Dear people
I have been trying to fetch some data from the web. For this I am using the
LWP:: Simple module.
The problem is that I have been trying to pass a value to the URL in get function.
here is my code:
use LWP:: Simple;
$iq= 'all_proteins.data';
$id= 'seq.txt';
open(INFILE,"$iq");
while(<INFILE>)
{
$line= $_;
$line=~tr/\n//d;
($tax_id,$geneID,$genesymbol,$gene_des,$proteinacc_ver,$mrna_acc,$length,$nucleotide_gi,$start_gene,$end_gene,$strand) = split('\t');
push(@protacc_arr,"$proteinacc_ver");
}
$arr_size = $#protacc_arr;
open(OUTFILE,">>$id");
for($i=0;$i<=$arr_size;$i++)
{
$content = get('http://www.ncbi.nlm.nih.gov/sviewer/viewer.fcgi?db=protein&sendto=t&dopt=fasta&list_uids=$protacc_arr[$i]');
$store = $content;
print OUTFILE"$store\n";
}
close(INFILE);
close(OUTFILE);
exit;
--------------------------------------------------------------------------
ok So the main problem that I am facing over here is that the value which is a ID ($protacc_arr[$i]) acquires some ids from my earlier code.
but I think when i am trying to pass it in the get function ..i am not able to.
I want to ask:
can we pass a value in a URL.
If yes , how do we do it...if not what is an alternative to do that in perl.
I am confused how to do it, as the code works fine i write a value such as NP_332.1 instead of passing it using an array.. but the problem is that I haver to do it for more than lakhs of ids ..so I really need to automate it..can sumbosy help..
I would be really grateful.
Thanks
Aj