Package picard.util
Class ClippingUtility
java.lang.Object
picard.util.ClippingUtility
Utilities to clip the adapter sequence from a SAMRecord read
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
The default value used for the maximum error rate when matching read bases to clippable sequence.static final double
The default value used for the maximum error rate when matching paired end read bases to clippable sequence.static final int
The default value used for the minimum number of contiguous bases to match against.static final int
The default value used for the minimum number of contiguous bases to match against in a paired end readstatic final int
The value returned by methods returning int when no match is found. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AdapterPair
adapterTrimIlluminaPairedReads
(htsjdk.samtools.SAMRecord read1, htsjdk.samtools.SAMRecord read2, int minMatchBases, double maxErrorRate, AdapterPair... adapters) Invokes adapterTrimIlluminaRead with explicit parameters for a pair of reads.static String
adapterTrimIlluminaPairedReads
(htsjdk.samtools.SAMRecord read1, htsjdk.samtools.SAMRecord read2, AdapterPair adapters) Deprecated.Use the varargs version.static AdapterPair
adapterTrimIlluminaPairedReads
(htsjdk.samtools.SAMRecord read1, htsjdk.samtools.SAMRecord read2, AdapterPair... adapters) Invokes adapterTrimIlluminaPairedReads with default less stringent parameters for a pair of reads.static String
adapterTrimIlluminaPairedReads
(htsjdk.samtools.SAMRecord read1, htsjdk.samtools.SAMRecord read2, AdapterPair adapters, int minMatchBases, double maxErrorRate) Deprecated.Use the varargs version.static AdapterPair
adapterTrimIlluminaSingleRead
(htsjdk.samtools.SAMRecord read, int minMatchBases, double maxErrorRate, AdapterPair... adapters) Invokes adapterTrimIlluminRead with explicit matching thresholds for a single read.static void
adapterTrimIlluminaSingleRead
(htsjdk.samtools.SAMRecord read, AdapterPair adapter) Deprecated.Use the varargs version.static AdapterPair
adapterTrimIlluminaSingleRead
(htsjdk.samtools.SAMRecord read, AdapterPair... adapters) Invokes adapterTrimIlluminRead with default parameters for a single read.static void
adapterTrimIlluminaSingleRead
(htsjdk.samtools.SAMRecord read, AdapterPair adapter, int minMatchBases, double maxErrorRate) Deprecated.Use the varargs version.static htsjdk.samtools.util.Tuple<AdapterPair,
Integer> findAdapterPairAndIndexForSingleRead
(byte[] read, int minMatchBases, double maxErrorRate, int templateIndex, AdapterPair... adapters) Return the adapter to be trimmed from a read represented as an array of bytes[]static int
findIndexOfClipSequence
(byte[] read, byte[] adapterSequence, int minMatch, double maxErrorRate) Finds the first index of the adapterSequence sequence in the read sequence requiring at least minMatch bases of pairwise alignment with a maximum number of errors dictated by maxErrorRate.
-
Field Details
-
MIN_MATCH_BASES
public static final int MIN_MATCH_BASESThe default value used for the minimum number of contiguous bases to match against.- See Also:
-
MIN_MATCH_PE_BASES
public static final int MIN_MATCH_PE_BASESThe default value used for the minimum number of contiguous bases to match against in a paired end read- See Also:
-
MAX_ERROR_RATE
public static final double MAX_ERROR_RATEThe default value used for the maximum error rate when matching read bases to clippable sequence.- See Also:
-
MAX_PE_ERROR_RATE
public static final double MAX_PE_ERROR_RATEThe default value used for the maximum error rate when matching paired end read bases to clippable sequence.- See Also:
-
NO_MATCH
public static final int NO_MATCHThe value returned by methods returning int when no match is found.- See Also:
-
-
Constructor Details
-
ClippingUtility
public ClippingUtility()
-
-
Method Details
-
adapterTrimIlluminaSingleRead
@Deprecated public static void adapterTrimIlluminaSingleRead(htsjdk.samtools.SAMRecord read, AdapterPair adapter) Deprecated.Use the varargs version. This no longer returns a warning string.. -
adapterTrimIlluminaSingleRead
@Deprecated public static void adapterTrimIlluminaSingleRead(htsjdk.samtools.SAMRecord read, AdapterPair adapter, int minMatchBases, double maxErrorRate) Deprecated.Use the varargs version. This no longer returns a warning string.. -
adapterTrimIlluminaSingleRead
public static AdapterPair adapterTrimIlluminaSingleRead(htsjdk.samtools.SAMRecord read, AdapterPair... adapters) Invokes adapterTrimIlluminRead with default parameters for a single read. If the read is a negative strand, its bases will be reverse complemented Simpler, more common of two overloads. Accepts multiple adapters and tries them all until it finds the first one that matches.- Parameters:
read
- SAM/BAM read to trimadapters
- which adapters to try to use (indexed, paired_end, or single_end)- Returns:
- AdapterPair the AdapterPair matched, or null
-
adapterTrimIlluminaSingleRead
public static AdapterPair adapterTrimIlluminaSingleRead(htsjdk.samtools.SAMRecord read, int minMatchBases, double maxErrorRate, AdapterPair... adapters) Invokes adapterTrimIlluminRead with explicit matching thresholds for a single read. If the read is a negative strand, a copy of its bases will be reverse complemented. More general form of the two overloads. Accepts multiple adapters and tries them all until it finds the first one that matches.- Parameters:
read
- SAM/BAM read to trimminMatchBases
- minimum number of contiguous bases to match against in a readmaxErrorRate
- maximum error rate when matching read basesadapters
- which adapters to try (indexed, paired_end, or single_end)- Returns:
- AdapterPair the AdapterPair matched, or null
-
findAdapterPairAndIndexForSingleRead
public static htsjdk.samtools.util.Tuple<AdapterPair,Integer> findAdapterPairAndIndexForSingleRead(byte[] read, int minMatchBases, double maxErrorRate, int templateIndex, AdapterPair... adapters) Return the adapter to be trimmed from a read represented as an array of bytes[]- Parameters:
read
- The byte array of read dataminMatchBases
- The minimum number of base matches required for adapter matchingmaxErrorRate
- The maximum error rate allowed for adapter matchingtemplateIndex
- The paired index of the reads (1 or 2, 1 for single ended reads)adapters
- The set of adapters to search for- Returns:
- The adapter pair that matched the read and its index in the read or null
-
adapterTrimIlluminaPairedReads
@Deprecated public static String adapterTrimIlluminaPairedReads(htsjdk.samtools.SAMRecord read1, htsjdk.samtools.SAMRecord read2, AdapterPair adapters) Deprecated.Use the varargs version. This no longer returns a warning string.. -
adapterTrimIlluminaPairedReads
@Deprecated public static String adapterTrimIlluminaPairedReads(htsjdk.samtools.SAMRecord read1, htsjdk.samtools.SAMRecord read2, AdapterPair adapters, int minMatchBases, double maxErrorRate) Deprecated.Use the varargs version. This no longer returns a warning string.. -
adapterTrimIlluminaPairedReads
public static AdapterPair adapterTrimIlluminaPairedReads(htsjdk.samtools.SAMRecord read1, htsjdk.samtools.SAMRecord read2, AdapterPair... adapters) Invokes adapterTrimIlluminaPairedReads with default less stringent parameters for a pair of reads. If the read is a negative strand, its bases will be reverse complemented Simpler, more common of two overloads.- Parameters:
read1
- first read of the pairread2
- second read of the pairadapters
- which adapters to use (indexed, paired_end, or single_end, nextera), attempted in order- Returns:
- int number of bases trimmed
-
adapterTrimIlluminaPairedReads
public static AdapterPair adapterTrimIlluminaPairedReads(htsjdk.samtools.SAMRecord read1, htsjdk.samtools.SAMRecord read2, int minMatchBases, double maxErrorRate, AdapterPair... adapters) Invokes adapterTrimIlluminaRead with explicit parameters for a pair of reads. More general form of two overloads. Returns a warning string when the trim positions found differed for each read.- Parameters:
read1
- first read of the pair. If read1 is a negative strand, a copy of its bases will be reverse complemented.read2
- second read of the pair. If read2 is a negative strand, a copy of its bases will be reverse complementedminMatchBases
- minimum number of contiguous bases to match against in a readmaxErrorRate
- maximum error rate when matching read basesadapters
- which adapters to use (indexed, paired_end, or single_end, nextera), attempted in order- Returns:
- int number of bases trimmed
-
findIndexOfClipSequence
public static int findIndexOfClipSequence(byte[] read, byte[] adapterSequence, int minMatch, double maxErrorRate) Finds the first index of the adapterSequence sequence in the read sequence requiring at least minMatch bases of pairwise alignment with a maximum number of errors dictated by maxErrorRate.- Parameters:
read
-
-