public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static String |
checkSequence(String sequence)
Checks if the sequence contains invalid characters.
|
static String |
checkSequence(String sequence,
Set<Character> cSet)
Checks if the sequence contains invalid characters.
|
static String |
cleanSequence(String sequence,
Set<Character> cSet)
Returns a new sequence with all invalid characters being replaced by '-'.
|
static boolean |
doesSequenceContainInvalidChar(String sequence,
Set<Character> cSet)
Checks if given sequence contains invalid characters.
|
static int |
getNumberOfInvalidChar(String sequence,
Set<Character> cSet,
boolean ignoreCase)
Return the number of invalid characters in sequence.
|
static double |
roundToDecimals(double d,
int c)
Returns a value with the desired number of decimal places.
|
public static final double roundToDecimals(double d, int c)
d
- value to roundc
- number of decimal places desired.
Must be greater or equal to zero, otherwise, the given value d would be returned without any modification.public static final boolean doesSequenceContainInvalidChar(String sequence, Set<Character> cSet)
sequence
- protein sequence to be check.cSet
- the set of characters that are deemed valid.public static final int getNumberOfInvalidChar(String sequence, Set<Character> cSet, boolean ignoreCase)
sequence
- protein sequence to count for invalid characters.cSet
- the set of characters that are deemed valid.ignoreCase
- indicates if cases should be ignoredpublic static final String cleanSequence(String sequence, Set<Character> cSet)
sequence
- protein sequence to be cleancSet
- user defined characters that are valid. Can be null. If null, then 20 standard protein amino acid codes will be considered as valid.public static final String checkSequence(String sequence)
sequence
- protein sequence to be check for invalid characters.public static final String checkSequence(String sequence, Set<Character> cSet)
sequence
- protein sequence to be check for invalid characters.cSet
- character set which define the valid characters.Copyright © 2000–2016 BioJava. All rights reserved.