本文整理匯總了Python中cogent.core.profile.Profile.Alphabet['Y']方法的典型用法代碼示例。如果您正苦於以下問題:Python Profile.Alphabet['Y']方法的具體用法?Python Profile.Alphabet['Y']怎麽用?Python Profile.Alphabet['Y']使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cogent.core.profile.Profile
的用法示例。
在下文中一共展示了Profile.Alphabet['Y']方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_copy
# 需要導入模塊: from cogent.core.profile import Profile [as 別名]
# 或者: from cogent.core.profile.Profile import Alphabet['Y'] [as 別名]
def test_copy(self):
"""copy: should act as expected while rebinding/modifying attributes
"""
p = Profile(array([[1,1],[.7,.3]]),{'A':'A','G':'G','R':'AG'},"AG")
p_copy = p.copy()
assert p.Data is p_copy.Data
assert p.Alphabet is p_copy.Alphabet
assert p.CharOrder is p_copy.CharOrder
#modifying p.Data modifies p_copy.Data
p.Data[1,1] = 100
assert p.Alphabet is p_copy.Alphabet
#normalizing p.Data rebinds it, so p_copy.Data is unchanged
p.normalizePositions()
assert not p.Data is p_copy.Data
#Adding something to the alphabet changes both p and p_copy
p.Alphabet['Y']='TC'
assert p.Alphabet is p_copy.Alphabet
#Rebinding the CharOrder does only change the original
p.CharOrder='XX'
assert not p.CharOrder is p_copy.CharOrder