From 810f1fb41d1561160e0ef69e4aeb786d6b11dcc0 Mon Sep 17 00:00:00 2001 From: Leo Joseph Date: Sat, 9 Mar 2024 19:09:50 -0800 Subject: [PATCH] fixed bugs relating to qiita 10317 --- scripts/05c.beta.sh | 2 +- scripts/metadata_operations.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/05c.beta.sh b/scripts/05c.beta.sh index 6301871..6b64fb4 100644 --- a/scripts/05c.beta.sh +++ b/scripts/05c.beta.sh @@ -51,7 +51,7 @@ if [[ ! -z "${TMI_WEIGHTED_UNIFRAC}" ]]; then echo "${d}/beta/weighted_normalized_unifrac.qza" >> $SAFE_TO_DROP python k_neighbors.py neighbors \ - --distance-matrix ${d}/beta/weighted_unifrac.qza \ + --distance-matrix ${d}/beta/weighted_normalized_unifrac.qza \ --output ${d}/beta/weighted_unifrac_neighbors.tsv \ --k 100 \ --mask-study-id 10317 diff --git a/scripts/metadata_operations.py b/scripts/metadata_operations.py index d9fa2dc..f498a7d 100644 --- a/scripts/metadata_operations.py +++ b/scripts/metadata_operations.py @@ -200,8 +200,8 @@ def anonymize_sample_ids(input_output_md, input_output_tab): mapping.update(_anonymize_sample_and_study(random_studies, study_grp, md)) - - tab.update_ids(mapping, inplace=True, strict=False) + if len(mapping) > 0: + tab.update_ids(mapping, inplace=True, strict=False) with biom.util.biom_open(input_output_tab, 'w') as fp: tab.to_hdf5(fp, 'asd')