Skip to content

Commit

Permalink
Remove RNA-SeQC 3' bias statistics
Browse files Browse the repository at this point in the history
from MultiQC report
  • Loading branch information
marcellevstek committed Mar 14, 2024
1 parent 4431dbd commit b62a501
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 54 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Added

Changed
-------
- Remove ``rnaseqc-qc`` 3' bias statistics from MultiQC report

Fixed
-----
Expand Down
46 changes: 1 addition & 45 deletions resolwe_bio/processes/support_processors/multiqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,43 +64,6 @@ def create_summary_table(samples, species, build):
json.dump(sample_summary_json, out_file)


def parse_rnaseqc_report(report):
"""Parse RNA-SeQC QC report file."""
df = pd.read_csv(report, sep="\t")
return dict(df.values)


def create_coverage_table(sample_names, reports):
"""Prepare coverage metrics table."""
coverage_stats = [
"Genes used in 3' bias",
"Mean 3' bias",
"Median 3' bias",
"3' bias Std",
"3' bias MAD_Std",
"3' Bias, 25th Percentile",
"3' Bias, 75th Percentile",
]

coverage_qc_json = {
"id": "coverage_qc",
"section_name": "RNA-SeQC Coverage Stats",
"plot_type": "table",
"file_format": "json",
"data": {},
}

for sample_name, report in zip(sample_names, reports):
report_data = parse_rnaseqc_report(report)

coverage_qc_json["data"][sample_name] = {
k: report_data[k] for k in coverage_stats if k in report_data
}

with open("rnaseqc_coverage_mqc.json", "w") as out_file:
json.dump(coverage_qc_json, out_file)


def parse_chip_qc_report(report):
"""Parse ChiP-seq QC report file."""
df = pd.read_csv(report, sep="\t")
Expand Down Expand Up @@ -439,7 +402,7 @@ class MultiQC(Process):
}
category = "QC"
data_name = "MultiQC report"
version = "1.22.2"
version = "1.24.0"

class Input:
"""Input fields to process MultiQC."""
Expand Down Expand Up @@ -517,8 +480,6 @@ def run(self, inputs, outputs):
unsupported_data = []
star_quantification_samples = []
star_quantification_reports = []
rnaseqc_samples = []
rnaseqc_reports = []

config_file = "/opt/resolwebio/assets/multiqc_config.yml"
with open(config_file) as handle:
Expand Down Expand Up @@ -687,14 +648,9 @@ def run(self, inputs, outputs):

elif d.process.type == "data:rnaseqc:qc:":
name = os.path.basename(d.output.metrics.path)
rnaseqc_samples.append(sample_name)
rnaseqc_reports.append(d.output.metrics.path)
create_symlink(
src=d.output.metrics.path, dst=os.path.join(sample_dir, name)
)
create_coverage_table(
sample_names=rnaseqc_samples, reports=rnaseqc_reports
)

elif d.process.type == "data:expression:salmon:":
# Symlink files/dirs without the parent directory to
Expand Down
9 changes: 0 additions & 9 deletions resolwe_bio/tests/processes/test_support_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,6 @@ def test_multiqc(self):
},
)

rnaseqc_report = self.run_process(
"rnaseqc-qc",
{
"alignment": star_alignment.id,
"annotation": annotation.id,
},
)

# BED file is not part of a sample entity. Test if MultiQC process
# correctly skips this input data object
bed = self.run_process(
Expand All @@ -518,7 +510,6 @@ def test_multiqc(self):
star_quantification.id,
samtools_idxstats.id,
qorts_report.id,
rnaseqc_report.id,
bed.id,
],
"advanced": {
Expand Down

0 comments on commit b62a501

Please sign in to comment.