This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Using Blast Command Line to output unaligned FASTA

I am attempting to search for a set of homologs using BLAST command line. I currently am using the command blastp -db swissprot -query [FASTA_FILE] -evalue 0.005 -out homologs.fasta.

However, I am ideally looking for BLAST to output all the FASTA sequences of the hits to my query sequence in unaligned form. Is there a modification I can make to support this?

blast fasta homologs

2 answers

You can do e.g. this:

blastp -db swissprot -query [FASTA_FILE] -evalue 0.005 -outfmt '6 sseqid sseq' \
    | awk 'BEGIN{FS="\t"; OFS="\n"}{gsub(/-/, "", $2); print ">"$1,$2}' \
    > homologs.fasta

Please, take a look at this post in SEQanswers:

http://seqanswers.com/forums/showthread.php?t=8805

They basically recommend the construction of a list of IDS for those sequences in the database that matched and than used the blastdbcmd program to extract them from the BLAST database.

Log in to answer this question.