Comments (5)
Another option, instead of manually adding chunks to an existing mmMatrix
, would be to create a whole new one that combines all input parameters of rbind
or cbind
. This would allow for both functions to be easily implemented and for multiple mmMatrix
arguments, and also result in leaner chunking (our main overhead).
from bgdata.
We also have to decide whether to get the current storage location of an mmMatrix
via an attribute of the mmMatrix
(which impacts portability as we cannot always guarantee accuracy of that value since an mmMatrix
can be loaded directly using load
) or as a separate parameter (which would be unusual for an *bind
method).
from bgdata.
Looks like additional parameters can be added to the *bind
methods. vmode
, folderOut
, nChunks
, and dimorder
would be nice.
from bgdata.
Here's an initial draft for rbind
for rmmMatrix
:
rbind.rmmMatrix<-function(...,vmode='byte',folderOut=NULL,nChunks=NULL,dimorder=c(2,1),deparse.level=1){
allargs<-list(...)
alldims<-unique(sapply(allargs,function(arg){
dims<-dim(arg)
if(is.null(dims)){
c(1, length(arg))
}else{
dims
}
}))
numcols<-unique(alldims[2,])
if(length(numcols)>1){
stop('all params need the same number of columns')
}
numrows<-sum(alldims[1,])
mmmatrix<-rmmMatrix(nrow=numrows,ncol=numcols,vmode=vmode,folderOut=folderOut,nChunks=nChunks,dimorder=dimorder)
currow<-1
for(arg in 1:ncol(alldims)){
argrows<-alldims[1,arg]
for(argrow in 1:argrows){
if(argrows>1){
mmmatrix[currow,]<-allargs[[arg]][argrow,]
}else{
mmmatrix[currow,]<-allargs[[arg]]
}
currow<-currow+1
}
}
mmmatrix
}
Let me know what you think. In the meantime I will time it out for larger matrices. There is are some possible performance improvements when copying more than one row at the same time.
from bgdata.
I'll reopen this in the LinkedMatrix repository.
from bgdata.
Related Issues (20)
- getG.symDMatrix: Support minVar
- Try to improve error handling for mclapply calls
- GWAS: Check for columns with too many NAs / with zero variance HOT 1
- getG: Check for constant columns HOT 1
- getG.symDMatrix: blockSize does not use all individuals HOT 1
- Support LinkedMatrix in as.BGData
- Check if i and j != integer() HOT 1
- Allow transformations during getG HOT 1
- Consider covariate files in as.BGData HOT 1
- use gpuR HOT 1
- Error in .local(.Object, ...) : No such device HOT 6
- Fix signature of rayOLS
- Add Y parameter to getG HOT 1
- Add colnames in GWAS.lsfit result
- GWAS: attempt to set 'colnames' on an object with less than two dimensions HOT 5
- write.plink? HOT 4
- getG imputes by 0 if center = FALSE HOT 1
- BEDmatrix conversion to data frame HOT 1
- Problem with j in getG HOT 2
- 'mc.cores' > 1 is not supported on Windows HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bgdata.