Skip to content

geno_lewm.deploy.import_

import_

Local-only personal-genome raw-data importers.

VcfConversionSummary dataclass

VcfConversionSummary(output_path: Path, records_written: int, ref_calls_skipped: int, no_calls_skipped: int)

Summary returned by a local personal-genome conversion.

convert_ancestry_to_vcf

convert_ancestry_to_vcf(input_path: str | Path, output_path: str | Path, reference_alleles: ReferenceAlleles, *, sample_id: str = 'sample') -> VcfConversionSummary

Convert AncestryDNA raw genotype text to a local VCF file.

Source code in geno_lewm/deploy/import_/ancestry.py
def convert_ancestry_to_vcf(
    input_path: str | Path,
    output_path: str | Path,
    reference_alleles: ReferenceAlleles,
    *,
    sample_id: str = "sample",
) -> VcfConversionSummary:
    """Convert AncestryDNA raw genotype text to a local VCF file."""
    return convert_array_calls_to_vcf(
        parse_ancestry(input_path),
        output_path,
        reference_alleles,
        sample_id=sample_id,
    )

convert_myheritage_to_vcf

convert_myheritage_to_vcf(input_path: str | Path, output_path: str | Path, reference_alleles: ReferenceAlleles, *, sample_id: str = 'sample') -> VcfConversionSummary

Convert MyHeritage raw genotype CSV/TSV to a local VCF file.

Source code in geno_lewm/deploy/import_/myheritage.py
def convert_myheritage_to_vcf(
    input_path: str | Path,
    output_path: str | Path,
    reference_alleles: ReferenceAlleles,
    *,
    sample_id: str = "sample",
) -> VcfConversionSummary:
    """Convert MyHeritage raw genotype CSV/TSV to a local VCF file."""
    return convert_array_calls_to_vcf(
        parse_myheritage(input_path),
        output_path,
        reference_alleles,
        sample_id=sample_id,
    )

convert_sequencing_json_to_vcf

convert_sequencing_json_to_vcf(input_path: str | Path, output_path: str | Path, *, sample_id: str = 'sample') -> VcfConversionSummary

Convert Sequencing.com-style WGS JSON to a local VCF file.

Source code in geno_lewm/deploy/import_/sequencing.py
def convert_sequencing_json_to_vcf(
    input_path: str | Path,
    output_path: str | Path,
    *,
    sample_id: str = "sample",
) -> VcfConversionSummary:
    """Convert Sequencing.com-style WGS JSON to a local VCF file."""
    variants = parse_sequencing_json(input_path)
    path = write_vcf_variants(variants, output_path, sample_id=sample_id)
    return VcfConversionSummary(
        output_path=path,
        records_written=len(variants),
        ref_calls_skipped=0,
        no_calls_skipped=0,
    )

convert_23andme_to_vcf

convert_23andme_to_vcf(input_path: str | Path, output_path: str | Path, reference_alleles: ReferenceAlleles, *, sample_id: str = 'sample') -> VcfConversionSummary

Convert 23andMe raw genotype text to a local VCF file.

Source code in geno_lewm/deploy/import_/twentythreeandme.py
def convert_23andme_to_vcf(
    input_path: str | Path,
    output_path: str | Path,
    reference_alleles: ReferenceAlleles,
    *,
    sample_id: str = "sample",
) -> VcfConversionSummary:
    """Convert 23andMe raw genotype text to a local VCF file."""
    return convert_array_calls_to_vcf(
        parse_23andme(input_path),
        output_path,
        reference_alleles,
        sample_id=sample_id,
    )