-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnextflow.nf
68 lines (54 loc) · 1.85 KB
/
nextflow.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
params.referenceGenome = file("/umut/MahmutKarabulut/referans_fasta/fox_reference_genome.fasta")
params.assemblyDir = "/umut/MahmutKarabulut/nextflow_results/assembly_results"
params.mappingDir = "/umut/MahmutKarabulut/nextflow_results/mapping_results"
params.statsDir = "/umut/MahmutKarabulut/nextflow_results/statistics"
params.inputDataDir = "/umut/MahmutKarabulut/input_files"
process spadesAssembly {
input:
path dirPath from params.inputDataDir
file(illuminaFile) from fileTree(dirPath).include("*.fastq")
output:
path "${params.assemblyDir}/${illuminaFile.baseName}" into assemblyResults
script:
"""
spades.py -o ${params.assemblyDir}/${illuminaFile.baseName} -1 ${illuminaFile} -2 ${illuminaFile}
"""
}
process minimapMapping {
input:
path(sampleAssembly) from assemblyResults
file(referenceGenome)
output:
path "${params.mappingDir}/${sampleAssembly.baseName}" into mappingResults
script:
"""
minimap2 -ax map-ont ${referenceGenome} ${sampleAssembly}/scaffolds.fasta | samtools view -bS - | samtools sort -o ${params.mappingDir}/${sampleAssembly.baseName}.sorted.bam -
"""
}
process calculateN50N75 {
input:
path(mappedBam) from mappingResults
output:
path "${params.statsDir}/${mappedBam.baseName}.stats" into n50n75Stats
script:
"""
samtools stats ${mappedBam} > ${params.statsDir}/${mappedBam.baseName}.stats
"""
}
process calculateChromosomeCoverage {
input:
path(mappedBam) from mappingResults
output:
path "${params.statsDir}/${mappedBam.baseName}.chromosome_coverage_summary.txt" into chromosomeCoverage
script:
"""
python percentFinder.py
"""
}
workflow {
// Updated both processes to work with at least 2 files
spadesAssembly()
minimapMapping(referenceGenome)
calculateN50N75()
calculateChromosomeCoverage()
}