Reference
Cohort
Cohort class for managing and processing medical data.
Attributes: |
|
---|
Methods: init(data, output_dir): Initializes the Cohort instance with data and output directory. generate_manifest(): Generates a manifest file for the cohort using the Aggregator class. download(threads=4, include=None, exclude=None): Downloads files specified in the manifest. Raises FileNotFoundError if the manifest file is missing. include(modalities): Specifies the modalities to include in the download process. stats(): Prints and returns statistics of the cohort, including file count and total size, grouped by modality. _download_gdc_files(threads, include=None, exclude=None): Downloads files from GDC using the GDCFileDownloader class. _download_tcia_files(threads, include=None, exclude=None): Downloads files from TCIA using the TCIAFileDownloader class.
Source code in app/med_minds/__init__.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
stats()
Prints the statistics of the cohort in terms of file count and total size
Returns: |
|
---|
Source code in app/med_minds/__init__.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
build_cohort(output_dir, query=None, gdc_cohort=None, manifest=None)
Builds a cohort based on a query or a GDC cohort file and returns a Cohort object.
Source code in app/med_minds/__init__.py
177 178 179 180 181 182 183 184 185 186 187 188 189 |
|
get_columns(table)
Get the list of columns in a table
Parameters
table : str The name of the table
Returns
list A list of columns in the table
Source code in app/med_minds/__init__.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
get_tables()
Get the list of tables in the database
Returns
list A list of tables in the database
Source code in app/med_minds/__init__.py
19 20 21 22 23 24 25 26 27 |
|
query(query)
Query the database and return the result as a pandas dataframe
Parameters
query_string : str The query string to be executed on the database
Returns
pandas.DataFrame The result of the query
Source code in app/med_minds/__init__.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|