HannahVMeyer / PhenotypeSimulator

Other
28 stars 7 forks source link

questions abot how to simulate markers effects and phenotype #26

Closed Uljibuh closed 3 years ago

Uljibuh commented 3 years ago

Hi

I am trying to use your package to simulate phenotype and true breeding value from markers effects for one trait in dairy cow. what I want to to is that first simulate the marker effects and add some noise on it then simulate the phenotype in Rstudio(3.6.3) I have ped and map and bim file from plink and genomic relationship of individuals. I read the manual but still quite confused with some parts. (1) which genetic effects function should I use in my case

geneticBgEffects Simulate infinitesimal genetic effects (reflecting sample kinship). or geneticFixedEffects Simulate genetic variant effects ?

(2) if I understood right before using genetic function I have to get casual snps.
in the getCausalSNPs command

getCausalSNPs(N, NrCausalSNPs = 20, genotypes = NULL, chr = NULL, NrSNPsOnChromosome = NULL, NrChrCausal = NULL, genoFilePrefix = NULL, genoFileSuffix = NULL, format = "delim", delimiter = ",", header = FALSE, skipFields = NULL, probabilities = FALSE, sampleID = "ID_", verbose = TRUE)

will genotype be the ped file in my case? also my ped file is not in matrix format, I tried to convert into matrix using read.pedfile function but R fails to convert it , may be bacaise of size of the file. do know other way to do it?

I did to understand (genoFilePrefix), (genoFileSuffix) in the command, what are these file ? should I create these file ?

(3) it would be helpful you can outline the process for me. many many thanks

HannahVMeyer commented 3 years ago

thanks for your interest in PhenotypeSimulator.

1) Do you want individual SNP effects, ie where you will be able to estimate the effect for each variant individually or do you want to simulate only overall genetic effects based on kinship? This does not become clear to me from your question, but given that you have the genomic relationship (Kinship matrix?) you seem to at least wanting to include the latter.

2) You can run all of the simulation steps individually, ie get the causal SNPs, simulate the genetic effects etc, or you can use runSimulation (the main function of the package) to take care of that. Both the step-by-step methods and using runSimulation can be found in this vignette.

I would recommend using PLINK for converting your files into plink binary format ie from ped and map, to bed and fam; specifically, have look at the section Plink text in this link

Uljibuh commented 3 years ago

really appreciate your fast reply,

1, actually, I do not understand the difference between individual snp effects and overall genetic effects, I want to use this formula to estimate the true breeding value, in this case which genetic effects function will be used ? because I also want to predict the genomic estimated breeding value after simulate the phenotype and estimate the correlation between true breeding value and genomic estimated breeding value. ![Screenshot from 2020-11-27 16-41-45](https://user-images.githubusercontent.com/75124556/100465390-8274fa80-30cf-11eb-9c04-6fe773444f07.png)

Uljibuh commented 3 years ago

Screenshot from 2020-11-27 16-41-45

HannahVMeyer commented 3 years ago

I would recommend reading the accompanying paper, which describes the different effect components:

Meyer, HV & Birney E (2018) PhenotypeSimulator: A comprehensive framework for simulating multi-trait, multi-locus genotype to phenotype relationships, Bioinformatics, 34(17):2951–2956

Uljibuh commented 3 years ago

thank you