Giter Club home page Giter Club logo

bed's People

Contributors

patzaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bed's Issues

[searchBeid.R] Non-robust String manipulations

Function searchBeid

The function contains a lot of "low"-level string manipulations. The code is per se not robust.

A better alternative would be to write a parser for the string:

  • it increases the code robustness;
  • may be also faster;

Sample Parser

Have a look on my GitHub page for sample code how to write a parser:

https://github.com/discoleo/R/blob/master/Stat/Tools.Code.R

The function parse.simple implements a minimal parser, including processing and matching of specific brackets. It returns a data.frame with the positions of the various tokens in the original string (without generating intermediary strings). It is implemented (mostly) based on a finite state machine.

The function extract.str extracts then the tokens. The code can be adapted (e.g. to extract directly the desired tokens).

Some examples are available in:

https://github.com/discoleo/R/blob/master/Stat/Tools.Code.Tests.R

For a much simple version of such a parser, see function parseParenth inside the file TextMining.R. It can be used to parse Pubmed abstracts and detect non-matching brackets. The function extractParenth extracts the content between the parenthesis.

https://github.com/discoleo/R/blob/master/TextMining/Pubmed/TextMining.R

Error in connectToBed function

Hi,
I am having some trouble establishing a connection to BED. I followed the basic tutorial here. Installation of the package itself and dependencies worked out fine. However, when trying to connect to BED via

connectToBed(url="localhost:5454", remember=TRUE, useCache=TRUE)

it results in the following error:

Error in function (type, msg, asError = TRUE)  : 
  Failed to connect to localhost port 5454: Connection refused
BED is not connected.
You can connect to a BED database instance using the connectToBed function.
[1] FALSE
Warning message:
In rm("graph", envir = bedEnv) : object 'graph' not found

Any help on this would be highly appreciated, thanks in advance!


R session info:

R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.5

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] BED_1.4.7        visNetwork_2.1.0 neo2R_2.1.0     

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.1  remotes_2.2.0     purrr_0.3.4       vctrs_0.3.8       generics_0.1.1   
 [6] testthat_2.3.2    miniUI_0.1.1.1    usethis_1.6.3     htmltools_0.5.2   base64enc_0.1-3  
[11] utf8_1.2.2        blob_1.2.1        rlang_0.4.12      pkgbuild_1.1.0    pillar_1.6.4     
[16] later_1.2.0       glue_1.6.0        withr_2.4.3       DBI_1.1.0         sessioninfo_1.1.1
[21] lifecycle_1.0.1   stringr_1.4.0     devtools_2.3.2    htmlwidgets_1.5.4 memoise_1.1.0    
[26] callr_3.5.1       fastmap_1.1.0     httpuv_1.6.5      ps_1.4.0          curl_4.3         
[31] fansi_1.0.2       Rcpp_1.0.8        xtable_1.8-4      backports_1.1.10  promises_1.2.0.1 
[36] DT_0.20           desc_1.2.0        pkgload_1.1.0     jsonlite_1.7.2    mime_0.12        
[41] fs_1.5.2          digest_0.6.29     stringi_1.7.6     processx_3.4.4    dplyr_1.0.7      
[46] shiny_1.7.1       rprojroot_1.3-2   bitops_1.0-7      cli_3.1.1         tools_3.6.2      
[51] magrittr_2.0.1    RCurl_1.98-1.5    tibble_3.1.6      crayon_1.4.2      pkgconfig_2.0.3  
[56] ellipsis_0.3.2    prettyunits_1.1.1 assertthat_0.2.1  rstudioapi_0.13   R6_2.5.1         
[61] compiler_3.6.2   

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.