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

Update Anndata to 0.10.9 #6309

Merged
merged 17 commits into from
Sep 14, 2024
Merged

Conversation

pavanvidem
Copy link
Member

FOR CONTRIBUTOR:

  • I have read the CONTRIBUTING.md document and this tool is appropriate for the tools-iuc repo.
  • License permits unrestricted use (educational + commercial)
  • This PR adds a new tool or tool collection
  • This PR updates an existing tool or tool collection
  • This PR does something else (explain below)

This update adds some new user-requested features from #6025

@bgruening
Copy link
Member

If you have time you should really change the tests from sim_size to some better more strict asserts.

<token name="@VERSION_SUFFIX@">0</token>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">anndata</requirement>
<requirement type="package" version="3.0.6">loompy</requirement>
<requirement type="package" version="1.26.4">numpy</requirement>
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

@pavanvidem pavanvidem Sep 14, 2024

Choose a reason for hiding this comment

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

Turned out it was issue was only with the loompy package. I moved all the loompy functions to a modify_loom tool and added the numpy requirement there so that all the anndata functions can use numpy 2.

tools/anndata/manipulate.xml Show resolved Hide resolved
<when value="flag_genes">
<repeat name="gene_flags" title="Flag genes that start with these names">
<param name="startswith" type="text" label="Text that you expect the genes to be flagged to start with" help="for example, 'MT-' for mito genes"/>
<param name="col_name" type="text" label="Name of the column in var.names where this boolean flag is stored" help="for example, name this column as 'mito' for mitochondrial genes."/>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<param name="col_name" type="text" label="Name of the column in var.names where this boolean flag is stored" help="for example, name this column as 'mito' for mitochondrial genes."/>
<param name="col_name" type="text" label="Name of the column in var.names where this boolean flag is stored" help="For example, name this column as 'mito' for mitochondrial genes."/>

</when>
<when value="flag_genes">
<repeat name="gene_flags" title="Flag genes that start with these names">
<param name="startswith" type="text" label="Text that you expect the genes to be flagged to start with" help="for example, 'MT-' for mito genes"/>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<param name="startswith" type="text" label="Text that you expect the genes to be flagged to start with" help="for example, 'MT-' for mito genes"/>
<param name="startswith" type="text" label="Text that you expect the genes to be flagged to start with" help="For example, 'MT-' for mito genes"/>

Copy link
Member

Choose a reason for hiding this comment

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

Should we add a validator here ... eg. no whitespace?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@pavanvidem pavanvidem marked this pull request as ready for review September 13, 2024 20:01
@pavanvidem
Copy link
Member Author

If you have time you should really change the tests from sim_size to some better more strict asserts.

Done for all h5 files

Comment on lines 43 to 45
#if $in.adata_format == 'mtx'
&& rm -rf mtx
#end if
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#if $in.adata_format == 'mtx'
&& rm -rf mtx
#end if

Galaxy will clean-up, you don't need to do that.

#end if
adata.write('anndata.h5ad', compression='gzip')
print(adata)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
print(adata)

Copy link
Member Author

@pavanvidem pavanvidem Sep 14, 2024

Choose a reason for hiding this comment

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

print is needed here. I assert the matrix dimensions in the stdout.

<when value="umi_tools">
<param name="input" type="data" format="tabular" label="condensed count matrix from UMI tools"/>
<when value="v3_10x">
<param name="features" type="data" format="tabular" label="Features"/>
Copy link
Member

Choose a reason for hiding this comment

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

Please add to help, how does such a file need to look like?

</assert_stdout>
<output name="anndata" value="import.tsv.h5ad" ftype="h5ad" compare="sim_size"/>
Copy link
Member

Choose a reason for hiding this comment

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

you are not testing the output file?

Copy link
Member Author

Choose a reason for hiding this comment

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

there are no annotations in the anndata to assert h5 keys. That is why I added the print(data) so that we can at least compare the matrix dimensions with assert_stdout.

</assert_stdout>
<output name="anndata" value="import.csv.h5ad" ftype="h5ad" compare="sim_size"/>
Copy link
Member

Choose a reason for hiding this comment

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

You are not testing the output file?

@@ -226,8 +204,10 @@ adata.write('anndata.h5ad')
<conditional name="tenx">
<param name="use" value="no"/>
</conditional>
</conditional>
<output name="anndata" value="import.mtx.no_10x.h5ad" ftype="h5ad" compare="sim_size"/>
Copy link
Member

Choose a reason for hiding this comment

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

Some here ...

adata.write('anndata.h5ad')
#if $manipulate.function != 'split_on_obs'
adata.write('anndata.h5ad', compression='gzip')
print(adata)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
print(adata)

@@ -1,90 +1,33 @@
<tool id="anndata_export" name="Export AnnData and loom files" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
<description>Interconvert AnnData and Loom formats</description>
<tool id="anndata_export" name="Export AnnData" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
Copy link
Member

Choose a reason for hiding this comment

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

please add, make sure, a profile version is in all tools

Suggested change
<tool id="anndata_export" name="Export AnnData" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
<tool id="anndata_export" name="Export AnnData" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE_VERSION@">

Copy link
Member Author

Choose a reason for hiding this comment

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

set profile to 21.09 (same as scanpy) to support other instances. See here: #6001

@bgruening bgruening merged commit 67b3808 into galaxyproject:main Sep 14, 2024
14 checks passed
@bgruening
Copy link
Member

Thanks @pavanvidem! Good luck with the trainings!

@mvdbeek
Copy link
Member

mvdbeek commented Sep 14, 2024

Attention: deployment skipped!

https://github.com/galaxyproject/tools-iuc/actions/runs/10864948585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants