Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add drug2cell tool #6684

Open
wants to merge 77 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
37cf263
Create drug2cell.xml
Mennayousef Jan 21, 2025
030d377
Create drug2cell.yaml
Mennayousef Jan 21, 2025
1b883a9
Create test-data
Mennayousef Jan 21, 2025
887abce
Delete tools/drug2cell/test-data
Mennayousef Jan 21, 2025
63646cc
Create pbmc3k_processed.h5ad
Mennayousef Jan 21, 2025
d4aba80
Update pbmc3k_processed.h5ad
Mennayousef Jan 21, 2025
5a0393c
Rename drug2cell.yaml to .shed.yml
Mennayousef Jan 21, 2025
fd4789f
Update tools/drug2cell/drug2cell.xml
Mennayousef Jan 21, 2025
65669b8
Update drug2cell.xml
Mennayousef Jan 21, 2025
36aeb5e
use subset of the test data file
Mennayousef Jan 21, 2025
577cf8d
Merge branch 'main' of https://github.com/Mennayousef/tools-iuc
Mennayousef Jan 21, 2025
c1bc7d9
Update drug2cell.xml
Mennayousef Jan 21, 2025
b11035a
further subset test data file
Mennayousef Jan 21, 2025
9c5f922
Merge branch 'main' of https://github.com/Mennayousef/tools-iuc
Mennayousef Jan 21, 2025
0e99f36
Update drug2cell.xml
Mennayousef Jan 21, 2025
5011fae
Update drug2cell.xml
Mennayousef Jan 21, 2025
1908854
Update tools/drug2cell/.shed.yml
bgruening Jan 21, 2025
6d417bf
Update tools/drug2cell/drug2cell.xml
Mennayousef Jan 21, 2025
e807950
Update tools/drug2cell/drug2cell.xml
Mennayousef Jan 21, 2025
548a155
Update drug2cell.xml
Mennayousef Jan 21, 2025
f0b1fbd
Create .gitignore
Mennayousef Jan 21, 2025
b270fa4
Delete tools/drug2cell/test-data/expected-output/.gitignore
Mennayousef Jan 21, 2025
39a8624
Create .gitkeep
Mennayousef Jan 21, 2025
cbf508b
Delete tools/drug2cell/test-data/expected-output directory
Mennayousef Jan 21, 2025
0e55143
put output files in test-data folder
Mennayousef Jan 21, 2025
36b5cf6
Update tools/drug2cell/drug2cell.xml
Mennayousef Jan 21, 2025
c129d75
Update pbmc3k_processed.h5ad
Mennayousef Jan 26, 2025
102d6bb
Merge branch 'main' of https://github.com/Mennayousef/tools-iuc
Mennayousef Jan 26, 2025
f3f0a5b
Update drug2cell.xml
Mennayousef Jan 26, 2025
7ac7919
Update drug2cell.xml
Mennayousef Jan 26, 2025
288d9be
fix a few issues found during debugging
bgruening Jan 26, 2025
ed1976f
fix a few issues found during debugging
bgruening Jan 26, 2025
93234a6
add tiny test file
bgruening Jan 26, 2025
132dc36
Update drug2cell.xml
Mennayousef Jan 27, 2025
afd53c0
Add files via upload
Mennayousef Jan 31, 2025
f0632b1
Update tools/drug2cell/drug2cell.xml
Mennayousef Jan 31, 2025
763c8f7
Update drug2cell.xml
Mennayousef Jan 31, 2025
6f777fc
Update drug2cell.xml
Mennayousef Jan 31, 2025
f448bb6
Delete tools/drug2cell/test-data/pbmc3k_processed.h5ad
Mennayousef Jan 31, 2025
8366d15
Create umap_plot.png
Mennayousef Jan 31, 2025
cf7e25d
Create dotplot1.png
Mennayousef Jan 31, 2025
0349f97
Create dotplot2.png
Mennayousef Jan 31, 2025
8995b2c
Update tools/drug2cell/drug2cell.xml
Mennayousef Feb 2, 2025
45af189
Update tools/drug2cell/drug2cell.xml
Mennayousef Feb 2, 2025
33a7170
Update drug2cell.xml
Mennayousef Feb 7, 2025
0fb4e89
Delete tools/drug2cell/test-data/dotplot1.png
Mennayousef Feb 7, 2025
6547e24
Delete tools/drug2cell/test-data/dotplot2.png
Mennayousef Feb 7, 2025
bed202b
Delete tools/drug2cell/test-data/fake_small_data.h5ad
Mennayousef Feb 7, 2025
f47f754
Delete tools/drug2cell/test-data/pbmc3k_tiny.h5ad
Mennayousef Feb 7, 2025
8e3c685
Delete tools/drug2cell/test-data/umap_plot.png
Mennayousef Feb 7, 2025
9fa2390
Create test-data
Mennayousef Feb 7, 2025
13b8a23
Delete tools/drug2cell/test-data
Mennayousef Feb 7, 2025
2acc0aa
Create tiny_adata.h5ad
Mennayousef Feb 7, 2025
9ac2c8d
Update tiny_adata.h5ad
Mennayousef Feb 7, 2025
52837b6
Update drug2cell.xml
Mennayousef Feb 7, 2025
53deecf
Update drug2cell.xml
Mennayousef Feb 7, 2025
b4cf01a
Update tiny_adata.h5ad
Mennayousef Feb 7, 2025
44891cb
Merge branch 'main' of https://github.com/Mennayousef/tools-iuc
Mennayousef Feb 7, 2025
109a8e0
Delete tools/drug2cell/test-data/tiny_adata.h5ad
Mennayousef Feb 7, 2025
8656564
Update drug2cell.xml
Mennayousef Feb 7, 2025
a47a01a
Create d2c_output.h5ad
Mennayousef Feb 7, 2025
0949bf5
Merge branch 'main' of https://github.com/Mennayousef/tools-iuc
Mennayousef Feb 7, 2025
0093ae4
Create tiny_adata.h5ad
Mennayousef Feb 7, 2025
4088dd9
Update d2c_output.h5ad
Mennayousef Feb 7, 2025
b1e52ce
Update drug2cell.xml
Mennayousef Feb 7, 2025
4326113
Update tools/drug2cell/drug2cell.xml
Mennayousef Feb 11, 2025
bbf49fa
Update drug2cell.xml
Mennayousef Feb 11, 2025
334bfb2
Update drug2cell.xml
Mennayousef Feb 11, 2025
68c4888
Update drug2cell.xml
Mennayousef Feb 11, 2025
423cfd2
Update drug2cell.xml
Mennayousef Feb 11, 2025
687d4e0
Update drug2cell.xml
Mennayousef Feb 11, 2025
e76375a
Update drug2cell.xml
Mennayousef Feb 11, 2025
8422619
Update drug2cell.xml
Mennayousef Feb 11, 2025
6210b23
without has_h5_attribute
Mennayousef Feb 11, 2025
94e9618
Update drug2cell.xml
Mennayousef Feb 11, 2025
91a8944
Update drug2cell.xml
Mennayousef Feb 11, 2025
4876e93
add assert_contents to test section
Mennayousef Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tools/drug2cell/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: drug2cell
owner: iuc
description: Collection of utility functions for gene group activity evaluation in scanpy.
homepage_url: https://github.com/Teichlab/drug2cell
long_description: |
This tool uses the drug2cell package to score gene groups based on drug-target data from the ChEMBL database. It performs differential expression analysis to identify gene groups up-regulated in particular clusters and visualizes the results in UMAP and dotplot formats.
remote_repository_url: https://github.com/Teichlab/drug2cell
categories:
- Single cell
bgruening marked this conversation as resolved.
Show resolved Hide resolved
107 changes: 107 additions & 0 deletions tools/drug2cell/drug2cell.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<tool id="drug2cell" name="drug2cell" version="0.1.2+galaxy0" python_template_version="3.5" profile="21.05">
Mennayousef marked this conversation as resolved.
Show resolved Hide resolved

