GithubHelp home page GithubHelp logo

pride-utilities / ms-data-core-api Goto Github PK

View Code? Open in Web Editor NEW
12.0 10.0 8.0 117.75 MB

Open-source java library to handle different file format standards for proteomics. Specially ms-data-core-api is good for MetaData representation.

License: Apache License 2.0

Java 99.91% Shell 0.02% AngelScript 0.07%

ms-data-core-api's Introduction

ms-data-core-api

Build Status

About

The primary purpose of ms-data-core-api library is to provide commonly used classes and Object Model for Proteomics Experiments. You may also find it useful for your own computational proteomics projects.

Main Features

  • Common Object Model for different proteomics experiments, with classes to represent proteins, peptides, psms, psectrums
  • DataAccessControllers for mzTab, mzIdentML, PRIDE XML, PRIDE Database, mzML, mzXML, mgf, pkl, apl, ms2, dta files
  • Proteomics Standard compleint Data model with classes for Ontologies and User params
  • Read different file formats in proteomics in a common Object Model
  • Export the current model to mzTab files in for Identification Experiments.

Note: the library is still evolving, we are committed to expand this library and add more useful classes.

Getting ms-data-core-api

The zip file in the releases section contains the ms-data-core-api jar file and all other required libraries.

Maven Dependency

PRIDE Utilities library can be used in Maven projects, you can include the following snippets in your Maven pom file.

<dependency>
  <groupId>uk.ac.ebi.pride.utilities</groupId>
  <artifactId>ms-data-core-api</artifactId>
  <version>x.x.x</version>
</dependency> 
<!-- EBI repo -->
<repository>
    <id>nexus-ebi-release-repo</id>
    <url>http://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-repo/</url>
</repository>

<!-- EBI SNAPSHOT repo -->
<snapshotRepository>
   <id>nexus-ebi-snapshots-repo</id>
   <url>http://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-snapshots/</url>
</snapshotRepository>

Note: you need to change the version number to the latest version.

For developers, the latest source code is available from our SVN repository.

How to use ms-data-core-api

Using ms-data-core-api

Reading a mzIdentML file:

This example shows how to read an mzIdentML file and retrieve the information from them:

import uk.ac.ebi.pride.utilities.data.core.*;

//Open an inputFile mzIdentml File using memory 
MzIdentMLControllerImpl mzIdentMlController = new MzIdentMLControllerImpl(inputFile, true);

//Print size of the Sample List
List<Sample> samples = mzIdentMlController.getSamples();
System.out.println(samples.size());

//Print the Id of the first sample
System.out.println(samples.get(0).getId());

// Get the list of softwares from the mzIdentMlController
List<Software> software = mzIdentMlController.getSoftwares();

//Print size of the Software List
System.out.println(software.size());

//Print the Name of the first Software
System.out.println(software.get(0).getName());

//Retrieve the Identification Metadata    
IdentificationMetaData experiment = mzIdentMlController.getIdentificationMetaData();
// test SearchDatabase
List<SearchDataBase> databases = experiment.getSearchDataBases();
        
// test SpectrumIdentificationProtocol
List<SpectrumIdentificationProtocol> spectrumIdentificationProtocol = experiment.getSpectrumIdentificationProtocols();

// Retrieve the Protein Identification Protocol
Protocol proteinDetectionProtocol = experiment.getProteinDetectionProtocol();

//Retrieve all Protein Identifications
List<Comparable> identifications = new ArrayList<Comparable>(mzIdentMlController.getProteinIds());

Reading a PRIDE XML file:

This example shows how to read an PRIDE XML file and retrieve the information from them:

//Open an inputFile mzIdentml File using memory 
PrideXmlControllerImpl prideXMLController = new PrideXmlControllerImpl(inputFile);

// You can use the example above and the same functions to retrieve the data using this controller for example:
//Print size of the Sample List
List<Sample> samples = prideXMLController.getSamples();
System.out.println(samples.size());

Using tools in ms-data-core-api:

File format conversion

Convert from mzIdentML to mzTab

java -jar ms-data-core-api<version>.jar -c -mzid <input.mzid> -outputfile <output.mztab>

Convert from PRIDE XML to mzTab

java -jar ms-data-core-api<version>.jar -c -pridexml <pride.xml> -outputformat <output.mztab>

Convert from annotated mzTab to (sorted, filtered*) proBed

