Skip to content

Commit

Permalink
downloader: add MONDO ontology
Browse files Browse the repository at this point in the history
  • Loading branch information
imedina committed Jan 2, 2024
1 parent ce1767a commit 0004be6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public class DownloadProperties {
private URLProperties hpoObo;
private URLProperties goObo;
private URLProperties doidObo;
private URLProperties mondoObo;
private URLProperties goAnnotation;
private URLProperties revel;
private URLProperties pubmed;
Expand Down Expand Up @@ -527,6 +528,15 @@ public DownloadProperties setCancerHotspot(URLProperties cancerHotspot) {
return this;
}

public URLProperties getMondoObo() {
return mondoObo;
}

public DownloadProperties setMondoObo(URLProperties mondoObo) {
this.mondoObo = mondoObo;
return this;
}

public static class EnsemblProperties {

private DatabaseCredentials database;
Expand Down
2 changes: 2 additions & 0 deletions cellbase-core/src/main/resources/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ download:
host: http://purl.obolibrary.org/obo/go/go-basic.obo
doidObo:
host: http://purl.obolibrary.org/obo/doid.obo
mondoObo:
host: http://purl.obolibrary.org/obo/mondo.obo
goAnnotation:
host: http://geneontology.org/gene-associations/goa_human.gaf.gz
revel:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public class EtlCommons {
public static final String HPO_FILE = "hp.obo";
public static final String GO_FILE = "go-basic.obo";
public static final String DOID_FILE = "doid.obo";
public static final String MONDO_FILE = "mondo.obo";
public static final String PFM_DATA = "regulatory_pfm";

// Build specific data options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ public class OntologyBuilder extends CellBaseBuilder {
private Path hpoFile;
private Path goFile;
private Path doidFile;
private Path mondoFile;

public OntologyBuilder(Path oboDirectoryPath, CellBaseSerializer serializer) {
super(serializer);
hpoFile = oboDirectoryPath.resolve(EtlCommons.HPO_FILE);
goFile = oboDirectoryPath.resolve(EtlCommons.GO_FILE);
doidFile = oboDirectoryPath.resolve(EtlCommons.DOID_FILE);
mondoFile = oboDirectoryPath.resolve(EtlCommons.MONDO_FILE);
}

@Override
Expand All @@ -64,6 +66,13 @@ public void parse() throws Exception {
serializer.serialize(term);
}

bufferedReader = FileUtils.newBufferedReader(mondoFile);
terms = parser.parseOBO(bufferedReader, "Mondo Ontology");
for (OntologyTerm term : terms) {
term.setSource("MONDO");
serializer.serialize(term);
}

serializer.close();
}
}

0 comments on commit 0004be6

Please sign in to comment.