Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Denovo & recessif mutation selection with variant_tools
#!/bin/bash
pwd
MAMAN="maman.vcf.gz"
PAPA="pere.vcf.gz"
ENFANT="enfant.vcf.gz"
DP_MAX=50
EXAC_AF=0.001
# initialize vtools prj
vtools init myprj
# set vtools database path
vtools admin --set_runtime_option='local_resource=/BIG_SPACE/sschutz/vtools'
# Import trio files
vtools import $MAMAN --sample_name maman --var_info DP,AF --build hg19
vtools import $PAPA --sample_name papa --geno_info DP,AF --var_info DP,AF --build hg19
vtools import $ENFANT --sample_name enfant --geno_info DP,AF --var_info DP,AF --build hg19
# Remove low depth
vtools select variant "DP >= $DP_MAX" -t clean
# Create tables for each samples
vtools select clean --samples "sample_name =='maman'" -t maman
vtools select clean --samples "sample_name =='papa'" -t papa
vtools select clean --samples "sample_name =='enfant'" -t enfant
# Create denovo table
vtools compare --expression "denovo = enfant - maman - papa"
# Create common table with common variant
vtools compare --expression "common = enfant & papa & maman"
# Select recessif mutation . ( homozygote for child , hetero for parent )
vtools select common "genotype('enfant') == 2 and genotype('maman')!=2 and genotype('papa')!=2" -t hetero
# Annotation
vtools use refGene
vtools use dbNSFP
vtools use dbSNP
vtools select denovo "dbNSFP.ExAC_AF < 0.01" -o chr pos ref alt name2 MutationTaster_pred FATHMM_pred Polyphen2_HVAR_pred MetaSVM_pred MetaLR_pred "genotype()" > denovo_low_AF.tsv
vtools select hetero "dbNSFP.ExAC_AF < 0.01" -o chr pos ref alt name2 MutationTaster_pred FATHMM_pred Polyphen2_HVAR_pred MetaSVM_pred MetaLR_pred "genotype()" > hetero_low_AF.tsv
vtools select denovo "clinvar_clnsig is not NULL" -o chr pos ref alt name2 MutationTaster_pred FATHMM_pred Polyphen2_HVAR_pred MetaSVM_pred MetaLR_pred "genotype()" > denovo_clinvar.tsv
vtools select hetero "clinvar_clnsig is not NULL" -o chr pos ref alt name2 MutationTaster_pred FATHMM_pred Polyphen2_HVAR_pred MetaSVM_pred MetaLR_pred "genotype()" > hetero_clinvar.tsv
vtools select denovo "MutationTaster_pred=='D' and FATHMM_pred=='D'" -o chr pos ref alt name2 MutationTaster_pred FATHMM_pred Polyphen2_HVAR_pred MetaSVM_pred MetaLR_pred "genotype()">denovo_D.tsv
vtools select hetero "MutationTaster_pred=='D' and FATHMM_pred=='D'" -o chr pos ref alt name2 MutationTaster_pred FATHMM_pred Polyphen2_HVAR_pred MetaSVM_pred MetaLR_pred "genotype()">hetero_D.tsv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.