From e73bcc3c07681f69228a4250da729da7aaf2eaf9 Mon Sep 17 00:00:00 2001 From: likelet Date: Thu, 27 Sep 2018 15:46:08 +0800 Subject: [PATCH] fix the null design bugs fix the typos V0.2.4 --- LncRNAanalysisPipe.nf | 124 +++++++++++++++++++++++++++++------------- README.md | 4 +- docker.config | 2 +- nextflow.config | 2 +- singularity.config | 2 +- 5 files changed, 90 insertions(+), 44 deletions(-) diff --git a/LncRNAanalysisPipe.nf b/LncRNAanalysisPipe.nf index 735ef8c..5fbebab 100644 --- a/LncRNAanalysisPipe.nf +++ b/LncRNAanalysisPipe.nf @@ -58,7 +58,7 @@ def print_white = { str -> ANSI_WHITE + str + ANSI_RESET } //Help information // Nextflow version -version="v0.2.31" +version="v0.2.4" //======================================================================================= // Nextflow Version check if( !nextflow.version.matches('0.26+') ) { @@ -86,7 +86,7 @@ if (params.help) { print_cyan(' --fastq_ext <*_fq.gz> ') + print_green('Filename pattern for pairing raw reads, e.g: *_{1,2}.fastq.gz for paired reads\n') + print_cyan(' --out_folder ') + print_green('The output directory where the results will be saved(optional), current path is default\n') + print_cyan(' --aligner ') + print_green('Aligner for reads mapping (optional),"hisat"(defalt)/"star"/"tophat"\n') + - print_cyan(' --qctools ') + print_green('Tools for assess reads quality, fastp(default)/afterqc/fastqc/none(skip QC step)\n') + + print_cyan(' --qctools ') + print_green('Tools for assess reads quality, fastp(default)/afterqc/fastqc/none(skip QC step)\n') + print_cyan(' --detools ') + print_green('Tools for differential analysis, edger(default)/deseq/noiseq\n') + print_cyan(' --quant ') + print_green('Tools for estimating abundance of transcript, kallisto(default)/htseq\n') + '\n' + @@ -960,7 +960,7 @@ else { /* -*Step 8: Filter GTFs to distinguish novel lncRNAS +*Step 8: Filter GTFs to distinguish novel lncRNAs */ process Identify_novel_lncRNA_with_criterions { @@ -1508,57 +1508,103 @@ lncRep_cdf_percent = params.lncRep_cdf_percent lncRep_max_lnc_len = params.lncRep_max_lnc_len lncRep_min_expressed_sample = params.lncRep_min_expressed_sample detools = params.detools -design=null -if(params.design){ +design=params.design +if(design!=null){ design = file(params.design) if (!design.exists()) exit 1, "Design file not found, plz check your design path: ${params.design}" -} -if(!params.merged_gtf) { - process Run_LncPipeReporter { - tag { file_tag } - publishDir pattern: "*", - path: "${params.out_folder}/Result/", mode: 'move' - input: - //alignmet log - file design - file alignmetlogs from alignment_logs.collect() - //gtf statistics - file basic_charac from statistic_result - //Expression matrix - file kallisto_count_matrix from expression_matrixfile_count + if(!params.merged_gtf) { + process Run_LncPipeReporter { + tag { file_tag } + publishDir pattern: "*", + path: "${params.out_folder}/Result/", mode: 'move' + input: + //alignmet log + file design + file alignmetlogs from alignment_logs.collect() + //gtf statistics + file basic_charac from statistic_result + //Expression matrix + file kallisto_count_matrix from expression_matrixfile_count - output: - file "*" into final_output - shell: - file_tag = "Generating report ..." - """ + output: + file "*" into final_output + shell: + file_tag = "Generating report ..." + """ Rscript -e "library(LncPipeReporter);run_reporter(input='.', output = 'reporter.html',output_dir='./LncPipeReports',de.method=\'${detools}\',theme = 'npg',cdf.percent = ${lncRep_cdf_percent},max.lncrna.len = ${lncRep_max_lnc_len},min.expressed.sample = ${lncRep_min_expressed_sample}, ask = FALSE)" """ + } + }else{ + process Run_LncPipeReporter { + tag { file_tag } + publishDir pattern: "*", + path: "${params.out_folder}/Result/", mode: 'move' + input: + //alignment log + file design + //gtf statistics + file basic_charac from statistic_result + //Expression matrix + file kallisto_count_matrix from expression_matrixfile_count + + output: + file "*" into final_output + shell: + file_tag = "Generating report ..." + """ + Rscript -e "library(LncPipeReporter);run_reporter(input='.', output = 'reporter.html',output_dir='./LncPipeReports',de.method=\'${detools}\',theme = 'npg',cdf.percent = ${lncRep_cdf_percent},max.lncrna.len = ${lncRep_max_lnc_len},min.expressed.sample = ${lncRep_min_expressed_sample}, ask = FALSE)" + """ + } } + }else{ - process Run_LncPipeReporter { - tag { file_tag } - publishDir pattern: "*", - path: "${params.out_folder}/Result/", mode: 'move' - input: - //alignment log - file design - //gtf statistics - file basic_charac from statistic_result - //Expression matrix - file kallisto_count_matrix from expression_matrixfile_count + if(!params.merged_gtf) { + process Run_LncPipeReporter_without_Design { + tag { file_tag } + publishDir pattern: "*", + path: "${params.out_folder}/Result/", mode: 'move' + input: + //alignmet log + file alignmetlogs from alignment_logs.collect() + //gtf statistics + file basic_charac from statistic_result + //Expression matrix + file kallisto_count_matrix from expression_matrixfile_count - output: - file "*" into final_output - shell: - file_tag = "Generating report ..." + output: + file "*" into final_output + shell: + file_tag = "Generating report ..." + """ + Rscript -e "library(LncPipeReporter);run_reporter(input='.', output = 'reporter.html',output_dir='./LncPipeReports',de.method=\'${detools}\',theme = 'npg',cdf.percent = ${lncRep_cdf_percent},max.lncrna.len = ${lncRep_max_lnc_len},min.expressed.sample = ${lncRep_min_expressed_sample}, ask = FALSE)" """ + } + }else{ + process Run_LncPipeReporter_without_Design { + tag { file_tag } + publishDir pattern: "*", + path: "${params.out_folder}/Result/", mode: 'move' + input: + //alignment log + //gtf statistics + file basic_charac from statistic_result + //Expression matrix + file kallisto_count_matrix from expression_matrixfile_count + + output: + file "*" into final_output + shell: + file_tag = "Generating report ..." + """ Rscript -e "library(LncPipeReporter);run_reporter(input='.', output = 'reporter.html',output_dir='./LncPipeReports',de.method=\'${detools}\',theme = 'npg',cdf.percent = ${lncRep_cdf_percent},max.lncrna.len = ${lncRep_max_lnc_len},min.expressed.sample = ${lncRep_min_expressed_sample}, ask = FALSE)" """ + } } } + + //pipeline log if(workflow.success) { workflow.onComplete { diff --git a/README.md b/README.md index 5de768c..471d170 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ git clone https://github.com/likelet/LncPipe.git * Reference files for humans - 1. hisat index: ftp://ftp.ccb.jhu.edu/pub/infphilo/hisat2/data/grch38_tran.tar.gz + 1. hisat index built from Genome 2. Genome reference: ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_27/GRCh38.p10.genome.fa.gz 3. GENCODE gene annotation: ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_27/gencode.v27.annotation.gtf.gz 4. LNCipedia gene annotation: https://lncipedia.org/downloads/lncipedia_5_0_hc_hg38.gtf @@ -101,7 +101,7 @@ git clone https://github.com/likelet/LncPipe.git * Reference files for mouse - 1. hisat index: ftp://ftp.ccb.jhu.edu/pub/infphilo/hisat2/data/grcm38_tran.tar.gz + 1. hisat index built from Genome 2. Genome reference: ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_mouse/release_M16/GRCm38.p5.genome.fa.gz 3. GENCODE gene annotation: ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_mouse/release_M16/gencode.vM16.annotation.gtf.gz 4. LNCipedia gene annotation: null diff --git a/docker.config b/docker.config index 0600f18..45a1a11 100644 --- a/docker.config +++ b/docker.config @@ -8,7 +8,7 @@ params { fastq_ext = '*_{1,2}.fq.gz' fasta_ref = '/data/database/hg38/genome.fa' - design = 'design.file' + design = 'design.file' // or null hisat2_index = '/data/database/hg38/hisatIndex/grch38_snp_tran/genome_snp_tran' cpatpath='/opt/CPAT-1.2.3' //human gtf only diff --git a/nextflow.config b/nextflow.config index 6965f2f..886618b 100644 --- a/nextflow.config +++ b/nextflow.config @@ -8,7 +8,7 @@ params { species="human"// mouse , zebrafish, fly fastq_ext = '*_{1,2}.fq.gz' fasta_ref = '/data/database/hg38/genome.fa' - design = 'design.file' + design = 'design.file' // or null hisat2_index = '/data/database/hg38/hisatIndex/grch38_snp_tran/genome_snp_tran' cpatpath='/opt/CPAT-1.2.3' //human gtf only diff --git a/singularity.config b/singularity.config index 79b849d..7d144cd 100644 --- a/singularity.config +++ b/singularity.config @@ -8,7 +8,7 @@ params { fastq_ext = '*_{1,2}.fq.gz' fasta_ref = '/data/database/hg38/genome.fa' - design = 'design.file' + design = 'design.file' // or null hisat2_index = '/data/database/hg38/hisatIndex/grch38_snp_tran/genome_snp_tran' cpatpath='/opt/CPAT-1.2.3' //human gtf only