[BioPython] Problems with NCBIDict and EUtils

Bonis Sanz, Julio JBonis at imim.es
Fri Nov 5 09:17:39 EST 2004


Hi!

I have been several hours turning around a problem and don't get the solution.

I want to retrieve a gene with its SNPs, as can be done with this URL:

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=10835174&retmode=html&rettype=gb&extrafeat=1

(take into account the last parameter: 'extrafeat=1')

Using NCBIDict, by default, the extrafeat=1 is not added so SNPs are not shown.

What I want is to add extrafeat=1 parameter to my NCBIDict['id'] calls.

Any idea? I am getting crazy!

Julio

-----Mensaje original-----
De: biopython-bounces at portal.open-bio.org
[mailto:biopython-bounces at portal.open-bio.org]En nombre de Ernesto
Enviado el: viernes, 05 de noviembre de 2004 13:24
Para: BioPython at biopython.org
Asunto: [BioPython] Node problem


Hi all,
I have a list of nodes such as:

Nodo1=Nodo("A",0.1,None,None,1)
Nodo2=Nodo("B",0.2,None,None,1)
Nodo3=Nodo("C",0.3,None,None,1)
Nodo4=Nodo("D",0.4,None,None,1)
Nodo6=Nodo("nodo6",0.2,Nodo1,Nodo2,0)
Nodo7=Nodo("nodo7",0.3,Nodo3,Nodo4,0)
Nodo8=Nodo("nodo8",0.1,Nodo6,Nodo7,0)
Nodo5=Nodo("E",0.5,None,None,1)
Nodo9=Nodo("Root",None,Nodo8,Nodo5,None).

where Nodo9 is the root. I would to substitute each node with its specific value starting from the root, in order to obtain a tree like the following:

Tree=Nodo(9,None,Nodo(8,0.01,Nodo(6,0.01,Nodo(1,0.01,None,None,1),Nodo(2,0.01,None,None,1),0),Nodo(7,0.01,Nodo(3,0.01,None,None,1),Nodo(4,0.01,None,None,1),0),0),Nodo(5,0.01,None,None,1),None)

Main difficulty is that the value of each node is an istance according to the following class:

class Nodo:
    '''definisci la struttura del nodo'''
    def __init__(self, contenuto, br=None, sinistra=None, destra=None, tip=None,seq=None):
        self.c = contenuto       #  node name
 self.b = br              # branch length
        self.s = sinistra         # left
        self.d = destra      # rigth
 self.t = tip         # is 1 for a tip or 0 for other nodes
 self.seq = seq



Could you suggest me how I could obtain Tree? I could use the recursion but I don't know.

Thank in advance for your help

Ernesto 



More information about the BioPython mailing list