halo.examples
contained in the src/
directory.
HALO/data
.
data/Example_mouse.txt
is used as input. From the file a Data
-object is created, where all necessary information is
stored.
The example also shows how to load not only RNA measurements but also additional attributes that are part of
the original datafile.
//Define the names of columns containing newly transcribed RNA |
Data
-object. It is always
advisable to load present calls separately instead of with other attributes, since they are handled internally
differently. For this reason there exist two methods for each attribute loading procedure, one for
regular attributes, and one for present/absent calls or similar attributes.
//Define the names of columns containing present call attributes
ArrayList<String> colAtt = new ArrayList<String>();
String[] attributes = new String[]{"Call_T1", "Call_T2", "Call_T3", "Call_E1",
"Call_E2", "Call_E3","Call_U1", "Call_U2", "Call_U3"};
for(String t: attributes) {
colAtt.add(t);
} |
Data
-object is created after every filtering step that can be used for subsequent analysis and even more filtering methods.
//Filter according to a given threshold
double threshold = 50;
data = Filter.filter(data, threshold);
String call = "A"; //The present/absent call used for filtering
int callNumber = 1; //The number of appearances of this call requested to discard the probeset
//Filter according to present/absent calls
data = Filter.filterAbsent(data, colAtt, call, callNumber);
data = Filter.filterAbsent(data, colAtt, "M", callNumber);
//Filtering for probe sets with no annotated gene name
data = Filter.filterAbsent(data, geneAtt, "---", callNumber);
|
//choose name for output
String output = "Example_mouse_filtered.txt";
//write output
colAtt.addAll(geneAtt);
data.writeOutput(output, colTot, colNew, colPre,colAtt );
|
Loading data...
Done loading data.
You have 31451 probesets.
------------------------------
Loading attributes...
Done loading attributes.
------------------------------
Filtering data...
Done filtering data.
You have 11031 probesets.
------------------------------
Filtering data...
Done filtering data.
You have 10984 probesets.
------------------------------
Filtering data...
Done filtering data.
You have 10937 probesets.
------------------------------
Filtering data... |
Example_mouse_filtered.txt