fusor.fusion_matching¶
Module for matching assayed fusions against categorical fusions
- class fusor.fusion_matching.FusionMatcher(cache_dir=None, assayed_fusions=None, comparator_fusions=None, cache_files=None)[source]¶
Class for matching assayed fusions against assayed fusions and categorical fusions
- __init__(cache_dir=None, assayed_fusions=None, comparator_fusions=None, cache_files=None)[source]¶
Initialize FusionMatcher class and comparator categorical fusion objects
- Parameters:
cache_dir (
Optional[Path]) – The directory containing the cached categorical fusions files. If this parameter is not provided, it will be set by default to be FUSOR_DATA_DIR.assayed_fusions (
Optional[list[AssayedFusion]]) – A list of AssayedFusion objectscomparator_fusions (
Optional[list[AssayedFusion|CategoricalFusion]]) – A list of AssayedFusion or CategoricalFusion objectscache_files (
Optional[list[str]]) – A list of cache file names incache_dircontaining AssayedFusion or CategoricalFusion objects to load, or None. By default this is set to None. It assumes that files contain lists of valid AssayedFusion or CategoricalFusion objects.
- Raises:
ValueError – If
comparator_fusionsis not provided and eithercache_dirorcache_filesis not provided.
- async match_fusion()[source]¶
Return best matching fusion
This method prioritizes using categorical fusion objects that are provided in
self.categorical_fusionsas opposed those that exist in thecache_dirdirectory.- Raises:
ValueError – If a list of AssayedFusion objects is not provided
- Return type:
list[Optional[list[tuple[AssayedFusion|CategoricalFusion,MatchType]]]]- Returns:
A list of list of tuples containing matching fusion objects and their associated match type, for each examined AssayedFusion object. This method iterates through all supplied AssayedFusion objects to find corresponding matches. The match type represents how many attributes are shared between an AssayedFusion and comparator fusion. The attributes that are compared include the gene partner, transcript accession, exon number, exon offset, and genomic breakpoint. Matches are returned according to the priority of their match type.
- class fusor.fusion_matching.MatchInformation(**data)[source]¶
Helper for reporting matching information based off of MatchType
- determine_match()[source]¶
Determine match type based on fields in MatchInformation class
- Return type:
Optional[MatchType]- Returns:
A MatchType object, or None if no match exists
-
five_prime_match_info:
PartnerMatch[source]¶
-
three_prime_match_info:
PartnerMatch[source]¶
- class fusor.fusion_matching.MatchType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Enum for defining different match types