tp2750 / dataplates.jl Goto Github PK
View Code? Open in Web Editor NEWJulia Package for working with data on SBS or microtiter (MTP) plates
Julia Package for working with data on SBS or microtiter (MTP) plates
Julia Package for working with data on SBS or microtiter (MTP) plates.
This is a rewrite of MTP.jl which was never registered.
Similar use-cases in R: https://github.com/ropensci/plater, https://github.com/jpquast/ggplate
Below are implementation thoughts.
Not much done yet:
struct DataPlate
name::String
barcode::String
geometry::Int
quadrant_pattern::Vector{Int}
values::Vector{WellValues}
end
Assert that all value-vectors have length == geometry.
struct WellValues{T} T
name::String ## the "column name"
values::Vector{T} ## Well values are always stored column-wise
end
Well values are always stored column-wise. Re-sort on well to get them row-wise
T can be numeric or String.
T can itself be a vector, so this can also hold time-series as reader-curves.
But we probably want to keep this use case separate.
struct SparseWellValue{T}
well_name::String
value::T
end
Data is read in from a "plate format" like the one used in plater:
The "Name" is used a column name for the values in the "wells".
If read in from a spread-sheet workbook, the sheet name is used as plate name, and the file name is used as plateset name.
Name | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | V1 | V2 | V3 | V4 | V5 | V6 | V7 | V8 | V9 | V10 | V11 | V12 |
B | ... | |||||||||||
... |
When the data is converted to DataFrame is looks like this:
plateset_name | plate_name | geometry | well | Name |
---|---|---|---|---|
PS1 | Plate1 | 96 | A01 | V1 |
PS1 | Plate1 | 96 | A02 | V2 |
... |
If the input data is sparse (not all wells have values), the DataFrame can be sparse as well (only wells with values) or full depending on a kw parameter.
It makes everything easier, if we just decide on an order.
If we sort by column as default (A01, B01, ...) it is easy to resort to row-wise (A01, A02, ...)
The "A01" is nice as it sorts in data frames and spread sheets.
However, it does not scale to 1536, where we have wells: A01, ..., Z48, AA01, ..., AF48
We will consider 1536, when we get there.
The advantage of A01 wins for now.
This is going into docs.
julia> wells(6)
6-element Vector{String}:
"A01"
"B01"
"A02"
"B02"
"A03"
"B03"
julia> sort(wells(6))
6-element Vector{String}:
"A01"
"A02"
"A03"
"B01"
"B02"
"B03"
julia> DataFrame(DataPlate("Plate1",6))
6×4 DataFrame
Row │ platename barcode well well006
│ String String String String
─────┼─────────────────────────────────────
1 │ Plate1 Plate1 A01 A01
2 │ Plate1 Plate1 B01 B01
3 │ Plate1 Plate1 A02 A02
4 │ Plate1 Plate1 B02 B02
5 │ Plate1 Plate1 A03 A03
6 │ Plate1 Plate1 B03 B03
StructEquality gives us:
julia> DataPlate("Plate1") == DataPlate("Plate1", "Plate1")
julia> DataPlate("Plate1") == DataPlate("Plate1", "Plate1", 96)
TODO:
julia> DataFrame(DataPlate("Plate1",6; activity = [1,2,3,4,5,6]))
row, col should check that input has form r"\D+\d+"
Function for generating unique barcodes.
Make barcodes funtion (prefix, width; count=1, start=missing, sep="")
Compose by prefix, start, sep, index
Index Counts Up from 1.
For index missing use last n digits of epoch.
N= width - length(prefix) - length(sep) - digits(count)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.