Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: process file upload before submitting isa-json to ena #65

Merged
merged 1 commit into from
Nov 7, 2024
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
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