Skip to main content

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


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.3.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cncd_package-0.1.3-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file cncd_package-0.1.3.tar.gz.

File metadata

  • Download URL: cncd_package-0.1.3.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for cncd_package-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8ffd012b3087f773c8e40efc8810c19766ebb99b5bc4a8d99703109d737905ba
MD5 e4359ee033a504845df95fd35325bbfa
BLAKE2b-256 069d9600753026c7e2b6b7e32a44d75abef2dbe7095098a9b70a20332c2df0b3

See more details on using hashes here.

File details

Details for the file cncd_package-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: cncd_package-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for cncd_package-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 175580207c7bcedfd29648bccee7ce4c572a1fce3b8d441dd4ca97b0775d0b49
MD5 f6e1271360f12404828398debd553643
BLAKE2b-256 4fe80f21dc89d05818e4261413bf950faa51d39414b2aa5adfdb9056a67bf30e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page