Skip to content

Commit 2face9e

Browse files
committed
DrugbankParser: corrected file dependency
1 parent 5a3394c commit 2face9e

Some content is hidden

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

56 files changed

+148
-115
lines changed

parsers.iml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
44
<output url="file://$MODULE_DIR$/target/classes" />
55
<output-test url="file://$MODULE_DIR$/target/test-classes" />
6-
<exclude-output />
76
<content url="file://$MODULE_DIR$">
87
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
9-
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
108
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
9+
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
1110
<excludeFolder url="file://$MODULE_DIR$/target" />
1211
</content>
1312
<orderEntry type="inheritedJdk" />

src/main/java/drugbank/DrugbankParser.java

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
package drugbank;
22

3-
import com.fasterxml.jackson.databind.ObjectMapper;
43
import drugbank.drugbank.DrugInteraction;
4+
import drugbank.xjc20131209.*;
55

6+
import javax.xml.bind.JAXBException;
67
import java.nio.file.Path;
78
import java.util.ArrayList;
9+
import java.util.HashMap;
810
import java.util.List;
11+
import java.util.Map;
912

1013
/**
1114
* Created with IntelliJ IDEA.
@@ -17,11 +20,36 @@
1720

1821
public class DrugbankParser {
1922

20-
public List<DrugInteraction> parse(Object drugbank, String species, Path outPath) {
23+
public List<DrugInteraction> parse(Drugs drugs, String species, Path outPath) throws JAXBException {
2124

2225
List<DrugInteraction> drugInteractions = new ArrayList();
2326

24-
27+
System.out.println("Number of drugs: "+ drugs.getDrug().size());
28+
System.out.println("Number of partners: "+ drugs.getPartners().getPartner().size());
29+
30+
List<PartnerType> partnertype = drugs.getPartners().getPartner();
31+
32+
/**
33+
* Store all Partner Uniprot ID into a Map to speed up searching
34+
* Partner ID --> Uniprot ID
35+
*/
36+
Map<Integer, String> partnerTypesMap = new HashMap<Integer, String>(20000);
37+
for (PartnerType partner: drugs.getPartners().getPartner()){
38+
System.out.println(partner);
39+
// for (IdentifiersType.ExternalIdentifier xid: partner.getExternalIdentifiers().getExternalIdentifier()){
40+
// if (xid != null && xid.getResource().equalsIgnoreCase("UniProtKB")){
41+
// partnerTypesMap.put(partner.getId().intValue(), xid.getIdentifier());
42+
// }
43+
// }
44+
}
45+
46+
// for (x partner:drugs.getPartners()){
47+
//
48+
// }
49+
50+
// DrugbankXMLParser dxp = new DrugbankXMLParser();
51+
// drugbank = () dxp.loadXMLInfo("/home/mbleda/projects/2013_variability_drug_binding_proteins/1-data/drugbank/data_to_drugbank_parser/drugbank_20131209.xml");
52+
//
2553

2654

2755
return drugInteractions;

src/main/java/drugbank/DrugbankXMLParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
public class DrugbankXMLParser {
2121

22-
private final static String DRUGBANK_CONTEXT = "drugbank.xjc20131209";
22+
public final static String DRUGBANK_CONTEXT = "drugbank.xjc20131209";
2323

2424
public static void saveXMLInfo(Object obj, String filename) throws FileNotFoundException, JAXBException {
2525
JAXBContext jaxbContext;

src/main/java/drugbank/xjc20131209/AffectedOrganisms.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
33
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
44
// Any modifications to this file will be lost upon recompilation of the source schema.
5-
// Generated on: 2013.12.09 at 12:57:02 PM CET
5+
// Generated on: 2013.12.10 at 11:00:55 AM CET
66
//
77

88

9-
package xjc20131209;
9+
package drugbank.xjc20131209;
1010

1111
import java.util.ArrayList;
1212
import java.util.List;

src/main/java/drugbank/xjc20131209/AhfsCodes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
33
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
44
// Any modifications to this file will be lost upon recompilation of the source schema.
5-
// Generated on: 2013.12.09 at 12:57:02 PM CET
5+
// Generated on: 2013.12.10 at 11:00:55 AM CET
66
//
77

88

9-
package xjc20131209;
9+
package drugbank.xjc20131209;
1010

1111
import java.util.ArrayList;
1212
import java.util.List;

src/main/java/drugbank/xjc20131209/AtcCodes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
33
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
44
// Any modifications to this file will be lost upon recompilation of the source schema.
5-
// Generated on: 2013.12.09 at 12:57:02 PM CET
5+
// Generated on: 2013.12.10 at 11:00:55 AM CET
66
//
77

88

9-
package xjc20131209;
9+
package drugbank.xjc20131209;
1010

1111
import java.util.ArrayList;
1212
import java.util.List;

src/main/java/drugbank/xjc20131209/BondActionsType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
33
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
44
// Any modifications to this file will be lost upon recompilation of the source schema.
5-
// Generated on: 2013.12.09 at 12:57:02 PM CET
5+
// Generated on: 2013.12.10 at 11:00:55 AM CET
66
//
77

88

9-
package xjc20131209;
9+
package drugbank.xjc20131209;
1010

1111
import java.util.ArrayList;
1212
import java.util.List;

src/main/java/drugbank/xjc20131209/BondType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
33
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
44
// Any modifications to this file will be lost upon recompilation of the source schema.
5-
// Generated on: 2013.12.09 at 12:57:02 PM CET
5+
// Generated on: 2013.12.10 at 11:00:55 AM CET
66
//
77

88

9-
package xjc20131209;
9+
package drugbank.xjc20131209;
1010

1111
import java.math.BigInteger;
1212
import javax.xml.bind.annotation.XmlAccessType;

src/main/java/drugbank/xjc20131209/Brands.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
33
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
44
// Any modifications to this file will be lost upon recompilation of the source schema.
5-
// Generated on: 2013.12.09 at 12:57:02 PM CET
5+
// Generated on: 2013.12.10 at 11:00:55 AM CET
66
//
77

88

9-
package xjc20131209;
9+
package drugbank.xjc20131209;
1010

1111
import java.util.ArrayList;
1212
import java.util.List;

src/main/java/drugbank/xjc20131209/Carriers.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
33
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
44
// Any modifications to this file will be lost upon recompilation of the source schema.
5-
// Generated on: 2013.12.09 at 12:57:02 PM CET
5+
// Generated on: 2013.12.10 at 11:00:55 AM CET
66
//
77

88

9-
package xjc20131209;
9+
package drugbank.xjc20131209;
1010

1111
import java.util.ArrayList;
1212
import java.util.List;

0 commit comments

Comments
 (0)