sif.js

1.0.1 • Public • Published

sif.js

A javascript library to parse simple interaction file (SIF) files. You can find more information about SIF files here.

Example

//Require SIF.js 
var SIFJS = require('../');

var interactions = SIFJS.parse('node1 xx node2\nnode1 xx node2\nnode1 yy node2');

SIF Format

The simple interaction format is convenient for building a graph from a list of interactions. It also makes it easy to combine different interaction sets into a larger network, or add new interactions to an existing data set. Lines in the SIF file specify a source node, a relationship type (or edge type), and one or more target nodes:

nodeA <relationship type> nodeB
nodeC <relationship type> nodeA
nodeD <relationship type> nodeE nodeF nodeB
nodeG
...
nodeY <relationship type> nodeZ

Duplicate entries are ignored. Multiple edges between the same nodes must have different edge types. For example, the following specifies two edges between the same pair of nodes, one of type xx and one of type yy:

node1 xx node2
node1 xx node2
node1 yy node2

Delimiters

Whitespace (space or tab) is used to delimit the names in the simple interaction file format. However, in some cases spaces are desired in a node name or edge type. The standard is that, if the file contains any tab characters, then tabs are used to delimit the fields and spaces are considered part of the name. If the file contains no tabs, then any spaces are delimiters that separate names (and names cannot contain spaces).

Readme

Keywords

Package Sidebar

Install

npm i sif.js

Weekly Downloads

0

Version

1.0.1

License

Apache 2.0

Last publish

Collaborators

  • secevalliv