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

Java IDMapperException类代码示例

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

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



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

示例1: syncGet

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

import org.bridgedb.IDMapperException; //导入依赖的package包/类
/**
 * Close the connection to the Expression database, with option to execute the 'SHUTDOWN COMPACT'
 * statement before calling {@link Connection#close()}
 */
public void close() throws DataException
{
	if(con != null)
	{
		try
		{
			dbConnector.closeConnection(con);
			con.close();
		}
		catch (IDMapperException e)
		{
			throw new DataException (e);
		}
		catch (SQLException ex)
		{
			throw new DataException (ex);
		}
		con = null;
	}
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:25,代码来源:SimpleGex.java


示例3: finalize

import org.bridgedb.IDMapperException; //导入依赖的package包/类
/**
 * Run this after insterting all sample / expression data
 * once, to defragment the db and create indices.
 * This method closes the current database connection in order
 * for the {@link DBConnector} to clean up.
 */
public void finalize() throws IDMapperException
{
	try
	{
		con.commit();
	}
	catch (SQLException e)
	{
		throw new IDMapperException (e);
	}
	dbConnector.compact(con);
	createGexIndices();
	dbConnector.closeConnection(con, DBConnector.PROP_FINALIZE);
	//The dbConnector may change the database file after cleaning up,
	//for example, the derby connector first creates the database as directory
	//and then adds the database to a zip file and removes the directory.
	//The database name needs to be changed to the zip file in this case.
	String newDb = dbConnector.finalizeNewDatabase(dbName);
	setDbName(newDb);
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:27,代码来源:SimpleGex.java


示例4: testImportSimplyWrong

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

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

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

	// 91 errors expected if no genes can be looked up.
	assertEquals (91, info2.getErrorList().size());
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:17,代码来源:Test.java


示例5: testImportAffy

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


示例6: testImportLongHeaders

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


示例7: testImportNoHeader

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


示例8: testImportWithText

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


示例9: getIdentifiers

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


示例10: getIterator

import org.bridgedb.IDMapperException; //导入依赖的package包/类
@Override
public Iterable<Xref> getIterator() throws IDMapperException {
	Set<Xref> xrefs = new HashSet<Xref>();
	final QueryLifeCycle pst = qAllXrefs;
	synchronized (pst) { 
    	try
    	{
    	 	pst.init();
    	 	ResultSet rs = pst.executeQuery();
    	 	while (rs.next())
    	 	{
    	 		xrefs.add(new Xref(rs.getString(1), DataSource.getExistingBySystemCode(rs.getString(2))));
    	 	}
    	}
    	catch (SQLException ignore)
    	{
    		throw new IDMapperException(ignore);
    	}
		finally {pst.cleanup(); }
    	return xrefs;
	}		
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:23,代码来源:SimpleGdbImplCommon.java


示例11: getMapSrcTgt

import org.bridgedb.IDMapperException; //导入依赖的package包/类
private Map<DataSource, Set<DataSource>> getMapSrcTgt()
        throws IDMapperException {
    Map<DataSource, Set<DataSource>> map = new HashMap<DataSource, Set<DataSource>>();
    Set<String> domains = stub.availableDomains(authority, species);
    for (String domain : domains) {
        DataSource src = DataSource.getByFullName(domain);
        Set<String> ranges = stub.availableRanges(authority, species, domain);
        Set<DataSource> tgts = new HashSet<DataSource>();
        for (String range : ranges) {
            tgts.add(DataSource.getByFullName(range));
        }
        map.put(src, tgts);
    }

    return map;
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:17,代码来源:IDMapperSynergizer.java


示例12: checkSchemaVersion

import org.bridgedb.IDMapperException; //导入依赖的package包/类
/**
 * look at the info table of the current database to determine the schema version.
 * @throws IDMapperException when looking up the schema version failed
 */
private void checkSchemaVersion() throws IDMapperException 
{
	int version = 0;
	try 
	{
		ResultSet r = getConnection().createStatement().executeQuery("SELECT schemaversion FROM info");
		if(r.next()) version = r.getInt(1);
	} 
	catch (SQLException e) 
	{
		//Ignore, older db's don't even have schema version
	}
	if(version != GDB_COMPAT_VERSION) 
	{
		throw new IDMapperException ("Implementation and schema version mismatch");
	}
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:22,代码来源:SimpleGdbImpl3.java


示例13: testGdbAttributes

import org.bridgedb.IDMapperException; //导入依赖的package包/类
/**
 * From schema v2 to v3 there was a change in how the backpage was stored.
 * In schema v2 there was a backpage column in the datanode table
 * In schema v3 the backpage is split in several attributes.
 * For backwards compatibility, SimpleGdbImpl2 fakes these new attributes. 
 * This is tested here. 
 * @throws IDMapperException should be considered a failed test
 */
@Ignore public void testGdbAttributes() throws IDMapperException
{
	// test special attributes that are grabbed from backpage
	// since this is a Schema v2 database
	IDMapper gdb = BridgeDb.connect ("idmapper-pgdb:" + GDB_HUMAN);
	AttributeMapper am = (AttributeMapper)gdb;
	Xref ref = new Xref ("26873", DataSource.getBySystemCode("L"));
	Assert.assertTrue (am.getAttributes(ref, "Synonyms").contains ("5-Opase|DKFZP434H244|OPLA"));
	Assert.assertTrue (am.getAttributes(ref, "Description").contains ("5-oxoprolinase (EC 3.5.2.9) (5-oxo-L-prolinase) (5-OPase) (Pyroglutamase) [Source:UniProtKB/Swiss-Prot.Acc:O14841]"));
	Assert.assertTrue (am.getAttributes(ref, "Chromosome").contains ("8"));
	Assert.assertTrue (am.getAttributes(ref, "Symbol").contains ("OPLAH"));
	
	Set<String> allExpectedAttributes = new HashSet<String>();
	allExpectedAttributes.add ("26873");
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:24,代码来源:Test2.java


示例14: IDMappingReaderFromDelimitedReader

import org.bridgedb.IDMapperException; //导入依赖的package包/类
/**
 *
 * @param reader a {@link Reader}
 * @param regExDataSourceDelimiter regular expression of delimiter between
 *        data sources
 * @param regExIDDelimiter regular expression of delimiter between IDs
 * @param transitivity transitivity support
 * @throws IDMapperException if failed to read
 */
public IDMappingReaderFromDelimitedReader(final Reader reader,
        final String regExDataSourceDelimiter,
        final String regExIDDelimiter,
        final boolean transitivity) throws IDMapperException {
    if (reader==null || regExDataSourceDelimiter==null) {
        throw new java.lang.IllegalArgumentException("reader and regExDataSourceDelimiter cannot be null");
    }

    readData(reader);
    this.regExDataSourceDelimiter = regExDataSourceDelimiter;
    this.regExIDDelimiter = regExIDDelimiter;
    this.transitivity = transitivity;

    dsValid = false;
    idMappingValid = false;
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:26,代码来源:IDMappingReaderFromDelimitedReader.java


示例15: readData

import org.bridgedb.IDMapperException; //导入依赖的package包/类
/**
 * Read data.
 * @param reader to read data from
 * @throws IDMapperException when file can't be read
 */
protected void readData(final Reader reader) throws IDMapperException {
    data = new ArrayList<String>();
    BufferedReader bfdrd = new BufferedReader(reader);
    try {
        String line = bfdrd.readLine();

        while (line!=null) {
            data.add(line);
            line = bfdrd.readLine();
        }
        
        bfdrd.close();
        reader.close();
    } catch(IOException e) {
        throw new IDMapperException(e);
    }
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:23,代码来源:IDMappingReaderFromDelimitedReader.java


示例16: freeSearchInner

import org.bridgedb.IDMapperException; //导入依赖的package包/类
private XrefsBean freeSearchInner(String text, String limitString) throws BridgeDBException {
    if (text == null) {
        throw new BridgeDBException(WsConstants.TEXT + " parameter missing");
    }
    Set<Xref> mappings;
    try {
        if (limitString == null || limitString.isEmpty()){
            mappings = idMapper.freeSearch(text, Integer.MAX_VALUE);
       } else {
            int limit = Integer.parseInt(limitString);
            mappings = idMapper.freeSearch(text,limit);
        }
    } catch (IDMapperException e){
        throw BridgeDBException.convertToBridgeDB(e);
    }
    return new XrefsBean(mappings);
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:18,代码来源:WSCoreService.java


示例17: mapID

import org.bridgedb.IDMapperException; //导入依赖的package包/类
/** {@inheritDoc} */
public Set<Xref> mapID(Xref srcXref, DataSource... tgtDataSources) throws IDMapperException {        Map<Xref,Set<Xref>> mapXrefs = reader.getIDMappings();
    Set<Xref> result = new HashSet<Xref>();

    if (mapXrefs==null) {
        return result;
    }

    Set<DataSource> tgtDss = new HashSet<DataSource>(Arrays.asList(tgtDataSources));
    Set<Xref> destRefs = mapXrefs.get(srcXref);
    if (destRefs != null) for (Xref destRef : mapXrefs.get(srcXref))
    {
        if (tgtDataSources.length == 0 || tgtDss.contains(destRef.getDataSource()))
        {
            result.add (destRef);
        }
    }
    
    return result;
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:21,代码来源:IDMapperFile.java


示例18: getAttributes

import org.bridgedb.IDMapperException; //导入依赖的package包/类
/** {@inheritDoc} */
public Map<String, Set<String>> getAttributes(Xref ref)
throws IDMapperException {
	try {
		Map<String, Set<String>> results = new HashMap<String, Set<String>>();

		BufferedReader in = new UrlBuilder ("attributes")
			.ordered(ref.getDataSource().getSystemCode(), ref.getId())
			.openReader();
		
		String line;
		while ((line = in.readLine()) != null) {
			String[] cols = line.split("\t", -1);
			Set<String> rs = results.get(cols[0]);
			if(rs == null) results.put(cols[0], rs = new HashSet<String>());
			rs.add(cols[1]);
		}
		in.close();
		return results;
	} catch (IOException ex) {
		throw new IDMapperException (ex);
	} 
}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:24,代码来源:BridgeRest.java


示例19: finalizeNewDatabase

import org.bridgedb.IDMapperException; //导入依赖的package包/类
public String finalizeNewDatabase(String dbName) throws IDMapperException
	{
		try
		{
			DriverManager.getConnection("jdbc:derby:" + FileUtilsGdb.removeExtension(dbName) + ";shutdown=true");
		}
		catch(SQLException e)
		{
			if (e.getSQLState().equals ("08006"))
			{
				// this exception is acutally expected, see
			    // http://db.apache.org/derby/docs/10.3/getstart/rwwdactivity3.html
//				Logger.log.info ("Database shudown cleanly");
			}
			else throw new IDMapperException (e);
		}
		return dbName;
	}
 
开发者ID:bridgedb,项目名称:BridgeDb,代码行数:19,代码来源:DataDerbyDirectory.java


示例20: mapIDtransitiveTargetted

import org.bridgedb.IDMapperException; //导入依赖的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.IDMapperException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java SyntacticLocalityModuleExtractor类代码示例发布时间:2022-05-22
下一篇:
Java OrientationEnum类代码示例发布时间: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