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

Add in test data and updated scripts.

parent 73082a3c
Branches
Tags
No related merge requests found
...@@ -36,7 +36,7 @@ documentation_files: ...@@ -36,7 +36,7 @@ documentation_files:
# Remember - The workflow file is always named 'workflow/main.nf' # Remember - The workflow file is always named 'workflow/main.nf'
# The workflow must publish all final output into $baseDir # The workflow must publish all final output into $baseDir
# A list of clueter environment modules that this workflow requires to run. # A list of cluster environment modules that this workflow requires to run.
# Specify versioned module names to ensure reproducability. # Specify versioned module names to ensure reproducability.
workflow_modules: workflow_modules:
- 'fastqc/0.11.5' - 'fastqc/0.11.5'
......
wget -O ENCLB904PZW_R1.fastq.gz https://www.encodeproject.org/files/ENCFF704XKC/@@download/ENCFF704XKC.fastq.gz
wget -O ENCLB904PZW_R2.fastq.gz https://www.encodeproject.org/files/ENCFF707CNX/@@download/ENCFF707CNX.fastq.gz
...@@ -21,7 +21,8 @@ process qc_fastq { ...@@ -21,7 +21,8 @@ process qc_fastq {
set val(name), file(reads) from read_pairs set val(name), file(reads) from read_pairs
output: output:
file "*_fastqc.{zip,html}" into fastqc_results file "*_fastqc.{zip,html}" into qc_fastq_results
file "qc.log" into qc_fastq_log
script: script:
""" """
......
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
import os import os
import subprocess import subprocess
import argparse import argparse
import shlex
import shutil import shutil
from multiprocessing import cpu_count
import logging import logging
import sys import sys
import json import json
...@@ -19,34 +17,35 @@ For more details: ...@@ -19,34 +17,35 @@ For more details:
## SETTINGS ## SETTINGS
logger = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler()) LOGGER.addHandler(logging.NullHandler())
logger.propagate = False LOGGER.propagate = False
logger.setLevel(logging.INFO) LOGGER.setLevel(logging.INFO)
def check_tools(): def check_tools():
'''Checks for required componenets on user system''' '''Checks for required componenets on user system'''
logger.info('Checking for required libraries and components on this system') LOGGER.info('Checking for required libraries and components on this system')
fastqc_path = shutil.which("fastqc") fastqc_path = shutil.which("fastqc")
if fastqc_path: if fastqc_path:
logger.info('Found fastqc:%s' % (fastqc_path)) LOGGER.info('Found fastqc: %s', fastqc_path)
else: else:
print("Please install 'fastqc' before using the tool") print("Please install 'fastqc' before using the tool")
sys.exit() sys.exit()
def get_args(): def get_args():
'''Define arguments.'''
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description=__doc__, epilog=EPILOG, description=__doc__, epilog=EPILOG,
formatter_class=argparse.RawDescriptionHelpFormatter) formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('-f', '--fastq', parser.add_argument('-f', '--fastq',
help="The fastq file to run QC check on.", help="The fastq file to run QC check on.",
nargs='+', nargs='+',
required=True) required=True)
args = parser.parse_args() args = parser.parse_args()
return args return args
...@@ -56,19 +55,23 @@ def check_qual_fastq(fastq): ...@@ -56,19 +55,23 @@ def check_qual_fastq(fastq):
'''Run fastqc on 1 or 2 files.''' '''Run fastqc on 1 or 2 files.'''
qc_command = "fastqc -t -f fastq " + " ".join(fastq) qc_command = "fastqc -t -f fastq " + " ".join(fastq)
logger.info("Running fastqc with %s" % (qc_command)) LOGGER.info("Running fastqc with %s", qc_command)
p = subprocess.Popen(qc_command, shell=True) qual_fastq = subprocess.Popen(qc_command, shell=True)
p.communicate() qual_fastq .communicate()
def main(): def main():
args = get_args() args = get_args()
# create a file handler # Create a file handler
handler = logging.FileHandler('qc.log') handler = logging.FileHandler('qc.log')
logger.addHandler(handler) LOGGER.addHandler(handler)
# Check if tools are present
check_tools()
# Run quality checks
check_qual_fastq(args.fastq) check_qual_fastq(args.fastq)
......
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