-
Notifications
You must be signed in to change notification settings - Fork 12
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
sample_modifiers applied to subsamples #435
Comments
The motivation for wanting to be able to do this relates to issue #434. Specifically, I want to be able to separate sample "properties" from "data paths". If this is actually a feature request (ie, there is no easy way to do this atm) then can I propose the idea of a "merge table", as similar to a subsample table in that it gets merged into the |
Digging deeper, it looks like that this is a feature request. But a simple implementation (rather than introducing a |
This makes a lot of sense to me, and I like the idea. I also agree that just making But as I think about this more, I'm not certain this is better than the way I've typically approached this in the past: which is to use a combined append/derived attribute. With this approach, I simply don't put the "data paths" into the sample table at all, I only put them into the project config file. You can do 1) use This way, the paths are solely encoded in derived attribute modifiers, and the sample table has no paths. I discuss this a little bit here: https://pep.databio.org/en/latest/howto_eliminate_paths/ You can make it even more powerful in this example by not including the |
Thanks! Your suggestion works beautifully. For anyone stumbling on this thread, my toy example looks like this:
.. saved as
If I get time I'll make a PR to extend the documentation to show how to compbine |
This is working great when the sample table is indexed by Here is my reprex ... First,
.. and my
I then try to load the sample sheet with ...
... and I get the following traceback:
If I rename the |
Indeed. in fact I think to use it with subsamples you will also need to specify |
Thanks @nsheff Can you please elaborate a little? Here's an even simpler reprex for you... Take this example. When I try to load this with Now add the following:
Load this with
Rather than |
FWIW, ammending
For context, our motivation for not simply using |
Yes, you found a bug, and I have fixed it locally. Will push soon. Thanks! |
Thanks! :) |
Try version 0.35.5 (now released) and see if this solves it for you. |
Thanks Nathan, I have tested this on my original reprex and it solves the problem. Thanks for fixing this so quickly! |
When a
subsample_table
is merged into thesample_table
the new columns resulting from the merge are list columns.This makes sense, as part of the motivation for subsample tables is to cater for situations where there a single sample has multiple values for a given property (column).
However, applying
sample_modifiers
such asderive
breaks on these list columns.More natural behaviour would be to iteratively apply the sample modifier rules to all elements in the list.
Alternatively, perhaps single item lists could be "unlisted" to become normal columns, and thus subject to
sample_modifiers
.Not sure if this a feature request or a "how to" question...
The text was updated successfully, but these errors were encountered: