Title: | Non-Trivial Balance of Centrifuge Rotors |
---|---|
Description: | Find the numbers of test tubes that can be balanced in centrifuge rotors and show various ways to load them. Refer to Pham (2020) <doi:10.31224/osf.io/4xs38> for more information on package functionality. |
Authors: | Duy Nghia Pham [aut, cre] |
Maintainer: | Duy Nghia Pham <[email protected]> |
License: | GPL-3 |
Version: | 0.1.8 |
Built: | 2025-02-12 03:10:12 UTC |
Source: | https://github.com/phamdn/centrifuger |
Find the numbers of test tubes that can be balanced in centrifuge rotors and show various ways to load them. Refer to Pham (2020) doi:10.31224/osf.io/4xs38 for more information on package functionality.
centrifugeR helps obtain the perfect centrifuge balance.
Call rotor
to know how many tubes can be loaded into the
rotor and see different ways to place these tubes. Alternatively, call
launch
to run the Shiny app. Also, call
rotorVerify
to verify the balance of pre-existing tube
configurations. Call rotorSpeed
for RPM/RCF conversion.
centrifugeR: Non-Trivial Balance of Centrifuge Rotors.
Copyright (C) 2020-2022 Duy Nghia Pham
centrifugeR is free
software: you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.
centrifugeR is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU
General Public License along with centrifugeR. If not, see
https://www.gnu.org/licenses/.
Duy Nghia Pham [email protected]
p2c
returns the coordinates of rotor holes. This is not meant to be
called directly.
p2c(x, y)
p2c(x, y)
x |
an integer or a vector, the hole position(s). |
y |
an integer, the number of rotor holes. |
p2c
returns a vector of coordinates.
pie2
was modified after pie
. This is not meant to be
called directly.
pie2( x, labels = names(x), edges = 200, radius = 0.8, clockwise = FALSE, init.angle = if (clockwise) 90 else 0, density = NULL, angle = 45, col = NULL, border = NULL, lty = NULL, main = NULL, panel = NULL, ... )
pie2( x, labels = names(x), edges = 200, radius = 0.8, clockwise = FALSE, init.angle = if (clockwise) 90 else 0, density = NULL, angle = 45, col = NULL, border = NULL, lty = NULL, main = NULL, panel = NULL, ... )
x |
See |
labels |
See |
edges |
See |
radius |
See |
clockwise |
See |
init.angle |
See |
density |
See |
angle |
See |
col |
See |
border |
See |
lty |
See |
main |
See |
panel |
a letter for labeling panel. |
... |
See |
pie2
returns a figure.
rotor
returns the numbers of tubes that can and cannot be loaded
in a centrifuge rotor and optionally shows various ways to balance a certain
number of tubes.
rotor(n, k = NULL, seed = 1, elapse = 1)
rotor(n, k = NULL, seed = 1, elapse = 1)
n |
an integer, the number of rotor holes. |
k |
an integer, the number of tubes (optional). |
seed |
an integer, the seed for random number generation. Setting a seed
ensures the reproducibility of the result. See |
elapse |
an integer, the constrained time in seconds for random sampling. |
The number of rotor holes n
ranges from 4
to
48
.
rotor
returns a list with two components:
check |
a list with three components:
|
load |
a list with three components:
|
Sivek G. On vanishing sums of distinct roots of unity. Integers.
2010;10(3):365-8.
Peil O, Hauryliuk V. A new spin on spinning your
samples: balancing rotors in a non-trivial manner. arXiv preprint
arXiv:1004.3671. 2010 Apr 21.
rotorVerify
for verifying the balance of pre-existing
tube configurations.
rotor(30, 7)
rotor(30, 7)
rotorCheck
returns the numbers of tubes that can and cannot be loaded
in a single operation.
rotorCheck(n, k = NULL)
rotorCheck(n, k = NULL)
n |
an integer, the number of rotor buckets. |
k |
an integer, the number of tubes. |
The number of rotor buckets n
ranges from 4
to
48
.
If k
is specified, rotorCheck
will check
whether the input number of tubes can be loaded or not.
rotorCheck
returns a list with two components:
valid |
a vector containing the numbers of tubes that can be loaded. |
invalid |
a vector containing the numbers of tubes that cannot be loaded. |
Sivek G. On vanishing sums of distinct roots of unity. Integers. 2010;10(3):365-8.
rotorEqual
for balancing tubes of equal mass and
rotorUnequal
for balancing tubes of unequal mass.
rotorEqual
returns the positions of rotor buckets that must be loaded
or empty to balance tubes of equal mass.
rotorEqual(n, k, seed = 2019)
rotorEqual(n, k, seed = 2019)
n |
an integer, the number of rotor buckets. |
k |
an integer, the number of tubes. |
seed |
an integer, the seed for random number generation. Setting a seed
ensures the reproducibility of the result. See |
The number of rotor buckets n
ranges from 4
to
48
. The number of tubes k
must be greater than 0
and
smaller than the number of rotor buckets n
.
rotorEqual
returns a list with two components:
loaded |
a vector containing the positions of rotor buckets that must be loaded. |
empty |
a vector containing the positions of rotor buckets that must be empty. |
rotorEqual
also plots a
schematic diagram of the centrifuge rotor.
Sivek G. On vanishing sums of distinct roots of unity. Integers.
2010;10(3):365-8.
Peil O, Hauryliuk V. A new spin on spinning your
samples: balancing rotors in a non-trivial manner. arXiv preprint
arXiv:1004.3671. 2010 Apr 21.
rotorCheck
for checking centrifuge rotors and
rotorUnequal
for balancing tubes of unequal mass.
rotorSpeed
converts rotational speed to relative centrifuge force and vice versa.
rotorSpeed(radius, value, type)
rotorSpeed(radius, value, type)
radius |
a numeric, the centrifugal radius in millimeters. |
value |
a numeric, the rotational speed in revolutions per minute or the relative centrifuge force in × g. |
type |
the type of the above-mentioned |
rotorSpeed
returns a numeric that is the rotational speed in
revolutions per minute or the relative centrifuge force in × g.
Rickwood D, editor. Centrifugation: a practical approach. London: Information Retrieval Ltd; 1978. 224 p.
rotorSpeed(100, 12000, "rpm") rotorSpeed(100, 6000, "rcf")
rotorSpeed(100, 12000, "rpm") rotorSpeed(100, 6000, "rcf")
rotorUnequal
returns the required masses and the positions of tubes of
unequal initial mass.
rotorUnequal(n, mass = NULL, seed = 2019)
rotorUnequal(n, mass = NULL, seed = 2019)
n |
an integer, the number of rotor buckets. |
mass |
a numeric vector with optional |
seed |
an integer, the seed for random number generation. Setting a seed
ensures the reproducibility of the result. See |
The number of rotor buckets n
ranges from 4
to
48
. The number of tubes (i.e. length(mass)
) should not be
greater than the number of rotor buckets n
.
If mass
is not specified, the names and the masses of tubes must then be taken from
the keyboard. In case mass
has no names
attribute, tubes will
be named automatically (i.e. S1, S2, S3,
etc.).
rotorUnequal
returns a data frame with three columns:
initial |
a vector containing the initial masses of tubes. |
required |
a vector containing the required masses of tubes. |
position |
a vector containing the bucket positions of tubes. |
rotorUnequal
also plots a schematic diagram of the centrifuge rotor.
Sivek G. On vanishing sums of distinct roots of unity. Integers.
2010;10(3):365-8.
Peil O, Hauryliuk V. A new spin on spinning your
samples: balancing rotors in a non-trivial manner. arXiv preprint
arXiv:1004.3671. 2010 Apr 21.
rotorCheck
for checking centrifuge rotors and
rotorEqual
for balancing tubes of equal mass.
# Call the function then input the names and the masses of tubes rotorUnequal(30) liver 10.05 gill 9.68 muscle 9.88 # Prepare the masses of tubes then call the function samples <- round(rnorm(19, mean = 10, sd = 0.5), 2) rotorUnequal(30, samples) # Prepare the masses and the names of tubes then call the function small.samples <- c(10.05, 9.68, 9.88) names(small.samples) <- c("liver", "gill", "muscle") rotorUnequal(30, small.samples)
# Call the function then input the names and the masses of tubes rotorUnequal(30) liver 10.05 gill 9.68 muscle 9.88 # Prepare the masses of tubes then call the function samples <- round(rnorm(19, mean = 10, sd = 0.5), 2) rotorUnequal(30, samples) # Prepare the masses and the names of tubes then call the function small.samples <- c(10.05, 9.68, 9.88) names(small.samples) <- c("liver", "gill", "muscle") rotorUnequal(30, small.samples)
rotorVerify
checks whether the rotor is balanced given the positions
of tubes of equal mass.
rotorVerify(n, pos)
rotorVerify(n, pos)
n |
an integer, the number of rotor buckets. |
pos |
an integer vector, the positions of tubes. |
The number of rotor buckets n
ranges from 4
to
48
. The positions of tubes pos
ranges from 1 to n
.
rotorVerify
returns 1
if the rotor is balanced and
0
if the rotor is unbalanced.
Johnsson M. Balancing a centrifuge. R-bloggers. 2016. Available from: https://www.r-bloggers.com/2016/06/balancing-a-centrifuge/.
rotorCheck
for checking centrifuge rotors.
rotorVerify(30, c(10, 20, 30)) rotorVerify(30, c(1, 11, 21, 4, 28))
rotorVerify(30, c(10, 20, 30)) rotorVerify(30, c(1, 11, 21, 4, 28))