本文整理匯總了Python中dark.sam.PaddedSAM.referencesToStr方法的典型用法代碼示例。如果您正苦於以下問題:Python PaddedSAM.referencesToStr方法的具體用法?Python PaddedSAM.referencesToStr怎麽用?Python PaddedSAM.referencesToStr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dark.sam.PaddedSAM
的用法示例。
在下文中一共展示了PaddedSAM.referencesToStr方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testReferencesToStr
# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import referencesToStr [as 別名]
def testReferencesToStr(self):
"""
The referencesToStr method must return the expected string.
"""
data = '\n'.join([
'@SQ SN:id1 LN:90',
'@SQ SN:id2 LN:91',
]).replace(' ', '\t')
with dataFile(data) as filename:
ps = PaddedSAM(filename)
self.assertEqual('id1 (length 90)\nid2 (length 91)',
ps.referencesToStr())
ps.close()
示例2: sorted
# 需要導入模塊: from dark.sam import PaddedSAM [as 別名]
# 或者: from dark.sam.PaddedSAM import referencesToStr [as 別名]
"""
result = []
for offset in sorted(nucleotides):
result.append(
'%s%d: %s' % (prefix, offset,
baseCountsToStr(nucleotides[offset])))
return '\n'.join(result)
args = parser.parse_args()
paddedSAM = PaddedSAM(args.samFile)
try:
if args.listReferenceNames:
print(paddedSAM.referencesToStr(), file=sys.stdout)
else:
try:
for read in paddedSAM.queries(
referenceName=args.referenceName,
minLength=args.minLength,
rcSuffix=args.rcSuffix,
dropSecondary=args.dropSecondary,
dropSupplementary=args.dropSupplementary,
dropDuplicates=args.dropDuplicates,
allowDuplicateIds=args.allowDuplicateIds,
keepQCFailures=args.keepQCFailures,
rcNeeded=args.rcNeeded):
print(read.toString('fasta'), end='')
except UnequalReferenceLengthError as e:
raise ValueError(