Skip to content

Commit cf4307f

Browse files
committed
updates
1 parent 975aaab commit cf4307f

40 files changed

+340
-520
lines changed

.idea/libraries/lib.xml

+10-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-1.47 MB
Binary file not shown.
Binary file not shown.
-336 KB
Binary file not shown.
Binary file not shown.
-193 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-45.7 KB
Binary file not shown.

lib/org.bridgedb.bio.jar

-39.6 KB
Binary file not shown.

lib/org.bridgedb.gui.jar

-25.9 KB
Binary file not shown.

lib/org.bridgedb.jar

-48.5 KB
Binary file not shown.

lib/org.bridgedb.rdb.construct.jar

-16 KB
Binary file not shown.

lib/org.bridgedb.rdb.jar

-25.2 KB
Binary file not shown.
-9.78 KB
Binary file not shown.

modules/org.pathvisio.core/META-INF/MANIFEST.MF

+5-17
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,12 @@ Export-Package: org.pathvisio.core,
1313
org.pathvisio.core.preferences,
1414
org.pathvisio.core.util,
1515
org.pathvisio.core.view
16-
Require-Bundle: com.springsource.org.jdom;bundle-version="2.0.1",
16+
Require-Bundle: org.apache.servicemix.bundles.jdom;bundle-version="2.0.6",
1717
org.pathvisio.pdftranscoder;bundle-version="1.7.0",
18-
org.bridgedb;bundle-version="2.3.0",
19-
org.bridgedb.bio;bundle-version="2.3.0",
20-
org.bridgedb.rdb;bundle-version="2.3.0",
21-
org.apache.batik.bridge;bundle-version="1.7.0",
22-
org.apache.batik.css;bundle-version="1.7.0",
23-
org.apache.batik.dom;bundle-version="1.7.0",
24-
org.apache.batik.dom.svg;bundle-version="1.7.0",
25-
org.apache.batik.ext.awt;bundle-version="1.7.0",
26-
org.apache.batik.extension;bundle-version="1.7.0",
27-
org.apache.batik.parser;bundle-version="1.7.0",
28-
org.apache.batik.svggen;bundle-version="1.7.0",
29-
org.apache.batik.transcoder;bundle-version="1.7.0",
30-
org.apache.batik.util;bundle-version="1.7.0",
31-
org.apache.batik.util.gui;bundle-version="1.7.0",
32-
org.apache.batik.xml;bundle-version="1.7.0",
33-
javax.xml;bundle-version="1.3.4",
18+
org.bridgedb;bundle-version="3.0.13",
19+
org.bridgedb.bio;bundle-version="3.0.13",
20+
org.bridgedb.rdb;bundle-version="3.0.13",
21+
org.apache.servicemix.bundles.batik;bundle-version="1.14",
3422
org.apache.xml.resolver;bundle-version="1.2.0",
3523
org.apache.xml.serializer;bundle-version="2.7.1",
3624
org.w3c.css.sac;bundle-version="1.3.1",

