Can you use blastn only with one sequence from the database?
0
0
Entering edit mode
5.1 years ago
Char20773 • 0

Hello !

I'm quite new to common bioinformatics methods and am now trying to use blastn from command line in ubuntu. I'm trying to limit my output without changing the fasta-files, which I'm using as input.

Example code:

blastn -query genome.fna -db genes_bacteria.fna

I created a db, because I thought there would eventually be an option to refer to the genes in the db I would like to align my query with. Is there? Or is there any other possibility?

Thank you!

alignment blast • 1.1k views
ADD COMMENT
0
Entering edit mode

You can look at using the restrictive GI list options (take a look at the extensive blast documentation online), but it will require that you know the identifiers you want in advance and have these in a file.

ADD REPLY
0
Entering edit mode

Actually it's only one gene I'm looking for.. is it still necessary to create a gi list for that?

ADD REPLY
0
Entering edit mode

If you only want to compare 2 sequences to each other, and you know in advance which sequences, you're better of using the bl2seq mode . syntax is something like this:

blastn -query seq1 -subject seq2

this does imply you have both sequences, and only those, each in a (separate) fasta file

ADD REPLY
0
Entering edit mode

I think this is what OP was trying to avoid by not “changing the fasta files” (but I agree this is the obvious choice for how to do it ;) )

ADD REPLY
0
Entering edit mode

OK, yes, indeed, my bad .

In that specific case I think your approach will be the most sensible one jrj.healey

ADD REPLY
0
Entering edit mode

and on a side note: do not get confused about the use cases of blast. Blast is NOT an alignment tool, it's a search tool (==refer to it as the google for sequences) . If you want to create proper alignment there are far better options.

ADD REPLY
0
Entering edit mode

AFAIK, yes - if I'm remembering correctly, there is both a flag for identifiers to ignore, and to include, so you'd only have to provide the identifier you want to include to the respective flag. You will still need to make a file with that one entry in however (I think).

To be honest, though I realise you've said you want to avoid this, it would be much easier to manipulate your input files in the first place than to try and tease out just the information you want after the fact.

ADD REPLY

Login before adding your answer.

Traffic: 2156 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