Skip to content

Commit

Permalink
fix the null design bugs
Browse files Browse the repository at this point in the history
fix the typos
V0.2.4
  • Loading branch information
likelet committed Sep 27, 2018
1 parent 24c4081 commit e73bcc3
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 44 deletions.
124 changes: 85 additions & 39 deletions LncRNAanalysisPipe.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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+') ) {
Expand Down Expand Up @@ -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 <path> ') + print_green('The output directory where the results will be saved(optional), current path is default\n') +
print_cyan(' --aligner <hisat> ') + print_green('Aligner for reads mapping (optional),"hisat"(defalt)/"star"/"tophat"\n') +
print_cyan(' --qctools <fastqc> ') + print_green('Tools for assess reads quality, fastp(default)/afterqc/fastqc/none(skip QC step)\n') +
print_cyan(' --qctools <fastp> ') + print_green('Tools for assess reads quality, fastp(default)/afterqc/fastqc/none(skip QC step)\n') +
print_cyan(' --detools <edger> ') + print_green('Tools for differential analysis, edger(default)/deseq/noiseq\n') +
print_cyan(' --quant <kallisto> ') + print_green('Tools for estimating abundance of transcript, kallisto(default)/htseq\n') +
'\n' +
Expand Down Expand Up @@ -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 {

Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ 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
5. Raw sequence file with \*.fastq.gz / \*.fq.gz suffixed

* 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
Expand Down
2 changes: 1 addition & 1 deletion docker.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion singularity.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e73bcc3

Please sign in to comment.