Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing translation to dsl2, pending to update to last arriba version #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ process build_star_index {
publishDir params.outdir, mode: 'copy'

input:
file(fasta)
file(gtf)
path(fasta)
path(gtf)

output:
file("star-index")
path("star-index"), emit: index

when: !(params.star_index)

Expand Down Expand Up @@ -95,7 +95,7 @@ process star_mapping{
file(star_index)
output:
//star bam files
tuple val(sample), file("${sample}_STAR.bam")
tuple val(sample), file("${sample}_STAR.bam"), emit: bams
//star mapping stats and gene counts *.{tsv,txt}
tuple val(sample), file("${sample}.{Log.final.out,ReadsPerGene.out.tab,fastq.log}") optional true

Expand Down Expand Up @@ -352,13 +352,14 @@ if(params.reads_csv) {
read_files_star = Channel.fromPath(file(params.reads_csv)).splitCsv(header: true, sep: '\t', strip: true)
.map{row -> [ row.sampleID, [file(row.fwd), file(row.rev)]]}
.ifEmpty{exit 1, "params.reads_csv was empty - no input files supplied" }
//read_files_star.view()

}else if(params.bams){
//we process the bam files
if (file(params.bams).listFiles().findAll { it.name ==~ /.*bam/ }.size() > 0){
if (file(params.bams).listFiles().findAll { it.name ==~ /.*cram/ }.size() > 0){
println "BAM files found, proceed with arriba";
read_files_star=Channel.fromPath( params.bams+'/*.bam' )
.map { path -> [ path.name.replace(".bam",""), path] }//.view()
read_files_star=Channel.fromPath( params.bams+'/*.cram' )
.map { path -> [ path.name.replace(".cram",""), path] }//.view()
mode="BAM"
}else{
println "ERROR: input folder contains no fastq nor BAM files"; System.exit(0)
Expand All @@ -384,13 +385,12 @@ if (params.svs){
// Build STAR index
if(mode!="BAM"){
build_star_index(ch_fasta,ch_gtf)
ch_star_index = params.star_index ? Channel.value(file(params.star_index)).ifEmpty{exit 1, "STAR index not found: ${params.star_index}" } : build_star_index.out
ch_star_index = ch_star_index.dump(tag:'ch_star_index')
ch_star_index = params.star_index ? Channel.value(file(params.star_index)).ifEmpty{exit 1, "STAR index not found: ${params.star_index}" } : build_star_index.out.index
//ch_star_index = ch_star_index
//map the rna-seq reads to the genome
star_mapping(read_files_star,ch_star_index)
read_files_star = star_mapping.out
read_files_star = star_mapping.out.bams
}

//run arriba
if(params.svs){
println "Run arriba in SV mode";
Expand All @@ -400,6 +400,7 @@ if(params.svs){
println "Run arriba";
arriba(read_files_star,ch_fasta,ch_gtf)
}

//we merge into a single channel the arriba result + the star mapping
plot_arriba = params.svs ? read_files_star.join(arriba_sv.out[0]):read_files_star.join(arriba.out[0])

Expand Down
10 changes: 6 additions & 4 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,28 @@ debug = false

}

// Define timestamp, to avoid overwriting existing trace
def timestamp = new java.util.Date().format('yyyy-MM-dd_HH-mm-ss')

// nextflow run information
timeline {
enabled = true
file = "${params.tracedir}/${manifest.name}_timeline.html"
file = "${params.tracedir}/${manifest.name}_${timestamp}_timeline.html"
}

report {
enabled = true
file = "${params.tracedir}/${manifest.name}_report.html"
file = "${params.tracedir}/${manifest.name}_${timestamp}_report.html"
}

trace {
enabled = true
file = "${params.tracedir}/${manifest.name}_trace.txt"
file = "${params.tracedir}/${manifest.name}_${timestamp}_trace.txt"
}

dag {
enabled = true
file = "${params.tracedir}/${manifest.name}_dag.html"
file = "${params.tracedir}/${manifest.name}_${timestamp}_dag.html"
}

//Mesage regarding errors or complete
Expand Down