Open gengbaobao opened 10 months ago
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 https://github.com/TRON-Bioinformatics/seq2HLA/issues/1#issuecomment-847477646
modify codes related to this issue in seq2HLA.py.
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
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
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