AlexTISYoung / hlmm

Library and command line scripts for fitting heteroskedastic linear mixed models to genetic data. Can be used to perform GWAS for genetic effects on phenotypic variability.
MIT License
17 stars 3 forks source link

Fitting the mixed model #2

Open gnarw opened 5 years ago

gnarw commented 5 years ago

I have plink .bed files (one .bed file for each chromosome) with genotypes for the test SNPs (test_chrN.bed) I have selected 1000 SNPs to use for random effects modeling. The genotypes for these 1000 SNPs are in plink .bed files (one .bed file for each chromosome) (random_chrN.bed). Can I run the mixed model by using: python ../bin/hlmm_chr.py test_chrN.bed --append phenotype.fam test_random --random_gts random_chrN.bed or does the genotype for the random effects need to be all in one .bed file ? If so, could you please suggest how best to do this ?

AlexTISYoung commented 5 years ago

Hi,

You should specify one bed file for random effects per run of the script.

I think this command should work:

python ../bin/hlmm_chr.py test_chrN.bed start_index end_index phenotype.fam test_random --random_gts random_chrN.bed --append

you need to specify the start and end indices in the test bed file you want to fit models for, or specify --whole_chr to fit for all SNPs in the bed file passing MAF and missingness thresholds. Also, the --append flag should be put after positional arguments.

Let me know if you have any further problems.

Thanks,

Alex.

On Mon, 11 Mar 2019 at 14:58, gnarw notifications@github.com wrote:

I have plink .bed files (one .bed file for each chromosome) with genotypes for the test SNPs (test_chrN.bed) I have selected 1000 SNPs to use for random effects modeling. The genotypes for these 1000 SNPs are in plink .bed files (one .bed file for each chromosome) (random_chrN.bed). Can I run the mixed model by using: python ../bin/hlmm_chr.py test_chrN.bed --append phenotype.fam test_random --random_gts random_chrN.bed or does the genotype for the random effects need to be all in one .bed file ? If so, could you please suggest how best to do this ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AlexTISYoung/hlmm/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AGEJeaUpmuhWYWz4NnVPwXkaWGkl9HZbks5vVm8qgaJpZM4boz2u .

gnarw commented 5 years ago

Hi. Thanks for your reply. I have been reading through your paper (Identifying loci affecting trait variability and detecting interactions in genome-wide association studies) and not sure I understand how the random effect SNPs are used. Specifically, I´m trying to understand the section "Analysis of BMI" in the Methods chapter. Could you please confirm If I´m correct or not. When I´m running the hlmm script for SNPs in eg. chr1 should the bed file for the random effects only contain genotypes for chromosomes other than chr1 ? or can the random effect bed file contain SNPs from all chromosomes. Does the script make sure only random effects from loci, other than the tested loci, are included?

Thanks, Gunnar

AlexTISYoung commented 5 years ago

You can do whatever you want with the software. It simply models random effects for the SNPs given by the .bed file specified in the --random_gts option, and it fits additive and log-linear variance effects for the SNPs in the test .bed file.

It is generally good practice to not model random effects for SNPs on the same chromosome as those being tested. This is because linkage disequilibrium (correlations between SNPs due to shared transmission) between the test SNP and a SNP which random effects are modelled for can lead to a reduction in power for the test SNP. To achieve this with the current software, it is necessary to specify separate .bed files for the random effects for each test chromosome. I could update the software to change this, but I have left it up to the user to determine what they want to do for now.

Thanks,

Alex.

On Mon, 11 Mar 2019 at 15:58, gnarw notifications@github.com wrote:

Hi. Thanks for your reply. I have been reading through your paper (Identifying loci affecting trait variability and detecting interactions in genome-wide association studies) and not sure I understand how the random effect SNPs are used. Specifically, I´m trying to understand the section "Analysis of BMI" in the Methods chapter. Could you please confirm If I´m correct or not. When I´m running the hlmm script for SNPs in eg. chr1 should the bed file for the random effects only contain genotypes for chromosomes other than chr1 ? or can the random effect bed file contain SNPs from all chromosomes. Does the script make sure only random effects from loci, other than the tested loci, are included?

Thanks, Gunnar

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AlexTISYoung/hlmm/issues/2#issuecomment-471602502, or mute the thread https://github.com/notifications/unsubscribe-auth/AGEJeZccAl44Uf3In68WHcOZY8iOTaGiks5vVn1BgaJpZM4boz2u .