Skip to content
Snippets Groups Projects
Unverified Commit f7ba71e6 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

SNP_calling: add vcf to csv conversion step

parent 61f2438d
Branches
No related tags found
No related merge requests found
...@@ -39,6 +39,12 @@ profiles { ...@@ -39,6 +39,12 @@ profiles {
withName: samtools_SNP_norm { withName: samtools_SNP_norm {
container = "samtools:1.7" container = "samtools:1.7"
} }
withName: vcf_to_csv_tumor {
container = "gatk:4.0.8.1"
}
withName: vcf_to_csv_norm {
container = "gatk:4.0.8.1"
}
withName: HaplotypeCaller { withName: HaplotypeCaller {
container = "gatk:4.0.8.1" container = "gatk:4.0.8.1"
} }
......
...@@ -339,7 +339,7 @@ indexed3_fasta_file.into{ ...@@ -339,7 +339,7 @@ indexed3_fasta_file.into{
} }
process samtools_SNP_tumor { process samtools_SNP_tumor {
tag "$file_id_norm" tag "$file_id_tumor"
cpus 1 cpus 1
publishDir "results/SNP/vcf_samtools/", mode: 'copy' publishDir "results/SNP/vcf_samtools/", mode: 'copy'
...@@ -351,8 +351,7 @@ process samtools_SNP_tumor { ...@@ -351,8 +351,7 @@ process samtools_SNP_tumor {
set genome3_idx, file(fasta3idx) from samtools_SNP_indexed3_fasta_file_tumor set genome3_idx, file(fasta3idx) from samtools_SNP_indexed3_fasta_file_tumor
output: output:
set file_id_norm, "*.vcf" into vcf_files_tumor set file_id_tumor, "*.vcf" into vcf_files_tumor
set file_id_norm, "*.vcf.idx" into index_vcf_files_tumor
file "*_samtools_SNP_report.txt" into samptools_SNP_report_tumor file "*_samtools_SNP_report.txt" into samptools_SNP_report_tumor
script: script:
...@@ -360,7 +359,7 @@ process samtools_SNP_tumor { ...@@ -360,7 +359,7 @@ process samtools_SNP_tumor {
samtools mpileup -AE -uf ${fasta} ${bam_tumor} | \ samtools mpileup -AE -uf ${fasta} ${bam_tumor} | \
bcftools call -mv --output-type v > ${file_id_tumor}_raw.vcf bcftools call -mv --output-type v > ${file_id_tumor}_raw.vcf
bcftools filter -s LowQual -e '%QUAL<20 || DP>100' ${file_id_tumor}_raw.vcf \ bcftools filter -s LowQual -e '%QUAL<20 || DP>100' ${file_id_tumor}_raw.vcf \
> ${file_id_tumor}_raw.vcf > ${file_id_tumor}_filtered.vcf
""" """
} }
...@@ -378,7 +377,6 @@ process samtools_SNP_norm { ...@@ -378,7 +377,6 @@ process samtools_SNP_norm {
output: output:
set file_id_norm, "*.vcf" into vcf_files_norm set file_id_norm, "*.vcf" into vcf_files_norm
set file_id_norm, "*.vcf.idx" into index_vcf_files_norm
file "*_samtools_SNP_report.txt" into samtools_SNP_report_norm file "*_samtools_SNP_report.txt" into samtools_SNP_report_norm
script: script:
...@@ -386,10 +384,56 @@ process samtools_SNP_norm { ...@@ -386,10 +384,56 @@ process samtools_SNP_norm {
samtools mpileup -AE -uf ${fasta} ${bam_norm} | \ samtools mpileup -AE -uf ${fasta} ${bam_norm} | \
bcftools call -mv --output-type v > ${file_id_norm}_raw.vcf bcftools call -mv --output-type v > ${file_id_norm}_raw.vcf
bcftools filter -s LowQual -e '%QUAL<20 || DP>100' ${file_id_norm}_raw.vcf \ bcftools filter -s LowQual -e '%QUAL<20 || DP>100' ${file_id_norm}_raw.vcf \
> ${file_id_norm}_raw.vcf > ${file_id_norm}_filtered.vcf
""" """
} }
process vcf_to_csv_tumor {
tag "$file_id_tumor"
cpus 1
publishDir "results/SNP/vcf_samtools/", mode: 'copy'
input:
set file_id_tumor, file(vcf) from vcf_files_tumor
output:
set file_id_tumor, "*.csv" into csv_files_tumor
script:
"""
gatk VariantsToTable -V ${file_id_tumor}_raw.vcf \
-F CHROM -F POS -F TYPE -GF GT -GF AD -GF AF \
-O ${file_id_tumor}_raw.csv
gatk VariantsToTable -V ${file_id_tumor}_filtered.vcf \
-F CHROM -F POS -F TYPE -GF GT -GF AD -GF AF \
-O ${file_id_tumor}_filtered.csv
"""
}
process vcf_to_csv_norm {
tag "$file_id_norm"
cpus 1
publishDir "results/SNP/vcf_samtools/", mode: 'copy'
input:
set file_id_norm, file(vcf) from vcf_files_norm
output:
set file_id_norm, "*.csv" into csv_files_norm
script:
"""
gatk VariantsToTable -V ${file_id_norm}_raw.vcf \
-F CHROM -F POS -F TYPE -GF GT -GF AD -GF AF \
-O ${file_id_norm}_raw.csv
gatk VariantsToTable -V ${file_id_norm}_filtered.vcf \
-F CHROM -F POS -F TYPE -GF GT -GF AD -GF AF \
-O ${file_id_norm}_filtered.csv
"""
}
/*
process HaplotypeCaller { process HaplotypeCaller {
tag "$file_id_norm" tag "$file_id_norm"
cpus 10 cpus 10
...@@ -429,7 +473,6 @@ index_vcf_files.into{ ...@@ -429,7 +473,6 @@ index_vcf_files.into{
filter_index_vcf_files filter_index_vcf_files
} }
/*
process GetPileupSummaries { process GetPileupSummaries {
tag "$file_id_norm" tag "$file_id_norm"
cpus 1 cpus 1
...@@ -500,7 +543,6 @@ gatk CollectSequencingArtifactMetrics \ ...@@ -500,7 +543,6 @@ gatk CollectSequencingArtifactMetrics \
2> ${file_id_tumor}_artifact_report.txt 2> ${file_id_tumor}_artifact_report.txt
""" """
} }
*/
process filter_SNP { process filter_SNP {
tag "$file_id_norm" tag "$file_id_norm"
...@@ -532,4 +574,5 @@ gatk SelectVariants \ ...@@ -532,4 +574,5 @@ gatk SelectVariants \
2>> ${file_id_norm}_filter_report.txt 2>> ${file_id_norm}_filter_report.txt
""" """
} }
*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment