Copy number conversion¶
to_copy_number_variation
¶
Module for to copy number variation translation
Classes¶
ToCopyNumberError
¶
Bases: Exception
Custom exceptions when representing copy number
ParsedAccessionSummary
¶
Bases: NamedTuple
Represents accession for parsed endpoints
ParsedChromosomeSummary
¶
Bases: NamedTuple
Represents chromosome and assembly for parsed endpoints
ToCopyNumberVariation
¶
ToCopyNumberVariation(seqrepo_access: SeqRepoAccess, tokenizer: Tokenize, classifier: Classify, validator: Validate, translator: Translate, gene_normalizer: QueryHandler, uta: UtaDatabase, liftover: LiftOver)
Bases: ToVRS
Class for representing copy number variation
Initialize theToCopyNumberVariation class
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
seqrepo_access
|
SeqRepoAccess
|
Access to SeqRepo |
required |
tokenizer
|
Tokenize
|
Instance for tokenizing input strings |
required |
classifier
|
Classify
|
Instance for classifying list of ordered tokens |
required |
validator
|
Validate
|
Instance for validating classification |
required |
translator
|
Translate
|
Instance for translating valid results to VRS representations |
required |
gene_normalizer
|
QueryHandler
|
Client for normalizing gene concepts |
required |
uta
|
UtaDatabase
|
Access to UTA queries |
required |
liftover
|
LiftOver
|
Instance to provide mapping between human genome assemblies |
required |
Methods:¶
hgvs_to_copy_number_count
async
¶
hgvs_to_copy_number_count(hgvs_expr: str, baseline_copies: int, do_liftover: bool = False) -> HgvsToCopyNumberCountService
Given hgvs, return abolute copy number variation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hgvs_expr
|
str
|
HGVS expression |
required |
baseline_copies
|
int
|
Baseline copies number |
required |
do_liftover
|
bool
|
Whether or not to liftover to GRCh38 assembly |
False
|
Returns:
| Type | Description |
|---|---|
HgvsToCopyNumberCountService
|
HgvsToCopyNumberCountService containing Copy Number Count Variation and warnings |
hgvs_to_copy_number_change
async
¶
hgvs_to_copy_number_change(hgvs_expr: str, copy_change: CopyChange | None, do_liftover: bool = False) -> HgvsToCopyNumberChangeService
Given hgvs, return copy number change variation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hgvs_expr
|
str
|
HGVS expression |
required |
copy_change
|
CopyChange | None
|
The copy change |
required |
do_liftover
|
bool
|
Whether or not to liftover to GRCh38 assembly |
False
|
Returns:
| Type | Description |
|---|---|
HgvsToCopyNumberChangeService
|
HgvsToCopyNumberChangeService containing Copy Number Change Variation and warnings |
parsed_to_copy_number
¶
parsed_to_copy_number(request_body: ParsedToCnVarQuery | ParsedToCxVarQuery) -> ParsedToCnVarService | ParsedToCxVarService
Given parsed genomic components, return Copy Number Count or Copy Number Change Variation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request_body
|
ParsedToCnVarQuery | ParsedToCxVarQuery
|
request body |
required |
Returns:
| Type | Description |
|---|---|
ParsedToCnVarService | ParsedToCxVarService
|
If |
amplification_to_cx_var
¶
amplification_to_cx_var(gene: str, sequence_id: str | None = None, start: int | None = None, end: int | None = None) -> AmplificationToCxVarService
Return Copy Number Change Variation for Amplification query Parameter priority: 1. sequence_id, start, end (must provide ALL) 2. use the gene-normalizer to get the SequenceLocation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gene
|
str
|
Gene query |
required |
sequence_id
|
str | None
|
Sequence ID for the location. If set, must also provide
|
None
|
start
|
int | None
|
Start position as residue coordinate for the sequence location. If
set, must also provide |
None
|
end
|
int | None
|
End position as residue coordinate for the sequence location. If
set, must also provide |
None
|
Returns:
| Type | Description |
|---|---|
AmplificationToCxVarService
|
AmplificationToCxVarService containing Copy Number Change and list of warnings |