andreyshabalin / MatrixEQTL

Matrix eQTL: Ultra fast eQTL analysis via large matrix operations
58 stars 17 forks source link

Preventing imputation of missing snps? #26

Closed julianalbers closed 1 year ago

julianalbers commented 1 year ago

Thanks for the great package!

I would like to run MatrixEQTL on only samples that are heterozygous for the respective snp of interest. For this I input a vcf file in which all homozygous snps are marked as missing values. However, since Matrix_eQTL_main() uses SetNanRowMean() to impute missing values during the preprocessing of the snps file this approach doesn't really work.

Is there any way to prevent the imputation of missing snp values in the vcf file or to make MatrixEQTL selectively only compare heterozygous samples for each snp-gene combination tested? Thanks for your help!

andreyshabalin commented 1 year ago

I think you should just exclude SNPs you are not interested in, not set them to missing values.

julianalbers commented 1 year ago

Thank you for your quick response! Sorry for making this not clearer in my first comment. I am working with allelic counts and would like to compare the effects of phased SNPs on the expression of the individual alleles in heterozygous cells.

That's why the relevant donors change for every SNP that's assessed the relevant donors change. I tried to make MatrixEQTL only recognize the heterozygous donors for a given SNP, by setting the vcf file for all other homozygous donors to ./. for this specific SNP.

However, this approach did not work since Matrixeqtl seems to have imputed the missing genotypes. Do you have any suggestion how I could prevent the imputation of missing genotype data? Do you see any other way I could make MatrixEQTL only take heterozygous samples into consideration?

andreyshabalin commented 1 year ago

If you want to vary the set of samples across SNPs, I'm sorry to say, Matrix eQTL is not the tool for you. Matrix eQTL approach for fast calculations requires the data to NOT have any missing values.

julianalbers commented 1 year ago

OK, thank you for your help!