fusor.fusor#

Module for modifying fusion objects.

class fusor.fusor.FUSOR(gene_database=None, cool_seq_tool=None)[source]#

Class for modifying fusion objects.

__init__(gene_database=None, cool_seq_tool=None)[source]#

Initialize FUSOR class.

Parameters:
  • cool_seq_tool (Optional[CoolSeqTool]) – Cool-Seq-Tool instance

  • gene_database (Optional[AbstractDatabase]) – gene normalizer database instance

static assayed_fusion(structure, causative_event=None, assay=None, regulatory_element=None, reading_frame_preserved=None)[source]#

Construct an assayed fusion object.

Parameters:
Return type:

AssayedFusion

Returns:

Tuple containing optional AssayedFusion if construction successful, and any relevant validation warnings

static categorical_fusion(structure, regulatory_element=None, critical_functional_domains=None, reading_frame_preserved=None)[source]#

Construct a categorical fusion object

Parameters:
Return type:

CategoricalFusion

Returns:

CategoricalFusion if construction successful

Raise:

FUSORParametersException if given incorrect fusion properties

functional_domain(status, name, functional_domain_id, gene, sequence_id, start, end, use_minimal_gene=True, seq_id_target_namespace=None)[source]#

Build functional domain instance.

Parameters:
  • status (DomainStatus) – Status for domain. Must be either lost or preserved

  • name (str) – Domain name

  • functional_domain_id (str) – Domain ID

  • gene (str) – Gene

  • sequence_id (str) – protein sequence on which provided coordinates are located

  • start (int) – start position on sequence

  • end (int) – end position on sequence

  • use_minimal_gene (bool) – True if minimal gene object (id, label) will be used. False if gene-normalizer’s gene object will be used

  • seq_id_target_namespace (Optional[str]) – If want to use digest for sequence_id, set this to the namespace you want the digest for. Otherwise, leave as None.

Return type:

tuple[Optional[FunctionalDomain], Optional[str]]

Returns:

Tuple with FunctionalDomain and None value for warnings if successful, or a None value and warning message if unsuccessful

fusion(fusion_type=None, **kwargs)[source]#

Construct fusion object.

Fusion type (assayed vs categorical) can be inferred based on provided kwargs, assuming they can sufficiently discriminate the type.

Parameters:

fusion_type (Optional[FusionType]) – explicitly specify fusion type. Unnecessary if providing fusion object in keyword args that includes type attribute.

Return type:

CategoricalFusion | AssayedFusion

Returns:

constructed fusion object if successful

Raise:

FUSORParametersException if fusion type unable to be determined, or if incorrect fusion parameters are provided

gene_element(gene, use_minimal_gene=True)[source]#

Create gene element

Parameters:
  • gene (str) – Gene

  • use_minimal_gene (bool) – True if minimal gene object (id and label) will be used. False if gene-normalizer’s gene object will be used

Return type:

tuple[Optional[GeneElement], Optional[str]]

Returns:

GeneElement, warning

generate_nomenclature(fusion)[source]#

Generate human-readable nomenclature describing provided fusion

Parameters:

fusion (CategoricalFusion | AssayedFusion) – a valid fusion

Return type:

str

Returns:

string summarizing fusion in human-readable way per VICC fusion curation nomenclature

static linker_element(sequence)[source]#

Create linker element

Parameters:

sequence (str) – Sequence

Return type:

tuple[Optional[LinkerElement], Optional[str]]

Returns:

Tuple containing a complete Linker element and None if successful, or a None value and warning message if unsuccessful

static multiple_possible_genes_element()[source]#

Create a MultiplePossibleGenesElement.

Return type:

MultiplePossibleGenesElement

Returns:

MultiplePossibleGenesElement

regulatory_element(regulatory_class, gene, use_minimal_gene=True)[source]#

Create RegulatoryElement

Parameters:
  • regulatory_class (RegulatoryClass) – one of {“promoter”, “enhancer”}

  • gene (str) – gene term to fetch normalized gene object for

  • use_minimal_gene (bool) – whether to use the minimal gene object

Return type:

tuple[Optional[RegulatoryElement], Optional[str]]

Returns:

Tuple with RegulatoryElement instance and None value for warnings if successful, or a None value and warning message if unsuccessful

templated_sequence_element(start, end, sequence_id, strand, coordinate_type=CoordinateType.INTER_RESIDUE, seq_id_target_namespace=None)[source]#

Create templated sequence element

Parameters:
  • start (int) – Genomic start

  • end (int) – Genomic end

  • sequence_id (str) – Chromosome accession for sequence

  • strand (Strand) – Strand

  • coordinate_type (CoordinateType) – Determines coordinate base used. Must be one of residue or inter-residue.

  • seq_id_target_namespace (Optional[str]) – If want to use digest for sequence_id, set this to the namespace you want the digest for. Otherwise, leave as None.

Return type:

TemplatedSequenceElement

Returns:

Templated Sequence Element

async transcript_segment_element(tx_to_genomic_coords=True, use_minimal_gene=True, seq_id_target_namespace=None, **kwargs)[source]#

Create transcript segment element.

Parameters:
  • tx_to_genomic_coords (bool) – True if going from transcript to genomic coordinates. False if going from genomic to transcript exon coordinates.

  • use_minimal_gene (bool) – True if minimal gene object (id, label) will be used. False if gene-normalizer’s entire gene object will be used

  • seq_id_target_namespace (Optional[str]) – If want to use digest for sequence_id, set this to the namespace you want the digest for. Otherwise, leave as None.

  • kwargs

    If tx_to_genomic_coords, possible key word arguments:

    (From cool_seq_tool.tx_segment_to_genomic)

    • gene (str | None = None)

    • transcript (str | None = None)

    • exon_start (int | None = None)

    • exon_start_offset: Optional[int] = 0

    • exon_end: Optional[int] = None

    • exon_end_offset: (Optional[int] = 0)

    else:

    (From cool_seq_tool.genomic_to_tx_segment)

    • genomic_ac: (str)

    • seg_start_genomic: (Optional[int] = None)

    • seg_end_genomic: (Optional[int] = None)

    • transcript: (Optional[str] = None)

    • gene: (Optional[str] = None)

Return type:

tuple[Optional[TranscriptSegmentElement], Optional[list[str]]]

Returns:

Transcript Segment Element, warning

static unknown_gene_element()[source]#

Create unknown gene element

Return type:

UnknownGeneElement

Returns:

Unknown Gene element