Skip to content

Commit

Permalink
Merge pull request #922 from Mailaender/area-percent-external-quant
Browse files Browse the repository at this point in the history
Added external quantitation reference entry to area % report
  • Loading branch information
eselmeister authored Feb 25, 2022
2 parents 7231ce1 + e64c864 commit c135c2f
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.eclipse.chemclipse.model.core.IPeakModel;
import org.eclipse.chemclipse.model.identifier.IIdentificationTarget;
import org.eclipse.chemclipse.model.identifier.ILibraryInformation;
import org.eclipse.chemclipse.model.quantitation.IQuantitationEntry;
import org.eclipse.chemclipse.msd.model.core.IChromatogramMSD;
import org.eclipse.chemclipse.msd.model.core.IChromatogramPeakMSD;
import org.eclipse.chemclipse.msd.model.core.IPeakModelMSD;
Expand Down Expand Up @@ -113,6 +114,8 @@ private void printAreaPercentList(PrintWriter printWriter, IChromatogram<? exten
printWriter.print("Retention Time [Minutes]");
printWriter.print(DELIMITER);
printWriter.print("Purity");
printWriter.print(DELIMITER);
printWriter.print("Ext. Quant. Ref. [Area%]");
printWriter.println("");
/*
* Data
Expand Down Expand Up @@ -157,6 +160,8 @@ private void printAreaPercentList(PrintWriter printWriter, IChromatogram<? exten
printWriter.print(decimalFormat.format(retentionTime / IChromatogramOverview.MINUTE_CORRELATION_FACTOR));
printWriter.print(DELIMITER);
printWriter.print(decimalFormat.format(getPurity(peakSource)));
printWriter.print(DELIMITER);
printWriter.print(decimalFormat.format(getExternalQuantAreaPercent(peakSource)));
printWriter.println("");
}
}
Expand Down Expand Up @@ -404,6 +409,17 @@ private float getPurity(IPeak peak) {
return purity;
}

private double getExternalQuantAreaPercent(IPeak peak) {

double area = 0f;
List<IQuantitationEntry> quantitationEntries = peak.getQuantitationEntries();
if(!quantitationEntries.isEmpty()) {
area = quantitationEntries.get(0).getArea();
}
//
return area;
}

private double getPercentagePeakArea(IChromatogram<?> chromatogram, IPeak peak) {

double peakAreaPercent = 0.0d;
Expand Down

0 comments on commit c135c2f

Please sign in to comment.