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

Option to skip loading data from specific plates? #39

Open
jeffclimax opened this issue Jun 1, 2023 · 2 comments
Open

Option to skip loading data from specific plates? #39

jeffclimax opened this issue Jun 1, 2023 · 2 comments

Comments

@jeffclimax
Copy link

First of all thanks for this package! It's much better than the equivalent thing I rolled myself before finding it.

I've started using it not only for loading data after an experiment, but also for organizing the prep work (serial dilutions, splitting master mix into a row for multichannel). But now it complains that the "Prep" plate doesn't have a meta.path with data to load. Here's the slightly simplified plate layout:

[meta]

paths = '{}_data.txt'

[plate.Prep.col]

'7,10'.dilution = 1
'8,11'.dilution = 4
'9,12'.dilution = 16

[plate.qPCR1.col]

'1,4,7,10'.dilution = 1
'2,5,8,11'.dilution = 4
'3,6,9,12'.dilution = 16

[plate.qPCR1.block.3x4]

A1.sample = 'PI682'
A4.sample = 'PI683'
A7.sample = 'PI684'
A10.sample = 'PI685'
E1.sample = 'PI690'
E4.sample = 'PI691'
E7.sample = 'ING364'
E10.sample = 'ING190'

[plate.qPCR2.block.1x4]

A9.sample = 'NPC'
A9.dilution = 1

[plate.Prep.block.3x1]

A7.sample = 'PI682'
A10.sample = 'PI683'
B7.sample = 'PI684'
B10.sample = 'PI685'
C7.sample = 'PI690'
C10.sample = 'PI691'
D7.sample = 'ING364'
D10.sample = 'ING190'

[plate.Prep.block.6x1]

E7.sample = 'H20'
E7.dilution = 1

F7.sample = 'Mix'
F7.dilution = 1
Screen Shot 2023-06-01 at 10 04 08 AM
LayoutError: example.toml: '/path/to/Prep_data.txt' for plate 'Prep' does not exist

Is there a way to exclude the Prep plate when loading data, but include it when showing the wellmap?

While writing this question I discovered a workaround that might be fine: one main layout file with the experimental plates, and a second layout file that meta.includes the experimental one and adds the Prep plate. Show the second one, but load the first.

@kalekundert
Copy link
Owner

Thanks for the kind words! I'm glad this package has been useful to you!

This feature definitely doesn't already exist. The work-around you found is good, and could be the best way to do it. One other approach that I can think of would be to merge the data into the layout yourself (rather than having wellmap do it for you). This would give you the ability to drop the prep plates before doing the merge, and it wouldn't be that much extra code. Here's a rough outline of what you'd need to do: (i) call wellmap.load() without the merge_cols argument to get the layout data frame, (ii) load the experimental data into a separate data frame yourself, and make sure it has a column specifying the path that each row was loaded from, (iii) call pd.merge() on the two data frames. Let me know if that doesn't make sense.

I don't think it would be that hard to add a feature like this to wellmap.load(). This does seem like a bit of a niche use-case, and there are work-arounds, but it might still be worth doing. I could imagine something like this being useful if you have a big layout for a multiday experiment, and you want to look at some of the data before the whole experiment is finished. Unfortunately, I'm not likely to get around to it any time soon. I've been meaning to work on a bunch of the other open issues for a while now, but it's been hard to make time for.

@jeffclimax
Copy link
Author

No worries, even saying you don't have time so quickly is way above average. And it is a niche use case. I'm not sure I would want to change the default of complaining when it can't find the experimental data since that seems important.

I'll go ahead with the including in a prep file setup for now and if that turns out to be less than ideal I'll try to get a pull request together changing something else.

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

No branches or pull requests

2 participants