Skip to content

Commit

Permalink
Remove FusionGDB (#16)
Browse files Browse the repository at this point in the history
* fix modules

* remove all fusiongdb

* remove print

* remove log

* change pull request template

* update changelog
  • Loading branch information
rannick authored Nov 24, 2023
1 parent d13c52b commit 570b8f6
Show file tree
Hide file tree
Showing 30 changed files with 32 additions and 720 deletions.
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ Thank you for contribution to `fusion-report` project.
- [ ] Documentation in `docs` is updated
- [ ] `CHANGELOG.md` is updated
- [ ] `README` is updated

### This [version](https://semver.org/) is a

- [ ] **MAJOR** - when you make incompatible API changes
- [ ] **MINOR** - when you add functionality in a backwards compatible manner
- [ ] **PATCH** - when you make backwards compatible bug fixes or documentation/instructions
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.8]

### Removed

- Removed FusionGDB

## [2.1.5](https://github.com/matq007/fusion-report/releases/tag/2.1.5)

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ python3 setup.py install

```bash
# Download required databases
# Currently supported databases: FusionGDB, Mitelman and COSMIC
# Currently supported databases: FusionGDB2, Mitelman and COSMIC
# COSMIC requires login credentials to download Fusion gene Database
fusion_report download --cosmic_usr '<username>' --cosmic_passwd '<password>' /path/to/db/

Expand Down
2 changes: 1 addition & 1 deletion docs/add_database.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Test(Db, metaclass=Singleton):

```python
local_fusions: Dict[str, List[str]] = {
FusionGDB(path).name: FusionGDB(path).get_all_fusions(),
FusionGDB2(path).name: FusionGDB2(path).get_all_fusions(),
MitelmanDB(path).name: MitelmanDB(path).get_all_fusions(),
CosmicDB(path).name: CosmicDB(path).get_all_fusions(),
TestDB(path).name: TestDB(path).get_all_fusions() # add your database here
Expand Down
18 changes: 1 addition & 17 deletions docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Currently the tool supports three different databases:

* [FusionGDB](https://ccsm.uth.edu/FusionGDB/index.html)
* [FusionGDB2](https://compbio.uth.edu/FusionGDB2/tables)
* [Mitelman](https://cgap.nci.nih.gov/Chromosomes/Mitelman)
* [COSMIC](https://cancer.sanger.ac.uk/cosmic/fusion)

Expand All @@ -28,22 +28,6 @@ fusion_report download

## Manual download

### FusionGDB

Website: [https://ccsm.uth.edu/FusionGDB/index.html](https://ccsm.uth.edu/FusionGDB/index.html)

```bash
# Download all files
wget --no-check-certificate https://ccsm.uth.edu/FusionGDB/tables/TCGA_ChiTaRS_combined_fusion_information_on_hg19.txt -O TCGA_ChiTaRS_combined_fusion_information_on_hg19.txt
wget --no-check-certificate https://ccsm.uth.edu/FusionGDB/tables/TCGA_ChiTaRS_combined_fusion_ORF_analyzed_gencode_h19v19.txt -O TCGA_ChiTaRS_combined_fusion_ORF_analyzed_gencode_h19v19.txt
wget --no-check-certificate https://ccsm.uth.edu/FusionGDB/tables/uniprot_gsymbol.txt -O uniprot_gsymbol.txt
wget --no-check-certificate https://ccsm.uth.edu/FusionGDB/tables/fusion_uniprot_related_drugs.txt -O fusion_uniprot_related_drugs.txt
wget --no-check-certificate https://ccsm.uth.edu/FusionGDB/tables/fusion_ppi.txt -O fusion_ppi.txt
wget --no-check-certificate https://ccsm.uth.edu/FusionGDB/tables/fgene_disease_associations.txt -O fgene_disease_associations.txt
# Create database and import the data
sqlite3 fusiongdb.db < fusion_report/db/FusionGDB.sql
```

### Mitelman

Website: [https://cgap.nci.nih.gov/Chromosomes/Mitelman](https://cgap.nci.nih.gov/Chromosomes/Mitelman)
Expand Down
7 changes: 3 additions & 4 deletions docs/score.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ One disadvantage of the tools is that they tend to report false positive results
estimated score for a fusion. The only way how to correctly verify a fusion is biologically (RT-qPCR …).

**fusion-report** uses weighted approach of assigning weights to tools and databases. By default, each tool
is assigned the same weight. This is because each tool uses different approach of discovering fusions and
is assigned the same weight. This is because each tool uses different approach of discovering fusions and
report different results, for example FusionCatcher will work best on somatic samples.

You can customize weight of individual tool by specific parameter `<tool-name>_weight 30`.
The sum of the weights has to be 100!

Currently weights for databases are not adjustable. The weights for databases are as follows:

* FusionGDB (20)
* COSMIC (40)
* MITELMAN (40)
* COSMIC (50)
* MITELMAN (50)
* FusionGDB2 (0)

> It is strongly suggested to use all supported databases in order to get the best estimated score.
Expand Down
42 changes: 10 additions & 32 deletions fusion_report/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from fusion_report.common.models.fusion import Fusion
from fusion_report.common.report import Report
from fusion_report.data.cosmic import CosmicDB
from fusion_report.data.fusiongdb import FusionGDB
from fusion_report.data.fusiongdb2 import FusionGDB2
from fusion_report.data.mitelman import MitelmanDB
from fusion_report.download import Download
Expand Down Expand Up @@ -100,36 +99,16 @@ def generate_report(self, params: Namespace) -> None:
)
report.render(index_page)

# with tqdm(total=len(fusions)) as pbar:
# for fusion in fusions:
# fusion_page = report.create_page(
# fusion.name, page_variables={"sample": params.sample}
# )
# fusion_page.add_module("fusion_summary", params={"fusion": fusion})
# fusion_page.add_module(
# "fusiongdb.variations",
# params={"fusion": fusion.name, "db_path": params.db_path},
# )
# fusion_page.add_module(
# "fusiongdb.transcripts",
# params={"fusion": fusion.name, "db_path": params.db_path},
# )
# fusion_page.add_module(
# "fusiongdb.ppi",
# params={"fusion": fusion.name, "db_path": params.db_path},
# )
# fusion_page.add_module(
# "fusiongdb.drugs",
# params={"fusion": fusion.name, "db_path": params.db_path},
# )
# fusion_page.add_module(
# "fusiongdb.diseases",
# params={"fusion": fusion.name, "db_path": params.db_path},
# )
# report.render(fusion_page)
# pbar.set_description(f"Processing {fusion.name}")
# time.sleep(0.1)
# pbar.update(1)
with tqdm(total=len(fusions)) as pbar:
for fusion in fusions:
fusion_page = report.create_page(
fusion.name, page_variables={"sample": params.sample}
)
fusion_page.add_module("fusion_summary", params={"fusion": fusion})
report.render(fusion_page)
pbar.set_description(f"Processing {fusion.name}")
time.sleep(0.1)
pbar.update(1)

def parse_fusion_outputs(self, params: Dict[str, Any]) -> None:
"""Executes parsing for each provided fusion detection tool."""
Expand All @@ -144,7 +123,6 @@ def enrich(self, path: str) -> None:
local_fusions: Dict[str, List[str]] = {
CosmicDB(path).name: CosmicDB(path).get_all_fusions(),
MitelmanDB(path).name: MitelmanDB(path).get_all_fusions(),
# FusionGDB(path).name: FusionGDB(path).get_all_fusions(),
FusionGDB2(path).name: FusionGDB2(path).get_all_fusions(),
}
for fusion in self.manager.fusions:
Expand Down
16 changes: 0 additions & 16 deletions fusion_report/common/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from fusion_report.common.logger import Logger
from fusion_report.data.cosmic import CosmicDB
from fusion_report.settings import Settings
from fusion_report.data.fusiongdb import FusionGDB
from fusion_report.data.fusiongdb2 import FusionGDB2
from fusion_report.data.mitelman import MitelmanDB

Expand Down Expand Up @@ -133,7 +132,6 @@ def get_cosmic_from_sanger(token: str, return_err: List[str]) -> None:
}
try:
res = requests.get(url, headers=headers)
print(res)
auth_url: str = res.json()["url"]
LOG.info(f"auth_url: {auth_url}")
Net.get_large_file(auth_url)
Expand Down Expand Up @@ -171,20 +169,6 @@ def get_cosmic_from_qiagen(token: str, return_err: List[str], outputpath: str) -
except Exception as ex:
return_err.append(f'{Settings.COSMIC["NAME"]}: {ex}')

@staticmethod
def get_fusiongdb(self, return_err: List[str]) -> None:
"""Method for download FusionGDB database."""

for file in Settings.FUSIONGDB["FILES"]:
try:
url: str = f'{Settings.FUSIONGDB["HOSTNAME"]}/{file}'
Net.get_large_file(url)
except DownloadException as ex:
return_err.append(f"FusionGDB: {ex}")

db = FusionGDB(".")
db.setup(Settings.FUSIONGDB["FILES"], delimiter="\t", skip_header=False)

@staticmethod
def get_fusiongdb2(self, return_err: List[str]) -> None:
"""Method for download FusionGDB2 database."""
Expand Down
29 changes: 0 additions & 29 deletions fusion_report/data/fusiongdb.py

This file was deleted.

2 changes: 1 addition & 1 deletion fusion_report/data/fusiongdb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


class FusionGDB2(Db, metaclass=Singleton):
"""Implementation of FusionGDB Database. All core functionality is handled by parent class."""
"""Implementation of FusionGDB2 Database. All core functionality is handled by parent class."""

def __init__(self, path: str) -> None:
super().__init__(path, Settings.FUSIONGDB2["NAME"], Settings.FUSIONGDB2["SCHEMA"])
Expand Down
5 changes: 1 addition & 4 deletions fusion_report/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class Download:
"""Class designed for downloading any type of required database.
Currently the script is able to download: Mitelman, FusionGDB and COSMIC with provided
Currently the script is able to download: Mitelman, FusionGDB2 and COSMIC with provided
credentials.
Attributes:
Expand Down Expand Up @@ -41,9 +41,6 @@ def download_all(self, params: Namespace) -> None:
# MITELMAN
Net.get_mitelman(self, return_err)

# FusionGDB
# Net.get_fusiongdb(self, return_err)

# FusionGDB2
Net.get_fusiongdb2(self, return_err)

Expand Down
Empty file.
Empty file.
24 changes: 0 additions & 24 deletions fusion_report/modules/fusiongdb/diseases/diseases.py

This file was deleted.

58 changes: 0 additions & 58 deletions fusion_report/modules/fusiongdb/diseases/partial.html

This file was deleted.

Empty file.
27 changes: 0 additions & 27 deletions fusion_report/modules/fusiongdb/drugs/drugs.py

This file was deleted.

Loading

0 comments on commit 570b8f6

Please sign in to comment.