Skip to content

Commit 370339b

Browse files
author
Vyacheslav Brover
committed
#3: min. complexity
1 parent 6d1a403 commit 370339b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

genetics/marker2qual.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
#!/bin/bash --noprofile
22
THIS=$( dirname $0 )
33
source $THIS/../bash_common.sh
4-
if [ $# -ne 3 ]; then
4+
if [ $# -ne 4 ]; then
55
echo "Print a good quality subset of eukaryotic marker proteins created by tblastn2marker_euk.sh"
66
echo "#1: marker proteins (FASTA)"
77
echo "#2: min. score to length ratio"
8-
echo "#3: output uniKernel file | ''"
8+
echo "#3: min. complexity"
9+
echo "#4: output uniKernel file | ''"
910
exit 1
1011
fi
1112
M=$1
1213
T=$2
13-
UNI=$3
14+
COMPL=$3
15+
UNI=$4
1416

1517

1618
TMP=$( mktemp )
1719

1820

1921
grep '^>' $M | cut -f 1,7 -d ' '| sed 's/^>//1' | sed 's/ score=/\t/1' > $TMP.score
2022
$THIS/fasta2len $M > $TMP.len
21-
paste $TMP.len $TMP.score | awk -F '\t' '{OFS="\t"; print $1, $4/$2};' > $TMP.stat
23+
paste $TMP.len $TMP.score | awk -F '\t' '{OFS="\t"; print $1, $4 / $2};' > $TMP.stat
2224
if [ "$UNI" ]; then
2325
$THIS/../dm/conversion/cols2dm.sh $TMP.stat 0 5 1 > $TMP.dm
2426
$THIS/../dm/uniKernel $TMP "V2" -qc > $UNI
2527
fi
2628
awk '$2 > '$T $TMP.stat | cut -f 1 > $TMP.list
27-
$THIS/filterFasta $M -aa -target $TMP.list -len_min 20 -complexity_min 3
29+
$THIS/filterFasta $M -aa -target $TMP.list -len_min 20 -complexity_min $COMPL
2830

2931

3032
rm $TMP*

0 commit comments

Comments
 (0)