Skip to content

Commit

Permalink
Merge pull request #371 from MassBank/release-2.2.2
Browse files Browse the repository at this point in the history
Release 2.2.2
  • Loading branch information
meier-rene authored Feb 2, 2023
2 parents 5b64fcf + 3675572 commit 1c5ca71
Show file tree
Hide file tree
Showing 40 changed files with 99,802 additions and 433 deletions.
23 changes: 14 additions & 9 deletions Documentation/MassBankRecordFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
MassBank Consortium (May 13, 2022)

#### Updated
- **May 2022**: With version 2.6.0 MassBank introduces a new ACCESSION scheme.ch offers more freedom for contributors in the naming of their records. The new scheme consists of three fields separated by 'minus' signs and follows the format ID-[A-Z0–9_]{1,32}-[A-Z0–9_]{1,64}. The field ID will always be MSBNK for official MassBank releases. The second field is the contributor ID and is usually assigned by MassBank staff. Now it can be up to 32 characters long and is comprised of letters, digits and the '_' sign. The third field is the ID assigned by the contributor and can be up to 64 characters long and is also comprised of letters, digits and the '_' sign.
- **May 2022**: With version 2.6.0 MassBank introduces a new ACCESSION scheme. It offers more freedom for contributors in the naming of their records. The new scheme consists of three fields separated by 'minus' signs and follows the format ID-[A-Z0–9_]{1,32}-[A-Z0–9_]{1,64}. The field ID will always be MSBNK for official MassBank releases. The second field is the contributor ID and is usually assigned by MassBank staff. Now it can be up to 32 characters long and is comprised of letters, digits and the '_' sign. The third field is the ID assigned by the contributor and can be up to 64 characters long and is also comprised of letters, digits and the '_' sign.
- **July 2021**: Move to a semantic versioning scheme X.Y.Z with Z increases for changes in the description or fixing of typos, Y increases for changes that also change the Validator software and X increases with changes that break compatibility with older versions of the software.
- **March 2020**: Add new tag for the inlet type.
- **October 2019**: Add UVPD dissociation method and some undocumented or new tags.
Expand All @@ -26,13 +26,19 @@ Multiple line information:

Last line of a MassBank Record is `//`.

#### Controled Vocabulary terms
General format is `[CV label, accession, name, value]`. Any field that is not available MUST be left empty. Should the name contain commas, quotes MUST be added to avoid problems with parsing.
Example:
```
[CV label, accession, name, value]
[MS, MS:1000443, Mass Analyzer Type, Orbitrap]
[MS, MS:1001477, SpectraST,]
[label, accession, “first part of the param name, second part of the name”, value]
```

### 1.2 Order of Information
MassBank Record Information in a MassBank Record is arranged in a fixed order (see Section 2).

