Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tasks/phasingUKB/step1_array/step6_run_repbwt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

for CHR in {1..22}; do
VCF=/mnt/project/data/SNParray_hg19_phased_shapeit4/UKB.chr${CHR}.snps_QC_filter.phased_shapeit4.bcf
OUT=UKB.chr${CHR}.snps_QC_filter.phased_shapeit4.indices.repbwt
TIM=UKB.chr${CHR}.snps_QC_filter.phased_shapeit4.indices.repbwt.time
dx run app-swiss-army-knife --folder "/data/SNParray_hg19_phased_shapeit4/repbwt_indices/" -iimage_file="/docker/repbwt_abe107e_20230119.tar.gz" -icmd="/usr/bin/time -vo $TIM repbwt -i ${VCF} -s ${OUT}" --instance-type mem3_ssd1_v2_x8 --priority normal --name repbwt_chr${CHR} -y
done

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#DATA LOADING
library(RColorBrewer)
COLdiff = brewer.pal(8,"Set1")

CONFMall = read.csv("methods_coding.csv", stringsAsFactors=FALSE)

mets= c("BEAGLE_v5.4","SHAPEIT_v5.0.0")
refs = c("149,119 WGS samples")

list_legend=""
list_colours=""
j=1

pdf(paste("Fig_r2_snp_array.pdf", sep=""), 6, 6, bg="white")
is_new=FALSE
par(fig=c(0,1,0,1), new=is_new, mar=c(5,5,4,2)+0.1)
plot(1,1,type="n", xlim=c(0.0005,50), ylim=c(0.0,1), ylab=expression(paste("Aggregate ", italic("r"),""^"2"*"")), xlab="British Population Minor Allele Frequency (%)", log="x", xaxt='n', las=1)
mtext(paste0("Target: 1000 samples | Reference:", refs[j]), side=3, line=0)
axis(1, at=c(0.0001, 0.001, 0.01, 0.1, 1, 10, 50), label=c("0.0001", "0.001","0.01", "0.1", "1", "10", "50"), main=paste0("Imputation performance"))
abline(v=c(0.0001,0.0002,0.0005,0.001,0.002,0.005,0.01,0.02,0.05,0.1,0.2,0.5,1,2,5,10,20,50), col="lightgrey", lty=3)
abline(h=seq(0,1,0.05), col="lightgrey", lty=3)
x0=0



listN<-c()
listC<-c()
#for (i in seq(1, 2, by=1))
#{
SUBmetP <- paste(mets,"_1k",sep="")
CONFmetP = CONFMall[which(CONFMall$Prefix %in% SUBmetP),]
for (r in 1:nrow(CONFmetP))
{
file=paste("data/imputed_1k_rp_",CONFmetP$Met1[r],"_chr20.rsquare.grp.txt.gz", sep="")
print(file)
if(!file.exists(file))
{
next
}
D = read.table(file, head=FALSE, stringsAsFactors=FALSE)
points(D$V3*100, D$V5, type="o", pch=20, col=COLdiff[r], lwd=2)

}
listN<-c(listN, paste0(CONFmetP$Met, "-phased reference panel"))
listC<-c(listC, COLdiff[1:3])
#}
print(listN)
print(listC)
legend("bottomright", legend=listN, fill=listC, bg="white",cex = 0.8)

dev.off()
#}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

for FILE in $(find . -name "*.pdf"); do
convert -quality 100 -density 100 $FILE $(dirname $FILE)/$(basename $FILE .pdf)\.png
done
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Prefix,Cov,ImpFolder,NameRef,NameRef2,NameTar,Met,Met1,Vtype,Chr,Label,Version,Hex,Hex2,lty,ch
BEAGLE_v5.4_1k,UKB axiom array,imputation,UKB WGS - Beagle v5.4 phased,UK Biobank WGS (140k samples),100,BEAGLE v5.4,beagle5.4,all,20,-,v5.4,#d40025,#d40025,1,20
SHAPEIT_v5.0.0_1k,UKB axiom array,imputation,UKB WGS - SHAPEIT v5.0.0 phased,UK Biobank WGS (140k samples),100,SHAPEIT v5.0.0,shapeit5,all,20,-,v5.0.0,#ff8095,#E69F00,1,20
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

#Setting 1
PATHB="Phasing/PhasingWGS/step3_runbeagle/N147754"
EXTB="vcf.gz"
METB="beagle5.4"

#Setting 2
PATHS="Phasing/PhasingWGS/step5_runshapeit_phase2/N147754"
EXTS="default.bcf"
METS="shapeit5"

