It's a bit hard to help you since you don't give details on what URLs are needed to fetch the parts of human genome, but I think LWP::Simple and LWP::UserAgent should help you with that. | [reply] |
using LWP::Simple and LWP::UserAgent, is fine, but the URL changes with each chromosme and the region of each chromosome!
Is there a way around
| [reply] |
| [reply] |
Which part are you having problems with: the "random number" part, or the "fetch it from the web" part? With a little more guidance, we should be able to help you.
| [reply] |
| [reply] [d/l] |
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.
| [reply] [d/l] [select] |