|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthalo.data.Data
public class Data
Reading and containing RNA values from an input file and providing methods for the calculation of RNA ratios as well as methods to save the filtered values to a file.
Field Summary | |
---|---|
static int |
AVERAGEFIRST
|
static java.lang.String |
GENEDEFAULT
|
static java.lang.String |
LOGEN
|
static java.lang.String |
LOGEU
|
static java.lang.String |
LOGUN
|
static int |
RATIOFIRST
|
static int |
REPLICATE
|
Constructor Summary | |
---|---|
Data()
Constructs an empty Data-Object, so that parameters for data loading can be set before starting. |
|
Data(double[][] totalRNA,
double[][] newRNA,
double[][] preRNA,
java.lang.String[] totalDescr,
java.lang.String[] newDescr,
java.lang.String[] preDescr,
Mapping<java.lang.String,java.lang.Integer> map)
Constructs a Data-Object based on already existing data. |
|
Data(java.lang.String file,
java.util.List<java.lang.String> columnsTotal,
java.util.List<java.lang.String> columnsNew,
java.util.List<java.lang.String> columnsPre,
boolean log)
Constructs a Data-Object based on an Input-File and the list of columns to be read with no additional attributes. |
|
Data(java.lang.String file,
java.util.List<java.lang.String> columnsTotal,
java.util.List<java.lang.String> columnsNew,
java.util.List<java.lang.String> columnsPre,
java.util.List<java.lang.String> attr,
boolean log)
Constructs a Data-Object based on an Input-File and the list of columns to be read, defines columns containing attributes. |
Method Summary | |
---|---|
void |
addAttributes(java.lang.String inputfile)
Reads in every attribute from a given file. |
void |
addAttributes(java.lang.String inputfile,
java.util.ArrayList<java.lang.String> columnLabels)
Reads in regular attributes from a file. |
void |
addAttributes(java.lang.String inputfile,
java.util.ArrayList<java.lang.String> columnLabels,
boolean turnReverseMapOff)
Reads in a file containing several columns, of which one contains the spotID, the others contain attributes. |
void |
addPresenceCalls(java.lang.String inputfile,
java.util.ArrayList<java.lang.String> columnLabels)
Reads in attributes from a file. |
double[] |
calculateAverageFirst(double[][] rna,
double[][] total,
java.util.HashMap<java.lang.String,java.lang.Double> corr)
Calculates the average values from all replicates for the linear regression through calculating the ratio of the averages (AVERAGEFIRST method). |
void |
calculateMappingForAttributes(java.lang.String[][] allAttributes,
java.lang.String[] ids)
Transcribes the attributes into a mapping id -> attribute. |
Mapping<java.lang.String,java.lang.Integer> |
calculateNewMapping()
Calculates the Mapping corresponding to the ratio. |
double[] |
calculateRatio(double[][] rna,
double[][] total,
java.util.HashMap<java.lang.String,java.lang.Double> corr)
Calculates the ratios for an average over a set of replicates. |
double[] |
calculateRatio(double[][] rna,
double[][] total,
java.util.HashMap<java.lang.String,java.lang.Double> corr,
int replicate)
Calculates filtered Ratio of a set of RNA values (e.g. newly transcribed RNA) to a second set of values (e.g. total RNA) based on the specified method to calculate the average of multiple replicates. |
double[] |
calculateRatioFirst(double[][] allRatio)
calculates the average values from all replicates for the linear regression. |
Mapping<java.lang.String,java.lang.Integer> |
copyMap()
Copies the content of the Mapping object. |
double |
evaluate(java.lang.String fasta,
int column,
java.lang.String uraMeth,
java.lang.String printName,
java.util.HashMap<java.lang.String,java.lang.Double> corr,
boolean plot)
Method for the Uracil-based evaluation of the values: Compares (average) uracil number of the sequence to logarithm of the ratio. |
void |
findMiniMaxi()
Sets the new minimum and maximum |
java.lang.String |
getAbsent()
Returns the call used for present/absent filtering. |
java.lang.String |
getAbsentLabel()
Returns the name of the column with present/absent calls. |
java.lang.String[] |
getAttrDescr()
Returns the description of the attributes. |
java.util.ArrayList<Mapping<java.lang.String,java.lang.String>> |
getAttributes()
Returns the attribute lists. |
double |
getAvgLo()
Returns the average log(e'/n'). |
double |
getAvgUr()
Returns the average number of Uracil. |
java.util.HashMap<java.lang.String,java.lang.Double> |
getCorrNewPre()
Returns the correction bias values for the ratio newly transcribed/pre-existing. |
java.util.HashMap<java.lang.String,java.lang.Double> |
getCorrNewTot()
Returns the correction bias values for the ratio newly transcribed/total. |
java.util.HashMap<java.lang.String,java.lang.Double> |
getCorrPreTot()
Returns the correction bias values for the ratio pre-existing/total. |
double[] |
getDat()
Returns the evaluated normalized data. |
java.lang.String |
getFilename()
Returns the name of the file containing the data. |
java.lang.String |
getGeneName()
Returns the name of the column with gene names. |
Mapping<java.lang.String,java.lang.Integer> |
getMap()
Returns the map corresponding to the data. |
double |
getMaximum()
Returns the maximal expression value present in the data |
int |
getMethod()
Returns the number of the method used for ratio calculation. |
double |
getMinimum()
Returns the minimal expression value present in the data |
java.lang.String[] |
getNewDescr()
Returns the description = column labels of newly transcribed RNA. |
double[][] |
getNewRNA()
Returns all the values for newly transcribed RNA. |
int |
getNumberExperiments()
Returns the number of measured experiments (not changeable through filtering!). |
java.lang.String |
getPlotName()
Returns the name of the file into which evaluation results will be printed as a plottable table. |
double[] |
getPqs()
Returns the probe set quality scores. |
java.lang.String[] |
getPreDescr()
Returns the description = column labels of pre-existing RNA. |
double[][] |
getPreRNA()
Returns all the values for pre-existing RNA. |
int |
getReplicate()
Returns the number of the replicate used for calculations. |
int |
getReplicatesTotal()
Returns the total number of replicates. |
int |
getSize()
Returns the number of probesets present after filtering. |
java.lang.String[] |
getSpot()
Returns the list of spots. |
java.lang.String |
getSpotid()
Returns the name of the column with probeset ids. |
java.lang.String[] |
getTotalDescr()
Returns the description = column labeles of total RNA. |
double[][] |
getTotalRNA()
Returns all the values for total RNA. |
boolean |
isUnequal()
Returns TRUE if unequal number of RNA measurements has been loaded. |
void |
loadAttributesFromDatafile(java.util.ArrayList<java.lang.String> newAttributes)
Loads attributes from original data file. |
void |
loadAttributesFromDatafile(java.util.ArrayList<java.lang.String> newAttributes,
boolean turnReverseMapOff)
Loads attributes from the original data file. |
void |
loadData(java.lang.String file,
java.util.List<java.lang.String> columnsTotal,
java.util.List<java.lang.String> columnsNew,
java.util.List<java.lang.String> columnsPre,
java.util.List<java.lang.String> attr,
boolean log)
Loads the data from a file. |
void |
loadPresentCallsFromDatafile(java.util.ArrayList<java.lang.String> presentCallAttributes)
Loads present calls or other attributes with a small number of values from the original data file. |
void |
readInput(java.lang.String file,
java.util.List<java.lang.String> columnsTotal,
java.util.List<java.lang.String> columnsNew,
java.util.List<java.lang.String> columnsPre,
java.util.List<java.lang.String> addit,
boolean log)
Takes an input file, reads the values and saves them in the class variables of the Data object. |
double[] |
restrictRatio(double[][] input,
int replicate)
Restricts a multidimensional array onto an array with one dimension containing the wanted replicate, while keeping the order. |
void |
setAbsent(java.lang.String absent)
Sets the name of the column (column label) which holds information on present/absent. |
void |
setAttrDescr(java.lang.String[] attrDescr)
Sets the description of all attributes. |
void |
setAttributes(java.util.ArrayList<Mapping<java.lang.String,java.lang.String>> attributes)
Sets the attributes list for the data. |
void |
setCorrNewPre(java.util.HashMap<java.lang.String,java.lang.Double> corr)
Sets the correction bias values for the ratio newly transcribed/pre-existing. |
void |
setCorrNewTot(java.util.HashMap<java.lang.String,java.lang.Double> corrNewTot)
Sets the correction bias values for the ratio newly transcribed/total. |
void |
setCorrPreTot(java.util.HashMap<java.lang.String,java.lang.Double> corrPreTot)
Sets the correction bias values for the ratio pre-existing/total. |
void |
setFilename(java.lang.String filename)
Sets the name of the file holding the data information. |
void |
setGeneName(java.lang.String geneName)
Sets the name of the column which holds information on the gene name. |
void |
setMap(Mapping<java.lang.String,java.lang.Integer> map)
Sets the mapping corresponding to the whole data and filtered values. |
void |
setMaximum(double maximum)
Sets the maximum RNA value |
void |
setMethod(int i)
Sets the method used for calculating the average ratios over all replicates. |
void |
setMinimum(double minimum)
Sets the minimum RNA value |
void |
setPqs(double[] pqs)
Sets the probe set quality scores. |
void |
setReplicate(int replicate)
Sets the replicate used for ratio calculations, if method is restricting of ratios to one replicate. |
void |
setSpotid(java.lang.String probesetId)
Sets the name of the column with probeset ids. |
void |
setUnequal(boolean unequal)
Set the value of the unequal variable, meaning if there is an unequal number of measurements (new, pre, total). |
void |
writeOutput(java.lang.String output,
java.util.List<java.lang.String> columnsTotal,
java.util.List<java.lang.String> columnsNew,
java.util.List<java.lang.String> columnsPre,
java.util.List<java.lang.String> addit)
Desired columns are written to a file; former order is not kept, instead all values of one type are added sequentially. |
void |
writeToFileArray(java.lang.String output,
double[] array)
Writes the half-life values contained in the array and in the map together with corresponding spotIds into a file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int RATIOFIRST
public static final int AVERAGEFIRST
public static final int REPLICATE
public static final java.lang.String LOGEN
public static final java.lang.String LOGUN
public static final java.lang.String LOGEU
public static final java.lang.String GENEDEFAULT
Constructor Detail |
---|
public Data(java.lang.String file, java.util.List<java.lang.String> columnsTotal, java.util.List<java.lang.String> columnsNew, java.util.List<java.lang.String> columnsPre, boolean log)
file
- Name of the Input-filecolumnsTotal
- List containing the labels of columns for
total RNAcolumnsNew
- List containing the labels of columns for newly
transcribed RNAcolumnsPre
- List containing the labels of columns for
pre-existing RNApublic Data(java.lang.String file, java.util.List<java.lang.String> columnsTotal, java.util.List<java.lang.String> columnsNew, java.util.List<java.lang.String> columnsPre, java.util.List<java.lang.String> attr, boolean log)
file
- Name of the Input-filecolumnsTotal
- List containing the labels of columns for
total RNAcolumnsNew
- List containing the labels of columns for
newly transcribed RNAcolumnsPre
- List containing the labels of columns for
pre-existing RNAattr
- List containing the labels of columns for attributespublic Data()
public Data(double[][] totalRNA, double[][] newRNA, double[][] preRNA, java.lang.String[] totalDescr, java.lang.String[] newDescr, java.lang.String[] preDescr, Mapping<java.lang.String,java.lang.Integer> map)
totalRNA
- Array containing all values of total RNAnewRNA
- Array containing all values of newly transcribed RNApreRNA
- Array containing all values of pre-existing RNAtotalDescr
- A description that matches the columns of the
arrays containing the values to the labels of the columns for
total RNAnewDescr
- matches columns of arrays to labels for newly
transcribed RNApreDescr
- matches columns of arrays to labels for pre-existing
RNAmap
- A Map matching SpotId to index of RNA-arrays, containing
only filtered valuesMethod Detail |
---|
public void loadData(java.lang.String file, java.util.List<java.lang.String> columnsTotal, java.util.List<java.lang.String> columnsNew, java.util.List<java.lang.String> columnsPre, java.util.List<java.lang.String> attr, boolean log)
file
- Name of the Input-filecolumnsTotal
- List containing the labels of columns for
total RNAcolumnsNew
- List containing the labels of columns for
newly transcribed RNAcolumnsPre
- List containing the labels of columns for
pre-existing RNAattr
- List containing the labels of columns for attributespublic void readInput(java.lang.String file, java.util.List<java.lang.String> columnsTotal, java.util.List<java.lang.String> columnsNew, java.util.List<java.lang.String> columnsPre, java.util.List<java.lang.String> addit, boolean log)
file
- Name of the input filecolumnsTotal
- List containing labels of columns for total RNAcolumnsNew
- List containing labels of columns for newly
transcribed RNAcolumnsPre
- List containing labels of columns for pre-existing
RNAaddit
- List containing labels of columns with additional
information; null if no additional information is wantedpublic void calculateMappingForAttributes(java.lang.String[][] allAttributes, java.lang.String[] ids)
allAttributes
- A list of attributes for each idids
- The ids corresponding to the indicespublic void addAttributes(java.lang.String inputfile)
inputfile
- Name of the file that contains attributespublic void addAttributes(java.lang.String inputfile, java.util.ArrayList<java.lang.String> columnLabels)
inputfile
- Name of the file that contains attributescolumnLabels
- Labels of relevant columnspublic void addPresenceCalls(java.lang.String inputfile, java.util.ArrayList<java.lang.String> columnLabels)
inputfile
- Name of the file that contains attributescolumnLabels
- Labels of relevant columnspublic void addAttributes(java.lang.String inputfile, java.util.ArrayList<java.lang.String> columnLabels, boolean turnReverseMapOff)
inputfile
- Name of the file that contains attributescolumnLabels
- Labels of relevant columnsturnReverseMapOff
- TRUE it attributes are present calls or
similar attributes with a very small number of valuespublic void loadAttributesFromDatafile(java.util.ArrayList<java.lang.String> newAttributes)
newAttributes
- The list of attributes that will be loadedpublic void loadPresentCallsFromDatafile(java.util.ArrayList<java.lang.String> presentCallAttributes)
presentCallAttributes
- The list of attributes that will
be loadedpublic void loadAttributesFromDatafile(java.util.ArrayList<java.lang.String> newAttributes, boolean turnReverseMapOff)
newAttributes
- The list of attributes that will be loadedturnReverseMapOff
- TRUE if attributes are present calls or
similar attributes with very few possible valuespublic void writeOutput(java.lang.String output, java.util.List<java.lang.String> columnsTotal, java.util.List<java.lang.String> columnsNew, java.util.List<java.lang.String> columnsPre, java.util.List<java.lang.String> addit)
output
- Name of the output filecolumnsTotal
- List containing labels of columns for total
RNA that shall be exportedcolumnsNew
- List containing labels of columns for newly
transcribed RNA that shall be exportedcolumnsPre
- List containing labels of columns for pre-existing
RNA that shall be exportedaddit
- List containing labels of columns for attributespublic Mapping<java.lang.String,java.lang.Integer> copyMap()
public double[] calculateRatio(double[][] rna, double[][] total, java.util.HashMap<java.lang.String,java.lang.Double> corr, int replicate)
rna
- A set of RNA values serving as numeratortotal
- A second set of RNA values serving as denominatorcorr
- The map for ID and bias correction, null if no
correction should take placereplicate
- The number of the replicate (starting from 0)
that will be used for method REPLICATE; -1 if average should
be calculated
public double[] calculateRatio(double[][] rna, double[][] total, java.util.HashMap<java.lang.String,java.lang.Double> corr)
rna
- A set of RNA values serving as numeratortotal
- A second set of RNA values serving as denominatorcorr
- The map for ID and bias correction, null if no
correction should take place
public Mapping<java.lang.String,java.lang.Integer> calculateNewMapping()
public double[] restrictRatio(double[][] input, int replicate)
input
- Ratio or half-life arrayreplicate
- The replicate to which the ratio will be restricted
public double[] calculateRatioFirst(double[][] allRatio)
allRatio
- The array containing the previously calculated ratios
public double[] calculateAverageFirst(double[][] rna, double[][] total, java.util.HashMap<java.lang.String,java.lang.Double> corr)
rna
- A set of RNA that serves as numeratortotal
- A set of RNA that serves as denominatorcorr
- The map for ID and bias correction, null if no
correction should take place
public void writeToFileArray(java.lang.String output, double[] array)
output
- Name of output filearray
- List containing any set of valuespublic double evaluate(java.lang.String fasta, int column, java.lang.String uraMeth, java.lang.String printName, java.util.HashMap<java.lang.String,java.lang.Double> corr, boolean plot)
fasta
- The fasta file which contains the sequencescolumn
- The number of the column (starting with 1) of the
header in which the genename is contained (i.e. header:
> genename | attribute | attribute leads to column = 1)uraMeth
- Either "log(e'/n')", or "log(e'/u')", or
"log(u'/n')", according to the ratio which will be evaluatedprintName
- Name of the output file for plotting informationcorr
- The map for ID and bias correction, null if no
correction should take placeplot
- TRUE if histogram plot is wanted, FALSE otherwise
public void findMiniMaxi()
public void setCorrNewPre(java.util.HashMap<java.lang.String,java.lang.Double> corr)
corr
- The correction bias values for the ratio newly transcribed/pre-existingpublic void setCorrNewTot(java.util.HashMap<java.lang.String,java.lang.Double> corrNewTot)
corrNewTot
- The correction bias values for the ratio
newly transcribed/totalpublic void setCorrPreTot(java.util.HashMap<java.lang.String,java.lang.Double> corrPreTot)
corrPreTot
- The correction bias values for the ratio
pre-existing/totalpublic void setMethod(int i)
i
- The integer value for the methodpublic void setMap(Mapping<java.lang.String,java.lang.Integer> map)
map
- The mapping corresponding to datapublic void setMaximum(double maximum)
maximum
- Maximum RNA valuepublic void setMinimum(double minimum)
minimum
- Minimum RNA valuepublic void setFilename(java.lang.String filename)
filename
- Name of the file with the datapublic void setAttributes(java.util.ArrayList<Mapping<java.lang.String,java.lang.String>> attributes)
attributes
- The list of attribute mappingspublic void setAttrDescr(java.lang.String[] attrDescr)
attrDescr
- The description of attributespublic void setAbsent(java.lang.String absent)
absent
- Column label for present/absent callspublic void setGeneName(java.lang.String geneName)
geneName
- Column label for gene namepublic void setSpotid(java.lang.String probesetId)
probesetId
- Name of the column with probeset idspublic void setUnequal(boolean unequal)
unequal
- True, if there is an unequal number of measurementspublic void setReplicate(int replicate)
replicate
- The replicate used for ratio calculationspublic void setPqs(double[] pqs)
pqs
- The probe set quality scorespublic double[] getPqs()
public java.lang.String getAbsent()
public int getMethod()
public int getReplicate()
public java.lang.String getAbsentLabel()
public java.lang.String getGeneName()
public java.lang.String getSpotid()
public double getMaximum()
public double getMinimum()
public java.lang.String getFilename()
public java.lang.String[] getSpot()
public double[] getDat()
public java.util.ArrayList<Mapping<java.lang.String,java.lang.String>> getAttributes()
public Mapping<java.lang.String,java.lang.Integer> getMap()
public java.lang.String[] getAttrDescr()
public java.lang.String[] getNewDescr()
public double[][] getNewRNA()
public java.util.HashMap<java.lang.String,java.lang.Double> getCorrNewPre()
public java.util.HashMap<java.lang.String,java.lang.Double> getCorrNewTot()
public java.util.HashMap<java.lang.String,java.lang.Double> getCorrPreTot()
public java.lang.String[] getPreDescr()
public double[][] getPreRNA()
public java.lang.String[] getTotalDescr()
public double[][] getTotalRNA()
public int getNumberExperiments()
public int getSize()
public double getAvgLo()
public double getAvgUr()
public int getReplicatesTotal()
public java.lang.String getPlotName()
public boolean isUnequal()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |