Skip to content

Usage

Install genoSecretor and infer FUT2 secretor status from a genotype file. For pipeline internals see Workflow; for haplotype rules see Inference methods.

Research use only

genoSecretor is intended for population-genetics, epidemiology, GWAS, PheWAS, and biobank research. Genotype-inferred secretor status does not capture all rare or atypical FUT2 alleles and must not be used for clinical decision-making.

Install

pip install genosecretor

Quick start

genosecretor cohort.pgen --out secretor
# writes: secretor.secretor.tsv, secretor.qc.tsv, secretor.summary.txt, secretor.report.html

If --out is omitted, the prefix is the input path with its genotype suffix stripped (.vcf.gz and .vcf.bgz drop both suffixes, so eas_hg38.vcf.gz writes eas_hg38.secretor.tsv).

Command-line reference

genosecretor DATA [options]
Flag Default Meaning
DATA required Input genotype file
-o / --out stem of DATA Output prefix
--format auto auto, vcf, bcf, bgen, pgen, or plink1. Auto: .vcf/.vcf.gz → VCF, .bcf → BCF, .pgen → PGEN, .bgen → BGEN, .bed or a prefix that has .bim+.fam → PLINK1, else a prefix with .pgen → PGEN. If a bare prefix has both .bed and .pgen, PLINK1 wins.
--build auto auto, hg19, hg38, or chm13. Aliases GRCh37, GRCh38, CHM13v2, hs1, and T2T-CHM13v2 also resolve.
--method auto auto, two-marker, common, eas, or proxy
--ancestry auto auto, eas, eur, afr, amr, or unknown
--geno-mode auto auto, hardcall, dosage, or probability
--phase auto auto, phased, or unphased
--assume-trans / --no-assume-trans trans on Unphased double-het (rs601338 × rs1047781): assign Se^w/se with low confidence (default) or leave ambiguous
--phenotype-coding biochemical biochemical (default) or gwas
--min-genotype-prob 0.90 Minimum max(GP) for a probability hardcall
--dosage-hardcall-threshold 0.1 Dosage rounding window around 0 / 1 / 2
--strict-method off Fail if the requested method's markers are missing
--inspect off Probe markers and recommended method; do not write calls
--version — Print the package version and exit
--methods — List methods (no data file)
--method-info NAME — Print citations for a method (no data file)
--report PREFIX.report.html HTML run report path

--method auto chooses a method by marker availability and the selected coverage policy. --ancestry auto may restrict the fallback when only one functional SNP is available, its derived AF is below 5%, and at least 50 genotypes are usable. The resulting labels record the software policy. --ancestry unknown permits the marker-presence hierarchy (two-marker → common → eas → proxy). --phenotype-coding gwas combines weak-secretor and non-secretor in the phenotype column. See Inference methods.

--geno-mode auto uses GP, then DS, then GT when the higher-priority field is missing. An invalid field triggers QC. --phase auto and --phase phased use the phase of each sample's selected GTs. In VCF/BCF, two markers must share the same explicit PS or both use the implicit phase set. Calls with unresolved relative phase use the unphased rules. --phase unphased uses genotype counts throughout.

--build auto uses structured reference or assembly declarations, RefSeq contigs, chr19 length, and compatible marker coordinates. Conflicting evidence raises an error and requires explicit --build. The caller checks marker chromosome, position, and alleles against the selected assembly in either mode.

Inspect and method metadata

genosecretor --version
genosecretor cohort.pgen --inspect
genosecretor --methods
genosecretor --method-info two-marker

--inspect reports which FUT2 tags were found, call rates, derived-allele frequencies, the applied coverage policy, and the recommended method. Auto-selection with insufficient coverage for the selected policy exits with status 1 after printing the table. --methods lists registered methods (two-marker, common, eas, proxy); auto is CLI selection, not a method. --methods and --method-info do not require an input file.

Input formats

Format Extensions Notes
VCF/BCF .vcf, .vcf.gz, .bcf Diploid GT, phased GT and PS, and biallelic DS/GP. Indexed and streaming reads validate the same marker records.
PLINK2 .pgen + .pvar + .psam Auto-locates companion files
PLINK1 .bed + .bim + .fam Variant-major BED, with A1 counts as labelled in the BIM. Auto-detected from .bed or a fileset prefix.
BGEN .bgen (+ optional .sample) Unphased diploid biallelic probabilities and ALT dosage derived from those probabilities. Other genotype layouts produce a QC reason. In an Oxford .sample file, ID_1 and ID_2 become FID and IID.

GRCh37/hg19, GRCh38/hg38, and T2T-CHM13v2 are supported. --build GRCh38 (and the other aliases above) is equivalent to hg38.

Outputs

A successful call writes four files:

File Contents
PREFIX.secretor.tsv Per-sample secretor calls
PREFIX.qc.tsv Run-level QC metrics
PREFIX.summary.txt Human-readable summary
PREFIX.report.html HTML run report (--report overrides the path)

.secretor.tsv columns:

Column Description
FID Family or cohort identifier from the input file
IID Individual sample identifier
secretor_status Inferred phenotype: secretor, weak-secretor, non-secretor, or NA (GWAS coding recodes weak-secretor as non-secretor)
fut2_genotype Diplotype label (for example Se/se), or ambiguous
fut2_allele1 First haplotype allele after sort (Se < Se^w < se)
fut2_allele2 Second haplotype allele after sort
haplotype1 First haplotype in phase order or inferred diplotype order
haplotype2 Second haplotype in phase order or inferred diplotype order
method Inference method used for this sample
geno_mode Genotype interpretation mode (hardcall, dosage, probability, auto)
phase_mode Per sample, whether the call used ordered haplotypes (phased) or genotype counts (unphased). The report can show mixed.
build Genome assembly used for marker coordinates
confidence high, medium, low, or none (not a calibrated probability)
qc_status PASS, AMBIGUOUS, MISSING_MARKER, CONFLICT, or LOW_CONFIDENCE
qc_reason Free-text explanation of QC status
possible_diplotypes Compatible diplotypes when relative phase is unresolved, including assumed trans calls

See Workflow for how genotypes move from file load to these files.

.qc.tsv is a metric/value table. Besides sample counts and marker call rates it includes ancestry_requested, ancestry_resolved, rs601338_lof_af, rs1047781_weak_af, and rs602662_proxy_af.

Python API

SecretorCaller constructor kwargs match the CLI. call() returns a CallerResult; iterate result.calls for per-sample fields.

from genosecretor import SecretorCaller

caller = SecretorCaller(
    method="auto",
    ancestry="auto",
    build="auto",
    genotype_mode="auto",
    phase="auto",
    format="auto",
    dosage_threshold=0.1,
    min_genotype_prob=0.9,
    strict_method=False,
    assume_trans=True,
    phenotype_coding="biochemical",
)
result = caller.call("ukb.pgen")
for call in result.calls:
    print(call.sample.iid, call.secretor_status, call.fut2_genotype)

Inspect without writing calls:

result = caller.call("ukb.pgen", inspect_only=True)
print(result.build, result.method, result.inspect)

See also