Including "no significant hits" in output of local blastn searches
2
0
Entering edit mode
12 months ago
newol210 • 0

This is my my blastn command that uses '/ordered.fasta' as a query and searched the nt database for matches:

blastn -query ./ordered.fasta -db nt -outfmt "6 qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore salltitles" -max_target_seqs 1 -num_threads 20 -evalue 1e-5 -out ./blast_searches/De_novo_edgeR_sig_DEGs.txt

The output file is good, but I'm wondering if anyone knows if there is a way to write out "no significant hits" (or similar) for sequences that didn't have a good match? These sequences could be important so I want them to be included in my final output file, so I can investigate them later using other databases.

Thanks in advance!

blastn • 747 views
ADD COMMENT
2
Entering edit mode
12 months ago
Mensur Dlakic ★ 27k

Sequence IDs not listed in the output file will not have significant hits, and BLAST is not meant to report them in tabular format. If you run this in pairwise mode, which is considerably more difficult to parse, sequences without any matches will have a "No significant matches" in the output.

This command will give you all the sequences that have matches:

awk '{print $1}' blast_searches/De_novo_edgeR_sig_DEGs.txt | sort -u > matches.txt

There is an explanation how to "subtract" these sequences from your original file, which should give you a FASTA file of sequences that didn't match anything.

ADD COMMENT
0
Entering edit mode

Thats a bummer. Thanks for your help though!

ADD REPLY
1
Entering edit mode
12 months ago

As Mensur Dlakic correclty points out, there is no direct way to do this .

However there is a quite neat workaround to achieve this. Besides the outformat 6 you can also go for the tabular outformat 7 (==tabular with comment lines) which is nearly identical to the 6 with the only difference that it includes a few header lines per search entry. If a query has no significant hits, you can spot this as header lines without any hits underneath it moreover one of the comment lines will indicate '0 hits found'. (the hit part itself is identical to the outformat 6)

It is not as neat as to see it nicely printed in the tabular fields but it is workable.

ADD COMMENT

Login before adding your answer.

Traffic: 3808 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6