-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data file format #519
Comments
You're right, documentation could probably be better on this. Is this helping? |
The links you have provided help but not much. You need to understand that most users of your software (like me) are not R experts. Therefore, the instructions should be as simple as possible. Otherwise, I have to spend days or weeks trying to figure out how to use your software.
Specifically, you give three examples:
X <- FBM(10, 10, type = "raw")
X[] <- sample(as.raw(0:3), size = length(X), replace = TRUE)
X[]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 03 00 01 02 01 02 03 01 03 03
#> [2,] 01 03 00 01 00 03 01 02 01 03
#> [3,] 01 03 00 00 01 01 03 00 01 03
#> [4,] 03 01 02 02 03 00 01 00 00 02
#> [5,] 03 01 02 03 00 01 00 00 02 00
#> [6,] 01 03 03 01 03 02 00 00 02 03
#> [7,] 01 01 02 02 00 01 00 02 00 02
#> [8,] 02 00 01 00 03 03 02 00 02 00
#> [9,] 03 00 01 00 00 01 03 01 00 01
#> [10,] 00 00 02 03 00 01 02 00 03 02
# From an FBM of type 'raw' ('unsigned char')
code <- rep(NA_real_, 256)
code[1:3] <- c(1, 3, 5)
X.code <- add_code256(X, code)
X.code[]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] NA 1 3 5 3 5 NA 3 NA NA
#> [2,] 3 NA 1 3 1 NA 3 5 3 NA
#> [3,] 3 NA 1 1 3 3 NA 1 3 NA
#> [4,] NA 3 5 5 NA 1 3 1 1 5
#> [5,] NA 3 5 NA 1 3 1 1 5 1
#> [6,] 3 NA NA 3 NA 5 1 1 5 NA
#> [7,] 3 3 5 5 1 3 1 5 1 5
#> [8,] 5 1 3 1 NA NA 5 1 5 1
#> [9,] NA 1 3 1 1 3 NA 3 1 3
#> [10,] 1 1 5 NA 1 3 5 1 NA 5
# Or directly
X.code2 <- FBM.code256(10, 10, code, init = sample(as.raw(0:3), 100, TRUE))
X.code2[]
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> [1,] 1 3 3 NA 3 5 1 NA 5 3
#> [2,] 5 5 3 NA 3 NA 5 5 1 NA
#> [3,] 1 NA 1 1 NA NA 3 1 1 3
#> [4,] 5 NA 1 5 1 5 1 1 3 1
#> [5,] 5 1 3 NA NA 1 3 5 5 3
#> [6,] 5 5 NA NA 1 1 5 5 5 NA
#> [7,] 3 1 1 NA NA 3 3 1 5 1
#> [8,] NA 3 NA 1 NA 1 1 NA 3 NA
#> [9,] 3 NA NA 3 5 3 5 NA 3 5
#> [10,] NA NA 1 5 3 NA NA 3 1 3
# Get a new FBM.code256 object with another code (but same underlying data)
X.code3 <- X.code$copy(code = rnorm(256))
all.equal(X.code$code256, code)
#> [1] TRUE
Which one should be used in what case? What are the values [1,], [2,], and [,1], [,2], etc.? What are these codes: X.code2 <- FBM.code256(10, 10, code, init = sample(as.raw(0:3), 100, TRUE))
X.code2[]? Should they be included in the data file? More questions than answers.]
I have a data file like this:
Sample (Male/Female/Unknown) rs12608932 rs302668
HG01879 (M) A A T C
HG01880 (F) C C T C
HG01882 (M) C A T T
HG01883 (F) A C T C
HG01885 (M) A A T T
HG01886 (F) C A T T
HG01889 (F) A C T T
HG01890 (M) C A T T
How can I transform it into a the data file format for your software? What else is needed for the analysis?
Best,
Volodymyr
|
The packages are made for people that want to do most of their genetic analyses within R; usually people with some experience in R. With such data format that you have (does it have a name ?), usually you can use PLINK to convert to bed/bim/fam, and then use |
Dear Florian,
I am trying to use your bigsnpr package for R but I puzzled with the data format. Could you explain it for dummy and give respective examples?
Thank you.
Best,
Volodymyr
The text was updated successfully, but these errors were encountered: