Giter Site home page Giter Site logo

csbiology / fsharpgephistreamer Goto Github PK

View Code? Open in Web Editor NEW
25.0 5.0 5.0 33.99 MB

F# functions for streaming any kind of graph/network data to the network visualization tool gephi

Home Page: https://csbiology.github.io/FSharpGephiStreamer/

License: MIT License

Batchfile 0.11% F# 89.32% Shell 0.37% HTML 3.49% CSS 3.59% TeX 3.12%
gephi fsharp streaming-graph-data visualization graph-visualization exploratory-data-analysis data-analysis

fsharpgephistreamer's Introduction

FSharpGephiStreamer NuGet Badge DOI

F# functions for streaming any kind of graph/network data to the network visualization tool gephi. https://csbiology.github.io/FSharpGephiStreamer/

Branch Ubuntu(trusty) Windows
master Build Status Build status
developer Build Status Build status

FSharpGephi streamer was accepted in The Journal of Open Source Software (JOSS) with version 1.1.6. If you use this software in your research, please cite:

Schneider et al., (2019). FSharpGephiStreamer: An idiomatic bridge between F# and network visualization. Journal of Open Source Software, 4(38), 1445, https://doi.org/10.21105/joss.01445

Introduction

Gephi is the leading visualization and exploration software for all kinds of graphs and networks. Gephi is open-source and free

FSharpGephi streamer tackles the gap between the capabilities of F# in regards of strongly typed handling of large data sets and the visualization capabilites of Gephi by directly connecting them to each other. It enables users to convert any type of node/edge data to gephi interpretable objects and put them into gephi through F# interactive without the need of any UI interaction but the starting of the streaming server.

Demo

Prerequisites

A local installation of Java, Gephi and the Graph Streaming plugin is necessary. See here for more indepth installation instructions.

Documentation

Functions, types and Classes contained in the FSharpGephiStreamer library come with short explanatory description, which can be found in the API Reference.

More indepth explanations, tutorials and general information about the project can be found here.

