object Sequences
Utility methods for working with DNA or RNA sequences
- Alphabetic
- By Inheritance
- Sequences
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
OffsetAndLength(offset: Int, length: Int) extends Product with Serializable
Class to store the zero-based offset and length of match for various properties of a sequence.
Class to store the zero-based offset and length of match for various properties of a sequence. For example, see longestHomopolymer and longestDinuc.
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
CommonNonAutosomalContigNames: Seq[String]
Common contig/chrom names for non-autosomal sequences in mammals.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
compatible(base1: Byte, base2: Byte): Boolean
Returns true if two bases are compatible.
Returns true if two bases are compatible. Compatibility is defined as having any overlap in the set of acceptable bases. E.g.:
compatible('T', 't') == true
compatible('T', 'U') == true
compatible('A', 'R') == true
compatible('M', 'S') == true
compatible('A', 'C') == false
compatible('M', 'K') == false
- base1
the first base to be compared
- base2
the second base to be compared
- returns
true if the bases share at least one concrete base in common, false otherwise
-
final
def
complement(b: Byte): Byte
Complements a single base.
Complements a single base.
U
andu
are always complemented toA
anda
respectively. IUPAC ambiguity codes are handled appropriately - they are complemented to the IUPAC code that represents the set of bases that can pair with the input IUPAC code.Any byte that is not a valid upper- or lower-case DNA base, RNA base or IUPAC code will cause an exception to be thrown.
- b
the base to be complemented
- returns
the complement of that base
- Annotations
- @inline()
-
def
complement(bs: Array[Byte]): Unit
Complements the bases in the array in place.
Complements the bases in the array in place. See complement() for how complementing is performed.
- bs
an array of bases as bytes to be complemented in place
-
def
complement(s: String): String
Returns the sequence that is the complement of the provided sequence.
-
def
countMismatches(s1: String, s2: String): Int
Counts the number of mismatches between two sequences of the same length.
-
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
gcContent(s: String): Double
Calculates GC content for a DNA sequence as a fraction (between 0 and 1).
Calculates GC content for a DNA sequence as a fraction (between 0 and 1).
- s
a DNA sequence
- returns
the fraction GC content for the given sequence, zero if the sequence is empty
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
homopolymers(s: String, minLength: Int): Int
Returns the number of homopolymers of a given minimum length within the sequence.
Returns the number of homopolymers of a given minimum length within the sequence.
- s
a DNA or RNA sequence
- minLength
the minimum length of homopolymer to count (must be greater than 0)
- returns
the number of homopolymers of length >= minLength in the sequence
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
iupacCode(bases: Iterable[Byte]): Byte
Returns the IUPAC code for the set of bases given.
-
def
longestDinuc(s: String): OffsetAndLength
Returns the offset (0-based) and length of the longest dinucleotide run in the sequence.
Returns the offset (0-based) and length of the longest dinucleotide run in the sequence. In the case that there are multiple dinucleotide runs of the same length, the earliest one is returned.
- s
a DNA or RNA sequence
- returns
the offset and length of the longest dinucleotide sequence
-
def
longestHomopolymer(s: String): OffsetAndLength
Returns the offset (0-based) and length of the longest homopolymer in the sequence.
Returns the offset (0-based) and length of the longest homopolymer in the sequence. In the case that there are multiple homopolymers of the same length, the earliest one is returned.
- s
a DNA or RNA sequence
- returns
the offset and length of the longest homopolymer
-
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
revcomp(bs: Array[Byte]): Unit
Reverse complements an array of bases in place.
Reverse complements an array of bases in place. See complement() for how bases are complemented.
-
def
revcomp(s: String): String
Reverse complements a string of bases.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
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( ... )