Skip to content

BioCracker import error #7

@BTheDragonMaster

Description

@BTheDragonMaster

Installing RetroMol without BioCracker raises an error:

(retromol) barbara@MacBookPro raichu % retromol --help                                         
Traceback (most recent call last):
  File "/opt/anaconda3/envs/retromol/bin/retromol", line 3, in <module>
    from retromol.cli import main
  File "/opt/anaconda3/envs/retromol/lib/python3.10/site-packages/retromol/cli.py", line 24, in <module>
    from retromol.fingerprint.fingerprint import FingerprintGenerator
  File "/opt/anaconda3/envs/retromol/lib/python3.10/site-packages/retromol/fingerprint/fingerprint.py", line 237, in <module>
    class FingerprintGenerator:
  File "/opt/anaconda3/envs/retromol/lib/python3.10/site-packages/retromol/fingerprint/fingerprint.py", line 409, in FingerprintGenerator
    readout: BioCrackerLinearReadout,
NameError: name 'BioCrackerLinearReadout' is not defined
(retromol) barbara@MacBookPro raichu % 

The likely culprit is this try-except clause in fingerprint.py:

try:
    from biocracker.query.modules import (
        LinearReadout as BioCrackerLinearReadout,
        Module,
        NRPSModule,
        PKSModule,
        PKSExtenderUnit,
    )
    _BIOCRACKER = True
except ImportError:
    pass

Followed by the following type-hint:

def fingerprint_from_biocracker_readout(
        self,
        readout: BioCrackerLinearReadout,
        by_orf: bool = False,
        num_bits: int = 2048,
        kmer_sizes: list[int] | None = None,
        kmer_weights: dict[int, int] | None = None,
        counted: bool = False,
    ) -> NDArray[np.int8]:
        """

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions