Skip to content

Commit

Permalink
Update loadSIGNOR.py
Browse files Browse the repository at this point in the history
Fixed issue where SIGNOR parsing fails due to filename not being included in self.data_files list.
  • Loading branch information
beasleyjonm committed Aug 21, 2024
1 parent 4c776d2 commit 6e8f693
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions parsers/SIGNOR/src/loadSIGNOR.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, test_mode: bool = False, source_data_dir: str = None):

self.signor_version = self.get_latest_source_version()
self.signor_file_name = f"getLatestRelease.php"
self.data_files = [self.signor_data_url,
self.data_files = [self.self.signor_file_name,
self.signor_phenotypes_filename,
self.signor_stimuli_filename
]
Expand All @@ -72,7 +72,7 @@ def get_data(self) -> int:
"""

data_puller = GetData()
i=0
file_count=0
for source in self.data_files:
if source == self.signor_phenotypes_filename:
mp_encoder = MultipartEncoder(fields={"submit":(None, "Download phenotype data")})
Expand All @@ -86,13 +86,11 @@ def get_data(self) -> int:
response = rq.post(self.signor_mapping_download,headers=headers,data=mp_encoder)
with open(os.path.join(self.data_path, self.signor_stimuli_filename), 'wb') as f:
f.write(response.content)
else:
elif source == self.signor_file_name:
source_url = f"{source}"
data_puller.pull_via_http(source_url, self.data_path)

i+=1
print(os.path.join(self.data_path,self.signor_file_name))
return True
data_puller.pull_via_http(self.signor_data_url, self.data_path)
file_count+=1
return file_count

def process_node_to_kgx(self,node_id: str, node_name: str, node_categories: list):
#self.logger.info(f'processing node: {node_identity}')
Expand Down Expand Up @@ -187,4 +185,4 @@ def check_mappings(column_name):
nodeB_id = self.process_node_to_kgx(nodeB_id, nodeB_name, nodeB_categories)
self.process_edge_to_kgx(subject_id=nodeA_id, predicate=predicate, object_id=nodeB_id, edgeprops=edgeprops)

return {}
return {}

0 comments on commit 6e8f693

Please sign in to comment.