Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • dev
  • master
  • v0.1.0
  • v0.1.2
  • v0.2.0
  • v0.2.1
  • v0.2.2
  • v0.2.3
  • v0.2.4
  • v0.2.5
  • v0.2.6
  • v0.2.7
  • v0.2.8
  • v0.2.9
  • v0.3.0
  • v0.4.0
  • v2.0.0
17 results

Target

Select target project
  • LBMC/regards/nextflow
  • elabaron/nextflow
  • lanani/nextflow
  • mlepetit/nextflow
  • mdjaffar/nextflow
  • LBMC/RMI2/rmi2_pipelines
  • lpicard/nextflow
  • rseraphi/nextflow
  • hregue/nextflow
  • letien02/nextflow
  • mshamjal/nextflow
  • z483801/nextflow
  • fduveau/nextflow
  • cginevra/nextflow
  • dtorresc/nextflow
  • fmortreu/nextflow
  • jshapiro/nextflow
  • carpin/nextflow
  • LBMC/Delattre/JU28_59vs17_SNP
  • jclaud01/nextflow
  • dchalopi/nextflow
  • mvilcot/nextflow
  • mherbett/nextflow
  • lestrada/nextflow
  • nfontrod/nextflow
  • gbenoit/nextflow
  • gyvert/nextflow
  • aguill09/nextflow
  • alapendr/nextflow
  • jprobin/nextflow
  • vvanoost/nextflow
  • jblin/nextflow
  • mparis/nextflow
  • ogandril/nextflow
  • cbourgeo/nextflow
  • ggirau03/nextflow
  • ecombe01/nextflow
  • acorbin/nextflow
  • pberna01/nextflow
  • pmarie01/nextflow
  • rhoury/nextflow
  • lgely/nextflow
  • jvalat/nextflow
  • cfournea/nextflow
  • mprieux/nextflow
  • hpolvech/nextflow
  • LBMC/nextflow
  • mcariou/nextflow
  • z483800/nextflow
  • yjia01/nextflow
  • jkleine/nextflow
  • LBMC/Palladino/RNAseq_nextflow
  • jseimand/nextflow
  • nlecouvr/nextflow-nathan
54 results
Select Git revision
  • dev
  • master
  • v0.1.0
  • v0.1.2
  • v0.2.0
  • v0.2.1
  • v0.2.2
  • v0.2.3
  • v0.2.4
  • v0.2.5
  • v0.2.6
  • v0.2.7
  • v0.2.8
  • v0.2.9
