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

KeyError in unknownMods(), mmquant.py #9

Closed
uschwartz opened this issue May 21, 2021 · 5 comments
Closed

KeyError in unknownMods(), mmquant.py #9

uschwartz opened this issue May 21, 2021 · 5 comments

Comments

@uschwartz
Copy link

Hi,

I am trying to run mim-tRNAseq and I am ending in an "KeyError:'Homo_sapiens_tRNA-Ala-AGC-2-1'"

This is my code:
mimseq -t $AnnoDir'/'hg19-tRNAs.fa \ -o $AnnoDir'/'hg19-tRNAs.out.nohap \ -m $AnnoDir'/'hg19-mitotRNAs.fa \ --cluster --cluster-id 0.95 \ --threads 15 --min-cov 2000 \ --max-mismatches 0.1 \ --control-condition Input \ -n TD1_IP \ --out-dir $outDir'/02_default_hg19' \ --max-multi 4 --remap --remap-mismatches 0.075 \ $AnalysisDir'/script/mim-trnaseq/normal_Samples.tsv'
I tried to use the provided tRNA annotation of hg19 and GRCh38, but both end up in the same error :

`
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/Users/admin/anaconda3/envs/mimseq/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/Users/admin/anaconda3/envs/mimseq/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/Users/admin/anaconda3/envs/mimseq/lib/python3.7/site-packages/mimseq/mmQuant.py", line 274, in bamMods_mp
new_mods, new_Inosines = unknownMods(inputs, knownTable, cluster_dict, modTable_prop, misinc_thresh, cov_table_newMods, min_cov, tRNA_dict, remap)
File "/Users/admin/anaconda3/envs/mimseq/lib/python3.7/site-packages/mimseq/mmQuant.py", line 73, in unknownMods
if (sum(modTable[isodecoder][pos].values()) >= misinc_thresh and any(cov >= min_cov) and pos-1 not in knownTable[isodecoder]): # misinc above threshold, cov above threshold and not previously known
KeyError: 'Homo_sapiens_tRNA-Ala-AGC-2-1'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/admin/anaconda3/envs/mimseq/bin/mimseq", line 10, in
sys.exit(main())
File "/Users/admin/anaconda3/envs/mimseq/lib/python3.7/site-packages/mimseq/mimseq.py", line 361, in main
args.misinc_thresh, args.mito, args.pretrnas, args.local_mod, args.sampledata)
File "/Users/admin/anaconda3/envs/mimseq/lib/python3.7/site-packages/mimseq/mimseq.py", line 135, in mimseq
new_mods, new_Inosines, filtered_cov, filter_warning = generateModsTable(coverageData, out, name, threads, min_cov, mismatch_dict, insert_dict, del_dict, cluster_dict, cca, remap, misinc_thresh, new_mod_lists, Inosine_lists, newtRNA_dict, Inosine_clusters, unique_isodecoderMMs, newSplitBool, isodecoder_sizes, cluster)
File "/Users/admin/anaconda3/envs/mimseq/lib/python3.7/site-packages/mimseq/mmQuant.py", line 598, in generateModsTable
new_mods, new_Inosines = zip(*pool.map(func, bamlist))
File "/Users/admin/anaconda3/envs/mimseq/lib/python3.7/multiprocessing/pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/Users/admin/anaconda3/envs/mimseq/lib/python3.7/multiprocessing/pool.py", line 657, in get
raise self._value
KeyError: 'Homo_sapiens_tRNA-Ala-AGC-2-1'
`
Thanks for helping

Uwe

@uschwartz
Copy link
Author

If I set the option--misinc-thresh 1, I can bypass the error.

is there another way to solve this issue, without changing '--misinc-thresh '?

can anybody explain why this error is thrown and what it exactly means?

Thanks!

@drewjbeh
Copy link
Collaborator

Hi Uwe,

First of all, could you tell me which version of mimseq you are using by typing mimseq --version?

The problem seems to be coming from new mods detection where a non-existent entry for a tRNA (Homo_sapiens_tRNA-Ala-AGC-2-1) is being looked up but does not exist. We've had similar issues in the past, and I've worked to solve them. Unfortunately, with new data such as yours, some new specific cases can arise. I would be happy to try fix this bug but I would need to be able to recreate the error. This means having access to the sequencing data you are using as input (or at least a subset of this which would hopefully be enough to recreate the issue).
If you are ok with sharing the data so that I can take a look, then let me know and we can set this up.

@uschwartz
Copy link
Author

Hi Drew,

thanks for the response. I was running version: mimseq 0.3.4.1
I decided to disable the new mods detection and not going the remapping step. Then it worked out. I am happy with the results so far and I think the detection of new mods is not necessarily required in our project. Unfortunately, at this step of the project I cannot share our data.

@drewjbeh drewjbeh changed the title misinc above threshold, cov above threshold and not previously known KeyError in unknownMods(), mmquant.py Jun 22, 2021
@drewjbeh
Copy link
Collaborator

Hi @uschwartz,
I recently ran into the same error as above while testing and have solved the issue. I have released the new version which also has some other updates (https://github.com/nedialkova-lab/mim-tRNAseq/releases/tag/v0.3.4.2). This should be available on bioconda in the next day or two.
It would be great if you could upgrade to v0.3.4.2 when possible, and retest your above run with new mods detection and remap and let me know if it works! This would be super useful.

@uschwartz
Copy link
Author

Hi Drew,

Sounds great! I will upgrade mimseq and test it. As soon as I have the results I will let you know

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