[Biopython] access Uniprot record by different ids

Sheila the angel from.d.putto at gmail.com
Thu Jul 12 11:06:58 UTC 2012


Thanks for reply.
Now I made two dictionary one for uniprot_sprot.dat and another for
secondary ids to primary ids.
However it take too long to do this and I can't do Pickle for my_dict.
I would like to know is it possible to dump my_dict (the uniprot.dat data)
to MySql database.
I looked at biopython-BioSQL page  but didn't understand much (I am new to
SQL)
Thanks

--
Sheila


On Tue, Jul 10, 2012 at 3:43 PM, Peter Cock <p.j.a.cock at googlemail.com>wrote:

> On Tue, Jul 10, 2012 at 2:16 PM, Sheila the angel
> <from.d.putto at gmail.com> wrote:
> > I have a Uniprot AC list in which some AC are primary and some are
> > secondary. The function
> > my_dict = SeqIO.index("uniprot_sprot.dat", "swiss")
> > makes dictionary of  uniprot data but I can access a record only by
> primary
> > AC.
> > my_dict['P04637']  # gives the record
> > my_dict['Q15086'] # KeyError
> > my_dict['P53_HUMAN'] # KeyError
> >
> > Is it possible to access same record by both primary and secondary ACs
> > (and by uniprot ID) ?
>
> Not directly with Bio.SeqIO.index() or Bio.SeqIO.index_db(), no.
> You could perhaps use a second dictionary mapping aliases to
> the primary ID?
>
> Peter
>



More information about the Biopython mailing list