Skip to content

Commit

Permalink
test calling duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
pontushojer committed Jun 7, 2023
1 parent d82cdcf commit 040de51
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
Binary file added tests/data/HCC1954T_10xGenomics_chr3_DUP.bam
Binary file not shown.
Binary file added tests/data/HCC1954T_10xGenomics_chr3_DUP.bam.bai
Binary file not shown.
8 changes: 8 additions & 0 deletions tests/data/make_testdata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ bam="https://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/AshkenazimTrio/analysis/10
region="chr1:115,620,601-115,756,835"
samtools view "${bam}" "${region}" -o NA24385_10xGenomics_chr1_DEL.bam
samtools index NA24385_10xGenomics_chr1_DEL.bam

# DUPLICATION ON CHROMOSOME 3 (HCC1954T)
# GRCh38: chr3 101569210 101663759
# source: LongRanger calls
bam="https://s3-us-west-2.amazonaws.com/10x.files/samples/genome/HCC1954T_WGS_210/HCC1954T_WGS_210_phased_possorted_bam.bam"
region="chr3:101,508,502-101,725,227"
samtools view "${bam}" "${region}" -o HCC1954T_10xGenomics_chr3_DUP.bam
samtools index HCC1954T_10xGenomics_chr3_DUP.bam
20 changes: 20 additions & 0 deletions tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
CANDIDATES_INV = Path("tests/data/HCC1954T_10xGenomics_chr21_INV.candidates.bedpe").absolute()
CANDIDATES_REV_INV = Path("tests/data/HCC1954T_10xGenomics_chr21_INV.candidates_reversed.bedpe").absolute()
BAM_DEL = Path("tests/data/NA24385_10xGenomics_chr1_DEL.bam").absolute()
BAM_DUP = Path("tests/data/HCC1954T_10xGenomics_chr3_DUP.bam").absolute()
BAM_TRA = Path("tests/data/HCC1954T_10xGenomics_chr_12_20_TRA.bam").absolute()


Expand Down Expand Up @@ -195,6 +196,25 @@ def test_call_deletion(tmp_path):
assert abs(nas_pass[0].break2 - 115690219) < 500


def test_call_duplication(tmp_path):
config_file = io.StringIO(f"bam_file={BAM_DUP}\noutdir={tmp_path}\nDEBUG=True\n")
configs = Configs.from_file(config_file)

exitcode = run(configs)
assert exitcode == 0
output = tmp_path / "NAIBR_SVs.bedpe"
with open(output) as bedpe_reader:
nas = list(iter_novel_adjacencies(bedpe_reader))
assert len(nas) > 0
nas_pass = [na for na in nas if na.pass_threshold]
assert len(nas_pass) == 1
assert nas_pass[0].orient == "-+"
assert nas_pass[0].chrm1 == nas_pass[0].chrm2 == "chr3"
assert abs(nas_pass[0].break1 - 101569210) < 500
assert abs(nas_pass[0].break2 - 101663759) < 500
assert False


def test_call_interchromosomal(tmp_path):
config_file = io.StringIO(f"bam_file={BAM_TRA}\noutdir={tmp_path}\nDEBUG=True\n")
configs = Configs.from_file(config_file)
Expand Down

0 comments on commit 040de51

Please sign in to comment.