Closed ddpinto closed 1 year ago
Hi, Which version of tensorQTL are you running? Can you try running the version from the master branch? This should in principle fix the error, which is unrelated to the warnings.
Since you're getting many warnings related to monomorphic variants, you should filter your VCF before running QTL mapping (depending on sample size, inclusion of variants with MAF < 0.01 will likely result in artifacts), or apply in-sample MAF filtering with the maf_threshold
option.
Hi, After updating to the latest version in the master branch, I'm now seeing the following error in the permutation analysis:
Exception in thread Thread-2:
Traceback (most recent call last):
File "/hpc/packages/minerva-centos7/anaconda3/2021.5/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/hpc/packages/minerva-centos7/anaconda3/2021.5/lib/python3.8/site-packages/tensorqtl/genotypeio.py", line 40, in run
for item in self.generator:
File "/hpc/packages/minerva-centos7/anaconda3/2021.5/lib/python3.8/site-packages/tensorqtl/genotypeio.py", line 451, in generate_data
assert np.all([self.cis_ranges[g.index[0]][0] == self.cis_ranges[i][0] and self.cis_ranges[g.index[0]][1] == self.cis_ranges[i][1] for i in g.index[1:]])
AssertionError
Any ideas what may be causing this error?
Hello, After some more troubleshooting I solved the KeyError problem on my end. Instead of subsetting directly on the pd dataframe it had to be converted to a numpy array first. The following patch worked for me:
index bc1b062..133f640 100644
--- a/tensorqtl/post.py
+++ b/tensorqtl/post.py
@@ -51,9 +51,9 @@ def calculate_qvalues(res_df, fdr=0.05, qvalue_lambda=None, logger=None):
ub = res_df.loc[res_df['qval']>fdr, 'pval_beta'].sort_values()
if lb.shape[0] > 0: # significant phenotypes
- lb = lb[-1]
+ lb = lb.to_numpy()[-1]
if ub.shape[0] > 0:
- ub = ub[0]
+ ub = ub.to_numpy()[0]
pthreshold = (lb+ub)/2
else:
pthreshold = lb
I wasn't able to reproduce this. Please specify versions if this is still an issue.
Hello, With an sQTL dataset of ~260k phenotypes and ~8M variants we are running into convergence issues during calculations of cis-permutations. The permutations appear to run and yield a count of QTL phenotypes @ FDR 0.05 in the log files, but no final output is written. The logs contain ~5k messages of "WARNING: excluding # monomorphic variants" and about 14k warnings of "WARNING: scipy.optimize.newton failed to converge (running scipy.optimize.minimize)". The job dies with the following error message. Any ideas how to resolve this issue?