本文整理匯總了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