ConsDB  1.0
Tool for creating consensus genomes from variant databases.
Public Member Functions | Public Attributes | List of all members
RSEntry.RSEntry.RSVar Class Reference

Public Member Functions

def __init__ (self, pos, ref, var, major=0, minor=0, clin=[], afs=[], var_type='', pop_afs={})
 
def __add__ (self, v)
 
def __eq__ (self, v)
 
def __iadd__ (self, v)
 
def __repr__ (self)
 
def __str__ (self)
 
def af (self)
 
def calc_afs (self)
 
def calc_pop_afs (self, pop)
 
def is_major (self)
 
def is_empty (self)
 
def pop_af (self, pop)
 
def var_code (self)
 

Public Attributes

 pos
 
 ref
 
 var
 
 major
 
 minor
 
 clin
 
 afs
 
 var_type
 
 pop_afs
 

Detailed Description

A sub-class to represent a variant.

Attributes
--------------------
pos : int
    Base position of the variant
ref : str
    Reference base(s)
var : str
    Variant base(s)
major : int
    Number of studies that show this variant with AF >= 0.5
minor : int
    Number of studies that show this variant with AF < 0.5
clin : list
    List of clinical relevances
afs : list
    List of allele frequencies, stores as tuples of 
    (# patients showing var, # patients in study)
var_type : str
    What type of variant (SNP, indel, or blank)
pop_afs : dict
    Dict containing population allele frequencies

Methods
--------------------
af()
    Get a representative allele frequency for the variant
calc_afs()
    Calculate float allele frequencies from afs list
calc_pop_afs(pop)
    Calculate float allele frequencies for the given population
is_major()
    Return if the variant represents a major allele
is_empty()
    Return if the variant has no studies supporting it
pop_af(pop)
    Get a representative population allele frequency for the variant
    and given population.
var_code()
    Get the representative variant code for the variant

Constructor & Destructor Documentation

◆ __init__()

def RSEntry.RSEntry.RSVar.__init__ (   self,
  pos,
  ref,
  var,
  major = 0,
  minor = 0,
  clin = [],
  afs = [],
  var_type = '',
  pop_afs = {} 
)
Initialize an instance of the RSVar class. Requires a position,
reference allele, and variant allele. All other information is 
oprtional, and will either be left blank or inferred (in the case
of var_type).

Parameters:
pos: Variant position
ref: Reference sequence at the variant position
var: Variant sequence
major: Number of studies in dbSNP listing this variant as major
minor: Number of studies in dbSNP listing this variant as minor
clin: Clinical significance of this variant
afs: Allele frequency of this allele
var_type: Variant type (SNP or indel) of this allele
pop_afs: Population allele frequencies

Member Function Documentation

◆ __add__()

def RSEntry.RSEntry.RSVar.__add__ (   self,
  v 
)
Implement addition for two RSVar objects.

◆ __eq__()

def RSEntry.RSEntry.RSVar.__eq__ (   self,
  v 
)
Implement equality checking for two RSVar objects.

◆ __iadd__()

def RSEntry.RSEntry.RSVar.__iadd__ (   self,
  v 
)
Implement incremental addition.

◆ __repr__()

def RSEntry.RSEntry.RSVar.__repr__ (   self)
Implement repr operator.

◆ __str__()

def RSEntry.RSEntry.RSVar.__str__ (   self)
Implement str operator.

◆ af()

def RSEntry.RSEntry.RSVar.af (   self)
Get a representative allele frequency for the variant.

◆ calc_afs()

def RSEntry.RSEntry.RSVar.calc_afs (   self)
Calculate float allele frequencies from afs list.

◆ calc_pop_afs()

def RSEntry.RSEntry.RSVar.calc_pop_afs (   self,
  pop 
)
Calculate float allele frequencies from afs list.

Parameters:
pop: Population to use

◆ is_empty()

def RSEntry.RSEntry.RSVar.is_empty (   self)
Return if the variant has no studies supporting it.

◆ is_major()

def RSEntry.RSEntry.RSVar.is_major (   self)
Return if the variant represents a major allele.

◆ pop_af()

def RSEntry.RSEntry.RSVar.pop_af (   self,
  pop 
)
Get a representative population allele frequency for the variant
and given population.

Parameters:
pop: Population to use

◆ var_code()

def RSEntry.RSEntry.RSVar.var_code (   self)
Get the representative variant code for the variant.

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