kipoi / kipoi-veff

Variant effect prediction plugin for Kipoi
https://kipoi.org/veff-docs
MIT License
6 stars 5 forks source link

indel support: dataloader-utility: VariantSeqExtractor #2

Open krrome opened 6 years ago

krrome commented 6 years ago

Definition of a class that can deals with generation of mutated DNA sequences given an interval, a variant and an anchor point.

class VariantSeqExtractor:
  def __init__(self, fasta_file):
      …

  def extract(self, interval, variant, anchor, keep_length=True):
     “””
       interval: define a new class Interval()
       Variant: define a a new class Variant() in analogy to cyvcf2
       keep_length: returned sequence will have the same length as the interval
             ...[AGAC|AGATG]C...
                 [     interval       ]
                            |  anchor point
                                GA -> G variant
                   If not keep_length:
                  return (“AGAC|AGATG”, “AGACAGTG”)
       else:
                return (“AGAC|AGATG”, “AGACAGTGC”)  

     Returns
        A tuple of sequences with ref and alt
     “””
     pass