From 998cd562c161160f1ac969adfffe56da4fda6815 Mon Sep 17 00:00:00 2001 From: Pablo Moreno Date: Mon, 16 Jan 2023 15:05:43 +0000 Subject: [PATCH 01/10] Update cellxgene interactive tool to 1.1.1 Call is the same on 1.1.1, at least as it is used here. Will try to add some options here as well (to specify gene symbols field and others). --- tools/interactive/interactivetool_cellxgene.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/interactive/interactivetool_cellxgene.xml b/tools/interactive/interactivetool_cellxgene.xml index e9069afcb0af..06f39d7110d1 100644 --- a/tools/interactive/interactivetool_cellxgene.xml +++ b/tools/interactive/interactivetool_cellxgene.xml @@ -1,6 +1,6 @@ - + - quay.io/biocontainers/cellxgene:0.16.2--py_0 + quay.io/biocontainers/cellxgene:1.1.1--pyhdfd78af_0 From b860465f9c248171a87f742c04332dd6a3754534 Mon Sep 17 00:00:00 2001 From: Pablo Moreno Date: Mon, 16 Jan 2023 17:28:43 +0000 Subject: [PATCH 02/10] Handling of files not indexed by gene symbols and output recovery --- .../interactive/interactivetool_cellxgene.xml | 51 +++++++++++++++++-- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/tools/interactive/interactivetool_cellxgene.xml b/tools/interactive/interactivetool_cellxgene.xml index 06f39d7110d1..584423b59251 100644 --- a/tools/interactive/interactivetool_cellxgene.xml +++ b/tools/interactive/interactivetool_cellxgene.xml @@ -1,6 +1,9 @@ + - quay.io/biocontainers/cellxgene:1.1.1--pyhdfd78af_0 + + quay.io/biocontainers/cellxgene:1.1.1--pyhdfd78af_0 @@ -10,16 +13,54 @@ + + + - + + - + + + + From acd862c6329438d0281016b4e9907fce6f390d36 Mon Sep 17 00:00:00 2001 From: Pablo Moreno Date: Mon, 16 Jan 2023 17:29:22 +0000 Subject: [PATCH 03/10] Clean up --- tools/interactive/interactivetool_cellxgene.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/interactive/interactivetool_cellxgene.xml b/tools/interactive/interactivetool_cellxgene.xml index 584423b59251..e1983198ba33 100644 --- a/tools/interactive/interactivetool_cellxgene.xml +++ b/tools/interactive/interactivetool_cellxgene.xml @@ -1,8 +1,5 @@ - - quay.io/biocontainers/cellxgene:1.1.1--pyhdfd78af_0 From acc34f6d2110d09858f5ff843f4c8d623a0617d9 Mon Sep 17 00:00:00 2001 From: Pablo Moreno Date: Tue, 7 Mar 2023 08:59:43 +0000 Subject: [PATCH 04/10] Adds help --- .../interactive/interactivetool_cellxgene.xml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tools/interactive/interactivetool_cellxgene.xml b/tools/interactive/interactivetool_cellxgene.xml index e1983198ba33..590ea03374d9 100644 --- a/tools/interactive/interactivetool_cellxgene.xml +++ b/tools/interactive/interactivetool_cellxgene.xml @@ -61,7 +61,26 @@ adata.write_h5ad(output, compression="gzip") - - Interactive tool for visualising AnnData. - + From e9e8f9be27b02815fc3ddbbe6211aa58593c1488 Mon Sep 17 00:00:00 2001 From: Pablo Moreno Date: Tue, 7 Mar 2023 12:03:34 +0000 Subject: [PATCH 05/10] Change name and tutorial link --- ...ool_cellxgene.xml => interactivetool_cellxgene_1.1.1.xml} | 5 +++++ 1 file changed, 5 insertions(+) rename tools/interactive/{interactivetool_cellxgene.xml => interactivetool_cellxgene_1.1.1.xml} (95%) diff --git a/tools/interactive/interactivetool_cellxgene.xml b/tools/interactive/interactivetool_cellxgene_1.1.1.xml similarity index 95% rename from tools/interactive/interactivetool_cellxgene.xml rename to tools/interactive/interactivetool_cellxgene_1.1.1.xml index 590ea03374d9..2fec1b7865ac 100644 --- a/tools/interactive/interactivetool_cellxgene.xml +++ b/tools/interactive/interactivetool_cellxgene_1.1.1.xml @@ -82,5 +82,10 @@ Outputs If you create gene sets or differential experession sets, this will be available as a collection of files under "Cellxgene user annotations and gene sets" at the end of the execution (when you stop the interactive environment). + +Tutorials +--------- + +You can find cellxgene tuorials `here `_ . ]]> From 999322b35438b1dd5d6d6a70e3d9b6f43b2cd1d4 Mon Sep 17 00:00:00 2001 From: Pablo Moreno Date: Tue, 7 Mar 2023 12:05:10 +0000 Subject: [PATCH 06/10] Adds previous version as separate file --- .../interactivetool_cellxgene_0.16.2.xml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tools/interactive/interactivetool_cellxgene_0.16.2.xml diff --git a/tools/interactive/interactivetool_cellxgene_0.16.2.xml b/tools/interactive/interactivetool_cellxgene_0.16.2.xml new file mode 100644 index 000000000000..e9069afcb0af --- /dev/null +++ b/tools/interactive/interactivetool_cellxgene_0.16.2.xml @@ -0,0 +1,29 @@ + + + quay.io/biocontainers/cellxgene:0.16.2--py_0 + + + + 80 + + + + + + + + + + + + + + Interactive tool for visualising AnnData. + + From 6fe3db1db7abd4a2a1b921755f9fa7b1434405b1 Mon Sep 17 00:00:00 2001 From: Pablo Moreno Date: Tue, 7 Mar 2023 12:06:55 +0000 Subject: [PATCH 07/10] Update tool_conf.xml.sample --- lib/galaxy/config/sample/tool_conf.xml.sample | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/config/sample/tool_conf.xml.sample b/lib/galaxy/config/sample/tool_conf.xml.sample index b713c208d1a6..401d10a838a6 100644 --- a/lib/galaxy/config/sample/tool_conf.xml.sample +++ b/lib/galaxy/config/sample/tool_conf.xml.sample @@ -133,7 +133,8 @@ - + + From 703751b65c7b3a8c2656dea896a5ea3b4f69b8a7 Mon Sep 17 00:00:00 2001 From: Pablo Moreno Date: Wed, 8 Mar 2023 13:17:11 +0000 Subject: [PATCH 08/10] Avoid errors automatically detected by galaxy due to stderr output --- tools/interactive/interactivetool_cellxgene_1.1.1.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/interactive/interactivetool_cellxgene_1.1.1.xml b/tools/interactive/interactivetool_cellxgene_1.1.1.xml index 2fec1b7865ac..08edd9273b4d 100644 --- a/tools/interactive/interactivetool_cellxgene_1.1.1.xml +++ b/tools/interactive/interactivetool_cellxgene_1.1.1.xml @@ -7,6 +7,13 @@ 80 + + + Date: Mon, 27 Mar 2023 15:06:15 +0100 Subject: [PATCH 09/10] Layer and optionally make var field unique. --- .../interactivetool_cellxgene_1.1.1.xml | 60 +++++++++++++------ 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/tools/interactive/interactivetool_cellxgene_1.1.1.xml b/tools/interactive/interactivetool_cellxgene_1.1.1.xml index 08edd9273b4d..14bbcfc97bd3 100644 --- a/tools/interactive/interactivetool_cellxgene_1.1.1.xml +++ b/tools/interactive/interactivetool_cellxgene_1.1.1.xml @@ -15,19 +15,22 @@ /> @@ -44,21 +47,31 @@ def rn(df, field, suffix = '-duplicate-'): adata = ad.read_h5ad(sys.argv[1]) output = sys.argv[2] gene_symbol_field = sys.argv[3] -if gene_symbol_field not in adata.var.keys(): - sys.exit(f"Field {gene_symbol_field} set as var_name does not exist in the var object. AnnData object will be used as it was given") +make_unique = (sys.argv[4].lower() == "true") +layer = sys.argv[5] -adata.var = rn(adata.var, gene_symbol_field, suffix = "_d") +if gene_symbol_field and make_unique: + if gene_symbol_field not in adata.var.keys(): + sys.exit(f"Field {gene_symbol_field} set as var_name does not exist in the var object. AnnData object will be used as it was given") + + adata.var = rn(adata.var, gene_symbol_field, suffix = "_d") + adata.var["extra_gene_id"] = adata.var.index + adata.var = adata.var.set_index(f"{gene_symbol_field}_u") -adata.var["extra_gene_id"] = adata.var.index -adata.var = adata.var.set_index(f"{gene_symbol_field}_u") +if layer: + if layer not in adata.layers.keys(): + sys.exit(f"Layer {layer} is not present in AnnData, only available layers are: {', '.join(adata.layers.keys())}") + else: + adata.X = adata.layers[layer] - -adata.write_h5ad(output, compression="gzip") +adata.write_h5ad(output) ]]> - + + + @@ -80,9 +93,20 @@ Selecting the Var name ---------------------- It can happen that the main index for the var element of AnnData is not the gene symbol field, in which case search by genes will probably be by identifier. -You can choose a different field (which contains the gene symbols) so that +You can choose a different field and celxgene will use this. If in addition you choose "Make unique", the AnnData is modified (in a new copy) so that that field is made unique and -it is indexed by it. Then cellxgene will allow searches by genes in that field. +it is indexed by it. Making it unique entails though loading the object into memory, +modifying and writing it back, which can delay the execution of cellxgene. + +Then cellxgene will allow searches by genes in that field. + +Selecting the layer +------------------- + +It can happen that the AnnData object contains multiple layers, for example +one with the raw counts and another with the normalised counts. You can select +which layer to use as the matrix for cellxgene. By default cellxgene will use the X slot, but +that slot might not contain the matrix that you want to visualise. Outputs ------- From 1741fa45ee1840603e06ede10367614e0f6f9a13 Mon Sep 17 00:00:00 2001 From: Pablo Moreno Date: Tue, 28 Mar 2023 10:19:54 +0100 Subject: [PATCH 10/10] Some tabs to spaces --- tools/interactive/interactivetool_cellxgene_1.1.1.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/interactive/interactivetool_cellxgene_1.1.1.xml b/tools/interactive/interactivetool_cellxgene_1.1.1.xml index 14bbcfc97bd3..c8c6c4cb72bc 100644 --- a/tools/interactive/interactivetool_cellxgene_1.1.1.xml +++ b/tools/interactive/interactivetool_cellxgene_1.1.1.xml @@ -17,21 +17,21 @@