find_markers: Find marker genes for each cell type.

Description Usage Arguments Value Examples

View source: R/find_markers_fn.R

Description

Find marker genes for each cell type.

Usage

1
2
find_markers(Y, references = NULL, pure_samples = NULL,
  data_type = NULL, gamma = NULL, marker_method = "ratio")

Arguments

Y

Expression matrix.

(Required) Two-dimensional numeric. Must implement as.matrix.

Each row contains expression measurements for a particular sample. Each columm contains the measurements of the same gene over all individuals. Can either contain just the mixture samples to be deconvolved or both the mixture samples and the reference samples. See pure_samples and references for more details.

references

Cell-type reference expression matrix.

(Optional) Two-dimensional numeric. Must implement as.matrix. Must have same number of columns as Y. Columns must correspond to columns of Y.

Each row contains expression measurements for a reference profile of a particular cell type. Columns contain measurements of reference profiles of a gene. Optionally may merge this matrix with Y and use pure_samples to indicate which rows of Y are pure samples. If pure_samples is not specified references must be specified. In this case each row of references is assumed to be a distinct cell-type. If both pure_samples and references are specified then multiple rows of references may refer be the same cell type, and pure_samples specifies to which cell-type each row of references corresponds.

pure_samples

The pure sample indicies.

(Optional) List of one-dimensional integer. Must implement as.list.

The i-th element of the top-level list is a vector of indicies (rows of Y or references) that are pure samples of type i. If references is not specified then this argument identifies which rows of Y correspond to pure reference samples of which cell-types. If references is specified then this makes same idenficiation but for the references matrix instead.

data_type

Type of expression measurements.

(Optional) One-dimensional string.

An optional string indicating the type of the expression measurements. This is used to set gamma to a pre-determined value based upon the data type. Valid values are for probe-level microarray as “microarray-probe”, gene-level microarray as “microarray-gene” or rna-seq as “rna-seq”. Alternatively can set gamma directly.

gamma

Expression adjustment term.

(Optional) One-dimensional positive numeric.

If provided as a single positive number then that value will be used for gamma and over-ride the value of gamma chosen by the data_type argument. If neither gamma nor data_type are specified then gamma will be set to one.

marker_method

Method used to rank marker genes.

(Optional) One-dimensional string.

The method used to rank genes as markers. If not supplied defaults to “ratio”. Only used if markers are not provided to argument “markers”. Options are

  • 'ratio' selects and ranks markers by the ratio of the mean expression of each gene in each cell type to the mean of that gene in all other cell types.

  • 'regression ' selects and ranks markers by estimated regression coefficients in a series of regressions with single covariate that is indicator of each type.

  • 'diff' selects and ranks markers based upon the difference, for each cell type, between the median expression of a gene by each cell type and the median expression of that gene by the second most highly expressed cell type.

  • 'p.value' selects and ranks markers based upon the p-value of a t-test between the median expression of a gene by each cell type and the median expression of that gene by the second most highly expressed cell type.

Value

List with four elements. “L” is respective ranked markers for each cell type and “V” is the corresponding values of the ranking method (higher are better) used to determine markers and sort them, “M” is the matrix used to create the other two arguments after sorting and subsetting, and “sM” is a sorted version of M.

Examples

1
2
3
4
5
6
7
truth = shen_orr_ex$annotation$mixture
pure_samples <- lapply(1:3, function(i) {
   which(truth[, i] == 1)
})
Y <- shen_orr_ex$data$log
find_markers(Y=Y,pure_samples=pure_samples,
data_type='microarray-gene',marker_method='ratio')

Example output

$L
$L[[1]]
  [1] 120 253 479 446 529  90  61  66 174  77 316 162 215 551 488 473 574  91
 [19] 185  41 439 558 187  89  54 365 475  16 441  81 323 392 130 210 121 207
 [37]  24 135 428  86 486  44 461 133 332 459 403 217 442 537 575 431 358 105
 [55] 107 170 416   9 119 112 515 360  34 189 541 450 161 425 110 140 118 153
 [73] 599  82  58 134  72 116 221  43 423  26 195 589 103 132 146 173 549  94
 [91] 468 499 201 445 115  67 398 467 443 254 192 219 595 455 568 193 212 409
