本文整理匯總了Python中pyfasta.Fasta.iteritems方法的典型用法代碼示例。如果您正苦於以下問題:Python Fasta.iteritems方法的具體用法?Python Fasta.iteritems怎麽用?Python Fasta.iteritems使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyfasta.Fasta
的用法示例。
在下文中一共展示了Fasta.iteritems方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: parse_posns
# 需要導入模塊: from pyfasta import Fasta [as 別名]
# 或者: from pyfasta.Fasta import iteritems [as 別名]
a[start] = a[start - 1]
else:
a[start:end] = (a[start - 1] + a[end]) / 2
if __name__ == "__main__":
import doctest
doctest.testmod()
if __name__ == "__main__":
plookups = parse_posns(posns)
fasta = Fasta("/opt/src/flatfeature/data/thaliana_v9.fasta")
arrs = {}
counts = {}
for seqid, seq in fasta.iteritems():
arrs[seqid] = np.zeros((len(seq),), dtype=np.float32)
counts[seqid] = np.zeros((len(seq),), dtype=np.float32)
print arrs.keys()
success = 0
for id, val in parse_hists(hists):
start, length = plookups[id]
assert val != 0
#print id, val, start, length
seqid = id[3]
if not seqid in "12345": continue
a = arrs[seqid][start - 1: start + length]
counts[seqid][start - 1: start + length] += 1
c = counts[seqid][start -1: start + length]