for CHR in 20; do
#Setting 2PhasingWGS_Official_release/step2_phase_rare/concat_benchmark/
#JOBID0=$(dx run app-swiss-army-knife -iin="/Phasing/PhasingWGS/step8_imputation/support/1k_samples_wbi.txt" -icmd="bcftools view /mnt/project/PhasingWGS_Official_release/step3_phase_beagle/UKB_chr${CHR}.full.${METB}.vcf.gz -r chr${CHR} -S ^1k_samples_wbi.txt -Ou --threads 4 | bcftools filter -e 'AC==0 || AC==AN' -Oz -o UKB_chr${CHR}.rp.${METB}.vcf.gz --threads 4 && bcftools index -f UKB_chr${CHR}.rp.${METB}.vcf.gz --threads 4" --folder="/PhasingWGS_Official_release/step3_phase_beagle/reference_panels" --instance-type mem1_ssd1_v2_x4 --priority low --name subset_${METB}_chr${CHR} -y | tail -n1 | cut -d" " -f3)

#JOBID1=$(dx run app-swiss-army-knife -iin="/docker/bref3.22Jul22.46e.jar" -icmd="java -Xmx32G -jar bref3.22Jul22.46e.jar /mnt/project/PhasingWGS_Official_release/step3_phase_beagle/reference_panels/UKB_chr${CHR}.rp.${METB}.vcf.gz > UKB_chr${CHR}.rp.${METB}.bref3" --folder="/PhasingWGS_Official_release/step3_phase_beagle/reference_panels" --instance-type mem3_ssd1_v2_x4 --priority high --name bref_${METB}_chr${CHR} -y | tail -n1 | cut -d" " -f3) #--depends-on ${JOBID0}

#from vcf.gz to bref3
#JOBID2=$(dx run app-swiss-army-knife -iin="/docker/beagle.22Jul22.46e.jar" -icmd="java -Xmx32G -jar beagle.22Jul22.46e.jar gt=/mnt/project/Phasing/PhasingWGS/step8_imputation/target_snp_array/axiom_1k_c${CHR}_b0_v2.b38.vcf.gz map=/mnt/project/data/plink_maps/plink.prefix.chr${CHR}.GRCh38.map ref=/mnt/project/PhasingWGS_Official_release/step3_phase_beagle/reference_panels/UKB_chr${CHR}.rp.${METB}.bref3 out=imputed_1k_rp_${METB}_chr${CHR} nthreads=4 chrom=chr${CHR} impute=true gp=true && bcftools index -f imputed_1k_rp_${METB}_chr${CHR}.vcf.gz --threads 4" --folder="/PhasingWGS_Official_release/step3_phase_beagle/imputation" --instance-type mem3_ssd1_v2_x4 --priority low --name imp_rp_${METB}_chr${CHR} -y --depends-on ${JOBID1} | tail -n1 | cut -d" " -f3)

####################################

#Setting 2
JOBID0=$(dx run app-swiss-army-knife -iin="/Phasing/PhasingWGS/step8_imputation/support/1k_samples_wbi.txt" -icmd="bcftools view /mnt/project/PhasingWGS_Official_release/step2_phase_rare/concat_benchmark/chr${CHR}/UKB_chr${CHR}.full.${METS}_rare.bcf -r chr${CHR} -S ^1k_samples_wbi.txt -Ou --threads 4 | bcftools filter -e 'AC==0 || AC==AN' -Oz -o UKB_chr${CHR}.rp.${METS}.vcf.gz --threads 4 && bcftools index -f UKB_chr${CHR}.rp.${METS}.vcf.gz --threads 4" --folder="/PhasingWGS_Official_release/step2_phase_rare/reference_panels" --instance-type mem1_ssd1_v2_x4 --priority low --name subset_${METS}_chr${CHR} -y | tail -n1 | cut -d" " -f3)

JOBID1=$(dx run app-swiss-army-knife -iin="/docker/bref3.22Jul22.46e.jar" -icmd="java -Xmx32G -jar bref3.22Jul22.46e.jar /mnt/project/PhasingWGS_Official_release/step2_phase_rare/reference_panels/UKB_chr${CHR}.rp.${METS}.vcf.gz > UKB_chr${CHR}.rp.${METS}.bref3" --folder="/PhasingWGS_Official_release/step2_phase_rare/reference_panels" --instance-type mem3_ssd1_v2_x4 --depends-on ${JOBID0} --priority high --name bref_${METS}_chr${CHR} -y | tail -n1 | cut -d" " -f3) #--depends-on ${JOBID0}