[109] 211  65  93  92  51  31  59 222 183 440 477 565 137  79  88 460 550  68
[127]  52 591 220 175  39 123 528 470 197 114 576 596 512  87 138 415 334 330
[145] 144 167 527   6 364 218 402 385 216 235 317 191  42  71  11 457 449 414
[163] 590 331 117 136  85 139 326 466 295 518 453  80  33 530 311 401 209 463
[181] 124 377 421 177  49  53 190 545  20 213 464  15 342 281 390 579 319 351
[199] 437 539

$L[[2]]
  [1] 180  95 429  14 451 430  56 396 598 349 165 313 259  23 593  12  21  30
 [19] 151  84 296 434 152 184 264  18 419 143 577 341 588 186 570 388 199 597
 [37] 196  22 278  36 567 480 310 363 306 277 352 424 373 375 247 344 246 395
 [55] 525 444  62 267 472 276 100 493 366 542 357 148 294 320  83 413 244 485
 [73] 456 181 348  29 534 378 581 172 125 101 393  46 301 129 131 288 370  32
 [91] 237 356 359 353 580 374  28 329  19 399 258  99 502  45 478 166 522 145
[109] 263 452 501 408 292 496 507 435 157 291 327 582 289 338 379 520 384 532
[127] 243 232 492 410 233 285 141 498 300 367 307 154 372 369 321 509 600 108
[145] 257 337 572 160 387  57 283  17 422 411  76 482 113 571 241 521 381 312
[163] 505 569 274 149 256 122 128  98  78 293 547  97 510 412  74 438 245 427
[181] 242 386 584 309 299 188 484 426 371 182 287 333 325 304 594 514 583 406
[199] 540 328

$L[[3]]
  [1]   1 168 481 109 454 206 368 487 179 476 227 405 262 504 586 339 552 362
 [19] 447   7  35 290 249  64 230 345 503 382 433 490 265 169  73 250 592 255
 [37] 553 150 269 205 239 279  25 546  60 555 252 361 407 354  75 560  55  27
 [55]  50 271 158   5 305  69 336 554 282 420 394 266 376 231 489   8 268 391
 [73]  13 223 270 102 111 465 260 156 491 383 495 389 563 272 208 346 557 526
 [91] 448 397  37 214 497 543 533 404 564 204 297 556 531  38  63 298 417 523
[109] 350 284 355 513 155 251 228 587 418 432 163 538 380   2 400 469 315 275
[127] 500  48 142 194 516 261 176 474 483 585 343 198 286 458 280 104 226 318
[145] 508 535 562 506 225 248 566 517 347 147 324 224 240 200   3 471 106 340
[163] 573 164  10  47 462 494 302  96 308 335 127 561   4 559 322 544 178  40
[181] 519 202 126 436 511 524 234 314 171 203 548 236 159 303  70 238 229 578
[199] 536 273


$V
$V[[1]]
  [1] 242.46044 222.91446 215.28060 212.62594 190.36244 179.93137 177.40565
  [8] 176.45311 175.58377 169.06212 168.91950 166.69446 165.22035 161.95655
 [15] 161.55278 159.79985 159.74249 158.35153 156.87935 151.98703 150.50922
 [22] 150.46284 149.69603 148.85105 148.51559 142.83828 142.65469 142.27505
 [29] 137.95910 136.94153 131.70865 131.49109 131.41156 131.35372 131.27233
 [36] 130.53878 128.57801 128.50012 127.76585 127.18317 127.07961 126.72713
 [43] 126.46012 126.01171 124.84977 123.89228 122.63971 120.93857 120.44310
 [50] 120.12139 120.11153 116.22404 115.67489 114.57137 114.24835 113.60556
 [57] 113.57707 109.90386 109.13497 106.42688 105.87362 104.44035 104.16316
 [64] 103.82184 103.28702 102.45259 101.60793 101.06642  99.15316  98.02395
 [71]  98.01168  97.86853  97.37893  97.34471  96.94657  96.60282  95.25480
 [78]  94.64394  94.16090  92.69600  92.25281  91.77234  91.51184  91.32743
 [85]  88.80062  88.76333  85.70033  84.93646  83.81182  83.47830  82.66748
 [92]  81.23226  81.20376  81.12640  80.83079  79.15479  78.43056  77.96049
 [99]  77.92796  77.85051  76.94363  74.07114  73.22549  70.77145  69.80654
