derek [Sat, 11 Jun 2011 21:05:43 +0000 (17:05 -0400)]
Created 3 modes for ResolveTool: makeStats, markPairs, & twoPass
* "TwoPass" mode (the initial implementation of the tool) effectively
eliminates piped BAMs as an input option, since you can't exactly rewind
stdin and start reading from the beginning.
* To get around this, I separated the two passes into separate "modes"
(-makeStats & -markPairs), that communicate via a simple, human-readable
stats summary file. Data can then be merged, filtered, etc and piped
into each mode if you don't mind the runtime of preprocessing twice but
don't want to physically store the unresolved intermediate BAM file.
Brought API up to compliance with recent SAM Format Spec (v1.4-r962)
* Added support for new "binary array" tag type
* Added support for '=' and 'X' CIGAR ops
* Added support for multiple PG entries in header
* Added support for new RG fields
Major performance boost to startup & random-access - especially for the
use cases involving multiple (hundreds) of BAMs with BAI index files.
* This did require some changes to the BamIndex interface. I doubt man
y people are writing custom index format classes, but if you are one of
them and have any problems, feel free to contact me with questions.
derek [Fri, 24 Dec 2010 03:33:33 +0000 (22:33 -0500)]
Added SAM header-handling classes for read/write/validate.
* Not fully connected to the BamReader/Writer API yet, but will be
phased in soon.
* Will enable clients to query, modify & validate a BAM file's SAM
header data using the BamTools API, instead of having to use hand-rolled
string-parsing code on the result of BamReader::GetHeaderText().
derek [Fri, 24 Dec 2010 02:14:49 +0000 (21:14 -0500)]
Implemented proper -byname sorting (finally).
* BamMultiReader used to merge the "next" alignment based on (refID,
position). Extracted this and generalized to support merging on either
position OR alignment name.
derek [Wed, 15 Dec 2010 20:39:54 +0000 (15:39 -0500)]
Added creation of include/ folder in bamtools root directory at build time.
* API-related headers are copied here to provide an explicit target for client code.
derek [Mon, 13 Dec 2010 20:28:33 +0000 (15:28 -0500)]
Made BamAlignment flag queries symmetrical
* For example: there is now a SetIsMapped() setter to match the
IsMapped() getter. Before you had to reverse your logic on a few of the
flags (in this case, using SetIsUnmapped()). Not impossible to use, but
not immediately obvious and intuitive, and hard to remember when to use
the opposite setter. These older methods will remain available, but
should be considered deprecated.
derek [Mon, 6 Dec 2010 04:11:03 +0000 (23:11 -0500)]
Added new RevertTool to the toolkit
* "$ bamtools revert ... " will clear the IsDuplicate flag on
BamAlignments and replace the Qualities with the contents of the OQ tag.
* Suggested by and draft implementation contributed by Al Ward.
derek [Fri, 19 Nov 2010 17:41:54 +0000 (12:41 -0500)]
Extracted BamReaderPrivate & BamWriterPrivate from inner classes.
First step in breaking up the API's monolithic classes. Should allow easier maintenance, testing, and adding features as we go forward.
derek [Fri, 19 Nov 2010 15:32:45 +0000 (10:32 -0500)]
Migrated to CMake build system.
* Please see README: Installation for help in building BamTools toolkit & API and integrating the new shared library into your application
Derek [Thu, 21 Oct 2010 04:19:40 +0000 (00:19 -0400)]
Implemented index cache mode for both BAI & BTI formats
* Client code can now decide between 3 index cache modes:
Full : save entire index data in memory
Limited (default) : save only index data for current reference
None : save no index data - only load data necessary for a single-
* Required a major overhaul to BamIndex interface and derived classes.
Lots of refactoring to move common code up to BamIndex.
Derived classes now share much of the same method names &
organization. Only implementation details differ, as needed.
* Miscellaneous: moved BAMTOOLS_LFS definitions into BamAux.h & cleaned
up BGZF.h
Derek [Thu, 21 Oct 2010 04:19:40 +0000 (00:19 -0400)]
Implemented index cache mode for both BAI & BTI formats
* Client code can now decide between 3 index cache modes:
Full : save entire index data in memory
Limited (default) : save only index data for current reference
None : save no index data - only load data necessary for a single-
* Required a major overhaul to BamIndex interface and derived classes.
Lots of refactoring to move common code up to BamIndex.
Derived classes now share much of the same method names &
organization. Only implementation details differ, as needed.
* Miscellaneous: moved BAMTOOLS_LFS definitions into BamAux.h & cleaned
up BGZF.h
Derek [Sat, 9 Oct 2010 23:28:42 +0000 (19:28 -0400)]
Fixed: bug(s) related to empty references and regions.
* NOTE - This fix does introduce a slight modification to the *.bti index format.
So any existing BTI index files will need to be rebuilt to support the bug fix (apologies).
Implemented 'compound rule' logic in the FilterTool's script support.
* Previously the script was limited to doing 'OR' comparisons on various
property sets (what I call here filters). Now, by providing each filter
with an id, you can use these id's to define a compound rule.
* Documentation is severely lacking on this end at the moment, but I hope
to have a good explanation up soon. I think this interface could provide
a powerful flexibility in querying BAM files for very specific cases for
further analyses.
Added implementation of new SplitTool. This tool splits a single BAM file into multiple BAMs, based on a user-specified property. For now, properties supported are mapped/unmapped, paired/unpaired, split by reference, and split based on a given tag.
Moved BamAlignment data structure out to its own .h/.cpp. BamAux.h was getting over-crowded. *NOTE - This means that if you were using the BamAlignment data structure in code without a reader/writer, you need to include BamAlignment.h instead of BamAux.h. If your code was using reader/writer, no changes should be necessary on your end.
Fixed: bug related to accessing data (or regions with no alignments) near the ends of references, when using .bti index files. Required modifying the BamToolsIndex build step. *NOTE: This update invalidates any existing .bti files, please re-generate any that you have currently.* Versioning system in BTI will not allow users to use the older, buggy version... so no chance of accidental usage.
On second thought, moved the (non-indexing) constants back to BamAux.h, since they are not technically specific to BamWriter only and clients may be using them in their code
Added new PileupEngine to the toolkit. This is used by CoverageTool as well as ConvertTool for pileup format. Pileup conversion output before was buggy and overall incorrect. Now should match SAMtools output to the best of my knowledge