java -jar ms-data-core-api<version>.jar -c -mztab <input.mztab> -chromsizes <chrom.txt> -outputformat probed

Convert from annotated mzIdentML to (sorted, filtered*) proBed

java -jar ms-data-core-api<version>.jar -c -mzid <input.mztab> -chromsizes <chrom.txt> -outputformat probed

Convert from (sorted, filtered*) proBed to bigBed

java -jar ms-data-core-api<version>.jar -c -mztab <input.pro.bed> -chromsizes <chrom.txt> -asqlfile <aSQL.as> -bigbedconverter <bedToBigBed>

File Validation

MzIdentML validation

java -jar ms-data-core-api<version>.jar -v -mzid <sample.mzid> -peak <spectra.mgf> -skipserialization -reportfile <outputReport.txt>

MzTab validation

java -jar ms-data-core-api<version>.jar -v -mztab <input.mztab> -peaks <spectra1.mgf>##<spectra2.mgf> -skipserialization -reportfile <outputReport.txt>

PRIDE XML validation

java -jar ms-data-core-api<version>.jar -v -pridexml <input.pride.xml> -skipserialization -reportfile <outputReport.txt>

XML schema validation

MzIdentML schema validation and normal validation

java -jar ms-data-core-api<version>.jar -v -mzid <input.mzid> -peak <spectra.mgf> -scehma -skipserialization -reportfile <outputReport.txt>

PRIDE XML schema validation only, without normal validation

java -jar ms-data-core-api<version>.jar -v -pridexml <input.pride.xml> -schemaonly -skipserialization -reportfile <outputReport.txt>

ProBed validation

ProBed validation with the default schema

java -jar ms-data-core-api<version>.jar -v -proBed <input.pro.bed> -reportfile <outputReport.txt>

ProBed validation with a custom schema

java -jar ms-data-core-api<version>.jar -v -proBed -proBed <input.pro.bed> -asqlfile <input.as> -reportfile <outputReport.txt>

Miscellaneous

Check Results Files

java -jar ms-data-core-api<version>.jar -check -inputfile <inputfile>

Convert PRIDE or mzIdentML file to MzTab

java -jar ms-data-core-api<version>.jar -convert -inputfile <inputfile> -format <format>

Print Error/Warn detail message based on code

java -jar ms-data-core-api<version>.jar -error -code <code>

Help

java -jar ms-data-core-api<version>.jar -h or --help 

How to cite it:

  • Perez-Riverol Y, Uszkoreit J, Sanchez A, Ternent T, Del Toro N, Hermjakob H, Vizcaíno JA, Wang R. (2015). ms-data-core-api: An open-source, metadata-oriented library for computational proteomics. Bioinformatics. 2015 Apr 24. PDF File Pubmed Record

This library has been used in:

  • Wang, R., Fabregat, A., Ríos, D., Ovelleiro, D., Foster, J. M., Côté, R. G., ... & Vizcaíno, J. A. (2012). PRIDE Inspector: a tool to visualize and validate MS proteomics data. Nature biotechnology, 30(2), 135-137. PDF File, Pubmed Record
  • Vizcaíno, J. A., Côté, R. G., Csordas, A., Dianes, J. A., Fabregat, A., Foster, J. M., ... & Hermjakob, H. (2013). The PRoteomics IDEntifications (PRIDE) database and associated tools: status in 2013. Nucleic acids research, 41(D1), D1063-D1069. PRIDE-Archive

Getting Help

If you have questions or need additional help, please contact the PRIDE Helpdesk at the EBI: pride-support at ebi.ac.uk (replace at with @).

Please send us your feedback, including error reports, improvement suggestions, new feature requests and any other things you might want to suggest to the PRIDE team.

License

ms-data-core-api is a PRIDE API licensed under Apache License 2.0.

ms-data-core-api's People

Contributors

julianu avatar mbdebian avatar noedelta avatar proteomics-developers avatar ruiwanguk avatar sureshhewabi avatar tobias-ternent avatar ypriverol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ms-data-core-api's Issues

Using this API in MATLAB

Hello,
I've been trying to use ms-data-core-api in MATLAB to process mzXML and mzML data but have been unsucessful.

I downloaded the newest version from Github and built it with Maven in Eclipse, goal was set to "assembly:assembly". It seems that log4j was not included in the POM so I added it in the "dependency" section.