[106]  69.75112  68.99806  67.32110  65.78814  65.48942  65.46591  64.74478
[113]  63.49607  63.30770  63.27366  63.12980  62.32523  62.27060  62.13281
[120]  61.42215  61.32473  61.21393  60.90930  60.45943  60.16125  59.34351
[127]  59.08206  58.97573  58.67167  58.25329  58.22823  56.89037  56.47105
[134]  56.29660  55.92282  55.79668  55.22149  54.92905  52.60543  52.56832
[141]  52.18818  52.00880  51.79277  51.73631  50.82337  50.51428  50.24619
[148]  49.51434  49.49994  49.44598  49.29493  48.74805  48.74533  48.67492
[155]  48.20965  48.00628  46.91765  46.15000  45.53533  45.07823  44.16316
[162]  43.21879  42.58285  42.38112  41.32710  41.07108  40.18016  40.11522
[169]  39.73634  39.35721  38.98250  38.95818  37.63731  37.55797  37.50083
[176]  37.39889  37.16827  37.06380  36.73642  36.51131  36.32393  35.76912
[183]  35.76039  35.72624  35.05150  35.00339  34.37153  34.22095  33.57015
[190]  33.47629  33.34217  33.16317  32.95812  32.91718  32.37610  31.81997
[197]  31.80661  31.52158  31.23896  31.02910

$V[[2]]
  [1] 390.19030 294.52534 289.42511 211.60346 179.41701 158.19397 131.49242
  [8] 123.63070 119.23271 111.99647 111.35206 109.30619 109.04861 105.44800
 [15] 100.71713  99.10636  98.68013  98.49159  96.09401  94.32064  92.92460
 [22]  92.54878  90.55789  88.78434  87.42231  86.97392  85.76897  85.12225
 [29]  81.30495  81.01972  80.85329  78.24764  77.78914  75.57237  75.45814
 [36]  72.68299  72.66110  71.04771  69.17088  68.96705  68.31585  67.93476
 [43]  67.85902  67.84151  65.80222  65.45358  64.98173  64.86867  64.78556
 [50]  64.50785  63.00920  62.85190  61.92110  60.68372  60.62235  60.40268
 [57]  59.65553  59.50531  59.37996  58.41836  57.67876  57.65701  57.41476
 [64]  56.02591  55.84920  55.82340  55.56612  55.45506  54.43731  53.89955
 [71]  53.46451  52.85443  51.56035  51.42869  49.33334  48.64347  47.17041
 [78]  47.03579  46.53588  46.48954  45.67293  45.48738  45.45811  45.26787
 [85]  44.81681  44.53747  44.16689  43.94625  43.92715  43.60422  43.40342
 [92]  43.19170  42.33798  41.64620  41.60630  41.56925  41.22958  41.13779
 [99]  40.68209  40.54566  40.51217  40.44051  40.15617  39.48073  38.89161
