class SamRecordClipper extends AnyRef
Provides a suite of methods for clipping (soft- and hard-) bases from the beginnings and ends of reads in various ways. Cigar strings, bases, qualities and alignment positions are all correctly adjusted post-clipping.
Note that there are several "flavours" of method:
- Ones that work on the start and end of the read in whatever orientation the read is in, vs. working on the 5' or 3' end of the read
- Ones that attempt to clip an additional N bases beyond any clipping already provided (clip[Start|End|5PrimeEnd|3PrimeEnd]OfAlignment) and ones that attempt to make it so that the read has N bases clipped, including any existing clipping (clip[Start|End|5PrimeEnd|3PrimeEnd]OfRead)
- Alphabetic
- By Inheritance
- SamRecordClipper
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
SamRecordClipper(mode: ClippingMode, autoClipAttributes: Boolean)
- mode
how should clipping be performed (hard, soft, soft with masking)
- autoClipAttributes
if true attributes that are the same length as the bases and qualities be automatically clipped in the same way as the bases and qualities, otherwise attributes are not touched.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from SamRecordClipper to any2stringadd[SamRecordClipper] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (SamRecordClipper, B)
- Implicit
- This member is added by an implicit conversion from SamRecordClipper to ArrowAssoc[SamRecordClipper] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val autoClipAttributes: Boolean
-
def
cleanupClippedRecord(rec: SamRecord): Unit
Invalidates the set of tags that cannot be trusted if clipping is applied to a read.
Invalidates the set of tags that cannot be trusted if clipping is applied to a read.
- Attributes
- protected
-
def
clip3PrimeEndOfAlignment(rec: SamRecord, numberOfBasesToClip: Int): Int
Attempts to clip an additional numberOfBasesToClip from the 5' end of the read.
Attempts to clip an additional numberOfBasesToClip from the 5' end of the read. For details see com.fulcrumgenomics.bam.SamRecordClipper.clipStartOfAlignment and com.fulcrumgenomics.bam.SamRecordClipper.clipEndOfAlignment.
- rec
the record to be clipped
- numberOfBasesToClip
the number of additional bases to be clipped
- returns
the additional number bases clipped, not including bases already clipped
-
def
clip3PrimeEndOfRead(rec: SamRecord, numberOfBasesToClip: Int): Int
Ensures that there are at least clipLength bases clipped at the 3' end of the read, _including_ any existing soft and hard clipping.
Ensures that there are at least clipLength bases clipped at the 3' end of the read, _including_ any existing soft and hard clipping. Calculates any additional clipping and delegates to com.fulcrumgenomics.bam.SamRecordClipper.clipStartOfAlignment.
- rec
the record to be clipped
- numberOfBasesToClip
the number of additional bases to be clipped
- returns
the additional number bases clipped, not including bases already clipped
-
def
clip5PrimeEndOfAlignment(rec: SamRecord, numberOfBasesToClip: Int): Int
Attempts to clip an additional numberOfBasesToClip from the 5' end of the read.
Attempts to clip an additional numberOfBasesToClip from the 5' end of the read. For details see com.fulcrumgenomics.bam.SamRecordClipper.clipStartOfAlignment and com.fulcrumgenomics.bam.SamRecordClipper.clipEndOfAlignment.
- rec
the record to be clipped
- numberOfBasesToClip
the number of additional bases to be clipped
- returns
the additional number bases clipped, not including bases already clipped
-
def
clip5PrimeEndOfRead(rec: SamRecord, numberOfBasesToClip: Int): Int
Ensures that there are at least clipLength bases clipped at the 5' end of the read, _including_ any existing soft and hard clipping.
Ensures that there are at least clipLength bases clipped at the 5' end of the read, _including_ any existing soft and hard clipping. Calculates any additional clipping and delegates to [com.fulcrumgenomics.bam.SamRecordClipper.[clipStartOfAlignment]].
- rec
the record to be clipped
- numberOfBasesToClip
the number of additional bases to be clipped
- returns
the additional number bases clipped, not including bases already clipped
-
def
clipEndOfAlignment(rec: SamRecord, numberOfBasesToClip: Int): Int
Adds clipping of _at least_ numberOfBasesToClip to the end (right hand end) of an alignment.
Adds clipping of _at least_ numberOfBasesToClip to the end (right hand end) of an alignment. If clipping already exists at the end of the read it is preserved, and numberOfBasesToClip more clipping is added.
If is unmapped or the numberOfBasesToClip is < 1 nothing is done.
If the read has fewer clippable bases than requested clipping, the read is unmapped.
If hard-clipping is requested and the read has existing soft-clipping at the end it is converted to hard-clipping before adding further clipping.
If soft-clipping-with-masking is requested and the read already contains soft clipping at the end of the read, both the existing and new soft clipped bases are masked.
- rec
the record to be clipped
- numberOfBasesToClip
the number of additional bases to clip beyond any clipping already applied to the read
- returns
the additional number bases clipped, not including bases already clipped
-
def
clipEndOfRead(rec: SamRecord, clipLength: Int): Int
Ensures that there are at least clipLength bases clipped at the end (right-hand end) of the read, _including_ any existing soft and hard clipping.
Ensures that there are at least clipLength bases clipped at the end (right-hand end) of the read, _including_ any existing soft and hard clipping. Calculates any additional clipping and delegates to com.fulcrumgenomics.bam.SamRecordClipper.clipStartOfAlignment.
- rec
the record to be clipped
- clipLength
the total amount of clipping desired, including any existing clipping
- returns
the additional number bases clipped, not including bases already clipped
-
def
clipExtendedAttributes(rec: SamRecord, remove: Int, fromStart: Boolean): Unit
Clips extended attributes that are the same length as the bases were prior to clipping.
Clips extended attributes that are the same length as the bases were prior to clipping.
- Attributes
- protected
-
def
clipStartOfAlignment(rec: SamRecord, numberOfBasesToClip: Int): Int
Adds clipping of _at least_ numberOfBasesToClip to the start (left hand end) of an alignment.
Adds clipping of _at least_ numberOfBasesToClip to the start (left hand end) of an alignment. If clipping already exists at the start of the read it is preserved, and numberOfBasesToClip more clipping is added.
If is unmapped or the numberOfBasesToClip is < 1 nothing is done.
If the read has fewer clippable bases than requested clipping, the read is unmapped.
If hard-clipping is requested and the read has existing soft-clipping at the start it is converted to hard-clipping before adding further clipping.
If soft-clipping-with-masking is requested and the read already contains soft clipping at the start of the read, both the existing and new soft clipped bases are masked.
- rec
the record to be clipped
- numberOfBasesToClip
the number of additional bases to clip beyond any clipping already applied to the read
- returns
the additional number bases clipped, not including bases already clipped
-
def
clipStartOfRead(rec: SamRecord, clipLength: Int): Int
Ensures that there are at least clipLength bases clipped at the start (left-hand end) of the read, _including_ any existing soft and hard clipping.
Ensures that there are at least clipLength bases clipped at the start (left-hand end) of the read, _including_ any existing soft and hard clipping. Calculates any additional clipping and delegates to com.fulcrumgenomics.bam.SamRecordClipper.clipStartOfAlignment.
- rec
the record to be clipped
- clipLength
the total amount of clipping desired, including any existing clipping
- returns
the additional number bases clipped, not including bases already clipped
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
ensuring(cond: (SamRecordClipper) ⇒ Boolean, msg: ⇒ Any): SamRecordClipper
- Implicit
- This member is added by an implicit conversion from SamRecordClipper to Ensuring[SamRecordClipper] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (SamRecordClipper) ⇒ Boolean): SamRecordClipper
- Implicit
- This member is added by an implicit conversion from SamRecordClipper to Ensuring[SamRecordClipper] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): SamRecordClipper
- Implicit
- This member is added by an implicit conversion from SamRecordClipper to Ensuring[SamRecordClipper] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): SamRecordClipper
- Implicit
- This member is added by an implicit conversion from SamRecordClipper to Ensuring[SamRecordClipper] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from SamRecordClipper to StringFormat[SamRecordClipper] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val mode: ClippingMode
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
upgradeAllClipping(rec: SamRecord): (Int, Int)
Converts all clipping to the current mode.
Converts all clipping to the current mode. Can convert: 1. From ClippingMode.Soft to ClippingMode.SoftWithMask 2. From ClippingMode.Soft to ClippingMode.Hard 3. From ClippingMode.SoftWithMask to ClippingMode.Hard In all other cases, clipping remains the same.
Calculates any clipping required and delegates to com.fulcrumgenomics.bam.SamRecordClipper.clipStartOfRead and com.fulcrumgenomics.bam.SamRecordClipper.clipEndOfRead.
- rec
the record to be clipped
- returns
the number of bases converted at the start and end of the read respectively. For ClippingMode.SoftWithMask, any existing masked bases that would be converted will be counted.
-
def
upgradeClipping(rec: SamRecord, length: Int, fromStart: Boolean): Unit
Ensures sufficient masking or hard clipping exists on reads that may have soft-clipping.
Ensures sufficient masking or hard clipping exists on reads that may have soft-clipping. The read will only be altered if:
- ClippingMode is Hard or SoftWithMask
2. The read is already clipped at the appropriate end
3. Soft-clipping exist within the first
length
bases of the appropriate end
If all of those conditions are met, the soft-clipping will be upgraded to masking or hard clipping up until length bases are clipped or masked. E.g. if the incoming cigar is
10H10S80M
andlength
is 15, the resulting cigar will be15H5S80M
.- Attributes
- protected
- ClippingMode is Hard or SoftWithMask
2. The read is already clipped at the appropriate end
3. Soft-clipping exist within the first
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
→[B](y: B): (SamRecordClipper, B)
- Implicit
- This member is added by an implicit conversion from SamRecordClipper to ArrowAssoc[SamRecordClipper] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc