{"id":25865274,"url":"https://github.com/jcaperella29/clinical-text-mining_r_script","last_synced_at":"2025-08-30T10:34:17.546Z","repository":{"id":277890230,"uuid":"933831335","full_name":"jcaperella29/clinical-text-mining_R_SCRIPT","owner":"jcaperella29","description":"A lightweight R script for text mining and harmonizing medical phenotype data. Cleans, standardizes, and maps diagnoses to ICD-10 codes, with clinical annotations for enhanced data usability.","archived":false,"fork":false,"pushed_at":"2025-02-16T19:59:03.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-20T02:14:56.967Z","etag":null,"topics":["biomedical-data","clinical-informatics","data-cleaning","data-harmonization","database-integration","icd-10","machine-learning","medical-data","nlp-machine-learning","one-hot-encoding","phenotype","r","text-mining"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcaperella29.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-16T19:33:01.000Z","updated_at":"2025-02-16T19:59:52.000Z","dependencies_parsed_at":"2025-02-16T20:38:02.536Z","dependency_job_id":null,"html_url":"https://github.com/jcaperella29/clinical-text-mining_R_SCRIPT","commit_stats":null,"previous_names":["jcaperella29/clinical-text-mining_r_script"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jcaperella29/clinical-text-mining_R_SCRIPT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcaperella29%2Fclinical-text-mining_R_SCRIPT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcaperella29%2Fclinical-text-mining_R_SCRIPT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcaperella29%2Fclinical-text-mining_R_SCRIPT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcaperella29%2Fclinical-text-mining_R_SCRIPT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcaperella29","download_url":"https://codeload.github.com/jcaperella29/clinical-text-mining_R_SCRIPT/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcaperella29%2Fclinical-text-mining_R_SCRIPT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272839626,"owners_count":25001860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biomedical-data","clinical-informatics","data-cleaning","data-harmonization","database-integration","icd-10","machine-learning","medical-data","nlp-machine-learning","one-hot-encoding","phenotype","r","text-mining"],"created_at":"2025-03-02T01:34:13.963Z","updated_at":"2025-08-30T10:34:17.491Z","avatar_url":"https://github.com/jcaperella29.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clinical-text-mining_R_SCRIPT#\n\n# 🏥 Medical Phenotype Extraction from Doctor's Notes 🩺  \n\n## 📜 Overview  \nThis R script extracts **structured phenotype data** from **unstructured doctor's notes**.  \nIt cleans, standardizes, maps diagnoses to **ICD-10 codes**, applies **one-hot encoding**,  \nand exports a **ready-to-use phenotype matrix** for **machine learning \u0026 statistical analysis**.  \n\n### 🔬 Features  \n✅ Parses **doctor’s notes** into structured data using **regex \u0026 NLP**  \n✅ Handles **missing values \u0026 normalizes blood pressure, weight, age**  \n✅ **Maps diagnoses to ICD-10 codes** for standardization  \n✅ **One-hot encodes categorical data** (diagnosis \u0026 meds) for ML  \n✅ Saves **phenotype_matrix.csv** for **database integration \u0026 research**  \n\n---\n\n## ⚙️ Installation \u0026 Dependencies  \n```r\ninstall.packages(c(\"dplyr\", \"tidyr\", \"stringr\"))\n\n🚀 Usage\nPrepare your raw doctor’s notes in a structured text file.\nRun the script to extract structured data:\nr\nCopy\nEdit\nsource(\"generate_phenotype_matrix.R\")\nUpload the phenotype_matrix.csv to your lab’s database.\n📂 Output Example\nsample_id\tage\tweight_kg\tsystolic\tdiastolic\tdiagnosis_Hypertension\tdiagnosis_Diabetes\tdiagnosis_Asthma\tdiagnosis_Cardiovascular_Disease\tmed_Lisinopril\tmed_Metformin\tmed_Albuterol\tmed_Atorvastatin\nS001\t56\t81\t140\t90\t1\t0\t0\t0\t1\t0\t0\t0\n🏥 Database Integration\nIf using SQL, run:\n\n\nlibrary(DBI)\ncon \u003c- dbConnect(RSQLite::SQLite(), dbname = \"lab_database.sqlite\")\ndbWriteTable(con, \"phenotype_data\", read.csv(\"phenotype_matrix.csv\"), overwrite = TRUE)\ndbDisconnect(con)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcaperella29%2Fclinical-text-mining_r_script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcaperella29%2Fclinical-text-mining_r_script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcaperella29%2Fclinical-text-mining_r_script/lists"}