Data Integrator (Python API)
Public Member Functions | Static Public Attributes | List of all members
cls.Variant.CAlleleVariant Class Reference

Minimalistic form of a variant. More...

Inheritance diagram for cls.Variant.CAlleleVariant:
Inheritance graph
[legend]
Collaboration diagram for cls.Variant.CAlleleVariant:
Collaboration graph
[legend]

Public Member Functions

def __init__ (s, dver, gc, ref, alt, strand="+", rsID="", normalize=True)
 Constructor. More...
 
def __str__ (s)
 
def __eq__ (s, obj)
 The equality operator. More...
 
def IsChanged (s)
 Have the input data changed during normalization? More...
 
def GetDBSNPID (s)
 Get dbSNP ID. More...
 
def Reverse (s)
 Generate an object for the reverse strand. More...
 
def Original (s)
 Get an object with the original, unnormalized data. More...
 
- Public Member Functions inherited from cls.Variant.CCoordinateVariant
def __init__ (s, dver, gc)
 Constructor. More...
 
def IsValid (s)
 Is this a valid object? More...
 
def GetChrom (s)
 Get the chromosome name. More...
 
def GetStart (s)
 Get the start coordinate of the variant. More...
 
def GetEnd (s)
 Get the end coordinate of the variant. More...
 
def GetBuild (s)
 Get the build version. More...
 
def GetCoordString (s)
 Get the coordinate string of the variant. More...
 

Static Public Attributes

string dver = "v-37";
 
 obj = CAlleleVariant(dver, "GRCh37:22:42524203-42524206", "AGTC", "-");
 

Detailed Description

Minimalistic form of a variant.

This class attempts to represent variants in a minimalistic, normalized
form. Given the many possibilities to represent a single variant, it is
clear that there is no unique way to accomplish this. The class has been
designed to accept input from VCF-derived variants (eg. ClinVar), Ensembl,
and HGMD, which returns the mutation on the reading strand compared to
dbSNP, which almost always refers to the forward strand. Instances of this
class can be compared with the @c == operator, which is one of the main
goals of its implementation.

Comparison depends on the objects to be compared. If the objects belong to
the same class, the __eq__ method is called for this class. However, if
object @c a and @c c are instances of CAlleleVariant and
CCoordinateVariant, respectively, the comparison operator of the less
specialized class will be used (that is CCoordinateVariant in our case).

Given a variant, we remove redundancy by chopping basepairs from the 5'
and the 3' termini. One should especially be aware that using this class
for an insertion with a reference string (especially useful if it
indicates the reverse strand), there will be information loss due to
normalization.

Constructor & Destructor Documentation

◆ __init__()

def cls.Variant.CAlleleVariant.__init__ (   s,
  dver,
  gc,
  ref,
  alt,
  strand = "+",
  rsID = "",
  normalize = True 
)

Constructor.

Parameters
dverData version String for config file lookup.
gcGenomic SNP coordinate.
refReference allele. Since we do not have access to genomic data from Python, this is not check for correctness.
altAlternate allele.
strandReference strand, can be either '+' or '-'.
rsIDdbSNP ID, if known. This will not be used in the comparison operator.
normalizeIf set to False, do not attempt to find a minimalistic representation of the variant.

Member Function Documentation

◆ __eq__()

def cls.Variant.CAlleleVariant.__eq__ (   s,
  obj 
)

The equality operator.

Reimplemented from cls.Variant.CCoordinateVariant.

◆ __str__()

def cls.Variant.CAlleleVariant.__str__ (   s)

Reimplemented from cls.Variant.CCoordinateVariant.

◆ GetDBSNPID()

def cls.Variant.CAlleleVariant.GetDBSNPID (   s)

Get dbSNP ID.

    @return The dbSNP rs* ID if present, otherwise the empty String.

◆ IsChanged()

def cls.Variant.CAlleleVariant.IsChanged (   s)

Have the input data changed during normalization?

Returns
True, input has been transformed and normalized and is therefore a different representation.

◆ Original()

def cls.Variant.CAlleleVariant.Original (   s)

Get an object with the original, unnormalized data.

Returns
A cls.Variant.CAlleleVariant object that has not been normalized and holds the (upper cased) information as originally used in the constructor.

◆ Reverse()

def cls.Variant.CAlleleVariant.Reverse (   s)

Generate an object for the reverse strand.

Returns
Assuming that the input was given on the forward strand, this method produces a cls.Variant.CAlleleVariant object that encodes for the same mutation on the opposite strand. This includes basepair inversion and reversing of the nucleotide sequence.

Member Data Documentation

◆ dver

string cls.Variant.CAlleleVariant.dver = "v-37";
static

◆ obj

cls.Variant.CAlleleVariant.obj = CAlleleVariant(dver, "GRCh37:22:42524203-42524206", "AGTC", "-");
static

The documentation for this class was generated from the following file: