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 anndata2seurat conversion #265

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
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
17 changes: 16 additions & 1 deletion tools/tertiary-analysis/sceasy/sceasy_convert.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
-e 'srt <- readRDS("input.rds")'
-e 'sceasy::convertFormat(srt, outFile="output.h5ad", from="seurat", to="anndata", assay="${conversion.assay}", main_layer="${conversion.dtype}")'
-e 'print(srt)'
#else if $conversion.direction == "anndata2seurat"
-e 'srt <- sceasy::convertFormat("input.h5ad", from="anndata", to="seurat", main_layer="${conversion.assay}")'
-e 'saveRDS(srt, "output.rds")'
-e 'print(srt)'
#end if
]]></command>

Expand Down Expand Up @@ -74,6 +78,14 @@
<option value="scale.data">scale.data</option>
</param>
</when>
<when value="anndata2seurat">
Copy link
Member

Choose a reason for hiding this comment

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

I think that you also need to add an option in the conditional.param block (lines 42 to 46) for anndata2seurat.

<param name="input_object_file" type="data" format="h5ad" label="Input object in AnnData format"/>
<param name="assay" type="text" value="RNA" label="Name of assay in Seurat object to store expression values" help="Please make sure the assay exists"/>
<option value="counts" selected="true">counts</option>
<option value="logcounts">logcounts</option>
<option value="cpm">cpm</option>
</param>
</when>
</conditional>
</inputs>

Expand All @@ -87,6 +99,9 @@
<data name="output_anndata" format="h5" from_work_dir="output.h5ad" label="${tool.name} on ${on_string}: AnnData">
<filter>conversion['direction'].endswith('anndata')</filter>
</data>
<data name="output_seurat" format="rdata" from_work_dir="output.rds" label="${tool.name} on ${on_string}: Seurat">
<filter>conversion['direction'].endswith('seurat')</filter>
</data>
</outputs>

<tests>
Expand All @@ -105,7 +120,7 @@ Convert scRNA data object between formats `sceasy::convertFormat()`
Support the following conversion:
* Loom <-> SingleCellExperiment (full)
* SingleCellExperiment -> AnnData (matrix, metadata, reducedDim)
* Seurat -> AnnData (matrix, metadata, reducedDim)
* Seurat <-> AnnData (matrix, metadata, reducedDim)

@HELP@

Expand Down