By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,373 Members | 1,984 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,373 IT Pros & Developers. It's quick & easy.

problem with get method

P: 89
Hi
I am using the following script to extract the data from NCBI database. I have a set of EST ids in a word document and I am extracting the data using the following code.

Expand|Select|Wrap|Line Numbers
  1. #!usr/bin/perl -w
  2. use LWP::Simple;
  3.  
  4. my $url = 'http://www.ncbi.nlm.nih.gov/sites/entrez?db=nucest&cmd=search&term=';
  5.  
  6. while(<>) {
  7.     chomp $_;
  8.     @v = split(/\t/,$_);
  9.     $id = $v[0]; #EST id
  10.     $myURL = $url.$id;
  11.     $record = get($myURL);
  12.     print $record;
  13.  
  14. }
  15.  
perl extract.pl estid.txt >> extracteddata.txt
I am able to exract the data using the above code. The problem is for example if I have 5 ids in estid.txt, then every time I run the above command the downloaded data differs and for example sometimes it downloads 5 set of data and sometimes 4 set of data... Why is it varying and what could be the problem and how to resolve it as I can not afford to miss any data. All ids are valid. Thanks.
Feb 24 '09 #1
Share this Question
Share on Google+
2 Replies


KevinADC
Expert 2.5K+
P: 4,059
We can not help with data retrieval problems. I suggest you switch to LWP::UserAgent and LWP::Debug:

use LWP::UserAgent;
use LWP::Debug qw(+);

And see if debug reports anything that might help you determine the problem. You will need to read the documentation for both modules. And in the future please reply to your threads when people help you with your question(s):

http://bytes.com/topic/perl/answers/864111-perl-regex

Might not be a problem with others but when I take the time to help someone I do expect that person to acknowledge the help I gave them, barring unforseen circumstances of course.
Feb 24 '09 #2

P: 89
Thanks for your suggestions Kevin.

Sorry Kevin as I didn't respond to your response for the thread you had mentioned and I take this opportunity to thank everyone in this forum which is of great help for us to learn new techniques everyday as a new self learner. As I got diverted into some other problem, it just slipped out of my mind and I will make sure that it doesnot happen next time. Thanks again for your time and help.
Regards
Feb 25 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.