From 096e1e79c37048c0ce564fa393dc32b6924be4ea Mon Sep 17 00:00:00 2001 From: Venkat Malladi <venkat.malladi@utsouthwestern.edu> Date: Tue, 28 Jan 2020 16:26:12 -0600 Subject: [PATCH] Fix logic if paired-end and single replicate. --- workflow/scripts/pool_and_psuedoreplicate.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/workflow/scripts/pool_and_psuedoreplicate.py b/workflow/scripts/pool_and_psuedoreplicate.py index 25cc444..efefad9 100644 --- a/workflow/scripts/pool_and_psuedoreplicate.py +++ b/workflow/scripts/pool_and_psuedoreplicate.py @@ -204,6 +204,7 @@ def generate_design(paired, cutoff_ratio, design_df, cwd, no_reps, no_unique_con pool_control_tmp = bedpe_to_tagalign(pool_control, "pool_control") pool_control = pool_control_tmp + # Duplicate rows and update for pool and psuedoreplicates and update tagAlign with single end data experiment_id = design_df.at[0, 'experiment_id'] replicate_files = design_df.tag_align.unique() @@ -237,9 +238,9 @@ def generate_design(paired, cutoff_ratio, design_df, cwd, no_reps, no_unique_con else: pool_experiment_se = pool_experiment - # Check controls against cutoff_ratio - # if so replace with pool_control - # unless single control was used + # Check controls against cutoff_ratio + # if so replace with pool_control + # unless single control was used if not single_control: path_to_pool_control = cwd + '/' + pool_control if control_df.values.max() > cutoff_ratio: @@ -267,7 +268,10 @@ def generate_design(paired, cutoff_ratio, design_df, cwd, no_reps, no_unique_con path_to_control else: - path_to_pool_control = pool_control + if paired: + path_to_pool_control = cwd + '/' + pool_control + else: + path_to_pool_control = pool_control design_new_df['control_tag_align'] = path_to_pool_control # Add in pseudo replicates -- GitLab