From 1fe8377f71dcf87f617017db40902cb0f0d19761 Mon Sep 17 00:00:00 2001 From: vagisha Date: Sat, 1 Feb 2025 15:43:50 -0800 Subject: [PATCH] Do not write an empty element when there are no modifications with Unimod Ids. Instead write: so that we do not get XML validations errors from ProteomeXchange. Modifications without Unimod Ids are not supported by ProteomeXchange so we skip writing them to the XML file that is submitted to ProteomeXchange. --- .../org/labkey/panoramapublic/proteomexchange/PxXmlWriter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/PxXmlWriter.java b/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/PxXmlWriter.java index b0d9f156..2c1e6153 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/PxXmlWriter.java +++ b/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/PxXmlWriter.java @@ -391,7 +391,7 @@ void writeModificationList(Status validationStatus) throws PxException */ Element mod_list = new Element("ModificationList"); var mods = validationStatus.getModifications(); - if(mods.size() == 0) + if(mods.size() == 0 || mods.stream().noneMatch(Modification::isValid)) { mod_list.addChild(new CvParamElement("MS", "MS:1002864", "No PTMs are included in the dataset")); }