[Bioperl-l] get geneID for gene names
Hermann Norpois
hnorpois at googlemail.com
Wed May 2 21:00:56 UTC 2012
Thank you very much. But there still is a problem.
This is my output:
525211,210532,167498,142652
I get some ids (the first one is the UniSTS ID, the following ... I do not
know) but there is no gene ID. If you compare to the following link:
http://www.ncbi.nlm.nih.gov/genome/sts/sts.cgi?uid=525211 The gene ID
should be 54161<http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=Graphics&list_uids=54161>
.
This is my (your) script:
#!/bin/perl -w
use Bio::DB::EUtilities;
my $name = "Copg";
my $factory = Bio::DB::EUtilities->new(-eutil => 'esearch',
-db => 'unists',
-term => "$name AND Mus musculus
[ORGN]",
-email => 'hnorpois at mpipsykl.mpg.de',
);
print join(',',$factory->get_ids)."\n";
2012/5/2 Fields, Christopher J <cjfields at illinois.edu>
> Also, a small but very significant bug is in the below. Can you spot it?
>
> The '-term' value is in single quotes, these need to be double-quotes to
> interpolate $name. Otherwise, it is literally looking for '$name'.
>
> chris
>
> On May 2, 2012, at 12:55 PM, Christopher Fields wrote:
>
> > Hermann,
> >
> > The below works for me (note I'm using esearch, not efetch). To
> actually get the records you will use efetch and the IDs obtained below.
> >
> > chris
> >
> > ------------------------------
> > my $name = "Copg";
> > my $factory = Bio::DB::EUtilities->new(-eutil => 'esearch',
> > -db => 'unists',
> > -term => '$name AND mouse [ORGN]',
> > -email => '<EMAIL_HERE>',
> > );
> >
> > print join(',',$factory->get_ids)."\n";
> >
> >
> > On May 2, 2012, at 12:42 PM, Hermann Norpois wrote:
> >
> >> Hello,
> >>
> >> I wish to get gene IDs for gene names (e.g. bdnf, copg). I thought it
> was a
> >> good idea to use Bio::DB::EUtilities (see below) and addressed UNISTS as
> >> database because there it was quite easy to find the gene ID. So far I
> was
> >> unable to retrieve the gene ID from UNISTS. Could anybody give me a hint
> >> how to proceed? The cookbook ... Yes, I was trying.
> >>
> >> #!/bin/perl -w
> >>
> >> use Bio::DB::EUtilities;
> >>
> >> my $name = "Copg";
> >> my $factory = Bio::DB::EUtilities->new(-eutil => 'efetch',
> >> -db => 'unists',
> >> -term => '$name AND mouse
> [ORGN]',
> >> -email => '
> hnorpois at mpipsykl.mpg.de'
> >> )
> >>
> >>
> >> Thank you
> >> Hermann Norpois
> >> _______________________________________________
> >> Bioperl-l mailing list
> >> Bioperl-l at lists.open-bio.org
> >> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> >
>
>
More information about the Bioperl-l
mailing list