#from vcf.gz to bref3
JOBID2=$(dx run app-swiss-army-knife -iin="/docker/beagle.22Jul22.46e.jar" -icmd="java -Xmx32G -jar beagle.22Jul22.46e.jar gt=/mnt/project/Phasing/PhasingWGS/step8_imputation/target_snp_array/axiom_1k_c${CHR}_b0_v2.b38.vcf.gz map=/mnt/project/data/plink_maps/plink.prefix.chr${CHR}.GRCh38.map ref=/mnt/project/PhasingWGS_Official_release/step2_phase_rare/reference_panels/UKB_chr${CHR}.rp.${METS}.bref3 out=imputed_1k_rp_${METS}_chr${CHR} nthreads=4 chrom=chr${CHR} impute=true gp=true && bcftools index -f imputed_1k_rp_${METS}_chr${CHR}.vcf.gz --threads 4" --folder="/PhasingWGS_Official_release/step2_phase_rare/imputation" --instance-type mem3_ssd1_v2_x4 --priority low --name imp_rp_${METS}_chr${CHR} -y --depends-on ${JOBID1} | tail -n1 | cut -d" " -f3)

done
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

METB="beagle5.4"
METS="shapeit5"

for CHR in 20; do
OFOLDER=/Phasing/PhasingWGS/step8_imputation/ligated
dx run app-swiss-army-knife -iimage_file="docker/shapeit_ligate_0.0.1.tar.gz" -icmd="ls -1v /mnt/project/Phasing/PhasingWGS/step8_imputation/imputation/${METB}/imputed_1k_rp_${METB}_chr${CHR}_*.vcf.gz > list.txt && shapeit_ligate_v0.0.1 --input list.txt --output imputed_1k_rp_${METB}_chr${CHR}.bcf --index --thread 2 && bcftools index -f imputed_1k_rp_${METB}_chr${CHR}.bcf --threads 2 && rm list.txt" --instance-type mem2_ssd1_v2_x2 --priority low --name ${METB}_lg_${CHR} --folder "${OFOLDER}" -y

OFOLDER=/Phasing/PhasingWGS/step8_imputation/ligated
dx run app-swiss-army-knife -iimage_file="docker/shapeit_ligate_0.0.1.tar.gz" -icmd="ls -1v /mnt/project/Phasing/PhasingWGS/step8_imputation/imputation/${METS}/imputed_1k_rp_${METS}_chr${CHR}_*.vcf.gz > list.txt && shapeit_ligate_v0.0.1 --input list.txt --output imputed_1k_rp_${METS}_chr${CHR}.bcf --index --thread 2 && bcftools index -f imputed_1k_rp_${METS}_chr${CHR}.bcf --threads 2 && rm list.txt" --instance-type mem2_ssd1_v2_x2 --priority low --name ${METS}_lg_${CHR} --folder "${OFOLDER}" -y
done

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

#FULL CHR
OFOLDER=/Phasing/PhasingWGS/step8_imputation/concordance_test/binning2

METB="beagle5.4"
METS="shapeit5"

########### OLD
#dx run app-swiss-army-knife -iimage_file="/docker/glimpse2_20220825_502047a.tar.gz" -icmd="echo \"chr20 /mnt/project/data/ukb_wgs/unphased/step1_wbic_noval/ukb23352_c20_qc_v1_wbic_no10kgreml_sites.bcf /mnt/project/data/ukb_wgs/phased_shapeit/panels/validation_greml/wgs_ukb23352_c20_qc_v1_all.bcf /mnt/project/Phasing/PhasingWGS/step8_imputation/ligated/imputed_1k_rp_${METB}_chr${CHR}.bcf\" > concordance.txt && GLIMPSE_concordance_v2.0.0 --gt-val --allele-counts --thread 2 --input concordance.txt --output imputed_1k_rp_${METB}_chr${CHR} && rm -f concordance.txt" --instance-type mem1_ssd1_v2_x2 --priority low --name ${METB}_conc_wgs --folder "${OFOLDER}" -y

