Browse code

added function to compute pEC50 at specified temperature for protein of interest

Nils Kurzawa authored on 30/03/2020 15:32:18
Showing4 changed files

... ...
@@ -1,7 +1,7 @@
1 1
 Package: TPP2D
2 2
 Title: Detection of ligand-protein interactions from 2D thermal 
3 3
     profiles (DLPTP)
4
-Version: 1.3.12
4
+Version: 1.3.13
5 5
 Authors@R: c(
6 6
     person("Nils", "Kurzawa", email = "nils.kurzawa@embl.de", 
7 7
         role = c("aut", "cre")),
... ...
@@ -16,6 +16,7 @@ export(fitH0Model)
16 16
 export(fitH1Model)
17 17
 export(getFDR)
18 18
 export(getModelParamsDf)
19
+export(getPEC504Temperature)
19 20
 export(getPvalues)
20 21
 export(gg_qq)
21 22
 export(import2dDataset)
... ...
@@ -541,3 +541,39 @@ computeFStatFromParams <- function(params_df){
541 541
                       df1, df2, F_statistic)
542 542
     return(fstat_df)
543 543
 }
544
+
545
+#' Get pEC50 for a protein of interest at a specific temperatures
546
+#' (optimally the melting point of the protein)
547
+#' 
548
+#' @param fstat_df data frame as obtained after calling 
549
+#' \code{getModelParamsDf}, containing fitted null and 
550
+#' alternative model parameters for each protein
551
+#' @param protein character string referring to the protein 
552
+#' of interest
553
+#' @param temperaturePEC50 temperature (numeric) at which pEC50
554
+#' should be inferred
555
+#' 
556
+#' @return numeric value specifying the pEC50 for the 
557
+#' indicated protein and temperature
558
+#' 
559
+#' @examples 
560
+#' data("simulated_cell_extract_df")
561
+#' 
562
+#' model_params_df <- getModelParamsDf(
563
+#'    df = filter(simulated_cell_extract_df, 
564
+#'            clustername == "tp1"))
565
+#' 
566
+#' getPEC504Temperature(
567
+#'     fstat_df = model_params_df, 
568
+#'     protein = "tp1", 
569
+#'     temperaturePEC50 = 60)
570
+#' @import dplyr
571
+#' @export
572
+getPEC504Temperature <- function(fstat_df, protein, 
573
+                                 temperaturePEC50 = 60){
574
+    clustername <- NULL
575
+    fstat_fil <- filter(fstat_df, clustername == protein)
576
+    pEC50 <- fstat_fil$pEC50H1 - 
577
+        (temperaturePEC50 *fstat_fil$pEC50_slopeH1)
578
+    return(pEC50)
579
+}
544 580
new file mode 100644
... ...
@@ -0,0 +1,40 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/perform_analysis.R
3
+\name{getPEC504Temperature}
4
+\alias{getPEC504Temperature}
5
+\title{Get pEC50 for a protein of interest at a specific temperatures
6
+(optimally the melting point of the protein)}
7
+\usage{
8
+getPEC504Temperature(fstat_df, protein, temperaturePEC50 = 60)
9
+}
10
+\arguments{
11
+\item{fstat_df}{data frame as obtained after calling 
12
+\code{getModelParamsDf}, containing fitted null and 
13
+alternative model parameters for each protein}
14
+
15
+\item{protein}{character string referring to the protein 
16
+of interest}
17
+
18
+\item{temperaturePEC50}{temperature (numeric) at which pEC50
19
+should be inferred}
20
+}
21
+\value{
22
+numeric value specifying the pEC50 for the 
23
+indicated protein and temperature
24
+}
25
+\description{
26
+Get pEC50 for a protein of interest at a specific temperatures
27
+(optimally the melting point of the protein)
28
+}
29
+\examples{
30
+data("simulated_cell_extract_df")
31
+
32
+model_params_df <- getModelParamsDf(
33
+   df = filter(simulated_cell_extract_df, 
34
+           clustername == "tp1"))
35
+
36
+getPEC504Temperature(
37
+    fstat_df = model_params_df, 
38
+    protein = "tp1", 
39
+    temperaturePEC50 = 60)
40
+}