Repository navigation
Conversation
|
please review |
|
⏳ Some CI checks are still running. Please wait for them to complete before requesting a review. |
|
I also checked all available tutorials on the liana site and put everything that was missing from there, here |
|
There is also an overlapping PR in #7827 The 17 LR databases do not need a data manager at all.
If we prefer this PR (with or without a Data Manager): Ready to merge as-is if on-demand downloads for HCOP / MetalinksDB are acceptable. If we prefer #7827: The following features and fixes from this PR are currently missing in #7827 and would be worth porting over: Happy to adapt this PR in either direction based on preference. |
|
@khaled196 What do you think? |
Hi Amir, Thank you for your work on Liana. As the owner of that pull request, I am happy to close it and transfer whatever is needed to this pull request. Regarding the data managers, I can't provide a direct answer, personaly I don't like them, but depend on if users are aware of the on-demand installation method. If they have learned about this tool from Galaxy, it makes sense to keep them in the data managers, but if they know about that, then I agree about removing them. This would save us the burden of maintaining the wrapper data managers. The primary reason for using data managers was that the liana api installed them from links, and you could use it as an alternative to the built-in. final decision will depend on yourself and @pavanvidem |
| #if str($method.orderby).strip() != '': | ||
| orderby='$method.orderby'.strip(), | ||
| #else: | ||
| orderby='$method.colour'.strip() if hasattr($method, 'colour') and str($method.colour).strip() != '' else None, |
There was a problem hiding this comment.
I think this fallback line will break. $method.colour is resolved by Cheetah before Python ever runs, so for tileplot/circle (no colour param) you'd get a NotFound as soon as someone sets Top N without a sort column. For dotplot, hasattr($method, ...) renders the whole conditional dict (including dataset wrapper reprs) into the script, which probably won't even parse. The tileplot test sets orderby, so this path never runs in CI.
Could you do the check in Cheetah instead? Something like:
#else if 'colour' in $method and str($method.colour).strip() != '':
orderby='$method.colour',
#end if
and maybe add a test with top_n set and orderby left empty.
| n_components=$method.n_components, | ||
| #else: | ||
| n_components=None, | ||
| k_range=range($method.k_range_min, $method.k_range_max), |
There was a problem hiding this comment.
The PR description says this was fixed to range(min, max + 1), and the label on L311 says the maximum is inclusive, but here it's still range(min, max). Test 8's expected message range(1, 5) with k_range_max=5 confirms it's exclusive. I'd go with + 1 so it matches the label.
There was a problem hiding this comment.
The PR description was old, I changed it to match the tool defaults
| </output> | ||
| </test> | ||
| <!-- Test 8: nmf with automatic elbow rank estimation (n_components empty; random test matrix has no elbow) --> | ||
| <test expect_failure="true"> |
There was a problem hiding this comment.
Testing the failure path is fine, but this means auto-elbow never actually succeeds anywhere in the tests. Is there a small input with a real elbow we could use for a happy-path test, so we know n_components=None works end to end?
| <expand macro="version_command"/> | ||
| <command detect_errors="exit_code"><![CDATA[ | ||
| cat '$script_file' > '$hidden_output' && | ||
| python '$script_file' >> '$hidden_output' 2>&1 |
There was a problem hiding this comment.
With 2>&1 going into hidden_output, a failed job shows the user an empty stderr unless they happened to tick "Output Log". This is the one tool that downloads things (HCOP, MetalinksDB), so it's the one most likely to fail on network problems. Maybe drop the redirect so tracebacks reach stderr like in the other tools?
| </param> | ||
| <when value="rank_aggregate"> | ||
| <expand macro="inputs_anndata" format="h5ad,h5mu" label="Annotated data matrix (AnnData, or MuData)"/> |
There was a problem hiding this comment.
Moving adata inside the method conditional changes the input path from adata to method|adata, so existing workflows using Liana Methods will lose that connection after upgrading. That might be acceptable for a major bump, but if you keep it, it's worth calling out in the help/README. Misty/Multi/Utils keep adata at the top level, so the methods tool is the odd one out.
| **de_method, n_perms, seed**: Differential expression method, permutation count (if applicable), and RNG seed | ||
| - **compute_global_specificity**: Computes permutation-based global specificity scores and p-values per receiver cell type from spatial inflow scores. | ||
| - *Input*: Inflow `AnnData` (`.h5ad`) produced by `inflow`. | ||
| - *Output*: Updated Inflow `AnnData` (`.h5ad`) with specificity statistics in `.uns['global_res']`, plus an optional tabular file (`.tsv`). |
There was a problem hiding this comment.
Small help mismatch: the default uns_key is global_interactions, not global_res.
| ------- | ||
| - **df_to_lr**: Combines per-cell-type differential expression (DEA) statistics with expression proportions into a ligand-receptor interaction table. | ||
| - *Input*: `AnnData` (`.h5ad`) and a DEA table (`.tsv`) containing gene names, cell-type labels (`groupby`), and test statistics. | ||
| - *Output*: Tabular file (`.tsv`) of differential ligand-receptor interactions. |
There was a problem hiding this comment.
df_to_lr also writes to .uns[key_added] and returns the AnnData, so the output isn't only the TSV. Also, output_tsv defaults to true here but false everywhere else. Is that on purpose?
| - *Output*: `MuData` (`.h5mu`) with one pseudobulk modality per cell type. | ||
|
|
||
| - **filter_view_markers**: Filters out background marker genes of other cell types from `adata_to_views` pseudobulk views. | ||
| - *Input*: `MuData` (`.h5mu`) produced by `adata_to_views` and a marker gene table (`.tsv`, cell types as columns and marker genes as rows). |
There was a problem hiding this comment.
This says "cell types as columns and marker genes as rows", but the param help on L290 and the code expect a two-column view→gene table. One of them needs updating.
| <!-- Test 9: rank_aggregate with custom key_added --> | ||
| <test expect_num_outputs="2"> | ||
| <param name="adata" location="https://zenodo.org/records/18388645/files/pbmc_small.h5ad"/> | ||
| <!-- Test 10: rank_aggregate by_sample + spatial proximity weighting --> |
There was a problem hiding this comment.
Nit: the test name says "spatial proximity weighting", but no spatial_key is set, so the spatial path isn't tested anywhere. Either rename the test or add a spatial run.
| <xml name="param_plot_size"> | ||
| <param argument="size" type="text" value="" optional="true" label="Size by column" help="Column name in liana_res DataFrame to map to dot size. Larger values = larger dots."> | ||
| <xml name="param_plot_size" token_value="specificity_rank" token_optional="false"> | ||
| <param argument="size" type="text" value="@VALUE@" optional="@OPTIONAL@" label="Size by column" help="Column name in liana_res define color mapping"> |
There was a problem hiding this comment.
Nit: copy-paste in the help text. "define color mapping" should be about size. Also, now that both colour and size carry an empty_field validator, the optional token can't really be true, so it might be cleaner to drop it.
Summary
Upgrades the liana tool suite from
1.6.1to2.0.0, fixes runtime/API bugs, removes the Data Manager dependency which was not needed, adds new2.0.0methods, and expands test coverage.Why No Data Manager Is Needed:
liana/resource/omni_resource.csv).from_data_table="liana_resources"with a static<select>macro of the 17 bundled resources and removedtool-data/andtool_data_table_conf.xml.*.Bugs Fixed
liana_methods: FixedTypeErrorfrom passingn_permsto non-permutation methods (logfc,natmi,connectome,singlecellsignalr,geometric_mean); fixedbivariaten_permsto allowNone/0(analytical p-values); fixedestimate_metalinksto accept the requiredresource,pd_net, andt_nettables.liana_misty: FixedTypeErrorinlrMistyData(bypass_intramoved to model call).liana_multi: Fixedto_tensor_c2c(uns_keyinstead of stringliana_res, portable.npyoutput),lrs_to_views(added requiredsample_key), andnmf(range(min, max + 1)instead of tuplek_range).liana_plot: Fixedmisty_contributionscrash by wrappingMuDatainli.mt.MistyData; added missinggroupbytocircle.liana_utils: Fixedanndata_outoutput filter formdata_to_anndataon.h5muinputs.Functions Added
liana_methods:scseqcomm,inflow,compute_global_specificity,lric,cross_pcf,get_lric_auc, plus.by_sample(), spatial proximity weighting, and multi-modalMuDatasupport across single-cell L-R methods.liana_misty:MistyData(custom multi-viewAnnDatainputs orMuData), separateextra_adata, and optional.tsvexports.liana_multi:filter_view_markers,lrdata_to_mudata.liana_plot:elbow,feature_by_group,annulus,lric_lineplot,lric_divergence.liana_resource:translate_column, direct network exports (export_networks) inget_metalinks, andsource/targetformatting inget_hcop_orthologs.liana_utils:spatial_pair_proximity,expand_coordinates,interpolate_adata.Functions Removed or Simplified
show_resources: Removed fromresource.xml(all 17 built-in resources are now directly selectable in the dropdown UI).plot.xml: Simplified all plotting methods to takeAnnData(.h5ad) orMuData(.h5mu) directly.Functions Skipped / Commented Out
find_causalnet&build_prior_network: Implemented and tested inliana_methods.xml, but commented out because Bioconda'sliana:2.0.0container shipscorneto 1.0.0rc9(which removedcorneto.methods.carnival, required byliana 2.0.0's pinnedcorneto==0.9.1a6). Ready to uncomment once upstream/Bioconda resolvescornetocompatibility.show_methods,show_resources,describe_metalinks,get_metalinks_values): Skipped as their options are exposed directly in the Galaxy UI dropdowns.get_lric_divergence&estimate_elbow: Already executed and reported insideplot.xml(lric_divergence) andmulti.xml(nmfwith emptyn_components).I checked all the arguments and functions against the upstream API.
FOR CONTRIBUTOR:
tool update guide)
There are two labels that allow to ignore specific (false positive) tool linter errors:
skip-version-check: Use it if only a subset of the tools has been updated in a suite.skip-url-check: Use it if github CI sees 403 errors, but the URLs work.To request a review once your PR is ready, comment "please review" on the PR. This will
automatically apply the
ready-for-reviewlabel if the PR is not a draft, all reviewthreads are resolved, and all CI checks have passed. The label is removed once a reviewer
submits a review; after addressing it, comment "please review" again to ping the reviewers.