#dx run app-swiss-army-knife -iimage_file="/docker/glimpse2_20220825_502047a.tar.gz" -icmd="echo \"chr20 /mnt/project/data/ukb_wgs/unphased/step1_wbic_noval/ukb23352_c20_qc_v1_wbic_no10kgreml_sites.bcf /mnt/project/data/ukb_wgs/phased_shapeit/panels/validation_greml/wgs_ukb23352_c20_qc_v1_all.bcf /mnt/project/Phasing/PhasingWGS/step8_imputation/ligated/imputed_1k_rp_${METS}_chr${CHR}.bcf\" > concordance.txt && GLIMPSE_concordance_v2.0.0 --gt-val --allele-counts --thread 2 --input concordance.txt --output imputed_1k_rp_${METS}_chr${CHR} && rm -f concordance.txt" --instance-type mem1_ssd1_v2_x2 --priority low --name ${METS}_conc_wgs --folder "${OFOLDER}" -y

#dx run app-swiss-army-knife -iimage_file="/docker/glimpse2_20221002_73decec-dirty.tar.gz" -icmd="echo \"chr20 /mnt/project/Phasing/PhasingWGS/step8_imputation/reference_panels/sites/rp_s1k_shapeit5_chr20.bcf /mnt/project/data/ukb_wgs/phased_shapeit/panels/validation_greml/wgs_ukb23352_c20_qc_v1_all.bcf /mnt/project/Phasing/PhasingWGS/step8_imputation/ligated/imputed_1k_rp_${METB}_chr${CHR}.bcf\" > concordance.txt && GLIMPSE_concordance_v2.0.0 --gt-val --allele-counts --thread 2 --input concordance.txt --output imputed_1k_rp_${METB}_chr${CHR}_rp_af && rm -f concordance.txt" --instance-type mem1_ssd1_v2_x2 --priority low --name ${METB}_conc_wgs --folder "${OFOLDER}" -y

#dx run app-swiss-army-knife -iimage_file="/docker/glimpse2_20221002_73decec-dirty.tar.gz" -icmd="echo \"chr20 /mnt/project/Phasing/PhasingWGS/step8_imputation/reference_panels/sites/rp_s1k_shapeit5_chr20.bcf /mnt/project/data/ukb_wgs/phased_shapeit/panels/validation_greml/wgs_ukb23352_c20_qc_v1_all.bcf /mnt/project/Phasing/PhasingWGS/step8_imputation/ligated/imputed_1k_rp_${METS}_chr${CHR}.bcf\" > concordance.txt && GLIMPSE_concordance_v2.0.0 --gt-val --allele-counts --thread 2 --input concordance.txt --output imputed_1k_rp_${METS}_chr${CHR}_rp_af && rm -f concordance.txt" --instance-type mem1_ssd1_v2_x2 --priority low --name ${METS}_conc_wgs --folder "/Phasing/PhasingWGS/step8_imputation/concordance_test/" -y

#dx run app-swiss-army-knife -iimage_file="/docker/glimpse2_20221005_73decec-dirty.tar.gz" -icmd="echo \"chr20 /mnt/project/data/ukb_wgs/unphased/step1_wbic_noval/ukb23352_c20_qc_v1_wbic_no10kgreml_sites.bcf /mnt/project/data/ukb_wgs/phased_shapeit/panels/validation_greml/wgs_ukb23352_c20_qc_v1_all.bcf /mnt/project/Phasing/PhasingWGS/step8_imputation/ligated/imputed_1k_rp_${METB}_chr${CHR}.bcf\" > concordance.txt && GLIMPSE_concordance_v2.0.0 --gt-val --ac-bins 1 5 10 20 50 100 200 500 1000 2000 5000 10000 20000 50000 100000 146754 --input concordance.txt --output imputed_1k_rp_${METB}_chr${CHR}_wbi_af_binning2 && rm -f concordance.txt" --instance-type mem1_ssd1_v2_x2 --priority low --name ${METB}_conc_wgs --folder "${OFOLDER}" -y

#dx run app-swiss-army-knife -iimage_file="/docker/glimpse2_20221005_73decec-dirty.tar.gz" -icmd="echo \"chr20 /mnt/project/data/ukb_wgs/unphased/step1_wbic_noval/ukb23352_c20_qc_v1_wbic_no10kgreml_sites.bcf /mnt/project/data/ukb_wgs/phased_shapeit/panels/validation_greml/wgs_ukb23352_c20_qc_v1_all.bcf /mnt/project/Phasing/PhasingWGS/step8_imputation/ligated/imputed_1k_rp_${METS}_chr${CHR}.bcf\" > concordance.txt && GLIMPSE_concordance_v2.0.0 --gt-val --ac-bins 1 5 10 20 50 100 200 500 1000 2000 5000 10000 20000 50000 100000 146754 --thread 2 --input concordance.txt --output imputed_1k_rp_${METS}_chr${CHR}_wbi_af_binning2 && rm -f concordance.txt" --instance-type mem1_ssd1_v2_x2 --priority low --name ${METS}_conc_wgs --folder "${OFOLDER}" -y


