Commit abcbdb32 authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Merge branch '73-single_pool' of...

Merge branch '73-single_pool' of git.biohpc.swmed.edu:BICF/Astrocyte/chipseq_analysis into 73-single_pool
parents 3b0aeaf6 5ce018b0
Pipeline #6270 failed with stages
in 466 minutes and 5 seconds
......@@ -15,6 +15,10 @@ All notable changes to this project will be documented in this file.
- Fix xcor to increase file size for --random-source
- Fix skip diff test for paired-end data
- Add test data for single control and single replicate
- Fix python version for MultiQC report
- Fix xcor to get lowest non zero value above 50
- Fix references to display in Multiqc report
## [publish_1.0.6 ] - 2019-05-31
### Added
......
Test.20.tagAlign.gz 18588987 0,20,33 0.211525291335199,0.211232019956852,0.211139666755398 35 0.2123067 1500 0.209429 1.01001 0.7284536 0
......@@ -654,10 +654,10 @@ process multiqcReport {
"""
echo $workflow.nextflow.version > version_nextflow.txt
singularity exec /project/shared/bicf_workflow_ref/singularity_images/multiqc.sif multiqc --version > version_multiqc.txt
singularity exec /project/shared/bicf_workflow_ref/singularity_images/bicf-multiqc-2.0.0.img multiqc --version > version_multiqc.txt
python --version &> version_python.txt
python3 $baseDir/scripts/generate_references.py -r $references -o software_references
python3 $baseDir/scripts/generate_versions.py -o software_versions
singularity exec /project/shared/bicf_workflow_ref/singularity_images/multiqc.sif multiqc -c $multiqc .
singularity exec /project/shared/bicf_workflow_ref/singularity_images/bicf-multiqc-2.0.0.img multiqc -c $multiqc .
"""
}
......@@ -138,8 +138,20 @@ def call_peaks_macs(experiment, xcor, control, prefix, genome_size, chrom_sizes)
with open(xcor, 'r') as xcor_fh:
firstline = xcor_fh.readline()
frag_lengths = firstline.split()[2] # third column
fragment_length = frag_lengths.split(',')[0] # grab first value
logger.info("Fraglen %s", fragment_length)
frag_lengths_array = frag_lengths.split(',')
fragment_length = 0
fragment = False
# Loop through all values of fragment length
for f in frag_lengths.split(','):
fragment_length = f
logger.info("Fraglen %s", fragment_length)
if int(fragment_length) > 50:
fragment = True
break
if fragment == False:
logger.info('Error in cross-correlation analysis: %s', frag_lengths_array)
raise Exception("Error in cross-correlation analysis: %s" % frag_lengths_array)
# Generate narrow peaks and preliminary signal tracks
......
......@@ -46,7 +46,7 @@ SOFTWARE_REGEX = {
'MEME-ChIP': ['motifSearch_vf/version_memechip.txt', r"Version (\S+)"],
'DiffBind': ['diffPeaks_vf/version_DiffBind.txt', r"Version (\S+)\""],
'deepTools': ['experimentQC_vf/version_deeptools.txt', r"deeptools (\S+)"],
'Python': ['version_python.txt', r"python, version (\S+)"],
'Python': ['version_python.txt', r"Python (\S+)"],
'MultiQC': ['version_multiqc.txt', r"multiqc, version (\S+)"],
}
......
......@@ -3,10 +3,29 @@
import pytest
import os
import utils
from io import StringIO
import call_peaks_macs
test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
'/../output/callPeaksMACS/'
test_data_path = os.path.dirname(os.path.abspath(__file__)) + \
'/../../test_data/'
@pytest.mark.unit
def test_fragment_length():
experiment = "experiment.tagAlign.gz"
control = "control.tagAlign.gz"
prefix = 'test'
genome_size = 'hs'
chrom_sizes = 'genomefile.txt'
cross_qc = os.path.join(test_data_path, 'test_cross.qc')
with pytest.raises(Exception) as excinfo:
call_peaks_macs.call_peaks_macs(experiment, cross_qc, control, prefix, genome_size, chrom_sizes)
assert str(excinfo.value) == "Error in cross-correlation analysis: ['0', '20', '33']"
@pytest.mark.singleend
def test_fc_signal_singleend():
......
......@@ -4,6 +4,7 @@ import pytest
import os
import utils
import yaml
from bs4 import BeautifulSoup
test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
'/../output/multiqcReport/'
......@@ -21,3 +22,14 @@ def test_software_references_output():
data_loaded = yaml.load(stream)
assert len(data_loaded['data'].split('<ul>')) == 19
@pytest.mark.singleend
def test_software_references_html():
multiqc_report = os.path.join(test_output_path, 'multiqc_report.html')
html_file = open(multiqc_report, 'r')
source_code = html_file.read()
multiqc_html = BeautifulSoup(source_code, 'html.parser')
references = multiqc_html.find(id="mqc-module-section-Software_References")
assert references is not None
assert len(references.find_all('ul')) == 18
......@@ -21,3 +21,4 @@ def test_software_versions_output():
data_loaded = yaml.load(stream)
assert len(data_loaded['data'].split('<dt>')) == 18
assert 'Not Run' not in data_loaded['data'].split('<dt>')[17]
Markdown is supported
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