Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions database/network-database/data_services/data_fetcher_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,7 @@ def fetch_data(self):
query.add_view(
"regulatoryRegions.regulator.symbol",
"regulatoryRegions.regulator.secondaryIdentifier", "symbol",
"secondaryIdentifier", "regulatoryRegions.regEvidence.ontologyTerm.name",
"regulatoryRegions.regEvidence.ontologyTerm.identifier",
"regulatoryRegions.experimentCondition",
"regulatoryRegions.strainBackground",
"regulatoryRegions.regulationDirection", "regulatoryRegions.regulationType",
"regulatoryRegions.regulatorType",
"regulatoryRegions.publications.pubMedId", "regulatoryRegions.datasource",
"regulatoryRegions.annotationType", "featureType",
"regulatoryRegions.regulator.featureType"
)
Expand All @@ -90,15 +84,6 @@ def fetch_data(self):
"regulatorSystematicName": row["regulatoryRegions.regulator.secondaryIdentifier"],
"targetStandardName": row["symbol"],
"targetSystematicName": row["secondaryIdentifier"],
"ontologyTermName": row["regulatoryRegions.regEvidence.ontologyTerm.name"],
"ontologyTermIdentifier": row["regulatoryRegions.regEvidence.ontologyTerm.identifier"],
"experimentCondition": row["regulatoryRegions.experimentCondition"],
"strainBackground": row["regulatoryRegions.strainBackground"],
"regulationDirection": row["regulatoryRegions.regulationDirection"],
"regulatoryRegionsRegulationType": row["regulatoryRegions.regulationType"],
"regulatoryRegionsRegulatorType": row["regulatoryRegions.regulatorType"],
"pubMedId": row["regulatoryRegions.publications.pubMedId"],
"datasource": row["regulatoryRegions.datasource"],
"annotationType": row["regulatoryRegions.annotationType"]
})

Expand All @@ -117,12 +102,10 @@ def fetch_data(self):
query.add_view(
"primaryIdentifier", "secondaryIdentifier", "symbol", "name", "sgdAlias",
"interactions.details.annotationType",
"interactions.details.experiment.publication.pubMedId",
"interactions.participant2.symbol",
"interactions.participant2.secondaryIdentifier",
"interactions.details.experiment.interactionDetectionMethods.identifier",
"interactions.details.experiment.name",
"interactions.details.relationshipType", "featureType",
"interactions.details.experiment.name", "featureType",
"interactions.participant2.featureType", "proteins.symbol",
"interactions.participant2.proteins.symbol"
)
Expand Down Expand Up @@ -152,13 +135,11 @@ def fetch_data(self):
"name ": row["name"],
"sgdAlias": row["sgdAlias"],
"annotationType": row["interactions.details.annotationType"],
"pubMedId": row["interactions.details.experiment.publication.pubMedId"],
"gene2StandardName": row["interactions.participant2.symbol"],
"gene2SystematicName": row["interactions.participant2.secondaryIdentifier"],
"protein2StandardName": row["interactions.participant2.proteins.symbol"],
"interactionDetectionMethodsIdentifier": row["interactions.details.experiment.interactionDetectionMethods.identifier"],
"experimentName": row["interactions.details.experiment.name"],
"relationshipType": row["interactions.details.relationshipType"]
})

df = pd.DataFrame(rows_data)
Expand Down
5 changes: 4 additions & 1 deletion database/network-database/data_services/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,13 @@ def _combine_with_protein_genes(self, genes, proteins):
genes_diff = genes[genes['systematicName'].isin(diff_systematic_names)]
proteins_diff = proteins[proteins['gene_systematic_name'].isin(diff_systematic_names)]

# Protein standard names are in the format of lowercase + "p" but for gene standard name, all letters should be uppercase and remove the trailing "p"
proteins_diff_with_correct_gene_standard_name = proteins_diff.copy()
proteins_diff_with_correct_gene_standard_name['standard_name'] = proteins_diff_with_correct_gene_standard_name['standard_name'].str.rstrip('p').str.upper()
# Combine the differences from both genes and proteins
diff_combined = pd.concat([
genes_diff[['systematicName', 'standardName']],
proteins_diff[['gene_systematic_name', 'standard_name']].rename(
proteins_diff_with_correct_gene_standard_name[['gene_systematic_name', 'standard_name']].rename(
columns={'gene_systematic_name': 'systematicName', 'standard_name': 'standardName'}
)
], ignore_index=True)
Expand Down