Mercurial > repos > trinity_ctat > ctat_genome_resource_libs_data_manager_3
changeset 40:36c4ac3db40e draft
Fixed inconsistent gmap success filename.
author | trinity_ctat |
---|---|
date | Thu, 25 Oct 2018 17:26:18 -0400 |
parents | 07cb45d19f25 |
children | c90930ebbbc2 |
files | data_manager/add_ctat_resource_lib.py |
diffstat | 1 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/data_manager/add_ctat_resource_lib.py Thu Oct 25 16:58:59 2018 -0400 +++ b/data_manager/add_ctat_resource_lib.py Thu Oct 25 17:26:18 2018 -0400 @@ -699,7 +699,13 @@ os.remove(archive_filepath) # else: # It was removed previously, so we don't need to remove it again. return extracted_directory - + +def get_gmap_success_filename(genome_build_directory) + genome_name = find_genome_name_in_path(genome_build_directory) + if genome_name is None: + genome_name = os.path.basename(genome_build_directory) + return "{:s}.{:s}".format(genome_name, _GmapSuccessFile) + def gmap_the_library(genome_build_directory, force_new_gmap=False): # This is the processing that needs to happen for gmap-fusion to work. # genome_build_directory should normally be a fully specified path, @@ -708,7 +714,7 @@ # so route stderr to stdout. Otherwise, galaxy thinks an error occurred. # Create the name of the file used to indicate prior success of gmap. - gmap_success_filename = "{:s}.{:s}".format(os.path.basename(genome_build_directory), _GmapSuccessFile) + gmap_success_filename = get_gmap_success_filename(genome_build_directory) gmap_success_full_file_path = os.path.join(genome_build_directory, gmap_success_filename) orig_files_in_build_dir = set(os.listdir(genome_build_directory)) @@ -841,7 +847,7 @@ "to:\n\t{:s}\nsucceeded.".format(cannonical_destination)) if gmap_build: # Create the gmap success file. - gmap_success_filename = "{:s}.{:s}".format(src_filename, _GmapSuccessFile) + gmap_success_filename = get_gmap_success_filename(cannonical_destination) gmap_success_full_file_path = os.path.join(cannonical_destination, gmap_success_filename) create_success_file(gmap_success_full_file_path, \ "gmap of:\n\t{:s}\nsucceeded.".format(cannonical_destination))