MATLAB version is R2017b, running "Java 1.8.0_121-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode".

The issues I encountered are:

  1. When reading a mzML file (MzMLFile_7_compressed.mzML in \test\resources), in MATLAB I imported "java.io.File" and "uk.ac.ebi.pride.utilities.data.controller.impl.ControllerImpl.MzMLControllerImpl". When running "MzMLControllerImpl(file)", the error appeared as "java.lang.NoClassDefFoundError: Could not initialize class uk.ac.ebi.jmzml.xml.Constants".

  2. When reading a mzXML file (our own data), after following a similar routine, when running "MzXmlControllerImpl(file)", the error appeared as "java.lang.IllegalStateException: Could not initialize unmarshaller".

Please don't hesitate to ask if you need any more information to help me solve this problem.

I sincerely appreciate your kindly help. Thank you very much!

Issue with Spectrum Reader

Good morning,

I’ve made a few modifications to the ms-data-core-api (2.0.8-SNAPSHOT version). I, then, ran "mvn install" to get it on my local machine and added this version to my pom file, which is working with the 2.0.8-SNAPSHOT version.

I do, however, get some weird behavior when using 2.0.8-SNAPSHOT instead of the 2.0.5 fat jar from github’s release. Weird behavior include:

When debugging my application, I get the following errors during initial setup:
java.io.FileNotFoundException: /home/.m2/repository/edu/ucar/netcdf4/4.5.5/jcl-over-slf4j-1.7.7.jar
java.io.FileNotFoundException: /home/.m2/repository/edu/ucar/netcdf4/4.5.5/ehcache-core-2.6.2.jar
Whenever I use uk.ac.ebi.pride.utilities.data.controller.impl.ControllerImpl.MzXmlControllerImpl.getSpectrumById(Comparable id), the id value gets outputted to stdout, which doesn’t occur on 2.0.5. This can’t be ignored because it slows down considerably the program. I traced this to here.
I do get a lot of logback warnings that I don’t get using 2.0.5

Is there something that I’m missing here, regarding the warnings and the file not found exception? Should I be making a fat jar to use locally as well? I didn’t think that’d be necessary. Maybe I’m not building the lib correctly?

Thank you very much for your assistance

Can we add a Controller like the sum of different controllers

It would be interesting to have multiple mzIdentMLs in the same file. One the way is using a multiple Id Controller that can access to the specific protein id depending on the protein selected. Possibles uses cases Experiment data analysis (charts, etc), Protein inference at Experiment level.. etc

Review The following methods:

  • Number of Peptides identified: Total number of peptide Sequences identified.
  • Number of PeptidoForms: Number of Peptides + modifications + position of the modification.
  • Number of Unique Peptides: Peptides that map uniquely to a Protein ID.
  • Number of identified Spectra: Number of MS/MS with at least one peptide identification.
  • List of anchor proteins: Here we need to report only the proteins that are the anchor of the protein group in mzidentml. We will create another column with other members of the group. Additional Proteins.

These numbers need to be equal in ms-data-core-api and jmzTab.

CachedDataAccessController.getSpectrumById() ClassCastException

In class: CachedDataAccessController

L166

Spectrum getSpectrumById(Comparable id, boolean useCache) {
    return useCache ? (Spectrum) cache.get(CacheEntry.SPECTRUM, id) : null;
}

This method is being used by the PX submission pipeline:

Spectrum spectrum = dataAccessController.getSpectrumById(specId);

java.lang.ClassCastException: java.util.Collections$SynchronizedMap cannot be cast to uk.ac.ebi.pride.utilities.data.core.Spectrum

So the cache.get() is returning a SynchonizedMap instead of just one Spectrum object.

Tobias

Scanlists and precursors are null

Dear,

I am trying to cache MS2 spectra for MS1 spectra of interest. To do this, I convert RAW files into mzml format using msConvert. However, when I'm using the ms-data-core-api to parse the resulting file, it seems all scans/precursors are empty. The spectra are there though...

Could you help me resolve this?

Cheers,

Kenneth

Issue with massive dataset

From Geremy

