Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

pmdshodh

Latest version: v0.3.3

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
PyPI package Publisher: dpatel
0 Stars
0 Forks
9 Versions
1.8K Downloads
Rust Repo language

Scan summary

pmdshodh was last scanned on 23 Nov 2026 at version 0.3.3. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 9 versions; the latest 5 were published within 4 days (20–23 Nov 2026).
  • Findings: No rules fired in version 0.3.3.
  • Downloads: 1,807 downloads.

Versions

9 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.3.3 LATEST 23 Nov 2026 No rules fired
0.3.2 23 Nov 2026 No rules fired
0.3.1 22 Nov 2026 No rules fired
0.3.0 20 Nov 2026 Not shown
0.2.4 20 Nov 2026 Not shown

No rules fired in 0.3.3

Findings

Findings for v0.3.3. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.3.3; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

pmdshodh

Fast, maintained post-mortem damage (PMD) scoring and filtering for ancient DNA alignments.

pmdshodh scores every read in a SAM, BAM or CRAM file for ancient DNA damage, keeps or removes reads by score, and summarises damage patterns. It uses the scoring model of PMDtools 0.60, fixes PMDtools' known errors by default (--pmdtools-compat reproduces PMDtools exactly), reads and writes alignments directly, and runs on multiple threads.

Status: alpha (v0.3.3). Scores have been validated against PMDtools on real and synthetic data. Performance benchmarks are in docs/benchmarks.md; a Bioconda package is still to come.

Contents

  • Overview
  • Features
  • Installation
  • Quick start
  • Commands
  • Options
  • Output
  • Compatibility with PMDtools
  • Limitations
  • Development
  • License

Overview

Ancient DNA molecules carry characteristic damage. Cytosine deamination appears as C→T substitutions near the 5′ end of reads, and as G→A near the 3′ end in double-stranded libraries. The PMD score of Skoglund et al. (2014) is a per-read log-likelihood ratio comparing a damage model with a no-damage model. Reads scoring above a threshold (commonly 3) are likely to be ancient rather than modern contamination.

pmdshodh implements this score as a single program, with no samtools calmd | python | samtools view pipeline. It does not classify taxa, estimate contamination, call genotypes or rescale base qualities.

Features

  • PMDtools-compatible scores. It uses the same likelihood model, defaults and options (--threshold, --ss, --CpG, --UDGhalf, -m, -q, …). Single-stranded (--ss) scores follow the paper's model and are lower than PMDtools'; see Differences that change scores.
  • Direct SAM/BAM/CRAM input, SAM/BAM output. Kept records are written unchanged and in input order, with an @PG header line. CRAM is decoded with the reference given by -r.
  • Multi-threaded scoring and BGZF compression. Results are identical for any thread count.
  • JSON run summary with read counts, a score histogram and damage tables, designed for MultiQC.
  • HTML damage report from one or more run summaries: damage by position, score and length histograms, read counts. One self-contained file with no JavaScript or network access.
  • Robust input handling. It never drops reads silently: every skipped read is counted by reason, and invalid input stops with a clear error.
  • Correct by default, exact on request. Known PMDtools bugs are fixed, and --pmdtools-compat reproduces PMDtools exactly for comparisons.

Installation

pip: pip install pmdshodh installs the pmdshodh command; the wheels contain the compiled binary only. Wheels are built for Linux x86_64 and aarch64 (glibc 2.17 or newer), macOS arm64 and x86_64, and Windows x86_64.

Prebuilt binaries: download the archive for your platform from GitHub Releases, e.g. pmdshodh-0.3.3-x86_64-unknown-linux-gnu.tar.gz, and check it against SHA256SUMS. Linux binaries need glibc 2.17 or newer (CentOS/RHEL 7 and later). Builds are for Linux x86_64 and aarch64, macOS arm64 and x86_64, and Windows x86_64.

From source: this needs Rust 1.91 or newer, the minimum of the noodles dependency. CI tests 1.91 and the latest stable.

git clone https://github.com/dpatel511/pmdshodh.git
cd pmdshodh
cargo build --release
./target/release/pmdshodh --version

Input requirement: pmdshodh needs each read's reference bases. Either pass the reference with -r, or give it reads with an MD tag.

  • With -r ref.fa: the FASTA must be indexed with samtools faidx. Reference bases come from the FASTA, so reads need no MD tag. Any MD tags present are checked against the reference, and stale ones are counted.
  • CRAM input always needs -r, with the reference the CRAM was written against. Each reference sequence is checked against the M5 checksum in the CRAM header when it is loaded, so a different reference is an input error rather than silently wrong reads and scores. (samtools writes M5; without it, only single-reference slices are checked, against their own MD5.) REF_PATH, REF_CACHE and downloads are not used.
  • Without -r: every mapped read needs an MD tag. If your aligner doesn't write one, add it with samtools calmd -b input.bam reference.fa > input.md.bam.

Quick start

# Keep reads with PMD score >= 3 (double-stranded library, no UDG treatment)
pmdshodh filter --threshold 3 sample.bam -o sample.pmd3.bam

# Add the score to each kept read, write a run summary, use 8 threads
pmdshodh filter --threshold 3 --tag --summary sample.json --threads 8 sample.bam -o sample.pmd3.bam

# Single-stranded, UDG-half treated library
pmdshodh filter --threshold 3 --library ss --treatment half sample.bam -o sample.pmd3.bam

# Per-read scores as a table
pmdshodh score sample.bam -o sample.scores.tsv

# Damage summary only
pmdshodh damage sample.bam -o sample.damage.json