14 results
Show changes
Showing
with 474 additions and 378 deletions
#!/bin/sh
docker build src/docker_modules/samblaster/0.1.24 -t 'samblaster:0.1.24'
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
nextflow.enable.dsl=2
include {
fastp
} from './nf_modules/fastp/main'
workflow csv_parsing {
if (params.csv_path.size() > 0) {
log.info "loading local csv files"
Channel
.fromPath(params.csv_path, checkIfExists: true)
.ifEmpty { error
log.error """
=============================================================
WARNING! No csv input file precised.
Use '--csv_path <file.csv>'
Or '--help' for more informations
=============================================================
"""
}
.splitCsv(header: true, sep: ";", strip: true)
.flatMap{
it -> [
[(it.IP + it.WCE).md5(), "IP", "w", file(it.IP)],
[(it.IP + it.WCE).md5(), "WCE", "w", file(it.WCE)]
]
}
.map{ it ->
if (it[1] instanceof List){
it
} else {
[it[0], [it[1]], it[2], it[3], [it[4]]]
}
}
.map{
it ->
if (it[1].size() == 2){ // if data are paired_end
[
"index": it[0],
"group": ref_order(it),
"ip": it[2],
"type": it[3],
"id": read_order(it)[0],
"file": read_order(it)
]
} else {
[
"index": it[0],
"group": it[1].simpleName,
"ip": it[2],
"type": it[3],
"id": it[4].simpleName,
"file": [it[4].simpleName, it[4]]
]
}
}
.set{input_csv}
} else {
log.info "loading remotes SRA csv files"
Channel
.fromPath(params.csv_sra, checkIfExists: true)
.ifEmpty { error
log.error """
=============================================================
WARNING! No csv input file precised.
Use '--csv_path <file.csv>' or
Use '--csv_SRA <file.csv>'
Or '--help' for more informations
=============================================================
"""
}
.splitCsv(header: true, sep: ";", strip: true)
.flatMap{
it -> [
[[it.IP_w + it.WCE_w + it.IP_m + it.WCE_m], t.IP_w, "IP", "w", it.IP_w],
[[it.IP_w + it.WCE_w + it.IP_m + it.WCE_m], it.IP_w, "WCE", "w", it.WCE_w],
[[it.IP_w + it.WCE_w + it.IP_m + it.WCE_m], it.IP_w, "IP", "m", it.IP_m],
[[it.IP_w + it.WCE_w + it.IP_m + it.WCE_m], it.IP_w, "WCE", "m", it.WCE_m]
]
}
.map{
it ->
if (it[1].size() == 2){ // if data are paired_end
[
"index": (
it[0][0][0].simpleName +
it[0][0][1].simpleName +
it[0][0][2].simpleName +
it[0][0][3].simpleName
).md5(),
"group": it[1][0].simpleName,
"ip": it[2],
"type": it[3],
"id": it[4][0].simpleName[0..-4],
"file": [it[4][0].simpleName[0..-4], it[4]]
]
} else {
[
"index": (
it[0][0].simpleName +
it[0][1].simpleName +
it[0][2].simpleName +
it[0][3].simpleName
).md5(),
"group": it[1].simpleName,
"ip": it[2],
"type": it[3],
"id": it[4].simpleName,
"file": [it[4].simpleName, it[4]]
]
}
}
.set{input_csv}
}
emit:
input_csv
}
workflow {
}
\ No newline at end of file
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
nextflow.enable.dsl=2
/*
Testing pipeline for marseq scRNASeq analysis
*/
include { adaptor_removal} from "./nf_modules/cutadapt/main.nf"
include {
index_fasta;
count;
index_fasta_velocity;
count_velocity
} from "./nf_modules/kb/main.nf" addParams(
kb_protocol: "marsseq",
count_out: "quantification/",
count_velocity_out: "quantification_velocity/"
)
params.fasta = "http://ftp.ensembl.org/pub/release-98/fasta/gallus_gallus/dna/Gallus_gallus.GRCg6a.dna.toplevel.fa.gz"
params.fastq = "data/CF42_45/*/*R{1,2}.fastq.gz"
params.gtf = "http://ftp.ensembl.org/pub/release-98/gtf/gallus_gallus/Gallus_gallus.GRCg6a.98.gtf.gz"
params.transcript_to_gene = ""
params.whitelist = "data/expected_whitelist.txt"
params.config = "data/marseq_flexi_splitter.yaml"
params.workflow_type = "classic"
log.info "fastq files (--fastq): ${params.fastq}"
log.info "fasta file (--fasta): ${params.fasta}"
log.info "gtf file (--gtf): ${params.gtf}"
log.info "transcript_to_gene file (--transcript_to_gene): ${params.transcript_to_gene}"
log.info "whitelist file (--whitelist): ${params.whitelist}"
log.info "config file (--config): ${params.config}"
channel
.fromFilePairs( params.fastq, size: -1)
.set { fastq_files }
channel
.fromPath( params.fasta )
.ifEmpty { error "Cannot find any fasta files matching: ${params.fasta}" }
.map { it -> [it.simpleName, it]}
.set { fasta_files }
channel
.fromPath( params.gtf )
.ifEmpty { error "Cannot find any gtf files matching: ${params.gtf}" }
.map { it -> [it.simpleName, it]}
.set { gtf_files }
if (params.whitelist == "") {
channel.empty()
.set { whitelist_files }
} else {
channel
.fromPath( params.whitelist )
.map { it -> [it.simpleName, it]}
.set { whitelist_files }
}
channel
.fromPath( params.config )
.ifEmpty { error "Cannot find any config files matching: ${params.config}" }
.map { it -> [it.simpleName, it]}
.set { config_files }
workflow {
adaptor_removal(fastq_files)
if (params.workflow_type == "classic") {
index_fasta(
fasta_files,
gtf_files
)
count(
index_fasta.out.index,
adaptor_removal.out.fastq,
index_fasta.out.t2g, whitelist_files,config_files
)
} else {
index_fasta_velocity(
fasta_files,
gtf_files
)
count_velocity(
index_fasta_velocity.out.index,
adaptor_removal.out.fastq,
index_fasta_velocity.out.t2g,
whitelist_files,
config_files
)
}
}
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
nextflow.enable.dsl=2
/*
Testing pipeline for marseq scRNASeq analysis
*/
include {
mapping;
} from "./nf_modules/bwa/main.nf"
include {
sort_bam;
} from "./nf_modules/samtools/main.nf"
include {
germline_cohort_data_variant_calling;
} from "./nf_modules/gatk4/main.nf" addParams(
variant_calling_out: "vcf/",
)
params.fastq = ""
params.fasta = ""
channel
.fromFilePairs( params.fastq, size: -1)
.set { fastq_files }
channel
.fromPath( params.fasta )
.map { it -> [it.simpleName, it]}
.set { fasta_files }
workflow {
mapping(fasta_files, fastq_files)
sort_bam(mapping.out.bam)
germline_cohort_data_variant_calling(sort_bam.out.bam, fasta_files)
}
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
Channel
.fromPath( "data/tiny_dataset/fasta/*.fasta" )
.set { fasta_file }
process sample_fasta {
publishDir "results/sampling/", mode: 'copy'
input:
file fasta from fasta_file
output:
file "*_sample.fasta" into fasta_sample
script:
"""
head ${fasta} > ${fasta.baseName}_sample.fasta
"""
}
#!/bin/sh
# SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#SBATCH --job-name=nextflow
#SBATCH --ntasks=1
#SBATCH --output=results/nextflow_%j.log
#SBATCH --licenses=sps
####################################
# change to your path
SCRATCH=/sps/lbmc/lmodolo/nextflow
${SCRATCH}/nextflow run ${SCRATCH}/src/solution_RNASeq.nf -profile ccin2p3 \
--fastq "${SCRATCH}/data/tiny_dataset/fastq/*_R{1,2}.fastq" \
--fasta "${SCRATCH}/data/tiny_dataset/fasta/tiny_v2.fasta" \
--bed "${SCRATCH}/data/tiny_dataset/annot/tiny.bed" \
-ansi-log \
-w "${SCRATCH}/work/"
wait
#!/bin/sh
# SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
java -version
curl -s https://get.nextflow.io | bash
#!/usr/bin/Rscript
rm(list = ls())
library("tidyverse")
library("seqinr")
args <- c(
"results/SNP/vcf_samtools/normal_sample_filtered.csv",
"results/SNP/vcf_samtools/tumor_sample_filtered.csv",
"results/fasta/DBG2OLC_output2_filtered.fasta",
"data/list_of_enzymes.csv"
)
seq_restric_size <- 21
args <- commandArgs(trailingOnly = TRUE)
snp_a <- read_delim(args[1], delim = "\t") %>%
mutate(cords = paste0(CHROM, POS))
snp_b <- read_delim(args[2], delim = "\t") %>%
mutate(cords = paste0(CHROM, POS))
only_b <- snp_b %>%
select(cords) %>%
setdiff(snp_a %>% select(cords)) %>%
pull(cords)
snp <- snp_b %>%
filter(cords %in% only_b) %>%
filter(tumor_sample.GT %in% c("A/A", "T/T", "G/G", "C/C")) %>%
mutate(REF = do.call(rbind, strsplit(AD, split = ",", fixed = TRUE))[,1],
VAR = do.call(rbind, strsplit(AD, split = ",", fixed = TRUE))[,2],
REF = as.integer(REF),
VAR = as.integer(VAR),
tumor_sample.AD = NULL,
cords = NULL
) %>%
filter(REF == 0) %>%
filter(VAR >= 10) %>%
arrange(CHROM, desc(VAR))
fastafile <- read.fasta(file = args[3],
as.string = TRUE)
snp$seq_list <- snp %>%
apply(1, FUN = function(x, fastafile, POS, CHROM, seq_restric_size){
begin <- as.integer(x[ POS ]) - ((seq_restric_size - 1) / 2)
end <- as.integer(x[ POS ]) + ((seq_restric_size - 1) / 2)
chrom <- x[ CHROM ]
seq_restric <- fastafile[[ chrom ]] %>%
c2s() %>%
substr(begin, end) %>%
s2c()
seq_restric[((seq_restric_size - 1) / 2) + 1] <-
toupper(seq_restric[((seq_restric_size - 1) / 2) + 1])
print(paste0(chrom, ":", begin, "-", end, " ", seq_restric %>% c2s()))
return(seq_restric %>% c2s())
},
fastafile = fastafile,
POS = which(colnames(snp) %in% "POS"),
CHROM = which(colnames(snp) %in% "CHROM")
)
snp %>%
write_csv(paste0(args[2], "only.csv" ))
snp <- read_csv(paste0(args[2], "only.csv" ))
enzyme_list <- read_csv(args[4]) %>%
mutate(size = nchar(seq))
snp <- snp %>%
mutate(enzyme = NA,
enzyme_pos = NA,
enzyme_seq = NA)
for (i in seq_len(nrow(enzyme_list))) {
enzyme <- enzyme_list[i, ]
enzyme_search <- gregexpr(toupper(enzyme$seq),
toupper(snp$seq_list),
fixed = TRUE) %>%
lapply(FUN = function(x, enzyme, seq_restric_size) {
if (x[1] < 0) {
return(c(NA, NA, NA))
} else {
if (x[1] <= (seq_restric_size - 1) / 2 + 1 &
x[1] + enzyme$size >= (seq_restric_size - 1) / 2 + 1) {
return(c(enzyme$enzyme, x[1], enzyme$seq))
}
return(c(NA, NA, NA))
}
},
enzyme = enzyme,
seq_restric_size = seq_restric_size)
enzyme_search <- do.call(rbind, enzyme_search)
snp[is.na(snp$enzyme), c("enzyme", "enzyme_pos", "enzyme_seq")] <-
enzyme_search[is.na(snp$enzyme), ]
}
snp %>%
filter(!is.na(enzyme)) %>%
write_csv(paste0(args[2], "only_enzyme.csv" ))
// SPDX-FileCopyrightText: 2022 Laurent Modolo <laurent.modolo@ens-lyon.fr>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
nextflowVersion = '>=20'
manifest {
homePage = 'https://gitbio.ens-lyon.fr/LBMC/nextflow'
description = 'pipeline to '
mainScript = 'main.nf'
version = '0.0.0'
}
report {
enabled = true
file = "$baseDir/../results/report.html"
}
profiles {
docker {
docker.temp = "auto"
docker.enabled = true
process {
errorStrategy = 'finish'
memory = '16GB'
withLabel: big_mem_mono_cpus {
cpus = 1
}
withLabel: big_mem_multi_cpus {
cpus = 4
}
withLabel: small_mem_mono_cpus {
cpus = 1
memory = '2GB'
}
withLabel: small_mem_multi_cpus {
cpus = 4
memory = '2GB'
}
}
}
podman {
charliecloud.enabled = true
charliecloud.cacheDir = "./bin/"
process {
errorStrategy = 'finish'
memory = '16GB'
withLabel: big_mem_mono_cpus {
cpus = 1
}
withLabel: big_mem_multi_cpus {
cpus = 4
}
withLabel: small_mem_mono_cpus {
cpus = 1
memory = '2GB'
}
withLabel: small_mem_multi_cpus {
cpus = 4
memory = '2GB'
}
}
}
singularity {
singularity.enabled = true
singularity.cacheDir = "./bin/"
process {
errorStrategy = 'finish'
memory = '16GB'
withLabel: big_mem_mono_cpus {
cpus = 1
}
withLabel: big_mem_multi_cpus {
cpus = 4
}
withLabel: small_mem_mono_cpus {
cpus = 1
memory = '2GB'
}
withLabel: small_mem_multi_cpus {
cpus = 4
memory = '2GB'
}
}
}
psmn {
charliecloud.enabled = true
charliecloud.cacheDir = "/Xnfs/abc/charliecloud"
charliecloud.runOptions = "--bind /scratch:/scratch --bind /Xnfs:/Xnfs --bind /home:/home"
charliecloud.readOnlyInputs = true
process{
errorStrategy = { sleep(Math.pow(2, task.attempt) * 200 as long); return 'retry' }
maxRetries = 3
executor = "slurm"
queue = "Lake"
withLabel: big_mem_mono_cpus {
cpus = 1
memory = "128GB"
time = "24h"
}
withLabel: big_mem_multi_cpus {
cpus = 32
memory = "192GB"
time = "24h"
}
withLabel: small_mem_mono_cpus {
cpus = 1
memory = "16GB"
time = "24h"
}
withLabel: small_mem_multi_cpus {
cpus = 32
memory = "16GB"
time = "24h"
}
}
}
ccin2p3 {
singularity.enabled = true
singularity.cacheDir = "$baseDir/../bin/"
singularity.runOptions = "--bind /pbs,/sps,/scratch,/tmp"
process{
maxRetries = 3
withLabel: big_mem_mono_cpus {
scratch = true
stageInMode = "copy"
stageOutMode = "rsync"
executor = "slurm"
clusterOptions = "--licenses=sps"
cpus = 1
memory = "8GB"
queue = "htc"
}
withLabel: big_mem_multi_cpus {
scratch = true
stageInMode = "copy"
stageOutMode = "rsync"
executor = "slurm"
clusterOptions = "--licenses=sps"
cpus = 1
memory = "8GB"
queue = "htc"
}
withLabel: small_mem_mono_cpus {
scratch = true
stageInMode = "copy"
stageOutMode = "rsync"
executor = "slurm"
clusterOptions = "--licenses=sps"
cpus = 1
memory = "8GB"
queue = "htc"
}
withLabel: small_mem_multi_cpus {
scratch = true
stageInMode = "copy"
stageOutMode = "rsync"
executor = "slurm"
clusterOptions = "--licenses=sps"
cpus = 1
memory = "8GB"
queue = "htc"
}
}
}
}
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
$fasta_from_bed {
container = "bedtools:2.25.0"
}
}
}
sge {
process{
$fasta_from_bed {
beforeScript = "module purge; module load BEDtools/2.25.0"
executor = "sge"
cpus = 1
memory = "5GB"
time = "6h"
queueSize = 1000
pollInterval = '60sec'
queue = 'h6-E5-2667v4deb128'
penv = 'openmp8'
}
}
}
}
/*
* bedtools :
* Imputs : fasta files
* Imputs : bed files
* Output : fasta files
*/
/* fasta extraction */
params.fasta = "$baseDir/data/fasta/*.fasta"
params.bed = "$baseDir/data/annot/*.bed"
log.info "fasta file : ${params.fasta}"
log.info "bed file : ${params.bed}"
Channel
.fromPath( params.fasta )
.ifEmpty { error "Cannot find any fasta files matching: ${params.fasta}" }
.set { fasta_files }
Channel
.fromPath( params.bed )
.ifEmpty { error "Cannot find any bed files matching: ${params.bed}" }
.set { bed_files }
process fasta_from_bed {
tag "${bed.baseName}"
cpus 4
publishDir "results/fasta/", mode: 'copy'
input:
file fasta from fasta_files
file bed from bed_files
output:
file "*_extracted.fasta" into fasta_files_extracted
script:
"""
bedtools getfasta -name \
-fi ${fasta} -bed ${bed} -fo ${bed.baseName}_extracted.fasta
"""
}
./nextflow src/nf_modules/BEDtools/fasta_from_bed.nf \
-c src/nf_modules/BEDtools/fasta_from_bed.config \
-profile docker \
--fasta "data/tiny_dataset/fasta/tiny_v2.fasta" \
--bed "data/tiny_dataset/annot/tiny.bed" \
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
$index_fasta {
container = "bwa:0.7.17"
}
}
}
sge {
process{
$index_fasta {
beforeScript = "module purge; module load BWA/0.7.17"
executor = "sge"
cpus = 1
memory = "5GB"
time = "6h"
queueSize = 1000
pollInterval = '60sec'
queue = 'h6-E5-2667v4deb128'
penv = 'openmp8'
}
}
}
}
params.fasta = "$baseDir/data/bam/*.fasta"
log.info "fasta files : ${params.fasta}"
Channel
.fromPath( params.fasta )
.ifEmpty { error "Cannot find any bam files matching: ${params.fasta}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { fasta_file }
process index_fasta {
tag "$fasta_id"
cpus 4
publishDir "results/mapping/index/", mode: 'copy'
input:
set fasta_id, file(fasta) from fasta_file
output:
set fasta_id, "${fasta.baseName}.*" into index_files
file "*_bwa_report.txt" into index_files_report
script:
"""
bwa index -p ${fasta.baseName} ${fasta} \
&> ${fasta.baseName}_bwa_report.txt
"""
}
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
$mapping_fastq {
container = "bwa:0.7.17"
}
}
}
sge {
process{
$mapping_fastq {
beforeScript = "module purge; module load BWA/0.7.17"
executor = "sge"
cpus = 4
memory = "5GB"
time = "6h"
queueSize = 1000
pollInterval = '60sec'
queue = 'h6-E5-2667v4deb128'
penv = 'openmp8'
}
}
}
}
params.fastq = "$baseDir/data/fastq/*_{1,2}.fastq"
params.index = "$baseDir/data/index/*.index.*"
log.info "fastq files : ${params.fastq}"
log.info "index files : ${params.index}"
Channel
.fromFilePairs( params.fastq )
.ifEmpty { error "Cannot find any fastq files matching: ${params.fastq}" }
.set { fastq_files }
Channel
.fromPath( params.index )
.ifEmpty { error "Cannot find any index files matching: ${params.index}" }
.map { it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.groupTuple()
.set { index_files }
process mapping_fastq {
tag "$reads"
cpus 4
publishDir "results/mapping/sam/", mode: 'copy'
input:
set pair_id, file(reads) from fastq_files
set index_id, file(index) from index_files.collect()
output:
file "${pair_id}.sam" into sam_files
file "${pair_id}_bwa_report.txt" into mapping_repport_files
script:
"""
bwa mem -t ${task.cpus} \
${index_id} ${reads[0]} ${reads[1]} \
-o ${pair_id}.sam &> ${pair_id}_bwa_report.txt
"""
}
./nextflow src/nf_modules/BWA/indexing.nf \
-c src/nf_modules/BWA/indexing.config \
-profile docker \
--fasta "data/tiny_dataset/fasta/tiny_v2.fasta"
# ./nextflow src/nf_modules/BWA/mapping_single.nf \
# -c src/nf_modules/BWA/mapping_single.config \
# -profile docker \
# --index "results/mapping/index/tiny_v2.index" \
# --fastq "data/tiny_dataset/fastq/tiny*_S.fastq"
./nextflow src/nf_modules/BWA/mapping_paired.nf \
-c src/nf_modules/BWA/mapping_paired.config \
-profile docker \
--index "results/mapping/index/tiny_v2*" \
--fastq "data/tiny_dataset/fastq/tiny*_R{1,2}.fastq"
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
$index_fasta {
container = "bowtie:1.2.2"
}
}
}
sge {
process{
$index_fasta {
beforeScript = "module purge; module load Bowtie/1.2.2"
}
}
}
}
/* fasta indexing */
params.fasta = "$baseDir/data/bam/*.fasta"
log.info "fasta files : ${params.fasta}"
Channel
.fromPath( params.fasta )
.ifEmpty { error "Cannot find any bam files matching: ${params.fasta}" }
.set { fasta_file }
process index_fasta {
tag "$fasta.baseName"
cpus 4
publishDir "results/mapping/index/", mode: 'copy'
input:
file fasta from fasta_file
output:
file "*.index*" into index_files
file "*_report.txt" into indexing_report
script:
"""
bowtie-build --threads ${task.cpus} -f ${fasta} ${fasta.baseName}.index &> ${fasta.baseName}_bowtie_report.txt
if grep -q "Error" ${fasta.baseName}_bowtie_report.txt; then
exit 1
fi
"""
}
profiles {
docker {
docker.temp = 'auto'
docker.enabled = true
process {
$mapping_fastq {
container = "bowtie:1.2.2"
}
}
}
sge {
process{
$mapping_fastq {
beforeScript = "module purge; module load SAMtools/1.7; module load Bowtie/1.2.2"
}
}
}
}