Skip to content

Commit

Permalink
Do not write an empty <ModificationsList> element when there are no m…
Browse files Browse the repository at this point in the history
…odifications with Unimod Ids. Instead write:

<cvParam cvRef="MS" accession="MS:1002864" name="No PTMs are included in the dataset"/> 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.
  • Loading branch information
vagisha committed Feb 1, 2025
1 parent 0d1b806 commit 1fe8377
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand Down

0 comments on commit 1fe8377

Please sign in to comment.