Skip to content

Commit

Permalink
remove smiles from BGC and AntismashBGCLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
CunliangGeng committed Dec 6, 2024
1 parent 752655c commit 47d60db
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
8 changes: 0 additions & 8 deletions src/nplinker/genomics/antismash/antismash_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def parse_bgc_genbank(file: str | PathLike) -> BGC:
bgc.antismash_id = antismash_id
bgc.antismash_file = str(file)
bgc.antismash_region = features.get("region_number")
bgc.smiles = features.get("smiles")
bgc.strain = Strain(fname)
return bgc

Expand All @@ -154,11 +153,4 @@ def _parse_antismash_genbank(record: SeqRecord.SeqRecord) -> dict:
# biopython assumes region numer is a list, but it's actually an int
features["region_number"] = feature.qualifiers.get("region_number")[0]
features["product"] = feature.qualifiers.get("product")
if feature.type == "cand_cluster":
smiles = feature.qualifiers.get("SMILES")
# space is not allowed in SMILES spec
# biopython generates space when reading multi-line SMILES from .gbk
if smiles is not None:
smiles = tuple(i.replace(" ", "") for i in smiles)
features["smiles"] = smiles
return features
4 changes: 0 additions & 4 deletions src/nplinker/genomics/bgc.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ class BGC:
see [the paper](https://doi.org/10.1186/s40793-018-0318-y).
description: Brief description of the BGC.
Defaults to None.
smiles: A tuple of SMILES formulas of the BGC's
products.
Defaults to None.
antismash_file: The path to the antiSMASH GenBank file.
Defaults to None.
antismash_id: Identifier of the antiSMASH BGC, referring
Expand Down Expand Up @@ -80,7 +77,6 @@ def __init__(self, id: str, /, *product_prediction: str):

self.mibig_bgc_class: tuple[str] | None = None
self.description: str | None = None
self.smiles: tuple[str] | None = None

# antismash related attributes
self.antismash_file: str | None = None
Expand Down
1 change: 0 additions & 1 deletion tests/unit/genomics/test_antismash_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def test_parse_bgc_genbank():
assert bgc.antismash_id == "NZ_AZWB01000005"
assert bgc.antismash_file == gbk_file
assert bgc.antismash_region == "1"
assert bgc.smiles == ("NC([*])C(=O)NC([*])C(=O)NC(CO)C(=O)NC(Cc1ccccc1)C(=O)NCC(=O)O",)


def test_parse_bgc_genbank_error():
Expand Down

0 comments on commit 47d60db

Please sign in to comment.