appendRepo: appendRepo: Add extra population data

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Function that allows to add extra samples for running simulations. If the user wants to add custom data to an existing cBioportal dataset, this function allows to append new samples to the panel to increase its inference power. This function takes care of appending to the panel a list of alterations compatible with the @dataFull slot (the slot that stores the cBioportal downloaded info).

Usage

1
appendRepo(object, repos)

Arguments

object

An instance of class CancerPanel

repos

A list() in format compatible to @dataFull slot

Details

dataFull slot is a named list of 4 elements: "fusions" , "mutations" , "copynumber" , "expression". Each element is a list itself of two named elements: "data" (a data.frame), "Samples" (a list of character vectors). They must be all present, but they can be NULL if no data are provided. Check example to check correct format of colnames inside each data type.

At the end of the appending, subsetAlterations is automatically run.

Value

An updated instance of class CancerPanel

Author(s)

Giorgio Melloni , Alessandro Guida

References

data origin for mutations, copynumber and expression data

data origin for fusion data

See Also

getAlterations subsetAlterations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Retrieve example data
data(cpObj)
# Check format of slot dataFull
str(cpData(cpObj))
# Create two new mutations
newmutations <- data.frame(
    entrez_gene_id=c(7157 , 7157)
    ,gene_symbol=c("TP53" , "TP53")
    ,case_id=c("new_samp1" , "new_samp2")
    ,mutation_type=c("Nonsense_Mutation" , "Nonsense_Mutation")
    ,amino_acid_change=c("R306*" , "Y126*")
    ,genetic_profile_id=c("mynewbreaststudy" , "mynewbreaststudy")
    ,tumor_type=c("brca" , "brca")
    ,amino_position=c(306 , 126)
    ,genomic_position=c("17:7577022:G,A" , "17:7578552:G,C")
    ,stringsAsFactors=FALSE
    )
newsamples <- c("new_samp1" , "new_samp2")
# A dataFull slot style list should look like this
toBeAdded <- list(fusions=list(data=NULL , Samples=NULL)
                 , mutations=list(data=newmutations
                     , Samples=list(brca=newsamples))
                 , copynumber=list(data=NULL , Samples=NULL)
                 , expression=list(data=NULL , Samples=NULL)
                 )
cpObjplus <- appendRepo(cpObj , toBeAdded)

PrecisionTrialDrawer documentation built on Nov. 8, 2020, 8:17 p.m.