//phi2 //1) compute LFC by Tools --> Create normalized map --> Transformation = LogFolfChange, ReferenceRows = lookup_table, FilterReference = flat //2) replace -Infinity and Infinity by NaN if any (there are many NaNs, but no worry) //3) split result to two files: mutant (mt) and col-0 (wt) //4) compute the avg LFC by Tools --> Create averaged map -->MatchBy = SalkID, AdditionalMatchingCriteria = flat //5) compute atg averaged LFC by Tools --> Create averaged map -->MatchBy = AtNumber //6) replace all NaN by 0 because logged fold change=NaN is only caused by the divided by 0 error (caused by replacing negative or small phenotype with 0) //7) delete the row with its name "null" //8) display results: // multi-allPhi2-3-day-lfc2-mt-avg-atg-abn.txt // multi-allPhi2-3-day-lfc2-wt-avg.txt //the comment below shows how you could load data from your hard drive //phi2_raw = GLOBAL.loadHeatmapFromPath("C:\\Users\\Guest\\Documents\\Linda-final-expc\\phi2\\allPhi2.txt") //1 refTable = new ReferenceTable( phi2_raw, "Flat" ) phi2_lfc = new HeatmapNormalizer( phi2_raw ).buildNormalizedMap( LogFoldChange, refTable ) //2 phi2_lfc.replaceInfiniteValues( NaN ) //3 sel_wt = phi2_lfc.searchRowLabels( "col-0" ) phi2_lfc_wt = phi2_lfc.getSubMap( sel_wt ) phi2_lfc_mt = phi2_lfc.getSubMap( phi2_lfc.invert( sel_wt ) ) //4 phi2_lfc_mt_avg = new HeatmapAverager( phi2_lfc_mt ).getAveragedMap( "PlantName", "flat" ) phi2_lfc_wt_avg = new HeatmapAverager( phi2_lfc_wt ).getAveragedMap( "PlantName", "flat" ) //5 phi2_lfc_mt_avg_atg = new HeatmapAverager( phi2_lfc_mt_avg ).getAveragedMap( "AtNumber" ) //6 phi2_lfc_mt_avg.replaceValues( function(x){ return x=NaN; }, 0 ) phi2_lfc_wt_avg.replaceValues( function(x){ return x=NaN; }, 0 ) phi2_lfc_mt_avg_atg.replaceValues( function(x){ return x=NaN; }, 0 ) //7 phi2_lfc_mt_avg.deleteRows( phi2_lfc_mt_avg.searchRowLabels( "null" ) ) phi2_lfc_wt_avg.deleteRows( phi2_lfc_wt_avg.searchRowLabels( "null" ) ) phi2_lfc_mt_avg_atg.deleteRows( phi2_lfc_mt_avg_atg.searchRowLabels( "null" ) ) //8 phi2_lfc_mt_avg.setTitle( "LogFoldChanged Phi2 - mutants averaged by PlantName/Flat" ) phi2_lfc_wt_avg.setTitle( "LogFoldChanged Phi2 - wildtypes averaged by PlantName/Flat" ) phi2_lfc_mt_avg_atg.setTitle( "LogFoldChanged Phi2 - mutants averaged by AtNumber" ) GLOBAL.display( phi2_lfc_mt_avg, phi2_lfc_wt_avg, phi2_lfc_mt_avg_atg )