def setUp(self): self.tmp_root = tempfile.mkdtemp() name = "log.txt" self.log_file = os.path.join(self.tmp_root, name) content = ("foo Running bar: ls\n" "\n" "bar Running foo: pwd\n") create_file(self.log_file, content)
def setUp(self): self.tmp_root = tempfile.mkdtemp() name = "counts_foo.txt.summary" self.counts_file = os.path.join(self.tmp_root, name) content = ("Assigned:\t1\t5\n" "Unassigned_foo:\t1\t1\n" "Foo\n" "Unassigned_bar:\t2\t4\n") create_file(self.counts_file, content)
def setUp(self): self.tmp_root = tempfile.mkdtemp() good_lane = os.path.join(self.tmp_root, "P1234_101/L003") bad_lane = os.path.join(self.tmp_root, "P1234_101/L005") os.makedirs(good_lane) os.makedirs(bad_lane) name = "Log.final.out" self.log_file = os.path.join(good_lane, name) content = get_star_report_content() create_file(self.log_file, content) self.bad_log_file = os.path.join(bad_lane, name) create_file(self.bad_log_file, "badly | formatted | line") self.good_lane = report.Lane("L003", self.log_file) self.bad_lane = report.Lane("L005", self.bad_log_file)
def setUp(self): self.tmp_root = tempfile.mkdtemp() counts_file = os.path.join(self.tmp_root, "counts_foo.txt.summary") log_file = os.path.join(self.tmp_root, "trimmostar.log") lane_dir1 = os.path.join(self.tmp_root, "L001") lane_dir2 = os.path.join(self.tmp_root, "L002") star_log1 = os.path.join(lane_dir1, "Log.final.out") star_log2 = os.path.join(lane_dir2, "Log.final.out") dirs = [lane_dir1, lane_dir2] files = [counts_file, log_file, star_log1, star_log2] for d in dirs: os.makedirs(d) for f in files: create_file(f) lane1 = report.Lane("L001", star_log=star_log1) lane2 = report.Lane("L002", star_log=star_log2) self.sample = report.Sample("foo", log=log_file, counts=counts_file, lanes=[lane1, lane2])
def create_directory_structure(root, samples): for sample, lanes in samples.items(): sample_dir = os.path.join(root, sample) os.makedirs(sample_dir) for lane in lanes: lane_dir = os.path.join(sample_dir, lane) os.makedirs(lane_dir) create_file(os.path.join(lane_dir, "Log.final.out")) create_file(os.path.join(sample_dir, "trimmostar.log")) counts_file = "counts_{0}.txt.summary".format(sample) create_file(os.path.join(sample_dir, counts_file))
def setUp(self): self.tmp_root = tempfile.mkdtemp() project_root = os.path.join(self.tmp_root, "P1234_101") lane_dir = os.path.join(project_root, "L001") os.makedirs(lane_dir) trimmo_log = os.path.join(project_root, "trimmostar.log") counts = os.path.join(project_root, "counts_P1234_101.txt.summary") star_log_file = os.path.join(lane_dir, "Log.final.out") create_file(star_log_file, get_star_report_content()) lanes = [report.Lane("L001", star_log_file)] self.sample = report.Sample("P1234_101", log=trimmo_log, counts=counts, lanes=lanes) log_content = ("foo Running bar: ls\n" "\n" "bar Running foo: pwd\n") create_file(trimmo_log, log_content) counts_content = ("Assigned:\t1\n" "Unassigned_foo:\t1\n" "Foo\n" "Unassigned_bar:\t4\n") create_file(counts, counts_content)
def setUp(self): self.tmp_root = tempfile.mkdtemp() star_log = os.path.join(self.tmp_root, "Log.final.out") create_file(star_log) self.lane = report.Lane("L001", star_log=star_log)