# Generated by Django 5.1.2 on 2024-12-12 17:37

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Gene',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hugo_symbol', models.CharField(blank=True, help_text='Gene name', max_length=100, null=True)),
                ('entrez_gene_id', models.IntegerField(help_text='Unique Entrez Gene ID', unique=True)),
            ],
            options={
                'verbose_name': 'Gene',
                'verbose_name_plural': 'Genes',
                'db_table': 'tcga_gene',
            },
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('patient_id', models.CharField(help_text='Unique TCGA patient identifier', max_length=50, primary_key=True, serialize=False, unique=True)),
                ('case_id', models.CharField(blank=True, help_text='Case ID associated with the patient (if applicable)', max_length=50, null=True)),
            ],
            options={
                'verbose_name': 'Patient',
                'verbose_name_plural': 'Patients',
                'db_table': 'tcga_patient',
            },
        ),
        migrations.CreateModel(
            name='Dataset',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Unique name for the dataset', max_length=100, unique=True)),
                ('description', models.TextField(blank=True, help_text='Description of the dataset', null=True)),
                ('case_id_suffix', models.CharField(blank=True, help_text='Suffix for case IDs to distinguish this dataset', max_length=50, null=True)),
                ('case_ids', models.ManyToManyField(help_text='Patients linked to this dataset', related_name='datasets', to='tcgabcd.patient')),
            ],
            options={
                'verbose_name': 'Dataset',
                'verbose_name_plural': 'Datasets',
                'db_table': 'tcga_dataset',
            },
        ),
        migrations.CreateModel(
            name='ClinicalSample',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sample_id', models.CharField(max_length=50, unique=True)),
                ('oncotree_code', models.CharField(blank=True, max_length=20, null=True)),
                ('cancer_type', models.CharField(blank=True, max_length=100, null=True)),
                ('cancer_type_detailed', models.CharField(blank=True, max_length=100, null=True)),
                ('tumor_type', models.CharField(blank=True, max_length=100, null=True)),
                ('grade', models.CharField(blank=True, max_length=50, null=True)),
                ('tumor_tissue_site', models.CharField(blank=True, max_length=100, null=True)),
                ('aneuploidy_score', models.FloatField(blank=True, null=True)),
                ('sample_type', models.CharField(blank=True, max_length=50, null=True)),
                ('msi_score_mantis', models.FloatField(blank=True, null=True)),
                ('msi_sensor_score', models.FloatField(blank=True, null=True)),
                ('somatic_status', models.CharField(blank=True, max_length=50, null=True)),
                ('tmb_nonsynonymous', models.FloatField(blank=True, null=True)),
                ('tissue_source_site', models.CharField(blank=True, max_length=100, null=True)),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='clinical_samples', to='tcgabcd.patient')),
            ],
            options={
                'verbose_name': 'Clinical Sample',
                'verbose_name_plural': 'Clinical Samples',
                'db_table': 'tcga_clinical_sample',
            },
        ),
        migrations.CreateModel(
            name='TreatmentTimeline',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_date', models.IntegerField(help_text='Days from initial diagnosis')),
                ('stop_date', models.IntegerField(blank=True, help_text='Days from initial diagnosis', null=True)),
                ('event_type', models.CharField(choices=[('Treatment', 'Treatment'), ('Follow Up', 'Follow Up')], max_length=50)),
                ('treatment_type', models.CharField(choices=[('Radiation Therapy', 'Radiation Therapy'), ('Chemotherapy', 'Chemotherapy'), ('Hormone Therapy', 'Hormone Therapy'), ('Immunotherapy', 'Immunotherapy'), ('Targeted Molecular Therapy', 'Targeted Molecular Therapy'), ('Other', 'Other')], max_length=50)),
                ('treatment_subtype', models.CharField(blank=True, max_length=100, null=True)),
                ('agent', models.CharField(blank=True, max_length=100, null=True)),
                ('number_of_cycles', models.CharField(blank=True, max_length=50, null=True)),
                ('prescribed_dose', models.CharField(blank=True, max_length=50, null=True)),
                ('prescribed_dose_units', models.CharField(blank=True, max_length=20, null=True)),
                ('regimen_number', models.CharField(blank=True, max_length=20, null=True)),
                ('regimen_indication', models.CharField(blank=True, max_length=50, null=True)),
                ('measure_of_response', models.CharField(blank=True, max_length=50, null=True)),
                ('clinical_trial_drug_classification', models.CharField(blank=True, max_length=100, null=True)),
                ('route_of_administration', models.CharField(blank=True, max_length=20, null=True)),
                ('therapy_ongoing', models.CharField(blank=True, max_length=5, null=True)),
                ('total_dose', models.CharField(blank=True, max_length=20, null=True)),
                ('total_dose_units', models.CharField(blank=True, max_length=20, null=True)),
                ('tx_on_clinical_trial', models.CharField(blank=True, max_length=5, null=True)),
                ('anatomic_treatment_site', models.CharField(blank=True, max_length=100, null=True)),
                ('course_number', models.FloatField(blank=True, null=True)),
                ('number_of_fractions', models.IntegerField(blank=True, null=True)),
                ('radiation_dosage', models.IntegerField(blank=True, null=True)),
                ('radiation_treatment_ongoing', models.CharField(blank=True, max_length=5, null=True)),
                ('radiation_type', models.CharField(blank=True, max_length=50, null=True)),
                ('radiation_type_notes', models.TextField(blank=True, null=True)),
                ('radiation_units', models.CharField(blank=True, max_length=20, null=True)),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='treatments', to='tcgabcd.patient')),
            ],
            options={
                'verbose_name': 'Treatment Timeline',
                'verbose_name_plural': 'Treatment Timelines',
                'db_table': 'tcga_treatment_timeline',
                'ordering': ['patient', 'start_date'],
            },
        ),
        migrations.CreateModel(
            name='HypoxiaScore',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('buffa_score', models.IntegerField(help_text='mRNA based Buffa Hypoxia Score')),
                ('winter_score', models.IntegerField(help_text='mRNA based Winter Hypoxia Score')),
                ('ragnum_score', models.IntegerField(help_text='mRNA based Ragnum Hypoxia Score')),
                ('patient', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='hypoxia_scores', to='tcgabcd.patient')),
            ],
            options={
                'verbose_name': 'Hypoxia Score',
                'verbose_name_plural': 'Hypoxia Scores',
                'db_table': 'tcga_hypoxia_scores',
                'indexes': [models.Index(fields=['buffa_score'], name='tcga_hypoxi_buffa_s_8a76d8_idx'), models.Index(fields=['winter_score'], name='tcga_hypoxi_winter__fb9435_idx'), models.Index(fields=['ragnum_score'], name='tcga_hypoxi_ragnum__fa7728_idx')],
            },
        ),
        migrations.CreateModel(
            name='GeneExpression',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('z_score', models.FloatField(help_text='Z-score for the gene expression')),
                ('gene', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='expressions', to='tcgabcd.gene')),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gene_expressions', to='tcgabcd.patient')),
            ],
            options={
                'verbose_name': 'Gene Expression',
                'verbose_name_plural': 'Gene Expressions',
                'db_table': 'tcga_gene_expression',
                'unique_together': {('gene', 'patient')},
            },
        ),
        migrations.CreateModel(
            name='ClinicalPatient',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subtype', models.CharField(blank=True, max_length=50, null=True)),
                ('cancer_type_acronym', models.CharField(blank=True, max_length=10, null=True)),
                ('age', models.IntegerField(blank=True, null=True)),
                ('sex', models.CharField(max_length=10)),
                ('ajcc_pathologic_tumor_stage', models.CharField(blank=True, max_length=20, null=True)),
                ('ajcc_staging_edition', models.CharField(blank=True, max_length=20, null=True)),
                ('days_last_followup', models.IntegerField(blank=True, null=True)),
                ('days_to_birth', models.IntegerField(blank=True, null=True)),
                ('ethnicity', models.CharField(blank=True, max_length=50, null=True)),
                ('icd_10', models.CharField(blank=True, max_length=10, null=True)),
                ('icd_o_3_histology', models.CharField(blank=True, max_length=10, null=True)),
                ('icd_o_3_site', models.CharField(blank=True, max_length=10, null=True)),
                ('new_tumor_event_after_initial_treatment', models.CharField(blank=True, max_length=3, null=True)),
                ('path_m_stage', models.CharField(blank=True, max_length=10, null=True)),
                ('path_n_stage', models.CharField(blank=True, max_length=10, null=True)),
                ('path_t_stage', models.CharField(blank=True, max_length=10, null=True)),
                ('person_neoplasm_cancer_status', models.CharField(blank=True, max_length=20, null=True)),
                ('race', models.CharField(blank=True, max_length=50, null=True)),
                ('weight', models.FloatField(blank=True, null=True)),
                ('genetic_ancestry_label', models.CharField(blank=True, max_length=20, null=True)),
                ('os_status', models.CharField(blank=True, choices=[('0:LIVING', 'Living'), ('1:DECEASED', 'Deceased')], max_length=20, null=True)),
                ('os_months', models.FloatField(blank=True, null=True)),
                ('dss_status', models.CharField(blank=True, max_length=50, null=True)),
                ('dss_months', models.FloatField(blank=True, null=True)),
                ('dfs_status', models.CharField(blank=True, choices=[('0:DiseaseFree', 'Disease Free'), ('1:Recurred/Progressed', 'Recurred/Progressed')], max_length=50, null=True)),
                ('dfs_months', models.FloatField(blank=True, null=True)),
                ('pfs_status', models.CharField(blank=True, choices=[('0:CENSORED', 'Censored'), ('1:PROGRESSION', 'Progression')], max_length=50, null=True)),
                ('pfs_months', models.FloatField(blank=True, null=True)),
                ('patient', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='clinical_data', to='tcgabcd.patient')),
            ],
            options={
                'verbose_name': 'Clinical Patient Data',
                'verbose_name_plural': 'Clinical Patient Data',
                'db_table': 'tcga_clinical_patient',
                'indexes': [models.Index(fields=['subtype'], name='tcga_clinic_subtype_33cab6_idx'), models.Index(fields=['os_status'], name='tcga_clinic_os_stat_19c92a_idx'), models.Index(fields=['ajcc_pathologic_tumor_stage'], name='tcga_clinic_ajcc_pa_9fe11f_idx')],
            },
        ),
    ]
