Commit ff077ece authored by lrodrin's avatar lrodrin
Browse files

Optional reference genome index generation

parent e8d358aa
......@@ -63,6 +63,7 @@ params.trim_tail1 = 1
params.length_required = 70
params.min_mapping_quality = 10
params.bits_set = 4
params.algoType = ''
params.assemblyFilename = "gridss.assembly.bam"
params.read_group = "@RG\\tID:SRR709972\\tSM:NA19206\\tPL:ILLUMINA\\tCN:CBRA\\tLB:Fragment"
......@@ -70,6 +71,7 @@ params.read_group = "@RG\\tID:SRR709972\\tSM:NA19206\\tPL:ILLUMINA\\tCN:CBRA\\tL
* Include subworkflows
*/
include { SUB_BWA_INDEX } from './subworkflows/bwa_index'
include { SUB_BUNDLE_FILES } from './subworkflows/bundle_files'
include { SUB_TRIMMED_FASTQ } from './subworkflows/trimmed_fastq'
include { SUB_BWA_MEM } from './subworkflows/bwa_mem'
include { SUB_SAMTOOLS_VIEW_SAM2BAM } from './subworkflows/samtools_view_sam2bam'
......@@ -87,11 +89,18 @@ include { SUB_FINAL_FILTERING } from './subworkflows/final_filtering'
workflow{
SUB_BWA_INDEX(reference_fasta)
indexFiles = []
if( params.generate_bwa_indexes )
indexFiles = SUB_BWA_INDEX(reference_fasta)
else
indexFiles = SUB_BUNDLE_FILES(reference_fasta)
SUB_TRIMMED_FASTQ(fastq)
SUB_BWA_MEM(
SUB_TRIMMED_FASTQ.out.reads,
SUB_BWA_INDEX.out.output
SUB_TRIMMED_FASTQ.out.unpaired_R1,
SUB_TRIMMED_FASTQ.out.unpaired_R2,
indexFiles
)
SUB_SAMTOOLS_VIEW_SAM2BAM(
SUB_BWA_MEM.out
......@@ -107,26 +116,26 @@ workflow{
)
SUB_PICARD_MARKDUPLICATES( SAMTOOLS_INDEX.out.output )
SUB_BAM_FILTERING( PICARD_MARKDUPLICATES.out.alignments )
// SUB_CNV_MANTA (
// BAM_FILTERING.out,
// samples,
// SUB_BWA_INDEX.out
// bed
// )
// SUB_CNV_GRIDSS (
// BAM_FILTERING.out,
// samples,
// SUB_BWA_INDEX.out
// )
// SUB_CNV_EXOMEDEPTH (
// BAM_FILTERING.out,
// samples,
// SUB_BWA_INDEX.out
// )
// SUB_CNV_CODEX (
// BAM_FILTERING.out,
// samples,
// bed
// )
// SUB_FINAL_FILTERING ( final_filtering )
SUB_CNV_MANTA (
BAM_FILTERING.out,
samples,
indexFiles,
bed
)
SUB_CNV_GRIDSS (
BAM_FILTERING.out,
samples,
indexFiles
)
SUB_CNV_EXOMEDEPTH (
BAM_FILTERING.out,
samples,
indexFiles
)
SUB_CNV_CODEX (
BAM_FILTERING.out,
samples,
bed
)
SUB_FINAL_FILTERING ( final_filtering )
}
\ No newline at end of file
process BUNDLE_INDEXFILES{
tag "bundle indexfiles"
input:
path reference_amb
path reference_ann
path reference_bwt
path reference_pac
path reference_sa
output:
tuple path(reference_amb),
path(reference_ann),
path(reference_bwt),
path(reference_pac),
path(reference_sa)
script:
"""
"""
}
\ No newline at end of file
process BUNDLE_SECONDARYFILES{
tag "bundle_secondaryfiles"
input:
path index_files
path reference_fai
path reference_fasta
output:
tuple path(index_files), path(reference_fai), path(reference_fasta)
script:
"""
"""
}
\ No newline at end of file
......@@ -6,11 +6,11 @@ process BWA_INDEX {
path input
output:
tuple path("*.{amb,ann,bwt,pac,sa}"), path("*.fa"), emit: output_bwa
path "*.{amb,ann,bwt,pac,sa}"
script:
def algoType = params.algoType ? "-a $params.algoType" : ""
"""
bwa index $algoType $input
"""
}
}
\ No newline at end of file
......@@ -9,12 +9,20 @@
// Global default params, used in configs
params {
//Files
fastq = "data/fastq_simple/SRR{081254,078847}_{1,2}.fastq.gz"
generate_bwa_indexes = true
reference_fasta = "data/fastq/hs37d5.fa.gz"
samples = "data/samples_test.txt"
bed = "data/gencode.v19.genes.v7_model.patched_contigs.gtf.bed.*"
blacklist = "data/hg19-blacklist.v2.num.bed.gz"
fastq = [ "/scratch/laura/transbionet/fastq_simple/SRR081254_{1,2}.fastq.gz", "/scratch/laura/transbionet/fastq_simple/SRR078847_{1,2}.fastq.gz" ]
generate_bwa_indexes = false
reference_amb = "/scratch/laura/transbionet/hs37d5.fa.amb"
reference_ann = "/scratch/laura/transbionet/hs37d5.fa.ann"
reference_bwt = "/scratch/laura/transbionet/hs37d5.fa.bwt"
reference_pac = "/scratch/laura/transbionet/hs37d5.fa.pac"
reference_sa = "/scratch/laura/transbionet/hs37d5.fa.sa"
reference_fai = "/scratch/laura/transbionet/hs37d5.fa.fai"
reference_fasta = "/scratch/laura/transbionet/hs37d5.fa"
samples = "/scratch/laura/transbionet/samples_test.txt"
bed = "/scratch/laura/transbionet/gencode.v19.genes.v7_model.patched_contigs.gtf.bed.*"
blacklist = "/scratch/laura/transbionet/hg19-blacklist.v2.num.bed.gz"
//scripts
manta_filter_script = "templates/manta_filter.sh"
......
/*
* Includes for bundle_files
*/
include {
BUNDLE_SECONDARYFILES
} from "../modules/bundle_secondaryfiles"
include {
BUNDLE_INDEXFILES
} from "../modules/bundle_indexfiles"
/*
* Subworkflow bundle_files
*/
workflow SUB_BUNDLE_FILES {
take:
reference_fasta
main:
BUNDLE_INDEXFILES(params.reference_amb,
params.reference_ann,
params.reference_bwt,
params.reference_pac,
params.reference_sa,
)
BUNDLE_SECONDARYFILES(BUNDLE_INDEXFILES.out,
params.reference_fai,
reference_fasta)
emit:
output = BUNDLE_SECONDARYFILES.out
}
\ No newline at end of file
......@@ -7,12 +7,7 @@ include {
include {
SAMTOOLS_FAIDX
} from "../modules/samtools_faidx"
include {
BUNDLE_SECONDARYFILES
} from "../modules/bundle_secondaryfiles"
include {
BUNDLE_INDEXFILES
} from "../modules/bundle_indexfiles"
/*
* Subworkflow bwa_index
......@@ -23,26 +18,8 @@ workflow SUB_BWA_INDEX {
main:
BWA_INDEX(reference_fasta)
SAMTOOLS_FAIDX(reference_fasta, BWA_INDEX.out.output_bwa)
SAMTOOLS_FAIDX(reference_fasta, BWA_INDEX.out)
emit:
output = SAMTOOLS_FAIDX.out
}
// workflow SUB_BWA_INDEX {
// take:
// reference_fasta
// if( params.generate_bwa_indexes == true )
// main:
// BWA_INDEX(reference_fasta)
// SAMTOOLS_FAIDX(reference_fasta, BWA_INDEX.out.output_bwa)
// emit:
// output = SAMTOOLS_FAIDX.out
// else
// main:
// BUNDLE_INDEXFILES(reference_fasta)
// BUNDLE_SECONDARYFILES(BUNDLE_INDEXFILES.out)
// emit:
// output = BUNDLE_SECONDARYFILES.out
// }
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment