pcr
pcr copied to clipboard
Add the option to use less-than-perfect amplification efficiencies
This PR adds the option to use a table with the amplification efficiencies with the pcr_ddct method, instead of assuming perfect amplification as mentioned in #21 . The table should be one row with the amplification efficiencies (e.g. 1.89) and the same gene names as column names, that are also used in the dataset to call the main function.
One thing I am not sure about, is if I correctly implemented the optionality, so please review that :)
Thanks @richardstoeckl
I looked at the code. It is not passing the checks likely because you are using the pipe %>% and dplyr::select which are not dependencies in the package. We need to fix this issue to pass the checks.
Also, I want to ask, if you only need one raw data.frame, why not use a vector of the same length as the nrow of the ct's data.frame. This would simplify the implementation.
pcr_relative would look something like this
.pcr_relative <- function(vec, amp_eff) {
if (amp_eff) {
stopifnot(length(amp_eff) == length(vect))
res <- amp_eff ^ -vec
} else {
res <- 2 ^ -vec
}
return(res)
}
Finally, it would be great if you can add an example or a test case for your code.
Hi,
How/Where can I add the example?
So the reason I used the complicated way is to make sure the correct value is used for the correct gene.
I will look into your suggestions later today.
I think it is reasonable to expect the user to provide the vector of efficiencies that corresponds to the genes in the correct order. We just need to make it explicit in the documentation that this is what is expected.
You can use the oxygen tags @param to add a sentence or two about this new expected argument.
You can add the example to the @examples tag of the .pcr_relative (here) and the test (here)