Skip to content

Commit

Permalink
new file: cram2bam.sh
Browse files Browse the repository at this point in the history
	new file:   cram2fq.sh
	modified:   cre.bcbio.upgrade.sh
	new file:   cre.validation.sh
	new file:   cron_rsync_uploads.sh
	new file:   omim.inheritance.parse_orion.py
	modified:   omim.inheritance.py
  • Loading branch information
naumenko-sa committed Feb 21, 2018
1 parent 6d7d76b commit 85db22b
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 4 deletions.
10 changes: 10 additions & 0 deletions cram2bam.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

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

module load java

cramtools bam -I $cram -O $bam -b -R $ref
17 changes: 17 additions & 0 deletions cram2fq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

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

# reference should be decompressed and indexed: using one from bcbio
# usually crams come with hg19 reference (chr), not GRCh37


module load java

cramtools fastq -Xmx10g -F $sample --skip-md5-check \
-z \
-I $cram \
-R /hpf/largeprojects/ccmbio/naumenko/tools/bcbio/genomes/Hsapiens/hg19/seq/hg19.fa
4 changes: 2 additions & 2 deletions cre.bcbio.upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#upgrade code to stable version
#bcbio_nextgen.py upgrade -u stable
#upgrade code to development
#bcbio_nextgen.py upgrade -u development
bcbio_nextgen.py upgrade -u development

#upgrade tools
bcbio_nextgen.py upgrade -u skip --tools
#bcbio_nextgen.py upgrade -u skip --tools

#check tools
#bcbio_conda list | grep vep
Expand Down
13 changes: 13 additions & 0 deletions cre.validation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

export PATH=/hpf/largeprojects/ccmbio/naumenko/tools/bcbio/anaconda/bin:$PATH && export RTG_JAVA_OPTS='-Xms750m' && export RTG_MEM=10000m && rtg vcfeval --threads 1 \
-b /hpf/largeprojects/ccmbio/naumenko/tools/bcbio/genomes/Hsapiens/GRCh37/validation/giab-NA12878/truth_small_variants.vcf.gz \
--bed-regions /hpf/largeprojects/ccmbio/naumenko/validation/lynette/work/validate/NA12878-1/ensemble/NA12878-1-sort-callable_sample-NA12878-1-ensemble-wrm.bed \
-c $1 \
-t /hpf/largeprojects/ccmbio/naumenko/tools/bcbio/genomes/Hsapiens/GRCh37/rtg/GRCh37.sdf -o rtg --vcf-score-field='GQ'

for f in {tp,fp,fn};
do
echo snp $f `bcftools view --types snps rtg/$f.vcf.gz | grep -vc "^#"` >> $1.stat
echo indels $f `bcftools view --exclude-types snps rtg/$f.vcf.gz | grep -vc "^#"` >> $1.stat
done
15 changes: 15 additions & 0 deletions cron_rsync_uploads.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# push files from the uploader to hpf
# ssh cron1

echo "$(date)"

magic_path=/hpf/tools/centos6/python/2.7.11

export PATH=$magic_path/bin:$PATH
export LD_LIBRARY_PATH=$magic_path/lib/:$LD_LIBRARY_PATH
export PYTHONPATH=$magic_path:$PYTHONPATH
export LD_LIBRARY_PATH=$magic_path/usr/lib64/atlas:$LD_LIBRARY_PATH

python /hpf/largeprojects/ccm_dccforge/dccforge/cron/cron_rsync_uploads.py
51 changes: 51 additions & 0 deletions omim.inheritance.parse_orion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/python

# extracts information about omim inheritance modes from https://www.cs.toronto.edu/~buske/cheo/

import re
from os.path import expanduser

home = expanduser('~')

inheritance = {}
inheritance['Autosomal recessive']='AR'
inheritance['Autosomal dominant'] = 'AD'
inheritance['X-linked recessive'] = 'XLR'
inheritance['X-linked dominant'] = 'XLD'
inheritance['Isolated cases'] = 'IC'
inheritance['Mitochondrial'] = 'Mi'
inheritance['X-linked'] = 'XL'
inheritance['Y-linked'] = 'YL'
inheritance['Digenic recessive'] = 'DR'
inheritance['Digenic dominant'] = 'DD'
inheritance['Multifactorial'] = 'Mu'
inheritance['Somatic mosaicism'] = 'Smo'
inheritance['Somatic mutation'] = 'Smu'

genes = {}

f1 = open(home+'/cre/ensembl_w_description.txt','r')
for line in f1:
ar = line.split('\t')
genes[ar[0]] = ar[1]
f1.close()

f = open('genemap2.txt','r')

print 'Ensembl_gene_id Gene_name2 Omim_inheritance'

for line in f:
#print line,
match = re.search(r'ENSG[0-9]{11}',line)
if match:
modes = []
#print 'found', match.group()
for key in inheritance.keys():
match1 = re.search(key,line)
if match1:
#print 'found inheritance', match1.group()
modes.append(inheritance[key])
if len(modes)>0:
print match.group(), genes.get(match.group()), ','.join(modes)

f.close()
7 changes: 5 additions & 2 deletions omim.inheritance.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@
genes[ar[0]] = ar[1]
f1.close()

f = open('genemap2.txt','r')
#save non empty lines
#gene inheritance
f = open('omim_by_orion.txt','r')

print 'Ensembl_gene_id Gene_name2 Omim_inheritance'

for line in f:
#print line,
ar = line.split('\t')

match = re.search(r'ENSG[0-9]{11}',line)
if match:
modes = []
Expand Down

0 comments on commit 85db22b

Please sign in to comment.