General data accessing getter function to return any of:

  • data,

  • segmentation,

  • normalisation factors.

The function uses the what parameter to return the appropriate type of information

Since the input formats are different, the outputs are also different based on the value of what, but they are always in tibble format.

Besides obvious columns, these information will also be available in the returned tibbles.

  • what = "data": modality and value_type, the latter reporting the likelihood code associated to the modality.

  • what = "segmentation":

    • ATAC_nonzerovals and ATAC_peaks, reporting the number of ATAC entries mapped to a segment, and the number of peaks these come from. Note that one non-zero entry is given by a cell that reported a ATAC count in a peak mapping within the segment.

    • RNA_nonzerovals and RNA_genes, reporting the number of RNA entries mapped to a segment, and the number of genes these come from. For RNA, one non-zero entry is given by a cell that reported an RNA count in a gene mapping within the segment.

  • what = "normalisation": just modality.

get_input(x, what = "data")

Arguments

x

An object of class rcongasplus.

what

Any of "data", "segmentation" or "normalisation".

Value

A tibble; its format depends on what. See the examples.

Examples

data(example_object)

# Extract the input data, after mapping to segments
get_input(example_object, what = 'data') 
#> # A tibble: 29,190 × 5
#>    segment_id              cell                        value modality value_type
#>    <chr>                   <chr>                       <int> <chr>    <chr>     
#>  1 chr1:57781319:108512982 bcc.su008.pre.cd45_AAAGATG…   274 RNA      NB        
#>  2 chr1:57781319:108512982 bcc.su008.pre.cd45_GCAATCA…   227 RNA      NB        
#>  3 chr1:57781319:108512982 bcc.su008.pre.cd45_GCAGCCA…   209 RNA      NB        
#>  4 chr1:57781319:108512982 bcc.su008.pre.cd45_TCCACAC…   258 RNA      NB        
#>  5 chr1:57781319:108512982 bcc.su008.pre.tcell_AGCATA…   284 RNA      NB        
#>  6 chr1:57781319:108512982 bcc.su008.pre.tcell_AGCTCC…    56 RNA      NB        
#>  7 chr1:57781319:108512982 bcc.su008.pre.tcell_GGAAAG…   130 RNA      NB        
#>  8 chr1:57781319:108512982 bcc.su008.pre.tcell_GGTGCG…   195 RNA      NB        
#>  9 chr1:57781319:108512982 bcc.su008.pre.tumor_AAACCT…   251 RNA      NB        
#> 10 chr1:57781319:108512982 bcc.su008.pre.tumor_AAAGCA…   256 RNA      NB        
#> # ℹ 29,180 more rows

# e.g., in this way you can get input ATAC values
get_input(example_object, what = 'data') %>% dplyr::filter(modality == 'ATAC')
#> # A tibble: 7,770 × 5
#>    segment_id              cell                value modality value_type
#>    <chr>                   <chr>               <int> <chr>    <chr>     
#>  1 chr1:57781319:108512982 SU008_Tumor_Pre_10   1961 ATAC     NB        
#>  2 chr1:57781319:108512982 SU008_Tumor_Pre_100   342 ATAC     NB        
#>  3 chr1:57781319:108512982 SU008_Tumor_Pre_104   602 ATAC     NB        
#>  4 chr1:57781319:108512982 SU008_Tumor_Pre_106   511 ATAC     NB        
#>  5 chr1:57781319:108512982 SU008_Tumor_Pre_110   335 ATAC     NB        
#>  6 chr1:57781319:108512982 SU008_Tumor_Pre_112   593 ATAC     NB        
#>  7 chr1:57781319:108512982 SU008_Tumor_Pre_114   794 ATAC     NB        
#>  8 chr1:57781319:108512982 SU008_Tumor_Pre_115   273 ATAC     NB        
#>  9 chr1:57781319:108512982 SU008_Tumor_Pre_116  1076 ATAC     NB        
#> 10 chr1:57781319:108512982 SU008_Tumor_Pre_118   910 ATAC     NB        
#> # ℹ 7,760 more rows
 
# Extract the input segmentation. 
get_input(example_object, what = 'segmentation')
#> # A tibble: 30 × 12
#>    chr        from        to copies segment_id       ATAC_nonzerovals ATAC_peaks
#>    <chr>     <int>     <int>  <int> <chr>                       <dbl>      <dbl>
#>  1 chr10    285200 135490954      2 chr10:285200:13…           176459      18251
#>  2 chr4      40332 190986668      2 chr4:40332:1909…           153390      16652
#>  3 chr11  17515668 134898011      3 chr11:17515668:…           180071      17098
#>  4 chr2  133074851 241531737      3 chr2:133074851:…           122575      13415
#>  5 chr2      39340  89319834      3 chr2:39340:8931…           130226      12956
#>  6 chr14  20323479 105411153      3 chr14:20323479:…           125378      12371
#>  7 chr15  28947721 102517302      2 chr15:28947721:…           132411      12616
#>  8 chr6   67340783 171046023      2 chr6:67340783:1…           105050      11560
#>  9 chr12  53343461 133801333      3 chr12:53343461:…           120836      11634
#> 10 chr5  110286431 180712485      3 chr5:110286431:…           105659      10740
#> # ℹ 20 more rows
#> # ℹ 5 more variables: RNA_nonzerovals <dbl>, RNA_genes <dbl>, E <dbl>, L <int>,
#> #   `row_number() <= 30` <lgl>
 
# Extract the input normalisation factors
get_input(example_object, what = 'normalisation')
#> # A tibble: 973 × 3
#>    cell                                 normalisation_factor modality
#>    <chr>                                               <dbl> <chr>   
#>  1 bcc.su008.pre.cd45_AAAGATGCAAAGGAAG                 2.70  RNA     
#>  2 bcc.su008.pre.cd45_GCAATCATCAAACAAG                 1.89  RNA     
#>  3 bcc.su008.pre.cd45_GCAGCCATCTTTAGTC                 1.66  RNA     
#>  4 bcc.su008.pre.cd45_TCCACACCACATCTTT                 2.49  RNA     
#>  5 bcc.su008.pre.tcell_AGCATACCAGCATGAG                1.59  RNA     
#>  6 bcc.su008.pre.tcell_AGCTCCTAGGACAGAA                0.614 RNA     
#>  7 bcc.su008.pre.tcell_GGAAAGCGTATTAGCC                1.15  RNA     
#>  8 bcc.su008.pre.tcell_GGTGCGTCAGAGTGTG                1.74  RNA     
#>  9 bcc.su008.pre.tumor_AAACCTGTCCGAGCCA                1.17  RNA     
#> 10 bcc.su008.pre.tumor_AAAGCAAGTGTCTGAT                0.762 RNA     
#> # ℹ 963 more rows