File tree Expand file tree Collapse file tree 1 file changed +41
-3
lines changed
analysis/lintf2_ether/gmx Expand file tree Collapse file tree 1 file changed +41
-3
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,51 @@ gather() {
24
24
fi
25
25
}
26
26
27
+ gather_cmps () {
28
+ # Gather output of similar analyses scripts ordered by compounds
29
+ # into sub-directories.
30
+ local root=" ${1} "
31
+ local cmps=" ${2} "
32
+
33
+ # Create "root" directory.
34
+ if [[ -d ${root} ]]; then
35
+ echo " WARNING: Directory already exists: '${root} '"
36
+ return 0
37
+ else
38
+ mkdir " ${root} /" || exit
39
+ fi
40
+
41
+ # Move all "compound" directories to the root directory.
42
+ for cmp in ${cmps} ; do
43
+ if [[ -n $( find . -maxdepth 1 -type d -name " ${root} _${cmp} *_slurm-[0-9]*" -print -quit) ]]; then
44
+ mv " ${root} _${cmp} " * _slurm-[0-9]* / " ${root} /" || exit
45
+ fi
46
+ done
47
+
48
+ # Check if the root directory is empty.
49
+ if [[ -n $( find " ${root} /" -prune -empty) ]]; then
50
+ echo " WARNING: No directory matching pattern '${root} _<compound>*_slurm-[0-9]*'"
51
+ rm -r " ${root:? } /" || exit
52
+ return 0
53
+ fi
54
+
55
+ # Gather all compound analyses.
56
+ cd " ${root} /" || exit
57
+ for cmp in ${cmps} ; do
58
+ gather " ${root} _${cmp} "
59
+ done
60
+ cd ../ || exit
61
+ }
62
+
27
63
gather " density-z"
28
- gather " densmap-z"
29
64
gather " energy"
30
65
gather " make_ndx"
31
66
gather " msd"
32
67
gather " polystat"
33
68
gather " potential-z"
34
- gather " rdf_slab-z"
35
- gather " rdf"
36
69
gather " trjconv"
70
+
71
+ gather_cmps " densmap-z" " gra Li NBT OBT OE"
72
+
73
+ gather_cmps " rdf_slab-z" " Li-com NTf2-com ether-com Li NBT OE"
74
+ gather " rdf"
You can’t perform that action at this time.
0 commit comments