Skip to content

Commit

Permalink
Fix vcf sorting for freebayes
Browse files Browse the repository at this point in the history
  • Loading branch information
iracooke committed Apr 9, 2024
1 parent a1259b1 commit 7870ec5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
42 changes: 39 additions & 3 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,55 @@ process {
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
memory = { check_max( 4.GB * task.attempt, 'memory' ) }
}

withName: 'fastq2ubam'{
cpus = { check_max( 2 * task.attempt, 'cpus' ) }
queue='normal'
}

withName: 'markadapters' {
cpus= { check_max( 12 * task.attempt, 'cpus' ) }
}

withName: 'bwa_mem_gatk'{
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
memory = { check_max( 20.GB * task.attempt, 'memory' ) }
}

withName: 'gatk_mark_duplicates'{
cpus = { check_max( 4 * task.attempt, 'cpus' ) }
ext.args='-MAX_FILE_HANDLES 1000'
}

withName: 'gatk_haplotype_caller'{
cpus = { check_max( 4 * task.attempt, 'cpus' ) }
memory = { check_max( 20.GB * task.attempt, 'memory' ) }
}

withName: 'gatk_genomicsdb_import' {
cpus = { check_max( 2 * task.attempt, 'cpus' ) }
}

withName: 'gatk_genotypegvcfs' {
memory = { check_max( 8.GB * task.attempt, 'memory' ) }
}


withName: 'stat'{
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
}

withName: 'freebayes'{
cpus = 1
memory = { check_max( 20.GB * task.attempt, 'memory' ) }
ext.args='-m 20 -q 20 -R 0 -S 0'
queue = 'normal'
}

withName: 'mpileup_call'{
cpus = { check_max( 24 * task.attempt, 'cpus' ) }
memory = { check_max( 40.GB * task.attempt, 'memory' ) }
queue = 'normal'
cpus = { check_max( 36 * task.attempt, 'cpus' ) }
memory = { check_max( 80.GB * task.attempt, 'memory' ) }
queue = 'long'
}

withName: 'freebayes_collect'{
Expand Down
9 changes: 5 additions & 4 deletions modules/gatk.nf
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ process gatk_haplotype_caller {
script:
def args = task.ext.args ?: ''
def outfile = "${bam.baseName}.g.vcf.gz"

"""
gatk --java-options "-Xmx20G -XX:GCTimeLimit=50 -XX:GCHeapFreeLimit=10" \
gatk --java-options "-Xmx${task.memory.giga}G" \
HaplotypeCaller \
--native-pair-hmm-threads $task.cpus \
-R $genome \
Expand All @@ -183,11 +184,11 @@ process gatk_genomicsdb_import {
def args = task.ext.args ?: ''

"""
gatk --java-options "-Xmx4g -Xms4g" \
gatk --java-options "-Xmx${task.memory.giga}g -Xms${task.memory.giga}g" \
GenomicsDBImport \
--genomicsdb-workspace-path ${region}.gatk.db \
--sample-name-map $samplemap \
--reader-threads 4 \
--reader-threads ${task.cpus} \
--batch-size 50 \
--L $region
"""
Expand All @@ -212,7 +213,7 @@ process gatk_genotypegvcfs {
def args = task.ext.args ?: ''

"""
gatk --java-options "-Xmx8g -Xms8g" \
gatk --java-options "-Xmx${task.memory.giga}g -Xms${task.memory.giga}g" \
GenotypeGVCFs \
-R $genome \
-O ${region}.vcf.gz \
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ profiles {


genomics {
singularity.runOptions='--bind /fast/tmp:/tmp'
process.executor = 'local'
singularity.enabled = true
singularity.autoMounts = true
Expand Down
2 changes: 1 addition & 1 deletion shell/sort_vcf_files.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ls *.vcf | awk -F "[:.-]" '{print $1,$2,$3,$4,$5}' | sort -k2,2 -k4,4n | awk '{printf("%s.%s.%s:%s-%s.vcf\n",$1,$2,$3,$4,$5)}'
for f in *.vcf;do f1=${f%.vcf}; f2=${f1#freebayes.}; echo $f2 | awk -F "[:-]" '{print $1,$2,$3}';done | sort -k2,2 -k4,4n | awk '{printf("freebayes.%s:%s-%s.vcf\n",$1,$2,$3)}'

0 comments on commit 7870ec5

Please sign in to comment.