Skip to content

Commit c97275b

Browse files
committed
Minor changes to processes
1 parent d1cb257 commit c97275b

File tree

12 files changed

+80
-22
lines changed

12 files changed

+80
-22
lines changed

bin/reports_to_xls.rb

+41-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
require 'rubyXL/convenience_methods/workbook'
1111
require 'rubyXL/convenience_methods/worksheet'
1212

13-
1413
### Define modules and classes here
1514

1615
def parse_json(filename)
@@ -24,6 +23,7 @@ def parse_json(filename)
2423
opts = OptionParser.new()
2524
opts.banner = "Reads reports and makes a table"
2625
opts.separator ""
26+
opts.on("-o","--outfile", "=OUTFILE","Output file") {|argument| options.outfile = argument }
2727
opts.on("-h","--help","Display the usage information") {
2828
puts opts
2929
exit
@@ -67,15 +67,53 @@ def parse_json(filename)
6767

6868
end
6969

70+
workbook = RubyXL::Workbook.new
71+
page = 0
72+
7073
bucket.each do |rule,reports|
7174

75+
sheet = workbook.worksheets[page]
76+
sheet.sheet_name = rule
77+
78+
row = 0
79+
col = 0
80+
81+
sheet.add_cell(row,col,"Probe")
82+
col += 1
83+
sheet.add_cell(row,col,"Vsearch/Blast")
84+
col += 1
85+
sheet.add_cell(row,col,"Bwa2/Freebayes")
86+
87+
7288
reports.group_by{|r| r["Sample"]}.sort.each do |sample,data|
7389

74-
puts sample
90+
row += 1
91+
col = 0
92+
93+
sheet.add_cell(row,col,sample)
94+
col += 1
95+
96+
blast = data.find{|d| d["Befund"].include?("Amplicon")}
97+
freebayes = data.find{|d| d["Befund"].include?("Varianten")}
98+
99+
blast ? b = blast["Anteil Variante %"] : b = "Kein Nachweis"
100+
# Here we remove noisy results below 1%
101+
if !b.to_s.include?("Nachweis")
102+
b = "Kein Nachweis" if b.to_f < 1.0
103+
end
104+
freebayes ? f = freebayes["Anteil Variante %"] : f = "Kein Nachweis"
105+
106+
sheet.add_cell(row,col,b)
107+
col += 1
108+
109+
sheet.add_cell(row,col,f)
75110

76111
end
77-
end
78112

113+
page += 1
114+
115+
end
79116

117+
workbook.write(options.outfile)
80118

81119

conf/resources.config

+11-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ params {
22

33
references {
44

5-
65
genomes {
76
tomato {
87
fasta = "${params.reference_base}/solanum_lycopersicum.fa"
@@ -12,8 +11,17 @@ params {
1211
bed = "${baseDir}/assets/genomes/tomato/primers.bed"
1312
target_bed = "${baseDir}/assets/genomes/tomato/targets.bed"
1413
rules = "${baseDir}/assets/genomes/tomato/rules.json"
15-
url = "https://raw.githubusercontent.com/ikmb/nf-testdata/master/bacterial-annotation/ecoli.fasta"
16-
old_url = "https://ftp.ensemblgenomes.ebi.ac.uk/pub/plants/release-58/fasta/solanum_lycopersicum/dna/Solanum_lycopersicum.SL3.0.dna.toplevel.fa.gz"
14+
url = "https://ftp.ensemblgenomes.ebi.ac.uk/pub/plants/release-58/fasta/solanum_lycopersicum/dna/Solanum_lycopersicum.SL3.0.dna.toplevel.fa.gz"
15+
}
16+
soybean {
17+
fasta = "${params.reference_base}/soybean/Glycine_max.Glycine_max_v2.1.dna.toplevel.fa"
18+
fai = "${params.reference_base}/soybean/Glycine_max.Glycine_max_v2.1.dna.toplevel.fa.fai"
19+
dict = "${params.reference_base}/soybean/Glycine_max.Glycine_max_v2.1.dna.toplevel.fa.dict"
20+
amplicon_txt = null
21+
bed = null
22+
target_bed = null
23+
rules = null
24+
url = "https://ftp.ensemblgenomes.ebi.ac.uk/pub/plants/release-58/fasta/glycine_max/dna/Glycine_max.Glycine_max_v2.1.dna.toplevel.fa.gz"
1725
}
1826

1927
}

modules/biobloomtools/categorizer/main.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
process BIOBLOOMTOOLS_CATEGORIZER {
22

3-
publishDir "${params.outdir}/Bloomfilter", mode: 'copy'
3+
publishDir "${params.outdir}/Processing/Bloomfilter", mode: 'copy'
44

55
label 'short_parallel'
66

modules/blast/makeblastdb/main.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
process BLAST_MAKEBLASTDB {
22
tag "$fasta"
33

4-
publishDir "${params.outdir}/BlastDB", mode: 'copy'
4+
publishDir "${params.outdir}/Processing/BlastDB", mode: 'copy'
55

66
label 'short_parallel'
77

modules/fastp/main.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
process FASTP {
2-
publishDir "${params.outdir}/FastP", mode: 'copy'
2+
publishDir "${params.outdir}/Processing/FastP", mode: 'copy'
33

44
label 'short_parallel'
55

modules/gunzip/main.nf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
process GUNZIP {
22

3-
tag "${meta.genome}"
3+
tag "${meta.id}"
44

55
label 'medium_serial'
66

7-
publishDir "${params.outdir}/${meta.genome}", mode: 'copy'
7+
publishDir "${params.outdir}/${meta.id}", mode: 'copy'
88

99
conda 'sed=4.7'
1010
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?

modules/ptrimmer/main.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
process PTRIMMER {
22

3-
publishDir "${params.outdir}/${meta.sample_id}/PTRIMMER", mode: 'copy'
3+
publishDir "${params.outdir}/${meta.sample_id}/VSEARCH/PTRIMMER", mode: 'copy'
44

55
label 'short_serial'
66

modules/samtools/ampliconclip/main.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ process SAMTOOLS_AMPLICONCLIP {
66

77
tag "${meta.sample_id}"
88

9-
publishDir "${params.outdir}/${meta.sample_id}/", mode: 'copy'
9+
publishDir "${params.outdir}/${meta.sample_id}/BWA2", mode: 'copy'
1010

1111
input:
1212
tuple val(meta), path(bam), path(bai)

modules/samtools/faidx/main.nf

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
process SAMTOOLS_FAIDX {
22

3-
publishDir "${params.outdir}/${meta.name}", mode 'copy'
3+
tag "${meta.id}"
4+
5+
label 'short_serial'
6+
7+
publishDir "${params.outdir}/${meta.id}", mode 'copy'
48

59
conda 'bioconda::samtools=1.19.2'
610
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?

modules/samtools/index/main.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
process SAMTOOLS_INDEX {
22

3-
publishDir "${params.outdir}/${meta.sample_id}/", mode: 'copy'
3+
publishDir "${params.outdir}/${meta.sample_id}/BWA2", mode: 'copy'
44

55
conda 'bioconda::samtools=1.19.2'
66
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?

workflows/build_references.nf

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
2-
include { BWAMEM2_INDEX } from "./../modules/bwamem2/index"
3-
include { SAMTOOLS_FAIDX } from "./../modules/samtools/faidx"
4-
include { SAMTOOLS_DICT } from "./../modules/samtools/dict"
51
include { GUNZIP } from "./../modules/gunzip"
2+
include { SAMTOOLS_FAIDX } from "./../modules/samtools/faidx"
63

74
genomes = params.references.genomes.keySet()
85

96
genome_list = []
107

118
genomes.each { genome ->
129
def meta = [:]
13-
meta.name = genome.toString()
10+
meta.id = genome.toString()
1411

1512
genome_list << tuple(meta,file(params.references.genomes[genome].url, checkIfExists: true ))
1613
}
@@ -21,7 +18,18 @@ workflow BUILD_REFERENCES {
2118

2219
main:
2320

21+
ch_genomes.branch {
22+
compressed: it[1].toString().contains(".gz")
23+
uncompressed: !it[1].toString().contains(".gz")
24+
}.set { ch_genomes_branched }
25+
26+
GUNZIP(
27+
ch_genomes_branched.compressed
28+
)
29+
30+
ch_fasta = ch_genomes_branched.uncompressed.mix(GUNZIP.out.gunzip)
31+
2432
SAMTOOLS_FAIDX(
25-
ch_genomes
33+
ch_fasta
2634
)
2735
}

workflows/gmo.nf

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ workflow GMO {
4141
ch_versions = ch_versions.mix(BIOBLOOMTOOLS_CATEGORIZER.out.versions)
4242
multiqc_files = multiqc_files.mix(BIOBLOOMTOOLS_CATEGORIZER.out.results)
4343

44-
// trim reads using fastP in automatic mode
44+
// trim reads using fastP in automatic mode and with overlap correction
4545
FASTP(
4646
BIOBLOOMTOOLS_CATEGORIZER.out.reads
4747
)

0 commit comments

Comments
 (0)