Exemplo n.º 1
0
	def test_forward_only(self):
		filename = os.path.join(data_dir, 'test_plotgen')
		p = PlotGenerator([0,0,0,0,0,1,1,3], [], filename)
		self.assertTrue(p.construct_file())
		
		self.assertTrue(os.path.exists(filename))
		self.assertTrue(filecmp.cmp(os.path.join(data_dir, 'expected_plotgen'), filename))
		os.remove(filename)
Exemplo n.º 2
0
	def create_normalised_files(self):
		plot_objs = self.normalise()
		output_files = []
		for p in self.plotfiles:
			fd, output_filename = mkstemp()
			pg = PlotGenerator(plot_objs[p].forward, plot_objs[p].reverse, output_filename)
			pg.construct_file()
			output_files.append(output_filename)
		return output_files
Exemplo n.º 3
0
	def test_generate_and_read(self):
		filename = os.path.join(data_dir, 'plot.test')
		p = PlotGenerator([0,0,0,0,0,1,1,3], [9,9,0,9,9,1,1,3], filename)
		p.construct_file()
		
		d = PlotParser(filename,0)
		self.assertTrue(self.check_arrays_equal(d.forward, [0,0,0,0,0,1,1,3]))
		self.assertTrue(self.check_arrays_equal(d.reverse, [9,9,0,9,9,1,1,3]))
		self.assertTrue(self.check_arrays_equal(d.combined, [9,9,0,9,9,2,2,6]))
		
		os.remove(filename)
Exemplo n.º 4
0
	def masking(self):
		masking_plot = PlotParser(self.masking_plot_file)
		output_plot_files = {}
		
		for insertion_filename in self.insertion_plot_files:
			insertion_plot = PlotParser(insertion_filename)
			
			for i, mask in enumerate(masking_plot.combined):
				if mask == 0 and self.strict_signal:
					insertion_plot.forward[i] = 0
					insertion_plot.reverse[i] = 0
					
			fd, output_filename = mkstemp()
			pg = PlotGenerator(insertion_plot.forward, insertion_plot.reverse, output_filename)
			pg.construct_file()
			output_plot_files[insertion_filename] = output_filename
		return output_plot_files
Exemplo n.º 5
0
 def create_split_plot_file(self, forward, reverse):
     fd, filename = mkstemp()
     p = PlotGenerator(forward, reverse, filename)
     p.construct_file()
     return filename