Package 'parati'

Title: Parental Allele Transmission Inference for Trio Genotype Data
Description: Infers maternal and paternal transmitted and non-transmitted alleles from phased trio genotype data. The package supports SNP-level analyses of genetic nurture and transgenerational effects. It interoperates with Bioconductor VCF infrastructure through support for VariantAnnotation::VCF objects and returns R objects for downstream analysis.
Authors: Jinyi Che [aut, cre]
Maintainer: Jinyi Che <[email protected]>
License: GPL-3 + file LICENSE
Version: 1.1.0
Built: 2026-05-30 09:37:45 UTC
Source: https://github.com/bioc/parati

Help Index


Infer parental transmitted and non-transmitted alleles

Description

Given trio genotype data for a single family, infer maternal and paternal transmitted and non-transmitted alleles.

Usage

haplotype_infer(vcf_dt, hap_length = 5e+05)

Arguments

vcf_dt

A 'data.table' containing fixed VCF columns and genotype columns named 'M', 'P', and 'B'.

hap_length

Integer, haplotype window length.

Details

This function preserves the original PARATI inference semantics: - deterministic Mendelian inference for non-triple-heterozygote patterns - local haplotype matching for triple-heterozygote sites - low-similarity / ambiguous sites are left as missing (".|.")

Value

A named list containing:

vcf_trans

A 'data.table' with transmitted alleles.

vcf_nontrans

A 'data.table' with non-transmitted alleles.

sim_perc_summary

A 'data.table' summarizing inference statistics.


Run PARATI inference workflow

Description

Main function to infer parental transmitted and non-transmitted alleles from phased trio genotype data. The function accepts either a VCF file path or a 'VCF' object from 'VariantAnnotation', and returns R objects without writing files by default.

Usage

parati_run(vcf, fam, chr = NULL, hap_length = 5e+05)

Arguments

vcf

Either a character path to a phased VCF/VCF.GZ file, or a 'VariantAnnotation::VCF' object.

fam

Either a character path to a family index table ('.xlsx') or a 'data.frame' / 'data.table' with columns 'FamilyIndex', 'IndividualID', and 'Role'.

chr

Optional chromosome identifier to subset variants.

hap_length

Integer, haplotype window length.

Value

A named list containing:

vcf_trans

A 'data.table' with transmitted alleles.

vcf_nontrans

A 'data.table' with non-transmitted alleles.

sim_perc_summary

A 'data.table' summarizing inference statistics.

Examples

vcf_file <- system.file("extdata", "Toy_TrioGenotype.vcf.gz", package = "parati")
fam_file <- system.file("extdata", "Toy_FamilyIndexTable.xlsx", package = "parati")
res <- parati_run(vcf = vcf_file, fam = fam_file, chr = 1)
names(res)

Read VCF by chromosome

Description

Reads a VCF file and subsets variants to a given chromosome.

Usage

read_vcf_by_chr(vcf_file, chr)

Arguments

vcf_file

Character scalar, path to a VCF/VCF.GZ file.

chr

Character or integer chromosome identifier.

Value

A 'data.table' containing VCF rows for the selected chromosome.

Examples

vcf_file <- system.file("extdata", "Toy_TrioGenotype.vcf.gz", package = "parati")
vcf_chr <- read_vcf_by_chr(vcf_file, chr = 1)
dim(vcf_chr)

Convert data.table to vcfR object

Description

Converts a 'data.table' representing VCF rows into a 'vcfR' object.

Usage

vcf_dt_to_vcfR(df, meta = character())

Arguments

df

A 'data.table' containing VCF rows.

meta

Character vector of VCF meta lines.

Value

A 'vcfR' object.

Examples

vcf_file <- system.file("extdata", "Toy_TrioGenotype.vcf.gz", package = "parati")
vcf_dt <- read_vcf_by_chr(vcf_file, chr = 1)
vcf_obj <- vcf_dt_to_vcfR(vcf_dt)
class(vcf_obj)
stopifnot(inherits(vcf_obj, "vcfR"))

Write VCF data.table to file

Description

Writes a 'data.table' representing VCF rows to a VCF file.

Usage

write_vcf_dt(df, file)

Arguments

df

A 'data.table' containing VCF rows.

file

Character scalar, output file path.

Value

'NULL', invisibly. The VCF file is written to 'file'.

Examples

vcf_file <- system.file("extdata", "Toy_TrioGenotype.vcf.gz", package = "parati")
vcf_dt <- read_vcf_by_chr(vcf_file, chr = 1)
outfile <- tempfile(fileext = ".vcf")
write_vcf_dt(vcf_dt, outfile)
file.exists(outfile)

Write vcfR object to file

Description

Writes a 'vcfR' object to a VCF file.

Usage

write_vcf_obj(vcf_obj, file)

Arguments

vcf_obj

A 'vcfR' object.

file

Character scalar, output file path.

Value

'NULL', invisibly. The VCF file is written to 'file'.

Examples

vcf_file <- system.file("extdata", "Toy_TrioGenotype.vcf.gz", package = "parati")
vcf_dt <- read_vcf_by_chr(vcf_file, chr = 1)
vcf_obj <- vcf_dt_to_vcfR(vcf_dt)
stopifnot(inherits(vcf_obj, "vcfR"))
outfile <- tempfile(fileext = ".vcf")
write_vcf_obj(vcf_obj, outfile)
stopifnot(file.exists(outfile))