Skip to content
Snippets Groups Projects
Commit e2c6f213 authored by Amine  GHOZLANE's avatar Amine GHOZLANE
Browse files

Grab the bam

parent 1ee9d452
No related branches found
No related tags found
No related merge requests found
...@@ -142,12 +142,13 @@ process extract_snp { ...@@ -142,12 +142,13 @@ process extract_snp {
output: output:
file("*_snp*.tsv") into snpChannel file("*_snp*.tsv") into snpChannel
file("*_mpileup.vcf.gz") into vcfChannel file("*_mpileup.vcf.gz") into vcfChannel
file("*_nodup.bam"
script: script:
""" """
picard MarkDuplicates -I align_sorted.bam -O ${read_id}.bam -M marked_dup_metrics.txt --REMOVE_DUPLICATES true picard MarkDuplicates -I align_sorted.bam -O ${read_id}_nodup.bam -M marked_dup_metrics.txt --REMOVE_DUPLICATES true
picard BuildBamIndex -I ${read_id}.bam picard BuildBamIndex -I ${read_id}_nodup.bam
bcftools mpileup --skip-indels -d 10000 -f /local/databases/index/gatk/hg19/2.4-9/hg19.fa ${read_id}.bam -Oz -o ${read_id}_mpileup.vcf.gz bcftools mpileup --skip-indels -d 10000 -f ${params.human_genome_gatk} ${read_id}_nodup.bam -Oz -o ${read_id}_mpileup.vcf.gz
bcftools call --ploidy 1 -cv -Oz -p 1 -o ${read_id}_calls.vcf.gz ${read_id}_mpileup.vcf.gz bcftools call --ploidy 1 -cv -Oz -p 1 -o ${read_id}_calls.vcf.gz ${read_id}_mpileup.vcf.gz
bcftools filter -Oz -i 'MIN(DP)>5 && QUAL>10 &&CHROM="chrM"' -o ${read_id}_filt.vcf.gz ${read_id}_calls.vcf.gz bcftools filter -Oz -i 'MIN(DP)>5 && QUAL>10 &&CHROM="chrM"' -o ${read_id}_filt.vcf.gz ${read_id}_calls.vcf.gz
bcftools query -f '%CHROM %POS %REF %ALT %DP4\n' ${read_id}_filt.vcf.gz > ${read_id}_snp_bcf.tsv bcftools query -f '%CHROM %POS %REF %ALT %DP4\n' ${read_id}_filt.vcf.gz > ${read_id}_snp_bcf.tsv
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment