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

Check before creating by_assembly directories #459

Merged
merged 2 commits into from
Sep 23, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,16 @@ def create_symlink_to_species_folder_from_assembly_folder(current_release_assemb
public_release_species_assembly_folder = os.path.join(release_properties.public_ftp_current_release_folder,
by_species_folder_name, species_release_folder_name,
assembly_accession)
run_command_with_output(f"""Creating symlink from assembly folder {public_release_assembly_species_folder} to
species folder {public_release_species_assembly_folder}""",
'bash -c "cd {0} && ln -sfT {1} {2}"'.format(
public_release_assembly_folder,
os.path.relpath(public_release_species_assembly_folder,
public_release_assembly_folder),
public_release_assembly_species_folder))
if os.path.isdir(public_release_assembly_species_folder):
run_command_with_output(f"""Creating symlink from assembly folder {public_release_assembly_species_folder} to
species folder {public_release_species_assembly_folder}""",
'bash -c "cd {0} && ln -sfT {1} {2}"'.format(
public_release_assembly_folder,
os.path.relpath(public_release_species_assembly_folder,
public_release_assembly_folder),
public_release_assembly_species_folder))
else:
raise Exception(f'The species folder {public_release_assembly_species_folder} we're linking to does not exist')


def recreate_public_release_species_assembly_folder(assembly_accession, public_release_species_assembly_folder):
Expand Down Expand Up @@ -198,9 +201,10 @@ def publish_assembly_release_files_to_ftp(current_release_assembly_info, release
)
)

# Create a link from assembly folder to species_folder ex: by_assembly/GCA_000005005.5/zea_mays to by_species/zea_mays/GCA_000005005.5
create_symlink_to_species_folder_from_assembly_folder(current_release_assembly_info, release_properties,
public_release_assembly_folder)
if current_release_assembly_info["num_rs_to_release"] > 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debatable whether this is even a good idea, but elsewhere we check both num_rs_to_release and should_be_released... should we do the same here to be consistent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right that this is inconsistent with what is done elsewhere.
The reason I've only used the num_rs_to_release is because originally the should_be_released flag really meant that the release pipeline should be run not that the data should be copied and in previous version of the release automation should_be_released=false and num_rs_to_release>0 was used to denote release that had not changed since the previous release and could be hard-linked.

# Create a link from assembly folder to species_folder ex: by_assembly/GCA_000005005.5/zea_mays to by_species/zea_mays/GCA_000005005.5
create_symlink_to_species_folder_from_assembly_folder(current_release_assembly_info, release_properties,
public_release_assembly_folder)


def get_release_assemblies_for_release_version(assemblies_to_process, release_version):
Expand Down
Loading