Package htsjdk.samtools.util
Class CigarUtil
- java.lang.Object
-
- htsjdk.samtools.util.CigarUtil
-
public class CigarUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description CigarUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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(List<CigarElement> cigar)
static char[]
cigarArrayFromString(String cigar)
static String
cigarStringFromArray(char[] cigar)
static void
softClip3PrimeEndOfRead(SAMRecord rec, int clipFrom)
Adds a soft-clip, based onclipFrom
, to the SAM record's existing cigar and, for negative strands, also adjusts the SAM record's start position.static List<CigarElement>
softClipEndOfRead(int clipFrom, List<CigarElement> oldCigar)
adjust the cigar based on adapter clipping.
-
-
-
Method Detail
-
softClipEndOfRead
public static List<CigarElement> softClipEndOfRead(int clipFrom, List<CigarElement> oldCigar)
adjust the cigar based on adapter clipping. TODO: If there is hard clipping at the end of the input CIGAR, it is lost. It should not be. *- Parameters:
clipFrom
- 1-based position where the clipping startsoldCigar
- The existing unclipped cigar- Returns:
- New adjusted list of cigar elements
-
softClip3PrimeEndOfRead
public static void softClip3PrimeEndOfRead(SAMRecord rec, int clipFrom)
Adds a soft-clip, based onclipFrom
, to the SAM record's existing cigar and, for negative strands, also adjusts the SAM record's start position. Soft clips the end of the read as the read came off the sequencer.
-
addSoftClippedBasesToEndsOfCigar
public 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. Does not change the existing cigar except to merge the newly added soft-clipped bases if the element at the end of the cigar being modified is also a soft-clip.- Parameters:
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 read
-
cigarArrayFromElements
public static char[] cigarArrayFromElements(List<CigarElement> cigar)
-
cigarArrayFromString
public static char[] cigarArrayFromString(String cigar)
-
cigarStringFromArray
public static String cigarStringFromArray(char[] cigar)
-
-