The documentation and tutorials for this library are automatically generated (using the F# Formatting) from *.fsx and *.md files in the docsrc folder. If you find a typo, please submit a pull request!

Contributing

Please refer to the contribution guidelines

Library license

The library (1.1.0+) is available under MIT. For more information see the License file in the GitHub repository.

fsharpgephistreamer's People

Contributors

cgravill avatar kmutagene avatar muehlhaus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fsharpgephistreamer's Issues

Review: I see no nodes / Http_CreateRequestFailed

Describe the bug
When attempting to create nodes I'm getting this exception: Http_CreateRequestFailed

Note while I started with the install instructions as they are at: https://csbiology.github.io/FSharpGephiStreamer/exampleAnalysis.html I made some adjustments. What you're currently doing:

let addOboNode (node:GONode) =

    let nodeConverter (node:GONode) =
        [
            Grammar.Attribute.Label (sprintf "%s | %s {%s}" node.Id node.TermDescription node.NameSpace); 
            Grammar.Attribute.Size  10.; 
            Grammar.Attribute.Color node.Color; 
            Grammar.Attribute.UserDef ("UserData",node.TermDescription); 
        ]
    Streamer.addNode nodeConverter node.Id node

goNodes |> List.map addOboNode

means that you're masking errors with the implicit ignore on the List.map (which generates warnings). I suggest you need to choose, if you're going to use the Either monad then it's important to include that in your examples

As to the actual error, I do have Gephi running but perhaps there's an access issue? Any guidance on debugging this?

Expected behavior
Nodes and edges into Gephi

OS and framework information (please complete the following information):

  • OS: Windows 10
  • .Net core SDK version [e.g. 2.2.203 ]

Additional context
This is possibly related to #15 perhaps I have the wrong version for you?

openjournals/joss-reviews#1445

REVIEW: installation instructions

It would be nice to include instructions for OpenJDK to ensure flexibility of usage under a permissive license. I was was able to run Gephi on Windows successfully with binaries installed from https://adoptopenjdk.net/

The only complication was Gephi didn't automatically detect the installation which meant I had to alter the gephi.conf (found at C:\Program Files\Gephi-0.9.2\etc\gephi.conf) to contain:

jdkhome="C:\Program Files\AdoptOpenJDK\jre-11.0.3.7-hotspot"

https://joss.readthedocs.io/en/latest/review_criteria.html#what-about-submissions-that-rely-upon-proprietary-languages-development-environments

The install instructions seem to assume a working F# installation. It might help newcomers to point towards https://fsharp.org/ for instructions on installing F# for their environment.

openjournals/joss-reviews#1445

Review: Create a smaller (simpler) example

Is your feature request related to a problem? Please describe.
Currently, the there is one example mentioned in the main project page

While this is a very good example of how FSharpGephiStreamer can be used very easily to generate large complex graphs, the runtime is pretty big (or the set up time is too long).
Users can either

  • Parse the CSV files which takes a long time
  • Parse the .obo files using BioFSharps which requires users to build the dependencies of BioFSharps.

Describe the solution you'd like
It might be useful to the users if there was a "Hello World" example with very few nodes and edges (perhaps even 5 or 10) that shows how easily the tool can be used. (Preferably something that does not require parsing a large file.)

Describe alternatives you've considered
Currently, I am circumventing this issue by selecting just a few nodes from Gene Ontology Example to test and stream.

Review: example instructions

In the example instructions (https://csbiology.github.io/FSharpGephiStreamer/exampleAnalysis.html) you provide two approaches for loading nodes and edges. It's great that there's a locally reproducible version but also great to see your first alpha release of BioFSharp.

When taking the CSV route it gets a bit confusing. You have to get code later in the tutorial for e.g. createGONode but must only take part of the code from that section.

I suggest splitting and moving this section:

open FSharpGephiStreamer
open FSharpGephiStreamer.Colors


/// Simplified GO Term as node
type GONode = { 
    //GO term (e.g. "GO:0000001")
    Id              : string
    //full term description e.g. "RNA polymerase I transcription factor complex"
    TermDescription : string
    //e.g. "biological process"
    NameSpace       : string
    //The color for the node
    Color           : Colors.Color
    }

/// Creates GONode
let createGONode id descr nameSpace col =
    {Id = id; TermDescription = descr; NameSpace = nameSpace ; Color = col}

/// Represents the Is_A relationship of GO terms as a directed edge
type GOEdge = {
    Id          : int
    Source      : string
    Target      : string
    TargetColor : Colors.Color
}

/// Creates GOEdge
let createGOEdge i source target tc = {Id = i; Source = source; Target = target; TargetColor = tc}

up before the CSV loading section then give people a choice to either load via CSV or using the Obo parser.

Hope this is clear and helps.

openjournals/joss-reviews#1445

Error on running the CSV based example

Describe the bug
Error on running the CSV based example

To Reproduce
Steps to reproduce the behavior:

open System.IO
open System.Text

let readFromFile (file:string) =
        seq {use textReader = new StreamReader(file, Encoding.Default)
             while not textReader.EndOfStream do
                 yield textReader.ReadLine()}

let nodes = 
    readFromFile (__SOURCE_DIRECTORY__ + "/data/goNodeList.csv") 
    |> List.ofSeq
    |> List.map (fun n -> let tmp = n.Split([|','|])
                          createGONode tmp.[0] tmp.[1] tmp.[2] (Colors.Table.StatisticalGraphics24.getRandomColor()))

let edges = 
    readFromFile (__SOURCE_DIRECTORY__ + "/data/goEdgeList.csv") |> List.ofSeq
    |> List.ofSeq
    |> List.map (fun n -> let tmp = n.Split([|','|])
                          createGOEdge (tmp.[0] |> int) tmp.[1] tmp.[2] (nodes |> List.find(fun n -> n.Id = tmp.[2])).Color)

Run the code

System.FormatException
  HResult=0x80131537
  Message=Input string was not in a correct format.
  Source=System.Private.CoreLib
  StackTrace:
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
   at System.Number.ParseInt32(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)
   at System.Int32.Parse(String s, NumberStyles style, IFormatProvider provider)
   at Microsoft.FSharp.Core.LanguagePrimitives.ParseInt32(String s)

Inspecting the files, it looks like you need to skip the first row as you have a header there whereas the parsing code expects just data.

Expected behavior
Parse the pre-supplied edges and node

OS and framework information (please complete the following information):

  • OS: Windows 10
  • .Net core SDK version: 2.2.203

openjournals/joss-reviews#1445

Review: missing dependency on Newtonsoft.Json

Describe the bug
It looks like the NuGet has a missing dependency on Newtonsoft.Json

CreateJsonFailed
  "Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file specified."

I'm able to workaround this which I did by installing Newtonsoft.Json but you should express the dependency on the NuGet

OS and framework information (please complete the following information):

  • OS: Windows 10
  • .Net core SDK version: 2.2.203

openjournals/joss-reviews#1445

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.