{ "cells": [ { "cell_type": "markdown", "id": "aa8c8b39", "metadata": {}, "source": [ "# Human Proteome — Reviewed Protein Annotations\n", "\n", "Starter notebook for the Kaggle dataset in this folder. It loads `human_proteins.csv` with pandas and walks through quality checks and a first piece of analysis.\n", "\n", "**Files:** `human_proteins.csv`, `data_dictionary.csv`." ] }, { "cell_type": "markdown", "id": "0000f7f2", "metadata": {}, "source": [ "## 1. Load the data" ] }, { "cell_type": "code", "id": "9c010911", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "import pandas as pd\n", "\n", "df = pd.read_csv(\"human_proteins.csv\", low_memory=False)\n", "print(df.shape)" ] }, { "cell_type": "markdown", "id": "325de123", "metadata": {}, "source": [ "## 2. Shape, types and missing values" ] }, { "cell_type": "code", "id": "6eb42bc8", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "print(f\"{df.shape[0]:,} rows x {df.shape[1]} columns\")\n", "\n", "missing = df.isna().mean().mul(100).sort_values(ascending=False)\n", "missing[missing > 0].round(1).to_frame(\"missing_%\").head(15)" ] }, { "cell_type": "markdown", "id": "f2d963fe", "metadata": {}, "source": [ "## 3. Numeric summary" ] }, { "cell_type": "code", "id": "aa2f8fd4", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "df.describe(include='number').T.round(2).head(20)" ] }, { "cell_type": "markdown", "id": "1196968a", "metadata": {}, "source": [ "## 4. Length distribution" ] }, { "cell_type": "code", "id": "579626ab", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "df[\"length\"].dropna().clip(upper=3000).hist(bins=60, figsize=(9, 4))" ] }, { "cell_type": "markdown", "id": "3836ccfa", "metadata": {}, "source": [ "## 5. Enzymes by EC class" ] }, { "cell_type": "code", "id": "3f59ac0f", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "df[\"ec_class\"].value_counts().sort_index().to_frame(\"proteins\")" ] }, { "cell_type": "markdown", "id": "730ea8f4", "metadata": {}, "source": [ "## 6. Localisation flags" ] }, { "cell_type": "code", "id": "8f633efd", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "for c in [\"is_secreted\", \"is_membrane_protein\", \"is_nuclear\", \"is_mitochondrial\"]:\n", " print(c, round((df[c].astype(str).str.lower() == \"true\").mean() * 100, 1), \"%\")" ] }, { "cell_type": "markdown", "id": "2bbbb810", "metadata": {}, "source": [ "## 7. Structure coverage" ] }, { "cell_type": "code", "id": "920dcdf1", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "df[\"has_structure\"].value_counts(normalize=True).mul(100).round(1)" ] }, { "cell_type": "markdown", "id": "690d1dd5", "metadata": {}, "source": [ "## 8. Annotation richness" ] }, { "cell_type": "code", "id": "7985111d", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "df[[\"function_length\", \"domain_count\", \"go_term_count\", \"variant_count\"]].describe().T.round(2)" ] }, { "cell_type": "markdown", "id": "6e43770c", "metadata": {}, "source": [ "## Next steps\n", "\n", "See `KAGGLE.md` for analysis ideas, caveats and provenance." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "name": "python", "version": "3.11", "mimetype": "text/x-python", "file_extension": ".py", "codemirror_mode": { "name": "ipython", "version": 3 }, "pygments_lexer": "ipython3", "nbconvert_exporter": "python" } }, "nbformat": 4, "nbformat_minor": 5 }