### 1.3 Others
`[MS : space value ]` is the HUPO-PSI ID in [OLS](https://www.ebi.ac.uk/ols/index).


## Table 1. MassBank Record Format (Summary)
<table>
<tr>
Expand Down Expand Up @@ -758,8 +764,7 @@ Example:
```
AC$MASS_SPECTROMETRY: ION_MODE POSITIVE
```

Either of POSITIVE or NEGATIVE is allowed. Cross-reference to HUPO-PSI: POSITIVE [MS:1000030] or NEGATIVE [MS:1000129]; Ion mode [MS:1000465]
Either of POSITIVE or NEGATIVE is allowed. Cross-reference to HUPO-PSI: POSITIVE [MS, MS:1000130, positive scan,] or NEGATIVE [MS:1000129, negative scan,]; ION_MODE [MS, MS:1000465, scan polarity,]

#### <a name="2.4.5"></a>2.4.5 AC$MASS\_SPECTROMETRY: subtag Description
Other Optional Experimental Methods and Conditions of Mass Spectrometry.
Expand Down Expand Up @@ -1372,13 +1377,13 @@ Types currently used in MassBank are:
[2M-H-C6H10O5]-
```

##### 2.5.1 Subtag: PRECURSOR\_INT
##### 2.5.1 Subtag: PRECURSOR\_INTENSITY
Intensity of Focused Ion.

Example:

```
MS$FOCUSED_ION: PRECURSOR_INT 10000
MS$FOCUSED_ION: PRECURSOR_INTENSITY 10000
```

##### 2.5.1 Subtag: PRECURSOR\_M/Z
Expand Down
4 changes: 2 additions & 2 deletions MassBank-Project/MassBank-OpenAPI/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>de.ipb-halle.msbi</groupId>
<artifactId>MassBank-Project</artifactId>
<version>2.2</version>
<version>2.2.2</version>
</parent>

<artifactId>MassBank-OpenAPI</artifactId>
Expand Down Expand Up @@ -113,7 +113,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.7.0</version>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
11 changes: 9 additions & 2 deletions MassBank-Project/MassBank-lib/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>MassBank-Project</artifactId>
<groupId>de.ipb-halle.msbi</groupId>
<version>2.2</version>
<version>2.2.2</version>
</parent>

<artifactId>MassBank-lib</artifactId>
Expand Down Expand Up @@ -85,6 +87,11 @@
<groupId>io.github.dan2097</groupId>
<artifactId>jna-inchi-all</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-distribution</artifactId>
<version>5.5.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand Down
139 changes: 139 additions & 0 deletions MassBank-Project/MassBank-lib/src/main/java/massbank/CVUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
package massbank;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.net.URL;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Set;

import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLAxiom;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.reasoner.BufferingMode;
import org.semanticweb.owlapi.reasoner.InferenceType;
import org.semanticweb.owlapi.reasoner.OWLReasoner;
import org.semanticweb.owlapi.reasoner.OWLReasonerFactory;
import org.semanticweb.owlapi.reasoner.SimpleConfiguration;
import org.semanticweb.owlapi.reasoner.structural.StructuralReasoner;
import org.semanticweb.owlapi.reasoner.NodeSet;
import org.semanticweb.owlapi.model.OWLClass;


/**
* Controled vocabulary handler.
*
* @author rmeier
* @version 07-10-2022
*/
public final class CVUtil {
private static CVUtil instance;
private static Object mutex = new Object();
//Ontology ontology;

private CVUtil(){
// try (BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("cv/psi-ms.obo")))) {
// OboParser parser = new OboParser();
// try {
// ontology = parser.parseOBO(reader, "Mass spectrometry ontology", "A structured controlled vocabulary for the annotation of experiments concerned with proteomics mass spectrometry.");
// } catch (ParseException ex) {
// System.err.println("Parsing exception: " + ex.getLocalizedMessage());
// }
// } catch (IOException e) {
// e.printStackTrace();
// }
// OWLOntologyManager man = OWLManager.createOWLOntologyManager();
// OWLOntology o=null;
// try {
// o = man.loadOntology(IRI.create("https://protege.stanford.edu/ontologies/pizza/pizza.owl"));
// o = man.loadOntologyFromOntologyDocument(getClass().getClassLoader().getResourceAsStream("cv/psi-ms.owl"));
// } catch (OWLOntologyCreationException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
// for(OWLAxiom ax:o.getLogicalAxioms()) {
// System.out.println(ax);
// }
// System.out.println("Axioms: "+o.getAxiomCount()+", Format:"+man.getOntologyFormat(o));
// ArrayList t = new ArrayList<OWLAxiom>();
// for(OWLClass ax:o.getClassesInSignature()) {
// t.add(ax);
// System.out.println(ax.getIRI());
// }


// o.signature().filter((e->(!e.isBuiltIn()&&e.getIRI().getFragment().startsWith("M"))));
//o.signature().filter((e->(!e.isBuiltIn()&&e.getIRI().getFragment().startsWith("M")))).forEach(System.out::println);
// System.out.println(o);
//OWLReasonerFactory rf = new ReasonerFactory();
//OWLReasoner r = rf.createReasoner(o);
//
// OWLDataFactory df = man.getOWLDataFactory();
// OWLReasoner r = new StructuralReasoner(o, new SimpleConfiguration(),BufferingMode.BUFFERING);
// System.out.println(df.getOWLClass(IRI.create("http://purl.obolibrary.org/obo/MS_1000044")).getEntityType());
// System.out.println(df.getOWLClass(IRI.create("http://purl.obolibrary.org/obo/MS_1000044")).getIRI());
// //NodeSet<OWLClass> result = r.getSuperClasses(df.getOWLClass(IRI.create("http://www.co-ode.org/ontologies/pizza/pizza.owl#Hot")), false);
// NodeSet<OWLClass> result = r.getSuperClasses(df.getOWLClass(IRI.create("http://purl.obolibrary.org/obo/MS_1000044")), true);
// System.out.println(result);
// ((StructuralReasoner) r).dumpClassHierarchy(false);
// r.precomputeInferences(InferenceType.CLASS_HIERARCHY);
// r.getSubClasses(df.getOWLClass("http://purl.obolibrary.org/obo/MS:1000044"), false).forEach(System.out::println);
}

public static CVUtil get(){
CVUtil result = instance;
if (result == null) {
synchronized (mutex) {
result = instance;
if (result == null)
instance = result = new CVUtil();
}
}
return result;
}

// public boolean containsTerm(String name) {
// return ontology.containsTerm(name);
// }
//
// public Term getTerm(String name) {
// Term term = ontology.getTerm(name);
// return term;
// }

public boolean termIsA(String name, String isA) {
// Term term = ontology.getTerm(name);
// Set<Term> keys = ontology.getTerms();
// System.out.println(keys.toString());
// System.out.println(term.getName());
// System.out.println(term.getDescription());
// System.out.println(term.getAnnotation());
// System.out.println(term.getSynonyms().toString());
// System.out.println(term.getOntology());
// System.out.println(term.getOntology());
//
// System.out.println(ontology.getTriples(ontology.getTerm("MS:1003294"), ontology.getTerm("MS:1000250") , ontology.getTerm(IS_A)));
// System.out.println(ontology.getTriples(ontology.getTerm("MS:1000250"), ontology.getTerm("MS:1003294") , ontology.getTerm(IS_A)));
// System.out.println(ontology.getTriples(ontology.getTerm("MS:1003294"), ontology.getTerm("MS:1000044") , ontology.getTerm(IS_A)));
// System.out.println(ontology.getTerm("MS:1003294").getAnnotation());
//

// assertTrue(getAnnotationForTerm(ontology).containsProperty(NAMESPACE));
// assertEquals("sequence", getAnnotationForTerm(ontology).getProperty(NAMESPACE));
// getAnnotationForTerm(ontology).getProperty(NAMESPACE)
// //(List<String>) getAnnotationForTerm(ontology).getProperty(ALT_ID);




return true;
}

}
Loading

0 comments on commit 1c5ca71

Please sign in to comment.