def register_qc(self): if not qc_disabled(): self.register_qc_complexity() self.register_qc_gene_strandedness() self.register_qc_biotypes() self.register_qc_alignment_stats() self.register_qc_subchromosomal() self.register_qc_splicing()
def register_qc(self, genes): if not qc_disabled(): self.register_qc_distribution(genes) self.register_qc_pca(genes)
def register_qc(self): if not qc_disabled(): self.register_qc_distribution() self.register_qc_pca() self.register_qc_correlation()
def filter(self, filter_definition, new_name=None): """Turn a filter definition [(column, operator, threshold)...] into a filtered genes object. Example: comp.filter(genes, '2x', [ ('FDR', '<=', 0.05) # a name from our comparison strategy - inspect column_lookup to list ('log2FC', '|>', 1), #absolute ... (anno, '>=', 50), ((anno, 1), '>=', 50), # for the second column of the annotator ((anno, 'columnX'), '>=', 50), # for the second column of the annotator ('annotator_columnX', '=>' 50), # search for an annotator with that column. Use if exactly one, complain otherwise ] """ if new_name is None: filter_str = [] for column, op, threshold in sorted(filter_definition): if op == "==": oop = "=" elif op == ">": oop = ">" elif op == "<": oop = "<" elif op == ">=": oop = "≥" elif op == "<=": oop = "≤" elif op == "|>": oop = "|>" elif op == "|<": oop = "|<" elif op == "|>=": oop = "|≥" elif op == "|<=": oop = "|≤" else: oop = op filter_str.append(f"{column}_{oop}_{threshold:.2f}") filter_str = "__".join(filter_str) new_name = f"Filtered_{self.comp[0]}-{self.comp[1]}_{filter_str}" lookup = self.column_lookup.copy() for c in self.columns: lookup[c] = c # we need the filter func for the plotting filter_func, annos = self.comparisons.ddf.definition_to_function( filter_definition, lookup) kwargs = {} if hasattr(self, "vid"): kwargs["vid"] = self.vid res = self.comparisons.ddf.filter( new_name, filter_func, annotators=annos, column_lookup=lookup, result_dir=self.result_dir / new_name, **kwargs, ) if not qc_disabled(): if "p" in self.comparison_strategy.columns: self.register_qc_volcano(self.comparisons.ddf, res, filter_func) # self.register_qc_ma_plot(self.comparisons.ddf, res, filter_func) res.plot_columns = self.samples() res.venn_annotator = self return res
def register_qc(self): from mbf_qualitycontrol import qc_disabled if not qc_disabled(): self.register_qc_fastqc()
def test_new_pipegraph_no_qc(self, new_pipegraph_no_qc): assert qc_disabled()
def test_both_fixtures(self, both_ppg_and_no_ppg_no_qc): if not ppg.inside_ppg(): assert qc_disabled() else: assert qc_disabled()
def test_no_pipegraph_means_disabled(self, no_pipegraph): assert ppg.util.global_pipegraph is None assert qc_disabled()
def test_qc_pruning_is_bound_to_ppg(self, new_pipegraph): assert not qc_disabled() disable_qc() assert qc_disabled() new_pipegraph.new_pipegraph() assert not qc_disabled()