<description>Collection of utility functions for gene group activity evaluation in scanpy</description>

<macros>
<token name="@TOOL_VERSION@">0.1.2</token>
<token name="@VERSION_SUFFIX@">0</token>
</macros>

<requirements>
<requirement type="package" version="1.0">drug2cell</requirement>
<requirement type="package" version="1.0">scanpy</requirement>
<requirement type="package" version="1.0">blitzgsea</requirement>
</requirements>

<command>
<![CDATA[
# Python script to execute drug2cell scoring and differential expression
python3 <<CODE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use a configfile in Galaxy to store your code and reuse this.

<configfile name="script_file"><![CDATA[

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh it seems you have reverted the configfile change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it was just a test to see if without configfile will pass all checks, unfortunately it is still failing the test. with this error "Test output file (expected-output/dotplot2.png) is missing. If you are using planemo, try adding --update_test_data to generate it." I tried to manually create the expected-output folder, but no luck. Although the test passes when I run local galaxy instance.

import scanpy as sc
import drug2cell as d2c
import blitzgsea as blitz

# Load AnnData object
adata = sc.read("adata.h5ad")

# Perform scoring with raw data or normalized data
use_raw = "${use_raw}" == "true"
d2c.score(adata, use_raw=use_raw)

# Visualize the specified drug (UMAP)
sc.pl.umap(adata.uns['drug2cell'], color="${drug}", color_map="OrRd", save="umap_plot.png")

# Perform differential expression analysis
sc.tl.rank_genes_groups(adata.uns['drug2cell'], method="wilcoxon", groupby="louvain")
sc.pl.rank_genes_groups_dotplot(adata.uns['drug2cell'], swap_axes=True, dendrogram=False, n_genes=${n_genes}, save="dotplot1.png")

# Prepare arguments for dotplot visualization
plot_args = d2c.util.prepare_plot_args(adata.uns['drug2cell'], categories="${categories}".split(","))
sc.pl.dotplot(adata.uns['drug2cell'], groupby="louvain", swap_axes=True, **plot_args, save="dotplot2.png")
CODE
]]>
</command>

<inputs>
<!-- Input: AnnData object (processed scRNA-seq data) -->
<param name="adata" type="data" format="h5ad" label="AnnData Object" help="Select the processed AnnData object file containing your single-cell RNA-seq data" />

<!-- Option to select number of genes to visualize in the dotplot -->
<param name="n_genes" type="integer" label="Number of Genes for Dotplot"
min="1" max="20" help="Specify the number of genes to display in the dotplot (range: 1 to 20)." />

<!-- Option for visualizing a specific drug from ChEMBL -->
<param name="drug" type="text" label="Drug (CHEMBL ID)" help="Enter the ChEMBL ID of the drug to visualize." />

<!-- Option to perform differential expression analysis -->
<param name="use_raw" type="boolean" label="Use Raw Data for Drug Scoring" help="Choose whether to use raw data or normalized data for drug scoring." />

<!-- Option to categorize data for dotplot -->
<param name="categories" type="text" label="Categories for Dotplot" help="Enter a comma-separated list of categories to display in the dotplot." />
</inputs>

<outputs>
<!-- Output: One UMAP Plot -->
<data name="umap_plot" format="png" label="UMAP Plot" from_work_dir="umap_plot.png" />

<!-- Output: First Dotplot for Differential Expression -->
<data name="dotplot1" format="png" label="Dotplot of Gene Groups" from_work_dir="dotplot1.png" />

<!-- Output: Second Dotplot with customized categories -->
<data name="dotplot2" format="png" label="Dotplot with Custom Categories" from_work_dir="dotplot2.png" />
</outputs>

<tests>
<!-- Test case 1 -->
<test>
<param name="adata" value="../test-data/pbmc3k_processed.h5ad" />
<param name="use_raw" value="true" />
<param name="drug" value="CHEMBL1743048|OBINUTUZUMAB" />
<param name="n_genes" value="10" />
<param name="categories" value="B01,B02,B03" />
<output name="umap_plot" file="expected-output/umap_plot.png" />
<output name="dotplot1" file="expected-output/dotplot1.png" />
<output name="dotplot2" file="expected-output/dotplot2.png" />
</test>
</tests>

<help>
<![CDATA[
This tool uses the drug2cell package to score gene groups based on drug-target data from the ChEMBL database.
It performs differential expression analysis to identify gene groups up-regulated in particular clusters and visualizes the results in UMAP and dotplot formats.
]]>
</help>

<citations>
<citation type="bibtex">@article{kanemaru2023spatially,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use here type="doi" and use a doi instead.

title={Spatially resolved multiomics of human cardiac niches},
author={Kanemaru, Kazumasa and Cranley, James and Muraro, Daniele and Miranda, Antonio MA and Ho, Siew Yen and Wilbrey-Clark, Anna and Patrick Pett, Jan and Polanski, Krzysztof and Richardson, Laura and Litvinukova, Monika and others},
journal={Nature},
volume={619},
number={7971},
pages={801--810},
year={2023},
publisher={Nature Publishing Group UK London}
}</citation>
</citations>
</tool>
Binary file added tools/drug2cell/test-data/pbmc3k_processed.h5ad
Binary file not shown.
Loading