Using the pcs and the k number of components be included, we generate the qsva matrix.

get_qsvs(qsvPCs, k)

Arguments

qsvPCs

prcomp object generated by taking the pcs of degraded transcripts

k

number of qsvs to be included.

Value

matrix with k principal components for each sample.

Examples

qsv <- getPCs(rse_tx, "tpm")
get_qsvs(qsv, 2)
#>                             qSV1        qSV2
#> DLPFC_Br1385_A1_ribo -20.8283999 -18.9358162
#> DLPFC_Br1385_A2_ribo   3.3372474 -17.1339387
#> DLPFC_Br1385_A3_ribo  35.3748653 -17.7544971
#> DLPFC_Br1385_A4_ribo  22.4269171 -20.3065083
#> DLPFC_Br1729_B1_ribo -25.0123011 -18.8415182
#> DLPFC_Br1729_B2_ribo -15.1701602 -17.9420267
#> DLPFC_Br1729_B3_ribo  46.9207780 -22.2897020
#> DLPFC_Br1729_B4_ribo  10.9413016 -22.0281930
#> DLPFC_Br2015_F1_ribo -29.3995258  -8.3544389
#> DLPFC_Br2015_F2_ribo  -6.3204198 -10.4721078
#> DLPFC_Br2015_F3_ribo  15.7779525 -16.5898440
#> DLPFC_Br2015_F4_ribo  11.2904985 -23.0349209
#> DLPFC_Br2020_C1_ribo -23.7013135 -16.3300484
#> DLPFC_Br2020_C2_ribo   7.1892335 -19.3861125
#> DLPFC_Br2020_C3_ribo  57.4179250 -24.7576640
#> DLPFC_Br2020_C4_ribo  29.7637525 -21.1729343
#> DLPFC_Br2074_D1_ribo -43.8123596  -9.8948694
#> DLPFC_Br2074_D2_ribo -19.3014354 -19.3799657
#> DLPFC_Br2074_D3_ribo  29.2666406 -31.4707974
#> DLPFC_Br2074_D4_ribo  -8.8774683 -19.9736883
#> Br2623-H1a           -29.5871404  -0.8983503
#> Br2623-H1b           -15.4894971   0.1209622
#> Br2623-H1c           -15.9828262  -4.0485559
#> Br2623-H1d             3.6237689  -3.1175709
#> Br5005-H2a           -38.3799917   2.8809254
#> Br5005-H2b            -9.3337908   8.7067971
#> Br5005-H2c           -18.4853856   3.5485338
#> Br5005-H2d            -6.5076058   6.0442811
#> Br5370-H3a           -23.5888134   1.6245009
#> Br5370-H3b            -1.4434709   4.1472788
#> Br5370-H3c             1.9617211   5.1906688
#> Br5370-H3d            17.8526682   2.7759192
#> Br5889-H4a            -0.4701251  11.8751826
#> Br5889-H4b             7.0633761  16.4422422
#> Br5889-H4c            25.2251257  17.6023287
#> Br5889-H4d            29.8482061  20.9653347
#> Br5941-H5a           -35.6253833   0.7134732
#> Br5941-H5b           -17.6191395   2.5113135
#> Br5941-H5c            -6.6487252  -1.2955902
#> Br5941-H5d            -7.6194942   1.3309445
#> Br2623-C1a           -10.1010034   3.4651972
#> Br2623-C1b           -12.7938639  13.1044541
#> Br2623-C1c            -6.8892598   5.5181045
#> Br2623-C1d            -0.6433381   5.7535892
#> Br5005-C2a           -18.5856349  10.7736928
#> Br5005-C2b           -10.1477427  11.8512887
#> Br5005-C2c           -11.2904273  12.5751571
#> Br5005-C2d             3.7343795  14.3375912
#> Br5370-C3a            11.1243523  14.9407954
#> Br5370-C3b            19.3258020  18.4608793
#> Br5370-C3c            25.8292091  15.8747211
#> Br5370-C3d            28.5445500  12.7132908
#> Br5889-C4a            -0.9700789  21.7463078
#> Br5889-C4b            11.7991678  28.3404649
#> Br5889-C4c            21.2170851  31.2093559
#> Br5889-C4d            26.1076975  31.6279907
#> Br5941-C5a            -4.6088301   4.6893368
#> Br5941-C5b            -8.3377268  10.1820536
#> Br5941-C5c            -3.2186105   6.8648876
#> Br5941-C5d             3.8270681   4.8998134