Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way i can go around this error? #144

Open
maxozo opened this issue Aug 14, 2024 · 2 comments
Open

Any way i can go around this error? #144

maxozo opened this issue Aug 14, 2024 · 2 comments

Comments

@maxozo
Copy link

maxozo commented Aug 14, 2024

This causes thensorqtl to fail. I have 4 phenotypes, all 4 are dropped as there are no variants in the region that are passing the thresholds predefined. As all of thme are dropped there is nothing left to test and the thread gets stuck.

cis-QTL mapping: nominal associations for all variant-phenotype pairs
  * 1033 samples
  * 4 phenotypes
  * 6 covariates
  * 6100111 variants
  * cis-window: ±1,000,000

  * checking phenotypes: 4/4
    ** dropping 4 phenotypes without variants in cis-window
  * Computing associations
    Mapping chromosome 21
Exception in thread Thread-7:
Traceback (most recent call last):
  File "/home/container_user/conda/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/home/container_user/conda/lib/python3.9/site-packages/tensorqtl/genotypeio.py", line 50, in run
    for item in self.generator:
  File "/home/container_user/conda/lib/python3.9/site-packages/tensorqtl/genotypeio.py", line 489, in generate_data
    chr_offset = offset_dict[chrom]
KeyError: '21'
maxozo added a commit to maxozo/tensorqtl that referenced this issue Aug 16, 2024
As per my issue in broadinstitute#144 i sometimes experience freeze of tensorqtl as there is no variants in a range to test on a particular chromosome. MAF and window dropped all the genes to test on chromosome and because it still loops through it it freezes up. 

Here I define the chromosones to test only based on what actually is there to test.
@maxozo
Copy link
Author

maxozo commented Aug 16, 2024

I resolved it by doing this as per my pull request. master...maxozo:tensorqtl:patch-1
Untill this is merged i have made a copy of genotypeio.py with a patch and i load it from my local files instead of tensorqtl package.

@francois-a
Copy link
Collaborator

e97f4ea should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants