compomics / compomics-utilities

Open source Java library for computational proteomics
http://compomics.github.io/projects/compomics-utilities.html
30 stars 17 forks source link

Spectrum annotation #62

Closed wenbostar closed 9 months ago

wenbostar commented 9 months ago

In peptide spectrum annotation using the function getSpectrumAnnotation, is that possible to annotate charge 2+ fragment ions when peptide charge is 2+?

hbarsnes commented 9 months ago

We do not have any plans of implementing this ourselves, but you can always modify the getPeakAnnotation method in com.compomics.util.experiment.identification.matches.IonMatch to implement your own version.

Simply replace all of the lines where it says: result.append(Charge.getChargeAsFormattedString(charge));

with result.append(" ").append(Charge.toString(charge));

and you should get the wanted 2+ annotation.

Note that you probably also want to set spectrumPanel.setSubscriptAnnotationNumbers(false);

for your spectrum panel as otherwise the annotation may look a bit strange (which is partly why we have not implement this alternative annotation).

wenbostar commented 9 months ago

Thanks a lot.