Question: Can I align two DNA sequences using BLAST from command line?
0
gravatar for sj93
9 months ago by
sj9310
sj9310 wrote:

I've created two custom databases using blastn from the command line in Ubuntu. Each database is a different genomic sequence of the same species. The output for these custom databases each contained 3 files, .nhr, .nin and .nsq. The NCBI BLAST help manual says the command for running blast is

blastn –db nt –query nt.fsa –out results.out

I've tried researching this and playing around with the above command by using the file names, locations, etc. that apply to the files I'm trying to blast, but I cannot figure out what the appropriate version of this command is for my task. Any tips? Thanks in advance. I'm an undergrad studying biology.

snp blast sequence genome ncbi • 525 views
ADD COMMENTlink modified 9 months ago by nsmi8446120 • written 9 months ago by sj9310

Previous reference for this : Aligning two DNA sequences with nBLAST

ADD REPLYlink written 9 months ago by genomax75k
1
gravatar for nsmi8446
9 months ago by
nsmi8446120
nsmi8446120 wrote:

I think you want to create one database from one of the genomic sequences you have and blast the other different genomic sequence against it?

If this is the case, you would create one database like you already have (let's say your two sequence files are called genomic.sequences.1.fasta and genomic.sequences.2.fasta). We will use the genomic.sequences.1.fasta to build the database:

makeblastdb -in genomic.sequences.1.fasta -parse_seqids -dbtype nucl

Next, you would compare the other genomic sequence file (genomic.sequences.2.fasta) to the database you created above with the following:

blastn -query  genomic.sequences.2.fasta -db genomic.sequences.1.fasta -task blastn -outfmt 7 -max_target_seqs 10 -evalue 0.5 -perc_identity 95 > blast.out

Hope this is what you are after.

ADD COMMENTlink modified 9 months ago by h.mon28k • written 9 months ago by nsmi8446120

This sounds like what I was going for. I'm going to try it out. Thank you!

ADD REPLYlink written 9 months ago by sj9310

The original files I had were in fasta format, but when I created databases from them the results were .nhr, .nin and .nsq file types. So which file type should I use when running the code you provided above? I've tried a few different options and keep getting errors.

ADD REPLYlink written 9 months ago by sj9310

You will need to use the original fasta format files to a) create the database b) as query in actual search with the index name of the blast database created in first step.

ADD REPLYlink written 9 months ago by genomax75k

Sorry, I'm a newb, but what is the "index name"? Is that the name of the file location containing the database files? Where do I include the other sequence that I did not make a database from?

ADD REPLYlink written 9 months ago by sj9310

Index name would be something you provide by using -title option or it will be the default name of the file you made the index from.

 -title <String>
   Title for BLAST database
   Default = input file name provided to -in argument

Where do I include the other sequence that I did not make a database from?

In -query directive in your blastn command line.

ADD REPLYlink modified 9 months ago • written 9 months ago by genomax75k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 756 users visited in the last hour