Skip to content

Commit 4f2a97e

Browse files
committed
Merge branch 'release-2.4.x'
2 parents 1421c1a + 8497e24 commit 4f2a97e

File tree

106 files changed

+14800
-46
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+14800
-46
lines changed

.github/workflows/develop.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches:
66
- develop
7-
- release-2.2.x
7+
- release-*
88

99
jobs:
1010
build:
@@ -27,23 +27,17 @@ jobs:
2727
with:
2828
fetch-depth: '10'
2929
- name: Set up JDK 8
30-
uses: actions/setup-java@v2
30+
uses: actions/setup-java@v3
3131
with:
3232
distribution: 'temurin'
3333
java-version: '8'
3434
cache: 'maven'
35-
- name: Cache Maven packages
36-
uses: actions/cache@v2
37-
with:
38-
path: ~/.m2/repository
39-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
40-
restore-keys: ${{ runner.os }}-maven
4135
- name: Install Samtools
4236
run: sudo apt-get install samtools
4337
- name: Run tests with Maven
4438
run: mvn -T 2 clean install
4539

46-
deploy:
40+
deploy-maven:
4741
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
4842
needs: test
4943
secrets:

.github/workflows/release.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,17 @@ jobs:
2929
with:
3030
fetch-depth: '10'
3131
- name: Set up JDK 8
32-
uses: actions/setup-java@v2
32+
uses: actions/setup-java@v3
3333
with:
3434
distribution: 'temurin'
3535
java-version: '8'
3636
cache: 'maven'
37-
- name: Cache Maven packages
38-
uses: actions/cache@v2
39-
with:
40-
path: ~/.m2/repository
41-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
42-
restore-keys: ${{ runner.os }}-maven
4337
- name: Install Samtools
4438
run: sudo apt-get install samtools
4539
- name: Run tests with Maven
4640
run: mvn -T 2 clean install
4741

48-
deploy:
42+
deploy-maven:
4943
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
5044
needs: test
5145
secrets:
@@ -56,4 +50,4 @@ jobs:
5650

5751
release:
5852
uses: opencb/java-common-libs/.github/workflows/release-github-workflow.yml@develop
59-
needs: deploy
53+
needs: deploy-maven

.github/workflows/task.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,11 @@ jobs:
2626
with:
2727
fetch-depth: '10'
2828
- name: Set up JDK 8
29-
uses: actions/setup-java@v2
29+
uses: actions/setup-java@v3
3030
with:
3131
distribution: 'temurin'
3232
java-version: '8'
3333
cache: 'maven'
34-
- name: Cache Maven packages
35-
uses: actions/cache@v2
36-
with:
37-
path: ~/.m2/repository
38-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
39-
restore-keys: ${{ runner.os }}-maven
4034
- name: Install Samtools
4135
run: sudo apt-get install samtools
4236
- name: Run tests with Maven

biodata-external/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
<parent>
77
<artifactId>biodata</artifactId>
88
<groupId>org.opencb.biodata</groupId>
9-
<version>2.3.0</version>
9+
<version>2.4.0</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

1313
<artifactId>biodata-external</artifactId>
14-
<version>${biodata.version}</version>
1514
<packaging>jar</packaging>
1615

1716
<dependencies>

biodata-formats/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
<parent>
2323
<groupId>org.opencb.biodata</groupId>
2424
<artifactId>biodata</artifactId>
25-
<version>2.3.0</version>
25+
<version>2.4.0</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828

2929
<artifactId>biodata-formats</artifactId>
30-
<version>${biodata.version}</version>
3130
<packaging>jar</packaging>
3231

