if (nestCompartments) nm = CompartmentManager.getUnifiedName(nm);
compart = getCompartment(nm, map, root);
}
}
NodeModel nd;
if (cmp.getCOMPONENTS().isEmpty())
{
nd = new Actor(compart, cmp, list);
}
else
{
Complex c = new Complex(compart, cmp, list);
createComplexContent(c, cmp, list);
nd = c;
}
for (physicalEntityParticipant par : list)
{
map.put(par.getRDFId(), nd);
}
}
}
}
// Create events
for (conversion conv : model.getObjects(conversion.class))
{
String compName = Conversion.getPossibleCompartmentName(conv);
if (compName != null && nestCompartments)
compName = CompartmentManager.getUnifiedName(compName);
CompoundModel compart = compName == null ? root : (CompoundModel) map.get(compName);
Conversion forwd = null, rever = null;
if (evidenceExists(conv, Conversion.LEFT_TO_RIGHT))
{
forwd = new Conversion(compart, conv, Conversion.LEFT_TO_RIGHT, map);
forwd.selectBestCompartment();
}
if (evidenceExists(conv, Conversion.RIGHT_TO_LEFT))
{
rever = new Conversion(compart, conv, Conversion.RIGHT_TO_LEFT, map);
rever.selectBestCompartment();
}
if (forwd == null && rever == null)
{
forwd = new Conversion(compart, conv, Conversion.LEFT_TO_RIGHT, map);
forwd.selectBestCompartment();
}
}
for (interaction inter : model.getObjects(interaction.class))
{
boolean drawPPI = true;
if (!drawPPI) break;
if (!(inter instanceof conversion) && !(inter instanceof control))
{
Set<InteractionParticipant> interPartic = inter.getPARTICIPANTS();
Set<physicalEntityParticipant> peps = new HashSet<physicalEntityParticipant>();
boolean hasControl = !inter.isCONTROLLEDOf().isEmpty();
for (InteractionParticipant partic : interPartic)
{
if (partic instanceof physicalEntityParticipant)
{
peps.add((physicalEntityParticipant) partic);
}
}
if (hasControl || peps.size() != 2)
{
String compName = Hub.getPossibleCompartmentName(peps);
if (nestCompartments) compName = CompartmentManager.getUnifiedName(compName);
CompoundModel compart = compName == null ? root :
(CompoundModel) map.get(compName);
Hub hub = new Hub(compart, inter,
new ArrayList<physicalEntityParticipant>(peps), map);
for (physicalEntityParticipant pep : peps)
{
NodeModel node = map.get(pep.getRDFId());
// TEMPORARY CODE -- REMOVE WHEN BUG IS FIXED
if (node == null)
{
System.err.println("PEP without PE");