QuantGen / BEDMatrix

A matrix-like wrapper around PLINK .bed files
Other
18 stars 2 forks source link

automatically detect number of markers in .bim file #9

Closed lian0090 closed 8 years ago

lian0090 commented 9 years ago

Hello, Alex, the map file associated with bed file is generally ended with .bim, instead of .map. It might be good to be able to automatically detect number of markers from .bim file also.

Since .bed file is almost always associated with a .bim and .fam file, maybe it is also good being able to create another object that has the phenotype and map information ready in R. (Maybe the same structure as BGData?)

agrueneberg commented 9 years ago

Thanks for the feedback, @lian0090. The number of markers and column names should be determined from a bim file instead of a map file, indeed. I fixed it in 5eb2916fd97cfaded34b3a5f8d7a7d501f522e84.

agrueneberg commented 9 years ago

WRT phenotype and map information, BGData should already support matrices of type BEDMatrix in the @geno slot. The problem is that the object has to be manually constructed and consequently, fam and bim files have to be parsed again. I would like to keep this piece of work really focused on the matrix aspect, but since I'm already parsing the fam and bim files, I think it would be useful to expose the parsed information as an attribute of the matrix, e.g. attr(m, 'pheno')? Let's see what @gdlc has to say.

agrueneberg commented 8 years ago

I'll close this for now, but revisit a better integration with BGData once BEDMatrix has been published.

agrueneberg commented 8 years ago

as.BGData has been added to BGData.