append2List: append2List

Description Usage Arguments Value Examples

View source: R/functions.R

Description

Appends a data frame containing additional relationship information to an existing List having 6 columns: source, target, description, value, sourcefc, targetfc. Order matters! For example, add a map of transcripts to genes to a List of miRNAs and their target transcripts so that the final List connects miRNAs -> transcripts -> genes.

Usage

1
2
3
append2List(List, appendList, description = "description",
  sourcefc = "sourcefc", targetfc = "targetfc", value = "value",
  target = "target", source = "source", appendMatch = TRUE)

Arguments

List

Data frame containing the necessary columns above. e.g. Formatted with createList function.

appendList

Data frame or matrix to append to List.

description

Column name of appendList corresponding to the descriptions to append.

sourcefc

Column name of appendList corresponding to the sourcefcs to append.

targetfc

Column name of appendList correspondig to the targetfcs to append.

value

Column name of appendList correspondig to the relationship values to append.

target

Column name of appendList corresponding to the targets to append.

source

Column name of appendList corresponding to the sources to append.

appendMatch

Filter and remove 1) rows in List that contain targets without a corresponding source in appendList, and 2) rows in appendList that contain sources without a corresponding target in List.

Value

a combined List.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
tempList <- createList(data.frame(source=c("A","B","C"),
    target=c("D","E","G"),
    description=c("consonant","vowel","consonant"),
    value=runif(3,-1,1),
    sourcefc=runif(3,-2,2),
    targetfc=runif(3,-2,2)))
tempAppendList <- data.frame(source="D",target="I",
    description="vowel",value=runif(1,-1,1),
    sourcefc=runif(1,-2,2), targetfc=runif(1,-2,2))
append2List(tempList,tempAppendList) # Will combine only 1 row from each list.
append2List(tempList,tempAppendList, appendMatch=FALSE) # Will combine all rows

kzouchka/Director documentation built on Oct. 10, 2020, 5:29 p.m.