From: Mark A. D. <dep...@br...> - 2009-10-30 11:04:03
|
Dear E.O., We are also interested in extending our toolkit to automatically liftover input data like SAM and GFF. Would you mind sharing your Java code with us? Best, Mark On Oct 29, 2009, at 7:04 PM, E.O. Stinson wrote: > Hello, > > I've been putting together a Java liftover tool for wiggle, GFF, and > SAM that works like the perl-based liftover tools for Wormbase. (Given > a directory of text files describing insertions/deletions, and a > starting and ending genome build number, do liftover of features in > the aforementioned file types.) > > At the bottom of this email are two patches, one is just a toString() > method for the Cigar class to aid in debugging and output of cigar > strings. The other is a fix to the test in SAMRecord for sequence > length/quality length equality. Without the patch, providing a > sequence but not a quality (e.g. quality = "*") would fail, as it > would count the quality length as 1, rather than ignoring it as > missing. This patch fixes it so that sequence length and quality > length are only compared if the quality is not "*". > > Regards, > > --E.O. Stinson > yos...@be... > > > Index: src/java/net/sf/samtools/Cigar.java > =================================================================== > --- src/java/net/sf/samtools/Cigar.java (revision 143) > +++ src/java/net/sf/samtools/Cigar.java (working copy) > @@ -193,4 +193,8 @@ > public int hashCode() { > return cigarElements != null ? cigarElements.hashCode() : 0; > } > + > + public String toString() { > + return TextCigarCodec.getSingleton().encode(this); > + } > } > Index: src/java/net/sf/samtools/SAMRecord.java > =================================================================== > --- src/java/net/sf/samtools/SAMRecord.java (revision 143) > +++ src/java/net/sf/samtools/SAMRecord.java (working copy) > @@ -1375,7 +1375,7 @@ > } > } > } > - if (this.getReadLength() != getBaseQualities().length) { > + if (this.getReadLength() != getBaseQualities().length && > getBaseQualities() != NULL_QUALS) { > if (ret == null) ret = new ArrayList<SAMValidationError> > (); > ret.add(new SAMValidationError > (SAMValidationError.Type.MISMATCH_READ_LENGTH_AND_QUALS_LENGTH, > "Read length does not match quals length", > getReadName())); > > > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart > your > developing skills, take BlackBerry mobile applications to market and > stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Samtools-devel mailing list > Sam...@li... > https://lists.sourceforge.net/lists/listinfo/samtools-devel Mark A. DePristo, Ph.D. Manager, Medical and Population Genetics Analysis Broad Institute of Harvard and MIT dep...@br... ma...@de... |