Jon
Jon

Reputation: 601

Running BLAST queries with BioPython

I would like to

  1. BLAST several sequences
  2. Retrieve the top 100 hits or so from each query
  3. Pool the downloaded sequences
  4. Remove duplicates

How I can do this in BioPython?

Upvotes: 1

Views: 8815

Answers (2)

Chirag Matkar
Chirag Matkar

Reputation: 91

 from Bio.Blast import NCBIWWW
    fasta_string = open("myfasta").read()
    result_handle = NCBIWWW.qblast("blastn", "nt", fasta_string)
    print result_handle.read()

Above myfasta is your custom seq file which is provided for internet BLAST

you can later play with result_handle using NCBIXML as you wish to (ie to get top 100,remove duplicates)

Upvotes: 7

david w
david w

Reputation: 51

Sure can - the tutorial explains how to run BLAST locally and with the NCBI and how to parse the results. I'll leave the actual implementation as an exercise for you!

Upvotes: 5

Related Questions