Use this method to reconstitute the annotation tables into the format of
the original resources. With the `wide=TRUE` option
annotations
applies this function to the
downloaded data.
Arguments
- annotations
A data frame of annotations downloaded from the OmniPath web service by
annotations
.
Value
A wide format data frame (tibble) if the provided data contains annotations from one resource, otherwise a list of wide format tibbles.
Examples
# single resource: the result is a data frame
disgenet <- annotations(resources = "DisGeNet")
disgenet <- pivot_annotations(disgenet)
disgenet
#> # A tibble: 128,267 × 11
#> uniprot genesymbol entity_type disease type score dsi dpi nof_pmids
#> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 P04217 A1BG protein Hepatomegaly phen… 0.3 0.7 0.538 1
#> 2 P04217 A1BG protein Schizophren… dise… 0.3 0.7 0.538 1
#> 3 P01023 A2M protein Alzheimer D… dise… 0.3 0.529 0.769 3
#> 4 P01023 A2M protein Depressive … dise… 0.3 0.529 0.769 2
#> 5 P01023 A2M protein Fibrosis, L… dise… 0.3 0.529 0.769 1
#> 6 P01023 A2M protein alpha-2-Mac… dise… 0.31 0.529 0.769 0
#> 7 P01023 A2M protein Nephrotic S… group 0.51 0.529 0.769 1
#> 8 P01023 A2M protein Alzheimer D… dise… 0.37 0.529 0.769 3
#> 9 P01023 A2M protein Lung Neopla… group 0.3 0.529 0.769 2
#> 10 P01023 A2M protein Liver Cirrh… dise… 0.3 0.529 0.769 1
#> # ℹ 128,257 more rows
#> # ℹ 2 more variables: nof_snps <dbl>, source <chr>
# # A tibble: 126,588 × 11
# uniprot genesymbol entity_type disease type score dsi dpi
# <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl>
# 1 P04217 A1BG protein Schizophren. dise. 0.3 0.7 0.538
# 2 P04217 A1BG protein Hepatomegaly phen. 0.3 0.7 0.538
# 3 P01023 A2M protein Fibrosis, L. dise. 0.3 0.529 0.769
# 4 P01023 A2M protein Acute kidne. dise. 0.3 0.529 0.769
# 5 P01023 A2M protein Mental Depr. dise. 0.3 0.529 0.769
# # . with 126,583 more rows, and 3 more variables: nof_pmids <dbl>,
# # nof_snps <dbl>, source <chr>
# multiple resources: the result is a list
annot_long <- annotations(
resources = c("DisGeNet", "SignaLink_function", "DGIdb", "kinase.com")
)
annot_wide <- pivot_annotations(annot_long)
names(annot_wide)
#> [1] "DGIdb" "DisGeNet" "SignaLink_function"
#> [4] "kinase.com"
# [1] "DGIdb" "DisGeNet" "kinase.com"
# [4] "SignaLink_function"
annot_wide$kinase.com
#> # A tibble: 883 × 6
#> uniprot genesymbol entity_type group family subfamily
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 P31749 AKT1 protein AGC Akt NA
#> 2 P31751 AKT2 protein AGC Akt NA
#> 3 Q9Y243 AKT3 protein AGC Akt NA
#> 4 O14578 CIT protein AGC DMPK CRIK
#> 5 Q09013 DMPK protein AGC DMPK GEK
#> 6 Q5VT25 CDC42BPA protein AGC DMPK GEK
#> 7 Q9Y5S2 CDC42BPB protein AGC DMPK GEK
#> 8 Q6DT37 CDC42BPG protein AGC DMPK GEK
#> 9 Q13464 ROCK1 protein AGC DMPK ROCK
#> 10 O75116 ROCK2 protein AGC DMPK ROCK
#> # ℹ 873 more rows
# # A tibble: 825 x 6
# uniprot genesymbol entity_type group family subfamily
# <chr> <chr> <chr> <chr> <chr> <chr>
# 1 P31749 AKT1 protein AGC Akt NA
# 2 P31751 AKT2 protein AGC Akt NA
# 3 Q9Y243 AKT3 protein AGC Akt NA
# 4 O14578 CIT protein AGC DMPK CRIK
# 5 Q09013 DMPK protein AGC DMPK GEK
# # . with 815 more rows