Skip to content
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

getCausalSNPs from oxgen format #9

Closed
blairzhang126 opened this issue Dec 16, 2018 · 11 comments
Closed

getCausalSNPs from oxgen format #9

blairzhang126 opened this issue Dec 16, 2018 · 11 comments
Assignees
Labels
bug

Comments

@blairzhang126
Copy link

@blairzhang126 blairzhang126 commented Dec 16, 2018

I have trouble to get this function work for oxgen format. My command is:

"causalSNPs <- getCausalSNPs(N=6000, NrCausalSNPs=10, chr=22,genoFilePrefix="geno_case_", genoFileSuffix=".gen", format="oxgen", NrSNPsOnChromosome=119317)"

The error message I got is "Error in .rowNamesDF<-(x, value = value) : invalid 'row.names' length".
My guess is that if I use suffix as ".gen" it cannot read ".sample" file so that the row.names is invalid. However, I cannot proceed without suffix flag. Any idea?

Any feedback would be greatly appreciated.

Thanks so much Hannah.
-Blair

@HannahVMeyer
Copy link
Owner

@HannahVMeyer HannahVMeyer commented Dec 17, 2018

Hi Blair,

at the step that I suspect it is failing, the sample IDs (contained in the .sample) file are not needed yet, so this won't be the issue.

Can you paste the first 10 columns and lines of the file that is failing ie from geno_case_chr22.gen?

@HannahVMeyer HannahVMeyer self-assigned this Dec 17, 2018
@HannahVMeyer HannahVMeyer added the bug label Dec 17, 2018
@blairzhang126
Copy link
Author

@blairzhang126 blairzhang126 commented Dec 17, 2018

Thank you so much for the quick reply Hannah.

My first few lines look like this (I added "22-" after it's not working on the original hapgen2 output):
22-snp_0 rs62224609 14431249 T C 1 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 0 0 1 0 0
22-snp_1 rs11089130 14431347 G C 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0
22-snp_2 rs11089134 14431497 A G 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0
22-snp_3 rs2096600 14431968 C A 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0
22-snp_4 rs9604696 14431994 C T 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0
22-snp_5 rs4965031 14432080 G A 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0
22-snp_6 rs2843214 14432239 A G 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0
22-snp_7 rs4965018 14432361 A G 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0
22-snp_8 rs2078643 14432513 G C 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0
22-snp_9 rs738829 14432618 G A 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1

@blairzhang126
Copy link
Author

@blairzhang126 blairzhang126 commented Dec 17, 2018

I got it working when I transform my file format into the space-delimited format and follow the example you gave for .csv file. So don't worry about it if it requires a lot of time and work to get it working on oxgen format if I'm the only person who got this error. Thanks again for your help Hannah. Feel free to keep me posted on any thing related to this.

@HannahVMeyer
Copy link
Owner

@HannahVMeyer HannahVMeyer commented Dec 17, 2018

I've just made changes in the develop branch. Could you check if it works after you do:
devtools::install_github('HannahVMeyer/PhenotypeSimulator', ref='dev’)

Thanks

@blairzhang126
Copy link
Author

@blairzhang126 blairzhang126 commented Dec 17, 2018

Hi Hannah, I got an error: "Error in getCausalSNPs(N = 100, NrCausalSNPs = 10, chr = 22, genoFilePrefix = "test_time_", :
object 'samples' not found".

@blairzhang126
Copy link
Author

@blairzhang126 blairzhang126 commented Dec 17, 2018

My script: "causalSNPs <- getCausalSNPs(N=100, NrCausalSNPs=10, chr=22,genoFilePrefix="test_time_", genoFileSuffix="_100_out.controls.gen",NrSNPsOnChromosome = 119316, format="oxgen")"

@mahideel
Copy link

@mahideel mahideel commented Jan 16, 2019

Hi Hannah and Blair,

I got a similar error when running runSimulation.

My script:
sim <- runSimulation(N=2000, P=1, chr = c(1,3,5), genoFilePrefix = genoFilePrefix, genoFileSuffix = genoFileSuffix, genoDelimiter=" ", cNrSNP = 5, distBetaGenetic = "norm", mBetaGenetic = 1.00, sdBetaGenetic = 0.99, genVar = 0.1, h2b = 0, theta = 0, phi=1, pIndependentGenetic=1, verbose=TRUE, sampleID="id1_", format="oxgen")

Error I get:
Error in row.names<-.data.frame(*tmp*, value = value) :
invalid 'row.names' length

When I did the debugging, it seemed like the error came from this function:
rownames(causalSNPsChr) <- paste(causalSNPsChr[, 1:5],
collapse = "-")

Any help is greatly appreciated.

Kind regards,
Novia

@mahideel
Copy link

@mahideel mahideel commented Jan 16, 2019

PS. This error never happened in the past. Last time I ran PhenotypeSimulator was in mid-Dec 2018 (can't remember the date exactly).

@HannahVMeyer
Copy link
Owner

@HannahVMeyer HannahVMeyer commented Jan 22, 2019

Apologies for the late reply - I will look into it this week. Thanks

@HannahVMeyer
Copy link
Owner

@HannahVMeyer HannahVMeyer commented Mar 17, 2019

This fixed now on github version 0.3.2. I will keep the issue open until this has been updated on CRAN.

@HannahVMeyer
Copy link
Owner

@HannahVMeyer HannahVMeyer commented May 15, 2019

Latest release including this fix on CRAN (v0.3.3), closing this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.