Skip to content

Commit

Permalink
Merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
René Meier committed May 19, 2020
2 parents 3ec41c9 + 3cc65a5 commit bcc06ae
Show file tree
Hide file tree
Showing 15 changed files with 232 additions and 192 deletions.
12 changes: 6 additions & 6 deletions Documentation/MassBankRecordFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -904,12 +904,12 @@ Example:
AC$MASS_SPECTROMETRY: MASS_ACCURACY 50 ppm over a range of about m/z 100-1000
```

##### 2.4.5 Subtag: MASS\_RANGE\_MZ`
##### 2.4.5 Subtag: MASS\_RANGE\_M/Z`
Mass Range of the Scan (aka Scanning Range or Scan Range) in m/z.

Example:
```
AC$MASS_SPECTROMETRY: MASS_RANGE_MZ 100-1000
AC$MASS_SPECTROMETRY: MASS_RANGE_M/Z 100-1000
```

##### 2.4.5 Subtag: REAGENT\_GAS
Expand Down Expand Up @@ -1321,12 +1321,12 @@ Example:
MS$FOCUSED_ION: PRECURSOR_INT 10000
```

##### 2.5.1 Subtag: PRECURSOR\_MZ
##### 2.5.1 Subtag: PRECURSOR\_M/Z
m/z of Precursor Ion in MSn spectrum.

Example:
```
MS$FOCUSED_ION: PRECURSOR_MZ 289.07123
MS$FOCUSED_ION: PRECURSOR_M/Z 289.07123
```

Calculated exact mass is preferred to the measured accurate mass of the precursor ion.
Expand Down Expand Up @@ -1485,8 +1485,8 @@ PK$PEAK: m/z int. rel.int.
Line 1: fixed string which denotes the format of Line 2 or later.
`PK$PEAK: m/z int. rel.int.`

Line 2 or later: `space` `space` `MZ` `space` `INT` `space` `REL`
- MZ: m/z of the peak.
Line 2 or later: `space` `space` `M/Z` `space` `INT` `space` `REL`
- M/Z: m/z of the peak.
- INT: intensity of the peak.
- REL: an integer from 1 to 999 which denotes relative intensity of the peak.

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 @@ -6,7 +6,7 @@
<parent>
<artifactId>MassBank-Project</artifactId>
<groupId>de.ipb-halle.msbi</groupId>
<version>2.1.3.1</version>
<version>2.1.4</version>
</parent>

<artifactId>MassBank-OpenAPI</artifactId>
Expand All @@ -15,7 +15,7 @@
<name>MassBank-OpenAPI REST interface</name>

<properties>
<swagger-version>2.1.1</swagger-version>
<swagger-version>2.1.2</swagger-version>
<jersey2-version>2.30</jersey2-version>
<jackson-version>2.10.2</jackson-version>
<jetty-version>9.4.24.v20191120</jetty-version>
Expand Down
8 changes: 4 additions & 4 deletions MassBank-Project/MassBank-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>MassBank-Project</artifactId>
<groupId>de.ipb-halle.msbi</groupId>
<version>2.1.3.1</version>
<version>2.1.4</version>
</parent>

<artifactId>MassBank-lib</artifactId>
Expand All @@ -16,7 +16,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.1</version>
<version>2.13.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
Expand All @@ -36,12 +36,12 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
<version>3.10</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.6</version>
<version>2.7</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ public static void main(String[] arguments) throws Exception {
options.addOption("p", "publication", false, "format PUBLICATION tag from given DOI to follow the guidelines of ACS");
options.addOption("n", "name", false, "fix common problems in CH$NAME tag");
options.addOption("l", "link", false, "add links to CH$LINK tag");
options.addOption("r", "rewrite", false, "read and rewrite the file.");
options.addOption("ms_focused_ion", false, "Inspect MS$FOCUSED_ION");
CommandLine cmd = null;
try {
Expand Down Expand Up @@ -446,6 +447,8 @@ else if (record.DEPRECATED()) {
if (cmd.hasOption("l") || cmd.hasOption("a")) recordstring2=doLink(record, recordstring2);
if (cmd.hasOption("ms_focused_ion") || cmd.hasOption("a")) recordstring2=doFocusedIon(record, recordstring2);

if (cmd.hasOption("r")) recordstring2=record.toString();

if (!recordstring.equals(recordstring2)) {
Record record2 = Validator.validate(recordstring2, "");
if (record2 == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.StringReader;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
Expand All @@ -36,6 +37,7 @@
import java.util.List;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.commons.lang3.tuple.Triple;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

Expand Down Expand Up @@ -128,7 +130,7 @@ public class DatabaseManager {
private final static String insertAC_CHROMATOGRAPHY = "INSERT INTO AC_CHROMATOGRAPHY VALUES(?,?,?)";
private final static String insertMS_FOCUSED_ION = "INSERT INTO MS_FOCUSED_ION VALUES(?,?,?)";
private final static String insertMS_DATA_PROCESSING = "INSERT INTO MS_DATA_PROCESSING VALUES(?,?,?)";
private final static String insertPEAK = "INSERT INTO PEAK VALUES(?,?,?,?,?)";
private final static String insertPEAK = "INSERT INTO PEAK VALUES(?,?,?,?,?,?,?)";
private final static String updatePEAKs = "UPDATE PEAK SET PK_ANNOTATION = ? WHERE RECORD = ? AND PK_PEAK_MZ = ?";
private final static String insertANNOTATION_HEADER = "INSERT INTO ANNOTATION_HEADER VALUES(?,?)";

Expand Down Expand Up @@ -401,9 +403,10 @@ public Record getAccessionData(String accessionId) {
}

tmp = this.statementPEAK.executeQuery();
// acc.add("PK$PEAK", null, "m/z int. rel.int.");
while (tmp.next()) {
acc.PK_PEAK_ADD_LINE(Arrays.asList((Double) tmp.getDouble("PK_PEAK_MZ"), (Double) (double) tmp.getFloat("PK_PEAK_INTENSITY"), (Double) (double) tmp.getShort("PK_PEAK_RELATIVE")));
BigDecimal mz = (new BigDecimal(String.valueOf(tmp.getDouble("PK_PEAK_MZ")))).setScale(tmp.getInt("PK_PEAK_MZ_SIGNIFICANT"));
BigDecimal intensity = (new BigDecimal(String.valueOf(tmp.getDouble("PK_PEAK_INTENSITY")))).setScale(tmp.getInt("PK_PEAK_INTENSITY_SIGNIFICANT"));
acc.PK_PEAK_ADD_LINE(Triple.of(mz, intensity, tmp.getInt("PK_PEAK_RELATIVE")));
String PK_ANNOTATION = tmp.getString("PK_ANNOTATION");
if(PK_ANNOTATION != null)
acc.PK_ANNOTATION_ADD_LINE(Arrays.asList(PK_ANNOTATION.split(" ")));
Expand Down Expand Up @@ -432,7 +435,7 @@ public Record getAccessionData(String accessionId) {
set = this.statementCOMPOUND.executeQuery();
while (set.next()) {
acc.CH_FORMULA(set.getString("CH_FORMULA"));
acc.CH_EXACT_MASS(set.getDouble("CH_EXACT_MASS"));
acc.CH_EXACT_MASS(new BigDecimal(set.getDouble("CH_EXACT_MASS")));
acc.CH_SMILES(set.getString("CH_SMILES"));
acc.CH_IUPAC(set.getString("CH_IUPAC"));

Expand Down Expand Up @@ -552,6 +555,7 @@ public Record.Structure getStructureOfAccession(String accessionId) {
public void persistAccessionFile(Record acc) {
boolean bulk=false;

// get contributor ID
Integer conId = -1;
try {
String sql = "SELECT ID FROM CONTRIBUTOR WHERE SHORT_NAME = ?";
Expand Down Expand Up @@ -602,7 +606,7 @@ public void persistAccessionFile(Record acc) {
//System.out.println(System.nanoTime());
statementInsertCompound.setNull(1, java.sql.Types.INTEGER);
statementInsertCompound.setString(2, acc.CH_FORMULA());
statementInsertCompound.setDouble(3, acc.CH_EXACT_MASS());
statementInsertCompound.setDouble(3, acc.CH_EXACT_MASS().doubleValue());
statementInsertCompound.setString(4, acc.CH_SMILES());
statementInsertCompound.setString(5, acc.CH_IUPAC());

Expand Down Expand Up @@ -849,16 +853,17 @@ public void persistAccessionFile(Record acc) {
}

//System.out.println(System.nanoTime());
for (List<Double> peak : acc.PK_PEAK()) {

for (Triple<BigDecimal,BigDecimal,Integer> peak : acc.PK_PEAK()) {
statementInsertPEAK.setString(1, accession);
statementInsertPEAK.setDouble(2, peak.get(0));
statementInsertPEAK.setFloat(3, (float)(double) peak.get(1));
statementInsertPEAK.setShort(4, (short)(double) peak.get(2));
statementInsertPEAK.setNull(5, java.sql.Types.VARCHAR);
// statementInsertPEAK.setNull(5, java.sql.Types.VARCHAR);
// statementInsertPEAK.setNull(6, java.sql.Types.SMALLINT);
// statementInsertPEAK.setNull(7, java.sql.Types.FLOAT);
// statementInsertPEAK.setNull(8, java.sql.Types.FLOAT);
statementInsertPEAK.setDouble(2, peak.getLeft().doubleValue());
statementInsertPEAK.setInt(3, peak.getLeft().scale());

statementInsertPEAK.setDouble(4, peak.getMiddle().doubleValue());
statementInsertPEAK.setInt(5, peak.getMiddle().scale());

statementInsertPEAK.setInt(6, peak.getRight().intValue());
statementInsertPEAK.setNull(7, java.sql.Types.VARCHAR);
// statementInsertPEAK.executeUpdate();
statementInsertPEAK.addBatch();
}
Expand Down
Loading

0 comments on commit bcc06ae

Please sign in to comment.