Commit b084cc71 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

due to the fact that list of pubmeds can be empty split must be called differently

parent d6eecaf2
......@@ -47,7 +47,7 @@ public class PathwayCreator {
int isDirected = -1;
int references = -1;
while ((line = br.readLine()) != null) {
String cols[] = line.split("\t");
String cols[] = line.split("\t", -1);
if (line.indexOf("source_hgnc_symbol") >= 0) {
for (int i = 0; i < cols.length; i++) {
if (cols[i].equalsIgnoreCase("source_hgnc_symbol")) {
......@@ -73,9 +73,9 @@ public class PathwayCreator {
if (elements.get(cols[sourceHgncSymbolCol]) != null && elements.get(cols[targetHgncSymbolCol]) != null) {
reaction.addReactant(new Reactant(elements.get(cols[sourceHgncSymbolCol])));
reaction.addProduct(new Product(elements.get(cols[targetHgncSymbolCol])));
String tmp[] = cols[references].split(",");
String tmp[] = cols[references].split(",", -1);
for (String string : tmp) {
if (!string.equals("NA")) {
if (!string.equals("NA") && !string.isEmpty()) {
reaction.addMiriamData(new MiriamData(MiriamType.PUBMED, string));
}
}
......@@ -103,7 +103,7 @@ public class PathwayCreator {
int isDirected = -1;
int references = -1;
while ((line = br.readLine()) != null) {
String cols[] = line.split("\t");
String cols[] = line.split("\t", -1);
if (line.indexOf("source_entrezgene_id") >= 0) {
for (int i = 0; i < cols.length; i++) {
if (cols[i].equalsIgnoreCase("source_entrezgene_id")) {
......@@ -181,7 +181,7 @@ public class PathwayCreator {
int isDirected = -1;
int references = -1;
while ((line = br.readLine()) != null) {
String cols[] = line.split("\t");
String cols[] = line.split("\t", -1);
if (line.indexOf("source_hgnc_symbol") >= 0) {
for (int i = 0; i < cols.length; i++) {
if (cols[i].equalsIgnoreCase("source_hgnc_symbol")) {
......@@ -207,9 +207,9 @@ public class PathwayCreator {
if (elementNames.contains(cols[sourceHgncSymbolCol]) || elementNames.contains(cols[targetHgncSymbolCol])) {
reaction.addReactant(new Reactant(findElementByName(model, cols[sourceHgncSymbolCol])));
reaction.addProduct(new Product(findElementByName(model, cols[targetHgncSymbolCol])));
String tmp[] = cols[references].split(",");
String tmp[] = cols[references].split(",", -1);
for (String string : tmp) {
if (!string.equals("NA")) {
if (!string.equals("NA") && !string.isEmpty()) {
reaction.addMiriamData(new MiriamData(MiriamType.PUBMED, string));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment