Running examples in ‘CNVScope-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: rebinGenomicInteractions
> ### Title: Assign GenomicInteractions to a predefined series of bins for
> ###   row and column, corresponding to a genomic matrix.
> ### Aliases: rebinGenomicInteractions
> ### Keywords: GenomicInteractions bin binning colnames matrix rownames
> 
> ### ** Examples
> 
> foreach::registerDoSEQ()
> gint_small_chr1<-importBreakpointBed(breakpoint_fn = system.file("extdata",
+ "sample_breakpoints_chr1.bed",package = "CNVScope"))
> load(system.file("extdata","nbl_result_matrix_sign_small.rda",package = "CNVScope")) 
> rebinGenomicInteractions(gint=gint_small_chr1,whole_genome_matrix=NULL,
+ rownames_gr=underscored_pos_to_GRanges(rownames(nbl_result_matrix_sign_small)),
+ colnames_gr=underscored_pos_to_GRanges(colnames(nbl_result_matrix_sign_small)),
+ rownames_mat = rownames(nbl_result_matrix_sign_small),
+ colnames_mat = colnames(nbl_result_matrix_sign_small),
+ method="nearest")
[1] "16.6666666666667%"
[1] "33.3333333333333%"
[1] "50%"
[1] "66.6666666666667%"
[1] "83.3333333333333%"
[1] "100%"
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
CNVScope
 --- call from context --- 
rebinGenomicInteractions(gint = gint_small_chr1, whole_genome_matrix = NULL, 
    rownames_gr = underscored_pos_to_GRanges(rownames(nbl_result_matrix_sign_small)), 
    colnames_gr = underscored_pos_to_GRanges(colnames(nbl_result_matrix_sign_small)), 
    rownames_mat = rownames(nbl_result_matrix_sign_small), colnames_mat = colnames(nbl_result_matrix_sign_small), 
    method = "nearest")
 --- call from argument --- 
if (class(output) == "character" & is.null(nrow(output))) {
    output_df <- as.data.frame(t(output))
} else {
    output_df <- as.data.frame(matrix(as.character(output), nrow = nrow(output)))
    colnames(output_df) <- c("row_bin_index", "col_bin_index", 
        "row_bin_label", "col_bin_label", as.character(colnames(as.data.frame(gint[1]))))
}
 --- R stacktrace ---
where 1: rebinGenomicInteractions(gint = gint_small_chr1, whole_genome_matrix = NULL, 
    rownames_gr = underscored_pos_to_GRanges(rownames(nbl_result_matrix_sign_small)), 
    colnames_gr = underscored_pos_to_GRanges(colnames(nbl_result_matrix_sign_small)), 
    rownames_mat = rownames(nbl_result_matrix_sign_small), colnames_mat = colnames(nbl_result_matrix_sign_small), 
    method = "nearest")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (gint = NULL, whole_genome_matrix = NULL, rownames_gr = NULL, 
    colnames_gr = NULL, rownames_mat = NULL, colnames_mat = NULL, 
    method = "nearest") 
{
    i <- if (exists("i")) {
        get("i")
    }
    else {
        NULL
    }
    if (is.null(gint)) {
        return("No GenomicInteractions to rebin!")
    }
    if (!is.null(whole_genome_matrix)) {
        rownames_mat <- rownames(whole_genome_matrix)
        colnames_mat <- rownames(whole_genome_matrix)
    }
    output <- foreach(i = 1:length(gint), .inorder = T, .combine = "rbind", 
        .errorhandling = "pass", .export = ls()) %dopar% {
        current_int_df <- as.data.frame(cbind(as.data.frame(GenomicInteractions::anchorOne(gint)[i]), 
            as.data.frame(GenomicInteractions::anchorTwo(gint)[i]), 
            as.data.frame(mcols(gint[i]))))
        print(paste0(i/length(gint) * 100, "%"))
        if (method == "overlap") {
            row_bin_index <- InteractionSet::findOverlaps(rownames_gr, 
                GenomicInteractions::anchorOne(gint[i]))@from
            col_bin_index <- InteractionSet::findOverlaps(colnames_gr, 
                GenomicInteractions::anchorTwo(gint[i]))@from
        }
        if (method == "nearest") {
            row_bin_index <- GenomicRanges::nearest(GenomicInteractions::anchorOne(gint[i]), 
                rownames_gr)
            col_bin_index <- GenomicRanges::nearest(GenomicInteractions::anchorTwo(gint[i]), 
                colnames_gr)
        }
        if (length(row_bin_index) == 0 | length(col_bin_index) == 
            0) {
            print(paste0("no match pair for row", i))
            return(NULL)
        }
        col_bin_label <- colnames_mat[col_bin_index]
        row_bin_label <- rownames_mat[row_bin_index]
        outputline <- c(row_bin_index, col_bin_index, row_bin_label, 
            col_bin_label, sapply(current_int_df, as.character))
        outputnames <- c("row_bin_index", "col_bin_index", "row_bin_label", 
            "col_bin_label", colnames(current_int_df))
        if (length(row_bin_index) == 0 | length(col_bin_index) == 
            0) {
            outputline <- rep("", length(outputnames))
        }
        names(outputline) <- outputnames
        outputline
    }
    if (class(output) == "character" & is.null(nrow(output))) {
        output_df <- as.data.frame(t(output))
    }
    else {
        output_df <- as.data.frame(matrix(as.character(output), 
            nrow = nrow(output)))
        colnames(output_df) <- c("row_bin_index", "col_bin_index", 
            "row_bin_label", "col_bin_label", as.character(colnames(as.data.frame(gint[1]))))
    }
    return(output_df)
}
<bytecode: 0x56269866d7c8>
<environment: namespace:CNVScope>
 --- function search by body ---
Function rebinGenomicInteractions in namespace CNVScope has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1