• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BioDataSource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.bridgedb.bio.BioDataSource的典型用法代码示例。如果您正苦于以下问题:Java BioDataSource类的具体用法?Java BioDataSource怎么用?Java BioDataSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BioDataSource类属于org.bridgedb.bio包,在下文中一共展示了BioDataSource类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testImportAffy

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
public void testImportAffy() throws IOException, IDMapperException
{
	ImportInformation info = new ImportInformation();
	File f = new File ("example-data/sample_affymetrix.txt");
	assertTrue (f.exists());
	info.setTxtFile(f);
	info.guessSettings();

	assertEquals (info.getDataSource(), BioDataSource.AFFY);
	assertTrue (info.isSyscodeFixed());
	assertTrue (info.digitIsDot());
	assertEquals (info.getIdColumn(), 0);

	String dbFileName = System.getProperty("java.io.tmpdir") + File.separator + "tempgex2";
	info.setGexName(dbFileName);
	info.setSyscodeFixed(true);
	info.setDataSource(BioDataSource.AFFY);
	IDMapper gdb = BridgeDb.connect("idmapper-pgdb:" + GDB_RAT);
	GexTxtImporter.importFromTxt(info, null, gdb, gexManager);

	// just 6 errors if all goes well
	assertEquals (6, info.getErrorList().size());
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:24,代码来源:Test.java


示例2: testImportLongHeaders

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
/**
 * Column headers have lenghts of over 50.
 * Make sure this doesn't lead to problems when setting sample names
 */
public void testImportLongHeaders() throws IOException, IDMapperException
{
	ImportInformation info = new ImportInformation();
	File f = new File ("example-data/sample_data_long_headers.txt");
	assertTrue (f.exists());
	info.setTxtFile(f);
	info.guessSettings();

	assertEquals (info.getDataSource(), BioDataSource.ENTREZ_GENE);
	assertTrue (info.isSyscodeFixed());
	assertTrue (info.digitIsDot());
	assertEquals (0, info.getIdColumn());

	String dbFileName = System.getProperty("java.io.tmpdir") + File.separator + "tempgex3";
	info.setGexName(dbFileName);

	IDMapper gdb = BridgeDb.connect("idmapper-pgdb:" + GDB_HUMAN);
	GexTxtImporter.importFromTxt(info, null, gdb, gexManager);

	// 0 errors if all goes well
	assertEquals (0, info.getErrorList().size());
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:27,代码来源:Test.java


示例3: testImportNoHeader

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
public void testImportNoHeader() throws IOException, IDMapperException
{
	ImportInformation info = new ImportInformation();
	File f = new File ("example-data/sample_data_no_header.txt");
	assertTrue (f.exists());
	info.setTxtFile(f);
	info.setFirstDataRow(0);
	info.guessSettings();

	assertEquals (info.getDataSource(), BioDataSource.ENTREZ_GENE);
	assertFalse (info.isSyscodeFixed());
	assertTrue (info.digitIsDot());
	assertEquals (0, info.getIdColumn());
	assertTrue (info.getNoHeader());
	assertEquals ("Column A", info.getColNames()[0]);

	String dbFileName = System.getProperty("java.io.tmpdir") + File.separator + "tempgex5";
	info.setGexName(dbFileName);

	IDMapper gdb = BridgeDb.connect("idmapper-pgdb:" + GDB_HUMAN);
	GexTxtImporter.importFromTxt(info, null, gdb, gexManager);

	// 0 errors if all goes well
	assertEquals (0, info.getErrorList().size());
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:26,代码来源:Test.java


示例4: testImportWithText

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
/**
 * Test dataset contains two columns with textual data
 * make sure this doesn't give problems during import
 */
public void testImportWithText() throws IOException, IDMapperException
{
	ImportInformation info = new ImportInformation();
	File f = new File ("example-data/sample_data_with_text.txt");
	assertTrue (f.exists());
	info.setTxtFile(f);
	info.guessSettings();

	assertEquals (info.getDataSource(), BioDataSource.ENTREZ_GENE);
	assertFalse (info.isSyscodeFixed());
	assertEquals (info.getSyscodeColumn(), 1);
	assertTrue (info.digitIsDot());
	assertEquals (info.getIdColumn(), 0);

	String dbFileName = System.getProperty("java.io.tmpdir") + File.separator + "tempgex4";
	info.setGexName(dbFileName);

	IDMapper gdb = BridgeDb.connect("idmapper-pgdb:" + GDB_HUMAN);
	GexTxtImporter.importFromTxt(info, null, gdb, gexManager);

	// 0 errors if all goes well
	assertEquals (info.getErrorList().size(), 0);
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:28,代码来源:Test.java


示例5: usesOldEnsembl

import org.bridgedb.bio.BioDataSource; //导入依赖的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;
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:17,代码来源:Compat.java


示例6: convertEnsembl

import org.bridgedb.bio.BioDataSource; //导入依赖的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));
		}
	}

}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:23,代码来源:Compat.java


示例7: main

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
/**
 * Script can be run in two ways
 * 1) as part of BridgeQC, to check a single database. Pass one argument with a derby database filename.
 * 2) standalone, to check a set of databases. Specify each database on the command line separately.
 */
public static void main (String[] args) throws IDMapperException, SQLException
{
	BioDataSource.init();
	PatternChecker checker = new PatternChecker();
	
	if (args.length == 0)
	{
		System.err.println ("Argument expected: pgdb file to check");
		System.exit(1);
	}
	for (String arg : args)
	{
		File f = new File (arg);
		checker.run(f);
	}		
	if (args.length > 1)
	{
		checker.finalReport();
	}
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:26,代码来源:PatternChecker.java


示例8: main

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
public static void main (String[] args) throws ClassNotFoundException, IDMapperException
{
	// We'll use the BridgeRest webservice in this case, as it does compound mapping fairly well.
	// We'll use the human database, but it doesn't really matter which species we pick.
	Class.forName ("org.bridgedb.webservice.bridgerest.BridgeRest");
	IDMapper mapper = BridgeDb.connect("idmapper-bridgerest:http://webservice.bridgedb.org/Human");

	// Start with defining the Chebi identifier for
	// Methionine, id 16811
	Xref src = new Xref("16811", BioDataSource.CHEBI);		
	
	// the method returns a set, but in actual fact there is only one result
	for (Xref dest : mapper.mapID(src, BioDataSource.PUBCHEM_COMPOUND))
	{
		// this should print 6137, the pubchem identifier for Methionine.
		System.out.println ("" + dest.getId());
	}
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:19,代码来源:ChebiPubchemExample.java


示例9: run

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
private void run() throws ClassNotFoundException, IDMapperException
{
	DataSourceTxt.init();		

	// Entrez gene id for INSR.
	String id = "3643";
	
	Class.forName ("org.bridgedb.webservice.cronos.IDMapperCronos");
	domapping ("idmapper-cronos:hsa", "3643", BioDataSource.ENTREZ_GENE,
			BioDataSource.ENSEMBL_HUMAN);

	Class.forName ("org.bridgedb.webservice.synergizer.IDMapperSynergizer");
	domapping ("idmapper-synergizer:?authority=ensembl&species=Homo sapiens",
			id, DataSource.getByFullName("entrezgene"),
			DataSource.getByFullName("ensembl_gene_id"));
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:17,代码来源:ExampleWithBridgeDb.java


示例10: testLocalCapabilities

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
@org.junit.Test
public void testLocalCapabilities() throws IDMapperException, ClassNotFoundException {
	
    if (configExists)
    {
   	    IDMapper mapper = getLocalService();
   		
   		IDMapperCapabilities cap = mapper.getCapabilities();
   		
   		Set<DataSource> supported = cap.getSupportedSrcDataSources();
   		Assert.assertTrue (supported.contains(DataSource.getBySystemCode("L")));
   
   		String val = cap.getProperty("SCHEMAVERSION");
   		Assert.assertNotNull(val);
   		
   		Set<DataSource> srcDs = cap.getSupportedSrcDataSources();
   		Assert.assertTrue(srcDs.size() > 0);
   		
   		Assert.assertTrue(cap.isFreeSearchSupported());
   		
   		Assert.assertTrue(cap.isMappingSupported(BioDataSource.UNIPROT, BioDataSource.ENTREZ_GENE));
   		
   		Assert.assertFalse(cap.isMappingSupported(
   				DataSource.getBySystemCode("??"), DataSource.getBySystemCode("!!")));
    }
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:27,代码来源:Test.java


示例11: testLocalAttributes

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
@org.junit.Test
public void testLocalAttributes() throws ClassNotFoundException, IDMapperException {
	
    if (configExists)
       {
   	    AttributeMapper mapper = (AttributeMapper)getLocalService();
   		
   		Xref insr = new Xref("3643", BioDataSource.ENTREZ_GENE);
   		Map<String, Set<String>> attrMap = mapper.getAttributes(insr);
   		Assert.assertNotNull(attrMap.get("Symbol"));
   		Assert.assertTrue(attrMap.get("Symbol").size() == 2);
   		
   		Set<String> attrValues = mapper.getAttributes(insr, "Symbol");
   		Assert.assertTrue(attrValues.size() == 2);
   		
   		Map<Xref, String> xrefMap = mapper.freeAttributeSearch("INSR", "Symbol", 1);
   		Assert.assertTrue(xrefMap.size() == 1);
   
   		xrefMap = mapper.freeAttributeSearch("INSR", "Symbol", 100);
   		Assert.assertTrue(xrefMap.containsKey(insr));
   		Assert.assertTrue(xrefMap.size() > 1);
   		
   		Set<String> attrs = mapper.getAttributeSet();
   		Assert.assertTrue(attrs.size() > 0);
       }
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:27,代码来源:Test.java


示例12: testSearchXref

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
public void testSearchXref() {
	try {
		WSSearchResult[] results = client.findPathwaysByXref(
				new Xref("8743", BioDataSource.ENTREZ_GENE)
		);
		assertNotNull(results);
		assertTrue(results.length > 0);

		results = client.findPathwaysByXref(
				new Xref("GO:0016021", BioDataSource.GENE_ONTOLOGY)
		);
		assertNotNull(results);
		assertTrue(results.length > 0);

		results = client.findPathwaysByXref(
				new Xref("8743", BioDataSource.ENTREZ_GENE),
				new Xref("GO:0016021", BioDataSource.GENE_ONTOLOGY),
				new Xref("1234", null)
		);
		assertNotNull(results);
		assertTrue(results.length > 0);
	} catch (RemoteException e) {
		e.printStackTrace();
		fail(e.getMessage());
	}
}
 
开发者ID:wikipathways,项目名称:org.wikipathways.client,代码行数:27,代码来源:WikiPathwaysClientTest.java


示例13: gexHelper

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
public void gexHelper(DBConnector con, String filename) throws IDMapperException, SQLException, DataException
{
	String dbFileName = System.getProperty("java.io.tmpdir") + File.separator + filename;

	// TODO: check if filename gets .pgex or .pgdb?
	SimpleGex sgex = new SimpleGex (dbFileName, true, con);

	sgex.prepare();
	sgex.addSample(55, "mysample", 99);
	sgex.addExpr(new Xref ("abc_at", BioDataSource.AFFY), "55", "3.141", 77);

	// TODO: this is messy. call finalize on writeable db, not close...
	sgex.finalize();

	// read data back
	sgex = new SimpleGex (dbFileName, false, con);

	ISample s = sgex.getSample(55);
	assertEquals (s.getName(), "mysample");
	assertEquals (s.getDataType(), 99);

	//TODO: test data value as well.

	sgex.close();
	assertTrue (new File(dbFileName + ".pgex").exists());

}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:28,代码来源:Test.java


示例14: Compat

import org.bridgedb.bio.BioDataSource; //导入依赖的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);
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:13,代码来源:Compat.java


示例15: initIDMapper

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
public static IDMapper initIDMapper(File file, boolean transitive) {
	BioDataSource.init();
	try {
		Class.forName("org.bridgedb.rdb.IDMapperRdb");
	} catch (ClassNotFoundException ex) {
		return null;
	}

	try {
		IDMapper mapper = BridgeDb.connect("idmapper-pgdb:" + file.getAbsolutePath());
		return mapper;
	} catch (IDMapperException e) {
		return null;
	}
}
 
开发者ID:mkutmon,项目名称:regin-creator,代码行数:16,代码来源:Utils.java


示例16: testBridgeWebservice

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
public void testBridgeWebservice() throws IDMapperException, ClassNotFoundException
{
	BioDataSource.init();
	Class.forName("org.bridgedb.webservice.bridgerest.BridgeRest");
	Xref insr1 = new Xref ("ENSG00000171105", DataSource.getBySystemCode("EnHs"));
	Xref insr2 = new Xref ("3643", DataSource.getBySystemCode("L"));
	basicMapperTest (measure, "bridgerest", "idmapper-bridgerest:http://webservice.bridgedb.org/Human", insr1, insr2);
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:9,代码来源:TestAll.java


示例17: testCronos

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
public void testCronos() throws IDMapperException, ClassNotFoundException
{
	Class.forName ("org.bridgedb.webservice.cronos.IDMapperCronos");
	BioDataSource.init();
	Xref insr1 = new Xref ("ENSG00000171105", BioDataSource.ENSEMBL);
	Xref insr2 = new Xref ("3643", BioDataSource.ENTREZ_GENE);
	basicMapperTest (measure, "cronos", "idmapper-cronos:hsa", insr1, insr2);		
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:9,代码来源:TestAll.java


示例18: main

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
public static void main(String args[]) throws ClassNotFoundException, IDMapperException
{
	// This example shows how to map an identifier
	// using BridgeWebservice
	
	// first we have to load the driver
	// and initialize information about DataSources
	Class.forName("org.bridgedb.webservice.bridgerest.BridgeRest");
	DataSourceTxt.init();
	
	// now we connect to the driver and create a IDMapper instance.
	IDMapper mapper = BridgeDb.connect ("idmapper-bridgerest:http://webservice.bridgedb.org/Human");
	
	// We create an Xref instance for the identifier that we want to look up.
	// In this case we want to look up Entrez gene 3643.
	Xref src = new Xref ("3643", BioDataSource.ENTREZ_GENE);
	
	// let's see if there are cross-references to Ensembl Human
	Set<Xref> dests = mapper.mapID(src, DataSource.getBySystemCode("EnHs"));
	
	// and print the results.
	// with getURN we obtain valid MIRIAM urn's if possible.
	System.out.println (src.getURN() + " maps to:");
	for (Xref dest : dests)
		System.out.println("  " + dest.getURN());
	
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:28,代码来源:ExHello.java


示例19: testFile

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
public void testFile() throws IDMapperException, MalformedURLException
{
	IDMapper mapper = BridgeDb.connect ("idmapper-text:" + YEAST_ID_MAPPING.toURL());
	src.add (RAD51);
	Map<Xref, Set<Xref>> refmap = mapper.mapID(src, BioDataSource.ENTREZ_GENE);
	Set<Xref> expected = new HashSet<Xref>();
	expected.add (new Xref ("856831", BioDataSource.ENTREZ_GENE));
	Assert.assertEquals (expected, refmap.get(RAD51));
	
	System.out.println (mapper.getCapabilities().getSupportedTgtDataSources());
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:12,代码来源:TestStack.java


示例20: testPgdb

import org.bridgedb.bio.BioDataSource; //导入依赖的package包/类
public void testPgdb() throws IDMapperException
{
	IDMapper mapper = BridgeDb.connect("idmapper-pgdb:" + GDB_HUMAN);
	src.add (INSR);
	Map<Xref, Set<Xref>> refmap = mapper.mapID(src, BioDataSource.ENTREZ_GENE);
	Set<Xref> expected = new HashSet<Xref>();
	expected.add (new Xref ("3643", BioDataSource.ENTREZ_GENE));
	Assert.assertEquals (expected, refmap.get(INSR));
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:10,代码来源:TestStack.java



注:本文中的org.bridgedb.bio.BioDataSource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BurlapProxyFactory类代码示例发布时间:2022-05-22
下一篇:
Java ISessionInfoVisitor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap