Skip to content
Snippets Groups Projects
Commit 4a7bba6b authored by Jeremy Mathews's avatar Jeremy Mathews
Browse files

Merge branch '29-PlotProfile'

parents ab738147 d41309dc
Branches
Tags
No related merge requests found
before_script:
- module add python/3.6.1-2-anaconda
- pip install --user pytest-pythonpath==0.7.1 pytest-cov==2.5.1
- module load nextflow/0.31.0
- module load nextflow/0.31.0
- ln -s /project/shared/bicf_workflow_ref/workflow_testdata/chipseq/*fastq.gz test_data/
stages:
......@@ -76,7 +76,7 @@ single_end_skip:
only:
- master
script:
- nextflow run workflow/main.nf --designFile "$CI_PROJECT_DIR/test_data/design_diff_SE.txt" --genome 'GRCm38' --skipDiff true --skipMotif true --astrocyte false -resume
- nextflow run workflow/main.nf --designFile "$CI_PROJECT_DIR/test_data/design_diff_SE.txt" --genome 'GRCm38' --skipDiff true --skipMotif true --skipPlotProfile true --astrocyte false -resume
- pytest -m singleskip_true
artifacts:
expire_in: 2 days
......@@ -142,6 +142,15 @@ workflow_parameters:
description: |
Skip motif calling
- id: skipPlotProfile
type: select
required: true
choices:
- [ 'true', 'true']
- [ 'false', 'false']
description: |
Skip Plot Profile Analysis
- id: astrocyte
type: select
choices:
......
......@@ -44,6 +44,10 @@ process {
module = ['python/3.6.1-2-anaconda', 'macs/2.1.0-20151222', 'UCSC_userApps/v317', 'bedtools/2.26.0', 'phantompeakqualtools/1.2']
queue = '128GB,256GB,256GBv1'
}
withName: plotProfile {
module = ['deeptools/2.5.0.1']
cpus = 32
}
withName: consensusPeaks {
module = ['python/3.6.1-2-anaconda', 'bedtools/2.26.0']
executor = 'local'
......@@ -74,18 +78,21 @@ params {
genomesize = 'hs'
chromsizes = '/project/shared/bicf_workflow_ref/GRCh38/genomefile.txt'
fasta = '/project/shared/bicf_workflow_ref/GRCh38/genome.fa'
gta = '/project/shared/bicf_workflow_ref/GRCh38/gencode.gtf'
}
'GRCh37' {
bwa = '/project/shared/bicf_workflow_ref/GRCh37'
genomesize = 'hs'
chromsizes = '/project/shared/bicf_workflow_ref/GRCh37/genomefile.txt'
fasta = '/project/shared/bicf_workflow_ref/GRCh37/genome.fa'
gta = '/project/shared/bicf_workflow_ref/GRCh37/gencode.gtf'
}
'GRCm38' {
bwa = '/project/shared/bicf_workflow_ref/GRCm38'
genomesize = 'mm'
chromsizes = '/project/shared/bicf_workflow_ref/GRCm38/genomefile.txt'
fasta = '/project/shared/bicf_workflow_ref/GRCm38/genome.fa'
gta = '/project/shared/bicf_workflow_ref/GRCm38/gencode.gtf'
}
}
}
......
......@@ -25,8 +25,10 @@ params.topPeakCount = 600
params.astrocyte = false
params.skipDiff = false
params.skipMotif = false
params.skipPlotProfile = false
params.references = "$baseDir/../docs/references.md"
params.multiqc = "$baseDir/conf/multiqc_config.yaml"
params.gtf = "/project/shared/bicf_workflow_ref/$params.genome/gencode.gtf"
// Assign variables if astrocyte
if (params.astrocyte) {
......@@ -78,8 +80,10 @@ extendReadsLen = params.extendReadsLen
topPeakCount = params.topPeakCount
skipDiff = params.skipDiff
skipMotif = params.skipMotif
skipPlotProfile = params.skipPlotProfile
references = params.references
multiqc = params.multiqc
gtfFile = Channel.fromPath(params.gtf)
// Check design file for errors
process checkDesignFile {
......@@ -424,6 +428,7 @@ process callPeaksMACS {
set sampleId, file('*.narrowPeak'), file('*.fc_signal.bw'), file('*.pvalue_signal.bw'), experimentId, biosample, factor, treatment, replicate, controlId into experimentPeaks
file '*.xls' into callPeaksMACSsummit
file('version_*.txt') into callPeaksMACSVersions
file("*.fc_signal.bw") into bigwigs
script:
......@@ -456,6 +461,26 @@ peaksDesign = experimentPeaks
"$sampleId\t$peak\t$fcSignal\t$pvalueSignal\t$experimentId\t$biosample\t$factor\t$treatment\t$replicate\t$controlId\n"}
.collectFile(name:'design_peak.tsv', seed:"sample_id\tpeaks\tfc_signal\tpvalue_signal\texperiment_id\tbiosample\tfactor\ttreatment\treplicate\tcontrol_id\n", storeDir:"$outDir/design")
//plotProfile
process plotProfile {
publishDir "$outDir/${task.process}", mode: 'copy'
input:
file ("*.pooled.fc_signal.bw") from bigwigs.collect()
file gtf from gtfFile
when:
!skipPlotProfile
script:
"""
module load deeptools/2.5.0.1
bash $baseDir/scripts/plotProfile.sh
"""
}
// Calculate Consensus Peaks
process consensusPeaks {
......@@ -575,7 +600,6 @@ process diffPeaks {
// Generate Multiqc Report, gerernate Software Versions and references
process multiqcReport {
publishDir "$outDir/${task.process}", mode: 'copy'
input:
......@@ -611,6 +635,7 @@ process multiqcReport {
module load multiqc/1.7
echo $workflow.nextflow.version > version_nextflow.txt
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
multiqc -c $multiqc .
......
......@@ -7,8 +7,8 @@ profiles {
manifest {
name = 'chipseq_analysis'
description = 'BICF ChIP-seq Analysis Workflow.'
homePage = 'https://github.com/nf-core/rnaseq'
version = '1.0.0'
homePage = 'https://git.biohpc.swmed.edu/BICF/Astrocyte/chipseq_analysis'
version = '1.0.6'
mainScript = 'main.nf'
nextflowVersion = '>=0.31.0'
}
......@@ -46,6 +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+)"],
'MultiQC': ['version_multiqc.txt', r"multiqc, version (\S+)"],
}
......@@ -108,6 +109,7 @@ def main():
results['DiffBind'] = '<span style="color:#999999;\">Not Run</span>'
results['deepTools'] = '<span style="color:#999999;\">Not Run</span>'
results['MultiQC'] = '<span style="color:#999999;\">Not Run</span>'
results['Python'] = '<span style="color:#999999;\">Not Run</span>'
# list all files
files = glob.glob('**/*.txt', recursive=True)
......
#!/bin/bash
#plotProfile.sh
bws=`ls *.bw`
gtf=`ls *.gtf *.bed`
computeMatrix reference-point \
--referencePoint TSS \
-S $bws \
-R $gtf \
--skipZeros \
-o computeMatrix.gz
plotProfile -m computeMatrix.gz \
-out plotProfile.png \
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