[Bioperl-l] get Seq by Acc - needs a start and end (what format is needed??)
Wiepert, Mathieu
Wiepert.Mathieu@mayo.edu
Tue, 6 Aug 2002 08:20:52 -0500
Hi,
I am not sure what specific task you are trying to accomplish, is it remote fetching from genbank? http://www.bioperl.org/Core/bptutorial.html#III_1_1_Accessing_remote_databas has some good tips on how you might retrieve data from remote databases.
Otherwise, this script at least retrieved a sequence, I am sure you would want something that can use variable substitution for you sequences? Or did you want to retrieve sequences from a local db... Or there are many other scripts that are better than this in the archives somewhere, though I didn't search. I know I have seen plenty. Have you installed bioperl? I ran below with 1.0.1 (checked with 'perldoc -m Bio::Seq | grep VERSION'), it seemed to work.
#!/usr/bin/perl -w
#Test script to retrieve sequences from genbank and refseq.
use Bio::DB::GenPept;
use Bio::SeqIO;
use strict;
my $gb = new Bio::DB::GenPept(-retrievaltype => 'tempfile' ,
-format => 'Fasta');
$gb->request_format('fasta');
my $out = Bio::SeqIO->new('-file' => ">test.fa",
'-format' => 'FASTA'
);
my $seq = $gb->get_Seq_by_acc('AAF18306');
$out->write_seq($seq);
my $db = new Bio::DB::RefSeq;
$db->request_format('fasta');
$seq = $db->get_Seq_by_acc('NM_005252'); # RefSeq ACC
print "seq is ", $seq->seq, "\n";
-Mat
> -----Original Message-----
> From: Benjamin Breu [mailto:breu@proteosys.com]
> Sent: Tuesday, August 06, 2002 4:57 AM
> To: bioperl-l@bioperl.org
> Subject: [Bioperl-l] get Seq by Acc - needs a start and end
> (what format
> is needed??)
>
>
> Hi,
>
> I'm trying on Bioperl for a few days and would like to know
> what format is needed to get the module get_Seq_by_acc working
>
>
> Thx for helping
>
> Ben
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>