Skip to content

Commit

Permalink
Merge pull request #65 from lbouri/fix_ena_pipeline
Browse files Browse the repository at this point in the history
fix: process file upload before submitting isa-json to ena
  • Loading branch information
kdp-cloud authored Nov 7, 2024
2 parents 4135a56 + 223206b commit a180bab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
6 changes: 0 additions & 6 deletions mars-cli/mars_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,6 @@ def cli(ctx, development):
multiple=True,
help="Path of files to upload",
)
# @click.option(
# "--data-submit-to-ena",
# type=click.BOOL,
# default=False,
# help="Submit data files to ENA.",
# )
@click.option(
"--submit-to-metabolights",
type=click.BOOL,
Expand Down
22 changes: 10 additions & 12 deletions mars-cli/mars_lib/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,16 @@ def submission(
f"ISA JSON with investigation '{isa_json.investigation.title}' is valid."
)

if (
TargetRepository.ENA in target_repositories
and data_file_paths
and file_transfer
):
upload_to_ena(
file_paths=data_file_paths,
user_credentials=user_credentials,
submission_url=urls["ENA"]["DATA-SUBMISSION"],
file_transfer=file_transfer,
)
elif TargetRepository.ENA in target_repositories:
if TargetRepository.ENA in target_repositories:
# Step 1 : upload data if file paths are provided
if data_file_paths and file_transfer:
upload_to_ena(
file_paths=data_file_paths,
user_credentials=user_credentials,
submission_url=urls["ENA"]["DATA-SUBMISSION"],
file_transfer=file_transfer,
)
# Step 2 : submit isa-json to ena
# TODO: Filter out other assays
ena_result = submit_to_ena(
isa_json=isa_json,
Expand Down

0 comments on commit a180bab

Please sign in to comment.