Skip to content

Commit

Permalink
modified: bcbio.prepare_families.sh
Browse files Browse the repository at this point in the history
	new file:   fixit.sh
	new file:   vcf.split_multi.sh
  • Loading branch information
naumenko-sa committed Jul 6, 2017
1 parent 3bd20bf commit a363f98
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bcbio.prepare_families.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# prepares a run of multiples families to run variant calling, one family may have several samples
# $1 - a file table.txt in the format
# sample_id family_id absolute_path_to_bam_file
# sample_id family_id absolute_path_to_bam_file, i.e.
# 531_IN0067 531 /hpf/largeprojects/ccm_dccforge/dccdipg/dccc4r/c4r_wes/bam_files/531_IN0067.bam
# creates one project per family
#
# run with
Expand Down
23 changes: 23 additions & 0 deletions fixit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

#$1 = family_id

cat samples.txt | awk -v fam=$1 '{print fam"_"$1}' > samples.txt.fixed
rm samples.txt
mv samples.txt.fixed samples.txt

for f in *ready.bam.bai;do mv $f `echo $f | sed s/"-ready"//`;done;
for f in *ready.bam;do mv $f `echo $f | sed s/"-ready"//`;done;
for f in *.bam;do mv $f `echo ${1}_${f}`;done;
for f in *.bam.bai;do mv $f `echo ${1}_${f}`;done;


for f in *.vcf.gz;do bcftools reheader -s samples.txt $f > $f.reheader;done;
rm *.vcf.gz
for f in *.reheader;do mv $f `echo $f | sed s/.reheader//`;done;
for f in *.vcf.gz; do tabix $f;done;

vcf.split_multi.sh $1.vcf.gz

# run gemini db gemini.vep2gemini.sh ${family}-ensemble-annotated-decomposed.vcf.gz
# rerun cre.sh
8 changes: 8 additions & 0 deletions vcf.split_multi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# $1 = family.vcf.gz

for sample in `cat samples.txt`;
do
bcftools view -c1 -Ov -s $sample -o $sample.vcf $1;
done;

0 comments on commit a363f98

Please sign in to comment.