<jupyter_start><jupyter_text>Import Modules<jupyter_code>import pandas as pd

import api_tools as apit
import access_cBioPortal as cbio<jupyter_output><empty_output><jupyter_text>Load cBioPortal API using SwaggerWe define an object `cbioportal`, serving as our connection to the cBioPortal API.Reference: [cBioPortal "API and API Clients" documentation](https://docs.cbioportal.org/6.-web-api-and-clients/api-and-api-clients)<jupyter_code>client = apit.get_swagger_api_client(url='https://www.cbioportal.org/api/api-docs')<jupyter_output><empty_output><jupyter_text>Get Molecular Profiles<jupyter_code>df_molecular_profiles = cbio.get_all_from_bioportal_endpoint(client, "Molecular Profiles", out_path="molecular_profiles.csv")
df_molecular_profiles.head()<jupyter_output><empty_output><jupyter_text>Get Studies<jupyter_code>df_studies = cbio.get_all_from_bioportal_endpoint(client, "Studies", out_path="studies.csv")
df_studies.head()<jupyter_output><empty_output><jupyter_text>Get Sample Lists<jupyter_code>df_sample_lists = cbio.get_all_from_bioportal_endpoint(client, "Sample Lists", out_path="sample_lists.csv")
df_sample_lists.head()<jupyter_output><empty_output><jupyter_text>Get Cancer Types<jupyter_code>df_cancer_types = cbio.get_all_from_bioportal_endpoint(client, "Cancer Types", out_path="cancer_types.csv")
df_cancer_types.head()<jupyter_output><empty_output><jupyter_text>Get Patients<jupyter_code>df_patients = cbio.get_all_from_bioportal_endpoint(client, "Patients", out_path="patients.csv")
df_patients.head()<jupyter_output><empty_output><jupyter_text>Get Samples<jupyter_code>df_samples = cbio.get_all_from_bioportal_endpoint(client, "Samples", out_path="samples.csv")
df_samples.head()<jupyter_output>Parsing Study 100 of 339
Parsing Study 200 of 339
Parsing Study 300 of 339<jupyter_text>Get Patient Cancer Types<jupyter_code>df_clinical_data = cbio.get_all_from_bioportal_endpoint(client, "Clinical Data", out_path="clinical_data.csv")
df_clinical_data.head()<jupyter_output>Parsing Study 100 of 339
Parsing Study 200 of 339
Parsing Study 300 of 339<jupyter_text>Get Mutations<jupyter_code>cbio.get_all_from_bioportal_endpoint(
    client, "Mutations", out_path="mutations.csv"
)<jupyter_output>Getting mutation list 100 of 13839
Getting mutation list 200 of 13839
Getting mutation list 300 of 13839
Getting mutation list 400 of 13839
Getting mutation list 500 of 13839
Getting mutation list 600 of 13839
Getting mutation list 700 of 13839
Getting mutation list 800 of 13839
Getting mutation list 900 of 13839
Getting mutation list 1000 of 13839
Getting mutation list 1100 of 13839
Getting mutation list 1200 of 13839
Getting mutation list 1300 of 13839
Getting mutation list 1400 of 13839
Getting mutation list 1500 of 13839
Getting mutation list 1600 of 13839
Getting mutation list 1700 of 13839
Getting mutation list 1800 of 13839
Getting mutation list 1900 of 13839
Getting mutation list 2000 of 13839
Getting mutation list 2100 of 13839
Getting mutation list 2200 of 13839
Getting mutation list 2300 of 13839
Getting mutation list 2400 of 13839
Getting mutation list 2500 of 13839
Getting mutation list 2600 of 13839
Getting mutation list 2700 of 13839
Getting mutation list 2800 of 13839
G[...]
{'fraction_non_alphanumeric': 0.07384424449270865, 'fraction_numerical': 0.08687558175612783, 'mean_word_length': 8.39941690962099, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 38, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '70997', 'license': 'MIT', 'n_tokens_mistral': 1385, 'n_tokens_neox': 1047, 'n_words': 281, 'path': 'src/cBioPortal_API_Usage.ipynb', 'repo_name': 'jmichuda/bmi-214-final-project', 'size': '3223'}