pivot_annotations {OmnipathR} | R Documentation

## Converts annotation tables to a wide format

### Description

Use this method to reconstitute the annotation tables into the format of the original resources. With the 'wide=TRUE' option `import_omnipath_annotations` applies this function to the downloaded data.

### Usage

    pivot_annotations(annotations)

### Arguments

`annotations` | A data frame of annotations downloaded from the OmniPath web service by `import_omnipath_annotations`.

### Value

A wide format data frame (tibble) if the provided data contains annotations from one resource, otherwise a list of wide format tibbles.

### See Also

`import_omnipath_annotations`

### Examples

    # single resource: the result is a data frame
    disgenet <- import_omnipath_annotations(resources = 'DisGeNet')
    disgenet <- pivot_annotations(disgenet)
    disgenet
    # # A tibble: 119,551 x 10
    #    uniprot genesymbol entity_type disease score dsi   dpi   nof_pmids
    #    <chr>   <chr>      <chr>       <chr>   <chr> <chr> <chr> <chr>
    #  1 P04217  A1BG       protein     Schizo… 0.3   0.857 0.172 1
    #  2 P04217  A1BG       protein     Hepato… 0.3   0.857 0.172 1
    #  3 P01023  A2M        protein     alpha-… 0.31  0.564 0.724 0
    #  4 P01023  A2M        protein     Fibros… 0.3   0.564 0.724 1
    #  5 P01023  A2M        protein     Hepato… 0.3   0.564 0.724 1
    # # . with 119,541 more rows, and 2 more variables: nof_snps <chr>,
    # #   source <chr>

    # multiple resources: the result is a list
    annotations <- import_omnipath_annotations(
        resources = c('DisGeNet', 'SignaLink_function', 'DGIdb', 'kinase.com')
    )
    annotations <- pivot_annotations(annotations)
    names(annotations)
    # [1] "DGIdb"              "DisGeNet"           "kinase.com"
    # [4] "SignaLink_function"
    annotations$kinase.com
    # # 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

[Package OmnipathR version 3.0.0 Index]