-
Notifications
You must be signed in to change notification settings - Fork 4
Cigar
The org.jcvi.jillion.sam.cigar package contains classes for working with CIGAR formatted read alignments.
The org.jcvi.jillion.sam.cigar.Cigar class is the main Jillion CIGAR class and an instance of Cigar represents a single read alignment.
Methods of Cigar Object:
Range getValidRange();
String toCigarString();
NucleotideSequence toGappedTrimmedSequence(NucleotideSequence rawUngappedSequence)
}getValidRange() return a Range of the region of the read that is not clipped.
toGappedTrimmedSequence() takes the original full length ungapped sequence such as the sequence from the input fastq file and returns a new NucleotideSequence object that is clipped and gapped according to the Cigar specification.
The Cigar.parse(String) is a factory method for parsing CIGAR formatted strings into a Jillion Cigar Object.
Cigar cigar1 = Cigar.parse("8M2I40M1D3M");
Cigar cigar2 = Cigar.parse("6H5M");Jillion also comes with a Builder class to programmatically construct Cigar objects using the Builder pattern:
//same as Cigar.pares("8M2I40M1D3M")
Cigar cigar = new Cigar.Builder()
.addElement(CigarOperation.ALIGNMENT_MATCH, 8)
.addElement(CigarOperation.INSERTION, 2)
.addElement(CigarOperation.ALIGNMENT_MATCH, 40)
.addElement(CigarOperation.DELETION, 1)
.addElement(CigarOperation.ALIGNMENT_MATCH, 3)
.build();