CharlesJB / metagene

Artistic License 2.0
11 stars 11 forks source link

Error while producing matrices with design #72

Open asgarhussain opened 7 years ago

asgarhussain commented 7 years ago

I got the following error message

mg$produce_matrices()

mg$produce_matrices(design = design) Error: sum(i) == 1 is not TRUE

CharlesJB commented 7 years ago

This could be caused by non matching names for the bam_files and the design objects.

Can you give me the commands you used to produce the mg object?

What is the result of those 2 commands:

mg$get_params()$bam_files
mg$get_design()
asgarhussain commented 7 years ago

Output of the commands :

mg$get_params()$bam_files gfpexp_arpit_cmd_sort gfpinput_arpit_cmd_sort "gfpexp_arpit_cmd_sort.bam" "gfpinput_arpit_cmd_sort.bam"

mg$get_design() bam_files gfpexp_arpit_cmd_sort gfpinput_arpit_cmd_sort 1 gfpexp_arpit_cmd_sort 1 0 2 gfpinput_arpit_cmd_sort 0 1

On Thu, Apr 20, 2017 at 6:47 PM, Charles Joly Beauparlant < notifications@github.com> wrote:

This could be caused by non matching names for the bam_files and the design objects.

Can you give me the commands you used to produce the mg object?

What is the result of those 2 commands:

mg$get_params()$bam_filesmg$get_design()

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/CharlesJB/metagene/issues/72#issuecomment-295734803, or mute the thread https://github.com/notifications/unsubscribe-auth/AT-4Dj33dz4dIKdDJJEkwHKOBLLKD-Saks5rx1rkgaJpZM4NCyoL .

CharlesJB commented 7 years ago

The names of the samples in the design file appear to match the bam files. I will need more info to debug this:

  1. The command you used to create the mg object
  2. The output of the traceback() function called right after the error
  3. The output of sessionInfo()
asgarhussain commented 7 years ago
  1. mg object output :

mg

