snystrom / memes

An R interface to the MEME Suite
https://snystrom.github.io/memes/
Other
43 stars 5 forks source link

`runAme(sequences, control = "shuffle", evalue_report_threshold = 30)` get `FATAL: Template does not contain data section` #116

Open danli349 opened 5 months ago

danli349 commented 5 months ago

Hello:

I run the example codes in the README:

check_meme_install()
checking main install

✔ /home/dan/meme/bin
checking util installs

✔ /home/dan/meme/bin/dreme
✔ /home/dan/meme/bin/ame
✔ /home/dan/meme/bin/fimo
✔ /home/dan/meme/bin/tomtom
✔ /home/dan/meme/bin/meme
✔ /home/dan/meme/bin/streme
sequences
DNAStringSet object of length 10:
     width seq                                              names               
 [1]   200 AGAATGTTATATATTCAAGAGGC...TTAGGTTTCTAGAATAGCCCCG chr3L:14551120-14...
 [2]   200 TGGGCCCATTTTTATCATTTTCC...CCCCCTCACATTTTAATTGTTG chr3L:14625651-14...
 [3]   200 GGGCATACAGTAGAGCATCGTTG...ACAGGCTCTTTACCTAGTGCAA chr3L:14634365-14...
 [4]   200 TCACTCACTGAAAAAAAAACATA...GTACGGTTGCTCCACTTCGATG chr3L:14636806-14...
 [5]   200 ATTTTGCCTGTGTGGTCTCACCT...TTTTCGGGAGTGCAGCCAAAGA chr3L:14638235-14...
 [6]   200 CTGAGTGTATATATGTATATATT...CTCTATCCCCAATATCTTCTTT chr3L:14743361-14...
 [7]   200 TTATATAGCATTGCTCAGAAAAC...TTTGCCGTAGGAGCAAGGGAGA chr3L:14755203-14...
 [8]   200 TCCAATCGGCGTTAAAGCAGTGA...GGTAGGAATAGAATTACTATGT chr3L:14759244-14...
 [9]   200 CATCTCTAGGGTCCGGGTCCGGT...ACAGGCACTTACTCACCAGTGT chr3L:14978542-14...
[10]   200 GCACATTCACACATTGTGTACGT...CTGGCGTTTTTTGCGTTTCAGT chr3L:15104843-15...
# here I set the evalue_report_threshold = 30 to detect motifs in the limited example sequences
# In a real analysis, evalue_report_threshold should be carefully selected
ame_results <- runAme(sequences, control = "shuffle", evalue_report_threshold = 30)
ame_results
Added /home/dan/meme-5.5.5/Databases/motif_databases/FLY/OnTheFly_2014_Drosophila.meme to motif_sources which now has 1 file names.
Motif file name is /home/dan/meme-5.5.5/Databases/motif_databases/FLY/OnTheFly_2014_Drosophila.meme.
Writing results to output directory '/tmp/RtmpfGjF2s/file5e657f9a0350_vs_shuffle'.
E-value threshold for reporting results: 30
Checking alphabets in 1 motif files.
Loading motifs from file '/home/dan/meme-5.5.5/Databases/motif_databases/FLY/OnTheFly_2014_Drosophila.meme'
Loading primary sequences.
Creating control sequences by shuffling input sequences preserving 2-mers.
Not in partition maximization mode. Fixing partition at the number of primary sequences (10).
Bad file name.
Bad file name.
Bad file name.
Bad file name.
Bad file name.
Bad file name.
Bad file name.
Bad file name.
Bad file name.
Bad file name.
Bad file name.
Bad file name.
FATAL: Template does not contain data section.

Error: Shell process had non-zero exit status.
Traceback:

1. runAme(sequences, control = "shuffle", evalue_report_threshold = 30)
2. runAme.default(sequences, control = "shuffle", evalue_report_threshold = 30)
3. ps_out %>% process_check_error(help_fun = ~{
 .     ame_help(command)
 . }, user_flags = cmdfun::cmd_help_parse_flags(user_flags) %>% 
 .     grep("shuffle", ., invert = TRUE, value = TRUE), flags_fun = ~{
 .     gsub("-", "_", .x)
 . }, default_help_fun = TRUE)
4. process_check_error(., help_fun = ~{
 .     ame_help(command)
 . }, user_flags = cmdfun::cmd_help_parse_flags(user_flags) %>% 
 .     grep("shuffle", ., invert = TRUE, value = TRUE), flags_fun = ~{
 .     gsub("-", "_", .x)
 . }, default_help_fun = TRUE)
