public final class SequencesUtils extends Object
| Constructor and Description |
|---|
SequencesUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
belongsToAlphabet(Alphabet<?> alphabet,
String string)
Check if a sequence contains letters only from specified alphabet.
|
static <S extends Seq<S>> |
concatenate(S... sequences)
Returns a concatenation of several sequences.
|
static NucleotideSequence |
convertBit2ArrayToNSequence(Bit2Array bar)
Used to read legacy file formats.
|
static Bit2Array |
convertNSequenceToBit2Array(NucleotideSequence seq)
Used to write legacy file formats.
|
static <S extends Sequence<S>> |
mismatchCount(S seq0,
int seq0Offset,
S seq1,
int seq1Offset,
int length)
Calculates number of mismatches (comparing position by position) between two regions of one or two different
sequences.
|
static Set<Alphabet<?>> |
possibleAlphabets(String string)
Returns a set of possible alphabets for a given string.
|
static <S extends Sequence<S>> |
wildcardsToRandomBasic(S sequence,
long seed)
Converts sequence with wildcards to a sequence without wildcards by converting wildcard letters to uniformly
distributed letters from the set of letters allowed by the wildcard.
|
public static boolean belongsToAlphabet(Alphabet<?> alphabet, String string)
alphabet - alphabetstring - string to checkpublic static Set<Alphabet<?>> possibleAlphabets(String string)
Looks for alphabets registered in Alphabets.
string - target string (sequence)public static <S extends Sequence<S>> int mismatchCount(S seq0, int seq0Offset, S seq1, int seq1Offset, int length)
S - type of sequenceseq0 - first sequenceseq0Offset - first letter of second region in first sequenceseq1 - second sequence (may be the same as seq0seq1Offset - first letter of second region in second sequencelength - length of both regionsIllegalArgumentException - if one of regions is outside of target sequencepublic static <S extends Seq<S>> S concatenate(S... sequences)
S - type of sequencessequences - array of sequencespublic static <S extends Sequence<S>> S wildcardsToRandomBasic(S sequence, long seed)
Wildcard.getUniformlyDistributedBasicCode(long).
Returns same result for the same combination of sequence and seed.
S - type of sequencesequence - sequence to convertseed - seed for random generatorpublic static Bit2Array convertNSequenceToBit2Array(NucleotideSequence seq)
public static NucleotideSequence convertBit2ArrayToNSequence(Bit2Array bar)
Copyright © 2018. All rights reserved.