filterSif {paxtoolsr} | R Documentation

## Keep interactions in SIF network based on certain criteria

### Description

Keep interactions in SIF network based on certain criteria

### Usage

    filterSif(sif, ids = NULL, interactionTypes = NULL, dataSources = NULL,
      interactionPubmedIds = NULL, pathwayNames = NULL, mediatorIds = NULL,
      edgelist = NULL, idsBothParticipants = FALSE,
      edgelistCheckReverse = TRUE, verbose = FALSE)

### Arguments

`sif` | a binary SIF as a data.frame with three columns: "PARTICIPANT_A", "INTERACTION_TYPE", "PARTICIPANT_B"
`ids` | a vector of IDs to be kept
`interactionTypes` | a vector of interaction types to be kept (List of interaction types: http://www.pathwaycommons.org/pc2/formats)
`dataSources` | a vector of data sources to be kept. For Extended SIF.
`interactionPubmedIds` | a vector of Pubmed IDs to be kept. For Extended SIF.
`pathwayNames` | a vector of pathway names to be kept. For Extended SIF.
`mediatorIds` | a vector of mediator IDs to be kept. For Extended SIF. Mediator IDs are the full BioPAX objects that were simplified to interaction given in the SIF. For Extended SIF.
`edgelist` | a two-column data.frame where each row is an interaction to be kept. Directionality is ignored (e.g. Edge A B will return interactions A B and B A from SIF)
`idsBothParticipants` | a boolean whether both interaction participants should be in a given interaction when using the ids parameter; TRUE if both (DEFAULT: TRUE)
`edgelistCheckReverse` | a boolean whether to check for edges in the reverse order (DEFAULT: TRUE)
`verbose` | Show debugging information (DEFAULT: FALSE)

### Value

filtered interactions with three columns: "PARTICIPANT_A", "INTERACTION_TYPE", "PARTICIPANT_B". The intersection of multiple filters is returned.

### Examples

    results <- readSif(system.file("extdata", "test_sif.txt", package="paxtoolsr"))
    intTypes <- c("controls-state-change-of", "controls-expression-of", "catalysis-precedes")
    filteredNetwork <- filterSif(results, intTypes)

    tmp <- readSifnx(system.file("extdata", "test_sifnx_250.txt", package = "paxtoolsr"))
    results <- filterSif(tmp$edges, ids=c("CHEBI:17640", "MCM3"))
    results <- filterSif(tmp$edges, dataSources=c("INOH", "KEGG"))
    results <- filterSif(tmp$edges, dataSources=c("IntAct"), ids=c("CHEBI:17640", "MCM3"))
    results <- filterSif(tmp$edges, pathwayNames=c("Metabolic pathways"))
    results <- filterSif(tmp$edges,
      mediatorIds=c("http://purl.org/pc2/8/MolecularInteraction_1452626895158"))
    results <- filterSif(tmp$edges, interactionPubmedId="17654400")

    tmp <- readSifnx(system.file("extdata", "test_sifnx_250.txt", package = "paxtoolsr"))
    edgelist <- read.table(system.file("extdata", "test_edgelist.txt", package = "paxtoolsr"),
      sep="\t", header=FALSE, stringsAsFactors=FALSE)
    results <- filterSif(tmp$edges, edgelist=edgelist)

[Package paxtoolsr version 1.18.0 Index]