fusor.tools

Provide miscellaneous tools for fusion modeling.

class fusor.tools.FusorDataResourceStatus(cool_seq_tool, gene_normalizer)[source]
cool_seq_tool[source]

Alias for field number 0

gene_normalizer[source]

Alias for field number 1

async fusor.tools.check_data_resources(gene_database=None)[source]

Perform basic status checks on known data requirements.

Mirroring the input structure of the fusor.fusor.FUSOR class, existing instances of the Gene Normalizer database can be passed as arguments. Otherwise, resource construction is attempted in the same manner as it would be with the FUSOR class, relying on environment variables and defaults.

>>> from fusor.tools import check_data_resources
>>> status = await check_data_resources()
>>> assert all(status)  # passes if all resources can be acquired successfully

The return object is a broad description of resource availability, grouped by library. For a more granular description to support debugging, all failures are logged as logging.ERROR by respective upstream libraries.

Parameters:

gene_database (Optional[AbstractDatabase]) – gene normalizer DB instance

Return type:

FusorDataResourceStatus

Returns:

namedtuple describing whether Cool-Seq-Tool and Gene Normalizer resources are all available

fusor.tools.get_error_message(e)[source]

Get all error messages from a pydantic ValidationError

Parameters:

e (ValidationError) – the ValidationError to get the messages from

Return type:

str

Returns:

string containing all of the extracted error messages, separated by newlines or the string

representation of the exception if ‘msg’ field is not present