5. usethis::ui_stop("Shell process had non-zero exit status.")
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3;  LAPACK version 3.9.0

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

time zone: America/New_York
tzcode source: system (glibc)

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

other attached packages:
 [1] universalmotif_1.18.1                 BSgenome.Dmelanogaster.UCSC.dm6_1.4.1
 [3] BSgenome_1.68.0                       rtracklayer_1.60.1                   
 [5] Biostrings_2.68.1                     XVector_0.40.0                       
 [7] GenomicRanges_1.52.1                  GenomeInfoDb_1.36.4                  
 [9] IRanges_2.34.1                        S4Vectors_0.38.2                     
[11] BiocGenerics_0.46.0                   magrittr_2.0.3                       
[13] memes_1.8.0                          

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.0            IRdisplay_1.1              
 [3] farver_2.1.1                dplyr_1.1.3                
 [5] R.utils_2.12.2              bitops_1.0-7               
 [7] fastmap_1.1.1               RCurl_1.98-1.12            
 [9] GenomicAlignments_1.36.0    XML_3.99-0.8               
[11] digest_0.6.33               lifecycle_1.0.4            
[13] Cairo_1.6-1                 processx_3.8.2             
[15] compiler_4.3.0              rlang_1.1.2                
[17] tools_4.3.0                 utf8_1.2.4                 
[19] yaml_2.3.7                  data.table_1.14.8          
[21] labeling_0.4.3              S4Arrays_1.0.6             
[23] bit_4.0.5                   splitstackshape_1.4.8      
[25] DelayedArray_0.26.7         xml2_1.3.2                 
[27] repr_1.1.6                  pkgload_1.3.3              
[29] abind_1.4-5                 BiocParallel_1.34.2        
[31] pbdZMQ_0.3-10               withr_2.5.1                
[33] purrr_1.0.2                 desc_1.4.2                 
[35] R.oo_1.25.0                 grid_4.3.0                 
[37] fansi_1.0.5                 MotifDb_1.42.0             
[39] colorspace_2.1-0            ggplot2_3.4.4              
[41] MASS_7.3-60                 scales_1.2.1               
[43] SummarizedExperiment_1.30.2 cli_3.6.1                  
[45] cmdfun_1.0.2                crayon_1.5.2               
[47] generics_0.1.3              tzdb_0.4.0                 
[49] rjson_0.2.21                ggseqlogo_0.1              
[51] zlibbioc_1.46.0             parallel_4.3.0             
[53] restfulr_0.0.15             matrixStats_1.0.0          
[55] base64enc_0.1-3             vctrs_0.6.5                
[57] Matrix_1.6-1.1              jsonlite_1.8.7             
[59] patchwork_1.1.3             hms_1.1.3                  
[61] bit64_4.0.5                 testthat_3.2.0             
[63] tidyr_1.3.0                 glue_1.6.2                 
[65] codetools_0.2-19            ps_1.7.5                   
[67] gtable_0.3.4                BiocIO_1.10.0              
[69] munsell_0.5.0               tibble_3.2.1               
[71] pillar_1.9.0                htmltools_0.5.7            
[73] brio_1.1.3                  IRkernel_1.3.2.9000        
[75] GenomeInfoDbData_1.2.10     R6_2.5.1                   
[77] rprojroot_2.0.3             vroom_1.6.4                
[79] evaluate_0.23               Biobase_2.60.0             
[81] lattice_0.21-9              readr_2.1.4                
[83] R.methodsS3_1.8.2           Rsamtools_2.16.0           
[85] Rcpp_1.0.11                 uuid_1.1-1                 
[87] fs_1.6.3                    MatrixGenerics_1.12.3      
[89] usethis_2.2.2               pkgconfig_2.0.3      

How should I fix this? Thanks

danli349 commented 5 months ago

When I run the tutorial https://snystrom.github.io/memes-manual/articles/integrative_analysis.html I found this error again:

head(by_binding)
BStringSetList of length 3
[["ectopic"]] chr3L:40482-40581=GGACTGGGGTTGGGTACGAAACGAAATGGAAACATAGCCAAACAC...
[["entopic"]] chr3L:60616-60715=CAGGTGCATCCCGCGACGAGTATTTTTTATATTATTGTTTGGCCG...
[["orphan"]] chr3L:57749-57848=GAAACCTATACCCCGCCGTCGGCCGATTATCACCTTTTCAAGTCTC...
ame_by_binding <- by_binding %>% 
  runAme

