Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
grst committed Jul 7, 2020
1 parent c6bec69 commit 77c2a53
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -223,22 +223,21 @@ if ( params.fasta && !params.skipAlignment ){
.ifEmpty { exit 1, "Genome Fasta file not found: ${params.fasta}" }
.set { ch_genome_fasta }
}
}
else {
} else {
if (hasExtension(params.fasta, "gz")){
Channel.fromPath(params.fasta, checkIfExists: true)
.ifEmpty { exit 1, "Genome fasta file not found: ${params.fasta}" }
.set { genome_fasta_gz }
} else {
Channel.fromPath(params.fasta)
.ifEmpty { exit 1, "Genome Fasta file not found: ${params.fasta}" }
.into { ch_fasta_for_star_index; ch_fasta_for_hisat_index}}
}
}
else if (params.skipAlignment) {
.into { ch_fasta_for_star_index; ch_fasta_for_hisat_index;
ch_fasta_for_rsem_reference }
}
}
} else if (params.skipAlignment) {
println "Skipping alignment ..."
}
else {
} else {
exit 1, "No reference genome files specified!"
}

Expand Down Expand Up @@ -541,7 +540,7 @@ process get_software_versions {
compressedReference = (hasExtension(params.fasta, 'gz') ||
hasExtension(params.transcript_fasta, 'gz') || hasExtension(params.star_index, 'gz') ||
hasExtension(params.hisat2_index, 'gz') || hasExtension(params.additional_fasta, "gz" ))

if (compressedReference) {
// This complex logic is to prevent accessing the genome_fasta_gz variable if
// necessary indices for STAR, HiSAT2, Salmon already exist, or if
Expand Down Expand Up @@ -1017,6 +1016,7 @@ if (params.with_umi) {
process umi_tools_extract {
tag "$name"
label "low_memory"
cpus 1
publishDir "${params.outdir}/umitools/extract", mode: "${params.publish_dir_mode}",
saveAs: {filename ->
if (filename.endsWith('.log')) filename
Expand All @@ -1041,7 +1041,7 @@ if (params.with_umi) {
-I $reads \
-S ${name}_umi_extracted.fq.gz \
--extract-method=${params.umitools_extract_method} \
--bc-pattern=${params.umitools_bc_pattern} \
--bc-pattern="${params.umitools_bc_pattern}" \
${params.umitools_extract_extra} > ${name}_umi_extract.log
"""
} else {
Expand All @@ -1052,7 +1052,7 @@ if (params.with_umi) {
-S ${name}_umi_extracted_R1.fq.gz \
--read2-out=${name}_umi_extracted_R2.fq.gz \
--extract-method=${params.umitools_extract_method} \
--bc-pattern=${params.umitools_bc_pattern} \
--bc-pattern="${params.umitools_bc_pattern}" \
${params.umitools_extract_extra} > ${name}_umi_extract.log
"""
}
Expand Down

0 comments on commit 77c2a53

Please sign in to comment.