The main issue we are concerned with is this: when trying to convert an example file from one of our public datasets (ftp://massive.ucsd.edu/MSV000079538/result/20140326_C04A.mzid), we get this stack trace:


java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
at uk.ac.ebi.pride.utilities.data.exporters.MzIdentMLMzTabConverter.getDatabaseName(MzIdentMLMzTabConverter.java:968)
at uk.ac.ebi.pride.utilities.data.exporters.MzIdentMLMzTabConverter.loadProtein(MzIdentMLMzTabConverter.java:775)
at uk.ac.ebi.pride.utilities.data.exporters.MzIdentMLMzTabConverter.fillData(MzIdentMLMzTabConverter.java:186)
at uk.ac.ebi.pride.jmztab.utils.convert.ConvertProvider.getMZTabFile(ConvertProvider.java:82)
at edu.ucsd.mztab.converters.MzIdToMzTabConverter.convert(MzIdToMzTabConverter.java:56)

at edu.ucsd.mztab.ui.MzTabConverter.main(MzTabConverter.java:30)

It looks like a bug related to internal bookkeeping of protein databases. I'm not sure what about the file is causing this problem, but you can examine it at the download link provided above. In any case, it doesn't look like it's an issue we can easily work around by just overriding methods in our subclass of your converter.

Create more unit tests

Create more unit tests. Some users are complaining about the number of unit tests in ms-data-core-api. We should create more unit tests.

issue reported by Massive team

Reported by @jjcarver

We got the latest version of ms-data-core-api (2.0.21) working on our cluster, but it seems the issue we were having (way back with version 2.0.6) has not been resolved yet. Hopefully, this is caused by a bug that you or someone on your team can fix without much difficulty.

Specifically, all we're trying to do is convert a user-uploaded mzid file (found here) to mzTab. We use our own simple Java application to do this, though it doesn't do anything special; it just wraps basic ms-data-core-api code to convert in a standard way:

File mzIdFile = <some input file>;
File mzTabFile = <some output file>;
FileOutputStream output = new FileOutputStream(mzTabFile);
new MzIdentMLMzTabConverter(new MzIdentMLControllerImpl(mzIdFile)).getMZTabFile().printMZTab(output);

When running this simple code on the above mzid file, we get the following log output from ms-data-core-api (before it throws its final exception):

E|RawXMLListener                          |Error trying to instantiate reference resolver: uk.ac.ebi.jmzidml.xml.jaxb.resolver.PeptideEvidenceRefResolver
java.lang.NullPointerException: null
        at java.io.StringReader.<init>(StringReader.java:50)
        at uk.ac.ebi.jmzidml.xml.jaxb.resolver.AbstractReferenceResolver.unmarshal(AbstractReferenceResolver.java:89)
        at uk.ac.ebi.jmzidml.xml.jaxb.resolver.PeptideEvidenceRefResolver.updateObject(PeptideEvidenceRefResolver.java:24)
        at uk.ac.ebi.jmzidml.xml.jaxb.resolver.PeptideEvidenceRefResolver.afterUnmarshal(PeptideEvidenceRefResolver.java:39)
        at uk.ac.ebi.jmzidml.xml.jaxb.unmarshaller.listeners.RawXMLListener.referenceResolving(RawXMLListener.java:187)
        at uk.ac.ebi.jmzidml.xml.jaxb.unmarshaller.listeners.RawXMLListener.afterUnmarshal(RawXMLListener.java:52)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.fireAfterUnmarshal(Loader.java:221)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.leaveElement(StructureLoader.java:265)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(UnmarshallingContext.java:585)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.endElement(SAXConnector.java:165)
        at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
        at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:351)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
        at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:221)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:273)
        at uk.ac.ebi.jmzidml.xml.jaxb.resolver.AbstractReferenceResolver.unmarshal(AbstractReferenceResolver.java:89)
        at uk.ac.ebi.jmzidml.xml.jaxb.resolver.SpectrumIdentificationItemRefRefResolver.updateObject(SpectrumIdentificationItemRefRefResolver.java:24)
        at uk.ac.ebi.jmzidml.xml.jaxb.resolver.SpectrumIdentificationItemRefRefResolver.afterUnmarshal(SpectrumIdentificationItemRefRefResolver.java:39)
        at uk.ac.ebi.jmzidml.xml.jaxb.unmarshaller.listeners.RawXMLListener.referenceResolving(RawXMLListener.java:187)
        at uk.ac.ebi.jmzidml.xml.jaxb.unmarshaller.listeners.RawXMLListener.afterUnmarshal(RawXMLListener.java:52)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.fireAfterUnmarshal(Loader.java:221)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.leaveElement(StructureLoader.java:265)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(UnmarshallingContext.java:585)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.endElement(SAXConnector.java:165)
        at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
        at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:351)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
        at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:221)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:273)
        at uk.ac.ebi.jmzidml.xml.io.MzIdentMLUnmarshaller.generateObject(MzIdentMLUnmarshaller.java:323)
        at uk.ac.ebi.jmzidml.xml.io.MzIdentMLUnmarshaller.unmarshal(MzIdentMLUnmarshaller.java:255)
        at uk.ac.ebi.pride.utilities.data.io.file.MzIdentMLUnmarshallerAdaptor.getIdentificationById(MzIdentMLUnmarshallerAdaptor.java:164)
        at uk.ac.ebi.pride.utilities.data.controller.impl.ControllerImpl.MzIdentMLControllerImpl.getProteinById(MzIdentMLControllerImpl.java:518)
        at uk.ac.ebi.pride.utilities.data.controller.impl.ControllerImpl.CachedDataAccessController.getProteinById(CachedDataAccessController.java:235)
        at uk.ac.ebi.pride.utilities.data.exporters.AbstractMzTabConverter.loadSearchEngineScores(AbstractMzTabConverter.java:299)
        at uk.ac.ebi.pride.utilities.data.exporters.AbstractMzTabConverter.convertMetadata(AbstractMzTabConverter.java:109)
        at uk.ac.ebi.pride.utilities.data.exporters.MzIdentMLMzTabConverter.convertMetadata(MzIdentMLMzTabConverter.java:1056)
        at uk.ac.ebi.pride.jmztab.utils.convert.ConvertProvider.createArchitecture(ConvertProvider.java:53)
        at uk.ac.ebi.pride.jmztab.utils.convert.ConvertProvider.<init>(ConvertProvider.java:39)
        at uk.ac.ebi.pride.utilities.data.exporters.AbstractMzTabConverter.<init>(AbstractMzTabConverter.java:54)
        at uk.ac.ebi.pride.utilities.data.exporters.MzIdentMLMzTabConverter.<init>(MzIdentMLMzTabConverter.java:69)
