Found 160295 results in 22147 files, showing top 50 files (show more).
RBGL:src/Basic2DMatrix.hpp: [ ]
29: 	std::vector< std::vector<Object> > array;
5: class Basic2DMatrix
8: 	Basic2DMatrix( int rows, int cols ) : array( rows )
14: 	Basic2DMatrix( const Basic2DMatrix & rhs ) : array( rhs.array ) { }
2: #define BASIC2DMATRIX_H
11: 			array[ i ].resize( cols );
17: 	{ return array[ row ]; }
20: 	{ return array[ row ]; }
23: 	{ return array.size( ); }
26: 	{ return numrows( ) ? array[ 0 ].size( ) : 0; }
1: #ifndef BASIC2DMATRIX_H
32: #endif  // BASIC2DMATRIX
minfi:R/preprocessFunnorm.R: [ ]
161:     array <- annotation(rgSet)[["array"]]
197:     array <- extractedData$array
90:     model.matrix <- .buildControlMatrix450k(extractedData)
313:     model.matrix <- cbind(
407: .normalizeMatrix <- function(intMatrix, newQuantiles) {
410:     normMatrix <- sapply(1:ncol(intMatrix), function(i) {
189: .buildControlMatrix450k <- function(extractedData) {
385:         controlMatrix1 <- controlMatrix[sex == levels[1], ]
392:         controlMatrix2 <- controlMatrix[sex == levels[2], ]
2: ## Functional normalization of the 450k array
7: ## Return a normalized beta matrix
77:      normalizeQuantiles <- function(matrix, indices, sex = NULL) {
78:          matrix <- matrix[indices,,drop=FALSE]
79:          ## uses probs, model.matrix, nPCS, through scoping)
80:          oldQuantiles <- t(colQuantiles(matrix, probs = probs))
82:              newQuantiles <- .returnFit(controlMatrix = model.matrix, quantiles = oldQuantiles, nPCs = nPCs)
84:              newQuantiles <- .returnFitBySex(controlMatrix = model.matrix, quantiles = oldQuantiles, nPCs = nPCs, sex = sex)
86:          .normalizeMatrix(matrix, newQuantiles)
184:         array = array))
188: ## Extraction of the Control matrix
210:     if (array=="IlluminaHumanMethylation450k"){
216:     if (array=="IlluminaHumanMethylation450k"){
322:     for (colindex in 1:ncol(model.matrix)) {
323:         if(any(is.na(model.matrix[,colindex]))) {
324:             column <- model.matrix[,colindex]
326:             model.matrix[ , colindex] <- column
331:     model.matrix <- scale(model.matrix)
334:     model.matrix[model.matrix > 3] <- 3
335:     model.matrix[model.matrix < (-3)] <- -3
338:     model.matrix <- scale(model.matrix)
340:     return(model.matrix)
346:     stopifnot(is.matrix(quantiles))
347:     stopifnot(is.matrix(controlMatrix))
355:     design <- model.matrix(~controlPCs)
363:     stopifnot(is.matrix(quantiles))
364:     stopifnot(is.matrix(controlMatrix))
406: ### Normalize a matrix of intensities
408:     ## normMatrix <- matrix(NA, nrow(intMatrix), ncol(intMatrix))
425:         result <- preprocessCore::normalize.quantiles.use.target(matrix(crtColumn.reduced), target)
345: .returnFit <- function(controlMatrix, quantiles, nPCs) {
348:     stopifnot(ncol(quantiles) == nrow(controlMatrix))
354:     controlPCs <- prcomp(controlMatrix)$x[,1:nPCs,drop=FALSE]
362: .returnFitBySex <- function(controlMatrix, quantiles, nPCs, sex) {
365:     stopifnot(ncol(quantiles) == nrow(controlMatrix))
380:         newQuantiles <- .returnFit(controlMatrix = controlMatrix,
387:         newQuantiles1 <- .returnFit(controlMatrix = controlMatrix1,
394:         newQuantiles2 <- .returnFit(controlMatrix = controlMatrix2,
411:         crtColumn <- intMatrix[ , i]
428:     return(normMatrix)
12:     .isMatrixBackedOrStop(rgSet, "preprocessFunnorm")
bamsignals:src/bamsignals.cpp: [ ]
42:     int* array;//array where counts are stored
32: class GArray {
44:     GArray(int _rid, int _loc, int _len, int _strand){
30: //genomic array: represents a correspondence between a genomic range and
43:     int alen;//num of elements of the array
147:     //allocate a list with one vector (or matrix) containing all counts
164:             ranges[i].array = C + mult*i;
177:             //if strand specific, allocate matrix
181:             ranges[i].array = sig.begin(); 
186:             ranges[i].array = sig.begin(); 
360:         //even positions of the array are sense-reads, odd are antisense
361:         if (ss){ ++range.array[2*(relpos/binsize) + antisense]; }
362:         else {++range.array[relpos/binsize]; } 
424:             ++range.array[pos>0?pos:0];
427:                 --range.array[pos];
432:             ++range.array[pos>0?pos:0];
435:                 --range.array[pos];
491:         cumsum(ranges[i].array, ranges[i].len);
92: void parseRegions(std::vector<GArray>& container, RObject& gr, samFile* in){
131:         container.push_back(GArray(rid, starts[i] - 1, lens[i], strand));
137: //allocates the memory and sets the pointer for each GArray object
139: static List allocateList(std::vector<GArray>& ranges, int* binsize, bool ss){
152:           IntegerMatrix sig(2, rnum);
178:             IntegerMatrix sig(2, width);
222: static inline bool sortByStart(const GArray& a, const GArray& b){
236: //2. void pileup(GArray&): pileup the last set read with the given interval
241: static void overlapAndPileup(Bamfile& bfile, std::vector<GArray>& ranges, 
349:     inline void pileup(GArray& range){
418:     inline void pileup(GArray& range){
447:     std::vector<GArray> ranges;
477:     std::vector<GArray> ranges;
CellaRepertorium:src/cdhit-common.h: [ ]
183: 		int matrix[MAX_AA][MAX_AA];
173: typedef Vector<VectorInt> MatrixInt;
176: typedef Vector<VectorInt64> MatrixInt64;
179: class ScoreMatrix { //Matrix
197: typedef Vector<VectorIntX> MatrixIntX;
189: 		void set_matrix(int *mat1);
212: extern int NAAN_array[13];
45: #include<valarray>
95: // std::valarray could be used instead of std::vector.
186: 		ScoreMatrix();
193: }; // END class ScoreMatrix
476: 	MatrixInt64  score_mat;
477: 	MatrixInt    back_mat;
531: extern ScoreMatrix  mat;
606: int local_band_align( char query[], char ref[], int qlen, int rlen, ScoreMatrix &mat,
MotifDb:inst/scripts/import/uniprobe/import.R: [ ]
231:       matrix = matrices [[m]]
73:   matrix.start.lines = grep ('A\\s*[:\\|]', text)
79:   pwm.matrix = parsePWMfromText (lines)
148:     matrix.start.lines = grep ('A:', text)
153:     pwm.matrix = parsePWMfromText (lines.of.text)
157:     matrix.name <- paste(name.tokens[(token.count-1):token.count], collapse="/")
195:     matrix.name = names (matrices) [m]
33: createMatrixNameUniqifier = function (matrix)
36:   write (as.character (matrix), file=temporary.file)
52:   result = matrix (nrow=4, ncol=column.count, byrow=TRUE, dimnames=list (c ('A', 'C', 'G', 'T'), 1:column.count))
74:   stopifnot (length (matrix.start.lines) == 1)
75:   #printf ('%50s: %s', filename, list.to.string (matrix.start.lines))
76:   start.line = matrix.start.lines [1]
80:   return (pwm.matrix)
149:     stopifnot (length (matrix.start.lines) == 1)
150:     start.line = matrix.start.lines [1]
158:     matrices [[matrix.name]] = pwm.matrix
184: # and update matrix names
196:     #printf ('%d: %s', m, matrix.name)
197:     native.name.raw = gsub ('All_PWMs/', '', matrix.name)
225:       # the organism-dataSource-geneIdentifier matrix name.
232:       uniqifier = createMatrixNameUniqifier (matrix)
242:     experimentType = 'protein binding microarray'
42: } # createMatrixNameUniqifier
100:               'Compact, universal DNA microarrays...',
405:        #NBT06	5	Berger  	16998473	yeast;human;mouse	Compact, universal DNA microarrays...
shinyMethyl:R/server.R: [ ]
115:             matrix <- apply(quantiles, 2, function(x){
119:             matrix.x <- matrix[1:512,]
120:             matrix.y <- matrix[513:(2*512),]
242:                 density.matrix <- returnDensityMatrix()
243:                 x.matrix <- density.matrix[[1]]
244:                 y.matrix <- density.matrix[[2]]
27:         arrayNames      <- substr(sampleNames,12,17)
105:     returnDensityMatrix <- reactive({
125:     returnDensityMatrixNorm <- reactive({
121:             return(list(matrix.x = matrix.x, matrix.y = matrix.y))
139:             matrix <- apply(quantiles, 2, function(x){
143:             matrix.x <- matrix[1:512,]
144:             matrix.y <- matrix[513:(2*512),]
145:             return(list(matrix.x = matrix.x, matrix.y = matrix.y))  
245:                 x.matrix <- ((x.matrix - mouse.x)/range.x)^2
246:                 y.matrix <- ((y.matrix - mouse.y)/range.y)^2
247:                 clickedIndex <- arrayInd(which.min(x.matrix+y.matrix),
248:                                          c(512,ncol(x.matrix)))[2]
285:                 density.matrix <- returnDensityMatrixNorm()
286:                 x.matrix <- density.matrix[[1]]
287:                 y.matrix <- density.matrix[[2]]
288:                 x.matrix <- ((x.matrix - mouse.x)/range.x)^2
289:                 y.matrix <- ((y.matrix - mouse.y)/range.y)^2
290:                 clickedIndex <- arrayInd(which.min(x.matrix+y.matrix),
291:                                          c(512,ncol(x.matrix)))[2]
378:             densitiesPlot(matrix.x = returnDensityMatrix()[[1]],
379:                           matrix.y = returnDensityMatrix()[[2]],
391:                                 matrix.x = returnDensityMatrix()[[1]],
392:                                 matrix.y = returnDensityMatrix()[[2]],
445:         densitiesPlot(matrix.x = returnDensityMatrixNorm()[[1]],
446:                               matrix.y = returnDensityMatrixNorm()[[2]],
458:                                     matrix.x = returnDensityMatrixNorm()[[1]],
459:                                     matrix.y = returnDensityMatrixNorm()[[2]],
635:             matrix <- apply(betaQuantiles[[index]], 2, function(x){
639:             matrix.x <- matrix[1:512,]
640:             matrix.y <- matrix[513:(2*512),]
648:             densitiesPlot(matrix.x = matrix.x,
649:                           matrix.y = matrix.y,
711:         output$arrayDesign <- renderPlot({
717:         output$arrayDesignLegend <- renderPlot({
Director:inst/www/js/d3.v3.js: [ ]
6188:     chord.matrix = function(x) {
5:   var d3_arraySlice = [].slice, d3_array = function(list) {
5798:   function d3_interpolateArray(a, b) {
17:       d3_array(d3_document.documentElement.childNodes)[0].nodeType;
19:       d3_array = function(list) {
20:         var i = list.length, array = new Array(i);
21:         while (i--) array[i] = list[i];
22:         return array;
52:   d3.min = function(array, f) {
53:     var i = -1, n = array.length, a, b;
55:       while (++i < n) if ((b = array[i]) != null && b >= b) {
59:       while (++i < n) if ((b = array[i]) != null && a > b) a = b;
61:       while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
65:       while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
69:   d3.max = function(array, f) {
70:     var i = -1, n = array.length, a, b;
72:       while (++i < n) if ((b = array[i]) != null && b >= b) {
76:       while (++i < n) if ((b = array[i]) != null && b > a) a = b;
78:       while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
82:       while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
86:   d3.extent = function(array, f) {
87:     var i = -1, n = array.length, a, b, c;
89:       while (++i < n) if ((b = array[i]) != null && b >= b) {
93:       while (++i < n) if ((b = array[i]) != null) {
98:       while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
102:       while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
115:   d3.sum = function(array, f) {
116:     var s = 0, n = array.length, a, i = -1;
118:       while (++i < n) if (d3_numeric(a = +array[i])) s += a;
120:       while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a;
124:   d3.mean = function(array, f) {
125:     var s = 0, n = array.length, a, i = -1, j = n;
127:       while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j;
129:       while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j;
137:   d3.median = function(array, f) {
138:     var numbers = [], n = array.length, a, i = -1;
140:       while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a);
142:       while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a);
146:   d3.variance = function(array, f) {
147:     var n = array.length, m = 0, a, d, s = 0, i = -1, j = 0;
150:         if (d3_numeric(a = d3_number(array[i]))) {
158:         if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) {
201:   d3.shuffle = function(array, i0, i1) {
203:       i1 = array.length;
209:       t = array[m + i0], array[m + i0] = array[i + i0], array[i + i0] = t;
211:     return array;
213:   d3.permute = function(array, indexes) {
214:     var i = indexes.length, permutes = new Array(i);
215:     while (i--) permutes[i] = array[indexes[i]];
218:   d3.pairs = function(array) {
219:     var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n);
220:     while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ];
223:   d3.transpose = function(matrix) {
224:     if (!(n = matrix.length)) return [];
225:     for (var i = -1, m = d3.min(matrix, d3_transposeLength), transpose = new Array(m); ++i < m; ) {
226:       for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n; ) {
227:         row[j] = matrix[j][i];
257:     var n = arrays.length, m, i = -1, j = 0, merged, array;
259:     merged = new Array(j);
261:       array = arrays[n];
262:       m = array.length;
264:         merged[--j] = array[m];
303:     } else if (Array.isArray(object)) {
372:     function map(mapType, array, depth) {
373:       if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
374:       var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;
376:         if (values = valuesByKey.get(keyValue = key(object = array[i]))) {
398:       var array = [], sortKey = sortKeys[depth++];
400:         array.push({
405:       return sortKey ? array.sort(function(a, b) {
407:       }) : array;
409:     nest.map = function(array, mapType) {
410:       return map(mapType, array, 0);
412:     nest.entries = function(array) {
413:       return entries(map(d3.map, array, 0), 0);
433:   d3.set = function(array) {
435:     if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]);
611:           subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j)));
833:       value = new Array(n = (group = this[0]).length);
842:       var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData;
844:         var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue;
974:     var args = d3_array(arguments);
1054:       group = d3_array(d3_selectAll(nodes, d3_document));
1057:       group = d3_array(nodes);
1088:       var l = wrap(listener, d3_array(arguments));
1255:     return touches ? d3_array(touches).map(function(touch) {
1985:         return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments)));
2094:       if (Array.isArray(rows[0])) return dsv.formatRows(rows);
2295: ...(31 bytes skipped)...gth + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : "";
2734:     return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
3296:   function d3_geo_clipPolygonLinkCircular(array) {
3297:     if (!(n = array.length)) return;
3298:     var n, i = 0, a = array[0], b;
3300:       a.n = b = array[i];
3304:     a.n = b = array[0];
5448:     d3_geom_voronoiCells = new Array(sites.length);
5481:       var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[...(6 bytes skipped)...
5795: ...(83 bytes skipped).../i.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b);
5952:       return new d3_transform(t ? t.matrix : d3_transformIdentity);
6116:     var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;
6125:           x += matrix[i][j];
6139:             return sortSubgroups(matrix[i][a], matrix[i][b]);
6148:           var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k;
6189:       if (!arguments.length) return matrix;
6190:       n = (matrix = x) && matrix.length;
6413:           neighbors = new Array(n);
6818:   function d3_layout_stackMaxIndex(array) {
6819:     var i = 1, j = 0, v = array[0][1], k, n = array.length;
6821:       if ((k = array[i][1]) > v) {
9031:       tickArguments_ = d3_array(arguments);
6:     return d3_arraySlice.call(list);
256:   d3.merge = function(arrays) {
258:     while (++i < n) j += arrays[i].length;
1187:       point = point.matrixTransform(container.getScreenCTM().inverse());
5797:   d3.interpolateArray = d3_interpolateArray;
5847:     return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1))));
9142:             var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y);
cisPath:inst/extdata/D3/d3.js: [ ]
23:   return Array.prototype.slice.call(pseudoarray);
14: var d3_array = d3_arraySlice; // conversion for NodeLists
918: d3.interpolateArray = function(a, b) {
16: function d3_arrayCopy(pseudoarray) {
32: var d3_arraySubclass = [].__proto__?
17:   var i = -1, n = pseudoarray.length, array = [];
18:   while (++i < n) array.push(pseudoarray[i]);
19:   return array;
27:   d3_array(document.documentElement.childNodes)[0].nodeType;
29:   d3_array = d3_arrayCopy;
34: // Until ECMAScript supports array subclassing, prototype injection works well.
35: function(array, prototype) {
36:   array.__proto__ = prototype;
40: function(array, prototype) {
41:   for (var property in prototype) array[property] = prototype[property];
62: d3.mean = function(array, f) {
63:   var n = array.length,
69:     while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j;
71:     while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j;
75: d3.median = function(array, f) {
76:   if (arguments.length > 1) array = array.map(f);
77:   array = array.filter(d3_number);
78:   return array.length ? d3.quantile(array.sort(d3.ascending), .5) : undefined;
80: d3.min = function(array, f) {
82:       n = array.length,
86:     while (++i < n && ((a = array[i]) == null || a != a)) a = undefined;
87:     while (++i < n) if ((b = array[i]) != null && a > b) a = b;
89:     while (++i < n && ((a = f.call(array, array[i], i)) == null || a != a)) a = undefined;
90:     while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
94: d3.max = function(array, f) {
96:       n = array.length,
100:     while (++i < n && ((a = array[i]) == null || a != a)) a = undefined;
101:     while (++i < n) if ((b = array[i]) != null && b > a) a = b;
103:     while (++i < n && ((a = f.call(array, array[i], i)) == null || a != a)) a = undefined;
104:     while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
108: d3.extent = function(array, f) {
110:       n = array.length,
115:     while (++i < n && ((a = c = array[i]) == null || a != a)) a = c = undefined;
116:     while (++i < n) if ((b = array[i]) != null) {
121:     while (++i < n && ((a = c = f.call(array, array[i], i)) == null || a != a)) a = undefined;
122:     while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
147: d3.sum = function(array, f) {
149:       n = array.length,
154:     while (++i < n) if (!isNaN(a = +array[i])) s += a;
156:     while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a;
171:   for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m;) {
172:     for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n;) {
183: // arguments lo and hi may be used to specify a subset of the array which should
184: // be considered; by default the entire array is used. If x is already present
187: // `array.splice` assuming that a is already sorted.
189: // The returned insertion point i partitions the array a into two halves so that
206: // The returned insertion point i partitions the array into two halves so that
220: d3.first = function(array, f) {
222:       n = array.length,
223:       a = array[0],
227:     if (f.call(array, a, b = array[i]) > 0) {
233: d3.last = function(array, f) {
235:       n = array.length,
236:       a = array[0],
240:     if (f.call(array, a, b = array[i]) <= 0) {
253:   function map(array, depth) {
255:         ? rollup.call(nest, array) : (sortValues
256:         ? array.sort(sortValues)
257:         : array);
260:         n = array.length,
267:       if ((keyValue = key(object = array[i])) in o) {
299:   nest.map = function(array) {
300:     return map(array, 0);
303:   nest.entries = function(array) {
304:     return entries(map(array, 0), 0);
320:   // Applies to both maps and entries array.
348: d3.permute = function(array, indexes) {
352:   while (++i < n) permutes[i] = array[indexes[i]];
356:   return Array.prototype.concat.apply([], arrays);
358: d3.split = function(array, f) {
363:       n = array.length;
366:     if (f.call(values, value = array[i], i)) {
591:       if (length < width) value = new Array(width - length + 1).join(fill) + value;
601:       if (length < width) value = new Array(width - length + 1).join(fill) + value;
716:   return d3_ease_clamp(d3_ease_mode[m](d3_ease[t].apply(null, Array.prototype.slice.call(arguments, 1))));
966:   function(a, b) { return (b instanceof Array) && d3.interpolateArray(a, b); },
1391:         subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i)));
1813: // Note: assigning to the arguments array simultaneously changes the value of
1867:       : d3_selection([d3_array(selector)]); // assume node[]
2253:   return new d3_transform(d3_transformG.transform.baseVal.consolidate().matrix);
2958: // Converts the specified array of data into an array of points
3231: // Matrix to transform basis (b-spline) control points to bezier
3237: // Pushes a "C" B├ęzier curve onto the specified path array, given the
3271: // interpolation. Returns an array of tangent vectors. For details, see
3643:   return touches ? d3_array(touches).map(function(touch) {
22: function d3_arraySlice(pseudoarray) {
355: d3.merge = function(arrays) {
359:   var arrays = [],
369:       if (!values.length) arrays.push(values);
373:   return arrays;
1331:   d3_arraySubclass(groups, d3_selectionPrototype);
1870:   d3_arraySubclass(selection, d3_selection_enterPrototype);
1905:   d3_arraySubclass(groups, d3_transitionPrototype);
3238: // two specified four-element arrays which define the control points.
3637:   point = point.matrixTransform(container.getScreenCTM().inverse());
interactiveDisplay:inst/www/js/d3.v2.js: [ ]
20:     return Array.prototype.slice.call(pseudoarray);
5000:     var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;
5001:     chord.matrix = function(x) {
3317:   d3.interpolateArray = function(a, b) {
14:   function d3_arrayCopy(pseudoarray) {
2585:   var d3_arraySubclass = [].__proto__ ? function(array, prototype) {
15:     var i = -1, n = pseudoarray.length, array = [];
16:     while (++i < n) array.push(pseudoarray[i]);
17:     return array;
1547:   function d3_layout_stackMaxIndex(array) {
1548:     var i = 1, j = 0, v = array[0][1], k, n = array.length;
1550:       if ((k = array[i][1]) > v) {
2579:   var d3_array = d3_arraySlice;
2581:     d3_array(document.documentElement.childNodes)[0].nodeType;
2583:     d3_array = d3_arrayCopy;
2586:     array.__proto__ = prototype;
2587:   } : function(array, prototype) {
2588:     for (var property in prototype) array[property] = prototype[property];
2654:   d3.mean = function(array, f) {
2655:     var n = array.length, a, m = 0, i = -1, j = 0;
2657:       while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j;
2659:       while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j;
2663:   d3.median = function(array, f) {
2664:     if (arguments.length > 1) array = array.map(f);
2665:     array = array.filter(d3_number);
2666:     return array.length ? d3.quantile(array.sort(d3.ascending), .5) : undefined;
2668:   d3.min = function(array, f) {
2669:     var i = -1, n = array.length, a, b;
2671:       while (++i < n && ((a = array[i]) == null || a != a)) a = undefined;
2672:       while (++i < n) if ((b = array[i]) != null && a > b) a = b;
2674:       while (++i < n && ((a = f.call(array, array[i], i)) == null || a != a)) a = undefined;
2675:       while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
2679:   d3.max = function(array, f) {
2680:     var i = -1, n = array.length, a, b;
2682:       while (++i < n && ((a = array[i]) == null || a != a)) a = undefined;
2683:       while (++i < n) if ((b = array[i]) != null && b > a) a = b;
2685:       while (++i < n && ((a = f.call(array, array[i], i)) == null || a != a)) a = undefined;
2686:       while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
2690:   d3.extent = function(array, f) {
2691:     var i = -1, n = array.length, a, b, c;
2693:       while (++i < n && ((a = c = array[i]) == null || a != a)) a = c = undefined;
2694:       while (++i < n) if ((b = array[i]) != null) {
2699:       while (++i < n && ((a = c = f.call(array, array[i], i)) == null || a != a)) a = undefined;
2700:       while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
2738:   d3.sum = function(array, f) {
2739:     var s = 0, n = array.length, a, i = -1;
2741:       while (++i < n) if (!isNaN(a = +array[i])) s += a;
2743:       while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a;
2751:   d3.transpose = function(matrix) {
2752:     return d3.zip.apply(d3, matrix);
2756:     for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) {
2757:       for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) {
2790:   d3.first = function(array, f) {
2791:     var i = 0, n = array.length, a = array[0], b;
2794:       if (f.call(array, a, b = array[i]) > 0) {
2800:   d3.last = function(array, f) {
2801:     var i = 0, n = array.length, a = array[0], b;
2804:       if (f.call(array, a, b = array[i]) <= 0) {
2811:     function map(array, depth) {
2812:       if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
2813:       var i = -1, n = array.length, key = keys[depth++], keyValue, object, valuesByKey = new d3_Map, values, o = {};
2815:         if (values = valuesByKey.get(keyValue = key(object = array[i]))) {
2841:     nest.map = function(array) {
2842:       return map(array, 0);
2844:     nest.entries = function(array) {
2845:       return entries(map(array, 0), 0);
2883:   d3.permute = function(array, indexes) {
2885:     while (++i < n) permutes[i] = array[indexes[i]];
2889:     return Array.prototype.concat.apply([], arrays);
2891:   d3.split = function(array, f) {
2892:     var arrays = [], values = [], value, i = -1, n = array.length;
2895:       if (f.call(values, value = array[i], i)) {
3053:         if (length < width) value = (new Array(width - length + 1)).join(fill) + value;
3060:         if (length < width) value = (new Array(width - length + 1)).join(fill) + value;
3130:     return d3_ease_clamp(m(t.apply(null, Array.prototype.slice.call(arguments, 1))));
3138:       return new d3_transform(t ? t.matrix : d3_transformIdentity);
3348:     return b instanceof Array && d3.interpolateArray(a, b);
3621:           subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i)));
3786:       value = new Array(n = (group = this[0]).length);
3899:     return typeof selector === "string" ? d3_selectionRoot.selectAll(selector) : d3_selection([ d3_array(selector) ]);
4107:     return touches ? d3_array(touches).map(function(touch) {
4937:           x += matrix[i][j];
4951:             return sortSubgroups(matrix[i][a], matrix[i][b]);
4960:           var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k;
5002:       if (!arguments.length) return matrix;
5003:       n = (matrix = x) && matrix.length;
19:   function d3_arraySlice(pseudoarray) {
367:     d3_arraySubclass(groups, d3_selectionPrototype);
516:     d3_arraySubclass(selection, d3_selection_enterPrototype);
520:     d3_arraySubclass(groups, d3_transitionPrototype);
651:       point = point.matrixTransform(container.getScreenCTM().inverse());
2888:   d3.merge = function(arrays) {
2898:         if (!values.length) arrays.push(values);
2902:     return arrays;
scde:R/functions.R: [ ]
6015:             matrix <- gcl$vmap[rev(gcl$row.order), results$hvc$order, drop = FALSE]
6083:                        matrix <- results$rcm[rev(results$tvc$order), results$hvc$order]
6324:                        matrix <- results$rcm[rev(results$tvc$order), results$hvc$order]
1079: winsorize.matrix <- function(mat, trim) {
3405: calculate.joint.posterior.matrix <- function(lmatl, n.samples = 100, bootstrap = TRUE, n.cores = 15) {
3422: calculate.batch.joint.posterior.matrix <- function(lmatll, composition, n.samples = 100, n.cores = 15) {
3810: get.exp.posterior.matrix <- function(m1, counts, marginals, grid.weight = rep(1, nrow(marginals)), rescale = TRUE, n.cores =...(17 bytes skipped)...
3826: get.exp.logposterior.matrix <- function(m1, counts, marginals, grid.weight = rep(1, nrow(marginals)), rescale = TRUE, n.cores =...(6 bytes skipped)...
109: ##' Filter counts matrix
111: ##' Filter counts matrix based on gene and cell requirements
113: ##' @param counts read count matrix. The rows correspond to genes, columns correspond to individual cells
118: ##' @return a filtered read count matrix
145: ##' @param counts read count matrix. The rows correspond to genes (should be named), columns correspond to individual cells. The matrix should contain integer counts
163: ##' @return a model matrix, with rows corresponding to different cells, and columns representing different parameters of the d...(16 bytes skipped)...
184: ...(114 bytes skipped)...thod is designed to work on read counts - do not pass normalized read counts (e.g. FPKM values). If matrix contains read counts, but they are stored as numeric values, use counts<-apply(counts,2,function(x)...(49 bytes skipped)...
208: ##' @param counts count matrix
228:     fpkm <- log10(exp(as.matrix(fpkm))+1)
229:     wts <- as.numeric(as.matrix(1-fail[, colnames(fpkm)]))
262: ##' @param counts read count matrix
264: ...(41 bytes skipped)...e two groups of cells being compared. The factor entries should correspond to the rows of the model matrix. The factor should have two levels. NAs are allowed (cells will be omitted from comparison).
265: ##' @param batch a factor (corresponding to rows of the model matrix) specifying batch assignment of each cell, to perform batch correction
284: ##' \code{difference.posterior} returns a matrix of estimated expression difference posteriors (rows - genes, columns correspond to different magnit...(64 bytes skipped)...
305:         stop("ERROR: provided count data does not cover all of the cells specified in the model matrix")
309:     counts <- as.matrix(counts[, ci])
416: ##' @param models model matrix
417: ##' @param counts count matrix
513: ##' @param counts read count matrix
516: ##' @param batch a factor describing which batch group each cell (i.e. each row of \code{models} matrix) belongs to
523: ##' @return \subsection{default}{ a posterior probability matrix, with rows corresponding to genes, and columns to expression levels (as defined by \code{prior$x})
525: ...(24 bytes skipped)...ndividual.posterior.modes}{ a list is returned, with the \code{$jp} slot giving the joint posterior matrix, as described above. The \code{$modes} slot gives a matrix of individual expression posterior mode values on log scale (rows - genes, columns -cells)}
526: ...(85 bytes skipped)...st} slot giving a list of individual posterior matrices, in a form analogous to the joint posterior matrix, but reported on log scale }
538: ...(43 bytes skipped)...counts))) { stop("ERROR: provided count data does not cover all of the cells specified in the model matrix") }
545:     counts <- as.matrix(counts[, ci, drop = FALSE])
571:     # prepare matrix models
574:     mm <- matrix(NA, nrow(models), length(mn))
575:     mm[, which(!is.na(mc))] <- as.matrix(models[, mc[!is.na(mc)], drop = FALSE])
645: # models - entire model matrix, or a subset of cells (i.e. select rows) of the model matrix for which the estimates should be obtained
647: # return - a matrix of log(FPM) estimates with genes as rows and cells  as columns (in the model matrix order).
653: ##' @param counts count matrix
655: ##' @return a matrix of expression magnitudes on a log scale (rows - genes, columns - cells)
666: ...(43 bytes skipped)...counts))) { stop("ERROR: provided count data does not cover all of the cells specified in the model matrix") }
672: # magnitudes can either be a per-cell matrix or a single vector of values which will be evaluated for each cell
676: ##' Returns estimated drop-out probability for each cell (row of \code{models} matrix), given either an expression magnitude
678: ##' @param magnitudes a vector (\code{length(counts) == nrows(models)}) or a matrix (columns correspond to cells) of expression magnitudes, given on a log scale
679: ##' @param counts a vector (\code{length(counts) == nrows(models)}) or a matrix (columns correspond to cells) of read counts from which the expression magnitude should be estimate...(1 bytes skipped)...
681: ##' @return a vector or a matrix of drop-out probabilities
704:     if(is.matrix(magnitudes)) { # a different vector for every cell
705: ...(55 bytes skipped)...es))) { stop("ERROR: provided magnitude data does not cover all of the cells specified in the model matrix") }
730: ##' @param counts read count matrix (must contain the row corresponding to the specified gene)
732: ##' @param groups a two-level factor specifying between which cells (rows of the models matrix) the comparison should be made
733: ##' @param batch optional multi-level factor assigning the cells (rows of the model matrix) to different batches that should be controlled for (e.g. two or more biological replicates). The e...(224 bytes skipped)...
759:     counts <- as.matrix(counts[gene, ci, drop = FALSE])
819:         layout(matrix(c(1:3), 3, 1, byrow = TRUE), heights = c(2, 1, 2), widths = c(1), FALSE)
926: ##' @param counts count matrix
927: ...(8 bytes skipped)...am reference a vector of expression magnitudes (read counts) corresponding to the rows of the count matrix
936: ##' @return matrix of scde models
988:         #l <- layout(matrix(seq(1, 4*length(ids)), nrow = length(ids), byrow = TRUE), rep(c(1, 1, 1, 0.5), length(ids)), rep(1,...(23 bytes skipped)...
989:         l <- layout(matrix(seq(1, 4), nrow = 1, byrow = TRUE), rep(c(1, 1, 1, 0.5), 1), rep(1, 4), FALSE)
1000:         # make a joint model matrix
1011: ##' Determine principal components of a matrix using per-observation/per-variable weights
1015: ##' @param mat matrix of variables (columns) and observations (rows)
1026: ##' @return a list containing eigenvector matrix ($rotation), projections ($scores), variance (weighted) explained by each component ($var), total (...(45 bytes skipped)...
1030: ##' mat <- matrix( c(rnorm(5*10,mean=0,sd=1), rnorm(5*10,mean=5,sd=1)), 10, 10)  # random matrix
1032: ##' matw <- matrix( c(rnorm(5*10,mean=0,sd=1), rnorm(5*10,mean=5,sd=1)), 10, 10)  # random weight matrix
1040:       stop("bwpca: weight matrix contains NaN values")
1043:       stop("bwpca: value matrix contains NaN values")
1046:         matw <- matrix(1, nrow(mat), ncol(mat))
1061: ##' Winsorize matrix
1065: ##' @param mat matrix
1068: ##' @return Winsorized matrix
1072: ##' mat <- matrix( c(rnorm(5*10,mean=0,sd=1), rnorm(5*10,mean=5,sd=1)), 10, 10)  # random matrix
1075: ##' win.mat <- winsorize.matrix(mat, 0.1)
1100: ##' @param counts count matrix (integer matrix, rows- genes, columns- cells)
1133: ...(114 bytes skipped)...thod is designed to work on read counts - do not pass normalized read counts (e.g. FPKM values). If matrix contains read counts, but they are stored as numeric values, use counts<-apply(counts,2,function(x)...(49 bytes skipped)...
1162:         #celld <- WGCNA::cor(log10(matrix(as.numeric(as.matrix(ca)), nrow = nrow(ca), ncol = ncol(ca))+1), method = cor.method, use = "p", nThreads = n.cores)
1164:             celld <- WGCNA::cor(sqrt(matrix(as.numeric(as.matrix(ca[, ids])), nrow = nrow(ca), ncol = length(ids))), method = cor.method, use = "p", nThreads = n.co...(4 bytes skipped)...
1166:             celld <- stats::cor(sqrt(matrix(as.numeric(as.matrix(ca[, ids])), nrow = nrow(ca), ncol = length(ids))), method = cor.method, use = "p")
1174:         # TODO: correct for batch effect in cell-cell similarity matrix
1176:             # number batches 10^(seq(0, n)) compute matrix of id sums, NA the diagonal,
1178:             bm <- matrix(bid, byrow = TRUE, nrow = length(bid), ncol = length(bid))+bid
1181:             # use tapply to calculate means shifts per combination reconstruct shift vector, matrix, subtract
1239:                     l <- layout(matrix(seq(1, 4), nrow = 1, byrow = TRUE), rep(c(1, 1, 1, ifelse(local.theta.fit, 1, 0.5)), 1), rep(1, 4),...(7 bytes skipped)...
1263:     # make a joint model matrix
1278: ##' @param models model matrix (select a subset of rows to normalize variance within a subset of cells)
1279: ##' @param counts read count matrix
1288: ##' @param weight.k k value to use in the final weight matrix
1294: ##' @param gene.length optional vector of gene lengths (corresponding to the rows of counts matrix)
1307: ##' \item{matw} { weight matrix corresponding to the expression matrix}
1334:         stop(paste("supplied count matrix (cd) is missing data for the following cells:[", paste(rownames(models)[!rownames(models) %in% coln...(44 bytes skipped)...
1343:         if(verbose) { cat("Winsorizing count matrix ... ") }
1345:         #tfpm <- log(winsorize.matrix(exp(fpm), trim = trim))
1346:         tfpm <- winsorize.matrix(fpm, trim)
1430:     if(verbose) { cat("calculating weight matrix ... ") }
1450:     # calculate batch-specific version of the weight matrix if needed
1695:     # use milder weight matrix
1787: ##' (weighted) projection of the expression matrix onto a specified aspect (some pattern
1794: ##' @param center whether the matrix should be re-centered following pattern subtraction
1796: ##' @return a modified varinfo object with adjusted expression matrix (varinfo$mat)
1850: ##' @param center whether the expression matrix should be recentered
1989: ##' Determine de-novo gene clusters, their weighted PCA lambda1 values, and random matrix expectation.
1995: ##' @param n.samples number of randomly generated matrix samples to test the background distribution of lambda1 on
2004: ...(10 bytes skipped)... secondary.correlation whether clustering should be performed on the correlation of the correlation matrix instead
2014: ##' \item{varm} {standardized lambda1 values for each randomly generated matrix cluster}
2036:         mat <- winsorize.matrix(mat, trim = trim)
2060:                 gd <- as.dist(1-WGCNA::cor(as.matrix(gd), method = "p", nThreads = n.cores))
2062:                 gd <- as.dist(1-cor(as.matrix(gd), method = "p"))
2103:                 # generate random normal matrix
2105:                 m <- matrix(rnorm(nrow(mat)*n.cells), nrow = nrow(mat), ncol = n.cells)
2113:                     m <- winsorize.matrix(m, trim = trim)
2124:                         gd <- as.dist(1-WGCNA::cor(as.matrix(gd), method = "p", nThreads = 1))
2126:                         gd <- as.dist(1-cor(as.matrix(gd), method = "p"))
2230: ##' \item{xv} {a matrix of normalized aspect patterns (rows- significant aspects, columns- cells}
2231: ##' \item{xvw} { corresponding weight matrix }
2505: ##' @param distance distance matrix
2569:     if(trim > 0) { xvl$d <- winsorize.matrix(xvl$d, trim) } # trim prior to determining the top sets
2593: ...(35 bytes skipped)...f whether to return just the hclust result or a list containing the hclust result plus the distance matrix and gene values
2690: ##' @param mat Numeric matrix
2694: ##' @param row.cols  Matrix of row colors.
2695: ##' @param col.cols  Matrix of column colors. Useful for visualizing cell annotations such as batch labels.
2730: ##' @param col.cols  Matrix of column colors. Useful for visualizing cell annotations such as batch labels. Default NULL.
2840:         layout(matrix(c(1:3), 3, 1, byrow = TRUE), heights = c(2, 1, 2), widths = c(1), FALSE)
2953:                 m1@concomitant@x <- matrix()
2955:                     mod@x <- matrix()
2956:                     mod@y <- matrix()
3083: # vil - optional binary matrix (corresponding to counts) with 0s marking likely drop-out observations
3118:     f <- calcNormFactors(as.matrix(counts[gis, !is.na(groups)]), ...)
3127:     fpkm <- log10(exp(as.matrix(fpkm))+1)
3128:     wts <- as.numeric(as.matrix(1-fail[, colnames(fpkm)]))
3218:         # pair cell name matrix
3267:             m1@concomitant@x <- matrix()
3269:                 mod@x <- matrix()
3270:                 mod@y <- matrix()
3327:             #l <- layout(matrix(seq(1, 4*length(ids)), nrow = length(ids), byrow = TRUE), rep(c(1, 1, 1, 0.5), length(ids)), rep(1,...(23 bytes skipped)...
3328:             l <- layout(matrix(seq(1, 4), nrow = 1, byrow = TRUE), rep(c(1, 1, 1, ifelse(linear.fit, 1, 0.5)), 1), rep(1, 4), FALS...(2 bytes skipped)...
3344:         # make a joint model matrix
3360: # gets an array summary of gam model structure (assumes a flat ifm list)
3386:             df <- get.exp.logposterior.matrix(group.ifm[[nam]], dat[, nam], marginals, n.cores = inner.cores, grid.weight = prior$grid.weight)
3403: # calculate joint posterior matrix for a given group of experiments
3420: # lmatll - list of posterior matrix lists (as obtained from calculate.posterior.matrices)
3467: # calculate a joint posterior matrix with bootstrap
3589:     #matrix(cbind(ifelse(rdf$count<= zero.count.threshold, 0.95, 0.05), ifelse(rdf$count > zero.count.threshold...(15 bytes skipped)...
3604:         l <- layout(matrix(c(1:4), 1, 4, byrow = TRUE), c(1, 1, 1, 0.5), rep(1, 4), FALSE)
3654:     fdf <- data.frame(y = rowMeans(matrix(log10(rdf$fpm[1:(n.zero.windows*bw)]+1), ncol = bw, byrow = TRUE)), zf = rowMeans(matrix(as.integer(rdf$cluster[1:(n.zero.windows*bw)] == 1), ncol = bw, byrow = TRUE)))
3663:         cm0 <- exp(model.matrix(mt, data = mf) %*% m1@concomitant@coef)
3716: # df: count matrix
3717: # xr: expression level for each row in the matrix
3740: # counts - observed count matrix corresponding to the models
3780:     cm0 <- exp(model.matrix(mt, data = mf) %*% m1@concomitant@coef)
3797:     cm0 <- model.matrix(mt, data = mf) %*% m1@concomitant@coef
3805: # returns a matrix of posterior values, with rows corresponding to genes, and
3812:     #message(paste("get.exp.posterior.matrix() :", round((1-length(uc)/length(counts))*100, 3), "% savings"))
3828:     #message(paste("get.exp.logposterior.matrix() :", round((1-length(uc)/length(counts))*100, 3), "% savings"))
3841: # similar to get.exp.posterior.matrix(), but returns inverse ecdf list
3848: # similar to get.exp.posterior.matrix(), but returns inverse ecdf list
3871:     cm0 <- exp(model.matrix(mt, data = mf) %*% m1@concomitant@coef)
4138:         m <- matrix(sapply(components, function(x) x@logLik(model@x, model@y)), nrow = nrow(model@y))
4141:         m <- matrix(do.call(cbind, lapply(seq_along(components), function(i) {
4175:         m <- matrix(sapply(components, function(x) x@logLik(model@x, model@y)), nrow = nrow(model@y))
4178:         m <- matrix(do.call(cbind, lapply(seq_along(components), function(i) {
4223:         m <- matrix(sapply(components, function(x) x@logLik(model@x, model@y)), nrow = nrow(model@y))
4226:         m <- matrix(do.call(cbind, lapply(seq_along(components), function(i) {
4488:     x <- as.matrix(x)
4490:     ynames <- if (is.matrix(y))
4611:                 stop(gettextf("X matrix has rank %d, but only %d observations",
4711:         fit$qr <- as.matrix(fit$qr)
4718:         Rmat <- as.matrix(Rmat)
4856:     if (!is.matrix(x)) {
5008: # weight matrix should have the same dimensions as the data matrix
5154:         stop("'x' must be a numeric matrix")
5259:         if(is.matrix(ColSideColors)) {
5261:                 stop("'ColSideColors' matrix must have the same number of columns as length ncol(x)")
5306:         if(is.matrix(ColSideColors)) {
5307:             image(t(matrix(1:length(ColSideColors), byrow = TRUE, nrow = nrow(ColSideColors), ncol = ncol(ColSideColors))), co...(70 bytes skipped)...
5572:         mat <- winsorize.matrix(mat, trim = trim)
5583:     dd <- as.dist(1-abs(cor(t(as.matrix(d)))))
5599:         vd <- as.dist(1-cor(as.matrix(d)))
5669: ##' @param colcols optional column color matrix
5678: ##' @param box whether to draw a box around the plotted matrix
5680: ##' @param return.details whether the function should return the matrix as well as full PCA info instead of just PC1 vector
5726:         mat <- winsorize.matrix(mat, trim = trim)
5766:             mat <- winsorize.matrix(mat, trim = trim)
5791:     dd <- as.dist(1-abs(cor(t(as.matrix(d)))))
5807:         vd <- as.dist(1-cor(as.matrix(d)))
5973: ##' @field mat Matrix of posterior mode count estimates
5974: ##' @field matw Matrix of weights associated with each estimate in \code{mat}
6016:             matrix <- list(data = as.numeric(t(matrix)),
6017:                            dim = dim(matrix),
6018:                            rows = rownames(matrix),
6019:                            cols = colnames(matrix),
6024:             ol <- list(matrix = matrix)
6026:                 rcmvar <- matrix(gcl$rotation[rev(gcl$row.order), , drop = FALSE], ncol = 1)
6033:                 colcols <- matrix(gcl$oc[results$hvc$order], nrow = 1)
6084:                        matrix <- list(data = as.numeric(t(matrix)),
6085:                                       dim = dim(matrix),
6086:                                       rows = rownames(matrix),
6087:                                       cols = colnames(matrix),
6090:                                       range = range(matrix)
6095:                        rcmvar <- matrix(apply(results$rcm[rev(results$tvc$order), , drop = FALSE], 1, var), ncol = 1)
6105:                        ol <- list(matrix = matrix, rowcols = rowcols, colcols = colcols, coldend = treeg, trim = trim)
6159:                        patc <- .Call("matCorr", as.matrix(t(mat)), as.matrix(pat, ncol = 1) , PACKAGE = "scde")
6325:                        body <- paste(capture.output(write.table(round(matrix, 1), sep = "\t")), collapse = "\n")
1081:     wm <- .Call("winsorizeMatrix", mat, trim, PACKAGE = "scde")
1755:         ##   # construct mat multiplier submatrix
3723:         x <- FLXgetModelmatrix(m1@model[[1]], edf, m1@model[[1]]@formula)
3724:         #cx <- FLXgetModelmatrix(m1@concomitant, edf, m1@concomitant@formula)
TRONCO:R/as.functions.R: [ ]
900:     matrix = NULL
1013:     as.adj.matrix(x,
1289:     as.adj.matrix(x,
646: as.adj.matrix <- function(x,
916:     matrix.to.df <- function(m) {    
1035:     matrix.to.df <- function(z) {   
1213:     matrix.to.df <- function(z) {   
1217:         prederr.matrix = x$kfold[[z]]$prederr
1297:     matrix.to.df <- function(z) {  
1303:         posterr.matrix = get(z, x$kfold)$posterr
1967:     adj.matrix = get(model, as.adj.matrix(x, models = model))
21: #' @return A TRONCO genotypes matrix.
87: #' @return A matrix with 2 columns (event type, gene name) for the events found.
121: #' @return A matrix with 1 column annotating stages and rownames as sample IDs.
143: #' @return A matrix with 1 column annotating stages and rownames as sample IDs.
180: #' @return A matrix, subset of \code{as.genotypes(x)} with colnames substituted  with events' types.
627: #' Extract the adjacency matrix of a TRONCO model. The matrix is indexed with colnames/rownames which 
629: #' specify a subset of events to build the matrix, a subset of models if multiple reconstruction have
630: #' been performed. Also, either the prima facie matrix or the post-regularization matrix can be extracted.
634: #' as.adj.matrix(test_model)
635: #' as.adj.matrix(test_model, events=as.events(test_model)[5:15,])
636: #' as.adj.matrix(test_model, events=as.events(test_model)[5:15,], type='pf')
638: #' @title as.adj.matrix
642: #' @param type Either the prima facie ('pf') or the post-regularization ('fit') matrix, 'fit' by default.
643: #' @return The adjacency matrix of a TRONCO model. 
644: #' @export as.adj.matrix
667:             mat = m[[i]]$adj.matrix$adj.matrix.fit
669:             mat = m[[i]]$adj.matrix$adj.matrix.pf
683: #' Extract the marginal probabilities from a TRONCO model. The return matrix is indexed with rownames which 
685: #' specify a subset of events to build the matrix, a subset of models if multiple reconstruction have
709:         stop('Events should have colnames to access the adjacency matrix - use \'as.events\' function?')
734: #' Extract the joint probabilities from a TRONCO model. The return matrix is indexed with rownames/colnames which 
736: #' specify a subset of events to build the matrix, a subset of models if multiple reconstruction have
761:         stop('Events should have colnames to access the adjacency matrix - use \'as.events\' function?')
787: #' Extract the conditional probabilities from a TRONCO model. The return matrix is indexed with rownames which 
789: #' specify a subset of events to build the matrix, a subset of models if multiple reconstruction have
814:         stop('Events should have colnames to access the adjacency matrix - use \'as.events\' function?')
903:         matrix$pf = x$adj.matrix.prima.facie   
905:         matrix =
906:             as.adj.matrix(x,
911:     matrix = lapply(matrix, keysToNames, x = x)
981:     return(lapply(matrix, matrix.to.df))
1012:     matrix = 
1019:     matrix = lapply(matrix, keysToNames, x = x)
1036:         m = matrix[[z]]
1117:     res = lapply(seq_along(matrix), matrix.to.df)
1118:     names(res) = names(matrix)
1219:             names(prederr.matrix) = lapply(names(prederr.matrix), function(k) { nameToKey(x, k) })
1220:             return(prederr.matrix)
1225:         df$prederr = t(as.data.frame(prederr.matrix)) # values
1248:     res = lapply(seq_along(models), matrix.to.df)
1288:     matrix = 
1295:     matrix = lapply(matrix, keysToNames, x = x)
1302:         m = matrix[[z]]
1306:             rownames(posterr.matrix) = lapply(rownames(posterr.matrix), function(k) { nameToKey(x, k) })
1307:             colnames(posterr.matrix) = lapply(colnames(posterr.matrix), function(k) { nameToKey(x, k) })
1308:             return(posterr.matrix)
1312:         posterr.matrix = keysToNames(posterr.matrix, x = x)
1333:                     val = posterr.matrix[[select,selected]]
1369:     res = lapply(models, matrix.to.df)
1370:     names(res) = names(matrix)
1802: #' Convert colnames/rownames of a matrix into intelligible event names, e.g., change a key G23 in 'Mutation KRAS'.
1807: #' adj_matrix = as.adj.matrix(test_model, events=as.events(test_model)[5:15,])$capri_bic
1808: #' keysToNames(test_model, adj_matrix)
1813: #' @param matrix A matrix with colnames/rownames which represent genotypes keys. 
1814: #' @return The matrix with intelligible colnames/rownames. 
1817: keysToNames <- function(x, matrix) {
1819:     if (!is.matrix(matrix)
1820:         || any(is.null(colnames(matrix)))
1821:         || any(is.null(rownames(matrix))))
1822:         stop('"matrix" should be a matrix with rownames/colnames.')
1830:     colnames(matrix) = sapply(colnames(matrix), resolve)
1831:     rownames(matrix) = sapply(rownames(matrix), resolve)
1832:     return(matrix)
1840: #' adj_matrix = as.adj.matrix(test_model, events=as.events(test_model)[5:15,])$bic
1908:     data = array("missing", c(nrow(dataset), ncol(dataset)))
1961:     genotypes = as.matrix(genotypes)
1968:     adj.matrix = keysToNames(x, adj.matrix)
1975:     for (from in rownames(adj.matrix)) {
1976:         for (to in colnames(adj.matrix)) {
1977:             if (adj.matrix[from, to] == 1) {
wateRmelon:R/adjustedFunnorm.R: [ ]
199:     array <- annotation(rgSet)[["array"]]
236:     array <- extractedData$array
151:         n_matrix <- .normalizeMatrix(mat_auto, newQuantiles)
161:     model.matrix <- .buildControlMatrix450k(extractedData)
352:     model.matrix <- cbind(
447: .normalizeMatrix <- function(intMatrix, newQuantiles) {
450:     normMatrix <- sapply(1:ncol(intMatrix), function(i) {
228: .buildControlMatrix450k <- function(extractedData) {
424:         controlMatrix1 <- controlMatrix[sex == levels[1], ]
431:         controlMatrix2 <- controlMatrix[sex == levels[2], ]
480: .isMatrixBackedOrStop <- function(object, FUN) {
488: .isMatrixBacked <- function(object) {
1: ...(2 bytes skipped)...# ORIGINAL AUTHOR: Jean-Philippe Fortin, Sept 24 2013 (Functional normalization of 450k methylation array data improves replication in large cancer studies, Genome Biology, 2014)
5: ## Functional normalization of the 450k array
38: #' Functional normalization of 450k methylation array data improves replication 
117:     #normalizeQuantiles <- function(matrix, indices, sex = NULL) {
118:     #    matrix <- matrix[indices,,drop=FALSE]
119:     #    ## uses probs, model.matrix, nPCS, through scoping)
120:     #    oldQuantiles <- t(colQuantiles(matrix, probs = probs))
122:     #        newQuantiles <- .returnFit(controlMatrix = model.matrix, quantiles = oldQuantiles, nPCs = nPCs)
124:     #        newQuantiles <- .returnFitBySex(controlMatrix = model.matrix, quantiles = oldQuantiles, nPCs = nPCs, sex = sex)
126:     #    .normalizeMatrix(matrix, newQuantiles)
148:         ## uses probs, model.matrix, nPCS, through scoping)
150:         newQuantiles <- .returnFit(controlMatrix = model.matrix, quantiles = oldQuantiles, nPCs = nPCs)
152:         for(j in 1:ncol(n_matrix)){
153:             mat_sex[, j] <- interpolatedXY(mat_auto[, j], n_matrix[, j], mat_sex[, j])
156:         mat[(indices & !sex_probe), ] <- n_matrix
223:         array = array))
227: ## Extraction of the Control matrix
249:     if (array=="IlluminaHumanMethylation450k"){
255:     if (array=="IlluminaHumanMethylation450k"){
361:     for (colindex in 1:ncol(model.matrix)) {
362:         if(any(is.na(model.matrix[,colindex]))) {
363:             column <- model.matrix[,colindex]
365:             model.matrix[ , colindex] <- column
370:     model.matrix <- scale(model.matrix)
373:     model.matrix[model.matrix > 3] <- 3
374:     model.matrix[model.matrix < (-3)] <- -3
377:     model.matrix <- scale(model.matrix)
379:     return(model.matrix)
385:     stopifnot(is.matrix(quantiles))
386:     stopifnot(is.matrix(controlMatrix))
394:     design <- model.matrix(~controlPCs)
402:     stopifnot(is.matrix(quantiles))
403:     stopifnot(is.matrix(controlMatrix))
446: ### Normalize a matrix of intensities
448:     ## normMatrix <- matrix(NA, nrow(intMatrix), ncol(intMatrix))
465:         result <- preprocessCore::normalize.quantiles.use.target(matrix(crtColumn.reduced), target)
482:         stop("'", FUN, "()' only supports matrix-backed minfi objects.",
490:     all(vapply(assays(object), is.matrix, logical(1L)))
41: #' microarray data avoiding sex bias, Wang et al., 2021.
384: .returnFit <- function(controlMatrix, quantiles, nPCs) {
387:     stopifnot(ncol(quantiles) == nrow(controlMatrix))
393:     controlPCs <- prcomp(controlMatrix)$x[,1:nPCs,drop=FALSE]
401: .returnFitBySex <- function(controlMatrix, quantiles, nPCs, sex) {
404:     stopifnot(ncol(quantiles) == nrow(controlMatrix))
419:         newQuantiles <- .returnFit(controlMatrix = controlMatrix,
426:         newQuantiles1 <- .returnFit(controlMatrix = controlMatrix1,
433:         newQuantiles2 <- .returnFit(controlMatrix = controlMatrix2,
451:         crtColumn <- intMatrix[ , i]
468:     return(normMatrix)
50:     .isMatrixBackedOrStop(rgSet, "adjustedFunnorm")
481:     if (!.isMatrixBacked(object)) {
COMPASS:inst/shiny/www/js/d3.js: [ ]
3: for(var e in n)t.push({key:e,value:n[e]});return t},mo.merge=function(n){return Array...(5870 bytes skipped)...his)})},Ro.data=function(n,t){function e(n,e){var r,i,o,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),d=new Array...(448 bytes skipped)...parentNode,c.push(p),l.push(g),s.push(d)}var r,i,o=-1,a=this.length;if(!arguments.length){for(n=new Array...(14084 bytes skipped)... h=[];r!==i&&r!==o;)h.push(r),r=e();(!t||(h=t(h,f++)))&&a.push(h)}return a},e.format=function(t){if(Array.isArray...(1890 bytes skipped)...v?"":xa+n.substring(v+1);!o&&c&&(m=Aa(m));var M=i.length+m.length+y.length+(p?0:t.length),x=a>M?new Array(M=a-M+1).join(e):"";return p&&(m=Aa(x+m)),t+=i,n=m+y,("<"===r?t+n+x:">"===r?x+t+n:"^"===r?x.substri...(9172 bytes skipped)...
2: ...(24707 bytes skipped)...erCase(),e);return t}function Pi(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array...(3999 bytes skipped)...ement,_o=window;try{Mo(bo.childNodes)[0].nodeType}catch(wo){Mo=function(n){for(var t=n.length,e=new Array...(2455 bytes skipped)...th.random()*r--,t=n[r],n[r]=n[e],n[e]=t;return n},mo.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},mo.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array...(38 bytes skipped)...urn i},mo.zip=function(){if(!(u=arguments.length))return[];for(var n=-1,e=mo.min(arguments,t),r=new Array(e);++n<e;)for(var u,i=-1,o=r[n]=new Array(u);++i<u;)o[i]=arguments[i][n];return r},mo.transpose=function(n){return mo.zip.apply(mo,n)},mo.key...(159 bytes skipped)...
4: ...(5479 bytes skipped)...a=n.map(function(){return[]}),c=pt(e),l=pt(r),s=n.length,f=1e6;if(c===Ze&&l===Ve)t=n;else for(t=new Array...(1544 bytes skipped)...,o=n.map(function(){return[]}),a=[],c=pt(e),l=pt(r),s=n.length;if(c===Ze&&l===Ve)t=n;else for(t=new Array...(184 bytes skipped)...t:n[r]}))}),a},t.triangles=function(n){if(e===Ze&&r===Ve)return mo.geom.delaunay(n);for(var t,u=new Array...(1922 bytes skipped)...of t;return("string"===e?ga.has(t)||/^(#|rgb\(|hsl\()/.test(t)?br:Sr:t instanceof Z?br:"object"===e?Array.isArray(t)?kr:_r:wr)(n,t)}],mo.interpolateArray...(380 bytes skipped)...string(0,t):n,r=t>=0?n.substring(t+1):"in";return e=xc.get(e)||Mc,r=bc.get(r)||dt,Ar(r(e.apply(null,Array...(229 bytes skipped)...if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Zr(e?e.matrix...(1063 bytes skipped)...ce.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,l={},s=0;return l.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,l):u},l.padding=function(n){return ...(20385 bytes skipped)...
1: ...(4945 bytes skipped)...M();$o=!(u.f||u.e),e.remove()}return $o?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}var i=n.getBoundingClientRect();return[t.clientX-i.l...(26868 bytes skipped)...
ELMER:R/Small.R: [ ]
1001:   matrix <- Matrix::Matrix(0, nrow = nrow(motifs), ncol = ncol(motifs) - 21 ,sparse = TRUE)
426: makeSummarizedExperimentFromGeneMatrix <- function(exp, genome = genome){
499:   arrayType <- match.arg(plat)
572: splitmatrix <- function(x,by="row") {
998: getMatrix <- function(filename) {
6: #' a matrix or path of rda file only containing the data.
8: #' a matrix or path of rda file only containing the data. Rownames should be 
13: #'  of the gene expression and DNA methylation matrix. This should be used if your matrix
16: ...(14 bytes skipped)...A methylation" and "Gene expression"), primary (sample ID) and colname (names of the columns of the matrix).
111: #'    #1) Get gene expression matrix
299:         stop("Please the gene expression matrix should receive ENSEMBLE IDs")
363:         stop("Error DNA methylation matrix and gene expression matrix are not in the same order")
381: ...(63 bytes skipped)...ary (sample ID) and colname(DNA methylation and gene expression sample [same as the colnames of the matrix])")
400:         stop("Error DNA methylation matrix and gene expression matrix are not in the same order")
452:     stop("Please the gene expression matrix should receive ENSEMBLE IDs (ENSG)")
474:   assay <- data.matrix(met)
491: #' @title Get DNA methylation array metadata from SesameData
538: #' This function will receive the DNA methylation and gene expression matrix and will create
540: #' @param met DNA methylation matrix or Summarized Experiment
541: #' @param exp Gene expression matrix or Summarized Experiment
569: # @param x A matrix 
571: # @return A list each of which is the value of each row/column in the matrix.
789: #' @param data A MultiAssayExperiment with a DNA methylation martrix or a DNA methylation matrix
994: # This will read this homer file and create a sparce matrix
1002:   colnames(matrix) <- gsub(" Distance From Peak\\(sequence,strand,conservation\\)","",colnames(motifs)[-c(1:21)])
1003:   rownames(matrix) <- motifs$PeakID
1004:   matrix[!is.na(motifs[,-c(1:21)])] <- 1
1005:   matrix <- as(matrix, "nsparseMatrix")
1006:   return(matrix)
1015: #' foreground <- Matrix::Matrix(sample(0:1,size = 100,replace = TRUE), 
1019: #' background <- Matrix::Matrix(sample(0:1,size = 100,replace = TRUE), 
1033:   a <- Matrix::colSums(foreground)
1034:   b <- nrow(foreground) - Matrix::colSums(foreground)
1035:   c <- Matrix::colSums(background)
1036:   d <- nrow(background) - Matrix::colSums(background)
1038:     x <- fisher.test(matrix(c(a[i],b[i],c[i],d[i]),nrow = 2,ncol = 2))
1045:                         NumOfRegions = Matrix::colSums(foreground, na.rm=TRUE),
1182: #' @param met.platform DNA Methylation  Array platform (EPIC, 450K)
262:     exp <- makeSummarizedExperimentFromGeneMatrix(exp, genome)
505:   message("Accessing DNAm annotation from sesame package for: ", genome, " - ",arrayType)
507:     ifelse(arrayType == "450K","HM450","EPIC"),
1011: #' @param foreground A nsparseMatrix object in each 1 means the motif is found in a region, 0 not.
1012: #' @param background A nsparseMatrix object in each 1 means the motif is found in a region, 0 not.
interacCircos:inst/htmlwidgets/lib/d3.js: [ ]
5599:     chord.matrix = function(x) {
15:     d3_array = function(list) {
8:   var d3_arraySlice = [].slice, d3_array = function(list) {
5223:   function d3_interpolateArray(a, b) {
13:     d3_array(d3_documentElement.childNodes)[0].nodeType;
16:       var i = list.length, array = new Array(i);
17:       while (i--) array[i] = list[i];
18:       return array;
41:   d3.min = function(array, f) {
42:     var i = -1, n = array.length, a, b;
44:       while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined;
45:       while (++i < n) if ((b = array[i]) != null && a > b) a = b;
47:       while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
48:       while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
52:   d3.max = function(array, f) {
53:     var i = -1, n = array.length, a, b;
55:       while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined;
56:       while (++i < n) if ((b = array[i]) != null && b > a) a = b;
58:       while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
59:       while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
63:   d3.extent = function(array, f) {
64:     var i = -1, n = array.length, a, b, c;
66:       while (++i < n && !((a = c = array[i]) != null && a <= a)) a = c = undefined;
67:       while (++i < n) if ((b = array[i]) != null) {
72:       while (++i < n && !((a = c = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
73:       while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
80:   d3.sum = function(array, f) {
81:     var s = 0, n = array.length, a, i = -1;
83:       while (++i < n) if (!isNaN(a = +array[i])) s += a;
85:       while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a;
92:   d3.mean = function(array, f) {
93:     var n = array.length, a, m = 0, i = -1, j = 0;
95:       while (++i < n) if (d3_number(a = array[i])) m += (a - m) / ++j;
97:       while (++i < n) if (d3_number(a = f.call(array, array[i], i))) m += (a - m) / ++j;
105:   d3.median = function(array, f) {
106:     if (arguments.length > 1) array = array.map(f);
107:     array = array.filter(d3_number);
108:     return array.length ? d3.quantile(array.sort(d3.ascending), .5) : undefined;
137:   d3.shuffle = function(array) {
138:     var m = array.length, t, i;
141:       t = array[m], array[m] = array[i], array[i] = t;
143:     return array;
145:   d3.permute = function(array, indexes) {
146:     var i = indexes.length, permutes = new Array(i);
147:     while (i--) permutes[i] = array[indexes[i]];
150:   d3.pairs = function(array) {
151:     var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n);
152:     while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ];
157:     for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) {
158:       for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) {
167:   d3.transpose = function(matrix) {
168:     return d3.zip.apply(d3, matrix);
189:     var n = arrays.length, m, i = -1, j = 0, merged, array;
191:     merged = new Array(j);
193:       array = arrays[n];
194:       m = array.length;
196:         merged[--j] = array[m];
290:     function map(mapType, array, depth) {
291:       if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
292:       var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;
294:         if (values = valuesByKey.get(keyValue = key(object = array[i]))) {
316:       var array = [], sortKey = sortKeys[depth++];
318:         array.push({
323:       return sortKey ? array.sort(function(a, b) {
325:       }) : array;
327:     nest.map = function(array, mapType) {
328:       return map(mapType, array, 0);
330:     nest.entries = function(array) {
331:       return entries(map(d3.map, array, 0), 0);
351:   d3.set = function(array) {
353:     if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]);
535:           subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j)));
749:       value = new Array(n = (group = this[0]).length);
758:       var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData;
891:     var args = d3_array(arguments);
986:     var group = d3_array(typeof nodes === "string" ? d3_selectAll(nodes, d3_document) : nodes);
1017:       var l = wrap(listener, d3_array(arguments));
1116:     return touches ? d3_array(touches).map(function(touch) {
1907:         return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments)));
2012:       if (Array.isArray(rows[0])) return dsv.formatRows(rows);
2189: ...(29 bytes skipped)...gth + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : "";
2681:   function d3_geo_clipPolygonLinkCircular(array) {
2682:     if (!(n = array.length)) return;
2683:     var n, i = 0, a = array[0], b;
2685:       a.n = b = array[i];
2689:     a.n = b = array[0];
4879:     d3_geom_voronoiCells = new Array(sites.length);
4912:       var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[...(6 bytes skipped)...
5220: ...(85 bytes skipped)...nterpolateRgb : d3_interpolateString : b instanceof d3_Color ? d3_interpolateRgb : t === "object" ? Array.isArray(b) ? d3_interpolateArray : d3_interpolateObject : d3_interpolateNumber)(a, b);
5377:       return new d3_transform(t ? t.matrix : d3_transformIdentity);
5527:     var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;
5536:           x += matrix[i][j];
5550:             return sortSubgroups(matrix[i][a], matrix[i][b]);
5559:           var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k;
5600:       if (!arguments.length) return matrix;
5601:       n = (matrix = x) && matrix.length;
5808:           neighbors = new Array(n);
5889:         var i = -1, n, c = node.children = new Array(n), v = 0, j = depth + 1, d;
6190:   function d3_layout_stackMaxIndex(array) {
6191:     var i = 1, j = 0, v = array[0][1], k, n = array.length;
6193:       if ((k = array[i][1]) > v) {
8856:     return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
9:     return d3_arraySlice.call(list);
188:   d3.merge = function(arrays) {
190:     while (++i < n) j += arrays[i].length;
1108:       point = point.matrixTransform(container.getScreenCTM().inverse());
5222:   d3.interpolateArray = d3_interpolateArray;
5272:     return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1))));
8373:             var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y);
qmtools:R/reduceFeatures-functions.R: [ ]
113:     res <- pcaMethods::nipalsPca(Matrix = x, nPcs = ncomp, ...)
3: ##' Performs PCA on a matrix-like object where rows represent features and
10: ##' `reduced.pca` object that is a matrix with custom attributes to summarize
19: ##' * `loadings`: A matrix of variable loadings.
26: ##' @param x A matrix-like object.
64:     if (!is.matrix(x)) {
65:         x <- as.matrix(x)
70:     xt <- t(x) # transpose matrix;
131: ##' Performs t-SNE on a matrix-like object where rows represent features and
137: ##' `reduced.tsne` object that is a matrix with custom attributes to summarize
148: ##' @param x A matrix-like object.
151: ##' @param normalize A logical specifying whether the input matrix is
153: ##'   matrix is equal to unity. See [Rtsne::normalize_input] for details.
187:     if (!is.matrix(x)) {
188:         x <- as.matrix(x)
193:     xt <- t(x) # transpose matrix;
220: ##' Performs PLS-DA on a matrix-like object where rows represent features and
226: ##' so that it can be internally converted to an indicator matrix. The function
227: ##' returns a `reduced.plsda` object that is a matrix with custom attributes to
237: ##' * `coefficient`: An array of regression coefficients.
238: ##' * `loadings`: A matrix of loadings.
239: ##' * `loadings.weights`: A matrix of loading weights.
242: ##' * `Y.scores`: A matrix of Y-scores.
243: ##' * `Y.loadings`: A matrix of Y-loadings.
244: ##' * `projection`: The projection matrix.
245: ##' * `fitted.values`: An array of fitted values.
246: ##' * `residuals`: An array of regression residuals.
253: ##' @param x A matrix-like object.
290:     if (!is.matrix(x)) {
291:         x <- as.matrix(x)
304:     y_dummy <- model.matrix(~ y - 1)
331:     class(out) <- c("reduced.plsda", "matrix", class(out))
cisPath:inst/extdata/D3/d3.v3.min.js: [ ]
1: ...(190 bytes skipped)...ype=n}}function r(t){for(var n=-1,e=t.length,r=[];e>++n;)r.push(t[n]);return r}function u(t){return Array...(9545 bytes skipped)...M();Da=!(u.f||u.e),e.remove()}return Da?(r.x=n.pageX,r.y=n.pageY):(r.x=n.clientX,r.y=n.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.l...(21976 bytes skipped)...
2: ...(13235 bytes skipped)...ngth;r>++e;)n.set(t[e].toLowerCase(),e);return n}function Qu(t,n,e){t+="";var r=t.length;return e>r?Array...(6903 bytes skipped)...ply(Ci,t)},Ci.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,n=Ci.min(arguments,s),e=Array(n);n>++t;)for(var r,u=-1,i=e[t]=Array...(1360 bytes skipped)...unction(t,n){for(var e=[],r=-1,u=n.length;u>++r;)e[r]=t[n[r]];return e},Ci.merge=function(t){return Array...(3246 bytes skipped)...cale(t),h=d.symbol}else t*=s;t=f(t,l),!a&&c&&(t=Wi(t));var m=i.length+t.length+(p?0:n.length),v=o>m?Array...(1556 bytes skipped)...ubstring(0,n):t,r=n>=0?t.substring(n+1):"in";return e=ea.get(e)||na,r=ra.get(r)||a,S(r(e.apply(null,Array...(144 bytes skipped)...=function(t){n.setAttribute("transform",t);var e=n.transform.baseVal.consolidate();return new O(e?e.matrix...(2906 bytes skipped)...-u;return i>180?i-=360:-180>i&&(i+=360),function(t){return cn(e+i*t,r+a*t,u+o*t)+""}},Ci.interpolateArray...(449 bytes skipped)...\.?\d+)(?:[eE][-+]?\d+)?/g;Ci.interpolators=[Ci.interpolateObject,function(t,n){return n instanceof Array&&Ci.interpolateArray(t,n)},function(t,n){return("string"==typeof t||"string"==typeof n)&&Ci.interpolateString(t+"",n+"")...(3833 bytes skipped)...
3: ...(4404 bytes skipped)...ld(this)})},ba.data=function(t,n){function e(t,e){var r,u,a,o=t.length,s=e.length,h=Math.min(o,s),g=Array(s),p=Array(s),d=Array...(447 bytes skipped)...e=t.parentNode,c.push(p),l.push(g),f.push(d)}var r,u,a=-1,o=this.length;if(!arguments.length){for(t=Array...(24551 bytes skipped)...ce.value+t.target.value)/2,(n.source.value+n.target.value)/2)})}var e,r,u,i,a,o,c,l={},f=0;return l.matrix=function(t){return arguments.length?(i=(u=t)&&u.length,e=r=null,l):u},l.padding=function(t){return ...(2235 bytes skipped)...
maanova:R/makeModel.R: [ ]
126:         array <- rep(1:narrays, each=ndyes*nreps)
30:   narrays <- data$n.array
96:   X <- matrix(rep(1, ndyes*narrays*nreps),ncol=1)
103:     tmp <- matrix(0, nreps, ndyes*narrays)
127:         spot <- nreps*(array-1)+replicate
147:           termX[[i]] <- matrix(tmp, ncol=1)
163:       ########## finish making design matrix for this term
179:     nesting <- matrix(0, nlabels, nlabels)
213:       X.drop <- matrix(rep(1, ndyes*narrays*nreps),ncol=1)
216:         tmp <- matrix(0, nreps, ndyes*narrays)
15: # This is the function to make model object for microarray experiment
44:     if(length(design[[i]]) != narrays*ndyes)
125:         replicate <- rep(1:nreps, ndyes*narrays)
133:         label <- rep(1:(ndyes*narrays), each=nreps)
134:         for(j in 1:(ndyes*narrays))
NetSAM:R/mapToSymbol.R: [ ]
98:                     matrix <- mapresult$data_symbol
15:     if(length(which(inputType %in% c("genelist","network","sbt","sct","matrix")))==0){
16: ...(20 bytes skipped)...put 'inputType' is invalide! Please select an option from 'genelist', 'netwrok', 'sbt', 'sct', and 'matrix'!\n")
78:     if(inputType=="matrix"){
81:             outputFileName <- "matrix_symbol.cct"
88:                 stop("The ids in the input matrix can not be transformed to gene symbols! Please check whether the inut idType is correct!\n")
93:                     stop(paste("Only ",round(mapresult*100),"% ids in the input matrix can be transformed to gene symbols. Please check whether the inut idType is correct!\n",sep=""))
99:                     matrix <- cbind(rownames(matrix),matrix)
100:                     colnames(matrix)[1] <- "GeneSymbol"
101:                     write.table(matrix,file=outputFileName,row.names=F,col.names=T,sep="\t",quote=F)
298:         cat("\nSearching the array type...\n")
430:         if(.getClass(inputNetwork)=="data.frame" || .getClass(inputNetwork)=="matrix"){
439:                         inputNetwork <- as.matrix(inputNetwork[,c(1,2)])
441:                         inputNetwork_S <- array(inputNetwork_S,dim=dim(inputNetwork))
450:                     inputNetwork <- as.matrix(inputNetwork)
452:                     inputNetwork_S <- array(inputNetwork_S,dim=dim(inputNetwork))
490: ...(0 bytes skipped)...                    stop("The input network should be from a file or a data object with data.frame, matrix, graphNEL or igraph class. Other types of input are invalid!\n")
650:     inputMat <- as.matrix(inputMat[,2:ncol(inputMat)])
667:             inputMat <- as.matrix(inputMat[idmap[,1],])
pcaMethods:R/pca.R: [ ]
122:     Matrix <- as.matrix(object[,num])
25: ##' Perform PCA on a numeric matrix for visualisation, information
53: ##' @param object Numerical matrix with (or an object coercible to
56: ##' matrix is used. Can also be a data frame in which case all
125:     Matrix <- t(exprs(object))
127:   Matrix <- as.matrix(object, rownames.force=TRUE)
130:     Matrix <- Matrix[,subset]
135:   if (nPcs > ncol(Matrix)) {
136:     warning("more components than matrix columns requested")
137:     nPcs <- min(dim(Matrix))
139:   if (nPcs > nrow(Matrix)) {
140:     warning("more components than matrix rows requested")
141:     nPcs <- min(dim(Matrix))
144:   if (!checkData(Matrix, verbose=interactive()))
148:   missing <- is.na(Matrix)
162:   prepres <- prep(Matrix, scale=scale, center=center, simple=FALSE, ...)
196:   rownames(res@scores) <- rownames(Matrix)
197:   if(all(dim(loadings(res)) == c(ncol(Matrix), nPcs))) {
199:     rownames(res@loadings) <- colnames(Matrix)
205:   res@nObs <- nrow(Matrix)
206:   res@nVar <- ncol(Matrix)
217:     cObs <- Matrix
219:       cObs[missing] <- fitted(res, Matrix, pre=TRUE, post=TRUE)[missing]
225:     res@cvstat <- Q2(res, Matrix, nruncv=1, ...)
236: ##' @param object Numerical matrix with (or an object coercible to
239: ##' matrix is used.
240: ##' @param method For convenience one can pass a large matrix but only
264:   if ( !checkData(as.matrix(object), verbose=interactive()) )
344: ##' @param Matrix Pre-processed (centered and possibly scaled)
345: ##' numerical matrix samples in rows and variables as columns. No
350: ##' @param verbose Verbose complaints to matrix structure
364: svdPca <- function(Matrix, nPcs=2, 
367:   pcs <- prcomp(Matrix, center=FALSE, scale.=FALSE)
396: ##' @return A matrix with X and Y coordinates for the circle
87: ##' Missing value estimation methods for DNA microarrays.
Rbwa:src/bwtsw2_core.c: [ ]
50: 	bsw2cell_t *array;
205: static inline bsw2cell_t *push_array_p(bsw2entry_t *e)
90: 		free(kv_A(mp->pool, i)->array);
140: 		aux->array = (bsw2cell_t*)realloc(aux->array, aux->max * sizeof(bsw2cell_t));
142: 	a = (int*)aux->array;
144: 		if (u->array[i].ql && u->array[i].G > 0)
145: 			a[n++] = -u->array[i].G;
150: 		bsw2cell_t *p = u->array + i;
154: 			if (p->ppos >= 0) u->array[p->ppos].cpos[p->pj] = -1;
166: 		bsw2cell_t *p = u->array + i;
179: 			p = u->array + j;
181: 			if (p->ppos >= 0) u->array[p->ppos].cpos[p->pj] = -3;
191: 		u->array = (bsw2cell_t*)realloc(u->array, u->max * sizeof(bsw2cell_t));
194: 		bsw2cell_t *p = v->array + i;
201: 	memcpy(u->array + u->n, v->array, v->n * sizeof(bsw2cell_t));
209: 		e->array = (bsw2cell_t*)realloc(e->array, sizeof(bsw2cell_t) * e->max);
211: 	return e->array + e->n;
228: 		bsw2cell_t *p = u->array + i;
253: 		bsw2cell_t *p = u->array + i;
267: 			if (p->ppos >= 0) u->array[p->ppos].cpos[p->pj] = -3;
442: 	x = push_array_p(u);
460: 	// calculate score matrix
489: 			bsw2cell_t *p = v->array + i;
493: 				if (p->ppos >= 0) v->array[p->ppos].cpos[p->pj] = -5;
517: 				bsw2cell_t *p = v->array + i, *x, *c[4]; // c[0]=>current, c[1]=>I, c[2]=>D, c[3]=>G
520: 				c[0] = x = push_array_p(u);
524: 					c[1] = (v->array[p->ppos].upos >= 0)? u->array + v->array[p->ppos].upos : 0;
525: 					c[3] = v->array + p->ppos; c[2] = p;
527: 						x->ppos = v->array[p->ppos].upos; // the parent pos in u
529: 						if (x->ppos >= 0) u->array[x->ppos].cpos[p->pj] = p->upos; // the child pos of its parent in u
541: 				if (is_added) { // x has been added to u->array. fill the remaining variables
557: 							x = push_array_p(v);
558: 							p = v->array + i; // p may not point to the correct position after realloc
568: 			{ // push u to the stack (or to the pending array)
572: 				if (pos) { // something in the pending array, then merge
QUBIC:src/matrix.h: [ ]
7: template<typename T> class Matrix {
12:   Matrix(std::size_t reserved_count) {
2: #define MATRIX_H
1: #ifndef MATRIX_H
stJoincount:tests/testthat/test-zscoreMatrix.R: [ ]
22:   matrix <- zscoreMatrix(humanBC, joincount.result)
15: test_that("z-score matrix", {
23:   expect_type(matrix, "list")
epivizrServer:tests/testthat/test-indexed_array.R: [ ]
4:   array <- IndexedArray$new()
5:   expect_is(array, "IndexedArray")
6:   expect_equal(array$length(), 0)
10:   array <- IndexedArray$new()
11:   id1 <- array$append(1)
14:   id2 <- array$append(2)
16:   expect_equal(array$length(), 2)
18:   res2 <- array$get(2L)
19:   expect_equal(array$length(), 1)
22:   res1 <- array$get(1L)
23:   expect_equal(array$length(), 0)
28:   array <- IndexedArray$new()
29:   array$append(1)
30:   array$append(2)
31:   array$empty()
33:   expect_equal(array$length(), 0)
34:   id1 <- array$append(1)
1: context("IndexedArray")
LymphoSeq:R/differentialAbundance.R: [ ]
66:         matrix <- matrix(c(in.x, in.y, not.x, not.y), nrow = 2)
67:         fisher <- stats::fisher.test(matrix, workspace = 2e6)
epihet:R/epiNetwork.R: [ ]
180:         h <- WGCNA::labeledHeatmap(Matrix = moduleTraitCor,
51:     group.matrix <- compare.matrix[, group.samples]
53:     value.matrix <- group.matrix[DEH.loci, ]
58:     hit.matrix <- as.matrix(o)
60:         input.matrix = value.matrix
68:             mean.matrix <- foreach(i = geneid, .combine = cbind) %do%
173:         textMatrix <- paste(signif(moduleTraitCor, 2),
11: #' @param compare.matrix The comparison matrix generated from
17: #' for the samples in the comparison matrix. The row names should
35: #' heterogeneity matrix for patients
38: #' if node type is gene,it contains the epigenetic heterogeneity matrix for
41: epiNetwork <- function(node.type = "locus", DEH, compare.matrix,
49:     compare.matrix <- compare.matrix[which(compare.matrix$type == value), ]
50:     rownames(compare.matrix) <- compare.matrix$location
54:     value.matrix <- t(value.matrix)
61:         nSamples = nrow(value.matrix)
71:                   queryhit.id <- hit.matrix[which(hit.matrix[, 2] == i), 1]
73:                   epivalue <- value.matrix[, queryhit.loci$loci]
82:             mean.matrix <- mean.matrix[, colSums(mean.matrix) != 0]
83:             nSamples <- dim(mean.matrix)[1]
84:             input.matrix <- mean.matrix
90:     sft <- WGCNA::pickSoftThreshold(input.matrix, powerVector = powers,
131:     net <- WGCNA::blockwiseModules(input.matrix, power = softpowers,
157:         module <- data.frame(gene = colnames(input.matrix),
161:     MEs0 <- WGCNA::moduleEigengenes(input.matrix, moduleColors)$eigengenes
194:         geneset <- data.frame(DEHloci = mcols(userset[hit.matrix[,1]])$loci,
195:             gene = mcols(annotation.obj[hit.matrix[,2]])$name,
262:         result <- list(epimatrix = input.matrix, module = module,
265:         result <- list(epimatrix = input.matrix, module = module)
12: #' the compMatrix() function.
175:         dim(textMatrix) <- dim(moduleTraitCor)
183:             colors = WGCNA::blueWhiteRed(50), textMatrix = textMatrix,
pcxn:R/pcxn_analyze.R: [ ]
84:                 matrix <- pathCor_pathprint_v1.2.3_dframe
89:                 matrix <- pathCor_pathprint_v1.2.3_unadjusted_dframe 
98:                 matrix <- pathCor_Hv5.1_dframe
102:                 matrix <- pathCor_Hv5.1_unadjusted_dframe 
111:                 matrix <- pathCor_CPv5.1_dframe
115:                 matrix <- pathCor_CPv5.1_unadjusted_dframe 
123:                 matrix <- pathCor_GOBPv5.1_dframe
127:                 matrix <- pathCor_GOBPv5.1_unadjusted_dframe 
173:         step1_matrix <-
174:             subset(matrix, abs(PathCor) >= min_abs_corr & p.value <= max_pval)
178:             temp_cor <- subset(step1_matrix,(Pathway.A == unused_genesets[i]
199:         # create matrix with geneset groups
210:         step2_matrix <-
211:             subset(step1_matrix, Pathway.A %in% interesting_genesets &
217:                         top, " top correlated genesets, ", dim(step2_matrix)[1],
224:                         top, " top correlated genesets, ", dim(step2_matrix)[1],
227:         po = new("pcxn",type = "pcxn_analyze", data = as.matrix(step2_matrix),
chromPlot:R/chromplot-Internal.R: [ ]
898:     matrix <- t(sapply(data, unlist)) #list to matrix
325:                     plot.lodclust(as.matrix(track[,c("Start", "End")]),
396:     intervals <- as.matrix(intervals)
445:     intmat  <- matrix(intmat, ncol=2)
517:     if(is.data.frame(x) | is.matrix(x)) {
899:     aux    <-matrix[, c(2:5)]
BioNERO:R/gcn_inference.R: [ ]
450:         Matrix = modtraitcor, yLabels = yLabels, xLabels = xLabels,
1039:                 matrix <- list_mat[[x]]
150:     cor_matrix <- calculate_cor_adj(cor_method, norm.exp, SFTpower, net_type)$cor
151:     adj_matrix <- calculate_cor_adj(cor_method, norm.exp, SFTpower, net_type)$adj
1005:     cor_matrix <- net$correlation_matrix
428:     textMatrix <- paste(signif(modtraitcor, 2), modtraitsymbol, sep = "")
112: #'   \item Adjacency matrix
116: #'   \item Correlation matrix
149:     if(verbose) { message("Calculating adjacency matrix...") }
153:     #Convert to matrix
154:     gene_ids <- rownames(adj_matrix)
155:     adj_matrix <- matrix(adj_matrix, nrow=nrow(adj_matrix))
156:     rownames(adj_matrix) <- gene_ids
157:     colnames(adj_matrix) <- gene_ids
159:     #Calculate TOM from adjacency matrix
160:     if(verbose) { message("Calculating topological overlap matrix (TOM)...") }
162:     TOM <- WGCNA::TOMsimilarity(adj_matrix, TOMType = tomtype)
228:     kwithin <- WGCNA::intramodularConnectivity(adj_matrix, new.module_colors)
231:         adjacency_matrix = adj_matrix,
235:         correlation_matrix = cor_matrix,
320:     expr <- as.matrix(t(norm.exp))
337:     # Define a matrix of labels for the original and all resampling runs
338:     labels <- matrix(0, nGenes, nRuns + 1)
381: #' @param cex.text Font size for numbers inside matrix. Default: 0.6.
416:     modtraitcor <- cor(as.matrix(MEs), trait, use = "p", method = cor_method)
482: #'   \item{filtered_corandp}{Filtered matrix of correlation and p-values}
483: #'   \item{raw_GS}{Raw matrix of gene significances}
512:     GS <- cor(as.matrix(t(final_exp)), trait, use = "p")
534:         as.matrix(GS), border_color = NA, color = cols,
641:         fmat <- matrix(
914:     edges <- net$correlation_matrix
937: #' Get edge list from an adjacency matrix for a group of genes
959: #' the correlation matrix was calculated. Only required
968: #' edge lists by filtering the original correlation matrix by the thresholds
1004:     # Define objects containing correlation matrix and data frame of genes and modules
1011:         cor_matrix <- cor_matrix[keep, keep]
1016:         cor_matrix <- cor_matrix[genes, genes]
1019:     # Should we filter the matrix?
1021:         # Create edge list from correlation matrix
1022:         edges <- cormat_to_edgelist(cor_matrix)
1035:             list_mat <- replicate(length(cutoff), cor_matrix, simplify = FALSE)
1040:                 matrix[matrix < cutoff[x] ] <- NA
1041:                 diag(matrix) <- 0
1044:                 degree <- rowSums(matrix, na.rm=TRUE)
1047:                 matrix[lower.tri(matrix, diag=TRUE)] <- NA
1049:                 # Convert symmetrical matrix to edge list (Gene1, Gene2, Weight)
1050:                 matrix <- na.omit(data.frame(as.table(matrix)))
1051:                 result <- list(matrix = matrix, degree = degree)
1080:                 stop("Please, specify the number of samples used to calculate the correlation matrix")
1101:         # Create edge list from correlation matrix without filtering
1102:         edgelist <- cormat_to_edgelist(cor_matrix)
429:     dim(textMatrix) <- dim(modtraitcor)
433:         textMatrix <- t(textMatrix)
452:         colors = cols, textMatrix = textMatrix, setStdMargins = FALSE,
HiCBricks:R/Brick_functions.R: [ ]
2168:     Matrix <- Brick_get_matrix(Brick = Brick, chr1 = chr1, chr2 = chr2,
2255:     Matrix <- Brick_get_vector_values(Brick = Brick, chr1=chr1, chr2=chr2,
554:     Matrix_info <- return_configuration_matrix_info(Brick)
776:     Matrix.list.df <- do.call(rbind,chr1.list)
1322: Brick_load_matrix = function(Brick = NA, chr1 = NA, chr2 = NA, resolution = NA,
1613:     Matrix.list <- Brick_list_matrices(Brick = Brick, chr1 = chr1, 
1657:     Matrix.list <- Brick_list_matrices(Brick = Brick, chr1 = chr1, chr2 = chr2,
1713:     Matrix.list <- Brick_list_matrices(Brick = Brick, chr1 = chr1, chr2 = chr2,
1803:     Matrix.list <- Brick_list_matrices(Brick = Brick, chr1 = chr1, chr2 = chr2,
1898:     Matrix.list <- Brick_list_matrices(Brick = Brick, chr1 = chr1, chr2 = chr2,
2228: Brick_get_matrix = function(Brick, chr1, chr2, x_coords,
2574: Brick_get_entire_matrix = function(Brick, chr1, chr2, resolution){
2592:     entire_matrix <- dataset_handle[]
2848:     a_matrix <- .remove_nas(Brick_get_entire_matrix(Brick = Brick, 
2850:     normalised_matrix <- .normalize_by_distance_values(a_matrix)
2851:     correlation_matrix <- cor(normalised_matrix)
206:     Configuration_matrix_list <- list()
1419: Brick_load_cis_matrix_till_distance = function(Brick = NA, chr = NA, 
1607: Brick_matrix_isdone = function(Brick, chr1, chr2, resolution = NA){
1651: Brick_matrix_issparse = function(Brick, chr1, chr2, resolution = NA){
1703: Brick_matrix_maxdist = function(Brick, chr1, chr2, resolution = NA){
1758: Brick_matrix_exists = function(Brick, chr1, chr2, resolution = NA){
1797: Brick_matrix_minmax = function(Brick, chr1, chr2, resolution = NA){
1843: Brick_matrix_dimensions = function(Brick, chr1, chr2, resolution = NA){
1892: Brick_matrix_filename = function(Brick, chr1, chr2, resolution = NA){
2124: Brick_get_matrix_within_coords = function(Brick, x_coords,
2647: Brick_get_matrix_mcols = function(Brick, chr1, chr2, resolution, 
2706: Brick_list_matrix_mcols = function(){
8: #' table associated to the Hi-C experiment, creates a 2D matrix
21: #' contains 250 entries in the binning table, the _cis_ Hi-C data matrix for
24: #' matrices for chr1,chr2 will be a matrix with dimension 250 rows and
60: #' set to matrix dimensions/100.
95: #'                \item Min - min value of Hi-C matrix
96: #'                \item Max - max value of Hi-C matrix
97: #'                \item sparsity - specifies if this is a sparse matrix
99: #'                \item Done - specifies if a matrix has been loaded
101: #'            \item matrix - \strong{dataset} - contains the matrix
235:         Configuration_matrix_list <- return_configuration_matrix_info(
267:             Configuration_matrix_list[[paste(chrom1, chrom2, 
281:         Configuration_matrix_list, 
527: #' for that chromosome in a Hi-C matrix.
555:     current_resolution <- vapply(Matrix_info, function(a_list){
561:     chrom1_binned_length <- vapply(Matrix_info[current_resolution], 
565:     chrom1s <- vapply(Matrix_info[current_resolution], 
569:     chrom1_max_sizes <- vapply(Matrix_info[current_resolution], 
720: #' List the matrix pairs present in the Brick store.
727: #' @inheritParams Brick_load_matrix
733: #' minimum and maximum values in the matrix, done is a logical value
734: #' specifying if a matrix has been loaded and sparsity specifies if a matrix
735: #' is defined as a sparse matrix.
777:     rownames(Matrix.list.df) <- NULL
778:     return(Matrix.list.df)
1263: #' Load a NxM dimensional matrix into the Brick store.
1269: #' the rows of the matrix
1273: #' the columns of the matrix
1275: #' @param matrix_file \strong{Required}.
1277: #' matrix into the Brick store.
1280: #' The delimiter of the matrix file.
1283: #' If a matrix was loaded before, it will not be replaced. Use remove_prior to
1284: #' override and replace the existing matrix.
1290: #' If true, designates the matrix as being a sparse matrix, and computes the
1306: #' out_dir <- file.path(tempdir(), "matrix_load_test")
1314: #' Matrix_file <- system.file(file.path("extdata", 
1318: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
1319: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1323:     matrix_file = NA, delim = " ", remove_prior = FALSE, num_rows = 2000, 
1328:         resolution = resolution, matrix_file = matrix_file, 
1348:     if(!Brick_matrix_exists(Brick = Brick, chr1 = chr1, chr2 = chr2,
1352:     if(Brick_matrix_isdone(Brick = Brick, chr1 = chr1,
1354:         stop("A matrix was preloaded before. ",
1367:         Matrix.file = matrix_file, delim = delim, Group.path = Group.path, 
1375: #' Load a NxN dimensional sub-distance \emph{cis} matrix into
1380: #' @inheritParams Brick_load_matrix
1384: #' the rows and cols of the matrix
1388: #' it does not make sense to load the entire matrix into the data structure, as
1389: #' after a certain distance, the matrix will become extremely sparse. This
1403: #' out_dir <- file.path(tempdir(), "matrix_load_dist_test")
1411: #' Matrix_file <- system.file(file.path("extdata", 
1415: #' Brick_load_cis_matrix_till_distance(Brick = My_BrickContainer, 
1416: #' chr = "chr2L", resolution = 100000, matrix_file = Matrix_file, 
1420:     resolution = NA, matrix_file, delim = " ", distance, remove_prior = FALSE,
1425:         matrix_file = matrix_file, delim = delim, distance = distance, 
1443:     if(!Brick_matrix_exists(Brick = Brick, chr1 = chr,
1447:     if(Brick_matrix_isdone(Brick = Brick, chr1 = chr,
1449:         stop("A matrix was preloaded before. Use remove_prior = TRUE to ",
1461:     RetVar <- ._Process_matrix_by_distance(Brick = Brick_filepath,
1462:         Matrix.file = matrix_file, delim = delim, Group.path = Group.path,
1470: #' Load a NxN dimensional matrix into the Brick store from an mcool file.
1472: #' Read an mcool contact matrix coming out of 4D nucleome projects into a
1477: #' @inheritParams Brick_load_matrix
1489: #' @param matrix_chunk \strong{Optional}. Default 2000.
1490: #' The nxn matrix square to fill per iteration in a mcool file.
1493: #' cooler_read_limit sets the upper limit for the number of records per matrix
1495: #' matrix_chunk value will be re-evaluated dynamically.
1521: #' resolution = 50000, matrix_chunk = 2000, remove_prior = TRUE,
1527: #' @seealso \code{\link{Create_many_Bricks_from_mcool}} to create matrix from 
1533:     matrix_chunk = 2000, cooler_read_limit = 10000000, remove_prior = FALSE,
1569:         resolution = resolution, matrix_chunk = matrix_chunk, 
1575: #' Check if a matrix has been loaded for a chromosome pair.
1579: #' @inheritParams Brick_load_matrix
1581: #' @return Returns a logical vector of length 1, specifying if a matrix has
1588: #' out_dir <- file.path(tempdir(), "matrix_isdone_test")
1596: #' Matrix_file <- system.file(file.path("extdata", 
1600: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
1601: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1604: #' Brick_matrix_isdone(Brick = My_BrickContainer, chr1 = "chr2L", 
1609:     if(!Brick_matrix_exists(Brick = Brick, chr1 = chr1, chr2 = chr2,
1615:     return(Matrix.list[Matrix.list$chr1 == chr1 &
1616:         Matrix.list$chr2 == chr2, "done"])
1619: #' Check if a matrix for a chromosome pair is sparse.
1623: #' @inheritParams Brick_load_matrix
1625: #' @return Returns a logical vector of length 1, specifying if a matrix was
1626: #' loaded as a sparse matrix.
1632: #' out_dir <- file.path(tempdir(), "matrix_issparse_test")
1640: #' Matrix_file <- system.file(file.path("extdata", 
1644: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
1645: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1648: #' Brick_matrix_issparse(Brick = My_BrickContainer, chr1 = "chr2L", 
1653:     if(!Brick_matrix_exists(Brick = Brick, chr1 = chr1, chr2 = chr2,
1659:     return(Matrix.list[Matrix.list$chr1 == chr1 &
1660:         Matrix.list$chr2 == chr2, "sparsity"])
1664: #' Get the maximum loaded distance from the diagonal of any matrix.
1666: #' If values beyond a certain distance were not loaded in the matrix, this
1670: #' `Brick_matrix_maxdist` will return this parameter.
1674: #' @inheritParams Brick_load_matrix
1677: #' distance loaded for that matrix
1684: #' out_dir <- file.path(tempdir(), "matrix_maxdist_test")
1692: #' Matrix_file <- system.file(file.path("extdata", 
1696: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
1697: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1700: #' Brick_matrix_maxdist(Brick = My_BrickContainer, chr1 = "chr2L", 
1705:     if(!Brick_matrix_exists(Brick = Brick, chr1 = chr1, chr2 = chr2,
1709:     if(!Brick_matrix_isdone(Brick = Brick, chr1 = chr1, chr2 = chr2, 
1715:     return((Matrix.list[Matrix.list$chr1 == chr1 &
1716:         Matrix.list$chr2 == chr2, "distance"]))
1722: #' are provided. If a user is in doubt regarding whether a matrix is present or
1729: #' @inheritParams Brick_load_matrix
1731: #' @return Returns a logical vector of length 1, specifying if the matrix
1739: #' out_dir <- file.path(tempdir(), "matrix_exists_test")
1747: #' Matrix_file <- system.file(file.path("extdata", 
1751: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
1752: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1755: #' Brick_matrix_exists(Brick = My_BrickContainer, chr1 = "chr2L", 
1765: #' Return the value range of the matrix
1769: #' @inheritParams Brick_load_matrix
1772: #' maximum finite real values in the matrix.
1778: #' out_dir <- file.path(tempdir(), "matrix_minmax_test")
1786: #' Matrix_file <- system.file(file.path("extdata", 
1790: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
1791: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1794: #' Brick_matrix_minmax(Brick = My_BrickContainer, chr1 = "chr2L", 
1799:     if(!Brick_matrix_exists(Brick = Brick, chr1 = chr1, chr2 = chr2, 
1805:     Filter <- Matrix.list$chr1 == chr1 & Matrix.list$chr2 == chr2
1806:     Extent <- c(Matrix.list[Filter, "min"],Matrix.list[Filter, "max"])
1810: #' Return the dimensions of a matrix
1814: #' @inheritParams Brick_load_matrix
1816: #' @return Returns the dimensions of a Hi-C matrix for any given
1824: #' out_dir <- file.path(tempdir(), "matrix_dimension_test")
1832: #' Matrix_file <- system.file(file.path("extdata", 
1836: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
1837: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1840: #' Brick_matrix_dimensions(Brick = My_BrickContainer, chr1 = "chr2L", 
1844:     if(!Brick_matrix_exists(Brick = Brick, chr1 = chr1, chr2 = chr2, 
1853:         dataset.path = Reference.object$hdf.matrix.name,
1859: #' Return the filename of the loaded matrix
1863: #' @inheritParams Brick_load_matrix
1866: #' the currently loaded matrix.
1873: #' out_dir <- file.path(tempdir(), "matrix_filename_test")
1881: #' Matrix_file <- system.file(file.path("extdata", 
1885: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
1886: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1889: #' Brick_matrix_filename(Brick = My_BrickContainer, chr1 = "chr2L", 
1894:     if(!Brick_matrix_exists(Brick = Brick, chr1 = chr1, chr2 = chr2, 
1900:     Filter <- Matrix.list$chr1 == chr1 & Matrix.list$chr2 == chr2
1901:     Extent <- Matrix.list[Filter, "filename"]
1914: #' A string specifying the chromosome for the cis Hi-C matrix from which values
1947: #' Matrix_file <- system.file(file.path("extdata", 
1951: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
1952: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
1966: #' @seealso \code{\link{Brick_get_matrix_within_coords}} to get matrix by
1967: #' using matrix coordinates, \code{\link{Brick_fetch_row_vector}} to get values
1969: #' to get values using matrix coordinates, \code{\link{Brick_get_matrix}} to
1970: #' get matrix by using matrix coordinates.
1979:     if(!Brick_matrix_exists(Brick = Brick, chr1 = chr, 
1981:         !Brick_matrix_isdone(Brick = Brick, chr1 = chr, 
1993:     Max.dist <- Brick_matrix_maxdist(Brick = Brick, chr1 = chr, chr2 = chr,
1997:             "this matrix was at a distance of "
2041:             Name = Reference.object$hdf.matrix.name,
2055: #' Return a matrix subset between two regions.
2057: #' `Brick_get_matrix_within_coords` will fetch a matrix subset after
2060: #' This function calls \code{\link{Brick_get_matrix}}.
2075: #' If true, will force the retrieval operation when matrix contains loaded
2080: #' the matrix is returned.
2082: #' @return Returns a matrix of dimension x_coords binned length by y_coords
2090: #' out_dir <- file.path(tempdir(), "get_matrix_coords_test")
2098: #' Matrix_file <- system.file(file.path("extdata", 
2102: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
2103: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2106: #' Brick_get_matrix_within_coords(Brick = My_BrickContainer,
2111: #' Brick_get_matrix_within_coords(Brick = My_BrickContainer,
2118: #' @seealso \code{\link{Brick_get_matrix}} to get matrix by using matrix
2122: #' \code{\link{Brick_get_vector_values}} to get values using matrix
2152:     if(!Brick_matrix_isdone(Brick = Brick, chr1 = chr1, chr2 = chr2,
2154:         stop(chr1," ",chr2," matrix is yet to be loaded into the class.")
2171:     return(Matrix)
2174: #' Return a matrix subset.
2176: #' `Brick_get_matrix` will fetch a matrix subset between row values
2182: #' @inheritParams Brick_load_matrix
2191: #' If provided a data transformation with FUN will be applied before the matrix
2194: #' @inheritParams Brick_get_matrix_within_coords
2196: #' @return Returns a matrix of dimension x_coords length by y_coords length.
2203: #' out_dir <- file.path(tempdir(), "get_matrix_test")
2211: #' Matrix_file <- system.file(file.path("extdata", 
2215: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
2216: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2219: #' Brick_get_matrix(Brick = My_BrickContainer, chr1 = "chr2L", chr2 = "chr2L",
2222: #' @seealso \code{\link{Brick_get_matrix_within_coords}} to get matrix by using
2223: #' matrix genomic coordinates, \code{\link{Brick_get_values_by_distance}} to
2227: #' matrix coordinates.
2243:     if(!Brick_matrix_isdone(Brick = Brick, chr1 = chr1, chr2 = chr2, 
2245:         stop(chr1,chr2," matrix is yet to be loaded into the class.\n")
2258:         return(Matrix)             
2260:         return(FUN(Matrix))
2266: #' `Brick_fetch_row_vector` will fetch any given rows from a matrix. If
2273: #' @inheritParams Brick_load_matrix
2293: #' @inheritParams Brick_get_matrix_within_coords
2300: #' If provided a data transformation with FUN will be applied before the matrix
2320: #' Matrix_file <- system.file(file.path("extdata", 
2324: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
2325: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2334: #' @seealso \code{\link{Brick_get_matrix_within_coords}} to get matrix by
2335: #' using matrix genomic coordinates, \code{\link{Brick_get_values_by_distance}}
2338: #' subset them, \code{\link{Brick_get_matrix}} to get matrix by using
2339: #' matrix coordinates.
2354:     max.dist <- Brick_matrix_maxdist(Brick = Brick, chr1 = chr1, chr2 = chr2, 
2359:     if(!Brick_matrix_isdone(Brick = Brick, chr1 = chr1, chr2 = chr2,
2361:         stop(chr1,chr2," matrix is yet to be loaded.")
2437: #' other matrix retrieval functions.
2441: #' @inheritParams Brick_load_matrix
2457: #' @inheritParams Brick_get_matrix_within_coords
2460: #' returns a matrix of dimension xaxis length by yaxis length.
2477: #' Matrix_file <- system.file(file.path("extdata", 
2481: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
2482: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2503:     if(!Brick_matrix_isdone(Brick = Brick, chr1 = chr1, chr2 = chr2,
2505:         stop(chr1,chr2," matrix is yet to be loaded.")
2513:     Max.dist <- Brick_matrix_maxdist(Brick = Brick, chr1 = chr1, chr2 = chr2, 
2518:             "this matrix was at a distance of ",
2527:         Brick = Brick_filepath, Name = Reference.object$hdf.matrix.name, 
2536: #' Return an entire matrix for provided chromosome pair for a resolution.
2538: #' `Brick_get_entire_matrix` will return the entire matrix for the entire 
2544: #' @inheritParams Brick_load_matrix
2546: #' @return Returns an object of class matrix with dimensions corresponding to
2563: #' Matrix_file <- system.file(file.path("extdata", 
2567: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
2568: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2571: #' Entire_matrix <- Brick_get_entire_matrix(Brick = My_BrickContainer, 
2581:     if(!Brick_matrix_isdone(Brick = Brick, chr1 = chr1, chr2 = chr2,
2583:         stop(chr1,chr2," matrix is yet to be loaded.")
2590:         Brick = Brick_filepath, Name = Reference_object$hdf.matrix.name, 
2594:     return(entire_matrix)
2597: #' Get the matrix metadata columns in the Brick store.
2599: #' `Brick_get_matrix_mcols` will get the specified matrix metadata column for
2600: #' a chr1 vs chr2 Hi-C data matrix. Here, chr1 represents the rows and chr2
2601: #' represents the columns of the matrix. For cis Hi-C matrices, where 
2615: #' @inheritParams Brick_load_matrix
2618: #' A character vector of length 1 specifying the matrix metric to retrieve
2620: #' @return Returns a 1xN dimensional vector containing the specified matrix
2628: #' out_dir <- file.path(tempdir(), "get_matrix_mcols_test")
2636: #' Matrix_file <- system.file(file.path("extdata", 
2640: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
2641: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2644: #' Brick_get_matrix_mcols(Brick = My_BrickContainer, chr1 = "chr2L", 
2652:     Meta.cols <- Reference.object$hdf.matrix.meta.cols()
2657:     if(!Brick_matrix_exists(Brick = Brick, chr1 = chr1, chr2 = chr2, 
2659:         stop("Matrix for this chromsome pair does not exist.\n")  
2661:     if(!Brick_matrix_isdone(Brick = Brick, chr1 = chr1, chr2 = chr2,
2663:         stop("Matrix for this chromsome pair is yet to be loaded.\n")  
2668:     if(!Brick_matrix_issparse(Brick = Brick, chr1 = chr1, chr2 = chr2,
2670:         stop("This matrix is not a sparse matrix.",
2685: #' List the matrix metadata columns in the Brick store.
2687: #' `Brick_get_matrix_mcols` will list the names of all matrix metadata 
2690: #' @return Returns a vector containing the names of all matrix metadata columns
2697: #' out_dir <- file.path(tempdir(), "list_matrix_mcols_test")
2705: #' Brick_list_matrix_mcols()
2708:     Meta.cols <- Reference.object$hdf.matrix.meta.cols()
2714: #' upper triangle sparse matrix
2719: #' objects as a upper triangle sparse matrix (col > row) containing 
2746: #' Matrix_file <- system.file(file.path("extdata", 
2750: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
2751: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2833: #' Matrix_file <- system.file(file.path("extdata", 
2837: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
2838: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2852:     correlation_matrix <- .remove_nas(correlation_matrix)
2856:     pca_list <- prcomp(correlation_matrix)
2868: #' @inheritParams Brick_load_matrix
2873: #' sparse matrix
2875: #' @param matrix_chunk \strong{Optional}. Default 2000.
2876: #' The nxn matrix square to fill per iteration.
2900: #' Matrix_file <- system.file(file.path("extdata", 
2904: #' Brick_load_matrix(Brick = My_BrickContainer, chr1 = "chr2L", 
2905: #' chr2 = "chr2L", matrix_file = Matrix_file, delim = " ", 
2918:     resolution = NULL, batch_size = 1000000, matrix_chunk = 2000,
2930:         delim = delim, resolution = resolution, matrix_chunk = matrix_chunk, 
173:     Reference.object <- GenomicMatrix$new()
330:     Reference.object <- GenomicMatrix$new()
426:     Reference.object <- GenomicMatrix$new()
468:     Reference.object <- GenomicMatrix$new()
549:     Reference.object <- GenomicMatrix$new()
617:     Reference.object <- GenomicMatrix$new()
691:     Reference.object <- GenomicMatrix$new()
756:     Reference.object <- GenomicMatrix$new()
810:     Reference.object <- GenomicMatrix$new()
892:     Reference.object <- GenomicMatrix$new()
953:     Reference.object <- GenomicMatrix$new()
1086:     Reference.object <- GenomicMatrix$new()
1325:     Reference.object <- GenomicMatrix$new()
1366:     RetVar <- ._ProcessMatrix_(Brick = Brick_filepath, 
1423:     Reference.object <- GenomicMatrix$new()
1535:     Reference.object <- GenomicMatrix$new()
1608:     Reference.object <- GenomicMatrix$new()
1652:     Reference.object <- GenomicMatrix$new()
1704:     Reference.object <- GenomicMatrix$new()
1798:     Reference.object <- GenomicMatrix$new()
1848:     Reference.object <- GenomicMatrix$new()
1893:     Reference.object <- GenomicMatrix$new()
1977:     Reference.object <- GenomicMatrix$new()
2494:     Reference.object <- GenomicMatrix$new()
2575:     Reference_object <- GenomicMatrix$new()
2651:     Reference.object <- GenomicMatrix$new()
2707:     Reference.object <- GenomicMatrix$new()
2760:     Reference.object <- GenomicMatrix$new()
2920:     Reference.object <- GenomicMatrix$new()
CoRegNet:inst/www/js/cytoscape.min.js: [ ]
17: ...(518 bytes skipped)...unction(e){return null!=e&&"string"==typeof e},fn:function(e){return null!=e&&"function"==typeof e},array:function(e){return null!=e&&e instanceof Array},plainObject:function(t){return null!=t&&typeof t==typeof{}&&!e.is.array...(1356 bytes skipped)...;l++)if(null!=(t=arguments[l]))for(r in t)i=s[r],n=t[r],s!==n&&(u&&n&&(e.is.plainObject(n)||(a=e.is.array(n)))?(a?(a=!1,o=i&&e.is.array...(1230 bytes skipped)...{};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},copy:function(t){return null==t?t:e.is.array...(14223 bytes skipped)...?c:p>l?(e-n)*(e-n)+(t-a)*(t-a):c-p},e.math.pointInsidePolygon=function(e,t,r,i,n,a,o,s,l){var c=new Array...(560 bytes skipped)...y,x>t&&w++,t>x&&_++}return w%2==0?!1:!0},e.math.joinLines=function(e){for(var t,r,i,n,a,o,s,l,c=new Array...(227 bytes skipped)...,l,!0);c[2*u]=p[0],c[2*u+1]=p[1]}return c},e.math.expandPolygon=function(e,t){for(var r,i,n,a,o=new Array...(2124 bytes skipped)...ctPolygon=function(t,r,i,n,a,o,s,l,c,u,p){if(t>i){var d=t;t=i,i=d}if(r>n){var h=r;r=n,n=h}var g=new Array...(1011 bytes skipped)...gth>0)return!0}return!1},e.math.polygonIntersectLine=function(t,r,i,n,a,o,s,l){for(var c,u=[],p=new Array...(1067 bytes skipped)...nPoints=function(e,t){var r=1/e*2*Math.PI,i=e%2==0?Math.PI/2+r/2:Math.PI/2;i+=t;for(var n,a,o,s=new Array...(8065 bytes skipped)...ent.regex),v=g[1],f=g[2]?g[2]:void 0;t.push({type:v,namespace:f})}}}else if(l){var y=t;t=[y]}r?e.is.array(r)||(r=[r]):r=[];for(var d=0;d<t.length;d++)for(var m=t[d],b=0;b<o.length;b++){var h,x=o[b],w=x._pr...(338 bytes skipped)...
18: ...(26522 bytes skipped)...xValue)?f=g.pxValue!==v.pxValue:e.is.number(g.value)&&e.is.number(v.value)?f=g.value!==v.value:e.is.array(g.value)&&e.is.array(v.value)&&(f=g.value[0]!==v.value[0]||g.value[1]!==v.value[1]||g.value[2]!==v.value[2]),f&&(c[d]=v....(5302 bytes skipped)...
19: ...(2058 bytes skipped)...=c.minZoom&&(u.maxZoom=c.maxZoom),u.style=e.is.stylesheet(c.style)?c.style.generateStyle(this):e.is.array...(2677 bytes skipped)...{for(var a=[],o=0;o<n.length;o++){var s=n[o];a.push(s.json())}r=new e.Collection(i,a)}}else if(e.is.array(t)){var a=t;r=new e.Collection(i,a)}else if(e.is.plainObject(t)&&(e.is.array(t.nodes)||e.is.array(t.edges))){for(var l=t,a=[],c=["nodes","edges"],o=0,u=c.length;u>o;o++){var p=c[o],d=l[p];if(e.is.array...(583 bytes skipped)...=s.elements();return l.length>0&&l.remove(),s.notifications(!1),null!=i&&(e.is.plainObject(i)||e.is.array...(4171 bytes skipped)...if(e.is.element(t.collection)){var n=t.collection;t.collection=new e.Collection(i,[n])}else if(e.is.array...(13541 bytes skipped)...y,[]),n=[],a=this.nodes(),o=0;o<a.length;o++)n.push(a[o].collection());for(var s=this.edges(),l=s.toArray().sort(function(e,r){var i=t.call(e),n=t.call(r);return i-n}),o=0;o<l.length;o++){var c=l[o],u=c.so...(8172 bytes skipped)...
20: ...(6074 bytes skipped)...n(t))for(var r=0;r<this.length;r++){var i=this[r],n=t.apply(i,[r,i]);if(n===!1)break}return this},toArray...(396 bytes skipped)....empty()},sort:function(t){if(!e.is.fn(t))return this;var r=this.cy(),i=(new e.Collection(r),this.toArray...(11202 bytes skipped)...elect:[void 0,void 0,void 0,void 0,0],renderer:this,cy:e.cy,container:e.cy.container(),canvases:new Array(t.CANVAS_LAYERS),canvasNeedsRedraw:new Array(t.CANVAS_LAYERS),bufferCanvases:new Array(t.BUFFER_COUNT)},this.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,ini...(14229 bytes skipped)...
21: ...(12891 bytes skipped)...+e[0])/2-e[2],2)+Math.pow((e[5]+e[1])/2-e[3],2));var i,n=Math.ceil(r/t);if(!(n>0))return null;i=new Array...(169 bytes skipped)...Math.sqrt(Math.pow(e[2]-e[0],2)+Math.pow(e[3]-e[1],2)),n=Math.ceil(i/t);if(!(n>0))return null;r=new Array(2*n);for(var a=[e[2]-e[0],e[3]-e[1]],o=0;n>o;o++){var s=o/n;r[2*o]=a[0]*s+e[0],r[2*o+1]=a[1]*s+e[1]...(18657 bytes skipped)...
22: ...(24751 bytes skipped)...(t,r,n,a,o,s,l){return e.math.pointInsidePolygon(t,r,i.octagon.points,s,l,a,o,[0,-1],n)}};var n=new Array...(4404 bytes skipped)...iner(),c=l.clientWidth,u=l.clientHeight;if(e.is.elementOrCollection(i.roots))t=i.roots;else if(e.is.array(i.roots)){for(var p=[],d=0;d<i.roots.length;d++){var h=i.roots[d],g=n.getElementById(h);t.push(g)}t...(2596 bytes skipped)...
23: ...(5233 bytes skipped)...aph[k];if(M!=N){for(var C=a(E.sourceId,E.targetId,r),D=r.graphSet[C],T=0,o=r.layoutNodes[P];-1==$.inArray(o.id,D);)o=r.layoutNodes[r.idToIndex[o.parentId]],T++;for(o=r.layoutNodes[k];-1==$.inArray...(241 bytes skipped)...t,r){var i=o(e,t,0,r);return 2>i.count?0:i.graph},o=function(e,t,r,i){var n=i.graphSet[r];if(-1<$.inArray(e,n)&&-1<$.inArray(t,n))return{count:2,graph:r};for(var a=0,s=0;s<n.length;s++){var l=n[s],c=i.idToIndex[l],u=i.layout...(13472 bytes skipped)...
BADER:src/meth.h: [ ]
6: } Matrix;
2: typedef struct MatrixStructure {
20:     Matrix kA;
21:     Matrix kB;
24:     Matrix lambdaA;
26:     Matrix lambdaB;
44: double columnMean ( Matrix &A, int column )
95: void mult ( Vector &a, Matrix &X, Vector &b )
TRONCO:R/visualization.R: [ ]
2377:     matrix = matrix(0, nrow = length(keys) + 3, ncol = 1)
407:     pheat.matrix = data.lifting(x,data)
1223: draw_matrix <- function(matrix,
98:     ##  This function sorts a matrix to enhance mutual exclusivity
198:             stop('"group.samples" should be matrix with sample names and group assignment.')
364:     data.lifting <- function(obj, matrix) {
375:                                        function(obj, matrix) {
377:                                            ## Are you sure (obj %in% # matrix)
380:                                            if (obj %in% matrix) {
385:                                        rownames(matrix)))]
386:                 sub.data = matrix[keys.subset, , drop = FALSE]
394:                 matrix[keys.subset, ] = sub.data 
404:         return(list(data=matrix, colors=map.gradient))
408:     map.gradient = pheat.matrix$colors
409:     data = pheat.matrix$data
785:     data = matrix(0, nrow = ngenes(x), ncol = ntypes(x))
882:         tmp = as.matrix(subdata[which(refcol == i), ]);
1060:         t = c(as.vector(as.matrix(annotation_col)), colnames(annotation_col)) 
1083:             c(as.vector(as.matrix(annotation_row)),
1161:         stop("Gaps do not match with matrix size")
1182:     dist = matrix(0, nrow = 2 * n - 1, ncol = 2, dimnames = list(NULL, c("x", "y"))) 
1230:         n = nrow(matrix)
1231:         m = ncol(matrix)
1248:                      gp = gpar(fill = matrix, col = border_color))
1383:     return(as.matrix(new))
1550: heatmap_motor <- function(matrix,
1585:            nrow = nrow(matrix),
1586:            ncol = ncol(matrix),
1634:         ## gt = heatmap_motor(matrix, cellwidth = cellwidth,
1650:             heatmap_motor(matrix,
1711:     ## Draw matrix.
1713:     elem = draw_matrix(matrix, border_color, gaps_row, gaps_col, fmat, fontsize_number, number_color)
1714:     res = gtable_add_grob(res, elem, t = 4, l = 3, clip = "off", name = "matrix")
1810:         mat = as.matrix(mat)
1811:         return(matrix(scale_vec_colours(as.vector(mat),
1972: #' @param mat numeric matrix of the values to be plotted.
1994: #' of the above it is assumed that a distance matrix is provided.
2032: #' the cells. If this is a matrix (with same dimensions as original matrix), the contents
2033: #' of the matrix are shown instead of original values.
2067: #' # Create test matrix
2068: #' test = matrix(rnorm(200), 20, 10)
2144:     ## Preprocess matrix.
2146:     mat = as.matrix(mat)
2172:     if (is.matrix(display_numbers) | is.data.frame(display_numbers)) {
2174:             stop("If display_numbers provided as matrix, its dimensions have to match with mat")
2177:         display_numbers = as.matrix(display_numbers)
2178:         fmat = matrix(as.character(display_numbers), nrow = nrow(display_numbers), ncol = ncol(display_numbers))
2182:             fmat = matrix(sprintf(number_format, mat), nrow = nrow(mat), ncol = ncol(mat))
2185:             fmat = matrix(NA, nrow = nrow(mat), ncol = ncol(mat))
2259:     ## Select only the ones present in the matrix.
2378:     rownames(matrix) = c(keys, 'soft', 'co-occurrence', 'other')
2379:     ## colnames(matrix) = paste(to, collapse = ':')
2380:     colnames(matrix) = to[1]
2420:     matrix['co-occurrence', ] = length(co.occurrences)
2421:     cat('Co-occurrence in #samples: ', matrix['co-occurrence', ], '\n')
2426:         matrix[keys[i], ] = length(intersect(to.samples, hard.pattern.samples[[keys[i]]])) 
2427:     cat('Hard exclusivity in #samples:', matrix[keys, ], '\n')  
2433:     matrix['other', ] = length(intersect(to.samples, union))
2434:     cat('Other observations in #samples:', matrix['other', ], '\n') 
2438:     matrix['soft', ] = length(to.samples) - colSums(matrix)
2439:     cat('Soft exclusivity in #samples:', matrix['soft', ], '\n')  
2443:     sector.color = rep('gray', nrow(matrix) + 1) 
2444:     link.color = rep('gray', nrow(matrix)) 
2446:     names(sector.color) = c(rownames(matrix), colnames(matrix))
2447:     names(link.color) = rownames(matrix)
2465:     idx.max = which(matrix == max(matrix))
2466:     link.style = matrix(0, nrow=nrow(matrix), ncol=ncol(matrix))
2467:     rownames(link.style) = rownames(matrix)
2468:     colnames(link.style) = colnames(matrix)
2482:     sector.color[colnames(matrix)] = as.colors(x)[as.events(x, genes = to[1], types=to[2])[, 'type' ]]
2489:         ## rownames(matrix)[i] = paste(paste(rep(' ', i), collapse = ''), events.names[i, 'event' ])
2491:             rownames(matrix)[i] = paste(paste(rep(' ', i), collapse = ''), events.names[i, 'event' ])
2492:         else rownames(matrix)[i] = events.names[i, 'event' ]
2494:         names(sector.color)[i] = rownames(matrix)[i]    
2499:         cat('Circlize matrix.\n')
2500:         print(matrix)
2508:         chordDiagram(matrix, 
2536:         layout(matrix(c(1,2,3,3), ncol = 2, byrow = TRUE), heights = c(4, 1))
2551:         print(matrix)
2553:         ## barplot(matrix[, 1], widths, space = 0)
2555:         rownames(matrix)[length(keys) + 1] = '2 or more\n(soft-exclusivity)'
2556:         rownames(matrix)[length(keys) + 2] = 'all together\n(co-occurrence)'
2558:         rownames(matrix)[nrow(matrix)] = 'none of the\nevents'
2560:         summary = matrix[ (length(keys) + 1):nrow(matrix), 1, drop = FALSE]
2561:         summary = rbind( sum(matrix[1:length(keys),]), summary)
2586:         exclus = matrix[1:length(keys), 1, drop = FALSE]
2617:                    c(paste(sum(matrix[1:length(keys) ,]), 'with 1 event (hard exclusivity)'),
2618:                      paste(matrix[length(keys) + 1, ],  'with 2 or more events'),
2619:                      paste(matrix[length(keys) + 2, ], 'with all events (co-occurrence)'),
2620:                      paste(matrix[length(keys) + 3, ], 'with no events')
ISAnalytics:R/internal-functions.R: [ ]
2991:         matrix <- do.call(.import_single_matrix, args = append(
173:         matrix_type <- names(annotation_suffix[
240:     matrix_required_cols <- c(
1107: .import_single_matrix <- function(path,
5613:     matrix_desc <- df %>%
5871:             sub_matrix <- matrix_desc[, seq(from = t1, to = t2, by = 1)]
5917:             sub_matrix <- matrix_desc[, seq(from = t1, to = t2, by = 1)]
182:             matrix_type = matrix_type,
244:     if (!all(matrix_required_cols %in% colnames(integration_matrices))) {
246:             matrix_required_cols,
247:             matrix_required_cols[!matrix_required_cols %in%
377:             sparse <- as_sparse_matrix(.x)
381:                 "fragmentEstimate_matrix.no0.annotated.tsv.gz",
382:                 "fragmentEstimate_matrix.tsv.gz"
385:                 "seqCount_matrix.no0.annotated.tsv.gz",
386:                 "seqCount_matrix.tsv.gz"
466:         ### -- Choose a pool for matrix error
476:             sparse <- as_sparse_matrix(.x)
480:                 "fragmentEstimate_matrix.no0.annotated.tsv.gz",
481:                 "fragmentEstimate_matrix.tsv.gz"
484:                 "seqCount_matrix.no0.annotated.tsv.gz",
485:                 "seqCount_matrix.tsv.gz"
938: # Finds experimental columns in an integration matrix.
941: # standard integration matrix columns, if there are returns their names.
960: # Checks if the integration matrix is annotated or not.
975: #### ---- Internals for matrix import ----####
977: #---- USED IN : import_single_Vispa2Matrix ----
979: # Reads an integration matrix using data.table::fread
1044: # Reads an integration matrix using readr::read_delim
1106: #              import_single_Vispa2_matrix
1132:                 "?import_single_Vispa2Matrix"
1924:     matrix_type,
1926:     multi_quant_matrix) {
1934:     stopifnot(is.logical(multi_quant_matrix) & length(multi_quant_matrix) == 1)
2341: # @param matrix_type The matrix_type to lookup (one between "annotated" or
2365:     suffixes <- matrix_file_suffixes() %>%
2367:             .data$matrix_type == m_type,
2773:     matrix_type,
2781:         matrix_type,
2982:     progress, import_matrix_args) {
2985:     sample_col_name <- if ("id_col_name" %in% names(import_matrix_args)) {
2986:         import_matrix_args[["id_col_name"]]
2998:         return(matrix)
3006:                     arg_list = import_matrix_args,
3014:             import_matrix_args,
3058:         return(list(matrix = NULL, imported_files = imported_files))
3065:     list(matrix = matrices, imported_files = imported_files)
3075:     import_matrix_args) {
3108:                 import_matrix_args
3121:                 import_matrix_args
3130:     imported_matrices <- purrr::map(imported_matrices, ~ .x$matrix)
3132:     list(matrix = imported_matrices, summary = summary_files)
3159:         ## remove_collisions requires seqCount matrix, check if the list
3186:                 class = "coll_matrix_issues"
3189:         ## Transform the list in a multi-quant matrix
3193:         x <- rlang::exec(comparison_matrix, !!!args)
3260: # Checks if association file contains more information than the matrix.
3263: # the examined matrix there are additional CompleteAmplificationIDs contained
3264: # in the association file that weren't included in the integration matrix (for
3415: # for multi quantification matrix)
3453: # for multi quantification matrix)
3561: # (obtained via `.join_matrix_af`)
3562: # @param after The final matrix obtained after collision processing
3612: # Internal for obtaining summary info about the input sequence count matrix
3640:     ## Joined is the matrix already joined with metadata
3697:         MATRIX = unique(x[[pcr_col]]),
3920: # - x is a single matrix
3984: # meaning a subset of an integration matrix in which all rows
3992: # @return A named list with recalibrated matrix and recalibration map.
4052:             return(list(recalibrated_matrix = x, map = map_recalibr))
4197:     return(list(recalibrated_matrix = x, map = map_recalibr))
4824:                     "the matrix. Here is a summary: "
5612:     # --- OBTAIN MATRIX (ALL TPs)
5630:         as.matrix()
5631:     # --- OBTAIN MATRIX (STABLE TPs)
5653:             as.matrix()
5658:     timecaptures <- length(colnames(matrix_desc))
5665:         matrix_desc = matrix_desc,
5679:             matrix_desc = patient_slice_stable,
5695:         matrix_desc = matrix_desc,
5708:             matrix_desc = patient_slice_stable,
5723:     estimate_consecutive_m0 <- if (ncol(matrix_desc) > 1) {
5725:             matrix_desc = matrix_desc,
5742:     estimate_consecutive_mth <- if (stable_tps & ncol(matrix_desc) > 2) {
5743:         # - Note: pass the whole matrix, not only stable slice
5745:             matrix_desc = matrix_desc,
5775: .closed_m0_est <- function(matrix_desc, timecaptures, cols_estimate_mcm,
5778:     models0 <- Rcapture::closedp.0(matrix_desc,
5786:         colnames(matrix_desc)[1],
5790:         colnames(matrix_desc)[ncol(matrix_desc)],
5820: .closed_mthchaobc_est <- function(matrix_desc, timecaptures, cols_estimate_mcm,
5822:     mthchaobc <- Rcapture::closedp.bc(matrix_desc,
5830:         colnames(matrix_desc)[1],
5834:         colnames(matrix_desc)[ncol(matrix_desc)],
5864: .consecutive_m0bc_est <- function(matrix_desc, cols_estimate_mcm, subject) {
5866:     indexes <- seq(from = 1, to = ncol(matrix_desc) - 1, by = 1)
5873:                 colnames(sub_matrix)[1],
5877:                 colnames(sub_matrix)[ncol(sub_matrix)],
5880:             patient_trend_M0 <- Rcapture::closedp.bc(sub_matrix,
5911: .consecutive_mth_est <- function(matrix_desc, cols_estimate_mcm, subject) {
5912:     indexes_s <- seq(from = 1, to = ncol(matrix_desc) - 2, by = 1)
5919:                 colnames(sub_matrix)[1],
5923:                 colnames(sub_matrix)[ncol(sub_matrix)],
5926:             patient_trend_Mth <- Rcapture::closedp.bc(sub_matrix,
ISAnalytics:R/plotting-functions.R: [ ]
717:         matrix <- wide %>%
1834:             as_matrix <- as.matrix(x, rownames = "int_id")
1840:             as_matrix <- as.matrix(x, rownames = "int_id")
13: #' Users can supply as `x` either a simple integration matrix or a
20: #' @param x Either a simple integration matrix or a data frame resulting
700:         ## --- Obtain data matrix and annotations
719:             as.matrix()
720:         rownames(matrix) <- wide[[gene_sym_col]]
801:         map <- rlang::exec(pheatmap::pheatmap, mat = matrix, !!!params_to_pass)
1835:             eul <- eulerr::euler(as_matrix)
1841:             eul <- eulerr::venn(as_matrix)
1870: #' @param data Either a single integration matrix or a list of integration
1878: #' integration matrix is provided as `data` should be of the same length.
RGMQL:R/Utils.R: [ ]
82:         matrix <- matrix(new_value)
80:     aggregate_matrix <- t(vapply(meta_data, function(x) {
86:     metadata_matrix <- cbind(m_names,aggregate_matrix)
92:     cond_matrix <- NULL
85:     m_names <- matrix(names)
95:         cond_matrix <- rbind(cond_matrix, def)
99:         cond_matrix <- rbind(cond_matrix, exact)
103:         cond_matrix <- rbind(cond_matrix, full)
104:     cond_matrix
phantasus:inst/www/phantasus.js/jasmine/lib/jasmine-2.5.2/jasmine.js: [ ]
1314:       return Array.prototype.slice.call(argsObj, n);
187:   j$.arrayContaining = function(sample) {
271:   util.argsToArray = function(args) {
283:   util.arrayContains = function(array, search) {
1795:   PrettyPrinter.prototype.emitArray = j$.unimplementedMethod_;
1816:   StringPrettyPrinter.prototype.emitArray = function(array) {
2662:   function ArrayContaining(sample) {
2666:   ArrayContaining.prototype.asymmetricMatch = function(other) {
138:   j$.isArray_ = function(value) {
125:   j$.MAX_PRETTY_PRINT_ARRAY_LENGTH = 100;
139:     return j$.isA_('Array', value);
202:           args: Array.prototype.slice.apply(arguments)
241:       throw 'createSpyObj requires a non-empty array of method names to create spies for';
284:     var i = array.length;
286:       if (array[i] === search) {
294:     if (Object.prototype.toString.apply(obj) === '[object Array]') {
1397:     function indexOfFirstToPass(array, testFn) {
1400:       for (var i = 0; i < array.length; ++i) {
1401:         if (testFn(array[i])) {
1524:       var args = Array.prototype.slice.call(arguments, 0),
1767:       } else if (value.toString && typeof value === 'object' && !(value instanceof Array) && value.toString !== Object.prototype.toString) {
1770:         this.emitScalar('<circular reference: ' + (j$.isArray_(value) ? 'Array' : 'Object') + '>');
1818:       this.append('Array');
1821:     var length = Math.min(array.length, j$.MAX_PRETTY_PRINT_ARRAY_LENGTH);
1827:       this.format(array[i]);
1829:     if(array.length > length){
1834:     var first = array.length === 0;
1835:     this.iterateObject(array, function(property, isGetter) {
1846:       self.formatProperty(array, property, isGetter);
2165:       var values = Array.prototype.slice.call(arguments);
2668:     if (className !== '[object Array]') { throw new Error('You must provide an array to arrayContaining, not \'' + this.sample + '\'.'); }
2793:       if ((Object.prototype.toString.apply(haystack) === '[object Array]') ||
2808:       var args = Array.prototype.slice.call(arguments, 0),
2942:     // Compare array lengths to determine if a deep comparison is necessary.
2943:     if (className == '[object Array]') {
2958:       // or `Array`s from different frames are.
2967:     var aKeys = keys(a, className == '[object Array]'), key;
2971:     if (keys(b, className == '[object Array]').length !== size) { return false; }
3305:         var args = Array.prototype.slice.call(arguments, 0),
3334:         var args = Array.prototype.slice.call(arguments, 0),
64:     j$.ArrayContaining = jRequire.ArrayContaining(j$);
188:     return new j$.ArrayContaining(sample);
235:     if (j$.isArray_(baseName) && j$.util.isUndefined(methodNames)) {
240:     if (!j$.isArray_(methodNames) || methodNames.length === 0) {
272:     var arrayOfArgs = [];
274:       arrayOfArgs.push(args[i]);
276:     return arrayOfArgs;
1122:       var argsAsArray = j$.util.argsToArray(context.args);
1123:       for(var i = 0; i < argsAsArray.length; i++) {
1124:         if(Object.prototype.toString.apply(argsAsArray[i]).match(/^\[object/)) {
1125:           clonedArgs.push(j$.util.clone(argsAsArray[i]));
1127:           clonedArgs.push(argsAsArray[i]);
1571:           expected: expected // TODO: this may need to be arrayified/sliced
1769:       } else if (j$.util.arrayContains(this.seen, value)) {
1771:       } else if (j$.isArray_(value) || j$.isA_('Object', value)) {
1773:         if (j$.isArray_(value)) {
1774:           this.emitArray(value);
2661: getJasmineRequireObj().ArrayContaining = function(j$) {
2680:   ArrayContaining.prototype.jasmineToString = function () {
2681:     return '<jasmine.arrayContaining(' + jasmine.pp(this.sample) +')>';
2684:   return ArrayContaining;
2941:     // Recursively compare objects and arrays.
2988:     function keys(obj, isArray) {
3000:       if (!isArray) {
MotifDb:misc/hocomoco-v11/importV11.R: [ ]
106:     matrix <- matrices[[matrix.id]]
75:   matrix.names <- sapply(pwm.list, function (element) element$title)
101:   matrix.ids <- names(matrices)
103:   for (matrix.id in matrix.ids) {
302:   rawMatrixList <- readRawMatrices("./", dataDir)
44:   for (i in 1:max){ # loop through all motifs in the matrix file, one motif at a time
63:    mtx <- pwm.1$matrix
71: # rather than a sublist of title and matrix, each element is simply a matrix, with the element named
74:   matrices <- sapply(pwm.list, function (element) element$matrix)
76:   matrix.names <- sub("^> ", "", matrix.names)
77:   names(matrices) <- matrix.names
104:     tokens <- strsplit(matrix.id, ".", fixed=TRUE)[[1]]
107:     geneSymbol <- sub("_HUMAN.*$", "", matrix.id)
108:     tbl.sub <- subset(tbl.raw, Model==matrix.id)
116:     new.row <- list (providerName=matrix.id,
117:                      providerId=matrix.id, #"HOCOMOCO v8 and ChiPMunk 3.1"
125:                      sequenceCount=max(colSums(matrix)),
131:     #printf("matrix.id: %s", matrix.id);
134:     full.name <- sprintf ('%s-%s-%s', organism, dataSource, matrix.id)
136:     } # for matrix.id
151:      # make sure the reliability score (A-D) is searchably found in the matrix rowname
162: # we now have metadata rownames, one per matrix, each of which has all (or at least at lot) of information
163: # used in querying.  For instance, the hocomoco give name for the first matrix is
209:      # after normalization, each matrix column should total to 1.0
210:      # so sum(matrix) should be equals to the number of columns
232:   result <- matrix (nrow=4, ncol=cols,
247:   #return (list (title=title, consensus.sequence=consensus.sequence, matrix=result))
248:   return (list (title=title, matrix=result))
303:   length(rawMatrixList)
304:   matrices <- extractMatrices (rawMatrixList)
hipathia:inst/extdata/pathway-viewer/webcomponentsjs/webcomponents.min.js: [ ]
13: ...(8195 bytes skipped)...t){window[t]=e.wrappers[t]})}(window.ShadowDOMPolyfill),function(e){function t(e,t){var n="";return Array...(624 bytes skipped)... a(e,t){if(t){var o;if(e.match("@import")&&D){var a=n(e);i(function(e){e.head.appendChild(a.impl),o=Array...(1368 bytes skipped)...t(r.scopeStyles)),r},findStyles:function(e){if(!e)return[];var t=e.querySelectorAll("style");return Array...(3 bytes skipped)...ototype.filter.call(t,function(e){return!e.hasAttribute(R)})},applyScopeToContent:function(e,t){e&&(Array.prototype.forEach.call(e.querySelectorAll("*"),function(e){e.setAttribute(t,"")}),Array...(1659 bytes skipped)...(var t=0;t<N.length;t++)e=e.replace(N[t]," ");return e},scopeRules:function(e,t){var n="";return e&&Array...(450 bytes skipped)...ule(e))}},this),n},ieSafeCssTextFromKeyFrameRule:function(e){var t="@keyframes "+e.name+" {";return Array...(278 bytes skipped)...:this.applySelectorScope(e,t)),r.push(e)},this),r.join(", ")},selectorNeedsScoping:function(e,t){if(Array.isArray...(115 bytes skipped)...g,"\\[").replace(/\]/g,"\\]"),new RegExp("^("+e+")"+S,"m")},applySelectorScope:function(e,t){return Array.isArray...(908 bytes skipped)...itial"===n[r]&&(t+=r+": initial; ");return t},replaceTextInStyles:function(e,t){e&&t&&(e instanceof Array||(e=[e]),Array.prototype.forEach.call(e,function(e){e.textContent=t.call(this,e.textContent)},this))},addCssToDocu...(17237 bytes skipped)...
11: ...(5493 bytes skipped)... r=0,o=1,i=2,a=3;n.prototype={calcEditDistances:function(e,t,n,r,o,i){for(var a=i-o+1,s=n-t+1,c=new Array(a),l=0;l<a;l++)c[l]=new Array...(1455 bytes skipped)...tion(e,t){return this.calcSplices(e,0,e.length,t,0,t.length)},equals:function(e,t){return e===t}},e.Array...(3093 bytes skipped)...tObservedNodes=[]}var u=e.setEndOfMicrotask,d=e.wrapIfNeeded,p=e.wrappers,h=new WeakMap,f=[],m=!1,w=Array.prototype.slice,v=0;c.prototype={constructor:c,observe:function(e,t){e=d(e);var n,r=new s(t),o=h.ge...(21733 bytes skipped)...
14: ...(14987 bytes skipped)...olyfilled&&g["throttle-attached"];e.hasPolyfillMutations=E,e.hasThrottledAttached=E;var _=!1,S=[],T=Array.prototype.forEach.call.bind(Array...(5910 bytes skipped)...tomElements),function(e){Function.prototype.bind||(Function.prototype.bind=function(e){var t=this,n=Array.prototype.slice.call(arguments,1);return function(){var r=n.slice();return r.push.apply(r,arguments...(384 bytes skipped)...
12: ...(25723 bytes skipped)...ShadowRoot,j=(e.assert,e.getTreeScope),D=(e.mixin,e.oneOf),H=e.unsafeUnwrap,x=e.unwrap,R=e.wrap,I=e.ArraySplice,P=new WeakMap,k=new WeakMap,A=new WeakMap,W=D(window,["requestAnimationFrame","mozRequestAnim...(6091 bytes skipped)...
GeneTonic:R/gs_heatmap.R: [ ]
226:       matrix = mydata_sig,
501:   score_matrix <- mat
282:       matrix = mydata_sig,
318: #' @return A matrix with the geneset Z scores, e.g. to be plotted with [gs_scoresheat()]
379:   # returns a matrix, rows = genesets, cols = samples
386:   gss_mat <- matrix(NA, nrow = nrow(res_enrich), ncol = ncol(se))
408: #' Plots a matrix of geneset scores
410: #' Plots a matrix of geneset Z scores, across all samples
412: #' @param mat A matrix, e.g. returned by the [gs_scores()] function
504:     score_matrix <- score_matrix[row_tree$order, ]
508:     score_matrix <- score_matrix[, col_tree$order]
511:   labels_rows <- factor(rownames(score_matrix),
512:     levels = rev(rownames(score_matrix))
515:   labels_cols <- factor(colnames(score_matrix),
516:     levels = colnames(score_matrix)
523:   scores <- data.frame(as.vector(score_matrix))
382:   rowsd_se <- matrixStats::rowSds(mydata)
IRISFGM:R/CellTypePrediction.R: [ ]
76:         MATRIX <- rep(0, Covered) %o% rep(0, Covered)
48: #' @importFrom igraph as_adjacency_matrix
61:     A <- igraph::as_adjacency_matrix(G, type = "both", attr = "Weight", names = TRUE, sparse = FALSE)  # convert graph into adjacency matrix
87:             MATRIX <- MATRIX + TEMP
89:         MATRIX <- MATRIX/length(CAN_I)
90:         rownames(MATRIX) <- colnames(MATRIX) <- rownames(A)
91:         hc <- hclust(dist(MATRIX))
117: #' @importFrom igraph as_adjacency_matrix
124:     A <- igraph::as_adjacency_matrix(G, type = "both", attr = "Weight", names = TRUE, sparse = FALSE)  # convert graph into adjacency matrix
141: ## Raw is the path to the original expression matrix method should be either 'MCL' or 'SC', and if 'SC', user also need to specify K, the number of
BioNERO:R/consensus_modules.R: [ ]
488:         Matrix = cons_cor, yLabels = yLabels, xLabels = xLabels,
463:     textMatrix <- paste(signif(cons_cor, 2), modtraitsymbol, sep = "")
209:     if(verbose) { message("Calculating adjacency matrix...") }
232:     if(verbose) { message("Calculating topological overlap matrix (TOM)...") }
358: #' @param cex.text Font size for numbers inside matrix. Default: 0.6.
435:     cons_cor <- matrix(NA, nrow(moduleTraitCor[[1]]), ncol(moduleTraitCor[[1]]))
436:     cons_pval <- matrix(NA, nrow(moduleTraitCor[[1]]), ncol(moduleTraitCor[[1]]))
464:     textMatrix[textMatrix == "NANA"] <- "-"
465:     dim(textMatrix) <- dim(moduleTraitCor[[set]])
468:         textMatrix <- t(textMatrix)
491:         textMatrix = textMatrix, setStdMargins = FALSE,
TENxIO:R/TENxFileList-class.R: [ ]
213:     matrix <- grep("matrix.mtx", names(fdata), fixed = TRUE, value = TRUE)
8: #'   1. `matrix.mtx.gz` - the counts matrix
66: #'   1. `matrix.mtx.gz` - the counts matrix
89: #'     "extdata", "pbmc_granulocyte_sorted_3k_ff_bc_ex_matrix.tar.gz",
216:         mat <- datalist[[matrix]]
EpiCompare:R/plot_chromHMM.R: [ ]
85:   matrix <- genomation::heatTargetAnnotation(annotation, 
91:   matrix_melt <- reshape2::melt(matrix)
83:   # obtain matrix
84:   message("Obtaining target annotation matrix.")
88:   label_corrected <- gsub('X', '', colnames(matrix))
89:   colnames(matrix) <- label_corrected # set corrected labels
90:   # convert matrix into molten data frame
92:   colnames(matrix_melt) <- c("Sample", "State", "value")
94:   sorted_label <- unique(stringr::str_sort(matrix_melt$State,
96:   nm <- factor(matrix_melt$State, levels=sorted_label)
97:   matrix_melt$State <- nm
99:   chrHMM_plot <- ggplot2::ggplot(matrix_melt) +
121:                  data=matrix_melt)
M3C:R/clustersim.R: [ ]
37:   matrix = matrix(nrow = n, ncol = 3)
50:   matrix2 <- subset(data.frame(matrix), X3 < r)
108:   final_matrix <- as.matrix(final_df)
13: #' @return A list: containing 1) matrix with simulated data in it
38:   matrix[,1] <- rep(c(1:sqrt(n)),each=sqrt(n))
39:   matrix[,2] <- rep(c(1:sqrt(n)), sqrt(n))
42:   x1 <- (cluster::pam(data.frame(matrix)[,1:2], 1)$medoids)[1]
43:   y1 <- (cluster::pam(data.frame(matrix)[,1:2], 1)$medoids)[2]
45:   x2 <- matrix[,1]
46:   y2 <- matrix[,2]
48:   matrix[,3] <- answer
51:   #plot(matrix2[,1], matrix2[,2])
52:   matrix2[] <- vapply(as.matrix(matrix2), addnoise, numeric(1))
53:   #plot(matrix2[,1], matrix2[,2])
58:   res = matrix(nrow = nrow(matrix2), ncol = n2)
59:   for (i in seq(1,nrow(matrix2),1)){
60:     a <- matrix2[i,1] # get fixed co ordinate1 for entire row
61:     b <- matrix2[i,2] # get fixed co ordinate2 for entire row
72:   scores <- data.frame(pca1$x) # PC score matrix
104:   # convert back to a matrix of data for clustering
112:   jjj <- t(final_matrix[,4:5] %*% t(pca1$rotation[,1:2])) + pca1$center # equation, PCs * eigenvectors = original data
128:   scores <- data.frame(pca1$x) # PC score matrix
MethReg:R/filter_by_quantile.R: [ ]
30:         matrix <- assay(dnam)
129:         matrix <- assay(exp)
186:         matrix <- assay(exp)
6: #' @param dnam DNA methylation matrix or SummarizedExperiment object
19: #' A subset of the original matrix only with the
32:         matrix <- dnam
36:     keep.rows <- which(rowSums(is.na(matrix)) != ncol(matrix))
37:     if(length(keep.rows) < nrow(matrix)){
39:         matrix <- matrix[keep.rows,]
42:     IQR <- calculate_IQR(matrix)
55:     matrix <- matrix[diff.regions,,drop = FALSE]
58:         dnam <- dnam[rownames(matrix),]
59:         assay(dnam) <- matrix
61:         dnam <- matrix
69: #'   matrix(nrow = 1,dimnames = list(c("row1"), LETTERS[1:10])) %>%
72: calculate_IQR <- function(matrix){
75:         "ID" = rownames(matrix),
76:         "IQR" = matrixStats::rowIQRs(matrix, na.rm = TRUE)
83: #'   matrix(nrow = 1,dimnames = list(c("row1"), LETTERS[1:10])) %>%
87:     matrix, 
93:     plyr::adply(.data = matrix,.margins = 1,.fun = function(row){
106: #' @param exp Gene expression matrix or SumarizedExperiment object
120: #' A subset of the original matrix only with the rows passing
131:         matrix <- exp
136:     diff.genes <- plyr::adply(matrix,.margins = 1,.fun = function(row){
170: #' @param exp Gene expression matrix or SumarizedExperiment object
178: #' @return A subset of the original matrix only with the rows
188:         matrix <- exp
191:     na.or.zeros <- matrix == 0 | is.na(matrix)
192:     percent.na.or.zeros <- rowSums(na.or.zeros) / ncol(matrix)
195:     message("Removing ", nrow(matrix) - length(genes.keep), " out of ", nrow(matrix), " genes")
201: #' @param exp Gene expression matrix or a Summarized Experiment object
209: #' A subset of the original matrix only with the rows
73:     check_package("matrixStats")
UMI4Cats:R/utils.R: [ ]
122:   matrix <- assay(umi4c)
130:   mat_sp <- lapply(ids, function(x) matrix[x,])
155:   dds <- DESeq2::DESeqDataSetFromMatrix(
motifmatchr:src/MOODS/scanner.h: [ ]
16:         std::size_t matrix;
37:         void set_motifs(const std::vector<score_matrix>& matrices,
R4RNA:R/io.R: [ ]
86:     matrix <- data.frame(matrix(unlist(cells), ncol = 3, byrow = TRUE))    
87:     i <- as.integer(as.character(matrix[, 1]))
88:     j <- as.integer(as.character(matrix[, 3]))
90:     seq <- paste(matrix[1:width, 2], collapse = "")
psichomics:inst/shiny/www/jquery.textcomplete.min.js: [ ]
2: ...(299 bytes skipped)... strict";var b=function(a){console.warn&&console.warn(a)},c=1;a.fn.textcomplete=function(d,e){var f=Array...(1127 bytes skipped)...efined"==typeof CKEDITOR||!this.$el.is("textarea")||CKEDITOR.on("instanceReady",function(b){-1==a.inArray...(172 bytes skipped)...n.ckeditor_instance=b.editor,g.initialize()}))})}}var c=function(a){var b,c;return function(){var d=Array...(1559 bytes skipped)...,this._search.apply(this,c)}else this._term=null,this.dropdown.deactivate()},fire:function(a){var b=Array.prototype.slice.call(arguments,1);return this.$el.trigger(a,b),this},register:function(a){Array...(11044 bytes skipped)...aret(),g=this.el.value.substring(this.el.selectionEnd),h=c.replace(b,d);"undefined"!=typeof h&&(a.isArray...(1161 bytes skipped)...romHeadToCaret(),g=this.el.value.substring(f.length),h=c.replace(b,d);if("undefined"!=typeof h){a.isArray...(763 bytes skipped)...r);var i,j=h.toString(),k=j.substring(g.startOffset),l=c.replace(b,d);if("undefined"!=typeof l){a.isArray(l)&&(k=l[1]+k,l=l[0]),i=a.isFunction(c.match)?c.match(e):c.match,e=e.replace(i,l).replace(/ $/,"&nb...(3253 bytes skipped)...