fetch random id

11 views
Skip to first unread message

yvan

unread,
Nov 13, 2009, 10:02:00 AM11/13/09
to Group-4-Bioinformatics
Hello List,

I have to crash test a webservice so was wondering if any one knows a
way to get random sequence id from swissprot or genbank?
Thank for your help.

yvan

zeeann g

unread,
Nov 13, 2009, 4:14:38 PM11/13/09
to group4bioi...@googlegroups.com
Its hard to understand ur issue Mr. Yvan. Kindly elaborate it.
 
-GRV


--
Related website :  www.bioinformatics.fr

You received this message because you are subscribed to the Google Groups "group4bioinformatics" group.
To post to this group, send email to group4bioi...@googlegroups.com
To unsubscribe from this group, send email to group4bioinforma...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/group4bioinformatics

yvan

unread,
Nov 20, 2009, 3:42:18 AM11/20/09
to group4bioi...@googlegroups.com
zeeann g wrote:
> Its hard to understand ur issue Mr. Yvan. Kindly elaborate it.
>
> -GRV
>
> On Fri, Nov 13, 2009 at 8:32 PM, yvan <yvan....@gmail.com
> <mailto:yvan....@gmail.com>> wrote:
>
> Hello List,
>
> I have to crash test a webservice so was wondering if any one knows a
> way to get random sequence id from swissprot or genbank?
> Thank for your help.
>
> yvan
>
> --
> Related website : www.bioinformatics.fr
> <http://www.bioinformatics.fr/>
>
> You received this message because you are subscribed to the Google
> Groups "group4bioinformatics" group.
> To post to this group, send email to
> group4bioi...@googlegroups.com
> <mailto:group4bioi...@googlegroups.com>
> To unsubscribe from this group, send email to
> group4bioinforma...@googlegroups.com
> <mailto:group4bioinforma...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/group4bioinformatics
>
>
> --
> Related website : www.bioinformatics.fr
>
> You received this message because you are subscribed to the Google
> Groups "group4bioinformatics" group.
> To post to this group, send email to group4bioi...@googlegroups.com
> To unsubscribe from this group, send email to
> group4bioinforma...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/group4bioinformatics
Hello,

I am writing some tests to find weak points or exceptions for a
webservice and/or a web application. The application takes a sequence in
fasta format and apply some "magic" on it. In order to find situations
which could crash the services, I am sending hundreds sequences
completely randomly chosen to the application.
Brad and Peter from the biopython community gave me good pointers,
especially Brad who suggested to use the random entry retrieval URL from
expasy.

http://www.expasy.org/cgi-bin/get-random-entry.pl?S

So now the problem is solved ;-)

But thanks anyway for asking.
Cheers
yvan


Fred

unread,
Nov 20, 2009, 8:49:02 AM11/20/09
to Group-4-Bioinformatics
Hello Yvan,

I know my response is too late 5Sorry I was in vacation) but anyway
here is what would be my suggestion using php.
1) Downloading all the Uniprot ID. (Should be available at :
http://www.uniprot.org/downloads).
2) Put all the Uniprot ID on a php array called $arrUniprotId.
3) Use the php function array_rand (http://php.net/manual/en/
function.array-rand.php) to get randomly an id : $myRandomId =
array_rand ($arrUniprotId);
4) Then create a set od url using a loop.
for($i = 0; $i <= 100; $i++) {
$myRandomUrl = "http://www.uniprot.org/uniprot/" . $myRandomId ;
}

Hope this helps,

Fred

On Nov 20, 9:42 am, yvan <yvan.str...@gmail.com> wrote:
> zeeann g wrote:
> > Its hard to understand ur issue Mr. Yvan. Kindly elaborate it.
>
> > -GRV
>
> yvan- Hide quoted text -
>
> - Show quoted text -

Luis-Miguel Rodríguez Rojas

unread,
Nov 21, 2009, 11:03:46 PM11/21/09
to group4bioi...@googlegroups.com
Hi Yvan,

The GIs from GenBank are assigned consecutively [1], and therefore you can use any random numbers generator to pick a number between 2 (there is no gi:1) and the latest GI (currently 269784792).  To update the latest GI, you can use the Sequence Revision History [2], and try increasing your GI (the "first seen at NCBI" date is particularly useful for this end).

[1] http://www.ncbi.nlm.nih.gov/Sitemap/sequenceIDs.html
[2] http://www.ncbi.nlm.nih.gov/entrez/sutils/girevhist.cgi

Hope it's useful,

