本文整理汇总了Python中oncotator.utils.MutUtils.MutUtils.retrievePrecedingBaseFromReference方法的典型用法代码示例。如果您正苦于以下问题:Python MutUtils.retrievePrecedingBaseFromReference方法的具体用法?Python MutUtils.retrievePrecedingBaseFromReference怎么用?Python MutUtils.retrievePrecedingBaseFromReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oncotator.utils.MutUtils.MutUtils
的用法示例。
在下文中一共展示了MutUtils.retrievePrecedingBaseFromReference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _createMutRow
# 需要导入模块: from oncotator.utils.MutUtils import MutUtils [as 别名]
# 或者: from oncotator.utils.MutUtils.MutUtils import retrievePrecedingBaseFromReference [as 别名]
def _createMutRow(self,m):
if m is None:
return None
# Calculate values
# TODO: This is a sloppy way to do GT
n_lod = self._extract_lod(m, 'init_n_lod')
t_lod = self._extract_lod(m, 't_lod_fstar')
# Nothing to call if both LODs are too low.
if (t_lod < 0) and (n_lod < 0):
return
qual = max(t_lod, 0)
gtN, gtT = self.genotype(n_lod, t_lod)
ref,alt,new_start = MutUtils.retrievePrecedingBaseFromReference(m)
ss,ssCode = self.determineSomaticStatus(gtN, gtT, qual)
if ss is None or ssCode is None:
return
n_alt_count = self._get_annotation_value(m, 'n_alt_count', '0', is_blank_default=True)
n_ref_count = self._get_annotation_value(m, 'n_ref_count', '0', is_blank_default=True)
n_alt_sum = self._get_annotation_value(m, 'n_alt_sum', '0', is_blank_default=True)
t_alt_count = self._get_annotation_value(m, 't_alt_count', '0', is_blank_default=True)
t_ref_count = self._get_annotation_value(m, 't_ref_count', '0', is_blank_default=True)
t_alt_sum = self._get_annotation_value(m, 't_alt_sum', '0', is_blank_default=True)
mq0=0
normalFormat = self._generateFormatFieldWithValues(gtN, n_alt_count, n_ref_count, mq0,
self._generateBQ(n_alt_count, n_alt_sum), ssCode)
primaryFormat = self._generateFormatFieldWithValues(gtT, t_alt_count, t_ref_count, mq0,
self._generateBQ(t_alt_count, t_alt_sum), ssCode)
filterVal = self._generateFilterField(m)
info = self._generateInfoField(m,filterVal, mq0, ss)
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NORMAL PRIMARY
mutRow = dict()
mutRow['CHROM'] = self._renderChrom(m.chr)
mutRow['POS'] = new_start
mutRow['ID'] = self.renderID(m)
mutRow['REF'] = ref
mutRow['ALT'] = alt
mutRow['QUAL'] = qual
mutRow['FILTER'] = filterVal
mutRow['INFO'] = info
mutRow['FORMAT'] = self._generateFormatField()
mutRow['NORMAL'] = normalFormat
mutRow['PRIMARY'] = primaryFormat
return mutRow