Skip to content

Commit

Permalink
cleaning up physical entity builder
Browse files Browse the repository at this point in the history
  • Loading branch information
goodb committed Jan 27, 2020
1 parent 24a5826 commit 3af3372
Showing 1 changed file with 11 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public static void main(String[] args) throws OWLOntologyCreationException, IOEx
for (PhysicalEntity entity : biopax_model.getObjects(PhysicalEntity.class)){
String model_id = entity.hashCode()+"";
n++;
System.out.println(n+" defining "+entity.getDisplayName()+" "+entity.getModelInterface()+" "+entity.getUri());
//System.out.println(n+" defining "+entity.getDisplayName()+" "+entity.getModelInterface()+" "+entity.getUri());
converter.definePhysicalEntity(go_cam, entity, null, model_id);
}

Expand Down Expand Up @@ -258,10 +258,10 @@ public static void main(String[] args) throws OWLOntologyCreationException, IOEx

go_cam.writeGoCAM_jena(outfilename, false, outputformat);

int n_objects = 0;
for(String id : converter.id_class_map.keySet()) {
System.out.println(id+" "+(n_objects++)+" "+converter.id_class_map.get(id));
}
// int n_objects = 0;
// for(String id : converter.id_class_map.keySet()) {
// System.out.println(id+" "+(n_objects++)+" "+converter.id_class_map.get(id));
// }
}


Expand All @@ -277,10 +277,6 @@ private OWLClassExpression definePhysicalEntity(GoCAM go_cam, PhysicalEntity ent
this_iri = GoCAM.makeGoCamifiedIRI(model_id, entity_id);
}

if(this_iri.toString().contains("R-HSA-9663470")) {
System.out.println("Checking R-HSA-9663470 "+entity.getDisplayName());
}

//add entity to ontology as a class, whatever it is
OWLClass e = go_cam.df.getOWLClass(this_iri);
if(entity_id!=null) {
Expand Down Expand Up @@ -508,9 +504,8 @@ else if(entity.getModelInterface().equals(Protein.class)||entity.getModelInterfa
}
}else if(entity.getModelInterface().equals(Protein.class)) {
go_cam.addSubclassAssertion(e, GoCAM.chebi_protein, null);
System.out.println("non uniprot protein detected: "+entity.getDisplayName());
//System.out.println("non uniprot protein detected: "+entity.getDisplayName());
}else { //entity is just PhysicalEntity.class
System.out.println("ambiguous physical entity detected: "+entity.getDisplayName());
Set<Xref> e_xrefs = entity.getXref();
boolean entity_type_set = false;
if(e_xrefs!=null) {
Expand Down Expand Up @@ -544,6 +539,7 @@ else if(entity.getModelInterface().equals(Protein.class)||entity.getModelInterfa
//everything is at least a continuant...
go_cam.addSubclassAssertion(e, GoCAM.continuant_class, null);
go_cam.addUriAnnotations2Individual(e.getIRI(), GoCAM.canonical_record, GoCAM.continuant_class.getIRI());
System.out.println("unclassified entity\t"+e+"\t"+entity.getDisplayName());
}
}
}
Expand Down Expand Up @@ -832,7 +828,7 @@ public static String getDrugReferenceId(Entity bp_entity) {
}else if(bp_entity.getModelInterface().equals(DnaRegion.class)){
r = ((DnaRegion) bp_entity).getEntityReference();
}else if(bp_entity.getModelInterface().equals(PhysicalEntity.class)) {
System.err.println("Can not access EntityReference for untyped physical entity: "+bp_entity.getDisplayName());
//System.err.println("Can not access EntityReference for untyped physical entity: "+bp_entity.getDisplayName());
}
if(r!=null) {
Set<Xref> erefs = r.getXref();
Expand All @@ -845,9 +841,9 @@ public static String getDrugReferenceId(Entity bp_entity) {
}catch(Exception e) {
return null;
}
if(id!=null) {
System.out.println("found drug id "+id+" "+bp_entity.getDisplayName());
}
// if(id!=null) {
// System.out.println("found drug id "+id+" "+bp_entity.getDisplayName());
// }
return id;
}

Expand All @@ -873,10 +869,6 @@ public static void countPhysical(Model biopax_model) throws IOException {
n_all_pro++;
in_pro = true;
}
if(e.getDisplayName()!=null&&e.getDisplayName().equals("pertuzumab")) {
String testdrug_id = getDrugReferenceId(e);
System.out.println("hello pertuzumab "+testdrug_id);
}
String drug_id = getDrugReferenceId(e);
if(drug_id==null) {
drug_id = "no_IUPHAR";
Expand Down

0 comments on commit 3af3372

Please sign in to comment.