Skip to content

Commit f0d089c

Browse files
committed
H1pdm09v2019 relaxes filtering of 6B while slightly increasing it for older clades.
1 parent 78626c4 commit f0d089c

File tree

5 files changed

+49
-21
lines changed

5 files changed

+49
-21
lines changed

LABEL_RES/scripts/creation/parseInfo.pl

100644100755
File mode changed.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-1.210 1700

LABEL_RES/training_data/H1pdm09v2019/release.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
H1pdm09v2019R1 (aka R4 by Ujwal) based on H1pdm09v2018R3, H1pdm09R2-v2017
22
Ujwal Bagal with Sam Shepard.
33

4+
5+
v2019R1x2 (2021-11-03, SSS)
6+
- Relaxed x-filter at base from -1.210 to -1.00
7+
- Added x-filter to c-otherwise at -1.210 while c-6B remains filtered by base (more specific)
8+
49
v2019R1
510
- Added a split for 6B.1 and 6B.1A
611

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-1.210 1700
1+
-1.0 1700

createLABELlevel.sh

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ function err_test() {
3535
fi
3636
}
3737

38+
function warn() {
39+
local t=$(date +"%Y-%m-%d %k:%M:%S")
40+
echo -e "[$t] $SELF WARNING :: $1" 1>&2
41+
return 1
42+
}
43+
44+
function die() {
45+
local t=$(date +"%Y-%m-%d %k:%M:%S")
46+
echo -e "[$t] $SELF ERROR :: $1" 1>&2
47+
exit 1
48+
}
49+
3850
function check_prgm() {
3951
if ( ! hash $1>dev/null );then
4052
echo "$SELF ERROR: Program '$1' not found, please check your PATH or install it."
@@ -164,29 +176,33 @@ fi
164176
banlist=$ppath/level_banlist.txt
165177
use_xrev=0
166178
if [ "$doHMM" -eq "1" ];then
167-
if [ -r $banlist ]; then
168-
$spath/fastaExtractor.pl -R -A $alvl_hmm_file $banlist > $alvl_file.tmp.fasta
169-
[ "$rmGAP" -eq "1" ] && $spath/removeGapColumns.pl $alvl_file.tmp.fasta
170-
$spath/partitionTaxa.pl $alvl_file.tmp.fasta $tpath
179+
if [ -r "$banlist" ]; then
180+
"$spath"/fastaExtractor.pl -R -A $alvl_hmm_file $banlist > $alvl_file.tmp.fasta \
181+
&& [ "$rmGAP" -eq "1" ] && $spath/removeGapColumns.pl $alvl_file.tmp.fasta \
182+
|| die "Extraction and/or gap removal failed."
183+
"$spath"/partitionTaxa.pl $alvl_file.tmp.fasta $tpath \
184+
|| die "Partioning by taxa failed."
171185
# rm $alvl_file.tmp.fasta
172186
else
173-
[ "$rmGAP" -eq "1" ] && $spath/removeGapColumns.pl $alvl_hmm_file
174-
$spath/partitionTaxa.pl $alvl_hmm_file $tpath
187+
[ "$rmGAP" -eq "1" ] && $spath/removeGapColumns.pl $alvl_hmm_file \
188+
&& "$spath"/partitionTaxa.pl $alvl_hmm_file $tpath \
189+
|| die "Gap removal and/or partitioning failed."
175190
fi
176191

177192
rm $tpath/*_hmm.mod 2> /dev/null
178193
size=$(grep '>' $alvl_file -c)
179-
if [ -r null.fasta ];then
180-
$modelfromalign null -alignfile $ppath/null.fasta -alphabet DNA 2> /dev/null
181-
rm $ppath/null.weightoutput
182-
mv $ppath/null.mod $tpath
194+
if [ -r "null.fasta" ];then
195+
$modelfromalign null -alignfile $ppath/null.fasta -alphabet DNA 2> /dev/null \
196+
&& rm $ppath/null.weightoutput \
197+
&& mv $ppath/null.mod $tpath \
198+
|| die "ModelfromAlign failed for custom null"
183199
echo "$SELF: using custom null model"
184200
else
185201
if [ -r "$tpath/null.mod" ];then
186-
rm $tpath/null.mod
202+
rm "$tpath"/null.mod
187203
fi
188204

189-
if [ -d $ppath/x-rev -o -d $mpath/x-rev ];then
205+
if [ -d "$ppath/x-rev" -o -d "$mpath/x-rev" ];then
190206
use_xrev=1
191207
[ ! -d $ppath/x-rev ] && mkdir $ppath/x-rev
192208
[ ! -d $mpath/x-rev ] && mkdir $mpath/x-rev
@@ -197,14 +213,20 @@ if [ "$doHMM" -eq "1" ];then
197213
fi
198214

199215
echo "$SELF: generating pHMMs"
200-
for f in $tpath/*fasta;do
201-
m=`basename $f .fasta`_hmm
202-
taxa=(${taxa[*]} $m)
203-
[ "$rmGAP" -eq "1" ] && $spath/removeGapColumns.pl $f
204-
$modelfromalign $m -alignfile $f -alphabet DNA 2> /dev/null
205-
rm $m.weightoutput
206-
mv $m.mod $tpath
207-
done
216+
if test -n "$(shopt -s nullglob;echo "$tpath"/*fasta)";then
217+
for f in $tpath/*fasta;do
218+
m=`basename $f .fasta`_hmm
219+
taxa=(${taxa[*]} $m)
220+
[ "$rmGAP" -eq "1" ] && $spath/removeGapColumns.pl $f
221+
$modelfromalign $m -alignfile $f -alphabet DNA 2> /dev/null \
222+
&& rm $m.weightoutput \
223+
&& mv $m.mod $tpath \
224+
|| die "ModelfromAlign failed for '$f'"
225+
done
226+
else
227+
ls "$tpath"
228+
die "A 'level.fasta' is expected but found the above."
229+
fi
208230

209231
if [ "$use_xrev" -eq "1" ];then
210232
echo "$SELF: generating reverse pHMMs"

0 commit comments

Comments
 (0)