Index: tests/regression/Selection/Atoms/AtomById/post/empty.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/empty.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/empty.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,2 @@
+0
+	Created by molecuilder for unselect-atom-by-id test
Index: tests/regression/Selection/Atoms/AtomById/post/id0_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id0_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id0_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/AtomById/post/id0_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id0_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id0_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	0	0	0
Index: tests/regression/Selection/Atoms/AtomById/post/id1_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id1_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id1_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/AtomById/post/id1_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id1_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id1_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	0	0	1
Index: tests/regression/Selection/Atoms/AtomById/post/id2_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id2_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id2_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/AtomById/post/id2_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id2_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id2_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	0	1	0
Index: tests/regression/Selection/Atoms/AtomById/post/id3_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id3_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id3_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/AtomById/post/id3_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id3_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id3_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	0	1	1
Index: tests/regression/Selection/Atoms/AtomById/post/id4_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id4_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id4_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/AtomById/post/id4_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id4_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id4_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	1	0	0
Index: tests/regression/Selection/Atoms/AtomById/post/id5_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id5_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id5_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/AtomById/post/id5_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id5_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id5_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	1	0	1
Index: tests/regression/Selection/Atoms/AtomById/post/id6_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id6_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id6_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	1
Index: tests/regression/Selection/Atoms/AtomById/post/id6_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id6_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id6_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	1	1	0
Index: tests/regression/Selection/Atoms/AtomById/post/id7_missing.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id7_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id7_missing.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,9 @@
+7
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
Index: tests/regression/Selection/Atoms/AtomById/post/id7_present.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/post/id7_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/post/id7_present.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,3 @@
+1
+	Created by molecuilder for unselect-atom-by-id
+H	1	1	1
Index: tests/regression/Selection/Atoms/AtomById/pre/test.xyz
===================================================================
--- tests/regression/Selection/Atoms/AtomById/pre/test.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/pre/test.xyz	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,10 @@
+8
+	Created by molecuilder for select-atom-by-id
+H	0	0	0
+H	0	0	1
+H	0	1	0
+H	0	1	1
+H	1	0	0
+H	1	0	1
+H	1	1	0
+H	1	1	1
Index: tests/regression/Selection/Atoms/AtomById/testsuite-selection-atom-by-id.at
===================================================================
--- tests/regression/Selection/Atoms/AtomById/testsuite-selection-atom-by-id.at	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
+++ tests/regression/Selection/Atoms/AtomById/testsuite-selection-atom-by-id.at	(revision b9bfa63421aae8bda04dea61800ff9fe25d337b5)
@@ -0,0 +1,45 @@
+### 6. (un)select atom by id
+
+AT_SETUP([Selection - atom with specific id])
+AT_KEYWORDS([selection,id,atom])
+# go through all possible ids (0-7) and removed
+i=0
+while test $i -lt 8; do
+  file=id${i}_missing.xyz
+  # normal
+  AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/pre/test.xyz $file])
+  AT_CHECK([../../molecuilder -i $file -v 3 --select-atom-by-id ${i} -r], [], [ignore], [ignore])
+  AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/post/$file])
+  # normal
+  AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/pre/test.xyz $file])
+  AT_CHECK([../../molecuilder -i $file -v 3 --select-atom-by-id ${i} --undo -r], [], [ignore], [ignore])
+  AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/pre/test.xyz])
+  # redo
+  AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/pre/test.xyz $file])
+  AT_CHECK([../../molecuilder -i $file -v 3 --select-atom-by-id ${i} --undo --redo -r], [], [ignore], [ignore])
+  AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/post/$file])
+  ((i+=1))
+done
+AT_CLEANUP
+
+AT_SETUP([Unselection - atom with specific id])
+AT_KEYWORDS([selection,id,atom])
+# go through all possible ids (0-7) and remove others
+i=0
+while test $i -lt 8; do
+  file=id${i}_present.xyz
+  # normal
+  AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/pre/test.xyz $file])
+  AT_CHECK([../../molecuilder -i $file -v 3 --select-all-atoms --unselect-atom-by-id ${i} -r], [], [ignore], [ignore])
+  AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/post/$file])
+  # normal
+  AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/pre/test.xyz $file])
+  AT_CHECK([../../molecuilder -i $file -v 3 --select-all-atoms --unselect-atom-by-id ${i} --undo -r], [], [ignore], [ignore])
+  AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/post/empty.xyz])
+  # redo
+  AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/pre/test.xyz $file])
+  AT_CHECK([../../molecuilder -i $file -v 3 --select-all-atoms --unselect-atom-by-id ${i} --undo --redo -r], [], [ignore], [ignore])
+  AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomById/post/$file])
+  ((i+=1))
+done
+AT_CLEANUP
