|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttools.Tools
public class Tools
Contains helper methods used throughout the whole library.
This class is not instantiatable.
Field Summary | |
---|---|
static String |
CLUSTERERSFILE
|
static String |
CONFIGFILE
|
static String |
CONFIGPATH
|
static Map<String,Object> |
EMPTY_ANNOTATION_MAP
An empty, immutable map of annotations, i.e. a String => Object map |
static Map<String,String> |
EMPTY_STRING_MAP
An empty, immutable String => String map |
static String |
FULL_LIB_NAME
Full program string assembled from libary name and version |
static String |
LIBRARY_NAME
Name of this library |
static int |
MINOVERLAP
Default minimum overlap required for two complexes to be mapped to each other |
static Random |
random
Globally used random number generator, uses a Mersenne twister |
static String |
VERSION
Current version of this library |
Method Summary | |
---|---|
static String |
extractBaseFilename(String fullPath)
Extract the base file name (without extension) from a full path |
static String |
extractFilename(String fullPath)
Extracts the file name from a full path |
static int |
findMax(Collection<Integer> col)
Returns the maximum of a given integer collection. |
static org.jfree.chart.JFreeChart |
generateHistogram(String title,
double[] data,
boolean relative,
int bins)
Generates a histogram chart from a given dataset. |
static String |
getTempFilename()
Returns an unused temporary file name. |
static boolean |
isGZIPed(String file)
Determines whether a file contains a GZIP header |
static Comparable |
max(Comparable first,
Comparable second)
Returns the maximum of two Comparable objects |
static Comparable |
min(Comparable first,
Comparable second)
Returns the minimum of two Comparable objects |
static Map<String,Object> |
parseAnnotations(String parse)
Parse annotations from a string coming from a network or annotations file. |
static void |
verifyAnnotationType(Object value)
Checks whether a given object is an Integer , a Float or
a List . |
static void |
writeAnnotations(Map<String,Object> annotations,
PrintWriter writer)
Writes a given annotations set to a writer. |
static void |
writeChartToPNG(org.jfree.chart.JFreeChart chart,
File output,
int width,
int height)
Writes a given JFreeChart to a PNG file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MINOVERLAP
public static Random random
Mersenne twister
public static final Map<String,Object> EMPTY_ANNOTATION_MAP
public static final Map<String,String> EMPTY_STRING_MAP
public static final String LIBRARY_NAME
public static final String VERSION
public static final String FULL_LIB_NAME
public static final String CONFIGPATH
public static final String CONFIGFILE
public static final String CLUSTERERSFILE
Method Detail |
---|
public static String extractFilename(String fullPath)
fullPath
- full path
public static String extractBaseFilename(String fullPath)
fullPath
- full path
public static Comparable min(Comparable first, Comparable second)
Comparable
objects
first
- first objectsecond
- second object
public static Comparable max(Comparable first, Comparable second)
Comparable
objects
first
- first objectsecond
- second object
public static int findMax(Collection<Integer> col)
col
- integer collection
public static String getTempFilename()
public static boolean isGZIPed(String file)
file
- path to file
public static void verifyAnnotationType(Object value) throws ProCopeException
Integer
, a Float
or
a List
. Throws an exception if not.
value
- object whose type will be checked
ProCopeException
- if the object is not an Integer, Float
or Listpublic static org.jfree.chart.JFreeChart generateHistogram(String title, double[] data, boolean relative, int bins)
data
- dataset from which the histogram will be calculatedrelative
- show relative frequencies?bins
- number of bins
public static void writeChartToPNG(org.jfree.chart.JFreeChart chart, File output, int width, int height) throws IOException
chart
- the chart to be plotteoutput
- output filewidth
- width of the imageheight
- height of the image
IOException
- if the file could not be writtengenerateHistogram(String, double[], boolean, int)
,
ROCCurveHandler.generateChart(java.util.List, java.util.List)
public static void writeAnnotations(Map<String,Object> annotations, PrintWriter writer)
annotations
- annotations to be writtenwriter
- the writerpublic static Map<String,Object> parseAnnotations(String parse)
parse
- string to be parsed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |