diff --git a/R/pileup.R b/R/pileup.R index 6b2c0fc..d343793 100644 --- a/R/pileup.R +++ b/R/pileup.R @@ -186,8 +186,7 @@ pileup_sites <- function(bamfiles, ) } - fp <- .adjustParams(param, n_files) - fp <- .c_args_FilterParam(fp) + fp <- cfilterParam(param, n_files) if (!is.null(region)) { chroms_to_process <- region @@ -549,44 +548,6 @@ empty_plp_record <- function() { } -.adjust_arg_length <- function(obj, name, len) { - if (length(slot(obj, name)) != len) { - if (length(slot(obj, name)) == 1) { - slot(obj, name) <- rep(slot(obj, name), len) - } else { - stop( - "%s requires either 1 value, or individual values,", - "for all input bamfiles", slot - ) - } - } - slot(obj, name) -} -## Check validity and adjust -.adjustParams <- function(filterParam, nFiles) { - if (!inherits(filterParam, "FilterParam")) { - stop( - "'filterParam' must inherit from 'FilterParam', got '%s'", - class(filterParam) - ) - } - filterParam@min_mapq <- .adjust_arg_length( - filterParam, - "min_mapq", - nFiles - ) - filterParam@only_keep_variants <- .adjust_arg_length( - filterParam, - "only_keep_variants", - nFiles - ) - filterParam@library_type <- .adjust_arg_length( - filterParam, - "library_type", - nFiles - ) - filterParam -} #' @importFrom methods slot slot<- slotNames @@ -624,7 +585,7 @@ setMethod(show, "FilterParam", function(object) { }) -.encode_libtype <- function(library_type = c("unstranded", +encode_libtype <- function(library_type = c("unstranded", "fr-first-strand", "fr-second-strand"), n_files) { @@ -647,8 +608,48 @@ setMethod(show, "FilterParam", function(object) { as.integer(lib_code) } -.c_args_FilterParam <- function(x, ...) { - fp <-.as.list_FilterParam(x) +adjust_arg_length <- function(obj, name, len) { + if (length(slot(obj, name)) != len) { + if (length(slot(obj, name)) == 1) { + slot(obj, name) <- rep(slot(obj, name), len) + } else { + stop( + "%s requires either 1 value, or individual values,", + "for all input bamfiles", slot + ) + } + } + slot(obj, name) +} +## Check validity and adjust +adjustParams <- function(filterParam, nFiles) { + if (!inherits(filterParam, "FilterParam")) { + stop( + "'filterParam' must inherit from 'FilterParam', got '%s'", + class(filterParam) + ) + } + filterParam@min_mapq <- adjust_arg_length( + filterParam, + "min_mapq", + nFiles + ) + filterParam@only_keep_variants <- adjust_arg_length( + filterParam, + "only_keep_variants", + nFiles + ) + filterParam@library_type <- adjust_arg_length( + filterParam, + "library_type", + nFiles + ) + filterParam +} + + +c_args_FilterParam <- function(x, ...) { + fp <-as_list_FilterParam(x) # consistent length args are populated into vectors # note that unlisting will increase vector size greater than number of args @@ -691,12 +692,18 @@ setMethod(show, "FilterParam", function(object) { ) } -.as.list_FilterParam <- function(x, ...) { +as_list_FilterParam <- function(x, ...) { slotnames <- slotNames(x) names(slotnames) <- slotnames lapply(slotnames, slot, object = x) } +cfilterParam <- function(param, nfiles) { + fp <- adjustParams(param, nfiles) + fp <- c_args_FilterParam(fp) + fp +} + #' @param min_depth min read depth needed to report site #' @param max_depth maximum read depth considered at each site #' @param min_base_quality min base quality score to consider read for pileup @@ -801,7 +808,7 @@ FilterParam <- } } - library_type <- .encode_libtype(library_type) + library_type <- encode_libtype(library_type) ## creation .FilterParam( diff --git a/R/sc-pileup.R b/R/sc-pileup.R index c4e941f..19da8ff 100644 --- a/R/sc-pileup.R +++ b/R/sc-pileup.R @@ -172,23 +172,6 @@ pileup_cells <- function(bamfiles, sites <- sites[seqnames(sites) %in% chroms_to_process, ] - fp <- .adjustParams(param, 1) - fp <- .as.list_FilterParam(fp) - - lib_code <- fp$library_type - - event_filters <- unlist(fp[c( - "trim_5p", - "trim_3p", - "splice_dist", - "indel_dist", - "homopolymer_len", - "max_mismatch_type", - "min_read_qual", - "min_splice_overhang", - "min_variant_reads" - )]) - if (verbose) cli::cli_alert("Beginning pileup") bf <- path.expand(path(bamfiles)) bfi <- path.expand(index(bamfiles)) @@ -210,9 +193,7 @@ pileup_cells <- function(bamfiles, outfile_prefix = output_directory, cb_tag = cb_tag, umi_tag = umi_tag, - libtype_code = lib_code, - event_filters = event_filters, - fp = fp, + param = param, pe = paired_end, verbose = verbose ), @@ -232,9 +213,7 @@ pileup_cells <- function(bamfiles, outfile_prefix = output_directory, cb_tag = cb_tag, umi_tag = umi_tag, - libtype_code = lib_code, - event_filters = event_filters, - fp = fp, + param = param, pe = paired_end, verbose = verbose ), @@ -278,8 +257,8 @@ pileup_cells <- function(bamfiles, get_sc_pileup <- function(bamfn, index, id, sites, barcodes, outfile_prefix, chrom, - umi_tag, cb_tag, libtype_code, - event_filters, fp, pe, verbose) { + umi_tag, cb_tag, param, + pe, verbose) { if (length(chrom) > 0) { sites <- sites[seqnames(sites) %in% chrom, ] } @@ -293,8 +272,11 @@ get_sc_pileup <- function(bamfn, index, id, sites, barcodes, plp_outfns <- path.expand(plp_outfns) on.exit(unlink(plp_outfns)) - if (verbose) cli::cli_alert("working on group: {id}") + fp <- cfilterParam(param, 1) lst <- gr_to_regions(sites) + + if (verbose) cli::cli_alert("working on group: {id}") + res <- .Call( ".scpileup", bamfn, @@ -303,17 +285,13 @@ get_sc_pileup <- function(bamfn, index, id, sites, barcodes, lst, barcodes, cb_tag, - event_filters, - fp$min_mapq, - fp$max_depth, - fp$min_base_quality, - fp$read_bqual, - as.integer(libtype_code), - fp$bam_flags, + fp[["int_args"]], + fp[["numeric_args"]], + fp[["library_type"]], plp_outfns, umi_tag, pe, - max(fp$min_variant_reads, fp$min_depth) + max(fp$int_args["min_variant_reads"], fp$int_args["min_depth"]) ) if (res < 0) cli::cli_abort("pileup failed") diff --git a/src/init.c b/src/init.c index 344d5f2..5c77648 100644 --- a/src/init.c +++ b/src/init.c @@ -6,12 +6,12 @@ /* .Call calls */ extern SEXP get_region(SEXP); extern SEXP pileup(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); -extern SEXP scpileup(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); +extern SEXP scpileup(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); static const R_CallMethodDef CallEntries[] = { {".get_region", (DL_FUNC) &get_region, 1}, {".pileup",(DL_FUNC) &pileup, 15}, - {".scpileup",(DL_FUNC) &scpileup, 17}, + {".scpileup",(DL_FUNC) &scpileup, 13}, {NULL, NULL, 0} }; diff --git a/src/plp.c b/src/plp.c index f7dee73..f0788f7 100644 --- a/src/plp.c +++ b/src/plp.c @@ -325,10 +325,10 @@ static int store_counts(PLP_DATA pd, pcounts* pc, const char* ctig, // predicated on the true or false values in only_variants for (i = 0; i < conf->nbam; ++i) { // check depth - if ((pc + i)->pc->total >= conf->min_depth && (pc + i)->pc->nv >= conf->min_var_reads) { + if ((pc + i)->pc->total >= conf->min_depth && (pc + i)->pc->nv >= conf->ef.min_var_reads) { write_p = 1; } - if ((pc + i)->mc->total >= conf->min_depth && (pc + i)->mc->nv >= conf->min_var_reads) { + if ((pc + i)->mc->total >= conf->min_depth && (pc + i)->mc->nv >= conf->ef.min_var_reads) { write_m = 1; } @@ -542,30 +542,30 @@ static int check_read_filters(const bam_pileup1_t* p, mplp_conf_t* conf, int baq } // check if pos is within x dist from 5' end of read, qpos is 0-based - if (conf->trim.f5p > 0 || conf->trim.f3p > 0) { - res = check_variant_fpos(p->b, p->qpos, conf->trim.f5p, conf->trim.f3p); + if (conf->ef.trim_f5p > 0 || conf->ef.trim_f3p > 0) { + res = check_variant_fpos(p->b, p->qpos, conf->ef.trim_f5p, conf->ef.trim_f3p); if (res < 0) return -1; // error if (res > 0) return 1; } - if (conf->trim.i5p > 0 || conf->trim.i3p > 0) { - res = check_variant_pos(p->b, p->qpos, conf->trim.i5p, conf->trim.i3p); + if (conf->ef.trim_i5p > 0 || conf->ef.trim_i3p > 0) { + res = check_variant_pos(p->b, p->qpos, conf->ef.trim_i5p, conf->ef.trim_i3p); if (res < 0) return -1; // error if (res > 0) return 1; } // check for splice in alignment nearby - if (conf->splice_dist && dist_to_splice(p->b, p->qpos, conf->splice_dist) >= 0) return (1); + if (conf->ef.splice_dist && dist_to_splice(p->b, p->qpos, conf->ef.splice_dist) >= 0) return (1); // check if site in splice overhang and > min_overhang - if (conf->min_overhang) { - res = check_splice_overhang(p->b, p->qpos, conf->min_overhang); + if (conf->ef.min_overhang) { + res = check_splice_overhang(p->b, p->qpos, conf->ef.min_overhang); if (res == -2) return -1; // error if (res > 0) return (1); } // check if indel event nearby - if (conf->indel_dist && dist_to_indel(p->b, p->qpos, conf->indel_dist) >= 0) return (1); + if (conf->ef.indel_dist && dist_to_indel(p->b, p->qpos, conf->ef.indel_dist) >= 0) return (1); return 0; } @@ -769,7 +769,7 @@ while ((ret = bam_mplp64_auto(iter, &tid, &pos, n_plp, plp)) > 0) { } // check if site is in a homopolymer - if (conf->nmer > 0 && check_simple_repeat(&ref, &ref_len, pos, conf->nmer)) continue; + if (conf->ef.nmer > 0 && check_simple_repeat(&ref, &ref_len, pos, conf->ef.nmer)) continue; // check if read count less than min_depth int pass_reads = 0; @@ -824,9 +824,9 @@ while ((ret = bam_mplp64_auto(iter, &tid, &pos, n_plp, plp)) > 0) { if (invert) ci = (char)comp_base[(unsigned char)c]; // check read for >= mismatch different types and at least n_mm mismatches - if (conf->n_mm_type > 0 || conf->n_mm > 0) { + if (conf->ef.n_mm_type > 0 || conf->ef.n_mm > 0) { if ((invert && mref_b != ci) || pref_b != ci) { - int m = parse_mismatches(p->b, conf->n_mm_type, conf->n_mm); + int m = parse_mismatches(p->b, conf->ef.n_mm_type, conf->ef.n_mm); if (m == -1) { ret = -1; goto fail; @@ -1031,26 +1031,28 @@ static int set_mplp_conf(mplp_conf_t* conf, int n_bams, } } - conf->max_depth = i_args[0]; - conf->min_depth = i_args[1]; - conf->min_bq = i_args[2]; - conf->trim.i5p = i_args[3]; - conf->trim.i3p = i_args[4]; - conf->indel_dist = i_args[5]; - conf->splice_dist = i_args[6]; - conf->min_overhang = i_args[7]; - conf->nmer = i_args[8]; - conf->min_var_reads = i_args[9]; - conf->n_mm_type = i_args[10]; - conf->n_mm = i_args[11]; - conf->keep_flag[0] = i_args[12]; - conf->keep_flag[1] = i_args[13]; - - conf->trim.f5p = d_args[0]; - conf->trim.f3p = d_args[1]; - conf->min_af = d_args[2]; - conf->read_qual.pct = d_args[3]; - conf->read_qual.minq = d_args[4]; + memset(&conf->ef, 0, sizeof(efilter_t)); + + conf->max_depth = i_args[0]; + conf->min_depth = i_args[1]; + conf->min_bq = i_args[2]; + conf->ef.trim_i5p = i_args[3]; + conf->ef.trim_i3p = i_args[4]; + conf->ef.indel_dist = i_args[5]; + conf->ef.splice_dist = i_args[6]; + conf->ef.min_overhang = i_args[7]; + conf->ef.nmer = i_args[8]; + conf->ef.min_var_reads = i_args[9]; + conf->ef.n_mm_type = i_args[10]; + conf->ef.n_mm = i_args[11]; + conf->keep_flag[0] = i_args[12]; + conf->keep_flag[1] = i_args[13]; + + conf->ef.trim_f5p = d_args[0]; + conf->ef.trim_f3p = d_args[1]; + conf->min_af = d_args[2]; + conf->read_qual.pct = d_args[3]; + conf->read_qual.minq = d_args[4]; conf->report_multiallelics = b_args[0]; diff --git a/src/plp_utils.h b/src/plp_utils.h index 9a973eb..b0508a2 100644 --- a/src/plp_utils.h +++ b/src/plp_utils.h @@ -44,17 +44,11 @@ extern const char nt5_str[5]; extern unsigned char comp_base[256]; -typedef struct { - double f5p; - double f3p; - int i5p; - int i3p; -} trim_t; - typedef struct { - int nmer, splice_dist, indel_dist, trim_5p_dist, trim_3p_dist; - int n_mm_type, n_mm, min_overhang, min_var_reads; -} efilter; + int nmer, splice_dist, indel_dist, trim_i5p, trim_i3p; + int n_mm_type, n_mm, min_overhang, min_var_reads; + double trim_f5p, trim_f3p; +} efilter_t; typedef struct { int minq; @@ -64,8 +58,6 @@ typedef struct { typedef struct { int min_global_mq, flag, min_bq, min_depth, max_depth, output_reads; int report_multiallelics, multi_itr, in_memory; - int nmer, splice_dist, indel_dist; - int n_mm_type, n_mm, min_overhang, min_var_reads; int nbam, nfps; double min_af; int umi; @@ -73,7 +65,7 @@ typedef struct { int* min_mqs; // across all bam files int* libtype; // across all bam files int* only_keep_variants; // across all bam files - trim_t trim; + efilter_t ef; read_qual_t read_qual; uint32_t keep_flag[2]; char* reg, *fai_fname, *output_fname; diff --git a/src/sc-plp.c b/src/sc-plp.c index 0096780..4d1f905 100644 --- a/src/sc-plp.c +++ b/src/sc-plp.c @@ -129,7 +129,7 @@ typedef struct { char* bcfn; // barcodes filename char* sitesfn; // sites filename FILE** fps; // file pointers [0] = mtxfn, [1] = sitefn, [2] = bcfn; - efilter ef; // various additional site filters + efilter_t ef; // various additional site filters str2intmap_t cbidx; // hashmap cellbarcode key -> sparsematrix column index cbumi_map_t cbmap; // hashmap cellbarcode key -> cbumi_map_t int has_umi; // bool, library has umi @@ -164,7 +164,7 @@ typedef struct { 2 = read fails due to refskip, deletion, overlapping mate */ static int check_read_filters(const bam_pileup1_t* p, sc_mplp_conf_t* conf) { - + int res = 0; // skip indel and ref skip ; if (p->is_del || p->is_refskip) return (2) ; @@ -184,14 +184,26 @@ static int check_read_filters(const bam_pileup1_t* p, sc_mplp_conf_t* conf) { } // check if pos is within x dist from 5' end of read, qpos is 0-based - if (check_variant_pos(p->b, p->qpos, conf->ef.trim_5p_dist, conf->ef.trim_3p_dist)) return (1); + if (conf->ef.trim_f5p > 0 || conf->ef.trim_f3p > 0) { + res = check_variant_fpos(p->b, p->qpos, conf->ef.trim_f5p, conf->ef.trim_f3p); + if (res < 0) return -1; // error + if (res > 0) return 1; + } + if (conf->ef.trim_i5p > 0 || conf->ef.trim_i3p > 0) { + res = check_variant_pos(p->b, p->qpos, conf->ef.trim_i5p, conf->ef.trim_i3p); + if (res < 0) return -1; // error + if (res > 0) return 1; + } // check for splice in alignment nearby if (conf->ef.splice_dist && dist_to_splice(p->b, p->qpos, conf->ef.splice_dist) >= 0) return (1); // check if site in splice overhang and > min_overhang - if (conf->ef.min_overhang && check_splice_overhang(p->b, p->qpos, conf->ef.min_overhang) > 0) return (1); - + if (conf->ef.min_overhang) { + res = check_splice_overhang(p->b, p->qpos, conf->ef.min_overhang); + if (res == -2) return -1; // error + if (res > 0) return (1); + } // check if indel event nearby if (conf->ef.indel_dist && dist_to_indel(p->b, p->qpos, conf->ef.indel_dist) >= 0) return (1); @@ -500,20 +512,6 @@ static int screadaln(void* data, bam1_t* b) { return ret; } -/*! @function - @abstract Populate efilter struct - */ -static void set_event_filters(efilter* ef, int* event_filters) { - ef->trim_5p_dist = event_filters[0]; - ef->trim_3p_dist = event_filters[1]; - ef->splice_dist = event_filters[2]; - ef->indel_dist = event_filters[3]; - ef->nmer = event_filters[4]; - ef->n_mm_type = event_filters[5]; - ef->n_mm = event_filters[6]; - ef->min_overhang = event_filters[7]; - ef->min_var_reads = event_filters[8]; -} /*! @function @abstract Process one pileup site @@ -749,8 +747,7 @@ static int run_scpileup(sc_mplp_conf_t* conf, char* bamfn, char* index, char* ba */ static int set_sc_mplp_conf(sc_mplp_conf_t* conf, int nbams, int n_outfns, char** outfns, char* qregion, regidx_t* idx, - int min_mapQ, int min_baseQ, double* read_bqual_filter, - int max_depth, int* b_flags, int* event_filters, int libtype, + int* i_args, double* d_args, int libtype, int n_bcs, char** bcs, char* cbtag, char* umi, int pe, int min_counts) { conf->is_ss2 = nbams > 1 ? 1 : 0; @@ -775,22 +772,30 @@ static int set_sc_mplp_conf(sc_mplp_conf_t* conf, int nbams, conf->reg_itr = regitr_init(conf->reg_idx); } - conf->min_mq = (min_mapQ < 0) ? 0 : min_mapQ; - conf->min_bq = (min_baseQ < 0) ? 0 : min_baseQ; - conf->max_depth = (!max_depth) ? 10000: max_depth; + memset(&conf->ef, 0, sizeof(efilter_t)); - if (b_flags) { - conf->keep_flag[0] = b_flags[0]; - conf->keep_flag[1] = b_flags[1]; - } + conf->max_depth = i_args[0]; + conf->min_bq = i_args[2]; + conf->ef.trim_i5p = i_args[3]; + conf->ef.trim_i3p = i_args[4]; + conf->ef.indel_dist = i_args[5]; + conf->ef.splice_dist = i_args[6]; + conf->ef.min_overhang = i_args[7]; + conf->ef.nmer = i_args[8]; + conf->ef.min_var_reads = i_args[9]; + conf->ef.n_mm_type = i_args[10]; + conf->ef.n_mm = i_args[11]; + conf->keep_flag[0] = i_args[12]; + conf->keep_flag[1] = i_args[13]; - if (read_bqual_filter) { - conf->read_qual.pct = read_bqual_filter[0]; - conf->read_qual.minq = (int)read_bqual_filter[1]; - } + conf->ef.trim_f5p = d_args[0]; + conf->ef.trim_f3p = d_args[1]; + conf->read_qual.pct = d_args[3]; + conf->read_qual.minq = d_args[4]; - memset(&conf->ef, 0, sizeof(efilter)); - set_event_filters(&(conf->ef), event_filters); + conf->min_mq = (conf->min_mq < 0) ? 0 : conf->min_mq; + conf->min_bq = (conf->min_bq < 0) ? 0 : conf->min_bq; + conf->max_depth = (!conf->max_depth ) ? 10000: conf->max_depth ; conf->libtype = libtype; int hret = 0; @@ -859,10 +864,8 @@ static int write_all_sites(sc_mplp_conf_t* conf) { @abstract Check args passed from R. Likely has some redundancies with checks in R code. */ static void check_sc_plp_args(SEXP bampaths, SEXP indexes, SEXP qregion, SEXP lst, - SEXP barcodes, SEXP cbtag, SEXP event_filters, - SEXP min_mapQ, SEXP max_depth, SEXP min_baseQ, - SEXP read_bqual_filter, SEXP libtype, SEXP b_flags, - SEXP outfns, SEXP umi, SEXP pe, + SEXP barcodes, SEXP cbtag, SEXP int_args, SEXP dbl_args, + SEXP libtype, SEXP outfns, SEXP umi, SEXP pe, SEXP min_counts) { if (!IS_CHARACTER(bampaths) || (LENGTH(bampaths) < 1)) { @@ -893,34 +896,19 @@ static void check_sc_plp_args(SEXP bampaths, SEXP indexes, SEXP qregion, SEXP ls Rf_error("'cbtag' must be character of length 0 or 1"); } - if (!IS_INTEGER(event_filters) || (LENGTH(event_filters) != 9)) { - Rf_error("'event_filters' must be integer of length 9"); - } - - if (!IS_INTEGER(min_mapQ) || (LENGTH(min_mapQ) != 1)) { - Rf_error("'min_mapQ' must be integer(1)"); - } - - if (!IS_INTEGER(max_depth) || (LENGTH(max_depth) != 1)) { - Rf_error("'max_depth' must be integer(1)"); + // vectors populated with parameters of fixed sizes + if (!IS_INTEGER(int_args) || (LENGTH(int_args) != 14)) { + Rf_error("'int_args' must be integer of length 14"); } - if (!IS_INTEGER(min_baseQ) || (LENGTH(min_baseQ) != 1)) { - Rf_error("'min_baseQ' must be integer(1)"); - } - - if (!IS_NUMERIC(read_bqual_filter) || (LENGTH(read_bqual_filter) != 2)) { - Rf_error("'read_bqual_filter' must be numeric of length 2"); + if (!IS_NUMERIC(dbl_args) || (LENGTH(dbl_args) != 5)) { + Rf_error("'dbl_args' must be numeric of length 5"); } if (!IS_INTEGER(libtype) || (LENGTH(libtype) != 1)) { Rf_error("'lib_type' must be integer(1)"); } - if (!IS_INTEGER(b_flags) || (LENGTH(b_flags) != 2)) { - Rf_error("'b_flags' must be integer of length 2"); - } - if ((!IS_CHARACTER(outfns) || (LENGTH(outfns) != 3))) { Rf_error("'outfns' must be character(3)"); } @@ -943,15 +931,13 @@ static void check_sc_plp_args(SEXP bampaths, SEXP indexes, SEXP qregion, SEXP ls @abstract R interface to single cell pileup code */ SEXP scpileup(SEXP bampaths, SEXP indexes, SEXP query_region, SEXP lst, - SEXP barcodes, SEXP cbtag, SEXP event_filters, SEXP min_mapQ, - SEXP max_depth, SEXP min_baseQ, SEXP read_bqual_filter, - SEXP libtype, SEXP b_flags, SEXP outfns, SEXP umi, + SEXP barcodes, SEXP cbtag, SEXP int_args, SEXP dbl_args, + SEXP libtype, SEXP outfns, SEXP umi, SEXP pe, SEXP min_counts) { check_sc_plp_args(bampaths, indexes, query_region, lst, - barcodes, cbtag, event_filters, min_mapQ, max_depth, - min_baseQ, read_bqual_filter, libtype, - b_flags, outfns, umi, pe, min_counts); + barcodes, cbtag, int_args, dbl_args, libtype, + outfns, umi, pe, min_counts); regidx_t* idx = regidx_build(lst, 1); if (!idx) Rf_error("Failed to build region index"); @@ -994,11 +980,9 @@ SEXP scpileup(SEXP bampaths, SEXP indexes, SEXP query_region, SEXP lst, memset(&ga, 0, sizeof(sc_mplp_conf_t)); ret = set_sc_mplp_conf(&ga, nbams, nout, coutfns, - cq_region, idx, INTEGER(min_mapQ)[0], - INTEGER(min_baseQ)[0], REAL(read_bqual_filter), - INTEGER(max_depth)[0], INTEGER(b_flags), - INTEGER(event_filters), INTEGER(libtype)[0], - nbcs, bcs, c_cbtag, c_umi, + cq_region, idx, + INTEGER(int_args), REAL(dbl_args), + INTEGER(libtype)[0], nbcs, bcs, c_cbtag, c_umi, LOGICAL(pe)[0], INTEGER(min_counts)[0]); if (ret >= 0) {