本文整理汇总了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());
}
}
}
}
}