# HTML report from one or more run summaries
pmdshodh report sample.damage.json other.damage.json -o damage-report.html

# CRAM input (needs its reference); writes BAM
pmdshodh filter --threshold 3 -r ref.fa sample.cram -o sample.pmd3.bam

Commands

Command Purpose Output
filter Keep reads by PMD score SAM or BAM, chosen by the -o extension (-o - writes BAM to stdout)
score Score every read Tab-separated table: read_name, flag, pmds, n_sites
damage Summarise damage without filtering JSON run summary
report Report on run summaries (never re-reads alignments) One HTML file (-o - writes it to stdout)

filter keeps reads with score ≥ --threshold and/or < --upper-threshold; at least one is required.

Run pmdshodh <command> --help for every option, grouped by purpose, with examples.

Options

PMDtools option names are accepted as aliases (shown in the second column).

Library and treatment
Option PMDtools Default Description
--library ds\|ss --ss ds Double- or single-stranded library. Never inferred from the data.
--treatment none\|half\|full --UDGminus, --UDGhalf, --UDGplus / --CpG none half: CpG sites plus the terminal base; full: CpG sites only.
Read and base selection
Option PMDtools Default Description
-m, --min-mapq N -m, --requiremapq 0 Skip reads below this mapping quality.
-q, --min-baseq N -q, --requirebaseq 0 Ignore bases below this base quality.
--no-clips --noclips off Skip reads with soft or hard clips.
--no-indels --noindels off Skip reads with insertions or deletions.
Model parameters
Option PMDtools Default
--pmd-p --PMDpparam 0.3
--pmd-c --PMDconstant 0.01
--pi-ancient --polymorphism_ancient 0.001
--pi-contamination --polymorphism_contamination 0.001

Each is between 0 and 1, and --pmd-p + --pmd-c (the damage rate at the read end) must be at most 1; larger values would make scores undefined (NaN).

Output and performance
Option Applies to Description
-t, --threshold X filter Keep reads with score ≥ X.
--upper-threshold X filter Keep reads with score < X.
--tag, --tag-name pm\|DS filter Add the score to kept reads as pm:f (32-bit float, default) or DS:Z (3 decimals, as PMDtools --writesamfield).
--summary FILE filter, score Also write the JSON run summary.
--range N all Positions from each read end in damage tables (default 30, from 1 to 1000).
-n, --max-reads N damage Stop after N reads.
-@, --threads N all Threads (default 1, at most 1024): at most N do work at once, so you can pass your CPU allocation.
-r, --reference FILE all Indexed reference FASTA (samtools faidx; bgzip also needs .gzi). Reference bases come from it instead of MD tags, and MD tags are checked against it. Every header sequence must be in it with the same length.
--pmdtools-compat all Reproduce PMDtools 0.60 exactly, including its bugs.
--quiet all Suppress the summary line on stderr.

Output

Alignments (filter)
  • Kept records are unchanged (identical when decoded) apart from the optional score tag. From CRAM input, records are written as stored in the CRAM: MD and NM tags that htslib left out because it can regenerate them are not added back (see Limitations).
  • Input order is preserved.
  • The input header is copied, and one @PG line records the command.
  • Output files are written under a temporary name and renamed only on success, so a failed run never leaves a partial file. A symlink is followed and the file it points to is replaced. FIFOs and devices (/dev/null, NUL on Windows, /dev/stdout, >(...)) are written in place.
  • If Ctrl-C, SIGTERM (e.g. a scheduler's time limit) or SIGHUP ends the run, the temporary files are removed first, and the process still ends by that signal (status 130, 143 or 129).
  • The output format comes from a .bam or .sam extension (any case). For stdout and devices, which have none, --output-format decides, BAM by default: -o /dev/null --summary run.json keeps only the summary.
  • An output may not be the input, the reference or another output (exit 2).
JSON run summary

A single file per run, versioned with format_version (currently 4). It contains:

Section Contents
tool, command, mode, model, filters Version, command line, library and treatment, model parameters, thresholds
input_format sam, bam or cram, detected from the file contents
reference The -r FASTA (if any); whether reference bases came from MD or the FASTA; with -r, how many scored reads had MD tags agreeing, disagreeing or absent (for CRAM, only MD tags stored in the file count)
reads Input, scored, kept and removed counts; skipped reads by reason; flag counts (duplicate, secondary, supplementary, …)
score_histogram, length_histogram Score distribution (0.5-wide bins from −20 to 40), read lengths
damage Counts of read bases A/C/G/T at reference C and G, by position from each molecule end; first-base C→T rate with standard error
HTML damage report (report)

pmdshodh report run.json [more.json ...] -o report.html reads summaries written by damage -o, filter --summary or score --summary (format_version 1 to 4; fields missing from version 1 are shown as "not recorded"). The JSON stays the source of truth: the report computes rates from its counts and adds nothing new. Per sample, it shows:

  • the run: input, reference, command line, library, treatment, model parameters and thresholds;
  • read counts, skipped reads by reason, flag counts and, with -r, MD tag agreement;
  • damage by position in percent, positions from 1: 5′ C→T, and 3′ G→A for double-stranded or 3′ C→T for single-stranded libraries, with all other substitutions as a dashed baseline; and the first-base C→T rate with its standard error;
  • the PMD score histogram as a percentage of scored reads, with the thresholds marked and, for filter, the fraction of scored reads kept;
  • read lengths of scored reads and, for filter, of kept reads in a chart of their own.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases pmdshodh

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229