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)
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SamRecordClipper
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. 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

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. 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
  4. 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()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val autoClipAttributes: Boolean
  8. 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
  9. 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

  10. 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

  11. 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

  12. 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

  13. 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

  14. 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

  15. 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
  16. 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

  17. 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

  18. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  19. 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
  20. 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
  21. 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
  22. 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
  23. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  25. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. 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()
  27. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. val mode: ClippingMode
  31. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. 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.

  37. 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:

    1. 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 and length is 15, the resulting cigar will be 15H5S80M.

    Attributes
    protected
  38. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  41. 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

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from SamRecordClipper to any2stringadd[SamRecordClipper]

Inherited by implicit conversion StringFormat from SamRecordClipper to StringFormat[SamRecordClipper]

Inherited by implicit conversion Ensuring from SamRecordClipper to Ensuring[SamRecordClipper]

Inherited by implicit conversion ArrowAssoc from SamRecordClipper to ArrowAssoc[SamRecordClipper]

Ungrouped