Skip to content

Commit

Permalink
Skip non-catalysis logging and filter out small mols for #327
Browse files Browse the repository at this point in the history
  • Loading branch information
dustine32 committed Nov 22, 2024
1 parent 46b2db0 commit f345c72
Showing 1 changed file with 35 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1449,17 +1449,19 @@ else if (entity instanceof Interaction){
}
//check if there are active sites annotated on the controller.
Set<String> active_site_stable_ids = getActiveSites(controller);
for(Controller controller_entity : controller_entities) {
if (controller_entity instanceof Complex) {
boolean has_protein = false;
for(PhysicalEntity complex_component : ((Complex) controller_entity).getComponent()) {
if (complex_component instanceof Protein) {
has_protein = true;
if (controller instanceof Catalysis) {
for(Controller controller_entity : controller_entities) {
if (controller_entity instanceof Complex) {
boolean has_protein = false;
for(PhysicalEntity complex_component : ((Complex) controller_entity).getComponent()) {
if (complex_component instanceof Protein) {
has_protein = true;
}
}
if (has_protein && active_site_stable_ids.isEmpty()) {
String complex_entity_id = getEntityReferenceId(controller_entity);
System.out.println("COMPLEX_HAS_PROTEIN_NO_ACTIVE_UNIT\t"+model_id+"\t"+go_cam.name+"\t"+entity_id+"\t"+entity_name+"\t"+complex_entity_id+"\t"+controller_entity.getDisplayName());
}
}
if (has_protein && active_site_stable_ids.isEmpty()) {
String complex_entity_id = getEntityReferenceId(controller_entity);
System.out.println("COMPLEX_HAS_PROTEIN_NO_ACTIVE_UNIT\t"+model_id+"\t"+go_cam.name+"\t"+entity_id+"\t"+entity_name+"\t"+complex_entity_id+"\t"+controller_entity.getDisplayName());
}
}
}
Expand Down Expand Up @@ -1795,6 +1797,29 @@ private Set<String> getActiveSites(Control controlled_by_complex) {
active_site_ids.add(stable_id);
}
}
// If it's still empty, try more crazy stuff
if (active_site_ids.isEmpty()) {
Set<Controller> controller_entities = controlled_by_complex.getController();
for (Controller controller_entity : controller_entities) {
Set<PhysicalEntity> non_small_mol_components = new HashSet<PhysicalEntity>();
if (controller_entity instanceof Complex) {
for(PhysicalEntity complex_component : ((Complex) controller_entity).getComponent()) {
if (complex_component instanceof SmallMolecule) {
// Don't consider small molecules in finding active sites in complexes
continue;
}
non_small_mol_components.add(complex_component);
}
}
if (non_small_mol_components.size() == 1) {
PhysicalEntity single_component = non_small_mol_components.iterator().next();
if (single_component instanceof Protein) {
String stable_id = getEntityReferenceId(single_component);
active_site_ids.add(stable_id);
}
}
}
}
return active_site_ids;

}
Expand Down

0 comments on commit f345c72

Please sign in to comment.