本文整理匯總了Java中org.biopax.paxtools.model.level3.EntityReference類的典型用法代碼示例。如果您正苦於以下問題:Java EntityReference類的具體用法?Java EntityReference怎麽用?Java EntityReference使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EntityReference類屬於org.biopax.paxtools.model.level3包,在下文中一共展示了EntityReference類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createSifNodeAttr
import org.biopax.paxtools.model.level3.EntityReference; //導入依賴的package包/類
private void createSifNodeAttr(Model model, CyNetwork cyNetwork,
TaskMonitor taskMonitor) throws IOException
{
taskMonitor.setStatusMessage("Updating SIF network node attributes from the BioPAX model...");
// Set the Quick Find Default Index
AttributeUtil.set(cyNetwork, cyNetwork, "quickfind.default_index", CyNetwork.NAME, String.class);
if (cancelled) return;
// Set node attributes from the Biopax Model
for (CyNode node : cyNetwork.getNodeList()) {
String uri = cyNetwork.getRow(node).get(CyNetwork.NAME, String.class);
BioPAXElement e = model.getByID(uri);
if(e instanceof EntityReference || e instanceof Entity)
{
BioPaxMapper.createAttributesFromProperties(e, model, node, cyNetwork);
} else if (e != null) {
log.warn("SIF network has an unexpected node: " + uri + " of type " + e.getModelInterface());
BioPaxMapper.createAttributesFromProperties(e, model, node, cyNetwork);
} else { //should never happen anymore...
log.error("(BUG) the biopax model does not have an object with URI=" + uri);
}
}
}
示例2: createSifNodeAttr
import org.biopax.paxtools.model.level3.EntityReference; //導入依賴的package包/類
private void createSifNodeAttr(Model model, CyNetwork cyNetwork,
TaskMonitor taskMonitor) throws IOException
{
taskMonitor.setStatusMessage("Updating SIF network node attributes from the BioPAX model...");
// Set the Quick Find Default Index
Attributes.set(cyNetwork, cyNetwork, "quickfind.default_index", CyNetwork.NAME, String.class);
if (cancelled) return;
// Set node attributes from the Biopax Model
for (CyNode node : cyNetwork.getNodeList()) {
String uri = cyNetwork.getRow(node).get(CyNetwork.NAME, String.class);
BioPAXElement e = model.getByID(uri);
if(e instanceof EntityReference || e instanceof Entity)
{
BioPaxMapper.createAttributesFromProperties(e, model, node, cyNetwork);
} else if (e != null) {
log.warn("SIF network has an unexpected node: " + uri + " of type " + e.getModelInterface());
BioPaxMapper.createAttributesFromProperties(e, model, node, cyNetwork);
} else { //should never happen anymore...
log.error("(BUG) the biopax model does not have an object with URI=" + uri);
}
}
}
示例3: fixDisplayName
import org.biopax.paxtools.model.level3.EntityReference; //導入依賴的package包/類
/**
* For all Named biopax objects, sets 'displayName'
* from other names if it was missing.
*
* @param model
*/
public static void fixDisplayName(Model model) {
log.info("Trying to auto-set displayName for all BioPAX elements");
// where it's null, set to the shortest name if possible
for (Named e : model.getObjects(Named.class)) {
if (e.getDisplayName() == null) {
if (e.getStandardName() != null) {
e.setDisplayName(e.getStandardName());
} else if (!e.getName().isEmpty()) {
String dsp = e.getName().iterator().next();
for (String name : e.getName()) {
if (name.length() < dsp.length())
dsp = name;
}
e.setDisplayName(dsp);
}
}
}
// if required, set PE name to (already fixed) ER's name...
for(EntityReference er : model.getObjects(EntityReference.class)) {
for(SimplePhysicalEntity spe : er.getEntityReferenceOf()) {
if(spe.getDisplayName() == null || spe.getDisplayName().trim().length() == 0) {
if(er.getDisplayName() != null && er.getDisplayName().trim().length() > 0) {
spe.setDisplayName(er.getDisplayName());
}
}
}
}
}