How to use the cooltools.snipping function in cooltools

To help you get started, we’ve selected a few cooltools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Phlya / coolpuppy / coolpuppy / coolpup.py View on Github external
self.matsizes = np.ceil(self.clr.chromsizes / self.resolution).astype(int)

        self.chroms = natsorted(
            list(set(self.CC.final_chroms) & set(self.clr.chromnames))
        )
        self.regions = {
            chrom: cooler.util.parse_region_string(chrom) for chrom in self.chroms
        }
        if self.expected is not False:
            if self.control:
                warnings.warn(
                    "Can't do both expected and control shifts; defaulting to expected"
                )
                self.control = False
            assert isinstance(self.expected, pd.DataFrame)
            self.ExpSnipper = snipping.ExpectedSnipper(self.clr, self.expected)
            self.expected_selections = {
                chrom: self.ExpSnipper.select(region, region)
                for chrom, region in self.regions.items()
            }
            self.expected = True