object Bams extends LazyLogging
Utility methods for working with BAMs.
- Alphabetic
- By Inheritance
- Bams
- LazyLogging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
AlignmentTags: Seq[String]
Auxillary tags that should be cleared or re-calculated when unmapping or changing the alignment of a SamRecord.
-
val
MaxInMemory: Int
The default maximum # of records to keep and sort in memory.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
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] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
insertCoordinates(rec: SamRecord): (Int, Int)
Calculates the coordinates of the insert represented by this record and returns them as a pair of 1-based closed ended coordinates.
Calculates the coordinates of the insert represented by this record and returns them as a pair of 1-based closed ended coordinates.
Invalid to call on a read that is not mapped in a pair to the same chromosome as it's mate.
- returns
the start and end position of the insert as a tuple, always with start <= end
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
lazy val
logger: Logger
- Attributes
- protected
- Definition Classes
- LazyLogging
-
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()
-
def
positionFromOtherEndOfTemplate(rec: SamRecord, genomicPosition: Int): Option[Int]
If the read is mapped in an FR pair, returns the distance of the position from the other end of the template, other wise returns None.
If the read is mapped in an FR pair, returns the distance of the position from the other end of the template, other wise returns None.
- rec
the SamRecord whose insert to calculate the position within
- genomicPosition
the genomic position of interest (NOT the position within the read)
-
def
queryGroupedIterator(iterator: Iterator[SamRecord], header: SAMFileHeader, maxInMemory: Int, tmpDir: FgBioDef.DirPath): SelfClosingIterator[SamRecord]
Returns an iterator over the records in the given reader in such a way that all reads with the same query name are adjacent in the iterator.
Returns an iterator over the records in the given reader in such a way that all reads with the same query name are adjacent in the iterator. Does NOT guarantee a queryname sort, merely a query grouping.
- iterator
an iterator from which to consume records
- header
the header associated with the records.
- maxInMemory
the maximum number of records to keep and sort in memory if sorting is needed
- tmpDir
an optional temp directory to use for temporary sorting files if needed
- returns
an Iterator with reads from the same query grouped together
-
def
queryGroupedIterator(in: SamSource, maxInMemory: Int = MaxInMemory, tmpDir: FgBioDef.DirPath = Io.tmpDir): BetterBufferedIterator[SamRecord]
Returns an iterator over the records in the given reader in such a way that all reads with the same query name are adjacent in the iterator.
Returns an iterator over the records in the given reader in such a way that all reads with the same query name are adjacent in the iterator. Does NOT guarantee a queryname sort, merely a query grouping.
- in
a SamReader from which to consume records
- maxInMemory
the maximum number of records to keep and sort in memory if sorting is needed
- tmpDir
an optional temp directory to use for temporary sorting files if needed
- returns
an Iterator with reads from the same query grouped together
-
def
regenerateNmUqMdTags(rec: SamRecord, ref: ReferenceSequenceFileWalker): Unit
Ensures that any NM/UQ/MD tags on the read are accurate.
Ensures that any NM/UQ/MD tags on the read are accurate. If the read is unmapped, any existing values are removed. If the read is mapped all three tags will have values regenerated.
- rec
the SamRecord to update
- ref
a reference sequence file walker to pull the reference information from
-
def
sortByTag[A](iterator: Iterator[SamRecord], header: SAMFileHeader, maxInMemory: Int = MaxInMemory, tmpDir: FgBioDef.DirPath = Io.tmpDir, tag: String, defaultValue: Option[A] = None)(implicit ordering: Ordering[A]): Iterator[SamRecord]
Returns an iterator over the records in the given iterator such that the order of the records returned is determined by the value of the given SAM tag.
Returns an iterator over the records in the given iterator such that the order of the records returned is determined by the value of the given SAM tag.
- A
the type of the SAM tag
- iterator
an iterator from which to consume records
- header
the header to use for the sorted records
- maxInMemory
the maximum number of records to keep and sort in memory if sorting is needed
- tmpDir
the temporary directory to use when spilling to disk
- tag
the SAM tag (two-letter key) to sort by
- defaultValue
the default value, if any, otherwise require all records to have the SAM tag.
- ordering
the ordering of A.
- returns
an Iterator over records sorted by the given SAM tag.
-
def
sortByTransformedTag[A, B](iterator: Iterator[SamRecord], header: SAMFileHeader, maxInMemory: Int = MaxInMemory, tmpDir: FgBioDef.DirPath = Io.tmpDir, tag: String, defaultValue: Option[A] = None, transform: (A) ⇒ B)(implicit ordering: Ordering[B]): Iterator[SamRecord]
Returns an iterator over the records in the given iterator such that the order of the records returned is determined by the value of the given SAM tag, which can optionally be transformed.
Returns an iterator over the records in the given iterator such that the order of the records returned is determined by the value of the given SAM tag, which can optionally be transformed.
- A
the type of the SAM tag
- B
the type of the SAM tag after any transformation, or just A if no transform is given.
- iterator
an iterator from which to consume records
- header
the header to use for the sorted records
- maxInMemory
the maximum number of records to keep and sort in memory if sorting is needed
- tmpDir
the temporary directory to use when spilling to disk
- tag
the SAM tag (two-letter key) to sort by
- defaultValue
the default value, if any, otherwise require all records to have the SAM tag.
- transform
the transform to apply to the value of the SAM tags (default is the identity)
- ordering
the ordering of B.
- returns
an Iterator over records sorted by the given SAM tag, optionally transformed.
-
def
sorter(order: SamOrder, header: SAMFileHeader, maxRecordsInRam: Int = MaxInMemory, tmpDir: FgBioDef.DirPath = Io.tmpDir): Sorter[SamRecord, A]
Generates a com.fulcrumgenomics.util.Sorter for doing disk-backed sorting of objects.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
templateIterator(iterator: Iterator[SamRecord], header: SAMFileHeader, maxInMemory: Int, tmpDir: FgBioDef.DirPath): SelfClosingIterator[Template]
Returns an iterator of Template objects generated from all the reads in the SamReader.
Returns an iterator of Template objects generated from all the reads in the SamReader. If the SamReader is not query sorted or grouped, a sort to queryname will be performed.
- iterator
an iterator from which to consume records
- header
the header associated with the records.
- maxInMemory
the maximum number of records to keep and sort in memory if sorting is needed
- tmpDir
an optional temp directory to use for temporary sorting files if needed
- returns
an Iterator of Template objects
-
def
templateIterator(in: SamSource, maxInMemory: Int = MaxInMemory, tmpDir: FgBioDef.DirPath = Io.tmpDir): SelfClosingIterator[Template]
Returns an iterator of Template objects generated from all the reads in the SamReader.
Returns an iterator of Template objects generated from all the reads in the SamReader. If the SamReader is not query sorted or grouped, a sort to queryname will be performed.
- in
a SamReader from which to consume records
- maxInMemory
the maximum number of records to keep and sort in memory if sorting is needed
- tmpDir
an optional temp directory to use for temporary sorting files if needed
- returns
an Iterator of Template objects
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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( ... )