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

error in parallel_reditools.py : ValueError: 'chrKI270748' is not in list #14

Open
Twainsysucc opened this issue Mar 13, 2023 · 0 comments

Comments

@Twainsysucc
Copy link

Traceback (most recent call last):
File "reditools2.0-master/src/cineca/parallel_reditools.py", line 576, in
little_files = sorted(little_files, key = lambda x: (keys.index(x[1]) if x[1] in keys else keys.index("chr"+x[1]), int(x[2])))
File "reditools2.0-master/src/cineca/parallel_reditools.py", line 576, in
little_files = sorted(little_files, key = lambda x: (keys.index(x[1]) if x[1] in keys else keys.index("chr"+x[1]), int(x[2])))
ValueError: 'chrKI270748' is not in list

solution:
line 568 : print(little_file)
line 569 : pieces = re.sub("..", "", os.path.basename(little_file)).split("#")
line 570 : pieces.insert(0, little_file)
line 571 : little_files.append(pieces)
......
line 574 : keys = chromosomes.keys()
the keys is ['chr1', 'chr10', 'chr11','KI270712.1', 'KI270706.1','GL000221.1']
but the little_files is [['test_results/temp/chr1#72347729#75371875.gz', 'chr1', '72347729', '75371875'],['test_results/temp/KI270711.1#4615#37277.gz', 'KI270711'],['test_results/temp/KI270330.1#1306#1455.gz', 'KI270330']]
So it is possible that something went wrong during the name conversion.
I check the line 569 : pieces = re.sub("..
", "", os.path.basename(little_file)).split("#")
The identification character "..*" can remove the '.gz' character, while it also remove the decimal point of a chromosome sequence(KI270711.1--KI270711).
Correct it : pieces = re.sub(r".gz", "", os.path.basename(little_file)).split("#")

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

1 participant