Skip to content
Snippets Groups Projects
Commit 65460ef4 authored by AndiMajore's avatar AndiMajore
Browse files

commented out depricated functions

parent d36f3097
No related branches found
No related tags found
No related merge requests found
...@@ -31,55 +31,55 @@ class DataPopulator: ...@@ -31,55 +31,55 @@ class DataPopulator:
for disorder in models.Disorder.objects.all(): for disorder in models.Disorder.objects.all():
self.disorders[disorder.mondo_id]=disorder self.disorders[disorder.mondo_id]=disorder
def populate_proteins(self) -> int: # def populate_proteins(self) -> int:
""" Populates the Protein table in the django database. # """ Populates the Protein table in the django database.
Handles loading the data and passing it to the django database # Handles loading the data and passing it to the django database
#
Returns: # Returns:
int: Count of how many proteins were added # int: Count of how many proteins were added
""" # """
df = DataLoader.load_proteins() # df = DataLoader.load_proteins()
for _, row in df.iterrows(): # for _, row in df.iterrows():
self.proteins[row['entrez_id']] = models.Protein( # self.proteins[row['entrez_id']] = models.Protein(
uniprot_code=row['protein_ac'], # uniprot_code=row['protein_ac'],
gene=row['gene_name'], # gene=row['gene_name'],
entrez=row['entrez_id'], # entrez=row['entrez_id'],
protein_name=row['protein_name']) # protein_name=row['protein_name'])
self.uniprot_to_ensembl[row['protein_ac']] = row['entrez_id'] # self.uniprot_to_ensembl[row['protein_ac']] = row['entrez_id']
self.gene_name_to_ensembl[row['gene_name']].add(row['entrez_id']) # self.gene_name_to_ensembl[row['gene_name']].add(row['entrez_id'])
#
models.Protein.objects.bulk_create(self.proteins.values()) # models.Protein.objects.bulk_create(self.proteins.values())
return len(self.proteins) # return len(self.proteins)
#
def populate_disorders(self) -> int: # def populate_disorders(self) -> int:
""" Populates the Disorder table in the django database. # """ Populates the Disorder table in the django database.
Handles loading the data and passing it to the django database # Handles loading the data and passing it to the django database
#
Returns: # Returns:
int: Count of how many disorders were added # int: Count of how many disorders were added
""" # """
df = DataLoader.load_disorders() # df = DataLoader.load_disorders()
for _, row in df.iterrows(): # for _, row in df.iterrows():
self.disorders[row['mondo_id']] = models.Disorder( # self.disorders[row['mondo_id']] = models.Disorder(
mondo_id=row['mondo_id'], # mondo_id=row['mondo_id'],
label=row['label'], # label=row['label'],
icd10=row['icd10'] # icd10=row['icd10']
) # )
models.Disorder.objects.bulk_create(self.disorders.values()) # models.Disorder.objects.bulk_create(self.disorders.values())
return len(self.disorders) # return len(self.disorders)
#
def populate_drugs(self): # def populate_drugs(self):
df = DataLoader.load_drugs() # df = DataLoader.load_drugs()
for _, row in df.iterrows(): # for _, row in df.iterrows():
drug_id = row['drug_id'] # drug_id = row['drug_id']
drug_name = row['drug_name'] # drug_name = row['drug_name']
drug_status = row['drug_status'] # drug_status = row['drug_status']
self.drugs[drug_id] = models.Drug( # self.drugs[drug_id] = models.Drug(
drug_id=drug_id, # drug_id=drug_id,
name=drug_name, # name=drug_name,
status=drug_status) # status=drug_status)
models.Drug.objects.bulk_create(self.drugs.values()) # models.Drug.objects.bulk_create(self.drugs.values())
return len(self.drugs) # return len(self.drugs)
def populate_expessions(self): def populate_expessions(self):
self.init_proteins() self.init_proteins()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment