changeset 36:e3059a4ccf96 draft

Fixing the case where a build is requested, but not needed, and gmap build is demanded, so it will build even if it was already built.
author trinity_ctat
date Thu, 25 Oct 2018 16:28:55 -0400
parents 4cff4dbd7d6b
children ef9481f6e458
files data_manager/add_ctat_resource_lib.py
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager/add_ctat_resource_lib.py	Thu Oct 25 15:35:48 2018 -0400
+++ b/data_manager/add_ctat_resource_lib.py	Thu Oct 25 16:28:55 2018 -0400
@@ -747,7 +747,7 @@
     return
 
 
-def build_the_library(genome_source_directory, genome_build_directory, force_new_build=False, gmap_build=False):
+def build_the_library(genome_source_directory, genome_build_directory, force_new_build=False, gmap_build=False, force_gmap_build=False):
     """ genome_source_directory is the location of the source_data needed to build the library.
         Normally it is fully specified, but could be relative.
         genome_build_directory is the location where the library will be built.
@@ -850,7 +850,7 @@
         # We might still need to do a gmap_build.
         if gmap_build:
             print "Checking if we need to gmap the library."
-            gmap_the_library(cannonical_destination, force_new_build)
+            gmap_the_library(cannonical_destination, force_gmap_build)
             # gmap_the_library creates a gmap success file if it succeeds.
     else:
         print "build_the_library(): This code should never be printed. Something is wrong."
@@ -1424,21 +1424,22 @@
 
     # To take out builds for testing, comment out the lines that do the building.
     # The command that builds the ctat genome library also has an option for building the gmap indexes.
-    # That is why the gmap_build value is sent to build_the_library(), but if we are not building the
+    # That is why the gmap_build values are sent to build_the_library(), but if we are not building the
     # library, the user might still be asking for a gmap_build. That is done after rechecking for the
     # genome_build_directory.
     if (source_data_directory is not None):
         build_the_library(source_data_directory, \
                           genome_build_directory, \
                           args.new_library_build, \
-                          args.gmap_build)
+                          args.gmap_build
+                          args,force_gmap_build)
         lib_was_built = True
 
     # The following looks to see if the library actually exists after the build,
     # and raises an error if it cannot find the library files.
-    # The reassignment of genome_build_directory is superfluous in most cases, 
-    # since genome_build_directory should already point to the correct directory,
-    # except in the case where a user specifies a location that contains the 
+    # The reassignment of genome_build_directory can be superfluous, 
+    # since many times the genome_build_directory will already point to the correct directory.
+    # There are cases, however, where a user specifies a location that contains the 
     # genome_build_directory rather than is the genome_build_directory.
     genome_build_directory = search_for_genome_build_dir(genome_build_directory)