def__len__(self):# implements the "len" operator, e.g. "len(Alphabet('XYZ')" results in 3
returnlen(self.symbols)
def__len__(self):# implements the "len" operator, e.g. "len(Alphabet('XYZ'))" results in 3
returnlen(self.symbols)# will tell you the length of the symbols in an Alphabet instance
def__contains__(self,sym):# implements the "in" operator, e.g. "'A' in Alphabet('ACGT')" results in True
returnsyminself.symbols
returnsyminself.symbols# will tell you if 'A' is in the symbols in an Alphabet instance
def__iter__(self):# method that allows us to iterate over all symbols, e.g. "for sym in Alphabet('ACGT'): print sym" prints A, C, G and T on separate lines
tsyms=tuple(self.symbols)
returntsyms.__iter__()
def__getitem__(self,ndx):
""" Retrieve the symbol(s) at the specified index (or slice of indices) """
returnself.symbols[ndx]
defindex(self,sym):
""" Retrieve the index of the given symbol in the alphabet. """
returnself.symbols.index(sym)
def__str__(self):
returnself.symbols
""" Below we declare alphabet variables that are going to be available when
"""provide number of mapped reads for the two groups of interest and raw count data .This method provides length normalisation to prevent length and total count bias"""