Quick Reference
To see help pages while you work type:
help(function)
example:
help(fetch_rows)
Import available cdapython
functions¶
In [2]:
Copied!
from cdapython import tables, columns, column_values, fetch_rows, summary_counts
from cdapython import tables, columns, column_values, fetch_rows, summary_counts
Get a list of searchable CDA tables¶
In [3]:
Copied!
tables()
tables()
Out[3]:
['diagnosis', 'file', 'mutation', 'researchsubject', 'specimen', 'subject', 'treatment']
Explore CDA tables' columns in detail¶
In [4]:
Copied!
columns()
columns()
Out[4]:
Loading ITables v2.4.0 from the init_notebook_mode cell...
(need help?) |
See what values are populated in a given column¶
In [5]:
Copied!
column_values( 'primary_diagnosis_site' )
column_values( 'primary_diagnosis_site' )
Out[5]:
Loading ITables v2.4.0 from the init_notebook_mode cell...
(need help?) |
Fetch subject row summary information for a column value¶
In [6]:
Copied!
summary_counts( table= 'subject', match_all = 'primary_diagnosis_site = kid*')
summary_counts( table= 'subject', match_all = 'primary_diagnosis_site = kid*')
╔═════════════════════════╗ ║ total_subject_matches ║ ╠═════════════════════════╣ ║ 2738 ║ ╚═════════════════════════╝ ╔═══════════════════════╗ ║ total_related_files ║ ╠═══════════════════════╣ ║ 556489 ║ ╚═══════════════════════╝ ╔═════════╦═══════════════════════╗ ║ count ║ subject_data_source ║ ╠═════════╬═══════════════════════╣ ║ 2436 ║ GDC ║ ║ 1388 ║ IDC ║ ║ 269 ║ PDC ║ ║ 213 ║ CDS ║ ║ 1 ║ ICDC ║ ╚═════════╩═══════════════════════╝ ╔═════════╦════════╗ ║ count ║ sex ║ ╠═════════╬════════╣ ║ 1659 ║ male ║ ║ 1077 ║ female ║ ║ 2 ║ <NA> ║ ╚═════════╩════════╝ ╔═════════╦═══════════════════════════════════════════╗ ║ count ║ race ║ ╠═════════╬═══════════════════════════════════════════╣ ║ 1607 ║ White ║ ║ 808 ║ <NA> ║ ║ 277 ║ Black or African American ║ ║ 43 ║ Asian ║ ║ 2 ║ American Indian or Alaska Native ║ ║ 1 ║ Native Hawaiian or Other Pacific Islander ║ ╚═════════╩═══════════════════════════════════════════╝ ╔═════════╦════════════════════╗ ║ count ║ ethnicity ║ ╠═════════╬════════════════════╣ ║ 1353 ║ Non-Hispanic ║ ║ 1254 ║ <NA> ║ ║ 131 ║ Hispanic or Latino ║ ╚═════════╩════════════════════╝ ╔═════════╦══════════════════════════╗ ║ count ║ cause_of_death ║ ╠═════════╬══════════════════════════╣ ║ 2563 ║ <NA> ║ ║ 155 ║ Cancer-Related Death ║ ║ 7 ║ Infection ║ ║ 7 ║ Toxicity ║ ║ 4 ║ Non-Cancer Related Death ║ ║ 1 ║ Cardiovascular Disorder ║ ║ 1 ║ Surgical Complication ║ ╚═════════╩══════════════════════════╝
Fetch rows from any table for a column value¶
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
1 |
|
Fetch subject rows for a column value¶
In [7]:
Copied!
fetch_rows( table= 'mutation', match_all = 'subject_id = TCGA.TCGA-04-1369')
fetch_rows( table= 'mutation', match_all = 'subject_id = TCGA.TCGA-04-1369')
Out[7]:
Loading ITables v2.4.0 from the init_notebook_mode cell...
(need help?) |