##########BINNING 2 RP - NEW, for the paper
#dx run app-swiss-army-knife -iimage_file="/docker/glimpse2_20221005_73decec-dirty.tar.gz" -icmd="echo \"chr20 /mnt/project/Phasing/PhasingWGS/step8_imputation/reference_panels/sites/rp_s1k_shapeit5_chr20.bcf /mnt/project/data/ukb_wgs/phased_shapeit/panels/validation_greml/wgs_ukb23352_c20_qc_v1_all.bcf /mnt/project/Phasing/PhasingWGS/step8_imputation/ligated/imputed_1k_rp_${METB}_chr${CHR}.bcf\" > concordance.txt && GLIMPSE_concordance_v2.0.0 --gt-val --ac-bins 1 5 10 20 50 100 200 500 1000 2000 5000 10000 20000 50000 100000 146754 --thread 2 --input concordance.txt --output imputed_1k_rp_${METB}_chr${CHR}_rp_af_binning2 && rm -f concordance.txt" --instance-type mem1_ssd1_v2_x2 --priority low --name ${METB}_conc_wgs --folder "${OFOLDER}" -y

#dx run app-swiss-army-knife -iimage_file="/docker/glimpse2_20221005_73decec-dirty.tar.gz" -icmd="echo \"chr20 /mnt/project/Phasing/PhasingWGS/step8_imputation/reference_panels/sites/rp_s1k_shapeit5_chr20.bcf /mnt/project/data/ukb_wgs/phased_shapeit/panels/validation_greml/wgs_ukb23352_c20_qc_v1_all.bcf /mnt/project/Phasing/PhasingWGS/step8_imputation/ligated/imputed_1k_rp_${METS}_chr${CHR}.bcf\" > concordance.txt && GLIMPSE_concordance_v2.0.0 --gt-val --ac-bins 1 5 10 20 50 100 200 500 1000 2000 5000 10000 20000 50000 100000 146754 --thread 2 --input concordance.txt --output imputed_1k_rp_${METS}_chr${CHR}_rp_af_binning2 && rm -f concordance.txt" --instance-type mem1_ssd1_v2_x2 --priority low --name ${METS}_conc_wgs --folder "${OFOLDER}" -y

#dx run app-swiss-army-knife -iimage_file="/docker/glimpse2_20221005_73decec-dirty.tar.gz" -icmd="echo \"chr20 /mnt/project/Phasing/PhasingWGS/step8_imputation/reference_panels/sites/rp_s1k_shapeit5_chr20.bcf /mnt/project/data/ukb_wgs/phased_shapeit/panels/validation_greml/wgs_ukb23352_c20_qc_v1_all.bcf /mnt/project/Phasing/PhasingWGS/step8_imputation/ligated/imputed_1k_rp_hrc_chr${CHR}.bcf\" > concordance.txt && GLIMPSE_concordance_v2.0.0 --gt-val --ac-bins 1 5 10 20 50 100 200 500 1000 2000 5000 10000 20000 50000 100000 146754 --thread 2 --input concordance.txt --output imputed_1k_rp_hrc_chr${CHR}_rp_af_binning2 && rm -f concordance.txt" --instance-type mem1_ssd1_v2_x2 --priority low --name hrc_conc_wgs --folder "${OFOLDER}" -y


JOBID2=$(dx run app-swiss-army-knife -iimage_file="/docker/glimpse_v2.0.0-27-g0919952_20221207.tar.gz" -icmd="echo \"chr20 /mnt/project/Phasing/PhasingWGS/step8_imputation/reference_panels/sites/chr20/rp_ukb23352_c20_qc_v1_all_sites.bcf /mnt/project/data/ukb_wgs/phased_shapeit/panels/validation_greml/wgs_ukb23352_c20_qc_v1_all.bcf /mnt/project/PhasingWGS_Official_release/step2_phase_rare/imputation/imputed_1k_rp_shapeit5_chr20.vcf.gz\" > concordance.txt && GLIMPSE2_concordance --gt-val --ac-bins 1 5 10 20 50 100 200 500 1000 2000 5000 10000 20000 50000 100000 149754 --thread 4 --input concordance.txt --output imputed_1k_rp_shapeit5_chr20 && rm -f concordance.txt" --instance-type mem2_ssd1_v2_x4 --priority low --name cnc_rp_shapeit5 --folder "/PhasingWGS_Official_release/step2_phase_rare/concordance/" -y | tail -n1 | cut -d" " -f3)


