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¶
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¶
| 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 (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 picks the first ancestry-allowed method whose markers are present. Default --ancestry auto infers East Asian–like vs European-like from se428/se385 allele frequency when only one functional SNP is present (n ≥ 50): EAS-like files missing rs1047781 error instead of falling back to common; EUR-like files missing rs601338 error instead of falling back to eas. --ancestry unknown keeps the marker-presence hierarchy (two-marker → common → eas → proxy) and warns when common is chosen without rs1047781. Explicit --method still runs but warns if it contradicts ancestry. --phenotype-coding gwas recodes Se^w/Se^w and Se^w/se as non-secretor; fut2_genotype still keeps Se^w. See Inference methods.
--geno-mode auto uses GP, then DS, then hardcall GT. --phase auto uses phased haplotypes when the file has | genotypes; otherwise it enumerates unphased diplotypes. --build auto uses marker coordinates, header metadata, and chromosome lengths; conflicting evidence is an error and requires explicit --build.
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, resolved ancestry, and the recommended method. Auto-selection that would mis-type an EAS-like or EUR-like cohort exits with status 1 after printing that 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 |
GT, phased GT, DS, GP. BCF is reported as BCF. |
| PLINK2 | .pgen + .pvar + .psam |
Auto-locates companion files |
| PLINK1 | .bed + .bim + .fam |
Auto-detected from .bed (or a prefix with .bim+.fam); --format plink1 also works |
| BGEN | .bgen (+ optional .sample) |
Dosage/probability support. The reader is implemented; tests and examples do not yet ship a BGEN fixture. |
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 | Haplotype call on chromosome copy 1 |
| haplotype2 | Haplotype call on chromosome copy 2 |
| method | Inference method used for this sample |
| geno_mode | Genotype interpretation mode (hardcall, dosage, probability, auto) |
| phase_mode | Whether haplotypes used phase (phased) or enumeration (unphased) |
| 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 fut2_genotype is ambiguous |
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¶
- Workflow — load-to-output pipeline
- Inference methods — haplotype and phenotype rules
- Markers — coordinates and 1000 Genomes LD r²
- Assumptions — limitations
- Examples — synthetic and 1000 Genomes demos