-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from apriltuesday/issue-10
Add counts and fix bugs from test run
- Loading branch information
Showing
12 changed files
with
269 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
# opentargets-pharmgkb | ||
Pipeline to provide evidence strings for Open Targets from PharmGKB | ||
|
||
``` | ||
# Download data | ||
DATA_DIR=<directory for data> | ||
wget https://api.pharmgkb.org/v1/download/file/data/clinicalAnnotations.zip | ||
wget https://api.pharmgkb.org/v1/download/file/data/drugs.zip | ||
unzip -j clinicalAnnotations.zip "*.tsv" -d $DATA_DIR | ||
unzip -j clinicalAnnotations.zip "CREATED*.txt" -d $DATA_DIR | ||
unzip -j drugs.zip "*.tsv" -d $DATA_DIR | ||
rm clinicalAnnotations.zip drugs.zip | ||
# Run pipeline | ||
generate_evidence.py --data-dir $DATA_DIR --created-date <created date> --output-path evidence.json | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
class ClinicalAnnotationCounts: | ||
"""Simple class to hold counts for generating clinical annotation evidence.""" | ||
|
||
def __init__(self): | ||
# Input counts (before annotation and exploding by drug, etc.) | ||
self.clinical_annotations = 0 | ||
self.with_rs = 0 | ||
# Counts after exploding by each attribute | ||
self.exploded_alleles = 0 | ||
self.exploded_drugs = 0 | ||
self.exploded_phenotypes = 0 | ||
# Output counts (after annotation and exploding) | ||
self.evidence_strings = 0 | ||
self.with_chebi = 0 | ||
self.with_efo = 0 | ||
self.with_consequence = 0 | ||
# self.with_pgkb_gene = 0 | ||
self.with_vep_gene = 0 | ||
# Evaluation counts - after annotation but without exploding | ||
self.annot_with_pgkb_genes = 0 | ||
self.annot_with_vep_genes = 0 | ||
self.pgkb_vep_gene_diff = 0 | ||
|
||
def report(self): | ||
report_str = f'\nTotal clinical annotations: {self.clinical_annotations}\n' | ||
report_str += f'\tWith RS: {self.with_rs}\n' | ||
report_str += f'Exploded by allele: {self.exploded_alleles}\n' | ||
report_str += f'Exploded by drug: {self.exploded_drugs}\n' | ||
report_str += f'Exploded by phenotype: {self.exploded_phenotypes}\n' | ||
report_str += f'Total evidence strings: {self.evidence_strings}\n' | ||
report_str += f'\tWith CHEBI: {self.with_chebi}\n' | ||
report_str += f'\tWith EFO phenotype: {self.with_efo}\n' | ||
report_str += f'\tWith functional consequence: {self.with_consequence}\n' | ||
# report_str += f'\tWith PGKB gene: {self.with_pgkb_gene}\n' | ||
report_str += f'\tWith VEP gene: {self.with_vep_gene}\n' | ||
report_str += f'Gene comparisons per annotation\n' | ||
report_str += f'\tWith PGKB genes: {self.annot_with_pgkb_genes}\n' | ||
report_str += f'\tWith VEP genes: {self.annot_with_vep_genes}\n' | ||
report_str += f'\tPGKB genes != VEP genes: {self.pgkb_vep_gene_diff}\n' | ||
print(report_str) | ||
return report_str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
numpy==1.24.3 | ||
pandas==1.5.3 | ||
pytest==7.2.2 | ||
requests==2.28.2 | ||
requests==2.31.0 | ||
retry==0.9.2 | ||
cmat @ git+https://github.com/apriltuesday/eva-opentargets.git@refactor#egg=cmat | ||
cmat @ git+https://github.com/EBIvariation/eva-opentargets.git#egg=cmat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.