Previous topic

bioa.io.sam.reads_from_sam_quick

Next topic

Utilities

This Page

bioa.io.sam.reads_from_sam

reads_from_sam(sam_file, reference)[source]

Parse aligned reads from SAM/BAM file.

Parameters :

sam_file : pysam.SamFile

The SAM/BAM file object.

reference : Bio.Seq

The reference sequence used for alignment.

Returns :

align_start, align_stop, reads, ref : (int, int, list, Bio.Seq)

The alignment start, alignment stop, list of reads (str, int), and extended reference. Each (str, int) pair represents the read and its starting position.