本文整理汇总了Java中org.bridgedb.bio.Organism类的典型用法代码示例。如果您正苦于以下问题:Java Organism类的具体用法?Java Organism怎么用?Java Organism使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Organism类属于org.bridgedb.bio包,在下文中一共展示了Organism类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: usesOldEnsembl
import org.bridgedb.bio.Organism; //导入依赖的package包/类
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;
}
示例2: convertEnsembl
import org.bridgedb.bio.Organism; //导入依赖的package包/类
/**
* 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));
}
}
}
示例3: getContents
import org.bridgedb.bio.Organism; //导入依赖的package包/类
@Get
public String getContents()
{
try
{
StringBuilder result = new StringBuilder();
for (Organism org : getGdbProvider().getOrganisms())
{
result.append (org.shortName());
result.append ("\t");
result.append (org.latinName());
result.append ("\n");
}
return result.toString();
}
catch( Exception e )
{
e.printStackTrace();
setStatus( Status.SERVER_ERROR_INTERNAL );
return e.getMessage();
}
}
示例4: initIDMappers
import org.bridgedb.bio.Organism; //导入依赖的package包/类
private void initIDMappers() {
Organism org = Organism.fromLatinName(orgName);
if(org == null) { //Fallback on code
org = Organism.fromCode(orgName);
}
if(org == null) { //Fallback on shortname
org = Organism.fromShortName(orgName);
}
if(org == null) {
throw new IllegalArgumentException("Unknown organism: " + orgName + "<p><font size='+1'><i>Double check the spelling. We are expecting an entry like: Human</i></font></p>");
}
mappers = getGdbProvider().getStack(org);
if (mappers.getSize() == 0)
{
throw new IllegalArgumentException("No database found for: " + orgName +"<p><font size='+1'><i>Verify that the database is supported and properly referenced in gdb.config.</i></font></p>");
}
}
示例5: scanPathway
import org.bridgedb.bio.Organism; //导入依赖的package包/类
protected Result scanPathway(File pathwayFile) throws BotException {
try {
ConnectorBotResult report = new ConnectorBotResult(
getCache().getPathwayInfo(pathwayFile));
Pathway pathway = new Pathway();
pathway.readFromXml(pathwayFile, true);
String orgName = pathway.getMappInfo().getOrganism();
Organism org = Organism.fromLatinName(orgName);
if(org == null) org = Organism.fromShortName(orgName);
for(PathwayElement pwe : pathway.getDataObjects()) {
if(pwe.getObjectType() == ObjectType.LINE) {
boolean valid =
pwe.getMStart().isLinked() &&
pwe.getMEnd().isLinked();
report.addLine(pwe, valid);
}
}
return report;
} catch(Exception e) {
throw new BotException(e);
}
}
示例6: testListPathways
import org.bridgedb.bio.Organism; //导入依赖的package包/类
public void testListPathways() {
try {
WSPathwayInfo[] r = client.listPathways();
Logger.log.trace("Get pathway list returned " + r.length + " pathways");
r = client.listPathways(Organism.HomoSapiens);
Logger.log.trace("Get pathway list for Homo sapiens returned " + r.length + " pathways");
//Check if all pathways are indeed human
for(WSPathwayInfo wpi : r) {
if(!Organism.HomoSapiens.latinName().equals(wpi.getSpecies())) {
fail("Get pathway list for Homo sapiens included non-human pathway: " +
wpi.getId() + " (" + wpi.getSpecies() + ")");
}
}
} catch(Exception e) {
e.printStackTrace();
fail(e.getMessage());
}
}
示例7: addContent
import org.bridgedb.bio.Organism; //导入依赖的package包/类
protected void addContent(JPanel panel) {
JPanel fieldPanel = new JPanel();
fieldPanel.setBorder(BorderFactory.createTitledBorder(""));
GridBagConstraints panelConstraints = new GridBagConstraints();
panelConstraints.fill = GridBagConstraints.BOTH;
panelConstraints.weightx = 1;
panelConstraints.weighty = 1;
panel.add(fieldPanel, panelConstraints);
fieldPanel.setLayout(new GridBagLayout());
JLabel titleFieldLabel = new JLabel("Title");
JLabel orgComboLabel = new JLabel ("Organism ");
titleField = new JTextField();
organismComboBox = new PermissiveComboBox(Organism.latinNamesArray());
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.FIRST_LINE_START;
c.weightx = 0;
c.gridx = 0;
c.gridy = GridBagConstraints.RELATIVE;
fieldPanel.add(titleFieldLabel, c);
fieldPanel.add(orgComboLabel, c);
c.gridx = 1;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
fieldPanel.add(titleField, c);
fieldPanel.add(organismComboBox, c);
}
示例8: addCustomTabs
import org.bridgedb.bio.Organism; //导入依赖的package包/类
protected void addCustomTabs(JTabbedPane parent) {
JPanel panel = new JPanel();
panel.setLayout(new GridBagLayout());
JPanel fieldPanel = new JPanel();
fieldPanel.setBorder(BorderFactory.createTitledBorder(""));
GridBagConstraints panelConstraints = new GridBagConstraints();
panelConstraints.fill = GridBagConstraints.BOTH;
panelConstraints.weightx = 1;
panelConstraints.weighty = 1;
panel.add(fieldPanel, panelConstraints);
fieldPanel.setLayout(new GridBagLayout());
JLabel titleFieldLabel = new JLabel("Title");
JLabel orgComboLabel = new JLabel ("Organism ");
titleField = new JTextField();
titleField.setText(swingEngine.getEngine().getActivePathway().getMappInfo().getMapInfoName());
organismComboBox = new PermissiveComboBox(Organism.latinNamesArray());
organismComboBox.setSelectedItem(swingEngine.getEngine().getActivePathway().getMappInfo().getOrganism());
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.FIRST_LINE_START;
c.weightx = 0;
c.gridx = 0;
c.gridy = GridBagConstraints.RELATIVE;
fieldPanel.add(titleFieldLabel, c);
fieldPanel.add(orgComboLabel, c);
c.gridx = 1;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
fieldPanel.add(titleField, c);
fieldPanel.add(organismComboBox, c);
parent.add("Properties", panel);
parent.setSelectedComponent(panel);
}
示例9: Compat
import org.bridgedb.bio.Organism; //导入依赖的package包/类
public Compat (SwingEngine swingEngine)
{
this.swingEngine = swingEngine;
ensSpecies.put (Organism.HomoSapiens, BioDataSource.ENSEMBL_HUMAN);
ensSpecies.put (Organism.CaenorhabditisElegans, BioDataSource.ENSEMBL_CELEGANS);
ensSpecies.put (Organism.DanioRerio, BioDataSource.ENSEMBL_ZEBRAFISH);
ensSpecies.put (Organism.DrosophilaMelanogaster, BioDataSource.ENSEMBL_ZEBRAFISH);
ensSpecies.put (Organism.MusMusculus, BioDataSource.ENSEMBL_MOUSE);
ensSpecies.put (Organism.RattusNorvegicus, BioDataSource.ENSEMBL_RAT);
ensSpecies.put (Organism.SaccharomycesCerevisiae, BioDataSource.ENSEMBL_SCEREVISIAE);
}
示例10: findPathwaysByText
import org.bridgedb.bio.Organism; //导入依赖的package包/类
public WSSearchResult[] findPathwaysByText(String query, Organism organism) throws RemoteException {
String species = null;
if(organism != null) {
species = organism.latinName();
}
WSSearchResult[] r = port.findPathwaysByText(query, species);
if(r == null) r = new WSSearchResult[0];
return r;
}
示例11: test
import org.bridgedb.bio.Organism; //导入依赖的package包/类
@Test
public void test() throws RemoteException {
WSPathwayInfo [] info = client.listPathways();
assertTrue(info.length > 1900);
WSPathwayInfo [] info2 = client.listPathways(Organism.HomoSapiens);
assertTrue(info2.length < info.length);
assertFalse(info.length == info2.length);
}
示例12: check
import org.bridgedb.bio.Organism; //导入依赖的package包/类
public void check(String oldVal, String newVal)
{
if (newVal != null)
{
Organism o = Organism.fromLatinName(newVal);
if (o == null) System.out.println ("WARNING: species '" + newVal + "' is not a recognized latin name");
}
}
示例13: addOrganismGdb
import org.bridgedb.bio.Organism; //导入依赖的package包/类
public void addOrganismGdb(Organism organism, IDMapper gdb) {
IDMapperStack l = organism2gdb.get(organism);
if(l == null) {
organism2gdb.put(organism, l = new IDMapperStack());
l.setTransitive(transitive);
for (IDMapper globalGdb : globalGdbs)
{
l.addIDMapper(globalGdb);
}
}
l.addIDMapper(gdb);
}
示例14: addGlobalGdb
import org.bridgedb.bio.Organism; //导入依赖的package包/类
public void addGlobalGdb(IDMapper gdb) {
if(!globalGdbs.contains(gdb))
{
globalGdbs.add(gdb);
for (Organism org : organism2gdb.keySet())
{
organism2gdb.get(org).addIDMapper(gdb);
}
}
}
示例15: removeGlobalGdb
import org.bridgedb.bio.Organism; //导入依赖的package包/类
public void removeGlobalGdb(IDMapper gdb) {
if (globalGdbs.contains(gdb))
{
globalGdbs.remove(gdb);
for (Organism org : organism2gdb.keySet())
{
organism2gdb.get(org).removeIDMapper(gdb);
}
}
}