
Accessor Methods for VISTA Object
VISTA-accessors.RdThese accessor functions expose the analysis components stored in a VISTA object.
Core expression matrices and annotations live in the underlying
SummarizedExperiment, while differential expression results, summaries, and
configuration details are kept inside metadata(x).
Usage
# S4 method for class 'VISTA'
comparisons(object, source = "active")
# S4 method for class 'VISTA'
deg_summary(object, source = "active")
# S4 method for class 'VISTA'
cutoffs(object)
# S4 method for class 'VISTA'
norm_counts(object, summarise = FALSE)
# S4 method for class 'VISTA'
sample_info(object)
# S4 method for class 'VISTA'
row_data(object)
# S4 method for class 'VISTA'
group_colors(object)
# S4 method for class 'VISTA'
group_palette(object)Arguments
- object
An object of class
VISTA.- source
Which DE result source to use for
comparisons()/deg_summary(). One of"active","deseq2","edger","limma", or"consensus"."active"uses the currently selected source stored in metadata.- summarise
Logical. If TRUE, returns mean-normalized counts grouped by the grouping column stored in the
VISTAobject (e.g., condition or treatment). Default is FALSE.
Value
The content of the respective slot or processed data:
- comparisons
A named list of differential expression tables stored in
metadata(x)$de_results.- deg_summary
A named list of DEG summary tables stored in
metadata(x)$de_summary.- cutoffs
A list of analysis thresholds held in
metadata(x)$de_cutoffs(empty list if absent).- norm_counts
A matrix of normalized counts, optionally averaged by group.
- sample_info
A
DataFrameof sample metadata.- row_data
A
DataFrameof gene-level annotation (e.g., baseMean, gene ID).- group_colors
A named character vector of colours from
metadata(x)$group$colors.- group_palette
The qualitative palette name stored in
metadata(x)$group$palette.
Examples
# Create example VISTA object
data("count_data", package = "VISTA")
data("sample_metadata", package = "VISTA")
vista <- create_vista(
counts = count_data[1:100, ],
sample_info = sample_metadata[1:6, ],
column_geneid = "gene_id",
group_column = "cond_long",
group_numerator = "treatment1",
group_denominator = "control"
)
#> estimating size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing
# Access differential expression comparisons
comps <- comparisons(vista)
names(comps)
#> [1] "treatment1_VS_control"
comparisons(vista, source = "active")
#> $treatment1_VS_control
#> gene_id baseMean log2fc lfcSE stat
#> ENSG00000000003 ENSG00000000003 726.878325 -0.356142962 0.23230461 -1.53308607
#> ENSG00000000419 ENSG00000000419 545.331525 0.187985325 0.12159577 1.54598579
#> ENSG00000000457 ENSG00000000457 240.989131 0.062563981 0.16104873 0.38847856
#> ENSG00000000460 ENSG00000000460 54.633560 -0.008300710 0.39812317 -0.02084960
#> ENSG00000000971 ENSG00000000971 5574.909092 0.369947421 0.31100001 1.18954150
#> ENSG00000001036 ENSG00000001036 1307.851782 -0.213552643 0.15171061 -1.40763158
#> ENSG00000001084 ENSG00000001084 580.781900 -0.040773241 0.26881284 -0.15167892
#> ENSG00000001167 ENSG00000001167 391.976798 -0.506659327 0.28198556 -1.79675626
#> ENSG00000001460 ENSG00000001460 190.955072 -0.224882589 0.21515522 -1.04521094
#> ENSG00000001461 ENSG00000001461 2878.467968 -0.128227779 0.38203094 -0.33564763
#> ENSG00000001497 ENSG00000001497 564.051475 0.021641300 0.11838618 0.18280259
#> ENSG00000001561 ENSG00000001561 100.281189 0.237321897 0.94004696 0.25245749
#> ENSG00000001617 ENSG00000001617 598.841326 -0.313908928 0.21175777 -1.48239629
#> ENSG00000001626 ENSG00000001626 6.086652 -1.407807279 0.86490423 -1.62770307
#> ENSG00000001629 ENSG00000001629 1793.418010 -0.232766199 0.16212970 -1.43567899
#> ENSG00000001630 ENSG00000001630 58.791295 -0.224048583 0.36135730 -0.62001954
#> ENSG00000001631 ENSG00000001631 808.622140 -0.049317200 0.14402536 -0.34242025
#> ENSG00000002016 ENSG00000002016 198.156953 -0.322686859 0.18688219 -1.72668602
#> ENSG00000002330 ENSG00000002330 183.591815 0.066614681 0.20014352 0.33283455
#> ENSG00000002549 ENSG00000002549 1377.554775 0.163237010 0.14383717 1.13487364
#> ENSG00000002586 ENSG00000002586 8805.204607 0.096791244 0.13701604 0.70642270
#> ENSG00000002745 ENSG00000002745 7.997305 -0.155925571 1.35948971 -0.11469419
#> ENSG00000002746 ENSG00000002746 111.530755 0.007978706 0.42154272 0.01892740
#> ENSG00000002822 ENSG00000002822 371.488901 -0.202158994 0.15521135 -1.30247557
#> ENSG00000002834 ENSG00000002834 7355.028442 0.393130841 0.12418821 3.16560506
#> ENSG00000002919 ENSG00000002919 261.852871 0.360639085 0.19309103 1.86771540
#> ENSG00000002933 ENSG00000002933 711.822747 0.404260624 1.69455560 0.23856439
#> ENSG00000003056 ENSG00000003056 1122.947166 -0.056799262 0.09420310 -0.60294475
#> ENSG00000003096 ENSG00000003096 388.878345 -0.844169540 0.25494305 -3.31120829
#> ENSG00000003137 ENSG00000003137 94.998962 -0.942638124 0.75403125 -1.25013137
#> ENSG00000003249 ENSG00000003249 107.530971 -0.327674466 0.41048889 -0.79825417
#> ENSG00000003393 ENSG00000003393 869.984321 0.180734940 0.21072977 0.85766213
#> ENSG00000003400 ENSG00000003400 80.080167 -0.320705873 0.53478156 -0.59969508
#> ENSG00000003402 ENSG00000003402 2581.077677 1.059786635 0.19294670 5.49263936
#> ENSG00000003436 ENSG00000003436 4898.836792 -0.244935322 0.20823638 -1.17623694
#> ENSG00000003509 ENSG00000003509 308.118396 -0.053526695 0.15282106 -0.35025732
#> ENSG00000003756 ENSG00000003756 2162.918217 -0.260555007 0.08726862 -2.98566675
#> ENSG00000003987 ENSG00000003987 27.893187 0.960752642 0.42516560 2.25971396
#> ENSG00000003989 ENSG00000003989 41.186394 0.498066836 0.97490942 0.51088524
#> ENSG00000004059 ENSG00000004059 1248.573145 0.370647229 0.13650864 2.71519245
#> ENSG00000004139 ENSG00000004139 87.489219 -0.175622749 0.25536691 -0.68772712
#> ENSG00000004142 ENSG00000004142 1568.576639 0.154836323 0.12181926 1.27103315
#> ENSG00000004399 ENSG00000004399 3984.199757 -0.021836196 0.28835753 -0.07572612
#> ENSG00000004455 ENSG00000004455 1326.862181 0.110524877 0.17012447 0.64967067
#> ENSG00000004478 ENSG00000004478 495.743535 -0.073005807 0.14528666 -0.50249492
#> ENSG00000004487 ENSG00000004487 1278.705831 -0.294748727 0.10706833 -2.75290299
#> ENSG00000004534 ENSG00000004534 1364.687700 -0.179443873 0.16283758 -1.10198070
#> ENSG00000004660 ENSG00000004660 66.539195 -0.347768112 0.35091462 -0.99103341
#> ENSG00000004700 ENSG00000004700 1055.447369 0.312872303 0.14421564 2.16947549
#> ENSG00000004766 ENSG00000004766 500.392295 -0.019881515 0.12259104 -0.16217755
#> ENSG00000004776 ENSG00000004776 2577.378598 -0.008537275 0.34596684 -0.02467657
#> ENSG00000004777 ENSG00000004777 100.092969 -0.282398733 0.41442198 -0.68142797
#> ENSG00000004779 ENSG00000004779 388.838799 0.090863673 0.16124801 0.56350261
#> ENSG00000004799 ENSG00000004799 560.139920 2.876078467 0.56991088 5.04654072
#> ENSG00000004838 ENSG00000004838 13.342452 -0.130118230 0.58969796 -0.22065233
#> ENSG00000004846 ENSG00000004846 19.685913 -1.791984774 0.99198318 -1.80646689
#> ENSG00000004864 ENSG00000004864 156.201995 0.068236539 0.33143138 0.20588437
#> ENSG00000004866 ENSG00000004866 437.932077 -0.616435590 0.22658991 -2.72049001
#> ENSG00000004897 ENSG00000004897 1582.084328 0.056903368 0.08738462 0.65118284
#> ENSG00000004961 ENSG00000004961 460.854229 -0.245917899 0.17608434 -1.39659153
#> ENSG00000004975 ENSG00000004975 1021.753087 -0.315556185 0.24265656 -1.30042307
#> ENSG00000005007 ENSG00000005007 2290.585681 0.214613147 0.09259216 2.31783280
#> ENSG00000005020 ENSG00000005020 731.455249 0.222892780 0.24352012 0.91529513
#> ENSG00000005022 ENSG00000005022 1189.825336 -0.062024538 0.13254998 -0.46793322
#> ENSG00000005059 ENSG00000005059 208.874361 0.096808665 0.28964422 0.33423303
#> ENSG00000005075 ENSG00000005075 874.369317 0.084587358 0.12209906 0.69277646
#> ENSG00000005100 ENSG00000005100 482.233193 0.245963349 0.11651425 2.11101512
#> ENSG00000005108 ENSG00000005108 9.543684 0.673059866 0.69903578 0.96284037
#> ENSG00000005156 ENSG00000005156 225.969861 -0.291159408 0.35355517 -0.82351902
#> ENSG00000005175 ENSG00000005175 311.276720 -0.229781948 0.37581531 -0.61142253
#> ENSG00000005187 ENSG00000005187 8.673949 0.358544488 0.80066640 0.44780759
#> ENSG00000005189 ENSG00000005189 73.365168 -0.288230099 0.38784399 -0.74315990
#> ENSG00000005194 ENSG00000005194 482.061695 0.138376112 0.13618813 1.01606587
#> ENSG00000005206 ENSG00000005206 682.721506 0.062080592 0.12397640 0.50074523
#> ENSG00000005238 ENSG00000005238 743.362164 -0.249782993 0.13930770 -1.79303074
#> ENSG00000005243 ENSG00000005243 1034.293050 -0.068664538 0.21024985 -0.32658543
#> ENSG00000005249 ENSG00000005249 295.575439 0.531771527 0.27881786 1.90723622
#> ENSG00000005302 ENSG00000005302 491.365706 0.237261433 0.15445038 1.53616604
#> ENSG00000005339 ENSG00000005339 2607.340444 -0.151944692 0.14364773 -1.05775907
#> ENSG00000005379 ENSG00000005379 163.675124 0.282225698 0.33075565 0.85327552
#> ENSG00000005381 ENSG00000005381 4.535548 0.370227078 1.58407906 0.23371755
#> ENSG00000005436 ENSG00000005436 263.443342 0.178395591 0.19029732 0.93745719
#> ENSG00000005448 ENSG00000005448 243.464318 0.237507354 0.20303452 1.16978802
#> ENSG00000005469 ENSG00000005469 399.039017 -0.295568100 0.34629246 -0.85352162
#> ENSG00000005471 ENSG00000005471 32.561862 -1.188168604 0.62968707 -1.88691918
#> pvalue padj regulation
#> ENSG00000000003 1.252546e-01 4.628976e-01 Other
#> ENSG00000000419 1.221080e-01 4.628976e-01 Other
#> ENSG00000000457 6.976619e-01 8.783114e-01 Other
#> ENSG00000000460 9.833656e-01 9.848990e-01 Other
#> ENSG00000000971 2.342267e-01 6.052157e-01 Other
#> ENSG00000001036 1.592402e-01 5.116888e-01 Other
#> ENSG00000001084 8.794402e-01 9.344052e-01 Other
#> ENSG00000001167 7.237432e-02 3.445712e-01 Other
#> ENSG00000001460 2.959255e-01 6.619386e-01 Other
#> ENSG00000001461 7.371366e-01 8.783114e-01 Other
#> ENSG00000001497 8.549529e-01 9.316795e-01 Other
#> ENSG00000001561 8.006875e-01 9.231035e-01 Other
#> ENSG00000001617 1.382349e-01 4.895819e-01 Other
#> ENSG00000001626 1.035879e-01 4.402484e-01 Other
#> ENSG00000001629 1.510937e-01 5.116888e-01 Other
#> ENSG00000001630 5.352449e-01 7.905136e-01 Other
#> ENSG00000001631 7.320347e-01 8.783114e-01 Other
#> ENSG00000002016 8.422407e-02 3.767919e-01 Other
#> ENSG00000002330 7.392592e-01 8.783114e-01 Other
#> ENSG00000002549 2.564283e-01 6.227544e-01 Other
#> ENSG00000002586 4.799253e-01 7.905136e-01 Other
#> ENSG00000002745 9.086875e-01 9.535610e-01 Other
#> ENSG00000002746 9.848990e-01 9.848990e-01 Other
#> ENSG00000002822 1.927539e-01 5.670262e-01 Other
#> ENSG00000002834 1.547608e-03 3.288666e-02 Other
#> ENSG00000002919 6.180175e-02 3.445712e-01 Other
#> ENSG00000002933 8.114434e-01 9.231035e-01 Other
#> ENSG00000003056 5.465454e-01 7.905136e-01 Other
#> ENSG00000003096 9.289404e-04 2.631998e-02 Other
#> ENSG00000003137 2.112516e-01 5.792382e-01 Other
#> ENSG00000003249 4.247230e-01 7.521137e-01 Other
#> ENSG00000003393 3.910791e-01 7.271316e-01 Other
#> ENSG00000003400 5.487095e-01 7.905136e-01 Other
#> ENSG00000003402 3.959709e-08 3.365752e-06 Up
#> ENSG00000003436 2.395002e-01 6.052157e-01 Other
#> ENSG00000003509 7.261456e-01 8.783114e-01 Other
#> ENSG00000003756 2.829608e-03 4.810334e-02 Other
#> ENSG00000003987 2.383901e-02 2.026316e-01 Other
#> ENSG00000003989 6.094314e-01 8.318538e-01 Other
#> ENSG00000004059 6.623727e-03 7.037710e-02 Other
#> ENSG00000004139 4.916246e-01 7.905136e-01 Other
#> ENSG00000004142 2.037169e-01 5.771978e-01 Other
#> ENSG00000004399 9.396370e-01 9.740140e-01 Other
#> ENSG00000004455 5.159050e-01 7.905136e-01 Other
#> ENSG00000004478 6.153194e-01 8.318538e-01 Other
#> ENSG00000004487 5.906940e-03 7.037710e-02 Other
#> ENSG00000004534 2.704701e-01 6.386099e-01 Other
#> ENSG00000004660 3.216693e-01 6.835472e-01 Other
#> ENSG00000004700 3.004660e-02 2.321783e-01 Other
#> ENSG00000004766 8.711660e-01 9.344052e-01 Other
#> ENSG00000004776 9.803129e-01 9.848990e-01 Other
#> ENSG00000004777 4.956007e-01 7.905136e-01 Other
#> ENSG00000004779 5.730927e-01 8.118813e-01 Other
#> ENSG00000004799 4.498810e-07 1.911994e-05 Up
#> ENSG00000004838 8.253632e-01 9.231035e-01 Other
#> ENSG00000004846 7.084544e-02 3.445712e-01 Other
#> ENSG00000004864 8.368812e-01 9.238299e-01 Other
#> ENSG00000004866 6.518524e-03 7.037710e-02 Other
#> ENSG00000004897 5.149285e-01 7.905136e-01 Other
#> ENSG00000004961 1.625364e-01 5.116888e-01 Other
#> ENSG00000004975 1.934560e-01 5.670262e-01 Other
#> ENSG00000005007 2.045841e-02 1.932183e-01 Other
#> ENSG00000005020 3.600367e-01 7.117005e-01 Other
#> ENSG00000005022 6.398323e-01 8.497773e-01 Other
#> ENSG00000005059 7.382037e-01 8.783114e-01 Other
#> ENSG00000005075 4.884498e-01 7.905136e-01 Other
#> ENSG00000005100 3.477101e-02 2.462947e-01 Other
#> ENSG00000005108 3.356276e-01 6.958134e-01 Other
#> ENSG00000005156 4.102129e-01 7.418744e-01 Other
#> ENSG00000005175 5.409199e-01 7.905136e-01 Other
#> ENSG00000005187 6.542921e-01 8.556127e-01 Other
#> ENSG00000005189 4.573849e-01 7.905136e-01 Other
#> ENSG00000005194 3.095980e-01 6.747649e-01 Other
#> ENSG00000005206 6.165504e-01 8.318538e-01 Other
#> ENSG00000005238 7.296801e-02 3.445712e-01 Other
#> ENSG00000005243 7.439815e-01 8.783114e-01 Other
#> ENSG00000005249 5.649001e-02 3.445712e-01 Other
#> ENSG00000005302 1.244977e-01 4.628976e-01 Other
#> ENSG00000005339 2.901653e-01 6.619386e-01 Other
#> ENSG00000005379 3.935065e-01 7.271316e-01 Other
#> ENSG00000005381 8.152043e-01 9.231035e-01 Other
#> ENSG00000005436 3.485234e-01 7.053450e-01 Other
#> ENSG00000005448 2.420863e-01 6.052157e-01 Other
#> ENSG00000005469 3.933701e-01 7.271316e-01 Other
#> ENSG00000005471 5.917120e-02 3.445712e-01 Other
#>
# View DEG summary statistics
deg_summary(vista)
#> $treatment1_VS_control
#> regulation n
#> 1 Other 83
#> 2 Up 2
#>
# Get analysis cutoffs
cutoffs(vista)
#> $log2fc
#> [1] 1
#>
#> $pval
#> [1] 0.05
#>
#> $p_value_type
#> [1] "padj"
#>
#> $method
#> [1] "deseq2"
#>
#> $min_counts
#> [1] 10
#>
#> $min_replicates
#> [1] 1
#>
#> $covariates
#> character(0)
#>
#> $design_formula
#> NULL
#>
#> $consensus_mode
#> NULL
#>
#> $consensus_log2fc
#> NULL
#>
#> $active_source
#> [1] "deseq2"
#>
# Access normalized counts
nc <- norm_counts(vista)
head(nc)
#> SRR1039508 SRR1039509 SRR1039512 SRR1039513 SRR1039516
#> ENSG00000000003 683.40828 520.64761 760.37986 625.21466 1005.78678
#> ENSG00000000419 470.03191 598.51232 540.88876 559.32194 518.80214
#> ENSG00000000457 261.68800 245.21573 229.07205 251.31178 216.53582
#> ENSG00000000460 60.38954 63.91879 34.83986 53.63361 68.93793
#> ENSG00000000971 3272.10648 4275.58608 5380.14477 6515.71752 5940.15198
#> ENSG00000001036 1442.30347 1234.21376 1509.43676 1350.03460 1258.55921
#> SRR1039517
#> ENSG00000000003 765.83276
#> ENSG00000000419 584.43207
#> ENSG00000000457 242.11141
#> ENSG00000000460 46.08163
#> ENSG00000000971 8065.74772
#> ENSG00000001036 1052.56289
# Get group-summarized counts
nc_summary <- norm_counts(vista, summarise = TRUE)
head(nc_summary)
#> control treatment1
#> ENSG00000000003 816.52497 637.23168
#> ENSG00000000419 509.90761 580.75544
#> ENSG00000000457 235.76529 246.21297
#> ENSG00000000460 54.72244 54.54468
#> ENSG00000000971 4864.13441 6285.68377
#> ENSG00000001036 1403.43315 1212.27042
# Access sample metadata
sample_info(vista)
#> DataFrame with 6 rows and 14 columns
#> SampleName cell dex albut Run
#> <character> <character> <character> <character> <character>
#> SRR1039508 GSM1275862 N61311 untrt untrt SRR1039508
#> SRR1039509 GSM1275863 N61311 trt untrt SRR1039509
#> SRR1039512 GSM1275866 N052611 untrt untrt SRR1039512
#> SRR1039513 GSM1275867 N052611 trt untrt SRR1039513
#> SRR1039516 GSM1275870 N080611 untrt untrt SRR1039516
#> SRR1039517 GSM1275871 N080611 trt untrt SRR1039517
#> avgLength Experiment Sample BioSample cond_long
#> <integer> <character> <character> <character> <factor>
#> SRR1039508 126 SRX384345 SRS508568 SAMN02422669 control
#> SRR1039509 126 SRX384346 SRS508567 SAMN02422675 treatment1
#> SRR1039512 126 SRX384349 SRS508571 SAMN02422678 control
#> SRR1039513 87 SRX384350 SRS508572 SAMN02422670 treatment1
#> SRR1039516 120 SRX384353 SRS508575 SAMN02422682 control
#> SRR1039517 126 SRX384354 SRS508576 SAMN02422673 treatment1
#> cond_short groups sizeFactor sample_names
#> <character> <character> <numeric> <character>
#> SRR1039508 CTRL control 0.993550 SRR1039508
#> SRR1039509 TREAT1 treatment1 0.860467 SRR1039509
#> SRR1039512 CTRL control 1.148110 SRR1039512
#> SRR1039513 TREAT1 treatment1 0.652576 SRR1039513
#> SRR1039516 CTRL control 1.131453 SRR1039516
#> SRR1039517 TREAT1 treatment1 1.367139 SRR1039517
# Access gene-level annotations
head(row_data(vista))
#> DataFrame with 6 rows and 1 column
#> baseMean
#> <numeric>
#> ENSG00000000003 726.8783
#> ENSG00000000419 545.3315
#> ENSG00000000457 240.9891
#> ENSG00000000460 54.6336
#> ENSG00000000971 5574.9091
#> ENSG00000001036 1307.8518
# Get group colors
group_colors(vista)
#> control treatment1
#> "#C87A8A" "#00A396"
# Get palette name
group_palette(vista)
#> [1] "Dark 2"
# For method = "both", inspect method-specific outputs
if (FALSE) { # \dontrun{
vista_both <- create_vista(
counts = count_data,
sample_info = sample_metadata,
column_geneid = "gene_id",
group_column = "cond_long",
group_numerator = "treatment1",
group_denominator = "control",
method = "both",
result_source = "consensus"
)
comparisons(vista_both, source = "deseq2")
comparisons(vista_both, source = "edger")
vista_both <- set_de_source(vista_both, "edger")
} # }