A wrapper function used to perform qSVA in one step.

qSVA(
  rse_tx,
  type = c("cell_component", "standard", "top1500"),
  sig_transcripts = NULL,
  mod,
  assayname
)

Arguments

rse_tx

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

type

a character string specifying which model you would like to use from the sets of signature transcripts identified by the qsvaR package. This can be omitted if a custom set of transcripts is provided to sig_transcripts.

sig_transcripts

A list of transcript IDs that are associated with degradation signal. Specifying a character() input with ENSEMBL transcript IDs (whose values should match entries in rownames(rse_tx)). This argument provides a custom list of transcripts for adjusting for degradation; this should be used instead of the type argument.

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, type = "cell_component", mod = mod, assayname = "tpm")
#>    'cell_component' degradation model transcripts found: 2976
#>                             qSV1        qSV2        qSV3         qSV4
#> DLPFC_Br1385_A1_ribo -20.8283999 -18.9358162  11.8368597  -0.38990791
#> DLPFC_Br1385_A2_ribo   3.3372474 -17.1339387   2.2181715   1.73676021
#> DLPFC_Br1385_A3_ribo  35.3748653 -17.7544971  -5.5450016  -0.04749162
#> DLPFC_Br1385_A4_ribo  22.4269171 -20.3065083   4.2369380   1.48712394
#> DLPFC_Br1729_B1_ribo -25.0123011 -18.8415182  15.0132410  -0.70108704
#> DLPFC_Br1729_B2_ribo -15.1701602 -17.9420267  13.7012744   0.50581653
#> DLPFC_Br1729_B3_ribo  46.9207780 -22.2897020   0.4372831  -0.21605089
#> DLPFC_Br1729_B4_ribo  10.9413016 -22.0281930  12.7142861   0.08721363
#> DLPFC_Br2015_F1_ribo -29.3995258  -8.3544389   3.9805431   1.74773326
#> DLPFC_Br2015_F2_ribo  -6.3204198 -10.4721078   6.4247990   2.18864116
#> DLPFC_Br2015_F3_ribo  15.7779525 -16.5898440  -4.4563884   0.50583992
#> DLPFC_Br2015_F4_ribo  11.2904985 -23.0349209   4.0765805   0.50995351
#> DLPFC_Br2020_C1_ribo -23.7013135 -16.3300484   9.4727160   2.79459708
#> DLPFC_Br2020_C2_ribo   7.1892335 -19.3861125   9.8201769   4.19523622
#> DLPFC_Br2020_C3_ribo  57.4179250 -24.7576640  -6.8127194   2.19078208
#> DLPFC_Br2020_C4_ribo  29.7637525 -21.1729343   5.4408057   4.11319713
#> DLPFC_Br2074_D1_ribo -43.8123596  -9.8948694   2.2809540  -1.54354325
#> DLPFC_Br2074_D2_ribo -19.3014354 -19.3799657  12.0356772   0.32831012
#> DLPFC_Br2074_D3_ribo  29.2666406 -31.4707974   3.8466814  -0.90302457
#> DLPFC_Br2074_D4_ribo  -8.8774683 -19.9736883   9.5838997  -0.13659758
#> Br2623-H1a           -29.5871404  -0.8983503 -11.0290341  -4.47414859
#> Br2623-H1b           -15.4894971   0.1209622  -9.4141881   1.04938327
#> Br2623-H1c           -15.9828262  -4.0485559 -10.6427513  -3.99206981
#> Br2623-H1d             3.6237689  -3.1175709 -16.2738209  -1.91615026
#> Br5005-H2a           -38.3799917   2.8809254   4.9856222 -12.92133083
#> Br5005-H2b            -9.3337908   8.7067971  10.2751425  -4.95540639
#> Br5005-H2c           -18.4853856   3.5485338   1.8176085  -7.47678165
#> Br5005-H2d            -6.5076058   6.0442811  -0.3228424  -9.91571964
#> Br5370-H3a           -23.5888134   1.6245009  -8.2861373 -21.34840512
#> Br5370-H3b            -1.4434709   4.1472788  -5.0481132 -16.94304366
#> Br5370-H3c             1.9617211   5.1906688  -6.7759051 -17.83768277
#> Br5370-H3d            17.8526682   2.7759192 -17.2175150 -21.15270193
#> Br5889-H4a            -0.4701251  11.8751826  13.8751852 -11.41212989
#> Br5889-H4b             7.0633761  16.4422422  15.2495352  -7.23392242
#> Br5889-H4c            25.2251257  17.6023287  12.4713693  -6.87359313
#> Br5889-H4d            29.8482061  20.9653347   5.5102993  -6.43804434
#> Br5941-H5a           -35.6253833   0.7134732 -10.5264167  -5.42196417
#> Br5941-H5b           -17.6191395   2.5113135 -13.4322834   1.56757862
#> Br5941-H5c            -6.6487252  -1.2955902  -9.5993058   0.78914386
#> Br5941-H5d            -7.6194942   1.3309445 -13.6071695  -2.26065092
#> Br2623-C1a           -10.1010034   3.4651972 -12.6639320  14.68966429
#> Br2623-C1b           -12.7938639  13.1044541  -8.6413894  11.72388243
#> Br2623-C1c            -6.8892598   5.5181045 -14.9853887  15.12509117
#> Br2623-C1d            -0.6433381   5.7535892 -14.0623212  15.30292400
#> Br5005-C2a           -18.5856349  10.7736928   7.0093586   3.88175527
#> Br5005-C2b           -10.1477427  11.8512887   5.5053828   6.00909087
#> Br5005-C2c           -11.2904273  12.5751571   3.0188303   7.33514500
#> Br5005-C2d             3.7343795  14.3375912   2.0946709   8.34727817
#> Br5370-C3a            11.1243523  14.9407954 -13.1933827  -7.11805206
#> Br5370-C3b            19.3258020  18.4608793 -11.4828406  -6.25664758
#> Br5370-C3c            25.8292091  15.8747211 -16.7403786  -6.34834583
#> Br5370-C3d            28.5445500  12.7132908 -19.2216966  -6.53677072
#> Br5889-C4a            -0.9700789  21.7463078  22.4511925   3.15678553
#> Br5889-C4b            11.7991678  28.3404649  26.4469573   4.29122128
#> Br5889-C4c            21.2170851  31.2093559  22.3907290   5.21536455
#> Br5889-C4d            26.1076975  31.6279907  18.7055320   5.07813587
#> Br5941-C5a            -4.6088301   4.6893368  -8.8994060  17.20439550
#> Br5941-C5b            -8.3377268  10.1820536  -6.3878007  14.04295770
#> Br5941-C5c            -3.2186105   6.8648876 -11.6051628  17.77800976
#> Br5941-C5d             3.8270681   4.8998134 -12.0550115  17.79225266
#>                              qSV5        qSV6         qSV7         qSV8
#> DLPFC_Br1385_A1_ribo   3.29894775  -1.8954415   4.83406406 -11.68699091
#> DLPFC_Br1385_A2_ribo   0.84142914   1.4315062   1.15898669 -16.89668243
#> DLPFC_Br1385_A3_ribo  -1.23691206   9.2405143   1.60037940 -10.94782893
#> DLPFC_Br1385_A4_ribo  -0.22938461   6.4807403   4.29630078 -12.12410484
#> DLPFC_Br1729_B1_ribo   4.75300439  -4.0030144   3.11435837  -4.92000092
#> DLPFC_Br1729_B2_ribo   4.51049214  -1.6362233   2.41412494  -5.16683186
#> DLPFC_Br1729_B3_ribo   0.56971055   5.7599980  -1.07249220  -5.43263053
#> DLPFC_Br1729_B4_ribo   3.16838318  -0.5522472   4.42032899  -0.20649712
#> DLPFC_Br2015_F1_ribo   3.41900549  -0.6198994  -0.73421338 -10.13414592
#> DLPFC_Br2015_F2_ribo   4.31215189   2.1610525   6.00198455  -1.42144827
#> DLPFC_Br2015_F3_ribo  -0.40935541   8.6863557  -0.13533690  -2.25662222
#> DLPFC_Br2015_F4_ribo   4.94372727   3.4489181  -0.32213329  -4.96589724
#> DLPFC_Br2020_C1_ribo   1.46720062  -7.7961467   2.75399362   7.83051976
#> DLPFC_Br2020_C2_ribo   1.34470808  -6.3384212   5.19661754  12.62619357
#> DLPFC_Br2020_C3_ribo  -3.81432346   4.5802790  -1.48774773   9.35572524
#> DLPFC_Br2020_C4_ribo  -1.47191987  -3.2541064   2.09588336  13.76465289
#> DLPFC_Br2074_D1_ribo  -1.75183563 -12.9689274 -10.11617641  -4.74763398
#> DLPFC_Br2074_D2_ribo   0.32398169 -13.1519853  -6.31620484   6.45949931
#> DLPFC_Br2074_D3_ribo  -0.90696548  -5.2032692 -11.94930102   6.45550449
#> DLPFC_Br2074_D4_ribo  -0.57767914 -11.4013011  -6.68290750   8.43098576
#> Br2623-H1a           -12.69740447   1.9138557  -6.53451425  -1.75738761
#> Br2623-H1b           -10.87797067   3.0498629  -7.11817127   0.93318134
#> Br2623-H1c           -12.55090381   2.9803121  -6.44253868   1.52592184
#> Br2623-H1d           -14.53239623   5.7884663  -8.67921032   1.79698709
#> Br5005-H2a             2.42068118  10.9512446  -0.12953474   2.41265702
#> Br5005-H2b             7.79465882  12.0175275   1.36284577   6.16517224
#> Br5005-H2c             6.76454127  14.1901712  -0.58747472   4.79404488
#> Br5005-H2d             3.38080691  14.3939315   2.02688893   6.22810083
#> Br5370-H3a             1.93037917  -5.7163601   0.71840260  -0.64194065
#> Br5370-H3b             5.25120934  -7.3121912   2.03259249   2.40058084
#> Br5370-H3c             3.55916337  -5.2554067   3.54218830   3.01837757
#> Br5370-H3d             2.96665210  -2.1553103   0.05010423   0.03320052
#> Br5889-H4a           -12.72343611   1.6713121  -0.36124754  -0.05454226
#> Br5889-H4b           -11.96667889   1.4334044  -0.59322297   0.32283968
#> Br5889-H4c           -13.12566123   3.2421874  -1.88918750   0.55878449
#> Br5889-H4d           -14.81789627   6.0559651  -2.18691163  -1.67350138
#> Br5941-H5a            -9.28421469   1.3716811   8.20367336  -0.24067790
#> Br5941-H5b           -10.17626423   0.8594806   9.46620221  -0.70811909
#> Br5941-H5c           -10.71952941   1.1437176  12.15379216   4.57822866
#> Br5941-H5d           -11.36542196   2.5073586  11.16092701   1.70449173
#> Br2623-C1a            -1.90938499  -1.0596874 -10.57105777  -1.19942304
#> Br2623-C1b            -3.48398945  -1.2994313  -6.77690867  -2.80423421
#> Br2623-C1c            -2.03352754  -0.2720727 -10.96103824  -2.32973869
#> Br2623-C1d            -2.57191628  -0.3600162 -10.48283360  -1.25557221
#> Br5005-C2a            15.07619837   8.8410781  -3.68414960   3.64808322
#> Br5005-C2b            16.94193248  11.3370314  -2.86233994   3.82357436
#> Br5005-C2c            15.77557559  11.3491061  -4.42787165   1.76588752
#> Br5005-C2d            15.90688141  11.2769542  -3.13208193   3.72499896
#> Br5370-C3a            12.76596963 -11.0755391   0.50262761  -2.74326702
#> Br5370-C3b            13.62213996 -11.0004558   1.01741797  -2.41919924
#> Br5370-C3c            12.98295147 -10.4774349  -0.88237918  -2.40960925
#> Br5370-C3d            14.87685298  -8.0954038  -1.53708193  -2.77389696
#> Br5889-C4a            -2.19946861  -6.3500535  -1.17184592  -1.15574276
#> Br5889-C4b            -3.81272604  -6.8604795   0.83932014  -1.91890775
#> Br5889-C4c            -5.33064053  -5.3499233  -0.47747863  -3.04230493
#> Br5889-C4d            -6.55865453  -4.0737780   0.22353501  -2.73816700
#> Br5941-C5a            -0.06518356  -2.9455861   9.93025775   2.93378335
#> Br5941-C5b            -1.40041323  -4.2474997  10.81490274   1.04866021
#> Br5941-C5c             0.22658203  -2.6394660   9.04720791   1.44201283
#> Br5941-C5d            -0.59385989  -2.7969340   9.32568543   2.99089692
#>                              qSV9       qSV10
#> DLPFC_Br1385_A1_ribo   6.34511072  -4.1495011
#> DLPFC_Br1385_A2_ribo  -1.92442917  -8.1839256
#> DLPFC_Br1385_A3_ribo   3.60630196  -6.2568901
#> DLPFC_Br1385_A4_ribo   7.54302269  -5.3148216
#> DLPFC_Br1729_B1_ribo   5.77893819   9.1803349
#> DLPFC_Br1729_B2_ribo   7.28928533   8.4832380
#> DLPFC_Br1729_B3_ribo  -3.02450270  13.2738159
#> DLPFC_Br1729_B4_ribo  10.55883394  10.9141091
#> DLPFC_Br2015_F1_ribo -11.81402317  -6.5252192
#> DLPFC_Br2015_F2_ribo  -4.91369086  -8.5616784
#> DLPFC_Br2015_F3_ribo  -1.66189763   1.3488337
#> DLPFC_Br2015_F4_ribo  -9.58395499   1.3503042
#> DLPFC_Br2020_C1_ribo   3.10327300  -7.9392924
#> DLPFC_Br2020_C2_ribo   7.02504464 -10.5244890
#> DLPFC_Br2020_C3_ribo  -8.62780929  -4.9353544
#> DLPFC_Br2020_C4_ribo   7.29553174  -8.1189661
#> DLPFC_Br2074_D1_ribo -11.97889427  -2.7206437
#> DLPFC_Br2074_D2_ribo  -1.96818749   0.1528716
#> DLPFC_Br2074_D3_ribo -13.77037563   9.1639410
#> DLPFC_Br2074_D4_ribo  -0.86310922   0.7028271
#> Br2623-H1a             2.86676237  -0.2293483
#> Br2623-H1b             3.90817300  -1.6207157
#> Br2623-H1c             7.19468385   0.5193020
#> Br2623-H1d             3.64329853  -0.2277253
#> Br5005-H2a            -3.15012947   0.2044681
#> Br5005-H2b             0.15519638  -1.4527198
#> Br5005-H2c             0.07232186  -3.7066066
#> Br5005-H2d            -1.81868765  -1.8361417
#> Br5370-H3a             1.40711187   1.7683458
#> Br5370-H3b             3.56969060   0.9653862
#> Br5370-H3c             2.07156301  -2.4789929
#> Br5370-H3d             0.95105339   0.5577165
#> Br5889-H4a             1.65074195   4.8675765
#> Br5889-H4b             1.76308175   2.2874004
#> Br5889-H4c             1.27294612   1.6974219
#> Br5889-H4d            -3.20788895  -0.8667641
#> Br5941-H5a            -5.31164609   1.8319140
#> Br5941-H5b            -4.06731484   2.7464987
#> Br5941-H5c            -1.11500418   1.4189277
#> Br5941-H5d            -4.74351709   0.3225908
#> Br2623-C1a             6.31286510   2.2224562
#> Br2623-C1b             0.76255820  -4.4206101
#> Br2623-C1c             4.95793090  -0.5068652
#> Br2623-C1d             5.05998073  -1.6079189
#> Br5005-C2a            -0.84760437   3.0707237
#> Br5005-C2b            -1.20533328   1.0742630
#> Br5005-C2c             0.09316461   2.6961947
#> Br5005-C2d            -0.59410619  -0.5768293
#> Br5370-C3a             1.00753636   2.4760862
#> Br5370-C3b            -0.34848194  -2.4107377
#> Br5370-C3c             0.82808073  -0.5304384
#> Br5370-C3d             1.12594882  -0.9059015
#> Br5889-C4a             0.79079185   4.5549161
#> Br5889-C4b            -1.72577388  -2.3539147
#> Br5889-C4c            -1.88028060  -1.6856983
#> Br5889-C4d            -2.09381344  -4.2096251
#> Br5941-C5a            -1.62961776   5.7478035
#> Br5941-C5b            -3.73429788   0.4379703
#> Br5941-C5c            -1.37779312   4.5531531
#> Br5941-C5d            -1.02865899   4.2669448