rr1859 / R.4Cker

MIT License
16 stars 15 forks source link

error in .data.frame when running transAnalysis.R #1

Closed nagoue closed 8 years ago

nagoue commented 8 years ago

Hi, I tried to run the transAnalysis.R with the data provided i.e. CD83_HindIII but it returned the following error message : [1] "Building adaptive windows..." [1] "Normalizing counts..." [1] "Generating synthetic samples...." Error in [.data.frame(non_int, , 1) : undefined columns selected Called from: [.data.frame(non_int, , 1)

The same message pop up with my own dataset. On the other hand, the 2 other programs for nearBait and cis Analysis are working fine. Is there any connection with comment L23

while loop to change the quantile separation if the parameter estimation fails ?

Any ideas how to fix this? Regards, Nadia

rr1859 commented 8 years ago

Hi, What k did you use for the trans analysis? I usually see this when there isnt a good separation between the states.

nagoue commented 8 years ago

Hi, I run it with k=20. Since your message, I also tried it with k=100 and even k =200 ! resulting in the same error message. The code is : data(CD83_HindIII) my_obj = createR4CkerObjectFromDFs(dfs = c("CD83_HindIII_1", "CD83_HindIII_2"), bait_chr="chr13", bait_coord= 43773612, bait_name = "CD83", primary_enz = "AAGCTT", samples = c("CD83_H_1", "CD83_H_2"), conditions = "CD83", replicates = 2, species = "mm", output_dir = "~/Documents/results/4C/R/CD83/") trans_results=transAnalysis(my_obj,k=100)

[1] "Building adaptive windows..." [1] "Normalizing counts..." [1] "Generating synthetic samples...." Error in [.data.frame(non_int, , 1) : undefined columns selected Called from: [.data.frame(non_int, , 1)

rr1859 commented 8 years ago

Thanks so much for catching this! I had uploaded an older version of the transAnalysis.R file which did not have the correct variable name (I was previously using synth_hmm_input but had changed it to hmm_input). I re-tested the package and it works now. Please try now and let me know if it works!

nagoue commented 8 years ago

Hi, I have downloaded the newest R.4Cker. Unfortunately, I am facing the same error. If that might help, here is my R session : sessionInfo() R version 3.2.4 Revised (2016-03-16 r70336) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 14.04.4 LTS

locale: [1] LC_CTYPE=fr_FR.UTF-8 LC_NUMERIC=C LC_TIME=fr_FR.UTF-8 LC_COLLATE=fr_FR.UTF-8 LC_MONETARY=fr_FR.UTF-8 LC_MESSAGES=fr_FR.UTF-8
[7] LC_PAPER=fr_FR.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] ggplot2_2.1.0 Rsolnp_1.16 R.4Cker_0.0.0.9000

loaded via a namespace (and not attached): [1] Rcpp_0.12.3 RColorBrewer_1.1-2 futile.logger_1.4.1 GenomeInfoDb_1.6.3 plyr_1.8.3 XVector_0.10.0
[7] miscTools_0.6-16 futile.options_1.0.0 tools_3.2.4 zlibbioc_1.16.0 digest_0.6.9 rpart_4.1-10
[13] RSQLite_1.0.0 annotate_1.48.0 gtable_0.2.0 lattice_0.20-33 psych_1.5.8 DBI_0.3.1
[19] parallel_3.2.4 RcppArmadillo_0.6.600.4.0 gridExtra_2.2.1 genefilter_1.52.1 cluster_2.0.3 S4Vectors_0.8.11
[25] IRanges_2.4.8 locfit_1.5-9.1 stats4_3.2.4 depmixS4_1.3-3 nnet_7.3-12 grid_3.2.4
[31] Biobase_2.30.0 AnnotationDbi_1.32.3 XML_3.98-1.1 survival_2.38-3 BiocParallel_1.4.3 foreign_0.8-66
[37] latticeExtra_0.6-28 Formula_1.2-1 geneplotter_1.48.0 DESeq2_1.10.1 lambda.r_1.1.7 Hmisc_3.17-2
[43] scales_0.4.0 MASS_7.3-45 BiocGenerics_0.16.1 GenomicRanges_1.22.4 splines_3.2.4 mnormt_1.5-4
[49] SummarizedExperiment_1.0.2 xtable_1.8-2 colorspace_1.2-6 labeling_0.3 acepack_1.3-3.3 munsell_0.4.3
[55] truncnorm_1.0-7

rr1859 commented 8 years ago

Can you print the transAnalysis function and send the output of that?

nagoue commented 8 years ago

Hi, it's finally worked! Thank you for clearly mentioning what your update was. Actually, the script I cloned from github was correct but when I did a simple print(transAnalysis), the older version was printed (despite my previous cleaning before reinstalling). So I sourced the transAnalysis.R and that solved the problem. Thank you for kind help. Cheers,