public class CigarUtil
extends java.lang.Object
Constructor and Description |
---|
CigarUtil() |
Modifier and Type | Method and Description |
---|---|
static Cigar |
addClippedBasesToEndsOfCigar(Cigar cigar,
boolean negativeStrand,
int threePrimeEnd,
int fivePrimeEnd,
CigarOperator clippingOperator)
Adds additional soft-clipped bases at the 3' and/or 5' end of the cigar.
|
static Cigar |
addSoftClippedBasesToEndsOfCigar(Cigar cigar,
boolean negativeStrand,
int threePrimeEnd,
int fivePrimeEnd)
Adds additional soft-clipped bases at the 3' and/or 5' end of the cigar.
|
static char[] |
cigarArrayFromElements(java.util.List<CigarElement> cigar) |
static char[] |
cigarArrayFromString(java.lang.String cigar) |
static java.lang.String |
cigarStringFromArray(char[] cigar) |
static void |
clip3PrimeEndOfRead(SAMRecord rec,
int clipFrom,
CigarOperator clippingOperator)
Adds a soft- or hard-clip, based on
clipFrom and clippingOperator , to the SAM record's existing cigar
and, for negative strands, also adjusts the SAM record's start position. |
static java.util.List<CigarElement> |
clipEndOfRead(int clipFrom,
java.util.List<CigarElement> oldCigar,
CigarOperator clippingOperator)
Adjust the cigar based on adapter clipping.
|
static void |
softClip3PrimeEndOfRead(SAMRecord rec,
int clipFrom)
Adjust the cigar of
rec based on adapter clipping using soft-clipping |
static java.util.List<CigarElement> |
softClipEndOfRead(int clipFrom,
java.util.List<CigarElement> oldCigar)
Adjust the cigar based on adapter clipping
|
public static java.util.List<CigarElement> clipEndOfRead(int clipFrom, java.util.List<CigarElement> oldCigar, CigarOperator clippingOperator)
clipFrom
- 1-based position where the clipping startsoldCigar
- The existing unclipped cigarclippingOperator
- Type of clipping to use, either soft or hard. If non-clipping operator is used an exception is thrownpublic static java.util.List<CigarElement> softClipEndOfRead(int clipFrom, java.util.List<CigarElement> oldCigar)
clipFrom
- 1-based position where the clipping startsoldCigar
- The existing unclipped cigarpublic static void softClip3PrimeEndOfRead(SAMRecord rec, int clipFrom)
rec
based on adapter clipping using soft-clippingclipFrom
- 1-based position where the soft-clipping startspublic static void clip3PrimeEndOfRead(SAMRecord rec, int clipFrom, CigarOperator clippingOperator)
clipFrom
and clippingOperator
, to the SAM record's existing cigar
and, for negative strands, also adjusts the SAM record's start position. If clipping changes the number of unclipped bases,
the the NM, MD, and UQ tags will be invalidated.
Clips the end of the read as the read came off the sequencer.rec
- SAMRecord to clipclipFrom
- Position to clip fromclippingOperator
- Type of clipping to use, either soft or hard. If non-clipping operator is used an exception is thrownpublic static Cigar addClippedBasesToEndsOfCigar(Cigar cigar, boolean negativeStrand, int threePrimeEnd, int fivePrimeEnd, CigarOperator clippingOperator)
cigar
- The cigar on which to base the new cigarnegativeStrand
- Whether the read is on the negative strandthreePrimeEnd
- number of soft-clipped bases to add to the 3' end of the readfivePrimeEnd
- number of soft-clipped bases to add to the 5' end of the readclippingOperator
- Type of clipping to use, either soft or hard. If non-clipping operator is used an exception is thrownpublic static Cigar addSoftClippedBasesToEndsOfCigar(Cigar cigar, boolean negativeStrand, int threePrimeEnd, int fivePrimeEnd)
cigar
- The cigar on which to base the new cigarnegativeStrand
- Whether the read is on the negative strandthreePrimeEnd
- number of soft-clipped bases to add to the 3' end of the readfivePrimeEnd
- number of soft-clipped bases to add to the 5' end of the readpublic static char[] cigarArrayFromElements(java.util.List<CigarElement> cigar)
public static char[] cigarArrayFromString(java.lang.String cigar)
public static java.lang.String cigarStringFromArray(char[] cigar)