def test_fix(self): """The 'fix' command.""" # Extract fake target/antitarget bins from a combined file ref = cnvlib.read('formats/reference-tr.cnn') is_bg = (ref["gene"] == "Background") tgt_bins = ref[~is_bg] tgt_bins.log2 += np.random.randn(len(tgt_bins)) / 5 anti_bins = ref[is_bg] anti_bins.log2 += np.random.randn(len(anti_bins)) / 5 blank_bins = cnary.CopyNumArray([]) # Typical usage (hybrid capture) cnr = commands.do_fix(tgt_bins, anti_bins, ref) self.assertTrue(0 < len(cnr) <= len(ref)) # Blank antitargets (WGS or amplicon) cnr = commands.do_fix(tgt_bins, blank_bins, ref[~is_bg]) self.assertTrue(0 < len(cnr) <= len(tgt_bins))