This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Strand not working in biopython efetch

I noticed i can't get efetch to retrieve sequence on a reverse strand:

def fasta_from_chords(x): 
    import sys
    sys.path.append('/uge_mnt/home/tim_ivanov/pythonlibs/biopython-1.71')
    from Bio import Entrez, SeqIO
    Entrez.email = "user@email.com" 
    handle = Entrez.efetch(db="nucleotide",id=x[0],seq_start=x[1],seq_stop=x[2],strand=x[3],rettype="fasta")
    record = SeqIO.read(handle, "fasta")
    handle.close()
    return record

this is the function i've made, where x variable contans an array with: accession number, coordinate 1, coordinate 2, strand When i use it, the sequence returns on the straight strand only. Is there a way to fix it?


Moderator note: edited to remove authors email address

biopython efetch strand

1 answer

Can you confirm that you are passing 1 or 2 as strand argument instead of + and -? https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.EFetch

Strand of DNA to retrieve. Available values are "1" for the plus strand and "2" for the minus strand.

No i can't! Thank you - that did it, i was using 1, -1 instead

Hello tim.ivanov.92,

Don't forget to follow up on your threads.

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one if they work.

Upvote|Bookmark|Accept

Please do the same for your previous posts as well.

Log in to answer this question.