-
Notifications
You must be signed in to change notification settings - Fork 0
/
map_kinases_dpp.R
36 lines (28 loc) · 1009 Bytes
/
map_kinases_dpp.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Generate a list of kinases mapped to the LFC fo differentially phosphorylated peptides
library(tidyverse)
library(KRSA)
# Prepare the kinase data
ptk_coverage <- KRSA_coverage_PTK_PamChip_86402_v1 |>
rename(Kinase = Kin, Peptide = Substrates)
stk_coverage <- KRSA_coverage_STK_PamChip_87102_v2 |>
rename(Kinase = Kin, Peptide = Substrates)
coverage <- bind_rows(ptk_coverage, stk_coverage)
add_kinases <- function(dpp_file, coverage) {
dpp_data <- read_csv(dpp_file, show_col_types = FALSE) |>
select(Peptide, LFC = totalMeanLFC)
dpp_data |>
inner_join(coverage, by = "Peptide", relationship = "many-to-many") |>
select(Kinase, Peptide, LFC)
}
dpp_files <- list.files("results", "dpp", full.names = TRUE) |>
set_names(
~ basename(.x) |>
str_remove(fixed(".csv")) |>
str_remove(fixed("-dpp"))
)
dpp_data <- dpp_files |>
map(~ add_kinases(.x, coverage)) |>
imap(~ write_csv(
.x,
file = file.path("results", str_glue("{.y}-mapped_kinases.csv"))
))