final case class NTBitArray(data: Array[Long], size: Int) extends Ordered[NTBitArray] with Product with Serializable
A bit-packed sequence of nucleotides, where each letter is represented by two bits. Some operations mutate this object, and others return a new object instead. A new copy can always be obtained with clone(). No operations can change the size of the contained sequence.
- data
the encoded data. Array of longs, each storing up to 32 nts, with optional padding at the end. The data is left-aligned inside the long, starting from MSB.
- size
the size of this data represented (in NTs)
- Alphabetic
- By Inheritance
- NTBitArray
- Serializable
- Serializable
- Product
- Equals
- Ordered
- Comparable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
NTBitArray(data: Array[Long], size: Int)
- data
the encoded data. Array of longs, each storing up to 32 nts, with optional padding at the end. The data is left-aligned inside the long, starting from MSB.
- size
the size of this data represented (in NTs)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
&=(other: NTBitArray): NTBitArray.this.type
Bitwise and of NT bit arrays.
Bitwise and of NT bit arrays. Applies the operation up to the shortest length of the two. Mutates this object to write the result.
-
def
<(that: NTBitArray): Boolean
- Definition Classes
- Ordered
-
def
<<=(bits: Int): NTBitArray.this.type
Bitwise left shift of NT bit arrays.
Bitwise left shift of NT bit arrays. Will not change the length of the array, so data will be lost. Mutates this object to write the result.
-
def
<=(that: NTBitArray): Boolean
- Definition Classes
- Ordered
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
>(that: NTBitArray): Boolean
- Definition Classes
- Ordered
-
def
>=(that: NTBitArray): Boolean
- Definition Classes
- Ordered
-
def
>>>=(bits: Int): NTBitArray.this.type
Bitwise unsigned right shift of NT bit arrays.
Bitwise unsigned right shift of NT bit arrays. Will not change the length of the array, so data will be lost. Mutates this object to write the result.
-
def
^=(other: NTBitArray): NTBitArray.this.type
Bitwise xor of NT bit arrays.
Bitwise xor of NT bit arrays. Applies the operation up to the shortest length of the two. Mutates this object to write the result.
-
def
apply(pos: Int): Byte
Obtain the (twobit) NT at a given position.
Obtain the (twobit) NT at a given position. Only the lowest two bits of the byte are valid. The others will be zeroed out.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
canonical: NTBitArray
Return a new object that is either equal to this array or to its reverse complement, and that has forward orientation.
- def clear(): Unit
-
def
clone(): NTBitArray
- Definition Classes
- NTBitArray → AnyRef
-
def
cloneWithLength(length: Int): NTBitArray
Clone this NTBitArray with a new length, adding an AAAA suffix or truncating as needed.
-
def
compare(other: NTBitArray): Int
Lexicographic comparison of two NT bit arrays.
Lexicographic comparison of two NT bit arrays. The arrays must have equal length.
- Definition Classes
- NTBitArray → Ordered
-
def
compareTo(that: NTBitArray): Int
- Definition Classes
- Ordered → Comparable
-
def
copySliceAsLongArray(writeTo: Array[Long], offset: Int, partSize: Int): Unit
Write a subsequence of this sequence to the provided long array.
Write a subsequence of this sequence to the provided long array.
- writeTo
destination to write to (at offset zero)
- offset
offset to read from (0-based)
- partSize
amount to write
- val data: Array[Long]
- def dataOrBlank(offset: Int): Long
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(obj: Any): Boolean
- Definition Classes
- NTBitArray → Equals → AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- NTBitArray → AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
kmersAsLongArrays(k: Int, orientation: Orientation = Unchanged): Iterator[Array[Long]]
Obtain all k-mers from this bit array as long arrays.
Obtain all k-mers from this bit array as long arrays.
- k
length of k-mers
- orientation
orientation filter for k-mers
- returns
All k-mers as an iterator
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
def
reverseComplement: NTBitArray
Return a new array that is the reverse complement of this array
-
def
shiftAddBP(add: Byte): NTBitArray.this.type
Shift this NT bit array one BP to the left, dropping one bp, and add one bp on the right, maintaining the same length.
Shift this NT bit array one BP to the left, dropping one bp, and add one bp on the right, maintaining the same length. Mutates in place.
- val size: Int
-
def
sliceAsCopy(sliceStart: Int, sliceLength: Int): NTBitArray
Construct a new NTBitArray from a subsequence of this one, copying data from this object.
-
def
sliceAsLongArray(offset: Int, sliceSize: Int): Array[Long]
Create a long array representing a subsequence of this sequence.
Create a long array representing a subsequence of this sequence.
- offset
0-based offset
- sliceSize
size
-
def
sliceIsForwardOrientation(pos: Int, sliceSize: Int): Boolean
Test the orientation of a slice of this buffer.
Test the orientation of a slice of this buffer.
- pos
Start position
- sliceSize
Length of slice (must be an odd number)
- returns
True iff this slice has forward orientation.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- def toBinaryString: String
-
def
toInt: Int
Represent this bit array as a right-aligned int.
Represent this bit array as a right-aligned int. Only well-defined if the value is small enough to fit in a positive integer (size <= 15). toInt and NTBitArray$.fromLong are inverses as long as this holds true.
-
def
toLong: Long
Represent this bit array as a right-aligned long.
Represent this bit array as a right-aligned long. Only well-defined if the value is small enough to fit in a positive long. (size <= 31). toLong and NTBitArray$.fromLong are inverses as long as this holds true.
-
def
toString(): String
- Definition Classes
- NTBitArray → AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
writeCanonical(buffer: NTBitArray): NTBitArray
Write either this array or its reverse complement (whichever has forward orientation) to the provided buffer.
Write either this array or its reverse complement (whichever has forward orientation) to the provided buffer. The buffer must have the same size as this array.
- buffer
The buffer to write the canonical form to
- returns
The buffer for chaining
-
def
writeKmersToBuilder(destination: KmerTableBuilder, k: Int, orientation: Orientation, provider: RowTagProvider = EmptyRowTagProvider): Unit
Write all k-mers from this bit array into a KmerTableBuilder.
Write all k-mers from this bit array into a KmerTableBuilder.
- destination
builder to write to
- k
k
- orientation
orientation filter for k-mers
- provider
function to generate extra (tag) data for the k-mer starting at each column (offset). By default, no extra data is generated.
-
def
writeReverseComplement(buffer: NTBitArray): NTBitArray
Write the reverse complement of this array to the provided buffer.
Write the reverse complement of this array to the provided buffer.
- buffer
The buffer to write the reverse complement to
- returns
The buffer for chaining
-
def
|=(other: NTBitArray): NTBitArray.this.type
Bitwise or of NT bit arrays.
Bitwise or of NT bit arrays. Applies the operation up to the shortest length of the two. Mutates this object to write the result.
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated