HannahVMeyer / PhenotypeSimulator

Other
28 stars 7 forks source link

help with picking up causal chromosome at random #11

Closed mahideel closed 5 years ago

mahideel commented 5 years ago

Hi Hannah,

Is there any maximum number of NrCausalChr that PhenotypeSimulator can take? For my simulation, I need to compare different sizes of causal SNPs and causal chromosomes, and ideally the causal SNPs would be picked up arbitrarily from the causal chromosomes without me specifying which chromosomes to draw them from. Is this even possible?

This is my command: trial1strong <- runSimulation(N=2000, P=1, genoFilePrefix = genoFilePrefix, genoFileSuffix = genoFileSuffix, genoDelimiter=" ", cNrSNP = 10, NrChrCausal = 10, distBetaGenetic = "norm", mBetaGenetic = 1, sdBetaGenetic = 0.99, genVar = 0.1, h2b = 0, theta = 0, phi=1, pIndependentGenetic=1, verbose=TRUE, sampleID="id1", format="oxgen") Set seed: 219453

And this is the error: Error in getCausalSNPs(N = N, NrCausalSNPs = cNrSNP, chr = chr, NrChrCausal = NrChrCausal, : Sample number specified exceeds number of genotypes provided

Any idea on what does " Sample number specified exceeds number of genotypes provided" refer to? My sample is 2000 and I have 350,000 SNPs. Any help is much appreciated.

Many thanks in advance. Novia

HannahVMeyer commented 5 years ago

Hi Novia,

it looks like the number of samples, ie individuals that you want to simulate data for, the N in getCausalSNPs exceeds the number of individuals in your genotype file specified by genoFilePrefix-genoFileSuffix.

Can you check if that is the case?

HannahVMeyer commented 5 years ago

Hi Novia,

I also just realised, that the question you were asking, was not related to the error you were seeing. You specified the randomly chosen number of causal chromosomes and SNPs correctly with specifying NrChrCausal and cNrSNP.

Let me know if you need further clarification.

mahideel commented 5 years ago

Hi Hannah,

Thanks for your reply. To clarify, you think there's a mismatch in my command and the genotype file? It's been awhile so I'll go back and check.

HannahVMeyer commented 5 years ago

Yes, you are asking for 2000 samples to be simulated from your genotype data, but you only have 1000 samples in the genotype file.

mahideel commented 5 years ago

Ah I see. I will go back and check. I thought my genotype file has 2000 samples - hence me baffled why the error kept popping up. Many thanks again for your help.

HannahVMeyer commented 5 years ago

I am closing this now, let me know if you have additional questions about this.