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

version 2.3 error #15

Open
gengbaobao opened this issue Oct 23, 2023 · 1 comment
Open

version 2.3 error #15

gengbaobao opened this issue Oct 23, 2023 · 1 comment

Comments

@gengbaobao
Copy link

Hello developer

When I run seq2hla.py version 2.3, I get this error:

Traceback (most recent call last):
File "/home/gbb/tools/seq2HLA-master/seq2HLA.py", line 791, in
main()
File "/home/gbb/tools/seq2HLA-master/seq2HLA.py", line 786, in main
pipe.run()
File "/home/gbb/tools/seq2HLA-master/seq2HLA.py", line 140, in run
self.call_HLA(
File "/home/gbb/tools/seq2HLA-master/seq2HLA.py", line 252, in call_HLA
self.expression(locus_list, length_dict, map, run_name)
File "/home/gbb/tools/seq2HLA-master/seq2HLA.py", line 694, in expression
totalreads = float(linecache.getline(logfile, 1).split(':')[1])
IndexError: list index out of range

@powerinformatics
Copy link

Reason

Here is an extral first line exists in the .bowtielog file.
The code 'totalreads = ...' want to extract the reads number from the 1st line in logfile.
But actually the 1st line is a warning messages, the wanted numbers were export to 2nd line. See example here #1 (comment)

Solution

modify codes related to this issue in seq2HLA.py.

Way 1 - inhibit warning messages (recommanded).

If you are familiar with bowtie, located "mapping_cmd = ..." lines (should be at line372/374/376), then add '-x ' argument before bowtiebuild.

#mapping_cmd = "(bowtie -3 {} -S {} --al {}.aligned {} -1 {} -2 {} |  awk -F \'\\t\' '$3 != \"*\"{{ print $0 }}' > {}) 2> {}.bowtielog".format(self.trim3, mapopt, run_name, bowtiebuild, fq1, fq2, sam, run_name)
mapping_cmd = "(bowtie -3 {} -S {} --al {}.aligned -x {} -1 {} -2 {} |  awk -F \'\\t\' '$3 != \"*\"{{ print $0 }}' > {}) 2> {}.bowtielog".format(self.trim3, mapopt, run_name, bowtiebuild, fq1, fq2, sam, run_name) #add -x argument

Way 2 - skip warning messages.

Feed correct line number to linecache.getline() function.

#totalreads = float(linecache.getline(logfile, 1).split(':')[1])
totalreads = float(linecache.getline(logfile, 2).split(':')[1]) #load line2

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