E|RawXMLListener                          |Error trying to instantiate reference resolver: uk.ac.ebi.jmzidml.xml.jaxb.resolver.SpectrumIdentificationItemRefRefResolver
java.lang.IllegalStateException: Could not instantiate reference resolver: uk.ac.ebi.jmzidml.xml.jaxb.resolver.PeptideEvidenceRefResolver
        at uk.ac.ebi.jmzidml.xml.jaxb.unmarshaller.listeners.RawXMLListener.referenceResolving(RawXMLListener.java:191)
        at uk.ac.ebi.jmzidml.xml.jaxb.unmarshaller.listeners.RawXMLListener.afterUnmarshal(RawXMLListener.java:52)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.fireAfterUnmarshal(Loader.java:221)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.leaveElement(StructureLoader.java:265)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(UnmarshallingContext.java:585)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.endElement(SAXConnector.java:165)
        at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
        at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:351)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
        at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:221)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:273)
        at uk.ac.ebi.jmzidml.xml.jaxb.resolver.AbstractReferenceResolver.unmarshal(AbstractReferenceResolver.java:89)
        at uk.ac.ebi.jmzidml.xml.jaxb.resolver.SpectrumIdentificationItemRefRefResolver.updateObject(SpectrumIdentificationItemRefRefResolver.java:24)
        at uk.ac.ebi.jmzidml.xml.jaxb.resolver.SpectrumIdentificationItemRefRefResolver.afterUnmarshal(SpectrumIdentificationItemRefRefResolver.java:39)
        at uk.ac.ebi.jmzidml.xml.jaxb.unmarshaller.listeners.RawXMLListener.referenceResolving(RawXMLListener.java:187)
        at uk.ac.ebi.jmzidml.xml.jaxb.unmarshaller.listeners.RawXMLListener.afterUnmarshal(RawXMLListener.java:52)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.fireAfterUnmarshal(Loader.java:221)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.leaveElement(StructureLoader.java:265)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(UnmarshallingContext.java:585)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.endElement(SAXConnector.java:165)
        at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
        at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:351)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
        at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:221)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:273)
        at uk.ac.ebi.jmzidml.xml.io.MzIdentMLUnmarshaller.generateObject(MzIdentMLUnmarshaller.java:323)
        at uk.ac.ebi.jmzidml.xml.io.MzIdentMLUnmarshaller.unmarshal(MzIdentMLUnmarshaller.java:255)
        at uk.ac.ebi.pride.utilities.data.io.file.MzIdentMLUnmarshallerAdaptor.getIdentificationById(MzIdentMLUnmarshallerAdaptor.java:164)
        at uk.ac.ebi.pride.utilities.data.controller.impl.ControllerImpl.MzIdentMLControllerImpl.getProteinById(MzIdentMLControllerImpl.java:518)
        at uk.ac.ebi.pride.utilities.data.controller.impl.ControllerImpl.CachedDataAccessController.getProteinById(CachedDataAccessController.java:235)
        at uk.ac.ebi.pride.utilities.data.exporters.AbstractMzTabConverter.loadSearchEngineScores(AbstractMzTabConverter.java:299)
        at uk.ac.ebi.pride.utilities.data.exporters.AbstractMzTabConverter.convertMetadata(AbstractMzTabConverter.java:109)
        at uk.ac.ebi.pride.utilities.data.exporters.MzIdentMLMzTabConverter.convertMetadata(MzIdentMLMzTabConverter.java:1056)
        at uk.ac.ebi.pride.jmztab.utils.convert.ConvertProvider.createArchitecture(ConvertProvider.java:53)
        at uk.ac.ebi.pride.jmztab.utils.convert.ConvertProvider.<init>(ConvertProvider.java:39)
        at uk.ac.ebi.pride.utilities.data.exporters.AbstractMzTabConverter.<init>(AbstractMzTabConverter.java:54)
        at uk.ac.ebi.pride.utilities.data.exporters.MzIdentMLMzTabConverter.<init>(MzIdentMLMzTabConverter.java:69)