modules/org.pathvisio.core/src/org/pathvisio/core/model/DataNodeListExporter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class DataNodeListExporter implements PathwayExporter {
4343
* code as used in the pathway
4444
*/
4545
public static final String DB_ORIGINAL = "original"; //Use the id/code as in database
46-
private DataSource resultDs = DataSource.getBySystemCode(DB_ORIGINAL);
46+
private DataSource resultDs = DataSource.getExistingBySystemCode(DB_ORIGINAL);
4747
private String multiRefSep = ", ";
4848

4949
/**
@@ -74,7 +74,7 @@ public String getMultiRefSep() {
7474
*/
7575
public void setResultCode(String code)
7676
{
77-
resultDs = DataSource.getBySystemCode (code);
77+
resultDs = DataSource.getExistingBySystemCode (code);
7878
}
7979

8080
public void setResultDataSource (DataSource value)

modules/org.pathvisio.core/src/org/pathvisio/core/model/EUGeneExporter.java

+50-82
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,17 @@
2727

2828
import org.bridgedb.DataSource;
2929
import org.bridgedb.Xref;
30-
import org.bridgedb.bio.BioDataSource;
3130
import org.pathvisio.core.debug.Logger;
3231

3332
/**
34-
* Exports to pathway format understood by the EuGene
35-
* pathway statistics program.
36-
* This format is basically a list of genes in a flat text file
33+
* Exports to pathway format understood by the EuGene pathway statistics
34+
* program. This format is basically a list of genes in a flat text file
3735
* preceded by 3 header lines.
3836
*
39-
* EuGene supports several id systems but has its own naming
40-
* for them, this exporter also handles the translation.
37+
* EuGene supports several id systems but has its own naming for them, this
38+
* exporter also handles the translation.
4139
*/
42-
public class EUGeneExporter implements PathwayExporter
43-
{
40+
public class EUGeneExporter implements PathwayExporter {
4441
public String[] getExtensions() {
4542
return new String[] { "pwf" };
4643
}
@@ -53,7 +50,7 @@ public void doExport(File file, Pathway pathway) throws ConverterException {
5350
EUGenePathway eugPathway = new EUGenePathway(pathway);
5451
try {
5552
eugPathway.writeToEUGene(file);
56-
} catch(Exception e) {
53+
} catch (Exception e) {
5754
throw new ConverterException(e);
5855
}
5956
}
@@ -62,11 +59,11 @@ private static class EUGenePathway {
6259
Logger log = Logger.log;
6360
Pathway pathway;
6461

65-
DataSource system; //The annotation system
62+
DataSource system; // The annotation system
6663

6764
List<Xref> refs;
6865

69-
public EUGenePathway(Pathway p) {
66+
public EUGenePathway(Pathway p) {
7067
pathway = p;
7168
read();
7269
}
@@ -77,30 +74,27 @@ void writeToEUGene(File file) throws FileNotFoundException {
7774
StringBuilder missedGenes = new StringBuilder();
7875
euGeneSystem = getEUGeneSystem();
7976

80-
for(Xref ref : refs)
81-
{
77+
for (Xref ref : refs) {
8278
DataSource ds = ref.getDataSource();
8379
String id = ref.getId();
84-
if(ds == system)
85-
{ //Check if gene is of most occuring system
80+
if (ds == system) { // Check if gene is of most occuring system
8681
geneString.append(id + "\n");
87-
}
88-
else
89-
{
82+
} else {
9083
missedGenes.append(id + "|" + ds.getSystemCode() + "; ");
9184
log.error("id '" + id + "' differs from pathway annotation system");
9285
}
9386
}
9487

95-
//Write the file
88+
// Write the file
9689
PrintStream out = null;
9790
out = new PrintStream(file);
9891

99-
//Print the data
92+
// Print the data
10093
out.println("//PATHWAY_NAME = " + pathway.getMappInfo().getMapInfoName());
10194
out.println("//PATHWAY_SOURCE = GenMAPP");
10295
out.println("//PATHWAY_MARKER = " + euGeneSystem);
103-
if(missedGenes.length() > 0) out.println("//LOST_DURING_CONVERSION: " + missedGenes );
96+
if (missedGenes.length() > 0)
97+
out.println("//LOST_DURING_CONVERSION: " + missedGenes);
10498
out.print(geneString);
10599

106100
out.close();
@@ -110,105 +104,79 @@ void read() {
110104
refs = new ArrayList<Xref>();
111105
Map<DataSource, Integer> codeCount = new HashMap<DataSource, Integer>();
112106

113-
for(PathwayElement elm : pathway.getDataObjects()) {
114-
if(elm.getObjectType() != ObjectType.DATANODE) {
115-
continue; //Skip non-datanodes
107+
for (PathwayElement elm : pathway.getDataObjects()) {
108+
if (elm.getObjectType() != ObjectType.DATANODE) {
109+
continue; // Skip non-datanodes
116110
}
117111
Xref ref = elm.getXref();
118112
DataSource ds = ref.getDataSource();
119-
if(ref == null || ref.getId().equals("") || ref.getDataSource() == null)
120-
{
121-
continue; //Skip datanodes with incomplete annotation
113+
if (ref == null || ref.getId().equals("") || ref.getDataSource() == null) {
114+
continue; // Skip datanodes with incomplete annotation
122115
}
123-
refs.add (ref);
116+
refs.add(ref);
124117

125-
//Increase code count for this code
126-
if(codeCount.containsKey(ref.getDataSource()))
118+
// Increase code count for this code
119+
if (codeCount.containsKey(ref.getDataSource()))
127120
codeCount.put(ds, codeCount.get(ds) + 1);
128-
else codeCount.put(ds, 1);
121+
else
122+
codeCount.put(ds, 1);
129123
}
130124

131-
//Get most occuring systemcode
125+
// Get most occuring systemcode
132126
DataSource maxCode = null;
133-
for(DataSource ds : codeCount.keySet())
134-
{
135-
if(maxCode == null || codeCount.get(ds) > codeCount.get(maxCode))
136-
{
127+
for (DataSource ds : codeCount.keySet()) {
128+
if (maxCode == null || codeCount.get(ds) > codeCount.get(maxCode)) {
137129
maxCode = ds;
138130
}
139131
}
140132
system = maxCode;
141133

142-
if(system == null) { //May occur when no identifiers available
143-
system = BioDataSource.ENSEMBL;
134+
if (system == null) { // May occur when no identifiers available
135+
system = DataSource.getByCompactIdentifierPrefix("ensembl");
144136
}
145137

146-
if(codeCount.keySet().size() > 1) {
147-
log.warn("\tThis pathway contains genes with different SystemCodes; '" +
148-
maxCode + "' has the highest occurence and is therefore chosen as PATHWAY_MARKER" +
149-
" for the EUGene file\n\t Other SystemCodes found and their occurences: "
150-
+ codeCount);
138+
if (codeCount.keySet().size() > 1) {
139+
log.warn("\tThis pathway contains genes with different SystemCodes; '" + maxCode
140+
+ "' has the highest occurence and is therefore chosen as PATHWAY_MARKER"
141+
+ " for the EUGene file\n\t Other SystemCodes found and their occurences: " + codeCount);
151142
}
152143

153144
}
154145

155146
String getEUGeneSystem() {
156-
if(systemMappings.containsKey(system))
157-
{
147+
if (systemMappings.containsKey(system)) {
158148
return systemMappings.get(system);
159-
}
160-
else
161-
{
149+
} else {
162150
return system.getFullName();
163151
}
164152
}
165153
}
166154

167155
private static Map<DataSource, String> systemMappings;
168-
private static final String[] EU_GENE_SYSTEMS = new String[]
169-
{
170-
"ENSEMBL_GENE_ID",
171-
"UNIPROT",
172-
"ENTREZ",
173-
"UNIGENE",
174-
"AFFYMETRIX",
175-
"AGILENT",
176-
"HGNC",
177-
"PDB_ID",
178-
"SGD_ID"
179-
};
180-
private static final DataSource[] GENMAPP_SYSTEMS = new DataSource[]
181-
{
182-
BioDataSource.ENSEMBL,
183-
BioDataSource.UNIPROT,
184-
BioDataSource.ENTREZ_GENE,
185-
BioDataSource.UNIGENE,
186-
BioDataSource.AFFY,
187-
BioDataSource.AGILENT,
188-
BioDataSource.HUGO,
189-
BioDataSource.PDB,
190-
BioDataSource.SGD
191-
};
192-
193-
static
194-
{
156+
private static final String[] EU_GENE_SYSTEMS = new String[] { "ENSEMBL_GENE_ID", "UNIPROT", "ENTREZ", "UNIGENE",
157+
"AFFYMETRIX", "AGILENT", "HGNC", "PDB_ID", "SGD_ID" };
158+
private static final DataSource[] GENMAPP_SYSTEMS = new DataSource[] {
159+
DataSource.getByCompactIdentifierPrefix("ensembl"), DataSource.getByCompactIdentifierPrefix("uniprot"),
160+
DataSource.getByCompactIdentifierPrefix("ncbigene"), DataSource.getByCompactIdentifierPrefix("unigene"),
161+
DataSource.getByCompactIdentifierPrefix("affy.probeset"), DataSource.getExistingByFullName("Agilent"), // TODO
162+
DataSource.getExistingByFullName("HGNC"), // TODO
163+
DataSource.getByCompactIdentifierPrefix("pdb"), DataSource.getByCompactIdentifierPrefix("sgd") };
164+
165+
static {
195166
systemMappings = new HashMap<DataSource, String>();
196-
for(int i = 0; i < EU_GENE_SYSTEMS.length; i++)
197-
{
167+
for (int i = 0; i < EU_GENE_SYSTEMS.length; i++) {
198168
systemMappings.put(GENMAPP_SYSTEMS[i], EU_GENE_SYSTEMS[i]);
199169
}
200170
}
201171

202172
@Override
203-
public List<String> getWarnings()
204-
{
173+
public List<String> getWarnings() {
205174
return Collections.emptyList();
206175
}
207176

208177
@Override
209-
public void doExport(File file, Pathway pathway, int zoom)
210-
throws ConverterException {
178+
public void doExport(File file, Pathway pathway, int zoom) throws ConverterException {
211179
// TODO Auto-generated method stub
212-
180+
213181
}
214182
}

modules/org.pathvisio.core/src/org/pathvisio/core/model/GpmlFormat200X.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ protected void mapDataNode(PathwayElement o, Element e) throws ConverterExceptio
382382
o.setDataNodeType (getAttribute("DataNode", "Type", e));
383383
Element xref = e.getChild ("Xref", e.getNamespace());
384384
o.setElementID (getAttribute("DataNode.Xref", "ID", xref));
385-
o.setDataSource (DataSource.getByFullName (getAttribute("DataNode.Xref", "Database", xref)));
385+
o.setDataSource (DataSource.getExistingByFullName (getAttribute("DataNode.Xref", "Database", xref)));
386386
}
387387

388388
protected void mapStateData(PathwayElement o, Element e) throws ConverterException

modules/org.pathvisio.core/src/org/pathvisio/core/model/GpmlFormat2010a.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ protected void mapDataNode(PathwayElement o, Element e) throws ConverterExceptio
563563
o.setDataNodeType (getAttribute("DataNode", "Type", e));
564564
Element xref = e.getChild ("Xref", e.getNamespace());
565565
o.setElementID (getAttribute("DataNode.Xref", "ID", xref));
566-
o.setDataSource (DataSource.getByFullName (getAttribute("DataNode.Xref", "Database", xref)));
566+
o.setDataSource (DataSource.getExistingByFullName (getAttribute("DataNode.Xref", "Database", xref)));
567567
}
568568

569569
protected void updateDataNode(PathwayElement o, Element e) throws ConverterException
@@ -604,7 +604,7 @@ protected void mapStateData(PathwayElement o, Element e) throws ConverterExcepti
604604
o.setGraphRef(getAttribute("State", "GraphRef", e));
605605
Element xref = e.getChild ("Xref", e.getNamespace());
606606
o.setElementID (getAttribute("State.Xref", "ID", xref));
607-
o.setDataSource (DataSource.getByFullName (getAttribute("State.Xref", "Database", xref)));
607+
o.setDataSource (DataSource.getExistingByFullName (getAttribute("State.Xref", "Database", xref)));
608608
}
609609

610610
protected void updateStateData(PathwayElement o, Element e) throws ConverterException

modules/org.pathvisio.core/src/org/pathvisio/core/model/GpmlFormat2013a.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ protected void mapDataNode(PathwayElement o, Element e) throws ConverterExceptio
606606
o.setDataNodeType (getAttribute("DataNode", "Type", e));
607607
Element xref = e.getChild ("Xref", e.getNamespace());
608608
o.setElementID (getAttribute("DataNode.Xref", "ID", xref));
609-
o.setDataSource (DataSource.getByFullName (getAttribute("DataNode.Xref", "Database", xref)));
609+
o.setDataSource (DataSource.getExistingByFullName (getAttribute("DataNode.Xref", "Database", xref)));
610610
}
611611

612612
protected void updateDataNode(PathwayElement o, Element e) throws ConverterException
@@ -622,7 +622,7 @@ protected void mapLine(PathwayElement o, Element e) throws ConverterException
622622
{
623623
Element xref = e.getChild ("Xref", e.getNamespace());
624624
o.setElementID (getAttribute("Interaction.Xref", "ID", xref));
625-
o.setDataSource (DataSource.getByFullName (getAttribute("Interaction.Xref", "Database", xref)));
625+
o.setDataSource (DataSource.getExistingByFullName (getAttribute("Interaction.Xref", "Database", xref)));
626626
}
627627

628628

@@ -652,7 +652,7 @@ protected void mapStateData(PathwayElement o, Element e) throws ConverterExcepti
652652
o.setGraphRef(getAttribute("State", "GraphRef", e));
653653
Element xref = e.getChild ("Xref", e.getNamespace());
654654
o.setElementID (getAttribute("State.Xref", "ID", xref));
655-
o.setDataSource (DataSource.getByFullName (getAttribute("State.Xref", "Database", xref)));
655+
o.setDataSource (DataSource.getExistingByFullName (getAttribute("State.Xref", "Database", xref)));
656656
}
657657

658658
protected void updateStateData(PathwayElement o, Element e) throws ConverterException

0 commit comments

Comments
 (0)