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
No related merge requests found
......@@ -36,7 +36,7 @@ documentation_files:
# Remember - The workflow file is always named 'workflow/main.nf'
# 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.
workflow_modules:
- '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 {
set val(name), file(reads) from read_pairs
output:
file "*_fastqc.{zip,html}" into fastqc_results
file "*_fastqc.{zip,html}" into qc_fastq_results
file "qc.log" into qc_fastq_log
script:
"""
......
......@@ -5,9 +5,7 @@
import os
import subprocess
import argparse
import shlex
import shutil
from multiprocessing import cpu_count
import logging
import sys
import json
......@@ -19,34 +17,35 @@ For more details:
## SETTINGS
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
logger.propagate = False
logger.setLevel(logging.INFO)
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(logging.NullHandler())
LOGGER.propagate = False
LOGGER.setLevel(logging.INFO)
def check_tools():
'''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")
if fastqc_path:
logger.info('Found fastqc:%s' % (fastqc_path))
LOGGER.info('Found fastqc: %s', fastqc_path)
else:
print("Please install 'fastqc' before using the tool")
sys.exit()
def get_args():
'''Define arguments.'''
parser = argparse.ArgumentParser(
description=__doc__, epilog=EPILOG,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('-f', '--fastq',
help="The fastq file to run QC check on.",
nargs='+',
required=True)
help="The fastq file to run QC check on.",
nargs='+',
required=True)
args = parser.parse_args()
return args
......@@ -56,19 +55,23 @@ def check_qual_fastq(fastq):
'''Run fastqc on 1 or 2 files.'''
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)
p.communicate()
qual_fastq = subprocess.Popen(qc_command, shell=True)
qual_fastq .communicate()
def main():
args = get_args()
# create a file handler
# Create a file handler
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)
......
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