本文整理汇总了Java中org.pathvisio.core.model.ObjectType.DATANODE属性的典型用法代码示例。如果您正苦于以下问题:Java ObjectType.DATANODE属性的具体用法?Java ObjectType.DATANODE怎么用?Java ObjectType.DATANODE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.pathvisio.core.model.ObjectType
的用法示例。
在下文中一共展示了ObjectType.DATANODE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBackpageHTML
/**
* generates html for a given PathwayElement. Combines the base
* header with fragments from all BackpageHooks into one html String.
*/
public String getBackpageHTML(PathwayElement e)
{
if (e == null) {
return "<p>No pathway element is selected.</p>";
} else if (e.getObjectType() != ObjectType.DATANODE && e.getObjectType() != ObjectType.LINE) {
return "<p>Backpage is not available for this type of element.<BR>Only DataNodes or Interactions can have a backpage.</p>";
} else if (e.getDataSource() == null || e.getXref().getId().equals("")) {
return "<p>There is no annotation for this pathway element defined.</p>";
}
StringBuilder builder = new StringBuilder(backpagePanelHeader);
for (BackpageHook h : hooks)
{
builder.append(h.getHtml(e));
}
builder.append ("</body></html>");
return builder.toString();
}
示例2: usesOldEnsembl
private boolean usesOldEnsembl(Pathway pwy)
{
Organism org = Organism.fromLatinName(pwy.getMappInfo().getOrganism());
if (!ensSpecies.containsKey(org))
return false; // this pwy is not one of the species to be converted
for (PathwayElement elt : pwy.getDataObjects())
{
if (elt.getObjectType() == ObjectType.DATANODE &&
elt.getDataSource() == BioDataSource.ENSEMBL)
{
return true;
}
}
return false;
}
示例3: convertEnsembl
/**
* Ensembl considers each species database as separate,
* and thus they should have separate system codes as well.
* This method will convert generic Ensembl datanodes
* to species specific datanodes if possible.
*/
private void convertEnsembl(Pathway pwy)
{
Organism org = Organism.fromLatinName(pwy.getMappInfo().getOrganism());
if (!ensSpecies.containsKey(org))
return; // this pwy is not one of the species to be converted
for (PathwayElement elt : pwy.getDataObjects())
{
if (elt.getObjectType() == ObjectType.DATANODE &&
elt.getDataSource() == BioDataSource.ENSEMBL)
{
elt.setDataSource (ensSpecies.get (org));
}
}
}
示例4: getAnnotationHTML
/**
* generates html for a given PathwayElement. Combines the base header with
* fragments from all BackpageHooks into one html String.
*/
public String getAnnotationHTML(PathwayElement e) {
if (e == null) {
return "<p>No pathway element is selected.</p>";
} else if (e.getObjectType() != ObjectType.DATANODE
&& e.getObjectType() != ObjectType.LINE) {
return "<p>It is currently not possible to annotate this type of pathway element." +
"<BR>Only DataNodes and Interactions can be annotated.</p>";
} else if (e.getDataSource() == null || e.getXref().getId().equals("")) {
return "<p>This pathway element has not yet been annotated.</p>";
}
StringBuilder builder = new StringBuilder(backpagePanelHeader);
for (DataHook h : hooks) {
builder.append(h.getHtml(e));
}
builder.append("</body></html>");
return builder.toString();
}
示例5: doHighlight
/**
* Highlight all object but DataNodes and Groups. Only the first color
* from the hashmap will be used.
*/
private void doHighlight() {
for(VPathwayElement vpe : vPathway.getDrawingObjects()) {
if(vpe instanceof Graphics) {
PathwayElement pwe = ((Graphics)vpe).getPathwayElement();
List<Color> elmColors = colors.get(pwe);
if(elmColors != null && elmColors.size() > 0) {
ObjectType ot = pwe.getObjectType();
if(ot != ObjectType.DATANODE && ot != ObjectType.GROUP) {
vpe.highlight(elmColors.get(0));
}
}
}
}
}
示例6: main
public static void main(String[] args) throws Exception {
//Create a client to the WikiPathways web service
URL wsURL = new URL("http://webservice.wikipathways.org");
WikiPathwaysClient client = new WikiPathwaysClient(wsURL);
//////////////////////////
// EXAMPLE (FIND BY XREF)
// Find a pathway by affymetrix probeset
Xref affy = new Xref("201746_at", DataSource.getBySystemCode("X"));
System.out.println("Searching for pathways with Affymetrix probeset " + affy);
WSSearchResult[] result = client.findPathwaysByXref(affy);
for(WSSearchResult r : result) {
System.out.println("Found pathway: " + r.getName() + " (" + r.getSpecies() + ")");
}
////////////////////////////////////
// EXAMPLE (GET PATHWAY - SAVE GPML)
//Download a pathway from WikiPathways
WSPathway wsPathway = client.getPathway("WP274");
System.out.println("Downloaded pathway " + wsPathway.getName() + ", revision " + wsPathway.getRevision());
//Create a pathway object
Pathway pathway = WikiPathwaysClient.toPathway(wsPathway);
//Get all genes, proteins and metabolites for a pathway
for(PathwayElement pwElm : pathway.getDataObjects()) {
//Only take elements with type DATANODE (genes, proteins, metabolites)
if(pwElm.getObjectType() == ObjectType.DATANODE) {
//Print information to the screen
System.out.println(pwElm.getTextLabel());
System.out.println("\t" + pwElm.getXref());
System.out.println("\t" + pwElm.getDataNodeType());
}
}
//Save the pathway locally
pathway.writeToXml(new File(wsPathway.getName() + ".gpml"), true);
///////////////////////////////
// EXAMPLE (LIST ALL PATHWAYS)
//Print info for all WikiPathways pathways
WSPathwayInfo[] pathwayList = client.listPathways();
for(WSPathwayInfo pathwayInfo : pathwayList) {
System.out.println("Pathway:");
System.out.println("\tIdentifier:\t" + pathwayInfo.getId());
System.out.println("\tName:\t" + pathwayInfo.getName());
System.out.println("\tOrganism:\t" + pathwayInfo.getSpecies());
}
}