public class MotifUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PERIODICITY
The maximum periodicity that is used in
isRepetitive(String, int, int) . |
static int |
MIN_REPETITIVE_STRETCH_LENGTH
The length of a repetitive substring in
isRepetitive(String, int, int) . |
Constructor and Description |
---|
MotifUtils() |
Modifier and Type | Method and Description |
---|---|
static MotifList[] |
appendOnHamming(Motif[] motifs,
int maxHD,
boolean useEquivalence)
Performs a pairwise comparison on all the motifs and returns an array of MotifLists that are within maxHD of at least one other Motif.
|
static Motif[] |
cleanMotifArray(Motif[] motifs,
MotifComparator comp)
Returns an array of unique motifs, where the highest scoring of two equivalent motifs is kept.
|
private static int |
cleanMotifArray(Motif[] motifs,
Motif target,
MotifComparator comp,
int start,
int stop) |
static Motif[] |
combineOnHamming(Motif[] motifs,
int maxHD,
boolean useEquivalence)
Performs a pairwise comparison on all the motifs and returns an array of motifs that are the union of two motifs within maxHD of each
other.
|
static Motif[] |
enumerateMotifs(Alphabet alf,
Alphabet primaryAlf,
int length,
boolean includeRevComp)
Returns an alphabetically sorted array of all of the unique "primary alphabet" motifs of a given length.
|
static Motif[] |
enumerateMotifs(Alphabet alf,
Alphabet primaryAlf,
int length,
boolean includeRevComp,
int minNCount,
int maxNCount)
Returns an alphabetically sorted array of all of the bipartite versions (that have from minNCount to maxNCount N's in the middle) of
each of the unique "primary alphabet" motifs of a given length.
|
static Motif[] |
enumerateMotifs(int length,
boolean includeRevComp)
Calls
enumerateMotifs(Alphabet, Alphabet, int, boolean) using Alphabet.DEFAULT and Alphabet.DEFAULT_PRIMARY as default
alphabets. |
static Motif[] |
enumerateMotifs(int length,
boolean includeRevComp,
int minNCount,
int maxNCount)
Calls
enumerateMotifs(Alphabet, Alphabet, int, boolean, int, int) using Alphabet.DEFAULT and Alphabet.DEFAULT_PRIMARY as
default alphabets. |
static Motif[] |
filterByScore(Motif[] input,
double cutoff)
Returns only those motifs that have a score over the given cutoff.
|
static Motif[] |
getExtensionsOf(Alphabet primaryAlf,
Motif[] seed,
boolean side)
Returns an array of all of the motifs formed from adding a primary base to the specified side of a motif in seed; side should be set to
Motif.LEFT or Motif.RIGHT ; if seed is empty, then an empty array is returned. |
static int |
hammingDistance(Motif motif1,
Motif motif2,
boolean useEquivalence)
Computes the hamming distance between two motifs.
|
static int |
hammingDistance(java.lang.String s1,
java.lang.String s2,
boolean useEquivalence)
Computes the hamming distance between two strings.
|
static Motif[] |
hammingFilter(Motif[] motifs,
int maxHD,
boolean useEquivalence)
Performs a pairwise comparison on all the motifs and returns an array of motifs that are within maxHD of at least one other Motif.
|
static boolean |
hasRepetitiveInstantiation(Motif m)
Returns true if this motif has an instantiation that is all one base.
|
protected static java.lang.String |
intersectionOf(java.lang.String a,
java.lang.String b)
Returns the degenerate intersection of two sequences of the same length.
|
protected static boolean |
isDegenerateRepetitive(java.lang.String seq,
int maxPeriodicity)
Returns true if this degenerate motif is repetitive up to the given maxPeriodicity, where the maxPeriodicity is the maximum length of a
repeat.
|
protected static boolean |
isDegenerateRepetitivePeriod(java.lang.String seq,
int period)
Returns true if this degenerate motif is repetitive at the given period, where the period is the length of a repeat.
|
static boolean |
isRepetitive(Motif motif)
Calls
isRepetitive(String, int, int) in this motif's sequence using MAX_PERIODICITY and
MIN_REPETITIVE_STRETCH_LENGTH as defaults. |
static boolean |
isRepetitive(java.lang.String seq)
Calls
isRepetitive(String, int, int) in this sequence using MAX_PERIODICITY and
MIN_REPETITIVE_STRETCH_LENGTH as defaults. |
protected static boolean |
isRepetitive(java.lang.String seq,
int maxPeriodicity)
Returns true if this motif is repetitive up to the given maxPeriodicity, where the maxPeriodicity is the maximum length of a repeat.
|
protected static boolean |
isRepetitive(java.lang.String seq,
int maxPeriodicity,
int minRepStretchLength)
Returns true if any substring of seq of length minRepStretchLength evaluates to true when run on
isRepetitive(String, int) . |
static Motif[] |
removeRepetitiveDegenerateMotifs(Motif[] motifs)
Removes all repetitive degenerate sequences from this list.
|
private static Motif[] |
removeRepetitiveDegenerateMotifs(Motif[] motifs,
int stringency)
Removes all repetitive degenerate sequences from this list.
|
static Motif[] |
removeRepetitiveInstantiations(Motif[] motifs)
Returns a motif array that contains no motifs that contain repetitive instantiations.
|
static Motif[] |
removeRepetitiveMotifs(Motif[] motifs)
Removes all repetitive sequences from this list.
|
private static Motif[] |
removeRepetitiveMotifs(Motif[] motifs,
int stringency,
int maxRepLen)
Removes all repetitive sequences from this list.
|
private static int |
sameLengthHammingDistance(java.lang.String s1,
java.lang.String s2,
boolean useEquivalence)
Computes the hamming distance between two strings of the same length.
|
public static final int MAX_PERIODICITY
isRepetitive(String, int, int)
.public static final int MIN_REPETITIVE_STRETCH_LENGTH
isRepetitive(String, int, int)
.public static MotifList[] appendOnHamming(Motif[] motifs, int maxHD, boolean useEquivalence)
private static int cleanMotifArray(Motif[] motifs, Motif target, MotifComparator comp, int start, int stop)
public static Motif[] cleanMotifArray(Motif[] motifs, MotifComparator comp)
public static Motif[] combineOnHamming(Motif[] motifs, int maxHD, boolean useEquivalence)
public static Motif[] enumerateMotifs(Alphabet alf, Alphabet primaryAlf, int length, boolean includeRevComp)
public static Motif[] enumerateMotifs(Alphabet alf, Alphabet primaryAlf, int length, boolean includeRevComp, int minNCount, int maxNCount)
public static Motif[] enumerateMotifs(int length, boolean includeRevComp)
enumerateMotifs(Alphabet, Alphabet, int, boolean)
using Alphabet.DEFAULT and Alphabet.DEFAULT_PRIMARY as default
alphabets.public static Motif[] enumerateMotifs(int length, boolean includeRevComp, int minNCount, int maxNCount)
enumerateMotifs(Alphabet, Alphabet, int, boolean, int, int)
using Alphabet.DEFAULT and Alphabet.DEFAULT_PRIMARY as
default alphabets.public static Motif[] filterByScore(Motif[] input, double cutoff)
public static Motif[] getExtensionsOf(Alphabet primaryAlf, Motif[] seed, boolean side)
Motif.LEFT
or Motif.RIGHT
; if seed is empty, then an empty array is returned.public static int hammingDistance(Motif motif1, Motif motif2, boolean useEquivalence)
Alphabet.areEquivalent(char, char)
.public static int hammingDistance(java.lang.String s1, java.lang.String s2, boolean useEquivalence)
Alphabet.areEquivalent(char, char)
.public static Motif[] hammingFilter(Motif[] motifs, int maxHD, boolean useEquivalence)
public static boolean hasRepetitiveInstantiation(Motif m)
protected static java.lang.String intersectionOf(java.lang.String a, java.lang.String b)
protected static boolean isDegenerateRepetitive(java.lang.String seq, int maxPeriodicity)
protected static boolean isDegenerateRepetitivePeriod(java.lang.String seq, int period)
public static boolean isRepetitive(Motif motif)
isRepetitive(String, int, int)
in this motif's sequence using MAX_PERIODICITY
and
MIN_REPETITIVE_STRETCH_LENGTH
as defaults.public static boolean isRepetitive(java.lang.String seq)
isRepetitive(String, int, int)
in this sequence using MAX_PERIODICITY
and
MIN_REPETITIVE_STRETCH_LENGTH
as defaults.protected static boolean isRepetitive(java.lang.String seq, int maxPeriodicity)
protected static boolean isRepetitive(java.lang.String seq, int maxPeriodicity, int minRepStretchLength)
isRepetitive(String, int)
.public static Motif[] removeRepetitiveDegenerateMotifs(Motif[] motifs)
#isDegenerateRepetitive(Motif)
to determine if the motif is repetitive.private static Motif[] removeRepetitiveDegenerateMotifs(Motif[] motifs, int stringency)
#isDegenerateRepetitive(Motif)
to determine if the motif is repetitive.public static Motif[] removeRepetitiveInstantiations(Motif[] motifs)
hasRepetitiveInstantiation(Motif)
public static Motif[] removeRepetitiveMotifs(Motif[] motifs)
isRepetitive(Motif)
to
determine if the motif is repetitive.private static Motif[] removeRepetitiveMotifs(Motif[] motifs, int stringency, int maxRepLen)
#isRepetitive(Motif, int)
to
determine if the motif is repetitive.private static int sameLengthHammingDistance(java.lang.String s1, java.lang.String s2, boolean useEquivalence)
Alphabet.areEquivalent(char, char)
.