Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • automated remote blasting issue

    Hi everyone,

    I'm trying to remotely blast about 70 200-nt sequences using Biopython.
    I've been trying for hours to figure out why the following Python script won't work.
    I can get it to work for a read file that contains just one fasta using SeqIO.read, but when I try to switch to SeqIO.parse, I don't get anything in the .xml save file that I create.
    Any ideas?

    As a side note, if anyone knows the option syntax for excluding organisms from the results (as is possible when using the ncbi website, please let me know).

    Thanks very much for any help.

    Matt

    from Bio.Blast import NCBIWWW
    from Bio import SeqIO
    import tkinter.filedialog as tkfd
    in_file=tkfd.askopenfilename()
    record = SeqIO.parse(in_file, format="fasta")
    out_file = tkfd.asksaveasfilename()
    save_file = open(out_file, "w")
    for rec in record:
    ....print(rec)
    ....result_handle = NCBIWWW.qblast("blastn", "nt", rec.format("fasta"))
    ....save_file.write(result_handle.read())
    ....result_handle.close()
    else:
    ....save_file.close()

    This is the content of the in_file that I'm using as a test file (the line formatting of my file is set at 80 char, which might have been lost below):
    >165613
    TAACTGCAGTGTTTTGTGTCGAGCCTTTTTTGTGCCTTTTTTATAAAGGCATAACGTTATATTTAATTGAAGAGTTTGAT
    TCTGGCTCAGATTGAACGCTAGCGGCATGCTTAACACATGCAAGTCGAACGGCAGCGCGGGGAGCTTGCTCCCTGGCGGC
    GAGTGGCGGACGGGTGAGTAATGCGTAGGAATCTACCTTG
    >165875
    GGGATCTTCGGACCTCGTGCTATAAGATGAGCCTACGTCGGATTAGCTTGTTGGTGGGGTAATGGCCTACCAAGGCGACG
    ATCCGTAGCTGGTCTGAGAGGACGATCAGCCACACTGGGACTGAGACACGGCCCAGACTCCTACGGGAGGCAGCAGTGGG
    GAATATTGGACAATGGGGGAAACCCTGATCCAGCAATGCC
    Last edited by queueing; 04-29-2015, 06:12 AM. Reason: fixed indentation

  • #2
    Species restriction can be down with qblast setting entrez_query (or BLAST+ using -remote) and an Entrez [orgn] query, e.g. http://news.open-bio.org/news/2009/0...nfo-biopython/

    As to your script, try adding a bit more debugging, e.g.

    Code:
        data = result_handle.read()
        print("Got back: %r" % data)
        save_file.write(data)

    Comment

    Latest Articles

    Collapse

    • seqadmin
      Recent Advances in Sequencing Technologies
      by seqadmin







      Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.

      Long-Read Sequencing
      Long-read sequencing has...
      12-02-2024, 01:49 PM
    • seqadmin
      Genetic Variation in Immunogenetics and Antibody Diversity
      by seqadmin



      The field of immunogenetics explores how genetic variations influence immune responses and susceptibility to disease. In a recent SEQanswers webinar, Oscar Rodriguez, Ph.D., Postdoctoral Researcher at the University of Louisville, and Ruben Martínez Barricarte, Ph.D., Assistant Professor of Medicine at Vanderbilt University, shared recent advancements in immunogenetics. This article discusses their research on genetic variation in antibody loci, antibody production processes,...
      11-06-2024, 07:24 PM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by seqadmin, 12-02-2024, 09:29 AM
    0 responses
    144 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 12-02-2024, 09:06 AM
    0 responses
    51 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 12-02-2024, 08:03 AM
    0 responses
    41 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 11-22-2024, 07:36 AM
    0 responses
    70 views
    0 likes
    Last Post seqadmin  
    Working...
    X