Skip to content
Snippets Groups Projects
Commit befbf094 authored by nservant's avatar nservant
Browse files

[LINT] move to 4 spaces

parent 0c51b65d
No related branches found
No related tags found
No related merge requests found
Showing
with 498 additions and 582 deletions
...@@ -3,11 +3,9 @@ ...@@ -3,11 +3,9 @@
// Author(s): Nicolas Servant // Author(s): Nicolas Servant
// Contact: nicolas.servant@curie.fr // Contact: nicolas.servant@curie.fr
// This software is distributed without any guarantee under the terms of the BSD-3 licence // This software is distributed without any guarantee under the terms of the BSD-3 licence
// g++ -std=c++0x -o cutsite_trimming cutsite_trimming.cpp // g++ -std=c++0x -o cutsite_trimming cutsite_trimming.cpp
//./cutsite_trimming -fastq fastq -cutsite AGCTT //./cutsite_trimming -fastq fastq -cutsite AGCTT
#include <iostream> // std::cout #include <iostream> // std::cout
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -35,8 +33,8 @@ static int get_options(int argc, char* argv[], std::string& fastqFile, ...@@ -35,8 +33,8 @@ static int get_options(int argc, char* argv[], std::string& fastqFile,
if (*opt == '-') { if (*opt == '-') {
if (!strcmp(opt, "--fastq")) { if (!strcmp(opt, "--fastq")) {
fastqFile = std::string(argv[++ac]); fastqFile = std::string(argv[++ac]);
} else if (!strcmp(opt, "--cutsite")) { }
else if (!strcmp(opt, "--cutsite")) {
std::string cutSitesSequence; std::string cutSitesSequence;
cutSitesSequence = std::string(argv[++ac]); cutSitesSequence = std::string(argv[++ac]);
size_t pos = cutSitesSequence.find(","); size_t pos = cutSitesSequence.find(",");
...@@ -47,7 +45,6 @@ static int get_options(int argc, char* argv[], std::string& fastqFile, ...@@ -47,7 +45,6 @@ static int get_options(int argc, char* argv[], std::string& fastqFile,
pos = cutSitesSequence.find(",", begin + 1); pos = cutSitesSequence.find(",", begin + 1);
} }
cutSites.push_back(cutSitesSequence.substr(begin, pos)); cutSites.push_back(cutSitesSequence.substr(begin, pos));
} }
else if (!strcmp(opt, "--out")) { else if (!strcmp(opt, "--out")) {
output = std::string(argv[++ac]); output = std::string(argv[++ac]);
...@@ -65,9 +62,7 @@ static int get_options(int argc, char* argv[], std::string& fastqFile, ...@@ -65,9 +62,7 @@ static int get_options(int argc, char* argv[], std::string& fastqFile,
static int trim_fastq(std::string& fastqFile, static int trim_fastq(std::string& fastqFile,
std::vector<std::string>& cutSites, std::vector<std::string>& cutSites,
std::string& outFile, bool& rmuntrim) std::string& outFile, bool& rmuntrim){
{
int trim_count=0; int trim_count=0;
std::string ID; std::string ID;
std::ifstream ifs (fastqFile); std::ifstream ifs (fastqFile);
...@@ -125,7 +120,6 @@ static int trim_fastq(std::string& fastqFile, ...@@ -125,7 +120,6 @@ static int trim_fastq(std::string& fastqFile,
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
std::string fastqFile; std::string fastqFile;
std::vector<std::string> cutSites; std::vector<std::string> cutSites;
std::string outFile; std::string outFile;
......
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
options = initOptions(params.options)
process bowtie2_end_to_end {
tag "$sample"
label 'process_medium'
publishDir path: { params.save_aligned_intermediates ? "${params.outdir}/mapping/bwt2_end2end" : params.outdir },
saveAs: { filename -> if (params.save_aligned_intermediates) filename }, mode: params.publish_dir_mode
input:
tuple val(sample), path(reads)
path index
output:
tuple val(sample), path("${prefix}_unmap.fastq"), emit: unmapped_end_to_end
tuple val(sample), path("${prefix}.bam"), emit: end_to_end_bam
script:
prefix = reads.toString() - ~/(\.fq)?(\.fastq)?(\.gz)?$/
def bwt2_opts = params.bwt2_opts_end2end
if (!params.dnase){
"""
INDEX=`find -L ./ -name "*.rev.1.bt2" | sed 's/.rev.1.bt2//'`
bowtie2 --rg-id BMG --rg SM:${prefix} \\
${bwt2_opts} \\
-p ${task.cpus} \\
-x \${INDEX} \\
--un ${prefix}_unmap.fastq \\
-U ${reads} | samtools view -F 4 -bS - > ${prefix}.bam
"""
}else{
"""
INDEX=`find -L ./ -name "*.rev.1.bt2" | sed 's/.rev.1.bt2//'`
bowtie2 --rg-id BMG --rg SM:${prefix} \\
${bwt2_opts} \\
-p ${task.cpus} \\
-x \${INDEX} \\
--un ${prefix}_unmap.fastq \\
-U ${reads} > ${prefix}.bam
"""
}
}
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
options = initOptions(params.options)
process bowtie2_on_trimmed_reads {
tag "$sample"
label 'process_medium'
publishDir path: { params.save_aligned_intermediates ? "${params.outdir}/mapping/bwt2_trimmed" : params.outdir },
saveAs: { filename -> if (params.save_aligned_intermediates) filename }, mode: params.publish_dir_mode
when:
!params.dnase
input:
tuple val(sample), path(reads)
path index
output:
tuple val(sample), path("${prefix}_trimmed.bam"), emit:trimmed_bam
script:
prefix = reads.toString() - ~/(_trimmed)?(\.fq)?(\.fastq)?(\.gz)?$/
"""
INDEX=`find -L ./ -name "*.rev.1.bt2" | sed 's/.rev.1.bt2//'`
bowtie2 --rg-id BMG --rg SM:${prefix} \\
${params.bwt2_opts_trimmed} \\
-p ${task.cpus} \\
-x \${INDEX} \\
-U ${reads} | samtools view -bS - > ${prefix}_trimmed.bam
"""
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment