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 instancegene_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 AssayedFusion object.
- Parameters:
structure (
list[TranscriptSegmentElement|GeneElement|TemplatedSequenceElement|LinkerElement|UnknownGeneElement|ContigSequence|ReadData]) – elements constituting the fusioncausative_event (
Optional[CausativeEvent]) – event causing the fusionassay (
Optional[Assay]) – how knowledge of the fusion was obtainedregulatory_element (
Optional[RegulatoryElement]) – affected regulatory elementsreading_frame_preserved (
Optional[bool]) –Trueif reading frame is preserved.Falseotherwise.
- Return type:
- Returns:
Tuple containing optional
AssayedFusionif 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 CategoricalFusion object
- Parameters:
structure (
list[TranscriptSegmentElement|GeneElement|TemplatedSequenceElement|LinkerElement|MultiplePossibleGenesElement]) – elements constituting the fusionregulatory_element (
Optional[RegulatoryElement]) – affected regulatory elementcritical_functional_domains (
Optional[list[FunctionalDomain]]) – lost or preserved functional domainsreading_frame_preserved (
Optional[bool]) –Trueif reading frame is preserved.Falseotherwise
- Return type:
- 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, coordinate_type=CoordinateType.RESIDUE, seq_id_target_namespace=None)[source]¶
Build FunctionalDomain object.
- Parameters:
status (
DomainStatus) – Status for domain. Must be eitherlostorpreservedname (
str) – Domain namefunctional_domain_id (
str) – Domain IDgene (
str) – Genesequence_id (
str) – protein sequence on which provided coordinates are locatedstart (
int) – start position on sequenceend (
int) – end position on sequenceuse_minimal_gene (
bool) –Trueif minimal gene object (id,label) will be used.Falseif gene-normalizer’s gene object will be usedcoordinate_type (
CoordinateType) – The coordinate type that is being supplied forstartandend. This is set to residue coordinates by defaultseq_id_target_namespace (
Optional[str]) – If want to use digest forsequence_id, set this to the namespace you want the digest for. Otherwise, leave asNone.
- 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 includestypeattribute.- Return type:
- 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) – The gene symbol name
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 internal_tandem_duplication(structure, causative_event=None, assay=None, regulatory_element=None, reading_frame_preserved=None, critical_functional_domains=None)[source]¶
Construct an InternalTandemDuplication (ITD) object
- Parameters:
structure (
list[TranscriptSegmentElement|GeneElement|TemplatedSequenceElement|LinkerElement|UnknownGeneElement|MultiplePossibleGenesElement]) – Elements constituting the ITDcausative_event (
Optional[CausativeEvent]) – event causing the fusionassay (
Optional[Assay]) – how knowledge of the fusion was obtainedregulatory_element (
Optional[RegulatoryElement]) – affected regulatory elementscritical_functional_domains (
Optional[list[FunctionalDomain]]) – lost or preserved functional domainsreading_frame_preserved (
Optional[bool]) –Trueif reading frame is preserved.Falseotherwise
- Return type:
- Returns:
InternalTandemDuplication if construction successful
- Raise:
FUSORParametersException if given incorrect fusion properties
- static linker_element(sequence)[source]¶
Create linker element
- Parameters:
sequence (
str) – A nucleotide 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:
- Returns:
MultiplePossibleGenesElement
- regulatory_element(regulatory_class, gene, feature_id=None, sequence_id=None, start=None, end=None, seq_id_target_namespace=None, coordinate_type=CoordinateType.RESIDUE, use_minimal_gene=True)[source]¶
Create RegulatoryElement
- Parameters:
regulatory_class (
RegulatoryClass) – one of {“promoter”, “enhancer”}gene (
str) – gene term to fetch normalized gene object forfeature_id (
Optional[str]) – The feature ID for the regulatory elementsequence_id (
Optional[str]) – Genomic sequence on which provided coordinates existstart (
Optional[int]) – Start position on sequenceend (
Optional[int]) – Etart position on sequenceseq_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.coordinate_type (
CoordinateType) – The coordinate type that is being supplied forstartandend. This is set to residue coordinates by defaultuse_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 startend (
int) – Genomic endsequence_id (
str) – Chromosome accession for sequencestrand (
Strand) – Strandcoordinate_type (
CoordinateType) – Determines coordinate base used. Must be one ofresidueorinter-residue. Set tointer-residueby default.seq_id_target_namespace (
Optional[str]) – If want to use digest forsequence_id, set this to the namespace you want the digest for. Otherwise, leave asNone.
- Return type:
- Returns:
Templated Sequence Element
- async transcript_segment_element(tx_to_genomic_coords=True, use_minimal_gene=True, seq_id_target_namespace=None, coverage=None, reads=None, **kwargs)[source]¶
Create TranscriptSegmentElement.
- Parameters:
tx_to_genomic_coords (
bool) –Trueif going from transcript to genomic coordinates.Falseif going from genomic to transcript exon coordinates.use_minimal_gene (
bool) – True if minimal gene object (id,label) will be used.Falseif gene-normalizer’s entire gene object will be usedseq_id_target_namespace (
Optional[str]) – If want to use digest forsequence_id, set this to the namespace you want the digest for. Otherwise, leave asNone.coverage (
Optional[BreakpointCoverage]) – The read coverage located near the specified breakpointreads (
Optional[AnchoredReads]) – The read data for the specified breakpointkwargs –
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