def calculate(self):
"""
Wrapper method to calculate counts and enrichment scores
for all data in the :py:class:`~selection.Selection`.
"""
if len(self.labels) == 0:
raise ValueError("No data present across all sequencing libraries [{}]".format(self.name))
for label in self.labels:
self.merge_counts_unfiltered(label)
self.filter_counts(label)
if self.is_barcodevariant() or self.is_barcodeid():
self.combine_barcode_maps()
if self.scoring_method == "counts":
pass
elif self.scoring_method == "ratios":
for label in self.labels:
self.calc_ratios(label)
elif self.scoring_method == "simple":
for label in self.labels:
self.calc_simple_ratios(label)
elif self.scoring_method in ("WLS", "OLS"):
if len(self.timepoints) <= 2:
raise ValueError("Regression-based scoring requires three or more time points.")
for label in self.labels:
self.calc_log_ratios(label)
if self.scoring_method == "WLS":
self.calc_weights(label)
self.calc_regression(label)
else:
raise ValueError('Invalid scoring method "{}" [{}]'.format(self.scoring_method, self.name))
if self.scoring_method in ("ratios" , "WLS", "OLS") and self.component_outliers:
if self.is_barcodevariant() or self.is_barcodeid():
self.calc_outliers("barcodes")
if self.is_coding():
self.calc_outliers("variants")
评论列表
文章目录