---
name: "Bio::Tradis::Parser::Bam"
section: "3pm"
platform: "linux"
package: "bio-tradis"
version: "1.4.5+dfsg2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Bio::Tradis::Parser::Bam"
---

# Bio::Tradis::Parser::Bam(3pm)

Very basic BAM parser. Limited functionality.

## NAME

Bio::Tradis::Parser::Bam - Very basic BAM parser. Limited functionality.

## VERSION

version 1.4.5

## SYNOPSIS

Parses BAM files and gives access to basic info in them.

```
   use Bio::Tradis::Parser::Bam;

   my $pipeline = Bio::Tradis::Parser::Bam->new(file => 'abc');
   $pipeline->read_info;
   $pipeline->next_read;
   $pipeline->seq_info;
   $pipeline->is_mapped;
   $pipeline->is_reverse;
```

\=seq\_info  Reads BAM header and returns a hash (keys are sequence ids, values are hash refs with keys as tags (like LN and M5))

\=next\_read  Moves \_currentread to the next entry in the BAM. Returns 0 if EOF.

\=read\_info  Returns info from \_currentread = hash reference with field name as key.  Standard fields are named as per the SAM format specification: 1 : QNAME 2 : FLAG 3 : RNAME 4 : POS 5 : MAPQ 6 : CIGAR 7 : RNEXT 8 : PNEXT 9 : TLEN 10 : SEQ 11 : QUAL Additional fields will use their tag names. Complete line is returned with key READ

\=is\_mapped  Parses the flag for the current read and determines if mapped. Returns 0 or 1.

\=is\_reverse  Parses the flag for the current read and determines if reverse  complemented. Returns 0 or 1.

## AUTHOR

Carla Cummins \<path-help@sanger.ac.uk\>

## COPYRIGHT AND LICENSE

This software is Copyright (c) 2013 by Wellcome Trust Sanger Institute.

This is free software, licensed under:

```
  The GNU General Public License, Version 3, June 2007
```
