Skip to content

Commit

Permalink
Merge pull request #310 from Ensembl/mbarba/disha_extract_genbank
Browse files Browse the repository at this point in the history
Format outside record loop
  • Loading branch information
Dishalodha authored Mar 6, 2024
2 parents 4e97de2 + bb5f5ed commit 1cb6fe5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/python/ensembl/io/genomio/genbank/extract_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def __init__(

def parse_genbank(self, gb_file: PathLike) -> None:
"""
Load a sequence from a Genbank file
Load records metadata from a Genbank file
Args:
gb_file: Path to downloaded genbank file
Expand All @@ -121,10 +121,11 @@ def parse_genbank(self, gb_file: PathLike) -> None:
if record.id in organella:
record.organelle = organella[record.id]
self.seq_records.append(record)
if len(self.seq_records) >= 1:
self.format_write_record()
else:
logging.warning("No records are found in gb_file")

if len(self.seq_records) >= 1:
self.format_write_record()
else:
logging.warning("No records are found in gb_file")

def format_write_record(self) -> None:
"""
Expand Down

0 comments on commit 1cb6fe5

Please sign in to comment.