Comments (3)
Hi @CamillaMaciel
I don't think you need to do much beyond the looping, since the calculation are applied for each assay (gene) separately.
How about splitting the original data df
into smaller subsets based on Assay.Name
and use map
to call pcr_assess
# load libraries
library(pcr)
library(tidyverse)
# apply pcr_assess on each assay separately
df %>%
group_split(Assay.Name) %>%
setNames(unique(df$Assay.Name)) %>%
map(~{
pcr_assess(select(.x, CT), # use select to return a data.frame
amount = pull(.x, Sample.Name)) # use pull to return a vector
})
#> $Assay01
#> gene intercept slope r_squared
#> 1 CT 9.864613 -3.520934 0.9983931
#>
#> $Assay02
#> gene intercept slope r_squared
#> 1 CT 10.94083 -3.483191 0.9996576
#>
#> $Assay03
#> gene intercept slope r_squared
#> 1 CT 10.35883 -3.40583 0.9996625
Created on 2021-07-22 by the reprex package (v2.0.0)
Please let me know if you have other questions
from pcr.
Hi Mahmoud. Thank you so much for your reply. It works super fine :)
I also added these lines for calculating the efficiency:
# apply pcr_assess on each assay separately
res<- df %>%
group_split(Assay.Name) %>%
setNames(unique(std_bQC$Assay.Name)) %>%
map(~{
pcr_assess(select(.x, CT), # use select to return a data.frame
amount = pull(.x, Sample.Name)) # use pull to return a vector
})
# Calculate efficiency
df2<- lapply(df, function(x)
cbind(x, efficiency = (10^(-1/x$slope)-1)*100))
from pcr.
I am glad it worked.
There is a way to calculate the efficiency in the pcr
package. You only need to add method == 'efficiency'
along with the name of the reference_gene
in pcr_assess
.
from pcr.
Related Issues (20)
- Installation Error HOT 1
- NA value HOT 1
- Aggregate in .pcr_average HOT 2
- pcr HOT 3
- use pcr package for three sample group experiment HOT 2
- Negative lower value while analysing the using standard curve HOT 1
- Factor in amplification efficiency HOT 2
- Rsquared not calculated HOT 6
- `group_var` don't support variable names with `_` (underscore) HOT 2
- CpAverage or CrossingPoint HOT 6
- pcr_wilcox function HOT 4
- Add p-values on the plot HOT 2
- Importing from QuantStudio file? HOT 1
- Does calculated error represents Standard deviation? HOT 3
- Use column in data table for grouping when column name is passed as string to group_var HOT 2
- rOpenSci review for qPCR package HOT 4
- SEM instead of SD HOT 2
- Handling different starting sample masses HOT 3
- technical replicates HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pcr.