KaiAragaki / gplate2

Other
0 stars 0 forks source link

easier well(s) creation #1

Open KaiAragaki opened 2 months ago

KaiAragaki commented 2 months ago

Making wells should be dead simple, I think.

Some things that should be possible:

# Create a row of wells
well(1:10, 1)

# Create a column of wells
well(1, 1:10)

# Create a matrix of wells
well(1:10, 1:10, matrix = TRUE)

# Create wells where each contains a letter
well(1:10, 1, content = letters[1:10])

# Create wells where every well contains the first 10 letters
well(1:10, 1, content = list(letters[1:10]))

# Create a matrix of wells where each well contains a number
well(1:10, 1:10, content = 1:100, matrix = TRUE)

# 1 11 ...
# 2 12 ...
# 3 13 ...
# 4 14 ...
# : :  ...

# Fill matrix by row:
well(1:10, 1:10, content = 1:100, matrix = TRUE, byrow = TRUE)

# 1  2  ...
# 11 12 ...
# 21 22 ...
# 31 32 ...
# :  :  ...

well(1:10, rep(c(1, 2), each = 5), content = 1:10)
# 1 3 5 7 9
# 2 4 6 8 10

well(1:10, rep(c(1, 2), each = 5), content = 1:10, byrow = TRUE)
# 1 2 3 4 5
# 6 7 8 9 10

These should probably error:

# Mismatch, non-multiple content
well(1:10, 1, content = letters[1:9])

# Likewise:
well(1:10, 1:10, content = 1:99, matrix = TRUE)
well(1:10, 1:10, content = 1:9)
KaiAragaki commented 2 months ago

I think these should probably be calls to plate rather than well since a plate is a collection of wells