Skip to content

Commit

Permalink
fix wrong completion calculation in module outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanMainguy committed Oct 12, 2023
1 parent c1ed656 commit 77c3be8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ppanggolin/formats/writeFlat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,8 @@ def write_org_modules(output: Path, compress: bool = False):
for fam in mod.families:
mod_orgs |= set(fam.organisms)
for org in mod_orgs:
completion = round((org.number_of_families() + len(mod)) / len(mod), 2)
fout.write(f"module_{mod.ID}\t{org.name}\t{completion}\n")
completion = len(set(org.families) & set(mod.families)) / len(mod)
fout.write(f"module_{mod.ID}\t{org.name}\t{completion:.2}\n")
fout.close()
logging.getLogger("PPanGGOLiN").info(
f"Done writing modules to organisms associations to: '{output.as_posix() + '/modules_in_organisms.tsv'}'")
Expand Down

0 comments on commit 77c3be8

Please sign in to comment.