From 150d40c19dc0a3f2383f3f3b4b859d59f8f38c39 Mon Sep 17 00:00:00 2001 From: shjenkins94 Date: Fri, 29 Sep 2023 18:42:36 +0900 Subject: [PATCH 1/4] Fixed u12 check --- toga.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toga.py b/toga.py index af75a26..91902b7 100755 --- a/toga.py +++ b/toga.py @@ -329,13 +329,13 @@ def __check_args_correctness(self, args): def __check_param_files(self): """Check that all parameter files exist.""" files_to_check = [ - self.u12, self.t_2bit, self.q_2bit, self.cesar_binary, self.ref_bed, self.chain_file, self.isoforms_arg, + self.u12_arg, ] for item in files_to_check: if not item: From 5504727795991a0215a2d3812b62f2fede5874f7 Mon Sep 17 00:00:00 2001 From: shjenkins94 Date: Fri, 29 Sep 2023 18:45:01 +0900 Subject: [PATCH 2/4] made u12 more similar to isoforms --- modules/sanity_check_functions.py | 2 +- toga.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/sanity_check_functions.py b/modules/sanity_check_functions.py index 19d3468..4af6d6b 100644 --- a/modules/sanity_check_functions.py +++ b/modules/sanity_check_functions.py @@ -57,7 +57,7 @@ def check_2bit_file_completeness(two_bit_file, chroms_sizes, chrom_file): return -def check_and_write_u12_file(t_in_bed, u12_arg, temp_wd): +def check_and_write_u12_file(u12_arg, t_in_bed, temp_wd): """Sanity check for U12 file.""" if u12_arg is None: return None diff --git a/toga.py b/toga.py index 91902b7..289dc6d 100755 --- a/toga.py +++ b/toga.py @@ -170,6 +170,8 @@ def __init__(self, args): # mics things self.isoforms_arg = args.isoforms if args.isoforms else None self.isoforms = None # will be assigned after completeness check + self.u12_arg = args.u12 + self.u12 = None # assign after U12 file check self.chain_jobs = args.chain_jobs_num self.cesar_binary = ( self.DEFAULT_CESAR if not args.cesar_binary else args.cesar_binary @@ -246,9 +248,7 @@ def __init__(self, args): self.temp_wd, Constants.CESAR_PRECOMPUTED_MEMORY_DATA ) self.precomp_reg_dir = None - self.cesar_mem_was_precomputed = False - self.u12_arg = args.u12 - self.u12 = None # assign after U12 file check + self.cesar_mem_was_precomputed = False # genes to be classified as missing self._transcripts_not_intersected = [] @@ -355,7 +355,7 @@ def __check_param_files(self): # to compare chrom lengths with 2bit chrom_sizes_in_bed = {x: None for x in chroms_in_bed} self.isoforms = check_isoforms_file(self.isoforms_arg, t_in_bed, self.temp_wd) - self.u12 = check_and_write_u12_file(t_in_bed, self.u12_arg, self.temp_wd) + self.u12 = check_and_write_u12_file(self.u12_arg, t_in_bed, self.temp_wd) check_2bit_file_completeness(self.t_2bit, chrom_sizes_in_bed, self.ref_bed) # need to check that chain chroms and their sizes match 2bit file data with open(self.chain_file, "r") as f: From abaab379a22d1be92348ce65b88bf59013482851 Mon Sep 17 00:00:00 2001 From: shjenkins94 Date: Fri, 29 Sep 2023 18:45:42 +0900 Subject: [PATCH 3/4] Also changed modules_addr to all use constants --- toga.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/toga.py b/toga.py index 289dc6d..c80cddd 100755 --- a/toga.py +++ b/toga.py @@ -381,19 +381,19 @@ def __modules_addr(self): self.LOCATION = os.path.dirname(__file__) # folder containing pipeline scripts self.CONFIGURE = os.path.join(self.LOCATION, "configure.sh") self.CHAIN_SCORE_FILTER = os.path.join( - self.LOCATION, "modules", "chain_score_filter" + self.LOCATION, Constants.MODULES_DIR, "chain_score_filter" ) self.CHAIN_SCORE_FILTER_AWK = os.path.join( - self.LOCATION, "modules", "chain_score_filter.awk" + self.LOCATION, Constants.MODULES_DIR, "chain_score_filter.awk" ) self.CHAIN_COORDS_CONVERT_LIB = os.path.join( - self.LOCATION, "modules", "chain_coords_converter_slib.so" + self.LOCATION, Constants.MODULES_DIR, "chain_coords_converter_slib.so" ) self.EXTRACT_SUBCHAIN_LIB = os.path.join( - self.LOCATION, "modules", "extract_subchain_slib.so" + self.LOCATION, Constants.MODULES_DIR, "extract_subchain_slib.so" ) self.CHAIN_FILTER_BY_ID = os.path.join( - self.LOCATION, "modules", "chain_filter_by_id" + self.LOCATION, Constants.MODULES_DIR, "chain_filter_by_id" ) self.CHAIN_BDB_INDEX = os.path.join( self.LOCATION, Constants.MODULES_DIR, "chain_bst_index.py" From e45b0f6e24d583242f194c70f0f4a38244521b57 Mon Sep 17 00:00:00 2001 From: shjenkins94 Date: Fri, 29 Sep 2023 18:56:25 +0900 Subject: [PATCH 4/4] assign self.u12 to None if not provided --- toga.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toga.py b/toga.py index c80cddd..7648131 100755 --- a/toga.py +++ b/toga.py @@ -170,7 +170,7 @@ def __init__(self, args): # mics things self.isoforms_arg = args.isoforms if args.isoforms else None self.isoforms = None # will be assigned after completeness check - self.u12_arg = args.u12 + self.u12_arg = args.u12 if args.u12 else None self.u12 = None # assign after U12 file check self.chain_jobs = args.chain_jobs_num self.cesar_binary = (