Skip to content

apply_variants with reference_alignment=True raises a ValueError #130

@Veyron2121

Description

@Veyron2121

This script captures a quick reprex:

import genome_kit as gk
from genome_kit._apply_variants import apply_variants

genome = gk.Genome('gencode.v41')

interval = gk.Interval("chr1", "-", 50000, 50005, reference_genome=genome)

variants = [gk.Variant.from_string('chr1:50002:A:C', genome)]

seq, _ = apply_variants(genome.dna, variants, interval, reference_alignment=True)

This script provides the following ValueError:

Traceback (most recent call last):
  File "<redacted>", line 12, in <module>
    seq, _ = apply_variants(genome.dna, variants, interval, reference_alignment=True)
  File "<redacted>/lib/python3.10/site-packages/genome_kit/_apply_variants.py", line 198, in apply_variants
    raise ValueError("Reference alignment only work on forward strand.")
ValueError: Reference alignment only work on forward strand.

Is there a particular reason that this is only supported on the forward strand? We have a use case that would greatly benefit from being able to generate reference alignments on negative-stranded intervals as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions