Skip to content

Commit 249091b

Browse files
committed
missing values and field value fixes
1 parent 399859c commit 249091b

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# Oncogenator
22

3-
Oncogenator is used for post-annotation of genomic alterations that have been previously annotated with Annovar. It performs additional annotation based on copy number information, estimates the homogeneity of somatic alterations, and classifies somatic alterations by their functional consequences.
3+
Oncogenator is used for identifying significant genomic alterations from variants previously annotated with Annovar. It performs additional annotation based on copy number information, estimates the homogeneity of somatic alterations, and classifies somatic alterations by their functional consequences.
44

55
## Description
66

77
The tool processes somatic variants and copy number alterations (CNAs) to provide a comprehensive annotation of genomic alterations. It integrates data from various sources, including OncoKB and Cancer Genome Interpreter (CGI), to enhance the annotation with clinical relevance and treatment information.
88

99
### Features
10-
11-
- **Somatic Variant Annotation**: Annotates somatic variants with functional consequences and clinical relevance.
12-
- **Copy Number Alteration Annotation**: Annotates CNAs with functional consequences and clinical relevance.
13-
- **Homogeneity Estimation**: Estimates the homogeneity of somatic alterations.
14-
- **Classification**: Classifies somatic alterations by their functional consequences.
10+
- **Copy Number Alteration Annotation**: Detects higly expressed and silenced genes from copy number and ploidy information.
11+
- **Somatic Variant Annotation**: Annotates somatic variants with copy number and ploidy information.
12+
- **Homogeneity Estimation**: Estimates the homogeneity of somatic alterations from tumor purity, ploidy and copy number information.
13+
- **Pathogenicity Estimation**: Estimates the pathogenicity of somatic alterations based on their functional consequences and multiple variant effect predictors (AlphaMissense, Polyphen, SIFT)
14+
- **Classification**: Classifies somatic alterations by their functional consequences and homogeneity.
15+
- **Integration with OncoKB and CGI**: Queries OncoKB and CGI for clinical relevance and possible treatments.
1516

1617
### Requirements
1718
- Python 3.x

copy_number_annotator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def filter_cnas_by_ploidy(self, row):
4848
'nMinor': handle_int_field(row["nMinor"]),
4949
'lohstatus': handle_string_field(row["LOHstatus"]),
5050
'ploidy': handle_decimal_field(float(ploidy)),
51+
'chromosome': handle_string_field(row["chr"]),
5152
'start': handle_string_field(row["start"]),
5253
'end': handle_string_field(row["end"]),
5354
'strand': handle_string_field(row["strand"]),

somatic_variant_annotator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,14 @@ def post_filter_and_classify_snvs(self, row):
284284
row['hom_lo'] = "{:.9f}".format(expHomCI_lo),
285285
row['hom_hi'] = "{:.9f}".format(expHomCI_hi),
286286
row['hom_pbinom_lo'] = "{:.9f}".format(expHom_pbinom_lower),
287-
row['homogenous'] = homogenous
287+
row['homogenous'] = bool(homogenous)
288288
row['af'] = expHomAF
289289
if homogenous and exonicFuncMane == "nonsynonymous_SNV":
290290
row['classification'] = "Missense"
291-
row['hom_lo'] = row['hom_lo'][0] if isinstance(row['hom_lo'], tuple) else row['hom_lo']
292-
row['hom_hi'] = row['hom_hi'][0] if isinstance(row['hom_hi'], tuple) else row['hom_hi']
293-
row['hom_pbinom_lo'] = row['hom_pbinom_lo'][0] if isinstance(row['hom_pbinom_lo'], tuple) else row[
294-
'hom_pbinom_lo']
291+
row['hom_lo'] = float(row['hom_lo'][0] if isinstance(row['hom_lo'], tuple) else row['hom_lo'])
292+
row['hom_hi'] = float(row['hom_hi'][0] if isinstance(row['hom_hi'], tuple) else row['hom_hi'])
293+
row['hom_pbinom_lo'] = float(row['hom_pbinom_lo'][0] if isinstance(row['hom_pbinom_lo'], tuple) else row[
294+
'hom_pbinom_lo'])
295295

296296
except Exception as e:
297297
print(e)
@@ -316,7 +316,7 @@ def post_filter_and_classify_snvs_by_sample(self, row):
316316
sample_id = row['sample_id']
317317

318318
# Calculate homogeneity estimate
319-
tfs = self.ascats.loc[self.ascats['sample'] == sample_id]['purity']
319+
tfs = self.ascats.loc[self.ascats['sample'] == sample_id]['purity'] # Tumor fraction = purity of the tumor
320320
tf = tfs.iloc[0] if len(tfs) > 0 else 0.0 # loc[ascats['sample'] == sample_id]['purity'].values[0]
321321
ad0 = int(row['ad0'])
322322
ad1 = int(row['ad1'])

0 commit comments

Comments
 (0)