changeset 1:046d8ff974ff draft

planemo upload for repository https://github.com/ebi-gene-expression-group/container-galaxy-sc-tertiary/ commit 45145f380b27c3092e1fa2249adc36d7d6fdf5fe
author ebi-gxa
date Wed, 27 Sep 2023 01:11:32 +0000
parents 59a7f3f83aec
children 130e25d3ce92
files decoupler_pseudobulk.py decoupler_pseudobulk.xml
diffstat 2 files changed, 18 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/decoupler_pseudobulk.py	Sun Sep 24 08:44:24 2023 +0000
+++ b/decoupler_pseudobulk.py	Wed Sep 27 01:11:32 2023 +0000
@@ -58,15 +58,15 @@
     # avoid dash that is read as point on R colnames.
     obs_for_deseq.index = obs_for_deseq.index.str.replace("-", "_")
     obs_for_deseq.index = obs_for_deseq.index.str.replace(" ", "_")
-    col_metadata_file = f"{output_dir}col_metadata.csv"
+    col_metadata_file = f"{output_dir}col_metadata.tsv"
     # write obs to a col_metadata file
     if factor_fields:
         # only output the index plus the columns in factor_fields in that order
-        obs_for_deseq[factor_fields].to_csv(col_metadata_file, sep=",", index=True)
+        obs_for_deseq[factor_fields].to_csv(col_metadata_file, sep="\t", index=True)
     else:
-        obs_for_deseq.to_csv(col_metadata_file, sep=",", index=True)
+        obs_for_deseq.to_csv(col_metadata_file, sep="\t", index=True)
     # write var to a gene_metadata file
-    pdata.var.to_csv(f"{output_dir}gene_metadata.csv", sep=",", index=True)
+    pdata.var.to_csv(f"{output_dir}gene_metadata.tsv", sep="\t", index=True)
     # write the counts matrix of a specified layer to file
     if layer is None:
         # write the X numpy matrix transposed to file
@@ -75,7 +75,7 @@
         df = pd.DataFrame(
             pdata.layers[layer].T, index=pdata.var.index, columns=obs_for_deseq.index
         )
-    df.to_csv(f"{output_dir}counts_matrix.csv", sep=",", index_label="")
+    df.to_csv(f"{output_dir}counts_matrix.tsv", sep="\t", index_label="")
 
 
 def plot_pseudobulk_samples(
--- a/decoupler_pseudobulk.xml	Sun Sep 24 08:44:24 2023 +0000
+++ b/decoupler_pseudobulk.xml	Wed Sep 27 01:11:32 2023 +0000
@@ -1,4 +1,4 @@
-<tool id="decoupler_pseudobulk" name="Decoupler pseudo-bulk" version="1.4.0+galaxy0" profile="20.05">
+<tool id="decoupler_pseudobulk" name="Decoupler pseudo-bulk" version="1.4.0+galaxy1" profile="20.05">
     <description>aggregates single cell RNA-seq data for running bulk RNA-seq methods</description>
     <requirements>
         <requirement type="package" version="1.4.0">decoupler</requirement>
@@ -74,9 +74,9 @@
         <data name="pbulk_anndata" format="h5ad" label="${tool.name} on ${on_string}: Pseudo-bulk AnnData">
             <filter>produce_anndata</filter>
         </data>
-        <data name="count_matrix" format="csv" label="${tool.name} on ${on_string}: Count Matrix" from_work_dir="deseq_output_dir/counts_matrix.csv"/>
-        <data name="samples_metadata" format="csv" label="${tool.name} on ${on_string}: Samples Metadata (factors file)" from_work_dir="deseq_output_dir/col_metadata.csv"/>
-        <data name="genes_metadata" format="csv" label="${tool.name} on ${on_string}: Genes Metadata" from_work_dir="deseq_output_dir/gene_metadata.csv"/>
+        <data name="count_matrix" format="tabular" label="${tool.name} on ${on_string}: Count Matrix" from_work_dir="deseq_output_dir/counts_matrix.tsv"/>
+        <data name="samples_metadata" format="tabular" label="${tool.name} on ${on_string}: Samples Metadata (factors file)" from_work_dir="deseq_output_dir/col_metadata.tsv"/>
+        <data name="genes_metadata" format="tabular" label="${tool.name} on ${on_string}: Genes Metadata" from_work_dir="deseq_output_dir/gene_metadata.tsv"/>
         <data name="plot_output" format="png" label="${tool.name} on ${on_string}: Pseudobulk plot" from_work_dir="plots_output_dir/pseudobulk_samples.png">
             <filter>produce_plots</filter>
         </data>
@@ -105,19 +105,22 @@
                     <has_h5_keys keys="obs/psbulk_n_cells"/>
                 </assert_contents>
             </output>
-            <output name="count_matrix" ftype="csv">
+            <output name="count_matrix" ftype="tabular">
                 <assert_contents>
                     <has_n_lines n="3620"/>
+                    <has_n_columns n="8"/>
                 </assert_contents>
             </output>
-            <output name="samples_metadata" ftype="csv">
+            <output name="samples_metadata" ftype="tabular">
                 <assert_contents>
                     <has_n_lines n="8"/>
+                    <has_n_columns n="3"/>
                 </assert_contents>
             </output>
-            <output name="genes_metadata" ftype="csv">
+            <output name="genes_metadata" ftype="tabular">
                 <assert_contents>
                     <has_n_lines n="3620"/>
+                    <has_n_columns n="13"/>
                 </assert_contents>
             </output>
             <output name="plot_output" ftype="png">
@@ -153,9 +156,11 @@
 
         The tool will output the filtered AnnData, count matrix, samples metadata, genes metadata (in DESeq2 format), and the pseudobulk plot and filter by expression plot (if enabled).
 
+        You can obtain more information about Decoupler pseudobulk at the developers documentation `here <https://decoupler-py.readthedocs.io/en/latest/notebooks/pseudobulk.html>`_ .
+
         ]]>
     </help>
     <citations>
-        <citation type="doi">doi.org/10.1093/bioadv/vbac016</citation>
+        <citation type="doi">10.1093/bioadv/vbac016</citation>
     </citations>
 </tool>