Skip to content

Commit

Permalink
fix d-loop again
Browse files Browse the repository at this point in the history
  • Loading branch information
wpwupingwp committed Oct 4, 2024
1 parent b337c3b commit afe0d5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/OGU/gb2fasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,7 @@ def careful_extract(name, feature, whole_seq):
log.debug('The fragment of {} (Accession {}) '
'is too long. Skip.'.format(name, seq_info[1]))
continue
filename = arg._divide / (feature.type.replace('D-loop', 'D_loop')+
'-'+name+'.fasta')
filename = arg._divide / (feature.type + '-'+name+'.fasta')
with open(filename, 'a', encoding='utf-8') as handle:
sequence_id = '>' + '|'.join([name, *seq_info, feature.type])
sequence = careful_extract(name, feature, whole_seq)
Expand Down
6 changes: 5 additions & 1 deletion src/OGU/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ def init_arg(arg):


def get_name(old):
if old.lower().startswith('d-loop'):
return '-'.join(old.split('-')[2:])
return '-'.join(old.split('-')[1:])


def get_name2(old):
if old.lower().startswith('d-loop'):
return 'D-loop'
return old.split('-')[0]


Expand Down Expand Up @@ -231,7 +235,7 @@ def visualize_main(arg_str=None):
circle_end = circle_start + 360
else:
# - and _ conflicts
features = ('CDS', 'D_loop', 'tRNA', 'rRNA', 'spacer')
features = ('CDS', 'D-loop', 'tRNA', 'rRNA', 'spacer')
feature_colors = '#FFD93D,#999999,#4D96FF,#9D96FF,#6BCB77'.split(',')
circle_start = 0
circle_end = 360
Expand Down

0 comments on commit afe0d5a

Please sign in to comment.