Skip to content

plating efficiency input from dataframe? #2

Description

@ramiroricardo

Dear all,

I was having a look at using flan for estimating mutation rates, from my data. I usually have my data in a dataframe format, and would like to estimate the mutation rate for a number of clones. So my data will look something like

genotype; mutants; final_counts; plating_efficiency
A; 0; 1e9; 1
A; 10; 3e9; 1
A; 5; 2e9; 1
B; 1; 1e9; 0.3
B; 1; 2e9; 0.3
B; 50; 3e9; 0.3

I can easily calculate the mutation rate for each clone with:

library(data.table) as.data.table(data)[, mutestim(mutants,final_counts,method="GF"), by = genotype]

However, as you can see from the mock data, sometimes I will have variation (per genotype) for the plating efficiency. Such that for genotype A, I will have plated the entire culture, but for genotype B, I will have plated just 1/3.

So the problem is when I run:

as.data.table(data)[, mutestim(mutants,final_counts,plateeff=plating_efficiency,method="GF"), by = genotype]

I get the error:

Error in mutestim(res, final, method = "GF", plateff = plating_efficiency) : 'plateff' must be a single positive and <= 1 number. In addition: Warning message: In if (plateff > 1 | length(plateff) > 1) { : the condition has length > 1 and only the first element will be used

So is there a way around this? or would it be possible for a future version of flan to allow plateeff to be chosen from a data frame. I guess this would be useful for a lot of people.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions