Skip to contents

Compute Projection for High-Dimensional Data

Usage

get_projection(
  projection,
  proj_scale,
  highd_data,
  model_highd,
  tr_from_to_df,
  axis_param
)

Arguments

projection

A matrix or data frame representing the projection.

proj_scale

Scaling factor for the projection.

highd_data

A data frame or matrix of high-dimensional data.

model_highd

A model object or function used for high-dimensional transformation.

tr_from_to_df

A data frame defining transformation from one space to another.

axis_param

A list of parameters for axis configuration.

Value

A data frame or matrix with the transformed projection.

Examples

projection_df <- cbind(
c(-0.17353,-0.02906,0.19857,0.00037,0.00131,-0.05019,0.03371),
c(-0.10551,0.14829,-0.02063,0.02658,-0.03150,0.19698,0.00044))

df_bin <- s_curve_obj$s_curve_umap_model_obj$df_bin
edge_data <- s_curve_obj$s_curve_umap_model_tr_from_to_df

get_projection(projection = projection_df, proj_scale = 1,
highd_data = s_curve_noise_training, model_highd = df_bin,
tr_from_to_df = edge_data,
axis_param = list(limits = 1, axis_scaled = 1, axis_pos_x = -0.72,
axis_pos_y = -0.72,threshold = 0))
#> New names:
#>  `` -> `...1`
#>  `` -> `...2`
#> New names:
#>  `` -> `...1`
#>  `` -> `...2`
#> $projected_df
#> # A tibble: 3,750 × 3
#>      proj1   proj2    ID
#>      <dbl>   <dbl> <int>
#>  1 -0.427   0.315      1
#>  2 -0.0334  0.221      2
#>  3  0.174   0.248      3
#>  4 -0.295   0.112      4
#>  5 -0.486   0.103      5
#>  6  0.0863  0.0694     6
#>  7 -0.292   0.154      7
#>  8  0.145   0.295      8
#>  9 -0.0326  0.201      9
#> 10  0.183  -0.0528    10
#> # ℹ 3,740 more rows
#> 
#> $model_df
#> # A tibble: 313 × 10
#>     from    to x_from  y_from  x_to    y_to proj1_from proj2_from proj1_to
#>    <int> <int>  <dbl>   <dbl> <dbl>   <dbl>      <dbl>      <dbl>    <dbl>
#>  1     1     2  0.107 -0.0169 0.189 -0.0169     0.0286    -0.114    0.0922
#>  2     4     5  0.148  0.0546 0.231  0.0546     0.0652    -0.0752   0.161 
#>  3     4    13  0.148  0.0546 0.189  0.126      0.0652    -0.0752   0.111 
#>  4    12    13  0.107  0.126  0.189  0.126      0.0275    -0.0125   0.111 
#>  5     2     3  0.189 -0.0169 0.272 -0.0169     0.0922    -0.105    0.215 
#>  6    12    22  0.107  0.126  0.148  0.198      0.0275    -0.0125   0.0543
#>  7     3     5  0.272 -0.0169 0.231  0.0546     0.215     -0.104    0.161 
#>  8    13    23  0.189  0.126  0.231  0.198      0.111     -0.0146   0.172 
#>  9    13    14  0.189  0.126  0.272  0.126      0.111     -0.0146   0.220 
#> 10     5    14  0.231  0.0546 0.272  0.126      0.161     -0.0733   0.220 
#> # ℹ 303 more rows
#> # ℹ 1 more variable: proj2_to <dbl>
#> 
#> $axes
#>       x1    y1         x2         y2    distance
#> x1 -0.72 -0.72 -0.7489217 -0.7375850 0.033848117
#> x2 -0.72 -0.72 -0.7248433 -0.6952850 0.025185097
#> x3 -0.72 -0.72 -0.6869050 -0.7234383 0.033273130
#> x4 -0.72 -0.72 -0.7199383 -0.7155700 0.004430429
#> x5 -0.72 -0.72 -0.7197817 -0.7252500 0.005254538
#> x6 -0.72 -0.72 -0.7283650 -0.6871700 0.033878933
#> x7 -0.72 -0.72 -0.7143817 -0.7199267 0.005618812
#> 
#> $circle
#>            c1         c2
#> 1  -0.5533333 -0.7200000
#> 2  -0.5547017 -0.6986871
#> 3  -0.5587842 -0.6777242
#> 4  -0.5655139 -0.6574555
#> 5  -0.5747802 -0.6382137
#> 6  -0.5864311 -0.6203149
#> 7  -0.6002751 -0.6040529
#> 8  -0.6160850 -0.5896948
#> 9  -0.6336012 -0.5774762
#> 10 -0.6525361 -0.5675979
#> 11 -0.6725787 -0.5602220
#> 12 -0.6934000 -0.5554697
#> 13 -0.7146581 -0.5534190
#> 14 -0.7360038 -0.5541035
#> 15 -0.7570868 -0.5575120
#> 16 -0.7775608 -0.5635886
#> 17 -0.7970897 -0.5722334
#> 18 -0.8153528 -0.5833046
#> 19 -0.8320501 -0.5966203
#> 20 -0.8469077 -0.6119619
#> 21 -0.8596814 -0.6290775
#> 22 -0.8701615 -0.6476860
#> 23 -0.8781760 -0.6674820
#> 24 -0.8835932 -0.6881402
#> 25 -0.8863242 -0.7093216
#> 26 -0.8863242 -0.7306784
#> 27 -0.8835932 -0.7518598
#> 28 -0.8781760 -0.7725180
#> 29 -0.8701615 -0.7923140
#> 30 -0.8596814 -0.8109225
#> 31 -0.8469077 -0.8280381
#> 32 -0.8320501 -0.8433797
#> 33 -0.8153528 -0.8566954
#> 34 -0.7970897 -0.8677666
#> 35 -0.7775608 -0.8764114
#> 36 -0.7570868 -0.8824880
#> 37 -0.7360038 -0.8858965
#> 38 -0.7146581 -0.8865810
#> 39 -0.6934000 -0.8845303
#> 40 -0.6725787 -0.8797780
#> 41 -0.6525361 -0.8724021
#> 42 -0.6336012 -0.8625238
#> 43 -0.6160850 -0.8503052
#> 44 -0.6002751 -0.8359471
#> 45 -0.5864311 -0.8196851
#> 46 -0.5747802 -0.8017863
#> 47 -0.5655139 -0.7825445
#> 48 -0.5587842 -0.7622758
#> 49 -0.5547017 -0.7413129
#> 50 -0.5533333 -0.7200000
#>