[Bioperl-l] adding tags

Frank Schwach fs5 at sanger.ac.uk
Mon Jun 6 14:11:23 UTC 2011


Hi Jonas,

I have a module where I need to do the same but I re-cast the
Bio::DB::Align object into a Bio::SeqFeature::Lite before adding tags
simply because the Align object contained a lot of data that drained
memory and I didn't really need it. However, it should be possible to
add tags directly to a Bio::DB::Aign object as it it supposed to be
Bio::SeqFeatureI compatible, although it doesn't inherit from it.

Have you tried this:

$align->add_tag_value('key','value');

?

If that doesn't work then you may have to re-cast into a Bio::SeqFeature
object before adding tags.

Hope this helps,

Frank



On Mon, 2011-06-06 at 11:01 +0200, Jonas Zierer wrote:
> Hi everybody,
> 
> I have a bam file of aligned transcriptome reads and use bioperl
> (Bio::DB::Sam) to work with it.
> Now i wanted to ask if there is any possibility to add tags to
> alignments (=reads) in this File?
> 
> 
> I use 
> 	my $iterator     = $bam->features(-iterator => 1, -flags    => {M_UNMAPPED=>0});
> 	while (my $align = $iterator->next_seq) { 
>         	...
> 	}
> to loop through the aligned reads and I am searching for anthing like 
> 	$align->addTag(key=>value)
> 
> and i have one more question: is it possible to get the coverage of a
> segment using only the read start positions? (that means that each read
> is treated as it would have Length 1)
> 
> Thx
> bye
> 
> 
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l



-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 



More information about the Bioperl-l mailing list