Skip to content

Commit

Permalink
Avoid type mismatch for reusing variables in genetics.py
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Oct 10, 2024
1 parent 3cd1e7b commit 8f6610f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/galaxy/datatypes/genetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,16 +863,16 @@ def set_meta(self, dataset: DatasetProtocol, overwrite: bool = True, **kwd) -> N
pp = os.path.join(dataset.extra_files_path, pn)
dataset.metadata.pheno_path = pp
try:
with open(pp) as f:
pf = f.readlines() # read the basename.phenodata in the extra_files_path
with open(pp) as file:
pf = file.readlines() # read the basename.phenodata in the extra_files_path
except Exception:
pf = None
if pf:
h = pf[0].strip()
h = h.split("\t") # hope is header
h = [escape(x) for x in h]
dataset.metadata.column_names = h
dataset.metadata.columns = len(h)
header = pf[0].strip()
columns = header.split("\t") # hope is header
columns = [escape(x) for x in columns]
dataset.metadata.column_names = columns
dataset.metadata.columns = len(columns)
dataset.peek = "".join(pf[:5])
else:
dataset.metadata.column_names = []
Expand Down

0 comments on commit 8f6610f

Please sign in to comment.