Last active
December 31, 2015 21:39
-
-
Save arq5x/8047751 to your computer and use it in GitHub Desktop.
Ovarian cancer chemoresistance.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export SAMPLES="2484-AJ-0001 2484-AJ-0002 2484-AJ-0003" | |
###################################### | |
# Make FASTQ | |
###################################### | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-cell-lines | |
export STEPNAME=ovc-fastq | |
for sample in `echo $SAMPLES` | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=8000m:ncpus=1 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; ~/shared/bin/bamUtil_1.0.9/bamUtil/bin/bam bam2FastQ --in bam/$sample.bam \ | |
--outBase fastq/$sample" | $QSUB; | |
done | |
###################################### | |
# GZIP FASTQ | |
###################################### | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-cell-lines | |
export STEPNAME=ovc-fastq | |
for sample in `echo $SAMPLES` | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=1000m:ncpus=1 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; gzip fastq/${sample}_1.fastq" | $QSUB; | |
echo "cd $OVHOME; gzip fastq/${sample}_2.fastq" | $QSUB; | |
done | |
############################################################ | |
# BWA MEM | |
############################################################ | |
export GENOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes/fasta/human_g1k_v37.fasta | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-cell-lines | |
export STEPNAME=ovc-bwamem | |
for sample in `echo $SAMPLES`; | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=8000m:ncpus=8 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; bwa mem $GENOME fastq/${sample}_1.fastq.gz fastq/${sample}_2.fastq.gz -t 7 -M -R $'@RG\tID:$sample\tSM:$sample' | samtools view -Sb - > bam/$sample.bwamem.bam" | $QSUB | |
done | |
############################################################ | |
# SORT | |
############################################################ | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-cell-lines | |
export STEPNAME=ov-sort | |
for sample in `echo $SAMPLES`; | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=24000m:ncpus=8 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; samtools sort -@ 4 -m 2G bam/$sample.bwamem.bam bam/$sample.bwamem.sort" | $QSUB | |
done | |
############################################################ | |
# MARK DUPLICATES | |
############################################################ | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-cell-lines | |
export STEPNAME=ov-dedup | |
export BIN=/home/arq5x/cphg-home/shared/bin/picard-tools-1.72/ | |
for sample in `echo $SAMPLES`; | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=8000m:ncpus=6 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; java -Xmx2g -jar $BIN/MarkDuplicates.jar \ | |
INPUT=bam/$sample.bwamem.sort.bam \ | |
OUTPUT=bam/$sample.bwamem.sort.dedup.bam \ | |
TMP_DIR=$OVHOME/bam \ | |
VALIDATION_STRINGENCY=LENIENT \ | |
ASSUME_SORTED=true \ | |
METRICS_FILE=bam/$sample.markdup_metrics" | $QSUB; | |
done | |
############################################################ | |
# FREEBAYES | |
############################################################ | |
export GENOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes/fasta/human_g1k_v37.fasta | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-cell-lines | |
export STEPNAME=ov-freeb | |
for chrom in {1..22} X Y | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=24000m:ncpus=1 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; freebayes-9.9.2 -f $GENOME \ | |
--region $chrom \ | |
--pooled-discrete \ | |
--pooled-continuous \ | |
--min-alternate-fraction 0.05 \ | |
--genotype-qualities \ | |
--report-genotype-likelihood-max \ | |
bam/2484-AJ-0001.bwamem.sort.dedup.bam \ | |
bam/2484-AJ-0002.bwamem.sort.dedup.bam \ | |
bam/2484-AJ-0003.bwamem.sort.dedup.bam \ | |
> varcalling/freebayes.$chrom.minaaf.5pct.vcf" | $QSUB | |
done | |
############################################################ | |
# Combine files and remove poor quality variants. | |
############################################################ | |
(cat freebayes.1.minaaf.5pct.vcf; cat freebayes*.minaaf.5pct.vcf | grep -v ^# | awk '$1 != "1"') \ | |
| vcffilter -f 'QUAL > 1' -f 'DP > 20' -f 'AO > 2' > freebayes.all.minaaf.5pct.filtered.vcf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################ | |
# counts in windows | |
############################################################ | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes | |
export STEPNAME=ov-idx | |
cd $OVHOME; | |
for sample in `ls bam/*.bwamem.sort.dedup.bam`; | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=4000m:ncpus=1 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; bedtools intersect -c -sorted -a doc/hg19.500K.windows.gatk.bed -b $sample -g doc/hg19.chrom.order > $sample.500k.bedg" | $QSUB | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setwd("/Users/arq5x/Documents/Projects/QuinlanLab/Collaboration/Jazaeri-OV-Exome/OV-Exome/clonal-evolution") | |
som <- read.table('somatics.depth.20.nonormals.txt') | |
# compute the tumor and resistant allele freqs | |
som$tum_freq <- som[,17] / (som[,17] + som[,14]) | |
som$res_freq <- som[,18] / (som[,18] + som[,15]) | |
# 4x4 plotting grid | |
par(mfrow=c(4,4)) | |
# plot each sample on the grid | |
for (sample in unique(sort(som[,1]))) { # extract the unique sample ids in sorted order | |
sample_rows <- som[,1]==sample | |
subset <- som[sample_rows,] | |
plot(subset$tum_freq, subset$res_freq, | |
main=sample, xlim=c(0,1.0), ylim=c(0,1.0), | |
xlab="Tumor Freq.", ylab="Resistant Freq.") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zcat normals/H7G5DADXX_s1_1_GSLv2-7_74_SL58275.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_74_SL58275.fastq.gz | gzip > s02-N-2379-AJ-0030_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_74_SL58275.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_74_SL58275.fastq.gz | gzip > s02-N-2379-AJ-0030_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_75_SL58276.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_75_SL58276.fastq.gz | gzip > s03-N-2379-AJ-0031_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_75_SL58276.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_75_SL58276.fastq.gz | gzip > s03-N-2379-AJ-0031_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_76_SL58277.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_76_SL58277.fastq.gz | gzip > s04-N-2379-AJ-0032_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_76_SL58277.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_76_SL58277.fastq.gz | gzip > s04-N-2379-AJ-0032_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_77_SL58278.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_77_SL58278.fastq.gz | gzip > s09-N-2379-AJ-0033_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_77_SL58278.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_77_SL58278.fastq.gz | gzip > s09-N-2379-AJ-0033_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_78_SL58279.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_78_SL58279.fastq.gz | gzip > s10-N-2379-AJ-0034_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_78_SL58279.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_78_SL58279.fastq.gz | gzip > s10-N-2379-AJ-0034_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_79_SL58280.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_79_SL58280.fastq.gz | gzip > s11-N-2379-AJ-0035_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_79_SL58280.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_79_SL58280.fastq.gz | gzip > s11-N-2379-AJ-0035_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_80_SL58281.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_80_SL58281.fastq.gz | gzip > s12-N-2379-AJ-0036_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_80_SL58281.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_80_SL58281.fastq.gz | gzip > s12-N-2379-AJ-0036_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_81_SL58282.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_81_SL58282.fastq.gz | gzip > s15-N-2379-AJ-0037_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_81_SL58282.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_81_SL58282.fastq.gz | gzip > s15-N-2379-AJ-0037_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_82_SL58283.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_82_SL58283.fastq.gz | gzip > s17-N-2379-AJ-0038_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_82_SL58283.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_82_SL58283.fastq.gz | gzip > s17-N-2379-AJ-0038_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_83_SL58284.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_83_SL58284.fastq.gz | gzip > s18-N-2379-AJ-0039_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_83_SL58284.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_83_SL58284.fastq.gz | gzip > s18-N-2379-AJ-0039_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_84_SL58285.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_84_SL58285.fastq.gz | gzip > s19-N-2379-AJ-0040_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_84_SL58285.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_84_SL58285.fastq.gz | gzip > s19-N-2379-AJ-0040_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_95_SL58286.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_95_SL58286.fastq.gz | gzip > s20-N-2379-AJ-0041_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_95_SL58286.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_95_SL58286.fastq.gz | gzip > s20-N-2379-AJ-0041_2.fastq.gz & | |
zcat normals/H7G5DADXX_s1_1_GSLv2-7_96_SL58287.fastq.gz normals/H7G5DADXX_s2_1_GSLv2-7_96_SL58287.fastq.gz | gzip > s21-N-2379-AJ-0042_1.fastq.gz & | |
zcat normals/H7G5DADXX_s1_2_GSLv2-7_96_SL58287.fastq.gz normals/H7G5DADXX_s2_2_GSLv2-7_96_SL58287.fastq.gz | gzip > s21-N-2379-AJ-0042_2.fastq.gz & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################ | |
# counts in windows | |
############################################################ | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes | |
export STEPNAME=ov-probecov | |
cd $OVHOME; | |
for sample in `ls bam/*.bwamem.sort.dedup.bam`; | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=8000m:ncpus=1 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; bedtools coverage -hist -abam $sample -b bed/SeqCap_EZ_Exome_v3_primary.numeric.bed3 | grep ^all > $sample.probe.cov.hist" | $QSUB | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export ALLSAMPLES="s02-R-2379-AJ-0002 \ | |
s02-T-2379-AJ-0001 \ | |
s03-R-2379-AJ-0004 \ | |
s03-T-2379-AJ-0003 \ | |
s04-R-2379-AJ-0006 \ | |
s04-T-2379-AJ-0005 \ | |
s05-N-2379-AJ-0007 \ | |
s05-R-2379-AJ-0009 \ | |
s05-T-2379-AJ-0008 \ | |
s09-R-2379-AJ-0011 \ | |
s09-T-2379-AJ-0010 \ | |
s10-R-2379-AJ-0013 \ | |
s10-T-2379-AJ-0012 \ | |
s11-R-2379-AJ-0015 \ | |
s11-T-2379-AJ-0014 \ | |
s12-R-2379-AJ-0017 \ | |
s12-T-2379-AJ-0016 \ | |
s15-R-2379-AJ-0019 \ | |
s15-T-2379-AJ-0018 \ | |
s17-R-2379-AJ-0021 \ | |
s17-T-2379-AJ-0020 \ | |
s18-R-2379-AJ-0023 \ | |
s18-T-2379-AJ-0022 \ | |
s19-R-2379-AJ-0025 \ | |
s19-T-2379-AJ-0024 \ | |
s20-R-2379-AJ-0027 \ | |
s20-T-2379-AJ-0026 \ | |
s21-R-2379-AJ-0029 \ | |
s21-T-2379-AJ-0028" | |
export SAMPLESOLD="s02-R-2379-AJ-0002 \ | |
s02-T-2379-AJ-0001 \ | |
s03-T-2379-AJ-0003 \ | |
s04-R-2379-AJ-0006 \ | |
s04-T-2379-AJ-0005 \ | |
s05-N-2379-AJ-0007 \ | |
s05-R-2379-AJ-0009 \ | |
s05-T-2379-AJ-0008 \ | |
s09-R-2379-AJ-0011 \ | |
s10-R-2379-AJ-0013 \ | |
s10-T-2379-AJ-0012 \ | |
s11-R-2379-AJ-0015 \ | |
s11-T-2379-AJ-0014 \ | |
s12-R-2379-AJ-0017 \ | |
s12-T-2379-AJ-0016 \ | |
s15-R-2379-AJ-0019 \ | |
s15-T-2379-AJ-0018 \ | |
s17-R-2379-AJ-0021 \ | |
s17-T-2379-AJ-0020 \ | |
s18-R-2379-AJ-0023 \ | |
s18-T-2379-AJ-0022 \ | |
s19-R-2379-AJ-0025 \ | |
s19-T-2379-AJ-0024 \ | |
s20-R-2379-AJ-0027 \ | |
s20-T-2379-AJ-0026 \ | |
s21-R-2379-AJ-0029 \ | |
s21-T-2379-AJ-0028" | |
#export SAMPLES="s03-R-2379-AJ-0004 s09-T-2379-AJ-0010" | |
export SAMPLES="s02-N-2379-AJ-0030 \ | |
s03-N-2379-AJ-0031 \ | |
s04-N-2379-AJ-0032 \ | |
s09-N-2379-AJ-0033 \ | |
s10-N-2379-AJ-0034 \ | |
s11-N-2379-AJ-0035 \ | |
s12-N-2379-AJ-0036 \ | |
s15-N-2379-AJ-0037 \ | |
s17-N-2379-AJ-0038 \ | |
s18-N-2379-AJ-0039 \ | |
s19-N-2379-AJ-0040 \ | |
s20-N-2379-AJ-0041 \ | |
s21-N-2379-AJ-0042" | |
###################################### | |
# Sort the original BAM files by name: | |
###################################### | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes | |
export STEPNAME=ov-nmsrt | |
for sample in `echo $SAMPLES` | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=16000m:ncpus=8 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; samtools sort -n -@ 8 -m 1000000000 bam/$sample.bam bam/$sample.namesorted" | $QSUB | |
done | |
###################################### | |
# Make FASTQ | |
###################################### | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes | |
export STEPNAME=ov-fastq | |
for sample in `echo $SAMPLES` | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=8000m:ncpus=1 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; ~/shared/bin/bamUtil_1.0.9/bamUtil/bin/bam bam2FastQ --in bam/$sample.bam \ | |
--outBase fastq/$sample" | $QSUB; | |
done | |
###################################### | |
# GZIP FASTQ | |
###################################### | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes | |
export STEPNAME=ov-fastq | |
for sample in `echo $SAMPLES` | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=1000m:ncpus=1 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; gzip fastq/${sample}_1.fastq" | $QSUB; | |
echo "cd $OVHOME; gzip fastq/${sample}_2.fastq" | $QSUB; | |
done | |
############################################################ | |
# BWA MEM | |
############################################################ | |
export GENOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes/fasta/human_g1k_v37.fasta | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes | |
export STEPNAME=ov-bwamem | |
for sample in `echo $SAMPLES`; | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=8000m:ncpus=8 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; bwa mem $GENOME fastq/${sample}_1.fastq.gz fastq/${sample}_2.fastq.gz -t 7 -M -R $'@RG\tID:$sample\tSM:$sample' | samtools view -Sb - > bam/$sample.bwamem.bam" | $QSUB | |
done | |
############################################################ | |
# SORT | |
############################################################ | |
export GENOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes/fasta/human_g1k_v37.fasta | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes | |
export STEPNAME=ov-sort | |
for sample in `echo $SAMPLES`; | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=24000m:ncpus=8 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; samtools sort -@ 4 -m 2G bam/$sample.bwamem.bam bam/$sample.bwamem.sort" | $QSUB | |
done | |
############################################################ | |
# MARK DUPLICATES | |
############################################################ | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes | |
export STEPNAME=ov-dedup | |
export BIN=/home/arq5x/cphg-home/shared/bin/picard-tools-1.72/ | |
for sample in `echo $SAMPLES`; | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=8000m:ncpus=6 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; java -Xmx2g -jar $BIN/MarkDuplicates.jar \ | |
INPUT=bam/$sample.bwamem.sort.bam \ | |
OUTPUT=bam/$sample.bwamem.sort.dedup.bam \ | |
TMP_DIR=$OVHOME/bam \ | |
VALIDATION_STRINGENCY=LENIENT \ | |
ASSUME_SORTED=true \ | |
METRICS_FILE=bam/$sample.markdup_metrics" | $QSUB; | |
done | |
############################################################ | |
# INDEX | |
############################################################ | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes | |
export STEPNAME=ov-idx | |
for sample in `echo $SAMPLES`; | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=1000m:ncpus=1 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; samtools index bam/$sample.bwamem.sort.dedup.bam" | $QSUB | |
done | |
############################################################ | |
# FREEBAYES | |
############################################################ | |
export GENOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes/fasta/human_g1k_v37.fasta | |
export OVHOME=/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes | |
export STEPNAME=ov-freeb | |
for chrom in {1..22} X Y | |
do | |
export QSUB="qsub -W group_list=cphg_arq5x -q arq5xlab -V -l select=1:mem=24000m:ncpus=1 -N $STEPNAME -m bea -M [email protected]"; | |
echo "cd $OVHOME; freebayes-9.9.2 -f $GENOME \ | |
--region $chrom \ | |
--pooled-discrete \ | |
--pooled-continuous \ | |
--min-alternate-fraction 0.05 \ | |
--genotype-qualities \ | |
--report-genotype-likelihood-max \ | |
bam/s02-N-2379-AJ-0030.bwamem.sort.dedup.bam \ | |
bam/s02-T-2379-AJ-0001.bwamem.sort.dedup.bam \ | |
bam/s02-R-2379-AJ-0002.bwamem.sort.dedup.bam \ | |
bam/s03-N-2379-AJ-0031.bwamem.sort.dedup.bam \ | |
bam/s03-T-2379-AJ-0003.bwamem.sort.dedup.bam \ | |
bam/s03-R-2379-AJ-0004.bwamem.sort.dedup.bam \ | |
bam/s04-N-2379-AJ-0032.bwamem.sort.dedup.bam \ | |
bam/s04-T-2379-AJ-0005.bwamem.sort.dedup.bam \ | |
bam/s04-R-2379-AJ-0006.bwamem.sort.dedup.bam \ | |
bam/s05-N-2379-AJ-0007.bwamem.sort.dedup.bam \ | |
bam/s05-T-2379-AJ-0008.bwamem.sort.dedup.bam \ | |
bam/s05-R-2379-AJ-0009.bwamem.sort.dedup.bam \ | |
bam/s09-N-2379-AJ-0033.bwamem.sort.dedup.bam \ | |
bam/s09-T-2379-AJ-0010.bwamem.sort.dedup.bam \ | |
bam/s09-R-2379-AJ-0011.bwamem.sort.dedup.bam \ | |
bam/s10-N-2379-AJ-0034.bwamem.sort.dedup.bam \ | |
bam/s10-T-2379-AJ-0012.bwamem.sort.dedup.bam \ | |
bam/s10-R-2379-AJ-0013.bwamem.sort.dedup.bam \ | |
bam/s11-N-2379-AJ-0035.bwamem.sort.dedup.bam \ | |
bam/s11-T-2379-AJ-0014.bwamem.sort.dedup.bam \ | |
bam/s11-R-2379-AJ-0015.bwamem.sort.dedup.bam \ | |
bam/s12-N-2379-AJ-0036.bwamem.sort.dedup.bam \ | |
bam/s12-T-2379-AJ-0016.bwamem.sort.dedup.bam \ | |
bam/s12-R-2379-AJ-0017.bwamem.sort.dedup.bam \ | |
bam/s15-N-2379-AJ-0037.bwamem.sort.dedup.bam \ | |
bam/s15-T-2379-AJ-0018.bwamem.sort.dedup.bam \ | |
bam/s15-R-2379-AJ-0019.bwamem.sort.dedup.bam \ | |
bam/s17-N-2379-AJ-0038.bwamem.sort.dedup.bam \ | |
bam/s17-T-2379-AJ-0020.bwamem.sort.dedup.bam \ | |
bam/s17-R-2379-AJ-0021.bwamem.sort.dedup.bam \ | |
bam/s18-N-2379-AJ-0039.bwamem.sort.dedup.bam \ | |
bam/s18-T-2379-AJ-0022.bwamem.sort.dedup.bam \ | |
bam/s18-R-2379-AJ-0023.bwamem.sort.dedup.bam \ | |
bam/s19-N-2379-AJ-0040.bwamem.sort.dedup.bam \ | |
bam/s19-T-2379-AJ-0024.bwamem.sort.dedup.bam \ | |
bam/s19-R-2379-AJ-0025.bwamem.sort.dedup.bam \ | |
bam/s20-N-2379-AJ-0041.bwamem.sort.dedup.bam \ | |
bam/s20-T-2379-AJ-0026.bwamem.sort.dedup.bam \ | |
bam/s20-R-2379-AJ-0027.bwamem.sort.dedup.bam \ | |
bam/s21-N-2379-AJ-0042.bwamem.sort.dedup.bam \ | |
bam/s21-T-2379-AJ-0028.bwamem.sort.dedup.bam \ | |
bam/s21-R-2379-AJ-0029.bwamem.sort.dedup.bam \ | |
> varcalling/freebayes.$chrom.minaaf.5pct.vcf" | $QSUB | |
done | |
############################################################ | |
# Combine files and remove poor quality variants. | |
############################################################ | |
(cat freebayes.1.minaaf.5pct.vcf; cat freebayes*.minaaf.5pct.vcf | grep -v ^# | awk '$1 != "1"') \ | |
| vcffilter -f 'QUAL > 1' -f 'DP > 200' -f 'AO > 2' > freebayes.all.minaaf.5pct.filtered.vcf | |
java -Xmx4g -jar snpEff.jar eff -v GRCh37.69 /home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes/varcalling/freebayes.all.minaaf.10pct.vcf >/home/arq5x/cphg-home/cphg-quinlan/projects/ov-chemoresistant-exomes/varcalling/freebayes.all.minaaf.10pct.snpEff.vcf | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment