Mercurial > repos > blankenberglab > gpca
comparison r-gpca.R @ 2:4865e7f4e9c5 draft
planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/tools/r-gpca commit b72f398663cc133523cae0f5d7db2af1b4312f7a
| author | blankenberglab |
|---|---|
| date | Tue, 27 Nov 2018 12:29:58 -0500 |
| parents | d93629e79f5e |
| children | 8def7dda3bee |
comparison
equal
deleted
inserted
replaced
| 1:d93629e79f5e | 2:4865e7f4e9c5 |
|---|---|
| 108 | 108 |
| 109 dir.create(opt$path); | 109 dir.create(opt$path); |
| 110 data<-t(as.matrix(read.delim(opt$data, row.names=1, header=TRUE, sep="\t"))) | 110 data<-t(as.matrix(read.delim(opt$data, row.names=1, header=TRUE, sep="\t"))) |
| 111 batch<-as.matrix(read.delim(opt$batch, header=TRUE, row.names=1, sep="\t")) | 111 batch<-as.matrix(read.delim(opt$batch, header=TRUE, row.names=1, sep="\t")) |
| 112 | 112 |
| 113 write('<html><body><a name="top"></a>',file = opt$html_outfile, append=TRUE) | |
| 114 write('#Batch\tDelta\tP-value\tCumulative Variance',file = opt$numbers_outfile, append=TRUE) | 113 write('#Batch\tDelta\tP-value\tCumulative Variance',file = opt$numbers_outfile, append=TRUE) |
| 115 write('<div align="left><ul id =""><p><b>Table of Contents</b></p></ul></div>', file=opt$html_outfile, append=TRUE) | |
| 116 | 114 |
| 115 write('<html><body><div align="left" id="top"><p><h1>Table of Contents</h1><ul>',file = opt$html_outfile, append=TRUE) | |
| 117 for (row in 1:nrow(batch)) { | 116 for (row in 1:nrow(batch)) { |
| 118 write(paste0('<li><a href="#',row.names(batch)[row],'">',row.names(batch)[row],'</a></li>'), file=opt$html_outfile, append=TRUE) | 117 write(paste0('<li><a href="#',row.names(batch)[row],'">',row.names(batch)[row],'</a></li>'), file=opt$html_outfile, append=TRUE) |
| 119 } | 118 } |
| 119 write('</ul></p></div>', file=opt$html_outfile, append=TRUE) | |
| 120 | |
| 120 for (row in 1:nrow(batch)) { | 121 for (row in 1:nrow(batch)) { |
| 121 batch1<-as.numeric(factor(batch[row,])) | 122 batch1<-as.numeric(factor(batch[row,])) |
| 122 | 123 |
| 123 out<-gPCA.batchdetect(x=data, batch=batch1, center=opt$center, scaleY=opt$scaleY, nperm=opt$nperm, filt=opt$filt, seed=opt$seed) | 124 out<-gPCA.batchdetect(x=data, batch=batch1, center=opt$center, scaleY=opt$scaleY, nperm=opt$nperm, filt=opt$filt, seed=opt$seed) |
| 124 | 125 |
