-
Notifications
You must be signed in to change notification settings - Fork 1
/
sync_delete_with_mmcif.sh
executable file
·131 lines (89 loc) · 3.49 KB
/
sync_delete_with_mmcif.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
source ./scripts/env.sh
pdb_id_list=sync_mmcif_pdb_id_list
SRC_DIR=$MMCIF_VALID
src_file_ext=-validation-full.cif.gz
if [ -d $XML_VALID ] ; then
find $XML_VALID -maxdepth 1 -name '*.xml' | cut -d '/' -f 2 | cut -d '-' -f 1 > $pdb_id_list
while read pdb_id ; do
if [ ! -e $SRC_DIR/${pdb_id:1:2}/$pdb_id$src_file_ext ] ; then
echo deleting $XML_VALID/$pdb_id-validation-full.xml
rm -f $XML_VALID/$pdb_id-validation-full.xml
fi
done < $pdb_id_list
fi
if [ -d $RDF_VALID ] ; then
find $RDF_VALID -maxdepth 1 -name '*.rdf' | cut -d '/' -f 2 | cut -d '-' -f 1 > $pdb_id_list
while read pdb_id ; do
if [ ! -e $SRC_DIR/${pdb_id:1:2}/$pdb_id$src_file_ext ] ; then
echo deleting $RDF_VALID/$pdb_id-validation-full.rdf
rm -f $RDF_VALID/$pdb_id-validation-full.rdf
fi
done < $pdb_id_list
fi
if [ -d $XML_VALID ] ; then
find $XML_VALID -mindepth 2 -name '*.xml.gz' | cut -d '/' -f 3 | cut -d '-' -f 1 > $pdb_id_list
while read pdb_id ; do
if [ ! -e $SRC_DIR/${pdb_id:1:2}/$pdb_id$src_file_ext ] ; then
echo deleting $XML_VALID/${pdb_id:1:2}/$pdb_id-validation-full.xml.gz
rm -f $XML_VALID/${pdb_id:1:2}/$pdb_id-validation-full.xml.gz
fi
done < $pdb_id_list
fi
if [ -d $RDF_VALID ] ; then
find $RDF_VALID -mindepth 2 -name '*.rdf.gz' | cut -d '/' -f 3 | cut -d '-' -f 1 > $pdb_id_list
while read pdb_id ; do
if [ ! -e $SRC_DIR/${pdb_id:1:2}/$pdb_id$src_file_ext ] ; then
echo deleting $RDF_VALID/${pdb_id:1:2}/$pdb_id-validation-full.rdf.gz
rm -f $RDF_VALID/${pdb_id:1:2}/$pdb_id-validation-full.rdf.gz
fi
done < $pdb_id_list
fi
SRC_DIR=$MMCIF_VALID_ALT
src_file_ext=-validation-alt.cif.gz
if [ -d $VALID_INFO_ALT ] ; then
find $VALID_INFO_ALT -maxdepth 1 -name '*.xml' | cut -d '/' -f 2 | cut -d '-' -f 1 > $pdb_id_list
while read pdb_id ; do
if [ ! -e $SRC_DIR/${pdb_id:1:2}/$pdb_id$src_file_ext ] ; then
echo deleting $VALID_INFO_ALT/$pdb_id-validation-alt.xml
rm -f $VALID_INFO_ALT/$pdb_id-validation-alt.xml
fi
done < $pdb_id_list
fi
if [ -d $XML_VALID_ALT ] ; then
find $XML_VALID_ALT -maxdepth 1 -name '*.xml' | cut -d '/' -f 2 | cut -d '-' -f 1 > $pdb_id_list
while read pdb_id ; do
if [ ! -e $SRC_DIR/${pdb_id:1:2}/$pdb_id$src_file_ext ] ; then
echo deleting $XML_VALID_ALT/$pdb_id-validation-alt.xml
rm -f $XML_VALID_ALT/$pdb_id-validation-alt.xml
fi
done < $pdb_id_list
fi
if [ -d $RDF_VALID_ALT ] ; then
find $RDF_VALID_ALT -maxdepth 1 -name '*.rdf' | cut -d '/' -f 2 | cut -d '-' -f 1 > $pdb_id_list
while read pdb_id ; do
if [ ! -e $SRC_DIR/${pdb_id:1:2}/$pdb_id$src_file_ext ] ; then
echo deleting $RDF_VALID_ALT/$pdb_id-validation-alt.rdf
rm -f $RDF_VALID_ALT/$pdb_id-validation-alt.rdf
fi
done < $pdb_id_list
fi
if [ -d $XML_VALID_ALT ] ; then
find $XML_VALID_ALT -mindepth 2 -name '*.xml.gz' | cut -d '/' -f 3 | cut -d '-' -f 1 > $pdb_id_list
while read pdb_id ; do
if [ ! -e $SRC_DIR/${pdb_id:1:2}/$pdb_id$src_file_ext ] ; then
echo deleting $XML_VALID_ALT/${pdb_id:1:2}/$pdb_id-validation-alt.xml.gz
rm -f $XML_VALID_ALT/${pdb_id:1:2}/$pdb_id-validation-alt.xml.gz
fi
done < $pdb_id_list
fi
if [ -d $RDF_VALID_ALT ] ; then
find $RDF_VALID_ALT -mindepth 2 -name '*.rdf.gz' | cut -d '/' -f 3 | cut -d '-' -f 1 > $pdb_id_list
while read pdb_id ; do
if [ ! -e $SRC_DIR/${pdb_id:1:2}/$pdb_id$src_file_ext ] ; then
echo deleting $RDF_VALID_ALT/${pdb_id:1:2}/$pdb_id-validation-alt.rdf.gz
rm -f $RDF_VALID_ALT/${pdb_id:1:2}/$pdb_id-validation-alt.rdf.gz
fi
done < $pdb_id_list
fi
rm -f $pdb_id_list