diff --git a/modules/local/templates/mtx_to_h5ad_kallisto.py b/modules/local/templates/mtx_to_h5ad_kallisto.py index fab07f59..ac71fc42 100755 --- a/modules/local/templates/mtx_to_h5ad_kallisto.py +++ b/modules/local/templates/mtx_to_h5ad_kallisto.py @@ -77,9 +77,7 @@ def input_to_adata( # standard format # index are gene IDs and symbols are a column adata.var['gene_versions'] = adata.var.index - adata.var['gene_ids'] = adata.var['gene_versions'].str.split('.').str[0] - adata.var.index = adata.var["gene_ids"].values - adata.var = adata.var.drop("gene_ids", axis=1) + adata.var.index = adata.var['gene_versions'].str.split('.').str[0] adata.var_names_make_unique() # write results diff --git a/modules/local/templates/mtx_to_h5ad_star.py b/modules/local/templates/mtx_to_h5ad_star.py index 5614e698..aa0cd02f 100755 --- a/modules/local/templates/mtx_to_h5ad_star.py +++ b/modules/local/templates/mtx_to_h5ad_star.py @@ -64,9 +64,7 @@ def input_to_adata( # index are gene IDs and symbols are a column adata.var["gene_symbol"] = adata.var.index adata.var['gene_versions'] = adata.var["gene_ids"] - adata.var['gene_ids'] = adata.var['gene_versions'].str.split('.').str[0] - adata.var.index = adata.var["gene_ids"].values - adata.var = adata.var.drop("gene_ids", axis=1) + adata.var.index = adata.var['gene_versions'].str.split('.').str[0] # write results adata.write_h5ad(f"{output}")