[BioPython] EUtils and SNPs

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


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:


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

class ThinClient ....

    def efetch_using_dbids(self,
                           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.


Julio Bonis Sanz MD

More information about the BioPython mailing list