Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121376007
taxonomy.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 10, 09:48
Size
1 KB
Mime Type
text/x-python
Expires
Sat, Jul 12, 09:48 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27296223
Attached To
R2010 molecular_data_processing
taxonomy.py
View Options
#!/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
Log In to Comment