3332
<dependencies>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package org.opencb.biodata.formats.pubmed;
2+
3+
import javax.xml.bind.JAXBContext;
4+
import javax.xml.bind.JAXBException;
5+
import javax.xml.bind.Marshaller;
6+
import javax.xml.bind.Unmarshaller;
7+
import java.io.*;
8+
import java.util.zip.GZIPInputStream;
9+
10+
public class PubMedParser {
11+
12+
13+
public final static String PUBMED_CONTEXT = "org.opencb.biodata.formats.pubmed.v233jaxb";
14+
15+
public static void saveXMLInfo(Object obj, String filename) throws FileNotFoundException, JAXBException {
16+
JAXBContext jaxbContext;
17+
jaxbContext = JAXBContext.newInstance(PUBMED_CONTEXT);
18+
Marshaller marshaller = jaxbContext.createMarshaller();
19+
marshaller.marshal(obj, new FileOutputStream(filename));
20+
}
21+
22+
/**
23+
* Checks if XML info path exists and loads it
24+
*
25+
* @throws javax.xml.bind.JAXBException
26+
* @throws java.io.IOException
27+
*/
28+
public static Object loadXMLInfo(String filename) throws JAXBException, IOException {
29+
System.setProperty("javax.xml.accessExternalDTD", "all");
30+
31+
Object obj = null;
32+
JAXBContext jaxbContext = JAXBContext.newInstance(PUBMED_CONTEXT);
33+
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
34+
35+
if (filename.endsWith("gz")) {
36+
FileInputStream fis = new FileInputStream(filename);
37+
GZIPInputStream gis = new GZIPInputStream(fis);
38+
obj = unmarshaller.unmarshal(gis);
39+
} else {
40+
obj = unmarshaller.unmarshal(new File(filename));
41+
}
42+
43+
44+
return obj;
45+
}
46+
}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
//
2+
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0.1
3+
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
4+
// Any modifications to this file will be lost upon recompilation of the source schema.
5+
// Generated on: 2022.05.23 at 12:52:46 PM UTC
6+
//
7+
8+
9+
package org.opencb.biodata.formats.pubmed.v233jaxb;
10+
11+
import javax.xml.bind.annotation.*;
12+
import java.util.ArrayList;
13+
import java.util.List;
14+
15+
16+
/**
17+
* <p>Java class for anonymous complex type.
18+
*
19+
* <p>The following schema fragment specifies the expected content contained within this class.
20+
*
21+
* <pre>
22+
* &lt;complexType&gt;
23+
* &lt;complexContent&gt;
24+
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
25+
* &lt;sequence&gt;
26+
* &lt;element ref="{}AbstractText" maxOccurs="unbounded"/&gt;
27+
* &lt;element ref="{}CopyrightInformation" minOccurs="0"/&gt;
28+
* &lt;/sequence&gt;
29+
* &lt;/restriction&gt;
30+
* &lt;/complexContent&gt;
31+
* &lt;/complexType&gt;
32+
* </pre>
33+
*
34+
*
35+
*/
36+
@XmlAccessorType(XmlAccessType.FIELD)
37+
@XmlType(name = "", propOrder = {
38+
"abstractText",
39+
"copyrightInformation"
40+
})
41+
@XmlRootElement(name = "Abstract")
42+
public class Abstract {
43+
44+
@XmlElement(name = "AbstractText", required = true)
45+
protected List<AbstractText> abstractText;
46+
@XmlElement(name = "CopyrightInformation")
47+
protected String copyrightInformation;
48+
49+
/**
50+
* Gets the value of the abstractText property.
51+
*
52+
* <p>
53+
* This accessor method returns a reference to the live list,
54+
* not a snapshot. Therefore any modification you make to the
55+
* returned list will be present inside the JAXB object.
56+
* This is why there is not a <CODE>set</CODE> method for the abstractText property.
57+
*
58+
* <p>
59+
* For example, to add a new item, do as follows:
60+
* <pre>
61+
* getAbstractText().add(newItem);
62+
* </pre>
63+
*
64+
*
65+
* <p>
66+
* Objects of the following type(s) are allowed in the list
67+
* {@link AbstractText }
68+
*
69+
*
70+
*/
71+
public List<AbstractText> getAbstractText() {
72+
if (abstractText == null) {
73+
abstractText = new ArrayList<AbstractText>();
74+
}
75+
return this.abstractText;
76+
}
77+
78+
/**
79+
* Gets the value of the copyrightInformation property.
80+
*
81+
* @return
82+
* possible object is
83+
* {@link String }
84+
*
85+
*/
86+
public String getCopyrightInformation() {
87+
return copyrightInformation;
88+
}
89+
90+
/**
91+
* Sets the value of the copyrightInformation property.
92+
*
93+
* @param value
94+
* allowed object is
95+
* {@link String }
96+
*
97+
*/
98+
public void setCopyrightInformation(String value) {
99+
this.copyrightInformation = value;
100+
}
101+
102+
}

0 commit comments

Comments
 (0)