This is a test version of Biostars. For the public version, visit https://www.biostars.org.
blast all sequences within a fasta file

Hi I am new to working with blast on a local database. I am using biopython in a canopy shell I would like to be able to blast all the sequences within a fasta file using NcbiblastnCommandline. currently it only gives results for the first sequence in the file. I have searched high and low for a solution it really should not be complicated

from Bio.Blast.Applications import NcbiblastnCommandline
blastn_cline = NcbiblastnCommandline(query="SLQuery.fasta", db="S1.db", evalue=0.001, outfmt=5, out="SLQuery_vs_S1.xml")

blastn_cline()

I have tried opening the fasta in read format and then blasting no luck

any help is appreciated..I am new to programming so very clear instructions would be preferred :) Thanks

blast sequence

Can you please post the output of head SLQuery.fasta?

sorry what do you need? I don't understand....total nube here. i have a few of these files i have created they are fasta format with between 5 and 40 NT sequences i sliced from a contig each sequence is about 40 NT long. all i want is for each sequence to be read and blasted against the database. it currently only reads the first sequence why i have no idea

Can you show us how you fasta looks like ? first few lines ( or seq names) of your fasta file.

Sorry what do you need? I don't understand....

If you are on a Mac or Linux box, type head SLQuery.fasta so we can see what your FASTA file looks like. Or you can just view the FASTA file in a text editor and paste the first few lines here.

Sorry thats what i thought you where asking for. It all seems to be correct form to me. Do I need to parse the file before blasting maybe?

>query100
ATGTGATTCCTGATGATAATAACGCTAAATGACGTTATCT

>query200
AGAAAGAACCAACAGGTATGTAAGTAGGAAATTCATACA

>query300
TCCGGCTATCSTCTCTTACCTGGTCATGGTCTATTTGCTG

>query400
ATCACCTTCACATTCTCCTTTGGTACGATCATGCTTATAC

Try taking out that blank line between the first and second lines and see if it does the first two sequences instead of only the first one. If that works then the empty line is probably the reason for your problem.

0 answers

No answers yet.

Log in to answer this question.