[Bioperl-l] questions

Roy Chaudhuri roy.chaudhuri at gmail.com
Mon Feb 8 06:09:29 EST 2010

Hi Jessica,

> Does any one knows how to add locations(CDS, Joins(600,140;...) to the new
> sequence object as feature,'

use Bio::SeqIO;
use Bio::Seq;
use Bio::Location::Split;
use Bio::Location::Simple;
use Bio::SeqFeature::Generic;
my $loc=Bio::Location::Split->new;
$loc->add_sub_Location(Bio::Location::Simple->new(-start=>4, -end=>6, 
$loc->add_sub_Location(Bio::Location::Simple->new(-start=>10, -end=>12, 
my $feat=Bio::SeqFeature::Generic->new(-primary_tag=>'misc_feat', 
my $out=Bio::SeqIO->new(-format=>'genbank';

> or if anyone knows how to keep the feature of truncated sequences object.

Look at the trunc_with_features method in Bio::SeqUtils:

use Bio::SeqUtils;
my $trunc=Bio::SeqUtils->trunc_with_features($seq, 2, 12);

Hope this helps.

More information about the Bioperl-l mailing list