Regards,
--
Luis M. Rodriguez-R
[http://bioinf.uniandes.edu.co/~miguel/]
---------------------------------
Unidad de Bioinformática del Laboratorio de Micología y Fitopatología
Universidad de Los Andes, Colombia
[http://bioinf.uniandes.edu.co]

+ 57 1 3394949 ext 2619
luis...@uniandes.edu.co
lmrodr...@gmail.com

yvan

unread,
Nov 23, 2009, 6:22:55 AM11/23/09
to group4bioi...@googlegroups.com
Luis-Miguel Rodr�guez Rojas wrote:
> Hi Yvan,
>
> The GIs from GenBank are assigned consecutively [1], and therefore you
> can use any random numbers generator to pick a number between 2 (there
> is no gi:1) and the latest GI (currently 269784792). To update the
> latest GI, you can use the Sequence Revision History [2], and try
> increasing your GI (the "first seen at NCBI" date is particularly
> useful for this end).
>
> [1] http://www.ncbi.nlm.nih.gov/Sitemap/sequenceIDs.html
> [2] http://www.ncbi.nlm.nih.gov/entrez/sutils/girevhist.cgi
>
> Hope it's useful,
>
> Regards,
>
> On Fri, Nov 20, 2009 at 8:49 AM, Fred <frederi...@gmail.com
> <mailto:frederi...@gmail.com>> wrote:
>
> Hello Yvan,
>
> I know my response is too late 5Sorry I was in vacation) but anyway
> here is what would be my suggestion using php.
> 1) Downloading all the Uniprot ID. (Should be available at :
> http://www.uniprot.org/downloads).
> 2) Put all the Uniprot ID on a php array called $arrUniprotId.
> 3) Use the php function array_rand (http://php.net/manual/en/
> function.array-rand.php
> <http://php.net/manual/en/%0Afunction.array-rand.php>) to get
> randomly an id : $myRandomId =
> array_rand ($arrUniprotId);
> 4) Then create a set od url using a loop.
> for($i = 0; $i <= 100; $i++) {
> $myRandomUrl = "http://www.uniprot.org/uniprot/" . $myRandomId ;
> }
>
> Hope this helps,
>
> Fred
>
> On Nov 20, 9:42 am, yvan <yvan.str...@gmail.com
> <mailto:yvan.str...@gmail.com>> wrote:
> > zeeann g wrote:
> > > Its hard to understand ur issue Mr. Yvan. Kindly elaborate it.
> >
> > > -GRV
> >
> > > On Fri, Nov 13, 2009 at 8:32 PM, yvan <yvan.str...@gmail.com
> <mailto:yvan.str...@gmail.com>
> > > <mailto:yvan.str...@gmail.com <mailto:yvan.str...@gmail.com>>>
> wrote:
> >
> > > Hello List,
> >
> > > I have to crash test a webservice so was wondering if any
> one knows a
> > > way to get random sequence id from swissprot or genbank?
> > > Thank for your help.
> >
> > > yvan
> >
> > > --
> > > Related website : www.bioinformatics.fr
> <http://www.bioinformatics.fr>
> > > <http://www.bioinformatics.fr/>
> >
> > > You received this message because you are subscribed to
> the Google
> > > Groups "group4bioinformatics" group.
> > > To post to this group, send email to
> > > group4bioi...@googlegroups.com
> <mailto:group4bioi...@googlegroups.com>
> > > <mailto:group4bioi...@googlegroups.com
> <mailto:group4bioi...@googlegroups.com>>
> > > To unsubscribe from this group, send email to
> > > group4bioinforma...@googlegroups.com
> <mailto:group4bioinforma...@googlegroups.com>
> > > <mailto:group4bioinforma...@googlegroups.com
> <mailto:group4bioinforma...@googlegroups.com>>
> > > For more options, visit this group at
> > > http://groups.google.com/group/group4bioinformatics
> >
> > > --
> > > Related website :www.bioinformatics.fr
> <http://www.bioinformatics.fr>
> >
> > > You received this message because you are subscribed to the Google
> > > Groups "group4bioinformatics" group.
> > > To post to this group, send email to
> group4bioi...@googlegroups.com
> <mailto:group4bioi...@googlegroups.com>
> > > To unsubscribe from this group, send email to
> > > group4bioinforma...@googlegroups.com
> <mailto:group4bioinforma...@googlegroups.com>
> > > For more options, visit this group at
> > >http://groups.google.com/group/group4bioinformatics
> >
> > Hello,
> >
> > I am writing some tests to find weak points or exceptions for a
> > webservice and/or a web application. The application takes a
> sequence in
> > fasta format and apply some "magic" on it. In order to find
> situations
> > which could crash the services, I am sending hundreds sequences
> > completely randomly chosen to the application.
> > Brad and Peter from the biopython community gave me good pointers,
> > especially Brad who suggested to use the random entry retrieval
> URL from
> > expasy.
> >
> > http://www.expasy.org/cgi-bin/get-random-entry.pl?S
> >
> > So now the problem is solved ;-)
> >
> > But thanks anyway for asking.
> > Cheers
> > yvan- Hide quoted text -
> >
> > - Show quoted text -
>
> --
> Related website : www.bioinformatics.fr
> <http://www.bioinformatics.fr>
>
> You received this message because you are subscribed to the Google
> Groups "group4bioinformatics" group.
> To post to this group, send email to
> group4bioi...@googlegroups.com
> <mailto:group4bioi...@googlegroups.com>
> To unsubscribe from this group, send email to
> group4bioinforma...@googlegroups.com
> <mailto:group4bioinforma...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/group4bioinformatics
>
>
>
>
> --
> Luis M. Rodriguez-R
> [http://bioinf.uniandes.edu.co/~miguel/
> <http://bioinf.uniandes.edu.co/%7Emiguel/>]
> ---------------------------------
> Unidad de Bioinform�tica del Laboratorio de Micolog�a y Fitopatolog�a
> Universidad de Los Andes, Colombia
> [http://bioinf.uniandes.edu.co]
>
> + 57 1 3394949 ext 2619
> luis...@uniandes.edu.co <mailto:luis...@uniandes.edu.co>
> lmrodr...@gmail.com <mailto:lmrodr...@gmail.com>
> --
> Related website : www.bioinformatics.fr
>
> You received this message because you are subscribed to the Google
> Groups "group4bioinformatics" group.
> To post to this group, send email to group4bioi...@googlegroups.com
> To unsubscribe from this group, send email to
> group4bioinforma...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/group4bioinformatics
Hello,

What I am doing is:

1) fetch a random ID from expasy via this url
http://www.expasy.org/cgi-bin/get-random-entry.pl?S
2) fetch the records from this ID
3) manipulate the records in a way they are usable , for example switch
format, here swiss-prot to fasta

Maybe it is a little tedious, two fetches, but so I am sure I get a
existing, "real" protein. The code is completely dependant from expasy
and the consistency of the url's.
But it works ;-)

Thanks everyone for your help
Cheers,
yvan
Reply all
Reply to author
Forward
0 new messages