Skip to content
Snippets Groups Projects
Commit 89d9e085 authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Fix output.

parent cdb7d690
Branches
Tags
1 merge request!23Resolve "Output software versions and methods and references"
Pipeline #3232 failed with stages
in 23 seconds
......@@ -483,17 +483,17 @@ process softwareReport {
input:
trimReadsVersions
alignReadsVersions
filterReadsVersions
convertReadsVersions
crossReadsVersions
callPeaksMACSVersions
consensusPeaksVersions
peakAnnotationVersions
motifSearchVersions
diffPeaksVersions
experimentQCVersions
trimReadsVersions.collect()
alignReadsVersions.collect()
filterReadsVersions.collect()
convertReadsVersions.collect()
crossReadsVersions.collect()
callPeaksMACSVersions.collect()
consensusPeaksVersions.collect()
peakAnnotationVersions.collect()
motifSearchVersions.collect()
diffPeaksVersions.collect()
experimentQCVersions.collect()
output:
......@@ -502,7 +502,7 @@ process softwareReport {
script:
"""
python3 $baseDir/scripts/generate_versions.py -o software_versions
python3 $baseDir/scripts/generate_versions.py -f *.txt -o software_versions
python3 $baseDir/scripts/generate_references.py -r $references -o software_references
"""
}
......@@ -8,6 +8,7 @@ from collections import OrderedDict
import re
import logging
import argparse
import numpy as np
EPILOG = '''
For more details:
......@@ -46,6 +47,11 @@ def get_args():
description=__doc__, epilog=EPILOG,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('-f', '--files',
help="The version files.",
required=True,
nargs='*')
parser.add_argument('-o', '--output',
help="The out file name.",
required=True)
......@@ -54,8 +60,29 @@ def get_args():
return args
def check_files(files):
'''Check if version files are found.'''
logger.info("Running file check.")
software_files = np.array(list(SOFTWARE_REGEX.values()))[:,0]
missing_files = set(software_files) - set(files)
if len(missing_files) > 0:
logger.error('Missing version files: %s', list(missing_files))
raise Exception("Missing version files: %s" % list(missing_files))
extra_files = set(files) - set(software_files)
if len(extra_files) > 0:
logger.error('Missing regex: %s', list(extra_files))
raise Exception("Missing regex: %s" % list(extra_files))
def main():
args = get_args()
files = args.files
output = args.output
out_filename = output + '_mqc.yaml'
......@@ -79,6 +106,9 @@ def main():
results['DiffBind'] = '<span style="color:#999999;\">N/A</span>'
results['deepTools'] = '<span style="color:#999999;\">N/A</span>'
# Check for version files:
check_files(files)
# Search each file using its regex
for k, v in SOFTWARE_REGEX.items():
with open(v[0]) as x:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment