Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
fix for 2nd round which includes the bad qualtiy compounds
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-ludwig committed Mar 12, 2020
1 parent 2cf429b commit 0980134
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ private void prepare(FragmentsCandidate[][] candidates, double minimum_number_ma
System.out.println("prepare.");


if (normalizationMap==null & (used_minimum_number_matched_peaks_losses != minimum_number_matched_peaks_losses)){
if (normalizationMap==null || (used_minimum_number_matched_peaks_losses != minimum_number_matched_peaks_losses)
|| !containsAllCompounds(normalizationMap, Arrays.stream(candidates).map(c->c[0].getExperiment()).toArray(s->new Ms2Experiment[s]))){
//something changed, so recompute all.
long start = System.currentTimeMillis();
used_minimum_number_matched_peaks_losses = minimum_number_matched_peaks_losses;
norm = this.normalization(candidates, minimum_number_matched_peaks_losses);
Expand Down Expand Up @@ -102,9 +104,12 @@ private void prepare(FragmentsCandidate[][] candidates, double minimum_number_ma
if (GibbsMFCorrectionNetwork.DEBUG) System.out.println("compounds: " + this.maybeSimilar.length + " | maybeSimilar: " + sum + " | threshold was "+threshold);
}

// private void prepareData(){
//
// }
private boolean containsAllCompounds(TObjectDoubleHashMap<Ms2Experiment> normalizationMap, Ms2Experiment[] ms2Experiments) {
for (Ms2Experiment ms2Experiment : ms2Experiments) {
if (!normalizationMap.containsKey(ms2Experiment)) return false;
}
return true;
}



Expand Down

0 comments on commit 0980134

Please sign in to comment.