readSIF: readSIF

Description Usage Arguments Details Value Examples

View source: R/lib_network.R

Description

This function reads a data table into R; the data table describes network interactions. It is named for the Simple Interaction Format (SIF), but can read any data table if the users identifies which columns contain the pertinent data (see below).

Usage

1
2
readSIF(file = NA, header = FALSE, sep = "\t", as.is = TRUE, p1 = 1,
  p2 = 2, et = 3, score = NA, ...)

Arguments

file

location of file

header

indicator of presense of header on file

sep

file delimiter - used by read.table()

as.is

logical (default TRUE)

p1

Column number for the 1st entity. Default = 1.

p2

Column number for the 2nd entity. Default = 2.

et

Column number for the edge type. Default = 3. Optionally, it may be a string label to be used as the edge type for all interactions from the input file.

score

Column number for edge scores or weights. Default = NA (no score read).

...

Other options to read.table().

Details

The SIF file format is a 3-column format, with an optional 4th column: <entity-1><tab><edge-type><tab><entity-2><tab><score>

Entities may be genes, proteins, metabolites, etc. The edge type typically conveys the type of relationship that exists between the two entities, such as physical interaciton, phosphorylation, or activation.

Value

Returns a data.frame with 3 (or 4) columns of data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Make a simple example to show the SIF file format
s <- matrix(c('gene1','gene2','PPI',
              'gene1','gene3','Chip-Seq',
              'gene4','gene5','PPI'), ncol=3, byrow=TRUE)
## Not run: 
# Read a SIF file
write.table( s, "myFile.sif", sep='\t', col.names=FALSE, row.names=FALSE )
sif <- readSIF("myFile.sif")

## End(Not run)

MTZimmer/RITAN documentation built on Feb. 21, 2020, 7:09 a.m.