Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Selecting Random Sequence

by Sameet (Beadle)
on Apr 23, 2004 at 19:06 UTC ( [id://347713]=note: print w/replies, xml ) Need Help??


in reply to Re: Selecting Random Sequence
in thread Selecting Random Sequence

Actually i need some help with both the parts. the URL is

http://www.ncbi.nlm.nih.gov/mapview/seq_reg.cgi?org=human&chr=7&from=1&to=158545518&cntg=cntg

Where the chr= changes, frm, to and cntg also change.
besides generating a random number which will span entire length of human genome is also a task!

courtesy janitoring by ybiC: Made URL to be active link, by surrounding it with square brackets thusly [http://www...]

Replies are listed 'Best First'.
Re: Re: Re: Selecting Random Sequence
by thor (Priest) on Apr 25, 2004 at 16:42 UTC
    Okay...that's a start. First, let's cover the "random sequence" part. I'll make some assumptions here, as I don't really have a lot to go on. I'll assume that you have your data in a single string (I'll call it $super). So, in order to get a "random sequence", there are two elements of randomness that we have the ability to introduce: length and starting position. I'll try to incorporate both.
    my $start = int(rand(length($super))); my $length = int(rand(length($super) - $start)) + 1; my $substring = substr($super, $start, $length);
    Of course, you could make either $start or $length static by just assigning a value to them.
    Now, on the the fetching part. Once you have all of the appropriate values for the variable in your URL, fetching it is not so bad:
    use LWP::Simple; getstore($url, $localfile);
    If I can elaborate any further, let me know how and I'll do my best.

    thor

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://347713]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found