Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add real performance testing data #91

Merged
merged 5 commits into from
Oct 17, 2024
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,4 @@ cython_debug/

.vscode
vcz_test_cache/
**/.DS_Store
22 changes: 10 additions & 12 deletions performance/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,22 @@ def run_vcztools(command: str, dataset_name: str):

if __name__ == "__main__":
commands = [
"view",
"view -s tsk_7068,tsk_8769,tsk_8820",
r"query -f '%CHROM %POS %REF %ALT{0}\n'",
r"query -f '%CHROM:%POS\n' -i 'POS=49887394 | POS=50816415'",
"view -s '' --force-samples",
("view", "sim_10k"),
("view -s tsk_7068,tsk_8769,tsk_8820", "sim_10k"),
(r"query -f '%CHROM %POS %REF %ALT{0}\n'", "sim_10k"),
(r"query -f '%CHROM:%POS\n' -i 'POS=49887394 | POS=50816415'", "sim_10k"),
("view -s '' --force-samples", "sim_10k"),
("view -i 'FMT/DP>10 & FMT/GQ>10'", "chr22"),
("view -i 'QUAL>10 || FMT/GQ>10'", "chr22"),
(r"query -f 'GQ:[ %GQ] \t GT:[ %GT]\n'", "chr22"),
]
dataset = "sim_10k"

if len(sys.argv) == 2 and sys.argv[1].isnumeric():
index = int(sys.argv[1])
command = commands[index]
run_bcftools(command, dataset)
run_vcztools(command, dataset)
elif len(sys.argv) >= 2:
command = " ".join(sys.argv[1:])
command, dataset = commands[index]
run_bcftools(command, dataset)
run_vcztools(command, dataset)
else:
for command in commands:
for command, dataset in commands:
run_bcftools(command, dataset)
run_vcztools(command, dataset)
34 changes: 26 additions & 8 deletions performance/data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,39 @@
# The Python requirements are listed in requirements.txt:
# pip install -r requirements.txt

.PHONY: all clean
# Flags / commandline arguments:
CHROMOSOME ?= 22
WGS ?= 1

all: sim_10k.vcz
ifeq ($(WGS), 1)
TGP_URL = "https://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data_collections/1000G_2504_high_coverage/working/20190425_NYGC_GATK/CCDG_13607_B01_GRM_WGS_2019-02-19_chr$(CHROMOSOME).recalibrated_variants.vcf.gz"
else
# Use URL for genotyping data:
TGP_URL = "http://hgdownload.cse.ucsc.edu/gbdb/hg19/1000Genomes/phase3/ALL.chr$(CHROMOSOME).phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz"
endif

.PHONY: all simulated real clean

all: simulated real

simulated: sim_10k.vcz

real: chr22.vcz

sim_10k.ts:
stdpopsim HomSap -c chr22 -o sim_10k.ts pop_0:10000

sim_10k.vcf.gz: sim_10k.ts
tskit vcf sim_10k.ts | bgzip > sim_10k.vcf.gz
chr22.vcf.gz:
bcftools view $(TGP_URL) | head -n 25000 | bcftools view -O z -o chr22.vcf.gz

%.vcf.gz: %.ts
tskit vcf $< | bgzip > $@

sim_10k.vcf.gz.csi: sim_10k.vcf.gz
bcftools index sim_10k.vcf.gz
%.vcf.gz.csi: %.vcf.gz
bcftools index $<

sim_10k.vcz: sim_10k.vcf.gz sim_10k.vcf.gz.csi
vcf2zarr convert sim_10k.vcf.gz sim_10k.vcz
%.vcz: %.vcf.gz %.vcf.gz.csi
vcf2zarr convert $< $@

clean:
rm -rf sim_10k.*