Bazema linker
Application building relations between drugs, scientific publications, pubmed, journals and clinical trials.
The output is a JSON file.
Design
+-------------------------+
| input folder |
| + drugs.csv |
| | pubmed.csv |
| | pubmed.json |
| + clinical_trials.csv |
+-------------------------+
+ move valid
| files +------------------+
v +----> | archive folder |
+--------+-------+ | +------------------+
| |+--+
| bazema_linker |
| python job | move invalid
| |±--+ files
+----------------+ | +------------------+
+ +----> | errors folder |
| +------------------+
v
+-----------------------------+
| output folder |
| + result_2020_10_06.json |
+-----------------------------+
Once the job is done, the input files are moved to an archive
folder.
Invalid files (name invalid, format invalid, parsing impossible)
are moved to an errors folder.
Structure of input files
drugs.csv, 2 columns=atccodeanddrugpubmed.csv, 4 columns=id,title,dateandjournalpubmed.json, same structure as a JSONclinical_trials.csv, 4 columns=id,scientific_title,dateandjournal
Structure of generated output
[
{
"drug": "drug name",
"clinical_trials": [
{
"title": "title of article",
"date": "2020-01-01"
}, {...}
],
"pubmed": [
{
"title": "title of article",
"date": "2020-01-01"
}, {...}
],
"journals": [
{
"date": "2020-01-01",
"journal": "journal name"
}, {...}
]
},
{...}
]
Usage
Requirements
- Python >= 3.6
Installation
virtualenv -p python3 venv
source venv/bin/activate
pip install bazema_linker
Display usage
bazema_linker -h
Example
bazema_linker --input_dir data --output_dir result
Development
# Install
virtualenv -p python3 venv
source venv/bin/activate
make install
# Build
make test # coverage tests
make linter # runs pylint
make build
Ad-hoc Top journals
You can get the name of the journal with the most different drugs using
the script top_journals.py and a result file produced by bazema_linker.
Usage
# no depedency required
python top_journals.py result/result_2020-10-06.json
# output
Journal with most different drugs is "Science" with a total of "15" different drugs.
TODO
- Handle high volume of data, like few tera-octets -> use a highly scalable framework (i.e. Apache Spark, Apache Beam). Pay attention when broadcasting data across workers.
- Deploy to Pypi using Github Actions
Metadata
Release files for bazema-linker 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bazema_linker-1.2.tar.gz | 7.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bazema_linker-1.2-py3.8.egg | Legacy Egg format | - | - | Details |
Total release size: 21.8 kB
Release files / bazema_linker-1.2.tar.gz
| Download URL | bazema_linker-1.2.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32773b778164edb312a8ca51e372b4c498310efa2af6764ee2fc917a3bfb097b
|
|
BLAKE2b-256 checksum How to use checksums |
96c7bcf3e670cb718fdb3a5a83e77d701d8ec5ee242820f00908c670a108e0c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.1
|
Release files / bazema_linker-1.2-py3.8.egg
| Download URL | bazema_linker-1.2-py3.8.egg |
|---|---|
| Size | 14.4 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
c27f6e836f0ab8fa0e3535310689496d94d9a4cadce786f54e4d8aacfda68ef6
|
|
BLAKE2b-256 checksum How to use checksums |
30469a58d7b8d44ea021d75b1306db1dbef12989ca59de8a4794a1e93b2e5998
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.1
|
Security for bazema-linker 1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.