A Python package for CNCD
Project description
Download
pip install cncd-package
Loading the QC checks class
from cncd_package.QC import QC_Check
Reading data
sharing paths of different datasets:
- \cncd-dc1\DATA SCIENCE DEPARTMENT\1_phenotype_data\3_master_files_entry_1_entry_2_raw\april_2023\entry_1\updated_master_cad_2nd_entry_april_2023.csv
- \cncd-dc1\DATA SCIENCE DEPARTMENT\1_phenotype_data\3_master_files_entry_1_entry_2_raw\april_2023\entry_1\updated_master_dm_2nd_entry_april_2023.csv
- \cncd-dc1\DATA SCIENCE DEPARTMENT\1_phenotype_data\3_master_files_entry_1_entry_2_raw\april_2023\entry_1\updated_master_hf_1st_entry_april_2023.csv
- \cncd-dc1\DATA SCIENCE DEPARTMENT\1_phenotype_data\3_master_files_entry_1_entry_2_raw\april_2023\entry_1\updated_master_nafld_1st_entry_april_2023.csv
- \cncd-dc1\DATA SCIENCE DEPARTMENT\1_phenotype_data\3_master_files_entry_1_entry_2_raw\april_2023\entry_1\updated_master_pgr_1st_entry_april_2023.csv
- \cncd-dc1\DATA SCIENCE DEPARTMENT\1_phenotype_data\3_master_files_entry_1_entry_2_raw\april_2023\entry_1\updated_master_promis_1st_entry_april_2023.csv
- \cncd-dc1\DATA SCIENCE DEPARTMENT\1_phenotype_data\3_master_files_entry_1_entry_2_raw\april_2023\entry_1\updated_master_stroke_1st_entry_april_2023.csv
import pandas as pd
import warnings
warnings.simplefilter('ignore')
promis_data = pd.read_csv(r"\\cncd-dc1\DATA SCIENCE DEPARTMENT\1_phenotype_data\3_master_files_entry_1_entry_2_raw\april_2023\entry_1\updated_master_promis_1st_entry_april_2023.csv")
Doing QC
qc = QC_Check(dataframe=promis_data, project_id="PROMIS")
Age Check
qc.age_check().head()
| study_id | age | |
|---|---|---|
| 0 | D969 | 106.0 |
| 1 | LY6648 | 5.0 |
| 2 | LY6753 | 99.0 |
| 3 | LZ6394 | 96.0 |
| 4 | V3629 | 0.0 |
Gender Checks
qc.gender_check(gender='male')
| study_id | gender | result | ||
|---|---|---|---|---|
| 0 | LY7080 | 2.0 | MR | |
| 1 | LY7094 | 2.0 | MR | |
| 2 | LY7470 | 2.0 | MR | |
| 3 | V2125 | 2.0 | MR | |
| 4 | V2134 | 2.0 | MR | |
| ... | ... | ... | ... | ... |
| 65 | R891 | 2.0 | MR | |
| 66 | R1052 | 2.0 | MR | |
| 67 | R1560 | 2.0 | MR | |
| 68 | R1577 | 2.0 | MR | |
| 69 | R1658 | 2.0 | MR |
70 rows × 4 columns
qc.gender_check(gender='female')
| study_id | gender | result | ||
|---|---|---|---|---|
| 0 | K1884 | 1.0 | BIBI | |
| 1 | LY2898 | 1.0 | BIBI | |
| 2 | LY2903 | 1.0 | BIBI | |
| 3 | LY2910 | 1.0 | BANO | |
| 4 | LY3855 | 1.0 | BIBI | |
| ... | ... | ... | ... | ... |
| 85 | HZ93 | 1.0 | BIBI | |
| 86 | PZ6 | 1.0 | BIBI | |
| 87 | PY27 | 1.0 | BIBI | |
| 88 | SM191 | 1.0 | BB | |
| 89 | RZ9 | 1.0 | BIBI |
90 rows × 4 columns
Check QC status
qc.check_qc_status()
| study_id | status | mi | pre_mi | st_elevation | troponin_positive | |
|---|---|---|---|---|---|---|
| 0 | D1 | 1.0 | 0.0 | 0.0 | 1.0 | 0.0 |
| 1 | D2 | 1.0 | 0.0 | 0.0 | 1.0 | NaN |
| 2 | D4 | 1.0 | 0.0 | 0.0 | 1.0 | 0.0 |
| 3 | D5 | 1.0 | 0.0 | 0.0 | 1.0 | 2.0 |
| 4 | D6 | 1.0 | 1.0 | 1.0 | 1.0 | 0.0 |
| ... | ... | ... | ... | ... | ... | ... |
| 82820 | RZ111 | 1.0 | 0.0 | NaN | 1.0 | NaN |
| 82827 | RZ118 | 1.0 | 0.0 | NaN | 0.0 | 1.0 |
| 82828 | RZ119 | 1.0 | 0.0 | NaN | 0.0 | 1.0 |
| 82830 | RZ121 | 1.0 | 0.0 | NaN | 1.0 | NaN |
| 82831 | RZ122 | 1.0 | 0.0 | NaN | 0.0 | 1.0 |
31966 rows × 6 columns
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cncd_package-0.1.2.tar.gz
(10.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cncd_package-0.1.2.tar.gz.
File metadata
- Download URL: cncd_package-0.1.2.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17faa35d3da404f8c464a48a69a06f3f7a7759ff3d410d58ea1d88a135611651
|
|
| MD5 |
052215b2410680079c0e008c145b935d
|
|
| BLAKE2b-256 |
48c1a3e7bdfe975c4325eb521dec33a67c88979be2ebf18be984abdd3ef59d22
|
File details
Details for the file cncd_package-0.1.2-py3-none-any.whl.
File metadata
- Download URL: cncd_package-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
737bf41dd6b94263c6a05a8686054fd626430a86c8f20b788109a3d3bc57e637
|
|
| MD5 |
fbc17f69e668da48a24fb97c6e3a3f7e
|
|
| BLAKE2b-256 |
448907be6c6607b9040c0edc89991bd35f44d4342e7966a079a04929320835a4
|