{"id":22413797,"url":"https://github.com/jsta/dcir","last_synced_at":"2026-01-28T08:14:47.763Z","repository":{"id":30866734,"uuid":"34424333","full_name":"jsta/dciR","owner":"jsta","description":"Calculate Directional Connectivity Index without Matlab","archived":false,"fork":false,"pushed_at":"2016-07-31T00:16:05.000Z","size":302,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-08T10:41:38.797Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Matlab","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-23T00:39:40.000Z","updated_at":"2016-07-31T00:16:06.000Z","dependencies_parsed_at":"2022-09-06T23:51:24.583Z","dependency_job_id":null,"html_url":"https://github.com/jsta/dciR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jsta/dciR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsta%2FdciR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsta%2FdciR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsta%2FdciR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsta%2FdciR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsta","download_url":"https://codeload.github.com/jsta/dciR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsta%2FdciR/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28842835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-05T14:14:36.087Z","updated_at":"2026-01-28T08:14:47.747Z","avatar_url":"https://github.com/jsta.png","language":"Matlab","funding_links":[],"categories":[],"sub_categories":[],"readme":"dciR\n====\n\n[![Project Status: Unsupported - The project has reached a stable, usable state but the author(s) have ceased all work on it. A new maintainer may be desired.](http://www.repostatus.org/badges/latest/unsupported.svg)](http://www.repostatus.org/#unsupported)\n\nTHIS VERSION ONLY WORKS ON LINUX DUE TO INCOMPATABILITY BETWEEN RcppOctave AND WINDOWS! \n\nA modification of the directional connectivity index calculation from Larsen et al. (2012). Essentially replaces [MatlabBGL](http://dgleich.github.com/matlab-bgl/) with [RBGL](http://www.bioconductor.org/packages/release/bioc/html/RBGL.html). For convenience, Octave is called from R using [RcppOctave](http://cran.r-project.org/web/packages/RcppOctave/index.html).\n\nRequires RBGL, Octave, and RcppOctave (verified to work with version 3.8.1 and 0.14.5 respectively)\n\n\n\n## Installation\n  ```R\n  install.packages('devtools')  # package devtools needed\n  devtools::install_github('jsta/dciR')\n  \n  source(\"http://bioconductor.org/biocLite.R\")\n  biocLite(\"RBGL\")\n  #biocLite(\"Rgraphviz\")\n  ```\n  \n## Examples\n   ```R\n   #The example below reproduces figure 3 from Larsen et al. (2012)#####\n   library(dciR)\n      \n   #load test matricies####\n   ma \u003c- matrix(c(0,0,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0,1,1,0,0,0),nrow=5,byrow=T)\n   mb \u003c- matrix(c(1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0),nrow=5,byrow=T)\n   mc \u003c- matrix(c(1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,0,1),nrow=5,byrow=T)\n   md \u003c- matrix(c(1,0,0,0,1,1,0,1,0,1,0,0,1,0,0,1,0,0,0,1,1,0,0,0,1),nrow=5,byrow=T)\n   \n   data.frame(cbind(letters[1:4],round(unlist(lapply(list(ma,mb,mc,md),function(x) dci(x,1,1))),3)))\n   \n   #The example below reproduces Figure 4####\n   library(jpeg)\n   library(raster)\n   \n   c1\u003c-readJPEG(system.file(\"images\",\"conserved1.jpg\",package=\"dciR\"))\n   c2\u003c-readJPEG(system.file(\"images\",\"conserved2.jpg\",package=\"dciR\"))\n   s1\u003c-readJPEG(system.file(\"images\",\"sim1.jpg\",package=\"dciR\"))\n   r1\u003c-readJPEG(system.file(\"images\",\"rotated1.jpg\",package=\"dciR\"))\n   d1\u003c-readJPEG(system.file(\"images\",\"degraded1.jpg\",package=\"dciR\"))\n   \n   \n   c1\u003c-raster(matrix(c1,nrow=dim(c1)[1],ncol=dim(c1)[2]))\u003c0.4\n   c2\u003c-raster(matrix(c2,nrow=dim(c2)[1],ncol=dim(c2)[2]))\u003c0.4\n   s1\u003c-raster(matrix(s1,nrow=dim(s1)[1],ncol=dim(s1)[2]))\u003c0.4\n   r1\u003c-raster(matrix(r1,nrow=dim(r1)[1],ncol=dim(r1)[2]))\u003c0.4\n   d1\u003c-raster(matrix(d1,nrow=dim(d1)[1],ncol=dim(d1)[2]))\u003c0.4\n   \n   par(mfrow=c(1,5))\n   lapply(c(c1,c2,s1,r1,d1),function(x) plot(x,bty=\"n\",box=FALSE,axes=FALSE,legend=FALSE))\n   ```\n  \n   ![](inst/images/fig4.png)\n   \n   ```R\n   \n   #The example below reproduces Figure 5####\n   ret\u003c-list()\n   aglist\u003c-4:22\n   \n   ag_dci\u003c-function(c1,ag){\n   c1r\u003c-aggregate(c1,ag,fun=median)\u003e0.7\n   c1mat\u003c-as.matrix(c1r)\n   time\u003c-system.time(val\u003c-dci(c1mat,1,1))\n   list(time,val,sum(c1mat))\n   }\n      \n   for(i in aglist){\n   ret[[i]]\u003c-ag_dci(c1,i)\n   }\n      \n   ret\u003c-cbind(matrix(unlist(ret),ncol=7,byrow=T),aglist)\n   \n   par(mfrow=c(1,2))\n   plot(ret[,7]/10000,ret[,1],log=\"y\",yaxt=\"n\",xlim=c(0,3),ylim=c(1,10000),xlab=\"Number of nodes x 10^4\",ylab=\"Computation time (s)\")\n   labels\u003c-sapply(seq(0,3,1),function(i) as.expression(bquote(10^ .(i))))\n   axis(2,at=c(1,10,100,1000),labels=labels)\n   \n   plot(ret[,7]/10000,ret[,1],xlab=\"Number of nodes x 10^4\",ylab=\"\")\n   \n   ```\n   ![](inst/images/fig5.png)\n   ```R\n      \n   #The example below reproduces Figure 6\n   \n   ret\u003c-matrix(unlist(lapply(c(c1,c2,s1,d1),function(x) ag_dci(x,16))),ncol=7,byrow=T)\n   barplot(ret[,6],names.arg=c(\"Conserved1\",\"Conserved2\",\"Sim1\",\"Degraded1\"),ylim=c(0,1),las=2)\n   ```\n   \n   ![](inst/images/fig6.png)\n      \n   \n## References \n\n**Larsen, L. G., Choi, J., Nungesser, M. K., \u0026 Harvey, J. W. (2012)**. Directional connectivity in hydrology and ecology. *Ecological applications*, **22**(8), 2204-2220.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsta%2Fdcir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsta%2Fdcir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsta%2Fdcir/lists"}