-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from INCATools/issue-137
Handle missing columns and empty table cells by omitting outputs which require those values
- Loading branch information
Showing
9 changed files
with
171 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/test/resources/org/monarchinitiative/dosdp/missing_values_test.tsv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
defined_class structure structure_label taxon seeAlso exactSynonym relatedSynonyms term_name substitute_me | ||
EX:0001 UBERON:arm Arm VTO:Holothuroidea UBERON:tentacle a synonym for this term related term 1|related term 2 Term 0001 one two | ||
EX:0002 UBERON:arm Arm VTO:Holothuroidea UBERON:tentacle related term 1|related term 2 Term 0002 one two | ||
EX:0003 UBERON:arm Arm VTO:Holothuroidea UBERON:tentacle related term 1|related term 2 one two | ||
EX:0004 VTO:Holothuroidea UBERON:tentacle related term 1|related term 2 Term 0004 one two | ||
EX:0005 UBERON:arm Arm VTO:Holothuroidea UBERON:tentacle a synonym for this term related term 1|related term 2 Term 0005 |
62 changes: 62 additions & 0 deletions
62
src/test/resources/org/monarchinitiative/dosdp/missing_values_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
pattern_name: missing_values_test | ||
|
||
classes: | ||
shape: PATO:shape | ||
anatomical_entity: UBERON:anatomical_entity | ||
thing: owl:Thing | ||
|
||
relations: | ||
part_of: RO:part_of | ||
|
||
annotationProperties: | ||
never_in_taxon: RO:never_in_taxon | ||
|
||
vars: | ||
structure: anatomical_entity | ||
taxon: thing | ||
|
||
list_vars: | ||
seeAlso: anatomical_entity | ||
|
||
data_vars: | ||
term_name: xsd:string | ||
substitute_me: xsd:string | ||
|
||
data_list_vars: | ||
exactSynonym: xsd:string | ||
relatedSynonyms: xsd:string | ||
broadSynonyms: xsd:string # don't put this column in the test input | ||
|
||
annotations: | ||
- annotationProperty: never_in_taxon | ||
var: taxon | ||
|
||
name: | ||
text: "%s" | ||
vars: | ||
- term_name | ||
|
||
def: | ||
text: "%s %s %s" | ||
vars: | ||
- term_name | ||
- structure | ||
- substitute_me_munged | ||
|
||
exact_synonym: | ||
value: exactSynonym | ||
|
||
broad_synonym: | ||
value: broadSynonyms | ||
|
||
substitutions: | ||
- in: substitute_me | ||
out: substitute_me_munged | ||
match: (.+) (.+) | ||
sub: \2 and then \1 | ||
|
||
equivalentTo: | ||
text: "%s and (part_of some %s)" | ||
vars: | ||
- structure | ||
- taxon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/scala/org/monarchinitiative/dosdp/MissingValuesTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.monarchinitiative.dosdp | ||
|
||
import java.io.File | ||
|
||
import com.github.tototoshi.csv.TSVFormat | ||
import org.monarchinitiative.dosdp.cli.Generate | ||
|
||
class MissingValuesTest extends UnitSpec { | ||
|
||
"Missing columns and cell values" should "be handled by dropping outputs" in { | ||
val dosdp = Generate.inputDOSDPFrom("src/test/resources/org/monarchinitiative/dosdp/missing_values_test.yaml") | ||
val fillers = Generate.readFillers(new File("src/test/resources/org/monarchinitiative/dosdp/missing_values_test.tsv"), new TSVFormat {}) | ||
val axioms = Generate.renderPattern(dosdp: DOSDP, OBOPrefixes, fillers, None, true, true, None, false) | ||
// No exceptions should be thrown | ||
} | ||
|
||
} |
Oops, something went wrong.