[106]  38.58163  38.32676  37.39784  37.32332  36.96166  36.59479  35.66014
[113]  35.33126  34.89791  34.63511  34.58097  34.57378  34.02238  34.02216
[120]  34.01025  33.75146  33.56285  33.34646  33.33405  33.03530  32.89263
[127]  32.80499  32.68100  32.52682  32.39797  32.37715  32.05847  32.02188
[134]  31.60134  31.44846  31.37748  31.25118  31.21922  31.20006  30.96671
[141]  30.95432  30.92634  30.85068  30.62921  30.56571  30.50997  30.47105
[148]  30.30428  30.12850  29.89497  29.75437  29.74617  29.67407  29.52082
[155]  29.41821  29.33677  29.22136  29.15955  28.76715  28.70126  28.68984
[162]  28.61602  28.60645  28.58729  28.41796  28.38620  28.23036  28.18920
[169]  28.15200  28.14781  27.99149  27.84600  27.83905  27.76898  27.57398
[176]  27.10134  27.08080  26.82859  26.78222  26.48656  26.44805  26.01144
[183]  25.96563  25.76010  25.53078  25.41195  25.32042  25.17598  25.13946
[190]  24.83849  24.81233  24.74204  24.70858  24.38719  24.23100  24.20882
[197]  24.16933  24.11786  24.09025  24.02758

$V[[3]]
  [1] 599.359668 415.052034 399.963851 381.248319 374.727418 256.423912
  [7] 230.604336 163.415396 158.182651 157.721323 112.184000  88.804000
 [13]  87.452901  84.910460  80.330621  73.057847  64.330416  58.340685
 [19]  57.158386  54.716876  52.784128  52.479113  49.642932  47.850118
 [25]  44.680645  42.936093  42.353402  39.640173  39.573834  38.086928
 [31]  37.324679  37.124587  37.107287  32.926376  31.751032  31.552985
 [37]  31.325350  31.297013  30.838452  30.602287  30.497611  30.165257
 [43]  28.105785  27.279288  26.515057  26.014952  25.987005  24.230101
 [49]  23.804567  23.474905  23.208677  23.136930  22.705552  22.169292
 [55]  21.925015  21.663595  21.545603  21.369208  21.203289  21.028854
 [61]  20.267297  20.182648  19.917142  19.661400  19.556162  19.532939
 [67]  19.191427  19.061141  18.933729  18.415950  18.229073  18.180313
 [73]  17.926005  17.786169  17.767557  17.721657  17.482702  17.466888
 [79]  17.383790  17.308960  17.161262  16.848290  16.699105  16.501361
 [85]  16.434573  16.064486  16.020370  15.984595  15.806086  15.793794
 [91]  15.632803  15.504091  15.403655  15.390841  15.073799  15.051252
 [97]  15.021739  14.915415  14.827576  14.791638  14.783764  14.577726
[103]  14.535886  14.502059  14.156666  14.145969  13.936527  13.935458
[109]  13.841901  13.835335  13.833905  13.745383  13.488255  13.485368
[115]  13.418174  13.393770  13.329310  13.143679  13.046603  12.997175
[121]  12.992419  12.688339  12.507877  12.468493  12.429145  12.225565
[127]  12.170224  12.137673  12.107105  11.983704  11.899821  11.887084
[133]  11.814632  11.691487  11.605199  11.524067  11.471270  11.348010
[139]  11.308793  11.294299  11.224036  11.210236  11.168526  11.131958
[145]  11.129044  11.105642  11.010161  10.890382  10.861988  10.853521
[151]  10.824968  10.777357  10.678714  10.436097  10.368669  10.357307
[157]  10.323396  10.279038  10.158425  10.141870  10.118077  10.016287
[163]  10.015201  10.007869   9.982499   9.961879   9.901653   9.896991
[169]   9.891591   9.888104   9.875304   9.833395   9.820412   9.813056
[175]   9.788083   9.775021   9.700780   9.691315   9.652485   9.623129
[181]   9.606010   9.580741   9.578879   9.574901   9.528133   9.474883
[187]   9.462522   9.354159   9.337003   9.325040   9.299281   9.289342
[193]   9.282107   9.277748   9.177035   9.110043   9.075984   9.055262
[199]   9.055119   9.044122

dtangle documentation built on Dec. 2, 2019, 1:09 a.m.