本文整理汇总了Python中hgu.Util.stripPublicIdPrefix方法的典型用法代码示例。如果您正苦于以下问题:Python Util.stripPublicIdPrefix方法的具体用法?Python Util.stripPublicIdPrefix怎么用?Python Util.stripPublicIdPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hgu.Util
的用法示例。
在下文中一共展示了Util.stripPublicIdPrefix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getCloneByNibbXdbId
# 需要导入模块: from hgu import Util [as 别名]
# 或者: from hgu.Util import stripPublicIdPrefix [as 别名]
def getCloneByNibbXdbId(nibbXdbId):
"""
Return information about a NIBB XDB clone, given its NIBB XDB ID.
nibbXdbId: NIBB XDB clone ID, with or without the leading NIBB:.
"""
cloneId = Util.stripPublicIdPrefix(nibbXdbId)
nibbXdbClone = None
if cloneId in _clonesByNibbXdbId:
nibbXdbClone = _clonesByNibbXdbId[cloneId]
elif cloneId in _failedNibbXdbIds:
pass
else:
# build clone from sequence and library.
library = NibbXdbLibrary.getLibraryByNibbXdbId(cloneId)
if library:
sequencePage = urllib.urlopen(SEQUENCE_URL + cloneId )
nibbXdbClone = NibbXdbClone(sequencePage, library)
_clonesByNibbXdbId[cloneId] = nibbXdbClone
else:
Util.warning([
"Failed to locate NIBB clone library for " + nibbXdbId])
_failedNibbXdbIds.add(nibbXdbId)
return nibbXdbClone
示例2: getLibraryByNibbXdbId
# 需要导入模块: from hgu import Util [as 别名]
# 或者: from hgu.Util import stripPublicIdPrefix [as 别名]
def getLibraryByNibbXdbId(nibbXdbId):
"""
Return the library information for the given NIBB XDB ID. Returns None
if ID does not occur in any library.
The ID can be with or without the leading NIBB: prefix.
"""
cloneId = Util.stripPublicIdPrefix(nibbXdbId)
cloneIdStart = cloneId[0:CLONE_ID_LIBRARY_KEY_LENGTH]
matchingLib = None
for lib in _libraries:
if lib.getStartIdKey() <= cloneIdStart <= lib.getEndIdKey():
matchingLib = lib
break
return matchingLib