Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Ascat R script execution #127

Merged
merged 15 commits into from
Feb 25, 2020
3 changes: 2 additions & 1 deletion bin/convertAlleleCounts.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/env Rscript
#!/usr/bin/env Rscript

# Description:
# R-script for converting output from AlleleCount to BAF and LogR values.
#
Expand Down
2 changes: 1 addition & 1 deletion bin/run_ascat.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
q#!/bin/env Rscript
#!/usr/bin/env Rscript
library("optparse")
option_list = list(
make_option("--tumorbaf", type="character", default=NULL,
Expand Down
4 changes: 2 additions & 2 deletions conf/igenomes.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ params {
genomes {
'GRCh37' {
ac_loci = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Annotation/ASCAT/1000G_phase3_20130502_SNP_maf0.3.loci"
ac_lociGC = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Annotation/ASCAT/1000G_phase3_20130502_SNP_maf0.3.loci.gc"
ac_loci_gc = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Annotation/ASCAT/1000G_phase3_20130502_SNP_maf0.3.loci.gc"
bwa = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Sequence/BWAIndex/human_g1k_v37_decoy.fasta.{amb,ann,bwt,pac,sa}"
chr_dir = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Sequence/Chromosomes"
chr_length = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Sequence/Length/human_g1k_v37_decoy.len"
Expand All @@ -31,7 +31,7 @@ params {
}
'GRCh38' {
ac_loci = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Annotation/ASCAT/1000G_phase3_GRCh38_maf0.3.loci"
ac_lociGC = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Annotation/ASCAT/1000G_phase3_GRCh38_maf0.3.loci.gc"
ac_loci_gc = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Annotation/ASCAT/1000G_phase3_GRCh38_maf0.3.loci.gc"
bwa = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Sequence/BWAIndex/Homo_sapiens_assembly38.fasta.64.{alt,amb,ann,bwt,pac,sa}"
chr_dir = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Sequence/Chromosomes"
chr_length = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh38/Sequence/Length/Homo_sapiens_assembly38.len"
Expand Down
17 changes: 5 additions & 12 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2569,7 +2569,7 @@ process ConvertAlleleCounts {
script:
gender = genderMap[idPatient]
"""
Rscript ${workflow.projectDir}/bin/convertAlleleCounts.r ${idSampleTumor} ${alleleCountTumor} ${idSampleNormal} ${alleleCountNormal} ${gender}
convertAlleleCounts.r ${idSampleTumor} ${alleleCountTumor} ${idSampleNormal} ${alleleCountNormal} ${gender}
"""
}

Expand Down Expand Up @@ -2597,18 +2597,11 @@ process Ascat {
gender = genderMap[idPatient]
ascat_purity=params.ascat_purity
ascat_ploidy=params.ascat_ploidy
if (params.ascat_purity && params.ascat_ploidy)
purity_ploidy = (params.ascat_purity && params.ascat_ploidy) ? "--purity ${params.ascat_purity} --ploidy ${params.ascat_ploidy}" : ""
ggabernet marked this conversation as resolved.
Show resolved Hide resolved
"""
for f in *BAF *LogR; do sed 's/chr//g' \$f > tmpFile; mv tmpFile \$f;done
Rscript ${workflow.projectDir}/bin/run_ascat.r --tumorbaf ${bafTumor} --tumorlogr ${logrTumor} --normalbaf ${bafNormal} --normallogr ${logrNormal} --tumorname ${idSampleTumor} --basedir ${baseDir} --gcfile ${acLociGC} --gender ${gender} --purity ${ascat_purity} --ploidy ${ascat_ploidy}
"""
else
"""
for f in *BAF *LogR; do sed 's/chr//g' \$f > tmpFile; mv tmpFile \$f;done
Rscript ${workflow.projectDir}/bin/run_ascat.r --tumorbaf ${bafTumor} --tumorlogr ${logrTumor} --normalbaf ${bafNormal} --normallogr ${logrNormal} --tumorname ${idSampleTumor} --basedir ${baseDir} --gcfile ${acLociGC} --gender ${gender}
"""


for f in *BAF *LogR; do sed 's/chr//g' \$f > tmpFile; mv tmpFile \$f;done
run_ascat.r --tumorbaf ${bafTumor} --tumorlogr ${logrTumor} --normalbaf ${bafNormal} --normallogr ${logrNormal} --tumorname ${idSampleTumor} --basedir ${baseDir} --gcfile ${acLociGC} --gender ${gender} ${purity_ploidy}
"""""
}

ascatOut.dump(tag:'ASCAT')
Expand Down