From 6fad4952e0e17a1d2ffcdd040cad33165e04e9c0 Mon Sep 17 00:00:00 2001 From: farchaab Date: Fri, 5 Apr 2024 16:19:38 +0200 Subject: [PATCH] fixed lineage_id and rank format --- assembly_finder/bin/select_assemblies.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assembly_finder/bin/select_assemblies.py b/assembly_finder/bin/select_assemblies.py index 1c43583..2c7027a 100644 --- a/assembly_finder/bin/select_assemblies.py +++ b/assembly_finder/bin/select_assemblies.py @@ -42,7 +42,8 @@ def read_json(file): lineage_df["lineage_id"] = lineage_df[ranks_id].apply( lambda x: ",".join(x.dropna().astype(str)), axis=1 ) - +lineage_df["lineage_id"] = lineage_df["lineage_id"].str.replace(".0", "") +lineage_df["rank"] = lineage_df["rank"].str.lower() # Merge lineage and genome summary df = summary_df.merge(lineage_df, on="tax_id") df = df.replace(np.nan, "na")