in reply to Getting data from NCBI

Becky, NCBI switched over to a web service model years ago. Check out their eutils page for more info. If you do a lot of work with their data, I would recommend signing up on their mailing list.

For this particular query I think you would need to make an esearch request and then an efetch (but the folks at NCBI would now better):

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/search.fcgi?db=protein&te +rm=148261691&rettype=uilist&usehistory=y
and then using the info from esearch (basically WebEnv and query_key):
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=protein&We +bEnv=<xxx>&query_key=<yyy>&rettype=fasta&retmode=xml&sort=pub+date

-derby

Update: The NCBI folks may have a better way of *directly* pulling the data based on ids -- I only query pubmed and the app normally has to do a search first so this search/fetch approach always worked well for me.

Update: Well ... it looks like you can directly pull:

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=protein&id +=148261691&rettype=fasta
Like I said, I really like what the NCBI folks are doing.

Replies are listed 'Best First'.
Re^2: Getting data from NCBI
by jpearl (Scribe) on Apr 30, 2009 at 17:34 UTC
    I actually had a java program that did something very similar to this. It was very nice to just have the sequence as a string to read in, no parsing required! You can get the bare fasta formated sequence pretty easily if you use something like this:

    my $giNum = 148261691 my $seq = "http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=protei +n&qty=1&c_start=1&list_uids=" .$giNum ."&uids=&dopt=fasta&dispmax=5&sendto=t&from=begin&to=end";


    and then do something similar to what you're doing above.

    good luck!
Re^2: Getting data from NCBI
by Becky (Beadle) on Apr 30, 2009 at 12:49 UTC
    You're a star, thanks! I never knew about that stuff before but will use it from now on! Becky