----------

Then ms-data-core-api throws this exception, which our application catches:
----------
uk.ac.ebi.pride.utilities.data.controller.DataAccessException: Failed to retrieve protein identification: PROTEINDETECTIONHYPOTHESIS_IGHG4_HUMAN
        at uk.ac.ebi.pride.utilities.data.controller.impl.ControllerImpl.MzIdentMLControllerImpl.getProteinById(MzIdentMLControllerImpl.java:555)
        at uk.ac.ebi.pride.utilities.data.controller.impl.ControllerImpl.CachedDataAccessController.getProteinById(CachedDataAccessController.java:235)
        at uk.ac.ebi.pride.utilities.data.exporters.AbstractMzTabConverter.loadSearchEngineScores(AbstractMzTabConverter.java:299)
        at uk.ac.ebi.pride.utilities.data.exporters.AbstractMzTabConverter.convertMetadata(AbstractMzTabConverter.java:109)
        at uk.ac.ebi.pride.utilities.data.exporters.MzIdentMLMzTabConverter.convertMetadata(MzIdentMLMzTabConverter.java:1056)
        at uk.ac.ebi.pride.jmztab.utils.convert.ConvertProvider.createArchitecture(ConvertProvider.java:53)
        at uk.ac.ebi.pride.jmztab.utils.convert.ConvertProvider.<init>(ConvertProvider.java:39)
        at uk.ac.ebi.pride.utilities.data.exporters.AbstractMzTabConverter.<init>(AbstractMzTabConverter.java:54)
        at uk.ac.ebi.pride.utilities.data.exporters.MzIdentMLMzTabConverter.<init>(MzIdentMLMzTabConverter.java:69)
