Skip to content

Commit

Permalink
ignore weird RNA genes when reading pangneome file
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanMainguy committed Jul 3, 2024
1 parent 308731d commit 86785a5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ppanggolin/formats/readBinaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,13 @@ def read_rnas(pangenome: Pangenome, table: tables.Table, genedata_dict: Dict[int
for row in tqdm(read_chunks(table, chunk=chunk_size), total=table.nrows, unit="gene", disable=disable_bar):
rna = RNA(row["ID"].decode())
genedata = genedata_dict[row["genedata_id"]]
if genedata.start > genedata.stop:
logging.warning(f"Wrong coordinates in RNA gene {genedata.name}: Start ({genedata.start}) should not be greater than stop ({genedata.stop}). This gene is ignored.")
continue
if genedata.start < 1 or genedata.stop < 1:
logging.warning(f"Wrong coordinates in RNA gene {genedata.name}: Start ({genedata.start}) and stop ({genedata.stop}) should be greater than 0. This gene is ignored.")
continue

rna.fill_annotations(start=genedata.start, stop=genedata.stop, strand=genedata.strand,
gene_type=genedata.gene_type, name=genedata.name,
product=genedata.product)
Expand Down

0 comments on commit 86785a5

Please sign in to comment.