Skip to content

Commit

Permalink
modified: cre.R
Browse files Browse the repository at this point in the history
	modified:   cre.gemini2txt.sh
	modified:   cre.gemini_variant_impacts.sh
	modified:   cre.sh
	new file:   cre.vcfanno.sh
  • Loading branch information
naumenko-sa committed Aug 21, 2018
1 parent cd99ea8 commit 88a1f31
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cre.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ create_report = function(family,samples)
# Column 17 - Ensembl_gene_id

# Column 18 - Gene_description
gene_descriptions = read.delim2(paste0(default_tables_path,"/ensembl_w_description.txt"), stringsAsFactors=F)
gene_descriptions = read.delim2(paste0(default_tables_path,"/data/ensembl_w_description.txt"), stringsAsFactors=F)
variants = merge(variants,gene_descriptions,by.x = "Ensembl_gene_id",by.y = "ensembl_gene_id",all.x=T)

# Column 19 - Omim_gene_description - from omim text file
Expand Down Expand Up @@ -234,7 +234,7 @@ create_report = function(family,samples)
# Columns 30-35 - population frequencies

# Columns 36-37, Exac scores
exac_scores_file = paste0(default_tables_path,"/exac_scores.txt")
exac_scores_file = paste0(default_tables_path,"/data/exac_scores.txt")
exac_scores = read.delim(exac_scores_file, stringsAsFactors=F)
variants = merge(variants,exac_scores,all.x=T)

Expand All @@ -251,12 +251,12 @@ create_report = function(family,samples)


# Columns 44,45 - imprinting
imprinting_file_name = paste0(default_tables_path,"/imprinting.txt")
imprinting_file_name = paste0(default_tables_path,"/data/imprinting.txt")
imprinting = read.delim(imprinting_file_name, stringsAsFactors=F)
variants = merge(variants,imprinting,all.x=T)

# Column 46 - pseudoautosomal
pseudoautosomal_file_name = paste0(default_tables_path,"/pseudoautosomal.txt")
pseudoautosomal_file_name = paste0(default_tables_path,"/data/pseudoautosomal.txt")
pseudoautosomal = read.delim(pseudoautosomal_file_name, stringsAsFactors=F)
variants = merge(variants,pseudoautosomal,all.x=T)

Expand Down
2 changes: 1 addition & 1 deletion cre.gemini2txt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ sQuery=$sQuery"v.vep_hgvsc as Nucleotide_change_ensembl,
where
v.transcript=g.transcript and
(v.gene=g.gene or g.gene is NULL) "$severity_filter" and
v.max_aaf_all < 0.01 and
v.max_aaf_all <= "$max_af" and
(v.depth >= "$depth_threshold" or v.depth = '' or v.depth is null)"

echo $sQuery
Expand Down
2 changes: 1 addition & 1 deletion cre.gemini_variant_impacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fi

sQuery=$sQuery" from variants v,
variant_impacts i
where "$severity_filter"v.max_aaf_all < 0.01 and
where "$severity_filter"v.max_aaf_all <= "$max_af" and
v.variant_id=i.variant_id and
(v.depth>="$depth_threshold" or v.depth='' or v.depth is null)"

Expand Down
13 changes: 10 additions & 3 deletions cre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# cleanup= [0|1] default = 0
# make_report=[0|1] default = 1
# type = [ wes.regular (default) | wes.synonymous | wes.fast | rnaseq | wgs | vcf2db (new wes/wgs report with gemini loaded by vcf2db)]
# max_af = af filter, default = 0.01
####################################################################################################

#PBS -l walltime=20:00:00,nodes=1:ppn=1
Expand Down Expand Up @@ -109,8 +110,8 @@ function f_make_report
cre.gemini2txt.vcf2db.sh ${family}-ensemble.db $depth_threshold $severity_filter > $family.variants.txt
cre.gemini.variant_impacts.vcf2db.sh ${family}-ensemble.db $depth_threshold $severity_filter > $family.variant_impacts.txt
else
cre.gemini2txt.sh ${family}-ensemble.db $depth_threshold $severity_filter
cre.gemini_variant_impacts.sh ${family}-ensemble.db $depth_threshold $severity_filter
cre.gemini2txt.sh ${family}-ensemble.db $depth_threshold $severity_filter $max_af
cre.gemini_variant_impacts.sh ${family}-ensemble.db $depth_threshold $severity_filter $maf_af
fi

for f in *.vcf.gz;
Expand All @@ -125,7 +126,7 @@ function f_make_report
then
cat $family.variants.txt | cut -f 26,27 | sed 1d | sed s/chr// | sort -k1,1 -k2,2n > ${family}-ensemble.db.txt.positions
else
cat ${family}-ensemble.db.txt | cut -f 23,24 | sed 1d | sed s/chr// | sort -k1,1 -k2,2n > ${family}-ensemble.db.txt.positions
cat ${family}-ensemble.db.txt | cut -f 24,25 | sed 1d | sed s/chr// | sort -k1,1 -k2,2n > ${family}-ensemble.db.txt.positions
fi

# this may produce duplicate records if two positions from positions file overlap with a variant
Expand Down Expand Up @@ -221,6 +222,12 @@ then
make_report=1
fi

if [ -z $max_af ]
then
max_af=0.01
fi
export max_af

if [ $make_report -eq 1 ]
then
f_make_report
Expand Down
12 changes: 12 additions & 0 deletions cre.vcfanno.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

#PBS -l walltime=23:00:00,nodes=1:ppn=1
#PBS -joe .
#PBS -d .
#PBS -l vmem=10g,mem=10g

vcfanno -p 7 -lua /home/naumenko/cre/cre.vcfanno.lua \
-base-path /hpf/largeprojects/ccmbio/naumenko/tools/bcbio/gemini_data \
/home/naumenko/cre/cre.vcfanno.conf \
$vcf | sed -e 's/Number=A/Number=1/g' | bgzip -c > `echo $vcf | sed s/vcf/annotated.vcf/`

0 comments on commit 88a1f31

Please sign in to comment.