Coder Social home page Coder Social logo

krashkov / steinernet Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 5.0 1.06 MB

R Package: Steiner tree approach for graph analysis

Home Page: https://github.com/krashkov/SteinerNet

R 100.00%
biological-networks cran graph-algorithms r-language r-package steiner-heuristic steiner-tree steiner-tree-problem

steinernet's People

Contributors

afshinsadeghi avatar krashkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

steinernet's Issues

Compatibility with igraph 2.0.0

@krashkov @afshinsadeghi: This package does not terminate its checks when run with the release candidate for igraph 2.0.0.

Is this a problem in your package? Should we be doing things differently?

Install the 2.0.0 release candidate using pak::pak("igraph/rigraph") .

We're planning to release igraph 2.0.0 on January 23. My sincere apologies for the short notice, I only realized today that I should have warned about the problem much earlier. Happy to postpone if it turns out that the problem is on our end. Thank you for your help!

Tracker: igraph/rigraph#989.

Vertices name in steinertree function

Hello all,

Can anyone tell me how to retain the name of vertices in steinertree package (R)? Below is the code I used. The final object SP (igraph object) is the one that is showing node names as 1,2,3..

library(igraph)
    library(SteinerNet)

    a <- read.table("interactions.txt", sep="\t", quote="")
    head(a)
                   V1
    1 ENSP00000222390
    2 ENSP00000391826
    3 ENSP00000222390
    4 ENSP00000391669
    5 ENSP00000222390
    6 ENSP00000384675

    el <- matrix(as.vector(a$V1), nc=2, byrow=T) 

    g1 =graph_from_edgelist(el, directed=F)

    ter_list= c("ENSP00000306512","ENSP00000340019","ENSP00000361125","ENSP00000367207","ENSP00000384273","ENSP00000388107","ENSP00000400175","ENSP00000401303")
    SP=steinertree(type ="SP",terminals = ter_list, graph = g1)

SP
[[1]]
IGRAPH 6a21ce1 UN-- 139 1600 -- 
+ attr: name (v/c), realname (v/c), color (v/c)
+ edges from 6a21ce1 (vertex names):
 [1] 1 --2  1 --3  1 --4  1 --5  1 --6  1 --7  1 --8  1 --9  1 --10 1 --11
[11] 1 --12 1 --13 1 --14 1 --15 1 --16 1 --17 1 --18 1 --19 1 --20 1 --21
[21] 1 --22 1 --23 1 --24 1 --25 1 --26 1 --27 1 --28 1 --29 1 --30 1 --31
[31] 1 --32 1 --33 34--35 34--36 34--37 34--38 9 --34 34--39 20--34 34--40
[41] 25--34 27--34 34--41 34--42 34--43 34--44 35--45 45--46 45--47 45--48
[51] 38--45 45--49 39--45 40--45 45--50 30--51 3 --30 4 --30 30--52 30--53
[61] 30--54 5 --30 30--48 30--55 8 --30 30--56 9 --30 10--30 30--57 11--30
[71] 15--30 30--58 20--30 21--30 30--59 25--30 30--60 27--30 28--30 3 --61
+ ... omitted several edges

[[2]]
IGRAPH 886b59f UN-- 12 11 -- 
+ attr: name (v/c), realname (v/c), color (v/c)
+ edges from 886b59f (vertex names):
 [1] 5 --8  5 --19 5 --21 5 --50 35--50 5 --51 21--53 5 --61 8 --69 53--73
[11] 5 --84

Please help me out. Thanks.

Deletion of joint subtrees in steinertree3 incomplete

Hi,
I believe there is an issue with the merging of non-disjoint subtrees in the steinertree3 function in steinertree.R (lines 261 and following):
I encountered a case where there is no overlap between my trees with i=1 and j=2. So j is increased to 3. In this case there was an overlap between the i=1 and j=3 trees. When j reaches the end of the subtree list, i is increased. The problem is that the tree at i=1 is not the same anymore than the one that has been tested against j=2 (because it has been merged with other trees), so the new i=1 and j=2 trees may actually overlap. In my case, this lead to an empty list when calculating 'nsubtrees', which cased an error.
A solution may be to not increase i in a loop where something has been merged into the corresponding tree. My code is too complex to share here, but I hope the explanation makes sense.

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.