INNER CODE UNIT · Python

__init__

nloyfer/wgbs_tools · src/python/add_cpg_counts.py:79

    def __init__(self, args, bam_path):
        self.args = args
        self.out_dir = args.out_dir
        self.bam_path = bam_path
        self.bed_path = args.bed_file
        self.gr = GenomicRegion(args)
        self.extended_bed_path = self.validate_bed()
        self.validate_input()

    def validate_bed(self):
        if self.bed_path is None:
            return
        df = load_bed(self.bed_path).iloc[:, :3]

        # check start before end
        if ((df['start'] >= df['end']).any()):
            eprint(f'[wt add_cpg_counts] bed file is not legal - end before start')
            raise IllegalArgumentError('Bed file is not legal')

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…