[Bioperl-l] reading sam files

Peter Cock p.j.a.cock at googlemail.com
Wed Jun 15 09:03:05 UTC 2011


On Wed, Jun 15, 2011 at 9:50 AM, Jonas Zierer
<jonas.zierer at campus.lmu.de> wrote:
> Hi,
>
> the reason is, that i want do add tags to the sam file. as far as i know
> this is only possible in sam files and not in bam files. now i have to
> read the sam file analyze the read and add the tag. These tags are
> written to the sam file which can then be converted to bam.
> If i have to read a bam file with bioperl i have to convert the sam to
> bam, read it with bioperl, change the sam file and convert it again.
>
> my target was to avoid this second conversion, but i think that's the
> best solution.
> thx for your help!
> bye

Both SAM and BAM support plain text header text, e.g. @CO lines.
If you are looking for an efficient way to update this header in a BAM
file, try the samtools reheader command.

Peter



More information about the Bioperl-l mailing list