To do blastp iteratively using terminal script
I have one input file containing 200 fasta query sequence. I want to do standalone blast for each fasta sequence separately . I am expecting my outfile of blast should be named its corresponding query fasta header name. How to do it using linux terminal scripts? Can anyone help me
• 1,755 views
•
link
2 answers
(not tested)
linearize and loop
awk '/^>/ {printf("%s%s\n",(N>0?"\n":""),substr($0,2));N++;next;} {printf("%s",$0);} END {printf("\n");}' inputfasta | while read F; do echo ">$F" > tmp.fa ; read S ; echo $S | fold -w 60 >> tmp.fa ; blastn -db my.db -query tmp.fa > $F.blast ; rm tmp.fa; done
• 0 views
•
link
Log in to answer this question.