This commit is contained in:
Michiel de Hoon
2025-02-28 18:10:38 +09:00
committed by Peter Cock
parent 0619a8236d
commit 61be00dfce
5 changed files with 17 additions and 26 deletions

View File

@ -233,13 +233,12 @@ class _BaseGenBankConsumer:
else: else:
tax_info = taxonomy_string tax_info = taxonomy_string
tax_list = tax_info.split(";") tax_list = tax_info.split(";")
new_tax_list = [] return [
for tax_item in tax_list: item.strip()
new_items = tax_item.split("\n") for tax_item in tax_list
new_tax_list.extend(new_items) for item in tax_item.split("\n")
while "" in new_tax_list: if item
new_tax_list.remove("") ]
return [x.strip() for x in new_tax_list]
@staticmethod @staticmethod
def _clean_location(location_string): def _clean_location(location_string):

View File

@ -324,11 +324,11 @@ class Chromosome(_ChromosomeComponent):
self.end_x_position - self.start_x_position - segment_width self.end_x_position - self.start_x_position - segment_width
) )
y_limits = [] y_limits = [
for sub_component in self._sub_components: limit
y_limits.extend( for sub_component in self._sub_components
(sub_component.start_y_position, sub_component.end_y_position) for limit in (sub_component.start_y_position, sub_component.end_y_position)
) ]
y_min = min(y_limits) y_min = min(y_limits)
y_max = max(y_limits) y_max = max(y_limits)
del y_limits del y_limits

View File

@ -593,9 +593,7 @@ class Commandline:
for n in range(len(options)) for n in range(len(options))
if options[n] == "=" and n != 0 and n != len(options) if options[n] == "=" and n != 0 and n != len(options)
] ]
indices = [] indices = [index for sl in valued_indices for index in sl]
for sl in valued_indices:
indices.extend(sl)
token_indices = [n for n in range(len(options)) if n not in indices] token_indices = [n for n in range(len(options)) if n not in indices]
for opt in valued_indices: for opt in valued_indices:
# self.options[options[opt[0]].lower()] = options[opt[2]].lower() # self.options[options[opt[0]].lower()] = options[opt[2]].lower()

View File

@ -1034,11 +1034,8 @@ class IC_Chain:
self.initNCaCs.append(tuple(initNCaC)) self.initNCaCs.append(tuple(initNCaC))
# next residue NCaCKeys so can do per-residue assemble() # next residue NCaCKeys so can do per-residue assemble()
ric.NCaCKey = [] ric.NCaCKey = ric.split_akl(
ric.NCaCKey.extend( (AtomKey(ric, "N"), AtomKey(ric, "CA"), AtomKey(ric, "C"))
ric.split_akl(
(AtomKey(ric, "N"), AtomKey(ric, "CA"), AtomKey(ric, "C"))
)
) )
ric._link_dihedra() ric._link_dihedra()
@ -2709,11 +2706,8 @@ class IC_Residue:
self._build_rak_cache() self._build_rak_cache()
# initialise NCaCKey here: # initialise NCaCKey here:
self.NCaCKey = [] self.NCaCKey = self.split_akl(
self.NCaCKey.extend( (AtomKey(self, "N"), AtomKey(self, "CA"), AtomKey(self, "C"))
self.split_akl(
(AtomKey(self, "N"), AtomKey(self, "CA"), AtomKey(self, "C"))
)
) )
def set_flexible(self) -> None: def set_flexible(self) -> None:

View File

@ -274,7 +274,7 @@ def strict_consensus(trees):
def majority_consensus(trees, cutoff=0): def majority_consensus(trees, cutoff=0):
"""Search majority rule consensus tree from multiple trees. """Search majority rule consensus tree from multiple trees.
This is a extend majority rule method, which means the you can set any This is an extend majority rule method, which means the you can set any
cutoff between 0 ~ 1 instead of 0.5. The default value of cutoff is 0 to cutoff between 0 ~ 1 instead of 0.5. The default value of cutoff is 0 to
create a relaxed binary consensus tree in any condition (as long as one of create a relaxed binary consensus tree in any condition (as long as one of
the provided trees is a binary tree). The branch length of each consensus the provided trees is a binary tree). The branch length of each consensus