Amanda Birmingham, CCBB, UCSD (abirmingham@ucsd.edu)
To run this notebook reproducibly, follow these steps:
In [ ]:
g_dataset_name = "Notebook4Test"
g_fastq_counts_run_prefix = "TestSet4"
g_fastq_counts_dir = '~/dual_crispr/test_data/test_set_4'
g_collapsed_counts_run_prefix = ""
g_collapsed_counts_dir = '~/dual_crispr/test_outputs/test_set_4'
g_combined_counts_dir = ""
g_combined_counts_run_prefix = ""
In [ ]:
import inspect
import ccbb_pyutils.analysis_run_prefixes as ns_runs
import ccbb_pyutils.files_and_paths as ns_files
import ccbb_pyutils.notebook_logging as ns_logs
def describe_var_list(input_var_name_list):
description_list = ["{0}: {1}\n".format(name, eval(name)) for name in input_var_name_list]
return "".join(description_list)
ns_logs.set_stdout_info_logger()
In [ ]:
g_fastq_counts_dir = ns_files.expand_path(g_fastq_counts_dir)
g_collapsed_counts_run_prefix = ns_runs.check_or_set(g_collapsed_counts_run_prefix,
ns_runs.generate_run_prefix(g_dataset_name))
g_collapsed_counts_dir = ns_files.expand_path(ns_runs.check_or_set(g_collapsed_counts_dir, g_fastq_counts_dir))
g_combined_counts_run_prefix = ns_runs.check_or_set(g_combined_counts_run_prefix, g_collapsed_counts_run_prefix)
g_combined_counts_dir = ns_files.expand_path(ns_runs.check_or_set(g_combined_counts_dir, g_collapsed_counts_dir))
print(describe_var_list(['g_fastq_counts_dir','g_collapsed_counts_run_prefix','g_collapsed_counts_dir',
'g_combined_counts_run_prefix','g_combined_counts_dir']))
ns_files.verify_or_make_dir(g_collapsed_counts_dir)
ns_files.verify_or_make_dir(g_combined_counts_dir)
In [ ]:
import dual_crispr.construct_counter as ns_counter
print(inspect.getsource(ns_counter.get_counts_file_suffix))
In [ ]:
import dual_crispr.count_combination as ns_combine
print(inspect.getsource(ns_combine))
In [ ]:
print(ns_files.summarize_filenames_for_prefix_and_suffix(g_fastq_counts_dir, g_fastq_counts_run_prefix,
ns_counter.get_counts_file_suffix()))
In [ ]:
ns_combine.write_collapsed_count_files(g_fastq_counts_dir, g_collapsed_counts_dir, g_collapsed_counts_run_prefix,
g_fastq_counts_run_prefix, ns_counter.get_counts_file_suffix(),
ns_combine.get_collapsed_counts_file_suffix())
In [ ]:
print(ns_files.check_file_presence(g_collapsed_counts_dir, g_collapsed_counts_run_prefix,
ns_combine.get_collapsed_counts_file_suffix(),
check_failure_msg="Count combination failed to produce collapsed count file(s)."))
In [ ]:
ns_combine.write_combined_count_file(g_collapsed_counts_dir, g_combined_counts_dir, g_collapsed_counts_run_prefix,
g_combined_counts_run_prefix, ns_combine.get_collapsed_counts_file_suffix(),
ns_combine.get_combined_counts_file_suffix())
In [ ]:
print(ns_files.check_file_presence(g_combined_counts_dir, g_collapsed_counts_run_prefix,
ns_combine.get_collapsed_counts_file_suffix(),
check_failure_msg="Count combination failed to produce combined count file."))