Public: add_design: function (design, check_bam_files = FALSE) clone: function (deep = FALSE) export: function (bam_file, region, file) flip_regions: function () get_bam_count: function (filename) get_data_frame: function (region_names = NULL, exp_names = NULL) get_design: function () get_matrices: function (region_names = NULL, exp_names = NULL) get_normalized_coverages: function (filenames = NULL) get_params: function () get_plot: function () get_raw_coverages: function (filenames = NULL) get_regions: function (region_names = NULL) initialize: function (regions, bam_files, padding_size = 0, cores = SerialParam(), plot: function (region_names = NULL, exp_names = NULL, title = NULL, produce_data_frame: function (stat = "bootstrap", range = NULL, ...) produce_matrices: function (design = NA, bin_count = NA, noise_removal = NA, normalization = NA, unflip_regions: function () Private: bam_handler: Bam_Handler, R6 check_bam_files: function (bam_files) check_design: function (design, check_bam_files = FALSE) check_param: function (regions, bam_files, padding_size, cores, verbose, force_seqlevels) check_produce_matrices_params: function (bin_count, bin_size, design, noise_removal, normalization, coverages: list data_frame_need_update: function (stat = NA, alpha = NA, average = NA, sample_count = NA) design: data.frame df: data.frame fetch_design: function (design, check_bam_files = FALSE) flip_matrices: function () get_bam_names: function (filenames) get_matrix: function (coverages, region, bcount) get_param_value: function (param_value, param_name) get_view_means: function (gr, bcount, cov) graph: matrices: list matrices_need_update: function (design, bin_count, bin_size, noise_removal, normalization) merge_chip: function (coverages, design) normalize_coverages: function (coverages, design) parallel_job: Parallel_Job, R6 params: list plot_graphic: function (df, title, x_label) prepare_regions: function (regions) print_verbose: function (to_print) produce_coverages: function () regions: GRangesList remove_controls: function (coverages, design) 2. traceback output traceback() 9: stop(sprintf(ngettext(length(r), "%s is not TRUE", "%s are not all TRUE"), ch), call. = FALSE, domain = NA) 8: stopifnot(sum(i) == 1) 7: private$bam_handler$get_bam_name(x) 6: FUN(X[[i]], ...) 5: vapply(bam_files, function(x) { !is.null((private$bam_handler$get_bam_name(x))) }, logical(1)) 4: FUN(newX[, i], ...) 3: apply(design[rowSums(design[, -1, drop = FALSE]) > 0, 1, drop = FALSE], MARGIN = 2, FUN = private$check_bam_files) 2: private$check_produce_matrices_params(bin_count = bin_count, bin_size = bin_size, design = design, noise_removal = noise_removal, normalization = normalization, flip_regions = flip_regions) 1: mg$produce_matrices(design = design) 3. Session info sessionInfo() R version 3.3.2 (2016-10-31) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.2 LTS locale: [1] LC_CTYPE=en_IN.UTF-8 LC_NUMERIC=C LC_TIME=en_IN.UTF-8 LC_COLLATE=en_IN.UTF-8 [5] LC_MONETARY=en_IN.UTF-8 LC_MESSAGES=en_IN.UTF-8 LC_PAPER=en_IN.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_IN.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets methods base other attached packages: [1] knitr_1.15.1 metagene_2.6.1 BiocParallel_1.8.1 GenomicRanges_1.26.3 GenomeInfoDb_1.10.3 IRanges_2.8.1 [7] S4Vectors_0.12.1 BiocGenerics_0.20.0 R6_2.2.0 BiocInstaller_1.24.0 loaded via a namespace (and not attached): [1] SummarizedExperiment_1.4.0 genefilter_1.56.0 gtools_3.5.0 locfit_1.5-9.1 [5] splines_3.3.2 lattice_0.20-34 colorspace_1.3-2 DBChIP_1.18.0 [9] rtracklayer_1.34.2 GenomicFeatures_1.26.3 XML_3.98-1.5 survival_2.40-1 [13] DBI_0.5-1 RColorBrewer_1.1-2 matrixStats_0.51.0 plyr_1.8.4 [17] zlibbioc_1.20.0 Biostrings_2.42.1 munsell_0.4.3 gtable_0.2.0 [21] caTools_1.17.1 memoise_1.0.0 Biobase_2.34.0 geneplotter_1.52.0 [25] biomaRt_2.30.0 AnnotationDbi_1.36.2 muStat_1.7.0 highr_0.6 [29] Rcpp_0.12.9.1 KernSmooth_2.23-15 xtable_1.8-2 edgeR_3.16.5 [33] scales_0.4.1 limma_3.30.11 gdata_2.17.0 annotate_1.52.1 [37] XVector_0.14.0 Rsamtools_1.26.2 gplots_3.0.1 ggplot2_2.2.1 [41] digest_0.6.12 DESeq_1.26.0 grid_3.3.2 tools_3.3.2 [45] bitops_1.0-6 lazyeval_0.2.0 RCurl_1.95-4.8 tibble_1.2 [49] RSQLite_1.1-2 Matrix_1.2-8 assertthat_0.1 GenomicAlignments_1.10.0 On Fri, Apr 21, 2017 at 3:26 AM, Charles Joly Beauparlant < notifications@github.com> wrote: > The names of the samples in the design file appear to match the bam files. > I will need more info to debug this: > > 1. The command you used to create the mg object > 2. The output of the traceback() function called right after the error > 3. The output of sessionInfo() > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > , > or mute the thread > > . >
CharlesJB commented 7 years ago

I am not able to replicate the error, are you using these commands?

> bam_files
[1] "gfpexp_arpit_cmd_sort.bam"   "gfpinput_arpit_cmd_sort.bam"
> design
                bam_files gfpexp_arpit_cmd_sort gfpinput_arpit_cmd_sort
1   gfpexp_arpit_cmd_sort                     1                       0
2 gfpinput_arpit_cmd_sort                     0                       1
> mg <- metagene$new(bam_files = bam_files, regions = regions)
> mg$produce_matrices(design = design)
>