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

Java Xref类代码示例

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

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



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

示例1: syncGet

import org.bridgedb.Xref; //导入依赖的package包/类
@WorkerThreadOnly
public List<? extends IRow> syncGet(Xref ref) throws IDMapperException, DataException
{
	if (destFilterCache == null)
	{
		destFilterCache = parent.getUsedDatasources();
	}

	List<IRow> result;
	if (!data.containsKey (ref))
	{
		// get results and sort them
		result = new ArrayList<IRow>();
		Collection <? extends IRow> collection = getDataForXref(ref, mapper, destFilterCache);
		if (collection != null) result.addAll(collection);
		Collections.sort(result);
		data.put (ref, result);
	}
	else
	{
		result = data.get(ref);
	}
	return result;
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:25,代码来源:CachedData.java


示例2: addExpr

import org.bridgedb.Xref; //导入依赖的package包/类
/**
 * Add an expression row to the db. Must call prepare() before.
 */
public void addExpr(Xref ref, String idSample, String value, int group)
	throws SQLException
{
	assert (pstExpr != null);
	pstExpr.setString(1, ref.getId());
	pstExpr.setString(2, ref.getDataSource().getSystemCode());
	pstExpr.setString(3, idSample);
	//TODO: this is a hack.
	// Proper solution: ask user which columns contain data
	// don't even try to import annotation and other stuff
	// give an exception if a data value is longer than 50
	String truncValue = value;
	if (value.length() > 50) truncValue = value.substring(0, 50);
	pstExpr.setString(4, truncValue);
	pstExpr.setInt(5, group);
	pstExpr.execute();
	if (++commitCount % 1000 == 0) con.commit();
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:22,代码来源:SimpleGex.java


示例3: doGetSrcRefs

import org.bridgedb.Xref; //导入依赖的package包/类
private void doGetSrcRefs(List<File> pwyFiles)
{
	for (File file : pwyFiles)
	{
		try
		{
			PathwayParser pwyParser = new PathwayParser(file, xmlReader);

			Logger.log.info ("Reading references from " + pwyParser.getName());

			Set<Xref> srcRefs = new HashSet<Xref>();
			for (XrefWithSymbol x : pwyParser.getGenes()) srcRefs.add (x.asXref());

			PathwayInfo pi = new PathwayInfo();
			pi.name = pwyParser.getName();
			pi.srcRefs = srcRefs;
			pi.file = file;
			getPathways().add (pi);
		}
		catch (ParseException ex)
		{
			// ignore files that are not valid gpml, just skip
		}
	}
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:26,代码来源:PathwayMap.java


示例4: calculatePathway

import org.bridgedb.Xref; //导入依赖的package包/类
/**
 * Calculates n and r for a pathway the alternative way:
 * <UL>
 * <LI>n: the number of rows in the dataset that map to a gene in the pathway.
 * <LI>r: the number of significant rows in the dataset that map to a gene in the pathway.
 * </UL>
 */
public StatisticsPathwayResult calculatePathway(PathwayInfo pi)
{
	Set<String> probesMeasured = new HashSet<String>();
	Set<String> probesPositive = new HashSet<String>();

	for (Xref ref : pi.getSrcRefs())
	{
		RefInfo refInfo = dataMap.get(ref);
		probesMeasured.addAll(refInfo.getProbesMeasured());
		probesPositive.addAll(refInfo.getProbesPositive());
	}

	int cPwyMeasured = probesMeasured.size();
	int cPwyPositive = probesPositive.size();
	int cPwyTotal = pi.getSrcRefs().size();

	double zscore = Stats.zscore(cPwyMeasured, cPwyPositive, result.bigN, result.bigR);
	StatisticsPathwayResult spr = new StatisticsPathwayResult(
			pi.getFile(), pi.getName(),
			cPwyMeasured, cPwyPositive, cPwyTotal, zscore);
	return spr;
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:30,代码来源:ZScoreCalculator.java


示例5: findPathwaysByXref

import org.bridgedb.Xref; //导入依赖的package包/类
/**
 * Search for pathways containing one of the given xrefs by taking
 * into account cross-references to other database systems.
 * @param xrefs
 * @return
 * @throws RemoteException
 */
public WSSearchResult[] findPathwaysByXref(Xref... xrefs) throws RemoteException {
	String[] ids = new String[xrefs.length];
	String[] codes = new String[xrefs.length];
	for(int i = 0; i < xrefs.length; i++) {
		ids[i] = xrefs[i].getId();
		DataSource ds = xrefs[i].getDataSource();
		if(ds == null) {
			codes[i] = null;
		} else {
			codes[i] = ds.getSystemCode();
		}
	}
	WSSearchResult[] r =  port.findPathwaysByXref(ids, codes);
	if(r == null) r = new WSSearchResult[0];
	return r;
}
 
开发者ID:wikipathways,项目名称:wikipathways-api-client-java,代码行数:24,代码来源:WikiPathwaysClient.java


示例6: getIdentifiers

import org.bridgedb.Xref; //导入依赖的package包/类
private String getIdentifiers(String identifier, String targetSyscodeIn,
		List<String> targetSyscodeOut, IDMapper mapper) throws IDMapperException {
	String identifiers = "";
	Set<String> ids = new HashSet<String>();
	ids.add(identifier);
	Xref in = new Xref(identifier, DataSource.getBySystemCode(targetSyscodeIn));
	for(String ds : targetSyscodeOut) {
		Set<Xref> result = mapper.mapID(in, DataSource.getBySystemCode(ds));
		for(Xref x : result) {
			ids.add(x.getId());
		}
	}
	for(String str : ids) {
		if(!str.equals(identifier)) {
			identifiers = identifiers + "," + str;
		}
	}
	return identifiers;
}
 
开发者ID:mkutmon,项目名称:regin-creator,代码行数:20,代码来源:GenericCreator.java


示例7: testSearchXref

import org.bridgedb.Xref; //导入依赖的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


示例8: testMapUri_sourceXref_lensId_tgtUriPatterns_second__null

import org.bridgedb.Xref; //导入依赖的package包/类
/**
 * Test of mapUri method, of class UriMapper.
 */
@Test
public void testMapUri_sourceXref_lensId_tgtUriPatterns_second__null() throws Exception {
    report("MapUri_sourceXref_lensId_tgtUriPatterns_second_null");
    Xref sourceXref = map3xref2;
    String lensId = Lens.DEFAULT_LENS_NAME;
    Set<String> tgtUriPatterns = new HashSet<String>();
    tgtUriPatterns.add(stringPattern2);
    tgtUriPatterns.add(null);
    Set results = uriMapper.mapUri(sourceXref, lensId, NULL_GRAPH, tgtUriPatterns);
    assertFalse(results.contains(map3Uri1));
    assertTrue(results.contains(map3Uri2));
    assertFalse(results.contains(map3Uri2a));
    assertFalse(results.contains(map3Uri3));
    assertFalse(results.contains(map2Uri2));
    assertFalse(results.contains(map1Uri3));
    checkForNoOtherlensId(results);
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:21,代码来源:UriMapperNullTargetTest.java


示例9: testMapUri_sourceXref_lensId_tgtUriPattern

import org.bridgedb.Xref; //导入依赖的package包/类
/**
 * Test of mapUri method, of class UriMapper.
 */
@Test
public void testMapUri_sourceXref_lensId_tgtUriPattern() throws Exception {
    report("MapUri_sourceXref_lensId_tgtUriPattern");
    Xref sourceXref = map3xref2;
    String lensId = null;
    Set<String> tgtUriPatterns = new HashSet<String>();
    tgtUriPatterns.add(stringPattern3);
    Set results = uriMapper.mapUri(sourceXref, lensId, EMPTY_GRAPH, tgtUriPatterns);
    assertFalse(results.contains(map3Uri1));
    assertFalse(results.contains(map3Uri2));
    assertFalse(results.contains(map3Uri2a));
    assertTrue(results.contains(map3Uri3));
    assertFalse(results.contains(map2Uri2));
    assertFalse(results.contains(map1Uri3));
    checkForNoOtherlensId(results);
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:20,代码来源:UriMapperNullLensTest.java


示例10: testLocalAttributes

import org.bridgedb.Xref; //导入依赖的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


示例11: readList

import org.bridgedb.Xref; //导入依赖的package包/类
public void readList(File f)
		{
			refs = new ArrayList<Xref>();
//			int count = 0;
			try {
				BufferedReader in = new BufferedReader(new FileReader(f));
				String line;
				in.readLine(); // skip header line
				while ((line = in.readLine()) != null)
				{
					refs.add (new Xref (line, base));
//					count++;
//					if (count > 10) break;
				}
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:20,代码来源:ComparisonScript.java


示例12: uriSearch

import org.bridgedb.Xref; //导入依赖的package包/类
@Override
public Set<String> uriSearch(String text, int limit) throws BridgeDBException {
    Set<Xref> xrefs = freeSearch(text, limit);
    Set<String> results = new HashSet<String>();
    for (Xref xref : xrefs) {
        results.addAll(toUris(xref));
        if (results.size() >= limit) {
            break;
        }
    }
    if (results.size() > limit) {
        int count = 0;
        for (Iterator<String> i = results.iterator(); i.hasNext();) {
            String element = i.next();
            count++;
            if (count > limit) {
                i.remove();
            }
        }
    }
    return results;
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:23,代码来源:SQLUriMapper.java


示例13: getAttributes

import org.bridgedb.Xref; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public Set<String> getAttributes(Xref ref, String attrType) throws IDMapperException {
    if (ref==null || attrType==null) {
        return Collections.emptySet();
    }

    String srcType = ref.getDataSource().getFullName();
    if (srcType == null) return Collections.emptySet();
    
    String[] tgtTypes = new String[]{attrType};
    Set<String> srcIds = new HashSet<String>(1);
    srcIds.add(ref.getId());

    Map<String,Set<String>[]> map = stub.translate(mart, dataset, srcType, tgtTypes, srcIds);
    Set<String>[] sets = map.get(ref.getId());
    if (sets==null || sets.length==0)
        return null;

    return sets[0];
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:23,代码来源:IDMapperBiomart.java


示例14: doInit

import org.bridgedb.Xref; //导入依赖的package包/类
protected void doInit() throws ResourceException {
	super.doInit();
	try {
	    System.out.println( "Xrefs.doInit start" );
		//Required parameters
		String id = urlDecode((String)getRequest().getAttributes().get(IDMapperService.PAR_ID));
		String dsName = urlDecode((String)getRequest().getAttributes().get(IDMapperService.PAR_SYSTEM));
		DataSource dataSource = parseDataSource(dsName);
		if(dataSource == null) {
			throw new IllegalArgumentException("Unknown datasource: " + dsName);
		}
		xref = new Xref(id, dataSource);
		
		//Optional parameters
		String targetDsName = (String)getRequest().getAttributes().get(IDMapperService.PAR_TARGET_SYSTEM);
		if(targetDsName != null) {
			targetDs = parseDataSource(urlDecode(targetDsName));
		}
	} catch(Exception e) {
		throw new ResourceException(e);
	}
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:23,代码来源:Xrefs.java


示例15: testMapUri_sourceXref_lensId_null_pattern

import org.bridgedb.Xref; //导入依赖的package包/类
/**
 * Test of mapUri method, of class UriMapper.
 */
@Test
public void testMapUri_sourceXref_lensId_null_pattern() throws Exception {
    report("MapUri_sourceXref_lensId_null_pattern");
    Xref sourceXref = map3xref2;
    String lensId = Lens.DEFAULT_LENS_NAME;
    Set<String> targets = null;
    Set results = uriMapper.mapUri(sourceXref, lensId, NULL_GRAPH, targets);
    assertTrue(results.contains(map3Uri1));
    assertTrue(results.contains(map3Uri2));
    assertTrue(results.contains(map3Uri2a));
    assertTrue(results.contains(map3Uri3));
    assertFalse(results.contains(map2Uri2));
    assertFalse(results.contains(map1Uri3));
    checkForNoOtherlensId(results);
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:19,代码来源:UriMapperNullTargetTest.java


示例16: xrefExistsInner

import org.bridgedb.Xref; //导入依赖的package包/类
private XrefExistsBean xrefExistsInner(String id, String scrCode) throws BridgeDBException {
    if (id == null) {
        throw new BridgeDBException (WsConstants.ID + " parameter can not be null");
    }
    if (scrCode == null) {
        throw new BridgeDBException (WsConstants.DATASOURCE_SYSTEM_CODE + " parameter can not be null");
    }  
    DataSource dataSource;
    try {
        dataSource = DataSource.getExistingBySystemCode(scrCode);
    } catch (IllegalArgumentException ex){
         logger.error(ex.getMessage());
         return new XrefExistsBean(id, scrCode, false);           
    }
    Xref source = new Xref(id, dataSource);
    try {
        return new XrefExistsBean(source, idMapper.xrefExists(source));
    } catch (IDMapperException e){
        throw BridgeDBException.convertToBridgeDB(e);
    }
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:22,代码来源:WSCoreService.java


示例17: testFromUrn

import org.bridgedb.Xref; //导入依赖的package包/类
@Test
public void testFromUrn()
{
	Xref ref = Xref.fromUrn("urn:miriam:ncbigene:3643");
	assertEquals (BioDataSource.ENTREZ_GENE, ref.getDataSource());
	assertEquals ("3643", ref.getId());

	ref = Xref.fromUrn("urn:miriam:blahblahblah:abc");
	assertEquals (DataSource.getByFullName("blahblahblah"), ref.getDataSource());

	ref = Xref.fromUrn("blahblahblha");
	assertNull (ref);
	
	ref = Xref.fromUrn("urn:miriam:go:GO%3A00001234");
	assertEquals (BioDataSource.GENE_ONTOLOGY, ref.getDataSource());
	assertEquals ("GO:00001234", ref.getId());
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:18,代码来源:BioDataSourceTest.java


示例18: testMapUri_sourceXref_lensId_tgtUriPattern

import org.bridgedb.Xref; //导入依赖的package包/类
/**
 * Test of mapUri method, of class UriMapper.
 */
@Test
public void testMapUri_sourceXref_lensId_tgtUriPattern() throws Exception {
    report("MapUri_sourceXref_lensId_tgtUriPattern");
    Xref sourceXref = map3xref2;
    String lensId = Lens.DEFAULT_LENS_NAME;
    Set<String> targets = new HashSet<String>();
    targets.add(stringPattern3);
    Set results = uriMapper.mapUri(sourceXref, lensId, NULL_GRAPH, targets);
    assertFalse(results.contains(map3Uri1));
    assertFalse(results.contains(map3Uri2));
    assertFalse(results.contains(map3Uri2a));
    assertTrue(results.contains(map3Uri3));
    assertFalse(results.contains(map2Uri2));
    assertFalse(results.contains(map1Uri3));
    checkForNoOtherlensId(results);
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:20,代码来源:UriMapperSimpleTest.java


示例19: testMapID_sourceXref_lensId_tgtDataSource

import org.bridgedb.Xref; //导入依赖的package包/类
/**
 * Test of mapID method, of class UriMapper.
 */
@Test
public void testMapID_sourceXref_lensId_tgtDataSource() throws Exception {
    report("MapID_sourceXref_lensId_tgtDataSource");
    Xref sourceXref = map2xref2;
    String lensId = Lens.ALL_LENS_NAME;
    DataSource tgtDataSource = DataSource3;
    Set<DataSource> tgtDataSources = new HashSet<DataSource>();
    tgtDataSources.add(tgtDataSource);
    Set results = uriMapper.mapID(sourceXref, lensId, tgtDataSources);
    assertFalse(results.contains(map2xref1));
    assertFalse(results.contains(map2xref2));
    assertTrue(results.contains(map2xref3));
    assertFalse(results.contains(map1xref2));
    assertFalse(results.contains(map1xref1));
    assertFalse(results.contains(map3xref2));
    assertFalse(results.contains(map2Axref1));
    assertFalse(results.contains(map2Axref2));
    assertTrue(results.contains(map2Axref3));
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:23,代码来源:UriMapperAllLensTest.java


示例20: mapIDtransitiveTargetted

import org.bridgedb.Xref; //导入依赖的package包/类
public Set<Xref> mapIDtransitiveTargetted(Xref ref, Set<DataSource> dsFilter)
		throws IDMapperException
{
	DataSource srcDs = ref.getDataSource();

	Set<Xref> result = new HashSet<Xref>();
	for (DataSource tgtDs : targetMap.keySet()) {
		for (Path path : targetMap.get(tgtDs)) {
			DataSource pathSource = path.getSource();
			DataSource pathTarget = path.getTarget();
			if ( pathSource == srcDs && tgtDs == pathTarget && 
					dsFilter.contains(pathTarget)) 
			{
				for (Xref j : mapID(ref, path))
				{
					if (dsFilter.contains(j.getDataSource())) 
						result.add(j);
				}
			}
		}
	}
	return result;
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:24,代码来源:TransitiveGraph.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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