Skip to main content

Genotyping and sequence-resolved allele calling for tandem repeat regions

Project description

logo

variant motif where? variant motif here!

vmwhere (VariantMotifwhere) is a tool for analyzing tandem repeat (microsatellite) regions from long-read sequencing data. It provides three core capabilities:

  1. Discovery — identify microsatellite coordinates in a reference genome
  2. Genotyping — call allele length, repeath length, and motif-level sequence decomposition at each locus
  3. Visualization — generate sequence-resolved allele frequency plots

Installation

VMwhere is available as a Python package:

pip install vmwhere

Requirements

  • Python >= 3.12.4

  • R (>= 4.0) — required only for the visualize subcommand. Install required R packages:

    Rscript -e "install.packages(readLines('requirements-r.txt'), repos='https://cloud.r-project.org')"
    

Usage

1. Find microsatellites

Scan a reference FASTA for tandem repeat regions matching a given motif.

vmwhere find \
  --motif GGAA \
  --perfect_repeats 4 \
  --max_gap 50 \
  --buffer_size 50 \
  --fasta data/reference.fasta \
  --output_dir output/

This outputs a BED file (microsatellite_coordinates.bed) with columns: chr, start, end, region_id, motif.

Parameters

Flag Description
--motif / -m Repeat motif sequence to search for (e.g., GGAA)
--fasta / -f Path to the reference genome FASTA
--output_dir / -o Output directory
--perfect_repeats / -r Minimum number of uninterrupted tandem repeats to call a microsatellite (default: 2)
--max_gap / -g Maximum base pairs between adjacent microsatellites before they are treated as distinct loci (default: 50)
--buffer_size / -b Base pairs to extend beyond the outermost repeat on each side (default: 50)

See examples/run_vmwhere_find.sh for a runnable example.

2. Genotype microsatellites

Extract reads overlapping each locus, decompose sequences into motif and non-motif segments, cluster reads by Levenshtein distance, and call alleles.

vmwhere genotype \
  --sample_id example_sample \
  --bed_file data/T2T_regions.bed \
  --bam_file data/A673_sampled_reads.sorted.bam \
  --fasta data/GCF_009914755.1_T2T-CHM13v2.0_chr6_chr10.fasta \
  --cluster_distance 4 \
  --minor_threshold 0.20 \
  --major_threshold 0.80 \
  --output_dir output/ \
  --num_processes 2

See examples/run_vmwhere_genotype.sh for a runnable example.

Parameters

Required:

Flag Description
--sample_id Sample identifier (used in output filename)
--bam_file Path to sorted, indexed BAM file
--fasta Path to the reference genome FASTA
--bed_file Headerless BED file with columns: chr, start, end, region_id, motif
--output_dir Output directory (file will be named <sample_id>_vmwhere_results.tsv)

Optional:

Flag Description Default
--cluster_distance Maximum Levenshtein distance for grouping reads into a cluster 0
--minor_threshold Minimum read support fraction to call a minor allele 0.20
--major_threshold Minimum read support fraction to call a homozygous genotype 0.80
--num_processes Number of parallel processes 24

Output TSV columns

The output follows VCF-style conventions but is written as a TSV for simpler parsing.

Column Description
CHROM Chromosome
POS Start coordinate of the microsatellite
ID Locus identifier from the input BED file
REF Reference allele sequence
ALT Alternate allele sequence(s); . if none
END End coordinate of the microsatellite
MOTIF Canonical repeat motif
GT Genotype (e.g., 0/0 = homozygous reference, 0/1 = heterozygous)
AL Allele length in base pairs
CN Total copy number of the canonical motif (consecutive and interrupted occurrences)
CNM Maximum uninterrupted copy number of the canonical motif (e.g., 6GGAA_1GGAT_2GGAA = 6)
MD Motif purity — fraction of allele base pairs matching the canonical motif
DS_READ Decomposed sequence of the allele
DS_REF Decomposed sequence of the reference
RS Read support for the allele

3. Visualize alleles at a microsatellite

Generate a PDF showing sequence-resolved allele structures and their frequencies at a given locus.

vmwhere visualize \
  --genotype_tsv output/example_sample_vmwhere_results.tsv \
  --microsatellite_id chr6_region_41 \
  --min_allele_count 0 \
  --output_pdf output/chr6_region_41_visualization.pdf

See examples/run_vmwhere_visualize.sh for a runnable example.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vmwhere-0.2.0.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vmwhere-0.2.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file vmwhere-0.2.0.tar.gz.

File metadata

  • Download URL: vmwhere-0.2.0.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vmwhere-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c467eefefe2e86c14269b2e7b44c6e3a654b304c6dcc9ad7d101b02b0a85b94c
MD5 3014bf0def493c7f0f551006ce38da75
BLAKE2b-256 fb8186a09bb794fce7b5f2725df97d260d9927933c79fc15a1b12e4113b146fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for vmwhere-0.2.0.tar.gz:

Publisher: release.yml on pirl-unc/vmwhere

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vmwhere-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vmwhere-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vmwhere-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eeaf4dab9b1f45417e6ce9e7f4f0e765699201316b543d081b446093decd0e46
MD5 382a989464260d728048e7cbdde29877
BLAKE2b-256 c51df94f93b82070d0d688761a5ea76bea97af07c3ea417decad79c5b3944f81

See more details on using hashes here.

Provenance

The following attestation bundles were made for vmwhere-0.2.0-py3-none-any.whl:

Publisher: release.yml on pirl-unc/vmwhere

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page