Caused by: java.lang.IllegalStateException: Could not instantiate reference resolver: uk.ac.ebi.jmzidml.xml.jaxb.resolver.SpectrumIdentificationItemRefRefResolver
        at uk.ac.ebi.jmzidml.xml.jaxb.unmarshaller.listeners.RawXMLListener.referenceResolving(RawXMLListener.java:191)
        at uk.ac.ebi.jmzidml.xml.jaxb.unmarshaller.listeners.RawXMLListener.afterUnmarshal(RawXMLListener.java:52)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.fireAfterUnmarshal(Loader.java:221)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.leaveElement(StructureLoader.java:265)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(UnmarshallingContext.java:585)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.endElement(SAXConnector.java:165)
        at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
        at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:351)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
        at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:221)
        at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:273)
        at uk.ac.ebi.jmzidml.xml.io.MzIdentMLUnmarshaller.generateObject(MzIdentMLUnmarshaller.java:323)
        at uk.ac.ebi.jmzidml.xml.io.MzIdentMLUnmarshaller.unmarshal(MzIdentMLUnmarshaller.java:255)
        at uk.ac.ebi.pride.utilities.data.io.file.MzIdentMLUnmarshallerAdaptor.getIdentificationById(MzIdentMLUnmarshallerAdaptor.java:164)
        at uk.ac.ebi.pride.utilities.data.controller.impl.ControllerImpl.MzIdentMLControllerImpl.getProteinById(MzIdentMLControllerImpl.java:518)
        ... 11 more

I have no idea what these errors mean, so hopefully you can help us with this. This is a standard user-uploaded mzid file which should not pose any problem converting to mzTab.

Thanks,
Jeremy

Question about method MzIdentMLUtils.getSpectrumId

Hi - we have been looking at different ways of parsing mzIdentML files. PRIDEs ms-data-core-api looks to be the most complete solution, for example, other libraries do not deal with the different formats used for spectrum ids.

I have a question regarding the formats used for spectrum ids and the code at:

public static String getSpectrumId(uk.ac.ebi.jmzidml.model.mzidml.SpectraData spectraData, String spectrumID) {
Constants.SpecIdFormat fileIdFormat = getSpectraDataIdFormat(spectraData);
if (fileIdFormat == Constants.SpecIdFormat.MASCOT_QUERY_NUM) {
String rValueStr = spectrumID.replaceAll("query=", "");
String id = null;
if(rValueStr.matches(Constants.INTEGER)){
id = Integer.toString(Integer.parseInt(rValueStr) + 1);
}
return id;
} else if (fileIdFormat == Constants.SpecIdFormat.MULTI_PEAK_LIST_NATIVE_ID) {
String rValueStr = spectrumID.replaceAll("index=", "");
String id;
if(rValueStr.matches(Constants.INTEGER)){
id = Integer.toString(Integer.parseInt(rValueStr) + 1);
return id;
}
return spectrumID;
} else if (fileIdFormat == Constants.SpecIdFormat.SINGLE_PEAK_LIST_NATIVE_ID) {
return spectrumID.replaceAll("file=", "");
} else if (fileIdFormat == Constants.SpecIdFormat.MZML_ID) {
return spectrumID.replaceAll("mzMLid=", "");
} else if (fileIdFormat == Constants.SpecIdFormat.SCAN_NUMBER_NATIVE_ID) {
return spectrumID.replaceAll("scan=", "");
} else {
return spectrumID;
}
}

As I read it, in the case where the fileIdFormat is Constants.SpecIdFormat.MASCOT_QUERY_NUM or Constants.SpecIdFormat.MULTI_PEAK_LIST_NATIVE_ID
then one is added to the spectrum id. I took this to mean that these formats use zero-based indexes whereas the norm for these formats is to use one based indexes.

This is the case for the multiple peak list nativeID format (MS:1000774) which says:

Index is the spectrum number in the file, starting from 0.

However, for the Mascot query number (MS:1001528) it says:

The spectrum (query) number in a Mascot results file, starting from 1.

So, finally getting to my question, why is one added to the spectrum id for Mascot query number format when the corresponding CV term says it is already one-based?

cheers,
Colin

Return the Modifications identified

@sureshhewabi One of the things we need to guarantee in the following implementations is that we return the Set of PTMs for all the identified peptides, not the ones defined for search parameters. This needs to be consistent, we need to have a function that retrieves as CVterms all the modifications, not the one that was used for identification but the actual identified ones.

Parsing of some assays seems to hang

Hello,

I discovered that some projects cause the parsing to hang indefinitely. This seems the case on my end for example for assay 42095.

Cheers,

Kenneth

Compress existing mzml file?

Hi,

i have a multiple .mzml files where the spectrum data is not compressed.
Is it possible to load the files with ms-data-core-api and save it with (e.g.) zlib compression ?

Standardising the the modifications to UNIMOD

We need to standardize the modifications from all the submissions using the pride-mod library. If one modification is not found then we should be thrown an exception.

All the modifications will be finally represented as UNIMOD Terms.

Related with this issue: #35

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.