Page MenuHomec4science

taxonomy.py
No OneTemporary

File Metadata

Created
Thu, Jul 10, 09:48

taxonomy.py

#!/usr/bin/env python
# -*- coding: utf-8 -*-
" module containing class Taxonomy"
##########################################################################
##########################################################################
class Taxonomy(object):
"""
class Taxonomy: store the different values at the different taxonomic level (genus, family, ...)
"""
# ------------------------------------------------------------------ #
# Constructors/Destructors #
# ------------------------------------------------------------------ #
def __init__(self,taxonomic_information):
"""__init__: takes in parameter a list of taxonomic information of this format : [k__Eukaryota,p__Opisthokonta,c__Holozoa,o__Metazoa (Animalia),f__Eumetazoa,g__Bilateria,s__Arthropoda]
extract this information and store it """
# Members ---------------------- #
# string kingdom
self.kingdom = taxonomic_information[0].replace('k__','')
# string phylum
self.phylum = taxonomic_information[1].replace('p__','')
# string classe
self.classe = taxonomic_information[2].replace('c__','')
# string order
self.order = taxonomic_information[3].replace('o__','')
# string family
self.family = taxonomic_information[4].replace('f__','')
# string genus
self.genus = taxonomic_information[5].replace('g__','')
# string species
self.species = taxonomic_information[6].replace('s__','')
def __del__(self):
"""__del__: not implemented"""
pass
##########################################################################
if __name__ == '__main__':
test = Taxonomy('k__Bacteria;p__Proteobacteria;c__Alphaproteobacteria;o__Caulobacterales;f__Caulobacteraceae;g__Brevundimonas;s__')

Event Timeline