Skip to content

Commit

Permalink
rename method and update calls in base
Browse files Browse the repository at this point in the history
  • Loading branch information
mbthornton-lbl committed Jan 22, 2024
1 parent 2005ba6 commit b09cdcf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions nmdc_automation/re_iding/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
get_data_object_record_by_id,
get_omics_processing_id)
from nmdc_automation.re_iding.file_utils import (find_data_object_type,
compute_new_paths,
assembly_file_operations)
compute_new_paths_and_link,
assembly_file_operations)

NAPA_TEMPLATE = "../../../configs/re_iding_worklfows.yaml"
DATA_BASE_URL = "https://data.microbiomedata.org/data"
Expand Down Expand Up @@ -165,7 +165,7 @@ def update_reads_qc_analysis_activity_set(self, db_record: Dict,
logger.info(f"old_do_id: {old_do_id}")
old_do_rec = get_data_object_record_by_id(db_record, old_do_id)
data_object_type = find_data_object_type(old_do_rec)
new_file_path = compute_new_paths(
new_file_path = compute_new_paths_and_link(
old_do_rec["url"], new_readsqc_base_dir, new_activity_id, self.data_dir
)
logging.info(f"New file path computed for {data_object_type}: {new_file_path}")
Expand Down Expand Up @@ -223,7 +223,7 @@ def update_metagenome_assembly_set(self, db_record: Dict,
data_object_type = find_data_object_type(old_do_rec)
if not data_object_type:
continue
new_file_path = compute_new_paths(old_do_rec["url"],new_assembly_base_dir, new_activity_id)
new_file_path = compute_new_paths_and_link(old_do_rec["url"], new_assembly_base_dir, new_activity_id)
updated_md5, updated_file_size = assembly_file_operations(
old_do_rec, data_object_type, new_file_path, new_activity_id,
self.data_dir)
Expand Down Expand Up @@ -286,7 +286,7 @@ def update_read_based_taxonomy_analysis_activity_set(self, db_record: Dict,
data_object_type = find_data_object_type(old_do_rec)
if not data_object_type:
continue
new_file_path = compute_new_paths(
new_file_path = compute_new_paths_and_link(
old_do_rec["url"], new_readbased_base_dir, new_activity_id, self.data_dir
)
logging.info(f"New file path computed for {data_object_type}: {new_file_path}")
Expand Down Expand Up @@ -360,12 +360,11 @@ def update_metatranscriptome_activity_set(self, db_record: Dict,
if not data_object_type:
logger.warning(f"Data object type not found for {old_do_id}")
# continue

new_file_path = compute_new_paths(old_do_rec["url"],new_metatranscriptome_base_dir, new_activity_id)
# link data object to new location
new_file_path = compute_new_paths_and_link(
old_do_rec["url"], new_metatranscriptome_base_dir, new_activity_id, self.data_dir)
logging.info(f"New file path computed for {data_object_type}: {new_file_path}")

# TODO: determine file operations if any, similar to assembly_file_operations

new_do = self.make_new_data_object(
omics_processing_id, activity_type, new_activity_id, old_do_rec, data_object_type
)
Expand Down
2 changes: 1 addition & 1 deletion nmdc_automation/re_iding/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def assembly_file_operations(data_object_record, data_object_type,
return md5, size


def compute_new_paths(
def compute_new_paths_and_link(
old_url: str,
new_base_dir: Union[str, os.PathLike],
act_id: str,
Expand Down

0 comments on commit b09cdcf

Please sign in to comment.