Opened 9 years ago

Closed 9 years ago

#806 closed request (fixed)

bam pileup

Reported by: Peter Owned by: Peter
Priority: major Milestone: yat 0.13
Component: omic Version: trunk
Keywords: Cc:

Description

I have a class that I think is mature enough to be included in yat. It takes a bam range provides interface to walk in to directions: 1) user can iterate along the genome position dimension, 2) for a given position iterate over reads that overlap with that position.

Similar functionality exists in libbam api, but iirc it uses void function pointers and similar, and there are three things I try to stay away from since they typically cause head ache: void pointers, perl, and terrorists.

Change History (9)

comment:1 Changed 9 years ago by Peter

Status: newassigned

comment:2 Changed 9 years ago by Peter

(In [3310]) a first version of new class Pileup. refs #806

comment:3 Changed 9 years ago by Peter

(In [3317]) refs #806 add test for Pileup class

comment:4 Changed 9 years ago by Peter

(In [3327]) redefine Pileup::const_iterator so it avoids reads that do not overlap current position. refs #806

comment:5 Changed 9 years ago by Peter

(In [3328]) avoid temporary variables; prefer initialization. refs #806

comment:6 Changed 9 years ago by Peter

(In [3332]) In Pileup store reads in a std::list (rather than std::deque) to allow easy erase as soon as we are one passed last base. Erasing reads immediately implies we don't need a filter_iterator, but can use list::const_iterator directly.

Fix a bug in Pileup::Entry, which held a BamRead? and CigarIterator? and the latter is essentially a uint32_t* that is returned from BamRead::cigar(). This caused problems in copy/assignment since the BamRead? was copied by value and the CigarIterator? didn't point to BamRead? in this class but to BamRead? in rhs. The problem was solved by replacing the BamRead? by a shared_ptr<BamRead?>.

refs #806

comment:7 Changed 9 years ago by Peter

(In [3333]) correct docs. refs #806

comment:8 Changed 9 years ago by Peter

(In [3334]) Avoid stopping at position one passed a pile, instead fast forward to next locus with coverage.

refs #806

comment:9 Changed 9 years ago by Peter

Resolution: fixed
Status: assignedclosed

(In [3335]) closes #806

Note: See TracTickets for help on using tickets.