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

Add the option to use less-than-perfect amplification efficiencies #22

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

richardstoeckl
Copy link

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 :)

Updated the pcr_relative function to include the amplification efficiency
Updated the pcr_ddct function to include the amplification efficiency
@MahShaaban
Copy link
Owner

MahShaaban commented Dec 7, 2020

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.

@richardstoeckl
Copy link
Author

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.

@MahShaaban
Copy link
Owner

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)

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

Successfully merging this pull request may close these issues.

2 participants