[BioPython] EUtils and SNPs

Bonis Sanz, Julio JBonis at imim.es
Tue Nov 9 06:19:52 EST 2004


Hi, 

I posted this question some time ago, but get no answer... will send again (with a partial solution I found!)

I am trying to get all the variations (SNPs) from a given gene...

In old versions of biopython I used GenBank.NCBIDictionary(parser = GenBank.FeatureParser) ....

And I get the variations.

But now it doesnt work. The reason is that in EUtils (PubMed) now it is needed to add a parameter... "extrafeat=1" to get the SNPs (variations).....

The URL would be:

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

I have "fix" the problem touching the code in the script /EUtils/ThinClient.py

class ThinClient ....

    def efetch_using_dbids(self,
                           dbids,
                           retmode = None,
                           rettype = None,

                           # sequence only
                           seq_start = None,
                           seq_stop = None,
                           strand = None,
                           complexity = None,
                           ):

        id_string = _dbids_to_id_string(dbids)
        return self._get(program = "efetch.fcgi",
                         query = {"id": id_string,
                                  "db": dbids.db,
                                  "extrafeat": '1', #I HAVE ADDED THIS
                                  # "retmax": len(dbids.ids), # needed?
                                  "retmode": retmode,
                                  "rettype": rettype,
                                  "seq_start": seq_start,
                                  "seq_stop": seq_stop,
                                  "strand": strand,
                                  "complexity": complexity,
                                  })

So adding a parameter ("extrafeat": '1') in the self._get( query ) dictionary the efetch_using_dbids() function now fetch all the variations (SNPs included) from PubMed.

This fix is not the best one (I would like to integrate in the hole library so this extrafeat param could be set from NCBIDict calls, but works for me, as I always need the variations in my scripts).

Maybe te biopython developers team want to include this in someway for future releases.

Regards, 

Julio Bonis Sanz MD
http://www.juliobonis.com/portal/



More information about the BioPython mailing list