From ac770945600fbd1a3f9017795e3047078ea6388e Mon Sep 17 00:00:00 2001 From: axbazin Date: Sun, 3 Sep 2023 14:03:02 +0200 Subject: [PATCH] check that RGP exists before getting its spot in --projection --- ppanggolin/formats/writeFlat.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ppanggolin/formats/writeFlat.py b/ppanggolin/formats/writeFlat.py index e6918028..e12eee5a 100644 --- a/ppanggolin/formats/writeFlat.py +++ b/ppanggolin/formats/writeFlat.py @@ -592,10 +592,10 @@ def write_org_file(org: Organism, output: str, compress: bool = False): if gene.RGP is not None: rgp = gene.RGP.name row.append(rgp) - if needSpots: - if gene.RGP.spot is not None: - spot = gene.RGP.spot.ID - row.append(spot) + if needSpots: + if gene.RGP is not None and gene.RGP.spot is not None: + spot = gene.RGP.spot.ID + row.append(spot) if needModules: if len(gene.family.modules) > 0: modules = ','.join(["module_" + str(module.ID) for module in gene.family.modules])