[Bioperl-l] Genbank file construction
Richard Adams
Richard.Adams at ed.ac.uk
Wed Jan 14 07:52:30 EST 2004
The easiest way would be to add the features and sequence to a BioSeq
object using the add_SeqFeature() method.
Assuming you're starting with say an array of Bio::PrimarySeq objects
parsed from a FASTA file, for example
e.g.,
for my $ps (@sequences) {
my $newobj = Bio::Seq->new();
$newobj->primary_seq($ps);
## now get features related to your sequence and put in @features
#...
#now add features onto sequence object
$newobj->add_SeqFeature(@features);
### now write data out in genbank /embl format or whatever
my $io = Bio::SeqIO->new (-file => ">out", -format => 'genbank');
$io->write_seq($newobj);
}
There is a good HOWTO about sequence features /annotations available now
as well.
HTH
Richard
--
Dr Richard Adams,
Psychiatric Genetics Group,
Medical Genetics,
Molecular Medicine Centre,
Western General Hospital,
Crewe Rd West,
Edinburgh UK
EH4 2XU
Tel: 44 131 651 1084
richard.adams at ed.ac.uk
More information about the Bioperl-l
mailing list