Changeset 4284
- Timestamp:
- Feb 10, 2012, 4:25:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugin/src/org/proteios/plugins/FeatureComparison.java
r4281 r4284 192 192 String currentSequence = ""; 193 193 String currentAcc = ""; 194 Float[] values = null; 194 boolean conflict = false; 195 float[] values = null; 195 196 writer 196 197 .println("Cluster ID\tPeptide Sequence\tExternal IDs\tCharge\tAverage RT"); … … 201 202 if (!feature.getClusterId().equals(currentCluster)) 202 203 { 203 if (values != null) 204 { 205 writer 206 .print(currentCluster + "\t" + currentSequence + "\t" + currentAcc + "\t" + currentCharge + "\t" + (rtSum / nValues)); 207 for (Float value : values) 208 { 209 writer.print("\t" + value); 210 } 211 writer.println(); 212 } 213 values = new Float[entries]; 204 printRow(writer, values, currentCluster, currentSequence, 205 currentAcc, currentCharge, rtSum, nValues, conflict); 206 values = new float[entries]; 207 conflict = false; 214 208 currentAcc = ""; 215 209 currentCharge = 0; … … 219 213 nValues = 0; 220 214 } 221 if (currentSequence.equals("") && feature.getPeptideSequence() != null) 222 { 223 currentSequence = feature.getPeptideSequence(); 224 for (Hit hit : feature.getHits()) 215 if (currentSequence.equals("")) 216 { 217 if (feature.getPeptideSequence() != null) 225 218 { 226 if (currentSequence.startsWith(hit.getDescription())) 219 currentSequence = feature.getPeptideSequence(); 220 for (Hit hit : feature.getHits()) 227 221 { 228 currentAcc = hit.getExternalId(); 222 if (currentSequence.startsWith(hit.getDescription())) 223 { 224 currentAcc = hit.getExternalId(); 225 } 229 226 } 230 227 } 231 228 } 232 values[msFiles.indexOf(feature.getMsFile())] = feature 233 .getIntegratedIntensity(); 229 else if (!feature.getPeptideSequence().equals(currentSequence)) 230 { 231 conflict = true; 232 } 233 values[msFiles.indexOf(feature.getMsFile())] += feature 234 .getIntegratedIntensity().floatValue(); 234 235 nValues++; 235 236 if (currentCharge == 0) … … 237 238 rtSum += feature.getApexRetentionTimeInMinutes(); 238 239 240 } 241 printRow(writer, values, currentCluster, currentSequence, currentAcc, 242 currentCharge, rtSum, nValues, conflict); 243 } 244 245 246 private void printRow(PrintWriter writer, float[] values, 247 Long currentCluster, String currentSequence, String currentAcc, 248 int currentCharge, float rtSum, float nValues, boolean conflict) 249 { 250 if (values != null) 251 { 252 writer.print(currentCluster + "\t" + currentSequence); 253 if (conflict) 254 writer.print(",+"); 255 writer 256 .print("\t" + currentAcc + "\t" + currentCharge + "\t" + (rtSum / nValues)); 257 for (float value : values) 258 { 259 writer.print("\t" + value); 260 } 261 writer.println(); 239 262 } 240 263
Note: See TracChangeset
for help on using the changeset viewer.