Change the awk call by $AwkCmd

Former-commit-id: c5642bbbe1c9c16139d36a4446e96fde120adce4
Former-commit-id: 68463a5c29dd90a48339d34d75efe830a32d1fe5
This commit is contained in:
2016-10-09 01:01:57 -03:00
parent 87453701b7
commit 970addd9df

View File

@ -61,7 +61,7 @@ function usage {
function fastaIterator() { function fastaIterator() {
awk '/^>/ {if (seq) printf("%s\f",seq); seq=""} \ $AwkCmd '/^>/ {if (seq) printf("%s\f",seq); seq=""} \
{if (seq) seq=seq"\n"; seq=seq $1} \ {if (seq) seq=seq"\n"; seq=seq $1} \
END {print seq}' "$1" END {print seq}' "$1"
} }
@ -119,7 +119,7 @@ pushTmpDir ORG.organnot
if [[ ! -z "${sequence}" ]] ; then if [[ ! -z "${sequence}" ]] ; then
echo "${sequence}" > toannotate.fasta echo "${sequence}" > toannotate.fasta
seqid=$(awk '(NR==1) {print substr($1,2,1000)}' toannotate.fasta) seqid=$($AwkCmd '(NR==1) {print substr($1,2,1000)}' toannotate.fasta)
case "$types" in case "$types" in
chloro) chloro)
@ -246,17 +246,20 @@ pushTmpDir ORG.organnot
loginfo "Done." loginfo "Done."
loginfo "Ordering annotations..." loginfo "Ordering annotations..."
awk '/^.....(misc|repeat|rRNA|tRNA|gene|source)/ { \ $AwkCmd '(entry && /^.....(misc|repeat|rRNA|tRNA|gene|source)/) { \
print pos,entry } \
/^.....(misc|repeat|rRNA|tRNA|gene|source)/ { \
match($3,"[0-9][0-9]*"); \ match($3,"[0-9][0-9]*"); \
pos=substr($3,RSTART,RLENGTH)*1000 + 1; \ pos=substr($3,RSTART,RLENGTH)*1000 + 1; \
print pos,$0; \ entry=$0; \
next} \ next} \
{ pos++; \ { entry=entry "@" $0} \
print pos,$0}' "${RESULTS}.annot" | \ END {print pos,entry}' "${RESULTS}.annot" | \
sort -nk1 |\ sort -nk1 |\
awk '{ \ $AwkCmd '{ \
match($0,"^[0-9]* ");\ match($0,"^[0-9]* ");\
line=substr($0,RLENGTH+1);\ line=substr($0,RLENGTH+1);\
gsub("@","\n",line); \
print line}' print line}'
loginfo "Done." loginfo "Done."
@ -267,7 +270,7 @@ pushTmpDir ORG.organnot
loginfo "Done." loginfo "Done."
loginfo "Computing statistics on nucleotide usage..." loginfo "Computing statistics on nucleotide usage..."
awk '! /^>/ { \ $AwkCmd '! /^>/ { \
seq=toupper($0); \ seq=toupper($0); \
gsub(" ","",seq); \ gsub(" ","",seq); \
lseq=length(seq); \ lseq=length(seq); \
@ -293,8 +296,8 @@ pushTmpDir ORG.organnot
loginfo "Done." loginfo "Done."
loginfo "Reformating sequences..." loginfo "Reformating sequences..."
lines=$(wc -l "${RESULTS}.norm.fasta" | awk '{print $1}') lines=$(wc -l "${RESULTS}.norm.fasta" | $AwkCmd '{print $1}')
awk -v lines=$lines ' \ $AwkCmd -v lines=$lines ' \
! /^>/ { \ ! /^>/ { \
seq=tolower($0); \ seq=tolower($0); \
gsub(" ","",seq); \ gsub(" ","",seq); \