[Bioperl-l] Are Bio::DB::Bam::Alignment objects read-only ?

Charles Plessy charles-listes+bioperl at plessy.org
Wed Nov 23 05:27:45 EST 2011

Dear BioPerl developers,

I am trying to process some unaligned paired-end reads with Bio::DB::Sam.  For
each pair, I want to detect a sequence index and a unique molecular identifier in
the linker, record them as auxiliary flags, and trim the linker from the read.

I collect the pairs through a features iterator, and can access all their data
through the high-level Bio::DB::Bam::Alignment API.  After modifying them
(linker trimming and adding flags), I want to write the resulting pairs as a
new unaligned BAM file.

I apologise if the solution is trivial, but my problem is that I do not manage to
modify the Bio::DB::Bam::Alignment objects.  Typically, attempts such as
“$pair[0]->qseq("GATACA")” give errors like
“Usage: Bio::DB::Bam::Alignment::qseq(b) at /usr/lib/perl5/Bio/DB/Bam/AlignWrapper.pm line 80”.

Since I did not find explanations or portsions of source code indicating how to
modify Bio::DB::Bam::Alignment objects, I wonder if they are read-only…

Have a nice day,

Charles Plessy
Tsurumi, Kanagawa, Japan

More information about the Bioperl-l mailing list