Skip to content

Commit 1355929

Browse files
committed
add some fixes
1 parent 36c0bc9 commit 1355929

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

micom/community.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,7 @@ def __init__(
203203
if rank not in taxonomy.columns:
204204
raise ValueError("Missing the column `%s` from the taxonomy." % rank)
205205
if "id" not in taxonomy.columns:
206-
taxonomy["id"] = taxonomy[rank].str.replace(
207-
r"[^A-Za-z0-9_\s]+", "_", regex=True
208-
)
206+
taxonomy["id"] = taxonomy[rank]
209207
keep_cols = [
210208
r
211209
for r in _ranks[0 : (_ranks.index(rank) + 1)]
@@ -225,7 +223,7 @@ def __init__(
225223
)
226224
logger.info(
227225
"Matched %g%% of total abundance in model DB."
228-
% (100.0 * self.__db_metrics[3])
226+
% (100.0 * self.__db_metrics.iloc[3])
229227
)
230228
if self.__db_metrics["found_abundance_fraction"] < 0.5:
231229
logger.warning(
@@ -236,7 +234,7 @@ def __init__(
236234
taxonomy = merged
237235
taxonomy["abundance"] /= taxonomy["abundance"].sum()
238236

239-
taxonomy.id = taxonomy.id.str.replace(r"[^A-Za-z0-9_\s]+", "_", regex=True)
237+
taxonomy.id = taxonomy.id.str.replace(r"[^A-Za-z0-9_]+", "_", regex=True)
240238

241239
self.__taxonomy = taxonomy
242240
self.__taxonomy.index = self.__taxonomy.id

0 commit comments

Comments
 (0)