A wrapper function used to perform qSVA in one step.

qSVA(rse_tx, sig_transcripts = select_transcripts(), mod, assayname)

Arguments

rse_tx

A RangedSummarizedExperiment-class object containing the transcript data desired to be studied.

sig_transcripts

A character() vector of transcripts that should be associated with degradation, expected to be present in rownames(rse_tx).

mod

Model Matrix with necessary variables the you would model for in differential expression.

assayname

character string specifying the name of the assay desired in rse_tx

Value

matrix with k principal components for each sample

Examples

## First we need to define a statistical model. We'll use the example
## rse_tx data. Note that the model you'll use in your own data
## might look different from this model.
mod <- model.matrix(~ mitoRate + Region + rRNA_rate + totalAssignedGene + RIN,
    data = colData(rse_tx)
)

## To ensure that the results are reproducible, you will need to set a
## random seed with the set.seed() function. Internally, we are using
## sva::num.sv() which needs a random seed to ensure reproducibility of the
## results.
set.seed(20230621)
qSVA(rse_tx = rse_tx, mod = mod, assayname = "tpm")
#> Using 1044 degradation-associated transcripts.
#>                             qSV1        qSV2       qSV3        qSV4        qSV5
#> DLPFC_Br1385_A1_ribo -15.8672721 -12.3706539 -1.8250557  1.51888632 -0.01218481
#> DLPFC_Br1385_A2_ribo   1.6556199  -8.0281324 -1.0738816 -4.50675618 -8.58825752
#> DLPFC_Br1385_A3_ribo  25.3384820  -5.3240146  3.3150845 -0.56546246 -1.79096470
#> DLPFC_Br1385_A4_ribo  15.5859442 -10.4722056  0.3932367  0.99627839 -4.19047380
#> DLPFC_Br1729_B1_ribo -19.0007397 -12.2808055 -3.2636667  2.36908526  3.22374567
#> DLPFC_Br1729_B2_ribo -11.6801225 -11.4216642 -3.5355365  2.59402359 -0.14089959
#> DLPFC_Br1729_B3_ribo  33.5338036  -9.4991199  0.9506116 -4.88265288  2.67239443
#> DLPFC_Br1729_B4_ribo   6.7616423 -11.3475373 -2.7645155  6.56305015  2.40399963
#> DLPFC_Br2015_F1_ribo -21.6646587  -4.4813660 -2.5604991 -6.62907017 -4.29788099
#> DLPFC_Br2015_F2_ribo  -6.0196725  -8.5483118 -2.5461525  1.48356212 -0.10765696
#> DLPFC_Br2015_F3_ribo  14.0693876  -4.1953416  3.2272074 -0.43368309  1.44563204
#> DLPFC_Br2015_F4_ribo   9.0662610 -11.3620345 -2.3466733 -5.51689536  3.43711249
#> DLPFC_Br2020_C1_ribo -17.7970001 -10.4456548 -4.0617924  1.65550803 -0.31407413
#> DLPFC_Br2020_C2_ribo   2.7134773 -12.7331262 -4.4315213  5.48231731 -2.32052637
#> DLPFC_Br2020_C3_ribo  41.3621779 -10.0975048  2.4201913 -6.52387331  3.65186231
#> DLPFC_Br2020_C4_ribo  19.4249036 -11.1049686 -2.0921942  4.64493744 -1.46323248
#> DLPFC_Br2074_D1_ribo -31.3822759  -4.2196405 -1.6018474 -7.56412052 -7.23769162
#> DLPFC_Br2074_D2_ribo -14.6788526 -12.3946647 -3.9470495  1.68872681 -1.18334265
#> DLPFC_Br2074_D3_ribo  22.2372531 -17.5881834 -0.4283349 -9.31245868  3.92253931
#> DLPFC_Br2074_D4_ribo  -6.6602334 -11.9102376 -2.9932042  1.94225622 -2.97647765
#> Br2623-H1a           -17.4368272   3.3103737  8.4901488 -2.23516849  0.09691782
#> Br2623-H1b            -8.1086581   3.6500902  5.9787834 -0.62422784 -0.14121237
#> Br2623-H1c            -7.9022620   1.9855486  7.4230501  1.25420734  0.47473428
#> Br2623-H1d             6.0361201   5.1841577  9.9366248  0.09940832 -0.18942747
#> Br5005-H2a           -25.6966081  -3.3646831  5.4395129 -1.11580169  2.01702683
#> Br5005-H2b            -7.0497022  -0.7393247  0.1819131  3.19412165  1.31282809
#> Br5005-H2c           -12.3931268  -0.2302357  3.3274929  2.08726661  2.33580293
#> Br5005-H2d            -3.3015962   2.0176566  5.6557587  1.88070719  2.50506599
#> Br5370-H3a           -15.3021782  -0.1408422  7.7460122  0.45830226  1.31590218
#> Br5370-H3b            -0.8750812   0.5281671  3.8815361  3.67581441 -0.34284862
#> Br5370-H3c             0.5837811   1.3426739  7.1195996  3.55593853  0.52337138
#> Br5370-H3d            13.4756531   4.0693719  8.8956802  2.08654061 -0.25212951
#> Br5889-H4a            -1.4146639  -0.3514845  5.0184463  2.75141034  1.15700192
#> Br5889-H4b             3.4433652   2.1969559  3.3681149  3.88684088 -1.95214054
#> Br5889-H4c            15.9873176   3.7633527  4.0637448  4.31141121 -3.35253144
#> Br5889-H4d            19.5094658   7.4096739  5.9341236  1.80368304 -3.67381412
#> Br5941-H5a           -22.0419158   1.5807285  8.1295078 -3.41247294  1.64470779
#> Br5941-H5b            -8.8697237   5.6519260  5.8918015 -3.30879930 -0.38555744
#> Br5941-H5c            -2.3678784   1.9300725  6.5161765  2.36053327  0.58450593
#> Br5941-H5d            -3.0199792   3.4015244  7.5119565 -0.50574036 -0.41101206
#> Br2623-C1a            -4.5199965   8.9249453 -2.7801294 -2.38976044  1.36556803
#> Br2623-C1b            -9.3546218   9.5386242 -2.1276540 -3.95446968  0.46479482
#> Br2623-C1c            -3.1657310  10.1323544 -2.7417267 -3.00703860 -0.03148605
#> Br2623-C1d             0.7736339   9.9680350 -3.2045912 -2.22683210 -0.24318779
#> Br5005-C2a           -12.8475582   3.8741030 -5.3069843  0.14286265  5.26345205
#> Br5005-C2b            -7.4429662   4.8847338 -6.1230187  0.12203656  3.48710335
#> Br5005-C2c            -7.4277746   7.1227905 -6.4037019 -1.14615485  2.17730076
#> Br5005-C2d             2.2957480   7.5932940 -6.9834747  0.44091452 -0.41002468
#> Br5370-C3a             7.8626696  10.0100012 -2.4449842 -1.35874912  1.06817387
#> Br5370-C3b            11.3834946  10.2360201 -3.9916927 -0.32084631 -1.22874239
#> Br5370-C3c            16.9801608  11.3703756 -2.5986650 -0.53488319 -1.78817309
#> Br5370-C3d            19.3334321  10.1322825 -2.8902334 -0.36933264 -1.41092261
#> Br5889-C4a            -3.9052788   2.8812354 -5.7253843  2.83609041  3.81624293
#> Br5889-C4b             2.2369303   3.6432344 -7.0027978  3.52195782  0.64948482
#> Br5889-C4c             9.2464010   6.9474427 -6.6720996  2.51806225 -1.26608458
#> Br5889-C4d            12.5556762   8.4500147 -5.4778069  3.32774688 -2.65883440
#> Br5941-C5a            -1.7130276   6.6881252 -4.7813919 -0.70428838  1.84668374
#> Br5941-C5b            -5.9645386   7.0068497 -4.1438332 -2.01879942 -0.15737483
#> Br5941-C5c            -0.7358994   9.0086645 -4.9518412 -1.42215720  0.05585854
#> Br5941-C5d             4.1556194   8.2163381 -4.9923800 -0.66399321 -0.40064668
#>                             qSV6         qSV7         qSV8
#> DLPFC_Br1385_A1_ribo  1.06453573 -3.815556219  1.027593763
#> DLPFC_Br1385_A2_ribo -1.91660808 -0.373412600  1.557946934
#> DLPFC_Br1385_A3_ribo  0.82740993 -2.212276260  1.863476084
#> DLPFC_Br1385_A4_ribo  1.74505075 -1.115064084  2.834002112
#> DLPFC_Br1729_B1_ribo -0.27758192 -3.694350036  0.604497945
#> DLPFC_Br1729_B2_ribo  0.94333344 -2.300718429  0.833032270
#> DLPFC_Br1729_B3_ribo -2.81410074  0.164342146  0.410570144
#> DLPFC_Br1729_B4_ribo  0.76181246  0.899574264 -0.862819348
#> DLPFC_Br2015_F1_ribo -2.81227313 -0.543555516  2.975156750
#> DLPFC_Br2015_F2_ribo  0.60277590 -0.228855169  5.246330856
#> DLPFC_Br2015_F3_ribo  1.22030932  0.377111210  2.365659903
#> DLPFC_Br2015_F4_ribo -1.58251006 -0.195619129  2.428274741
#> DLPFC_Br2020_C1_ribo  1.59616912 -1.418234848  0.241582073
#> DLPFC_Br2020_C2_ribo  4.23857840  2.580718424  0.849556950
#> DLPFC_Br2020_C3_ribo -0.13360171 -0.056514286  0.156322719
#> DLPFC_Br2020_C4_ribo  3.72033921  3.082108375  0.744166153
#> DLPFC_Br2074_D1_ribo -2.17610415 -0.645713558 -3.357053282
#> DLPFC_Br2074_D2_ribo  1.94149150 -0.079358609 -4.692604532
#> DLPFC_Br2074_D3_ribo -1.74165236  2.971756749 -5.179630330
#> DLPFC_Br2074_D4_ribo  2.42652749  2.161298643 -5.173738926
#> Br2623-H1a            0.14637755  1.194930418 -0.672847932
#> Br2623-H1b            1.07979871  2.855834580 -0.695539948
#> Br2623-H1c            1.30163472  3.921330802 -1.267392877
#> Br2623-H1d            3.93193146  2.122686712  0.477239843
#> Br5005-H2a           -1.65730262 -1.166873529  1.898825629
#> Br5005-H2b           -1.59447123  1.378500228  1.368447893
#> Br5005-H2c           -1.25019696  1.619695306  2.091350440
#> Br5005-H2d           -0.61713110  0.336181957  2.790450433
#> Br5370-H3a           -1.29379050 -1.989147917 -2.943435220
#> Br5370-H3b           -0.82777172  0.270676633 -3.597173069
#> Br5370-H3c            0.12262276 -1.781037990 -1.454198677
#> Br5370-H3d            0.10683698 -3.182788886 -1.609341001
#> Br5889-H4a           -3.75657200 -0.716657922 -2.659844471
#> Br5889-H4b           -4.12240714  1.092508056 -1.645915017
#> Br5889-H4c           -4.09234605  0.868814257 -1.101129325
#> Br5889-H4d           -3.83254177 -0.687076820  0.371552020
#> Br5941-H5a            0.48467345 -1.650517932  1.662855093
#> Br5941-H5b            0.89532156 -0.004574709  1.280077530
#> Br5941-H5c            1.85917400  0.938641762  0.883438253
#> Br5941-H5d            1.58236376  0.438603339  2.639189967
#> Br2623-C1a            3.24585929  1.698399794 -1.420480730
#> Br2623-C1b            0.06200314  1.974004453  0.892435462
#> Br2623-C1c            3.06565524  2.293391255 -0.129613022
#> Br2623-C1d            3.04601058  2.985352440 -0.131862698
#> Br5005-C2a           -0.99549421 -1.739838536 -0.192846850
#> Br5005-C2b           -0.97955997 -0.228420366  0.821118120
#> Br5005-C2c           -1.24089333  0.736576234 -0.182421919
#> Br5005-C2d           -0.39937389  2.194399385  0.806529030
#> Br5370-C3a            2.24681796 -5.667046630 -2.196750720
#> Br5370-C3b            1.27472065 -4.087188119 -1.141386043
#> Br5370-C3c            2.13487792 -4.213819776 -1.267943503
#> Br5370-C3d            3.25956846 -5.574951123 -0.329608668
#> Br5889-C4a           -3.26079690 -0.775653930 -1.637361337
#> Br5889-C4b           -4.74726678  0.456974381  0.472426284
#> Br5889-C4c           -4.48924614  1.891780432  0.376824968
#> Br5889-C4d           -3.65896124  1.687838776  2.061090990
#> Br5941-C5a            1.52811658  0.653077397 -0.211566924
#> Br5941-C5b            0.53873097  1.041772240  0.864655602
#> Br5941-C5c            1.28614257  1.450106099 -0.139988199
#> Br5941-C5d            1.98298417  1.805836180 -0.002182388