Skip to content

Commit

Permalink
more roundtrip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchang committed Sep 28, 2023
1 parent d67c3ae commit 6540ae6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions 2.0/Tests/TEST_EXTRACT_CHR/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,20 @@ do
diff -q plink2x_c$c.bed plink2_c$c.bed
diff -q plink2x_c$c.bim plink2_c$c.bim
done

# tmp_data is also suitable for ind-major-bed, ped, and tped round-trip tests.
$1/plink2 $2 $3 --bfile tmp_data --export ind-major-bed --out plink2_roundtrip
$1/plink2 $2 $3 --bfile plink2_roundtrip --make-bed --out plink2_test
diff -q tmp_data.bed plink2_test.bed
diff -q tmp_data.bim plink2_test.bim
# .fam files aren't byte-for-byte identical due to spaces -> tabs.

$1/plink2 $2 $3 --bfile tmp_data --export ped --out plink2_roundtrip
$1/plink2 $2 $3 --pedmap plink2_roundtrip --make-bed --out plink2_test
diff -q tmp_data.bed plink2_test.bed
diff -q tmp_data.bim plink2_test.bim

$1/plink2 $2 $3 --bfile tmp_data --export tped --out plink2_roundtrip
$1/plink2 $2 $3 --tfile plink2_roundtrip --make-bed --out plink2_test
diff -q tmp_data.bed plink2_test.bed
diff -q tmp_data.bim plink2_test.bim
7 changes: 7 additions & 0 deletions 2.0/Tests/TEST_PHASED_VCF/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ $1/plink2 $2 $3 --vcf 1kg_phase3_chr21_start.vcf.gz --double-id --out plink2_dat
$1/plink2 $2 $3 --pfile plink2_data --export bcf --out plink2_roundtrip
$1/plink2 $2 $3 --bcf plink2_roundtrip.bcf --out plink2_roundtrip
diff -q plink2_data.pgen plink2_roundtrip.pgen
# Verify haps and hapslegend roundtrip.
$1/plink2 $2 $3 --pfile plink2_data --export haps sample-v2 --out plink2_roundtrip
$1/plink2 $2 $3 --haps plink2_roundtrip.haps --sample plink2_roundtrip.sample --real-ref-alleles --make-pgen --out plink2_roundtrip
diff -q plink2_data.pgen plink2_roundtrip.pgen
$1/plink2 $2 $3 --pfile plink2_data --export hapslegend sample-v2 --out plink2_roundtrip
$1/plink2 $2 $3 --haps plink2_roundtrip.haps --legend plink2_roundtrip.legend 21 --sample plink2_roundtrip.sample --real-ref-alleles --make-pgen --out plink2_roundtrip
diff -q plink2_data.pgen plink2_roundtrip.pgen

$1/plink2 $2 $3 --pfile plink2_data --export vcf --out plink2_data

Expand Down

0 comments on commit 6540ae6

Please sign in to comment.