JOBID2=$(dx run app-swiss-army-knife -iimage_file="/docker/glimpse_v2.0.0-27-g0919952_20221207.tar.gz" -icmd="echo \"chr20 /mnt/project/Phasing/PhasingWGS/step8_imputation/reference_panels/sites/chr20/rp_ukb23352_c20_qc_v1_all_sites.bcf /mnt/project/data/ukb_wgs/phased_shapeit/panels/validation_greml/wgs_ukb23352_c20_qc_v1_all.bcf /mnt/project/PhasingWGS_Official_release/step3_phase_beagle/imputation/imputed_1k_rp_beagle5.4_chr20.vcf.gz\" > concordance.txt && GLIMPSE2_concordance --gt-val --ac-bins 1 5 10 20 50 100 200 500 1000 2000 5000 10000 20000 50000 100000 149754 --thread 4 --input concordance.txt --output imputed_1k_rp_beagle5.4_chr20 && rm -f concordance.txt" --instance-type mem2_ssd1_v2_x4 --priority low --name cnc_rp_beagle5.4 --folder "/PhasingWGS_Official_release/step3_phase_beagle/concordance/" -y | tail -n1 | cut -d" " -f3)

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
6 chr1 chr1:107388953-152564670 chr1:108032695-150130228
7 chr1 chr1:149517389-168622808 chr1:150130247-168122803
3 chr9 chr9:31836957-77518833 chr9:32674876-76851846
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
34 chr1 chr1:119707834-146165488 chr1:119957834-145913683 25955850 757198
35 chr1 chr1:145663679-150599883 chr1:145913685-150349882 4436198 757196
36 chr1 chr1:150099876-154102132 chr1:150349888-153852121 3502234 757200
12 chr9 chr9:38478780-67628670 chr9:38729039-67378125 28649087 1262471 28284
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#DATA LOADING
library(RColorBrewer)
COLdiff = brewer.pal(8,"Set1")

CONFMall = read.csv("methods_coding.csv", stringsAsFactors=FALSE)

mets= c("BEAGLE_v5.4","SHAPEIT_v5.0.0")
refs = c("140,119 WGS samples")

list_legend=""
list_colours=""
j=1

pdf(paste("Fig_r2_snp_array.pdf", sep=""), 6, 6, bg="white")
is_new=FALSE
par(fig=c(0,1,0,1), new=is_new, mar=c(5,5,4,2)+0.1)
plot(1,1,type="n", xlim=c(0.0005,50), ylim=c(0.0,1), ylab=expression(paste("Aggregate ", italic("r"),""^"2"*"")), xlab="British Population Minor Allele Frequency (%)", log="x", xaxt='n', las=1)
mtext(paste0("Target: 1000 samples | Reference:", refs[j]), side=3, line=0)
axis(1, at=c(0.0001, 0.001, 0.01, 0.1, 1, 10, 50), label=c("0.0001", "0.001","0.01", "0.1", "1", "10", "50"), main=paste0("Imputation performance"))
abline(v=c(0.0001,0.0002,0.0005,0.001,0.002,0.005,0.01,0.02,0.05,0.1,0.2,0.5,1,2,5,10,20,50), col="lightgrey", lty=3)
abline(h=seq(0,1,0.05), col="lightgrey", lty=3)
x0=0



listN<-c()
listC<-c()
#for (i in seq(1, 2, by=1))
#{
SUBmetP <- paste(mets,"_1k",sep="")
CONFmetP = CONFMall[which(CONFMall$Prefix %in% SUBmetP),]
for (r in 1:nrow(CONFmetP))
{
file=paste("data/imputed_1k_rp_",CONFmetP$Met1[r],"_chr20.rsquare.grp.txt.gz", sep="")
print(file)
if(!file.exists(file))
{
next
}
D = read.table(file, head=FALSE, stringsAsFactors=FALSE)
points(D$V3*100, D$V5, type="o", pch=20, col=COLdiff[r], lwd=2)

}
listN<-c(listN, paste0(CONFmetP$Met, "-phased reference panel"))
listC<-c(listC, COLdiff[1:3])
#}
print(listN)
print(listC)
legend("bottomright", legend=listN, fill=listC, bg="white",cex = 0.8)

dev.off()
#}
Loading
Loading