public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static String |
formatNumber(int number,
int digits)
Formats a given Number by adding zeros at the beginning.
|
static ArrayList<String> |
readFile(File file)
Reads a File and returns its content as a list of Strings.
|
static ArrayList<String> |
readFileFromPath(String path)
Finds a file at its paths, reads it in and returns its
content as a list of Strings.
|
static Map<Double,Integer[]> |
realValuesToRgbColors(Set<Double> scores,
double max,
double min)
Calculates a coloring scheme from dark green to yellow from given values.
|
static Map<Double,Integer[]> |
rgbColorsForAlignments(AlignmentPath[][] alignments)
Calculates a color scheme for all alignment scores (for form.html).
|
static Map<String,Map<Double,Integer[]>> |
rgbColorsForKeys(AlignmentPath[][] alignments)
Calculates a color scheme for all keys over all alignments.
|
static Map<Double,Integer[]> |
rgbColorsForOperations(ArrayList<Operation> operations)
Calculates a color scheme for all operation scores in an alignment.
|
static void |
writeFile(String path,
String content)
Writes the given text to a file.
|
public static String formatNumber(int number, int digits)
number
- Number to be formatted.digits
- Length the number shall have.public static ArrayList<String> readFileFromPath(String path)
path
- The file's absolut path.public static ArrayList<String> readFile(File file)
file
- The file.public static void writeFile(String path, String content)
path
- The file's absolut path.content
- The text, which should be written to the file.public static Map<String,Map<Double,Integer[]>> rgbColorsForKeys(AlignmentPath[][] alignments)
alignments
- All alignments that should be included.public static Map<Double,Integer[]> rgbColorsForAlignments(AlignmentPath[][] alignments)
alignments
- Alignment matrix, containing the scores.public static Map<Double,Integer[]> rgbColorsForOperations(ArrayList<Operation> operations)
operations
- Needed to retrieve the scores.public static Map<Double,Integer[]> realValuesToRgbColors(Set<Double> scores, double max, double min)
scores
- max
- Needed for normalization. Maximum value in scores.min
- Needed for normalization. Minimal value in scores.Copyright (C) 2013, 2014 Benjamin Paaßen, Charlie Krüger, Georg Zentgraf, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs