Last data update: 2014.03.03
R: Creates features from a GSA analysis that can be used in...
GSA.make.features R Documentation
Creates features from a GSA analysis that can be used in other procedures
Description
Creates features from a GSA analysis that can be used in other procedures,
for example, sample classification.
Usage
GSA.make.features(GSA.func.obj, x, genesets, genenames)
Arguments
GSA.func.obj
Object returned by GSA.func
x
Expression dataset from which the features are to be created
genesets
Gene set collection
genenames
Vector of gene names in expression dataset
Details
Creates features from a GSA analysis that can be used in other procedures,
for example, sample classification.
For example, suppose the GSA analysis computes a maxmean score for gene set
1 that is positive, based on the mean of the positive part of
the scores in that
gene set. Call the subset of genes with positive scores "A". Then we compute a new feature for this geneset, for each sample,
by computing the mean of the scores for genes in A, setting other gene scores
to zero.
Author(s)
Robert Tibshirani
References
Efron, B. and Tibshirani, R.
On testing the significance of sets of genes. Stanford tech report rep 2006.
http://www-stat.stanford.edu/~tibs/ftp/GSA.pdf
Examples
######### two class unpaired comparison
# y must take values 1,2
set.seed(100)
x<-matrix(rnorm(1000*20),ncol=20)
dd<-sample(1:1000,size=100)
u<-matrix(2*rnorm(100),ncol=10,nrow=100)
x[dd,11:20]<-x[dd,11:20]+u
y<-c(rep(1,10),rep(2,10))
genenames=paste("g",1:1000,sep="")
#create some random gene sets
genesets=vector("list",50)
for(i in 1:50){
genesets[[i]]=paste("g",sample(1:1000,size=30),sep="")
}
geneset.names=paste("set",as.character(1:50),sep="")
GSA.func.obj<-GSA.func(x,y, genenames=genenames, genesets=genesets, resp.type="Two class unpaired")
GSA.make.features(GSA.func.obj, x, genesets, genenames)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(GSA)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GSA/GSA.make.features.Rd_%03d_medium.png", width=480, height=480)
> ### Name: GSA.make.features
> ### Title: Creates features from a GSA analysis that can be used in other
> ### procedures
> ### Aliases: GSA.make.features
> ### Keywords: univar survival ts
>
> ### ** Examples
>
>
> ######### two class unpaired comparison
> # y must take values 1,2
>
> set.seed(100)
> x<-matrix(rnorm(1000*20),ncol=20)
> dd<-sample(1:1000,size=100)
>
> u<-matrix(2*rnorm(100),ncol=10,nrow=100)
> x[dd,11:20]<-x[dd,11:20]+u
> y<-c(rep(1,10),rep(2,10))
>
>
> genenames=paste("g",1:1000,sep="")
>
> #create some random gene sets
> genesets=vector("list",50)
> for(i in 1:50){
+ genesets[[i]]=paste("g",sample(1:1000,size=30),sep="")
+ }
> geneset.names=paste("set",as.character(1:50),sep="")
>
> GSA.func.obj<-GSA.func(x,y, genenames=genenames, genesets=genesets, resp.type="Two class unpaired")
>
>
> GSA.make.features(GSA.func.obj, x, genesets, genenames)
[,1] [,2] [,3] [,4] [,5]
[1,] 0.533834126 0.33692705 0.583750228 0.041919385 0.899232783
[2,] -0.066403536 -0.24604327 0.030631995 -0.116751629 -0.472615340
[3,] 0.704457631 0.24377766 0.402533623 0.425696373 0.018840740
[4,] 0.209005743 -0.03237060 -0.376174533 -0.133740902 0.055100075
[5,] 0.447938718 0.31254936 0.421709232 0.161854807 0.149531605
[6,] -0.524667308 -0.35592376 -0.254419794 -0.383805976 -0.650752543
[7,] -0.227603311 -0.34856600 -0.028321994 -0.324438733 -0.003616816
[8,] 0.803762099 0.36160236 0.261968422 0.468228362 -0.164427817
[9,] 0.302957024 0.46928643 0.551649923 0.430380365 0.094875701
[10,] -0.206852103 -0.19692127 -0.080933449 -0.118135127 -0.407619479
[11,] -0.174776408 0.44677185 0.248959962 -0.266869643 0.652401861
[12,] 0.180058452 -0.09005820 0.537569881 -0.037975454 0.282770912
[13,] 0.368395798 0.01562469 1.010926527 -0.061160468 0.380232795
[14,] -0.425460077 0.15352212 -0.002387816 -0.075155155 -0.063570284
[15,] 0.981705840 0.83507139 0.794005480 0.513731440 0.473623907
[16,] -0.052689887 -0.62745097 -0.069097576 0.192796849 0.088296043
[17,] -0.500649821 -1.03826421 -0.508208816 -0.325348618 -0.758041442
[18,] -0.242778350 -0.23833536 -0.354319587 0.092876234 -0.134520675
[19,] -0.312303184 -0.36873677 -0.251024797 -0.057776223 -0.044939179
[20,] 0.272446558 0.59622516 0.355704175 0.375427596 0.546063733
[21,] -0.008691822 -0.45474359 -0.945207624 -0.152646096 -0.527954052
[22,] -0.425233611 -0.40806915 0.052933407 -0.205589447 -0.234694937
[23,] 0.662777989 0.39118754 -0.003950476 0.155704444 0.602448593
[24,] -0.299315996 0.10593220 -0.411781336 -0.236724239 -0.544354886
[25,] 0.384228286 0.17208393 0.237918081 0.767052648 0.113730655
[26,] -0.003703495 0.11095310 -0.082648644 0.333147150 -0.781938427
[27,] 0.116564379 -0.15454759 -0.509845683 -0.726268231 -0.437726499
[28,] -0.258234655 -0.16824305 -0.543101476 -0.020283834 -0.394007493
[29,] 0.278511921 0.96644036 0.309195492 -0.058547081 0.562747537
[30,] 0.095698139 -0.07256052 0.474900507 0.425761899 0.562436664
[31,] -0.257758906 -0.44450251 -0.238274383 -0.358030764 -0.353366270
[32,] -0.094203640 -0.22969710 -0.398441831 -0.139487813 -0.903440071
[33,] 0.058570878 0.43618271 0.191715798 0.155429352 0.530340335
[34,] -0.110471873 -0.37547799 -0.372172621 -0.001489427 -0.234081993
[35,] 0.182481594 -0.02443611 0.433957304 -0.141913058 0.645085595
[36,] -0.030298279 -0.49490640 -0.108447628 0.004558591 0.087185581
[37,] -0.101267491 -0.41831764 -0.218832066 0.051427764 -0.373292883
[38,] 0.106980762 -0.20258891 -0.081646498 0.137080431 -0.445408885
[39,] 0.670445953 0.17750095 -0.446187060 -0.491519554 -0.648293579
[40,] 0.474240212 -0.38462443 -0.196415211 -0.014516782 -0.539779911
[41,] 0.268105401 0.35175133 0.506542830 0.013090824 0.537026264
[42,] -0.350462781 0.29131536 0.003672795 0.046804006 -0.104244573
[43,] 0.399483107 0.39117855 0.319432020 -0.065638640 0.421864934
[44,] 0.382690730 -0.67896592 -0.398461284 -0.224455873 -0.466291183
[45,] 0.213111909 0.29577654 -0.173172151 0.290808210 0.792198722
[46,] 0.076540446 0.04540160 0.308572311 -0.053255541 0.574284899
[47,] -0.297880427 0.06981702 -0.339903020 -0.029717441 -0.091868261
[48,] -0.511782234 0.11510868 -0.417787289 -0.010520787 -1.027802207
[49,] -0.319186274 -0.40761382 -0.237706591 -0.359971463 0.019582654
[50,] -0.023612283 0.64365734 0.687253154 1.016945745 0.382688555
[,6] [,7] [,8] [,9] [,10] [,11]
[1,] 0.17611335 0.28030107 0.29579605 -0.06717297 0.49047900 -0.53664492
[2,] 0.01212818 -0.14155928 -0.40925488 -0.22215580 -0.06788189 0.27400164
[3,] 0.34363652 0.20234783 0.40265325 0.61445248 0.76475560 -0.45546422
[4,] -0.31283901 -0.28364975 -0.53134938 -0.11560669 -0.26312537 -0.19562650
[5,] 0.64002535 -0.23213811 0.67456033 0.43813085 0.41935578 -0.36534950
[6,] -0.02914406 -0.60717543 -0.48767299 -0.81518359 -0.58026780 0.57258883
[7,] 0.23672484 -0.46455356 -0.08600612 -0.30946973 -0.27371008 0.18735305
[8,] 0.75948092 0.40392971 0.00906729 0.33402493 -0.02261033 0.40206887
[9,] 0.19343719 -0.12896720 0.54330759 0.08731448 0.56375891 -0.29717912
[10,] -0.09155921 -0.56291916 -0.57330066 -0.29256330 -0.05426161 -0.48718359
[11,] 0.49828613 0.72420931 1.00238063 0.55681535 0.56344123 -0.53026477
[12,] 0.52420369 0.62749521 0.53511054 0.05007351 0.07509083 -0.12677911
[13,] 0.22544441 0.18557384 0.29795875 0.14661641 0.67104798 0.11404793
[14,] -0.57301498 -0.33165270 -0.08764565 0.19554543 -0.24230145 0.16416489
[15,] 0.94473401 0.05167521 0.45381589 0.66421014 0.65869612 -0.77915971
[16,] -0.03202832 0.04880699 -0.10097569 -0.17075721 -0.21989297 0.34403273
[17,] 0.12895653 -1.18844104 -0.49765692 -0.55767555 -0.15570590 0.59097746
[18,] 0.05702240 -0.39383525 -0.28819225 -0.55491188 -0.09049782 0.28944415
[19,] -0.25304378 -0.13062735 -0.75473707 -0.61093140 -0.12204426 0.06642115
[20,] 0.23488759 0.08635421 -0.17181827 0.57495167 0.42527337 -0.99788212
[21,] -0.28377569 0.11058389 0.06158178 -0.26100971 -0.38926699 0.47816697
[22,] -0.66589735 -0.58150973 -0.30085693 -0.36794224 0.27547389 0.40360083
[23,] 0.86148296 0.54868023 0.79615324 -0.04126220 0.48865127 -1.09502385
[24,] -0.14872113 -0.90874784 0.25366975 -0.46063470 -0.50624293 0.49018359
[25,] 0.35707305 0.16984588 0.48851074 0.56879476 0.65997014 -0.49988719
[26,] 0.13600799 0.11935228 -0.78715440 -0.18714237 -0.18357008 0.17240645
[27,] 0.11554198 -1.17767752 -0.02385107 -0.32436303 -0.13706950 0.76343926
[28,] 0.12055267 -0.23147648 -0.42996046 -0.11486332 -0.40191433 0.75583029
[29,] 0.36822262 0.18895426 0.37561134 0.38017947 -0.05146362 -0.10257722
[30,] 0.22791852 0.08204872 0.78965444 0.08447811 0.74405561 -0.13369567
[31,] -0.46022767 -0.88108065 -0.21477190 -0.27927641 -0.58503829 0.67326048
[32,] -0.24625196 0.02201052 -0.28416078 0.02022794 -0.46732115 0.96612808
[33,] 0.54018806 0.37311335 0.18612197 0.38367839 0.26450163 -0.87839021
[34,] -0.17286258 0.27120542 -0.21711627 -0.13639457 -0.24616581 0.35243646
[35,] 0.62667315 0.15841553 0.16337239 0.68343769 0.11576264 -0.72086453
[36,] -0.71140904 -0.15419995 -0.50227585 -0.50664799 -0.45881755 0.42331003
[37,] -0.19692887 -0.11738875 -0.33674712 -0.64391767 0.08785722 0.23795981
[38,] -0.51814038 -0.64817093 -0.57215310 -0.16896701 -0.33786445 0.22290710
[39,] -0.63565697 -0.21982823 -0.12309940 -1.12028887 -0.29825469 0.15470906
[40,] -0.35383596 -0.52272208 -0.13652848 -0.20062704 -0.57148317 -0.01544109
[41,] 0.33613169 0.15330667 0.28703733 0.22760261 0.52654348 -0.59255513
[42,] -0.13062226 -0.18707697 -0.24211485 -0.18833768 -0.71356627 0.50968290
[43,] 0.23519822 0.59460976 0.39698214 0.05311383 0.51624737 -0.45906261
[44,] -0.61122619 -0.42191019 -0.04754544 -0.30134512 -0.78810376 -0.13469754
[45,] 0.65562422 0.28292883 -0.09652661 0.34279716 0.46598466 -0.61477412
[46,] 0.47681658 0.20201605 0.19564393 0.82609960 0.47119624 -0.10748939
[47,] -0.04649885 -0.57323309 -0.44146213 -0.34948182 -0.08890578 0.51240027
[48,] -0.25698363 -0.67398276 0.30248892 -0.17786909 -0.49007001 0.47272893
[49,] -0.18639737 -0.66101116 -0.13741530 -0.17014956 -0.07312555 -0.33814226
[50,] 0.70394405 0.39159958 0.35868562 0.31860601 0.03880334 -0.64951640
[,12] [,13] [,14] [,15] [,16]
[1,] -0.297810316 0.02995348 -0.52963356 -0.528211196 -0.458947234
[2,] 0.025658743 0.46819606 0.41554086 0.138569997 -0.141969867
[3,] -0.660522872 -0.36141802 -0.32871166 0.062243262 -0.441362608
[4,] -0.284134722 0.55319363 0.10367152 0.488870010 0.253648695
[5,] 0.109731135 0.07578442 -0.21370824 -0.769407470 -0.184533949
[6,] 0.533502998 0.87393478 0.22321346 0.312005803 0.415025935
[7,] 0.472599461 0.55708932 0.22934488 -0.247888450 0.147056147
[8,] -0.985554694 -0.10991517 -0.50510906 -0.418948008 -0.592445635
[9,] -0.547570899 -0.41879791 -0.77165292 -0.461604202 -0.232720852
[10,] 0.697672354 0.17515339 0.53664177 0.648316804 0.199338076
[11,] -0.311377896 -0.41667638 -0.51748745 -0.298100075 -0.485229293
[12,] -0.566659882 0.03336010 -0.38155420 -0.327007403 -0.501359197
[13,] -0.896880396 0.01833612 -0.61464046 -0.067008649 -0.470382932
[14,] 0.318671662 0.32032233 -0.05419182 0.173080528 0.225410232
[15,] -0.899468713 -0.60007791 -0.91399288 -0.529678681 0.004965975
[16,] 0.220183491 -0.09478180 0.46121260 0.185458308 0.080189934
[17,] 0.906642847 0.31110633 0.91773802 0.497690030 0.166070597
[18,] -0.304179618 0.60899407 0.23657149 0.440543022 0.177080938
[19,] 0.635855388 0.16959168 -0.23999686 0.146082847 0.574933874
[20,] -0.006415334 -0.71937529 0.10522283 -0.248963264 -0.631379720
[21,] 0.135537080 0.57978474 0.26926206 0.297858310 0.267013036
[22,] 0.292172325 0.37322400 0.45259839 0.430630350 0.036053561
[23,] -0.730087194 -0.44080299 -0.22769241 -0.809640946 -0.772105636
[24,] -0.024664783 0.31469221 0.53705602 0.926438257 0.225615770
[25,] -0.477817611 -0.95565957 -0.45574897 -0.413125856 0.021260998
[26,] 0.073052560 0.06828231 0.06208266 0.614523098 0.017766147
[27,] 0.327944815 0.35056309 -0.03276620 0.499656138 0.508928981
[28,] 0.131810494 0.50524542 0.35192866 0.219077125 -0.011890072
[29,] -0.745587315 -0.12665108 -0.38346301 -0.041815158 -0.331535024
[30,] -0.123050438 -0.25504695 -0.51280398 -0.328336150 -0.570518395
[31,] 0.322852805 0.66834041 0.81884967 0.203597142 0.332892932
[32,] 0.019664803 0.76795800 0.11153405 0.180683828 0.370651241
[33,] -0.127102708 -0.19522622 0.10398122 0.012105978 -0.389449124
[34,] -0.280887090 0.48214926 0.48053932 0.378742664 0.130454856
[35,] -0.281713927 -0.81435844 0.07918738 -0.074918286 0.141920404
[36,] 0.175282013 0.51508401 0.65736382 0.677681864 0.208025492
[37,] 0.276438461 -0.02587227 0.05339142 0.115172862 0.469970073
[38,] 0.356521782 0.39996596 1.00031781 0.400408097 0.188369062
[39,] 0.493085183 0.37859696 0.31785250 0.204300282 0.481136283
[40,] 0.372527549 0.53841302 0.17240928 0.617692202 -0.103167620
[41,] 0.044849875 -0.35019466 -0.33732203 0.002974478 -0.185380216
[42,] 0.235995038 0.35351604 0.47107253 0.242555928 -0.154755981
[43,] -0.273096811 -0.02783195 -0.36467291 -0.677361902 -0.607665500
[44,] 0.993011652 0.34620266 0.13221603 0.168329573 0.322037047
[45,] -0.569048421 0.25395451 -0.38193982 -0.542442840 -0.477653743
[46,] -0.528316092 -0.71921308 -0.47382891 -0.480053793 -0.539106390
[47,] -0.394122463 0.49119891 0.26278247 0.351304837 -0.181277044
[48,] 0.489618411 0.30221424 0.47834532 0.401346840 0.365584514
[49,] 0.402968883 0.47753234 0.86788385 0.441098958 -0.066298158
[50,] -0.129636420 -0.43229471 -0.49172983 -0.652728261 -0.891858683
[,17] [,18] [,19] [,20]
[1,] -0.433992278 -0.58488954 -0.08532932 -0.14567519
[2,] -0.067969834 0.36552188 0.09335590 0.12900007
[3,] 0.124700645 -0.73986144 -0.42759199 -0.89516281
[4,] 0.302082201 0.58510327 -0.43305849 0.41100081
[5,] -0.087779240 -1.09496765 -0.39941735 -0.50387009
[6,] 0.356896736 0.50682236 0.22419973 0.67082262
[7,] -0.396487991 0.42264688 0.09024345 0.36760477
[8,] -0.187020559 -0.16478986 -0.08588356 -0.56742826
[9,] 0.003194441 -0.63142141 0.03224028 0.21751220
[10,] 0.303213175 0.31201607 -0.02643032 0.22632764
[11,] -0.453176575 -0.11171586 -0.71423220 -0.41335974
[12,] -0.491286974 -0.10555322 -0.10034777 -0.11715170
[13,] -0.443637015 -0.32247811 -0.43747023 -0.12054698
[14,] 0.212634544 0.04776755 0.09777720 -0.05351657
[15,] -0.631239548 -0.49253468 -0.75726949 -0.77281377
[16,] -0.171098186 0.27130155 -0.38483548 0.03132959
[17,] 0.299883146 0.20848465 0.55037239 0.95207033
[18,] 0.416417933 0.55259372 -0.17584819 -0.09412497
[19,] 0.493235373 0.30069876 0.52164456 0.23769726
[20,] 0.117503175 -0.18943499 -0.16304876 -0.56174230
[21,] 0.064302613 0.25781002 0.13821366 0.36318142
[22,] 0.333895595 0.32211852 0.02232849 0.19476405
[23,] -0.245853979 -0.39930875 -0.26575209 0.52439424
[24,] 0.479249611 0.05681412 0.02736141 0.12417489
[25,] 0.040955007 -0.47924149 -0.65315579 -0.04678769
[26,] -0.224081780 0.16586609 0.22489394 0.15190542
[27,] 0.192901933 0.44118824 0.10330204 0.10408448
[28,] 0.252669575 0.36112678 -0.28438401 0.16011816
[29,] -0.737227676 -0.43621287 0.02873390 -0.44351684
[30,] -0.404734676 -0.04317344 -0.14263319 -0.90039919
[31,] -0.034857021 0.42357484 0.05036949 0.61344701
[32,] -0.113177878 0.21419342 -0.29850560 0.50163595
[33,] -0.540743264 -0.33619552 -0.15114643 -0.61767618
[34,] 0.259332883 -0.24554424 -0.06042697 0.09823056
[35,] 0.170405818 -0.39844167 -0.72110538 -0.22294809
[36,] -0.017302857 -0.08952708 -0.08684572 0.41218694
[37,] -0.011654937 0.87470490 -0.07528893 0.35258612
[38,] -0.005619158 0.15261731 0.09115520 -0.07576419
[39,] 0.332408249 0.14202759 0.13333922 0.49772614
[40,] -0.042101457 0.16246693 0.42049501 0.32299904
[41,] -1.289708602 -0.17290864 -0.27445196 -0.05244154
[42,] 0.005787243 0.05531535 -0.23669553 0.09215971
[43,] 0.036632098 -0.35561010 -0.32722161 -0.20658000
[44,] 0.333525966 0.48503131 0.30070720 0.60925032
[45,] -0.299050947 0.20411829 -0.61377005 -0.02892436
[46,] 0.281219598 -0.03822271 -0.06149720 -0.45680813
[47,] 0.404774134 0.61637096 0.33573288 -0.21003116
[48,] -0.073489429 0.58917493 0.18633136 -0.06265470
[49,] 0.062078126 0.47917732 0.15250798 0.05418739
[50,] -0.325322764 -0.26748334 -0.40576230 -0.27223841
>
>
>
>
>
>
>
>
>
>
> dev.off()
null device
1
>