Skip to content

Commit

Permalink
fix for github bug #7 (error when dataset file is located in current …
Browse files Browse the repository at this point in the history
…dir)
  • Loading branch information
rdk committed Sep 23, 2019
1 parent f743b39 commit e92982f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'idea'


group = 'cz.siret'
version = '2.0'
version = '2.0.1'

description = 'Ligand binding site prediction based on machine learning.'

Expand Down
7 changes: 4 additions & 3 deletions src/main/groovy/cz/siret/prank/domain/Dataset.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Dataset implements Parametrized {
}

Item createNewItem(Map<String, String> columnValues) {
String proteinFile = dir + "/" + columnValues.get(COLUMN_PROTEIN)
String proteinFile = dir + "/" + columnValues.get(COLUMN_PROTEIN) // bug!dir==null
String predictionFile = null
if (header.contains(COLUMN_PREDICTION)) {
predictionFile = dir + "/" + columnValues.get(COLUMN_PREDICTION)
Expand Down Expand Up @@ -436,7 +436,7 @@ class Dataset implements Parametrized {

Dataset(String name, String dir) {
this.name = name
this.dir = dir
this.dir = dir ?: "." // safeguard for github#7
}

/**
Expand Down Expand Up @@ -468,7 +468,8 @@ class Dataset implements Parametrized {

log.info "loading dataset [$file.absolutePath]"

Dataset dataset = new Dataset(file.name, file.parent)
String dir = file.parent ?: "." // fix for bug github#7
Dataset dataset = new Dataset(file.name, dir)

for (String line in file.readLines()) {
line = line.trim()
Expand Down

0 comments on commit e92982f

Please sign in to comment.