Added /tmp/RtmpD0mwb1/file62f8791c7d96.meme to motif_sources which now has 1 file names. Motif file name is /tmp/RtmpD0mwb1/file62f8791c7d96.meme. Writing results to output directory '/tmp/RtmpD0mwb1/file62f8206069aa_vs_shuffle'. E-value threshold for reporting results: 10 Checking alphabets in 1 motif files. Loading motifs from file '/tmp/RtmpD0mwb1/file62f8791c7d96.meme' Loading primary sequences. Creating control sequences by shuffling input sequences preserving 2-mers. Not in partition maximization mode. Fixing partition at the number of primary sequences (2421). Bad file name. Bad file name. Bad file name. Bad file name. Bad file name. Bad file name. Bad file name. Bad file name. Bad file name. Bad file name. Bad file name. Bad file name. FATAL: Template does not contain data section.

Error in purrr::map(): ℹ In index: 1. ℹ With name: ectopic. Caused by error: ! Shell process had non-zero exit status. Traceback:

  1. by_binding %>% runAme
  2. runAme(.)
  3. runAme.BStringSetList(.)
  4. runAme.list(as.list(input), control, outdir, method, database, . meme_path, sequences, silent, ...)
  5. purrr::map(input, runAme.default, control = control, outdir = outdir, . method = method, database = database, meme_path = meme_path, . sequences = sequences, silent = silent, ...)
  6. map_("list", .x, .f, ..., .progress = .progress)
  7. with_indexed_errors(i = i, names = names, error_call = .purrr_error_call, . call_with_cleanup(map_impl, environment(), .type, .progress, . n, names, i))
  8. withCallingHandlers(expr, error = function(cnd) { . if (i == 0L) { . } . else { . message <- c(i = "In index: {i}.") . if (!is.null(names) && !is.na(names[[i]]) && names[[i]] != . "") { . name <- names[[i]] . message <- c(message, i = "With name: {name}.") . } . else { . name <- NULL . } . cli::cli_abort(message, location = i, name = name, parent = cnd, . call = error_call, class = "purrr_error_indexed") . } . })
  9. call_with_cleanup(map_impl, environment(), .type, .progress, . n, names, i)
  10. .f(.x[[i]], ...)
  11. ps_out %>% process_check_error(help_fun = ~{ . ame_help(command) . }, user_flags = cmdfun::cmd_help_parse_flags(user_flags) %>% . grep("shuffle", ., invert = TRUE, value = TRUE), flagsfun = ~{ . gsub("-", "", .x) . }, default_help_fun = TRUE)
  12. process_check_error(., help_fun = ~{ . ame_help(command) . }, user_flags = cmdfun::cmd_help_parse_flags(user_flags) %>% . grep("shuffle", ., invert = TRUE, value = TRUE), flagsfun = ~{ . gsub("-", "", .x) . }, default_help_fun = TRUE)
  13. usethis::ui_stop("Shell process had non-zero exit status.")
  14. stop(cnd)
  15. (function (cnd) . { . if (i == 0L) { . } . else { . message <- c(i = "In index: {i}.") . if (!is.null(names) && !is.na(names[[i]]) && names[[i]] != . "") { . name <- names[[i]] . message <- c(message, i = "With name: {name}.") . } . else { . name <- NULL . } . cli::cli_abort(message, location = i, name = name, parent = cnd, . call = error_call, class = "purrr_error_indexed") . } . })(structure(list(message = structure("Shell process had non-zero exit status.", class = c("glue", . "character"))), class = c("usethis_error", "error", "condition" . )))
  16. cli::cli_abort(message, location = i, name = name, parent = cnd, . call = error_call, class = "purrr_error_indexed")
  17. rlang::abort(message, ..., call = call, use_cli_format = TRUE, . .frame = .frame)
  18. signal_abort(cnd, .file)
snystrom commented 4 months ago

Hi Dan,

Sorry for just now seeing this issue, I was sick the week you reported & this slipped through the cracks!

Would you mind sharing how you installed the meme suite? I believe this error can happen when AME is missing a core file in its install. Perhaps rerun your runAme call using verbose = TRUE and post the resulting log.

I see you are running MEME Suite 5.5.5 which I have not tested myself, so perhaps the developers made a change. I can also take a look at their release notes for any clues.

Another way to test is to attempt to run ame at the commandline and see if it still errors. That may help rule out whether the R code or the install itself is at fault.

Sorry again for the delay.