This is a test version of Biostars. For the public version, visit https://www.biostars.org.
tensorQTL AssertionError

Hello everyone,

I am trying to run a meQTL analysis with tensorQTL. I prepared all necessary input files, but when I run tensorqtl.cis.map_cis( genotype_df, phenotype_df, phenotype_pos_df, covariates_df, variant_df )

I get the following AssertionError:

AssertionError Traceback (most recent call last) Cell In[103], line 2 1 #Testrun tensorQTL ----> 2 tensorqtl.cis.map_cis( 3 genotype_df, 4 phenotype_df, 5 phenotype_pos_df, 6 covariates_df, 7 variant_df 8 )

File ~/.conda/envs/mqtl_env/lib/python3.11/site-packages/tensorqtl/cis.py:645, in map_cis(genotype_df, variant_df, phenotype_df, phenotype_pos_df, covariates_df, group_s, paired_covariate_df, maf_threshold, beta_approx, nperm, window, random_tiebreak, logger, seed, logp, verbose, warn_monomorphic) 643 group_dict = group_s.to_dict() 644 if covariates_df is not None: --> 645 assert covariates_df.index.equals(phenotype_df.columns), 'Sample names in phenotype matrix columns and covariate matrix rows do not match!' 646 assert ~(covariates_df.isnull().any().any()), f'Missing or null values in covariates matrix, in columns {",".join(covariates_df.columns[covariates_df.isnull().any(axis=0)].astype(str))}' 647 logger.write(f' * {covariates_df.shape[1]} covariates')

AssertionError: Sample names in phenotype matrix columns and covariate matrix rows do not match!

However, I know that both are in the right order and have matching names and when I do covariates_df.index.equals(phenotype_df.columns) it gives out TRUE.

I am confused why this happens and wanted to reach out to hear, if anybody had same difficulties or knows how to solve this error.

Best regards

tensorqtl eqtl meqtl

you can actually try editing ~/.conda/envs/mqtl_env/lib/python3.11/site-packages/tensorqtl/cis.py and adding some additional debugging statements and force the assertion actually print out the columns to see why it thinks they differ

0 answers

No answers yet.

Log in to answer this question.