Skip to content

Commit

Permalink
Merge pull request #101 from NAL-i5K/error_fix
Browse files Browse the repository at this point in the history
Modified map fuction
  • Loading branch information
mpoelchau authored Mar 4, 2020
2 parents d6b321b + abbce02 commit 55c244f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gff3tool/bin/gff3_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def script_main():
if line:
try:
lines = line.split("\t")
line_num_list = map(int,re.findall(r'\d+',lines[0]))
line_num_list = list(map(int,re.findall(r'\d+',lines[0])))
if lines[1] not in error_dict:
error_dict[lines[1]] = [line_num_list]
else:
Expand Down
4 changes: 2 additions & 2 deletions gff3tool/lib/gff3_fix/fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def fix_phase(gff3, error_list, line_num_dict, logger):
sorted_CDS_list = sorted(CDS_list, key=lambda x: x['start'])
if sorted_CDS_list[0]['line_index']+1 in error:
if 'Ema0006' in line_num_dict[sorted_CDS_list[0]['line_index']+1]:
phase = map(int,re.findall(r'\d',line_num_dict[sorted_CDS_list[0]['line_index']+1]['Ema0006']))[1]
phase = list(map(int,re.findall(r'\d',line_num_dict[sorted_CDS_list[0]['line_index']+1]['Ema0006']))[1])
else:
try:
phase = sorted_CDS_list[0]['phase']
Expand Down Expand Up @@ -491,7 +491,7 @@ def fix_attributes(gff3, error_list, logger):
for error in error_list:
for line_num in error:
if gff3.lines[line_num-1]['line_status'] != 'removed':
tokens = map(str.strip, gff3.lines[line_num-1]['line_raw'].split('\t'))
tokens = list(map(str.strip, gff3.lines[line_num-1]['line_raw'].split('\t')))
if unescaped_field(tokens[8]):
# don't know how to fix this
pass
Expand Down

0 comments on commit 55c244f

Please sign in to comment.