INNER CODE UNIT · C

iter

dpryan79/MethylDackel · MBias.c:159

        iter = bam_mplp_init(1, filter_func, (void **) &data);
//        bam_mplp_init_overlaps(iter); //This is included in extract but excluded here. The main benefit to exclusion is that you can more accurately gauge overlapping regions.
        bam_mplp_set_maxcnt(iter, INT_MAX);
        while((ret = bam_mplp_auto(iter, &tid, &pos, &n_plp, plp)) > 0) {
            if(pos < localPos || pos >= localEnd) continue; // out of the region requested

            if(config->bed) { //Handle -l
                while((o = posOverlapsBED(tid, pos, config->bed, bedIdx)) == -1) bedIdx++;
                if(o == 0) continue; //Wrong strand
            }

            if(isCpG(seq, pos-localPos, seqlen)) {
                if(!config->keepCpG) continue;
            } else if(isCHG(seq, pos-localPos, seqlen)) {
                if(!config->keepCHG) continue;
            } else if(isCHH(seq, pos-localPos, seqlen)) {
                if(!config->keepCHH) continue;
            } else {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…