Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121914975
test_fct.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
Mon, Jul 14, 19:39
Size
2 KB
Mime Type
text/x-python
Expires
Wed, Jul 16, 19:39 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27412618
Attached To
R2010 molecular_data_processing
test_fct.py
View Options
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"This file contain the clustering_process functions, it take 9 arguments as input"
########################################################
from
cluster_collection
import
ClusterCollection
########################################################
def
check_clustering
(
clustering_software
,
cluster_collection
):
"""check taxonomic affiliataion and size of clusters from the test files """
if
clustering_software
==
'dbc'
:
test_dbc
=
True
test_why
=
''
if
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_1102_26606_9417'
]
.
size
!=
17
:
test_dbc
=
False
test_why
+=
'wrong size of cluster '
if
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_2113_7693_10856'
]
.
size
!=
18
:
test_dbc
=
False
test_why
+=
'wrong size of cluster '
if
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_2114_7665_11757'
]
.
taxonomic_affiliation
.
genus
!=
'Tetrasphaera'
:
test_dbc
=
False
test_why
+=
'wrong taxonomic affiliation '
if
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_2113_7693_10856'
]
.
d_abundance_per_sample
[
'-2016_02_15'
]
!=
12
:
test_dbc
=
False
test_why
+=
'wrong sample size '
if
test_dbc
:
print
'test dbc ok'
else
:
print
'test dbc failed'
print
test_why
if
clustering_software
==
'cd_hit'
:
test_cdhit
=
True
test_why
=
''
if
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_1112_16352_8661'
]
.
size
!=
339
:
test_cdhit
=
False
test_why
+=
'wrong size of cluster '
print
'size '
,
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_1112_16352_8661'
]
.
size
if
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_2101_17727_17562'
]
.
size
!=
506
:
test_cdhit
=
False
test_why
+=
'wrong size of cluster '
print
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_2101_17727_17562'
]
.
size
print
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_2113_20305_2539'
]
.
size
print
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_1105_16475_17491'
]
.
size
if
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_2113_20305_2539'
]
.
taxonomic_affiliation
.
genus
!=
'Propioniciclava'
:
test_cdhit
=
False
test_why
+=
'wrong taxonomic affiliation '
print
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_2113_20305_2539'
]
.
taxonomic_affiliation
.
genus
if
cluster_collection
.
cluster_collection
[
'M01312_138_000000000-AN8YW_1_1105_16475_17491'
]
.
d_abundance_per_sample
[
'-2016_02_15'
]
!=
32
:
test_cdhit
=
False
test_why
+=
'wrong sample size '
if
test_cdhit
:
print
'test cd-hit ok'
else
:
print
'test cd-hit failed'
print
test_why
return
0
Event Timeline
Log In to Comment