Found 47723 results in 5153 files, showing top 50 files (show more).
seq2pathway:R/seq2pathway.r: [ ]
928:    path <-paste(system.file(package="seq2pathway"),
856: get_python3_command_path <- function()
859:   python3_command_path <- Sys.which2("python")
1029:     script_path <- file.path(tempdir(), name)
275: pathwaygene<-length(intersect(toupper(gene_list[[i]]),
484: pathwaygene<-length(intersect(toupper(gsmap$genesets[[i]]),
843:   cmdpath <- Sys.which(cmdname)
1051: runseq2pathway<-function(inputfile,
1161: gene2pathway_result<-list()
1310: gene2pathway_test<-function(dat,DataBase="GOterm",FisherTest=TRUE,
1344: gene2pathway_result<-list()
854: #get_python3_command_path: funtion from Herve Pages, Bioconductor Maintainance Team, Oct 9 2020
858: #  python3_command_path <- Sys.which2("python3") #3/3/2021 by Holly
860:   if (python3_command_path != "")
864:           return(python3_command_path)}
873: #  python3_command_path <- Sys.which2("python")
874:   python3_command_path <- Sys.which2("python3")  #3/3/2021 by Holly
875:   if (python3_command_path != ""){
876:     print(paste0("python3 found: ",python3_command_path))
877:     return(python3_command_path)}
880:        "  'python3' (or 'python') executable is in your PATH.")
924:     ### assign the path of main function
932:     path <-paste(system.file(package="seq2pathway"),
976: 		sink(file.path(tempdir(),name,fsep = .Platform$file.sep))} 
994:     cat("'", path, "').load_module()",sep="")
1030:     if (!file.exists(script_path))
1032:     mypython <- get_python3_command_path()
1034:     response <- system2(mypython, args=script_path,
75: data(gencode_coding,package="seq2pathway.data")
155: data(gencode_coding,package="seq2pathway.data")
214: ####load GP pathway information
216:    data(GO_BP_list,package="seq2pathway.data")
217:    data(GO_MF_list,package="seq2pathway.data")
218:    data(GO_CC_list,package="seq2pathway.data") 
219:    data(Des_BP_list,package="seq2pathway.data")
220:    data(Des_MF_list,package="seq2pathway.data")
221:    data(Des_CC_list,package="seq2pathway.data")
223:          data(GO_BP_list,package="seq2pathway.data") 
224:          data(Des_BP_list,package="seq2pathway.data")
226:               data(GO_MF_list,package="seq2pathway.data") 
227:               data(Des_MF_list,package="seq2pathway.data")
229:                   data(GO_CC_list,package="seq2pathway.data")
230:                   data(Des_CC_list,package="seq2pathway.data")
237: data(GO_GENCODE_df_hg_v36,package="seq2pathway.data")
240: data(GO_GENCODE_df_hg_v19,package="seq2pathway.data")
243: data(GO_GENCODE_df_mm_vM25,package="seq2pathway.data")
246: data(GO_GENCODE_df_mm_vM1,package="seq2pathway.data")
280: c<-pathwaygene-a
289: mdat[i,7]<-pathwaygene
321: pathwaygene<-length(intersect(toupper(GO_BP_list[[i]]),
326: c<-pathwaygene-a
335: mdat[i,7]<-pathwaygene
367: pathwaygene<-length(intersect(toupper(GO_CC_list[[i]]),
372: c<-pathwaygene-a
381: mdat[i,7]<-pathwaygene
413: pathwaygene<-length(intersect(toupper(GO_MF_list[[i]]),
418: c<-pathwaygene-a
427: mdat[i,7]<-pathwaygene
455: data(Msig_GENCODE_df_hg_v36,package="seq2pathway.data")
458: data(Msig_GENCODE_df_hg_v19,package="seq2pathway.data")
461: data(Msig_GENCODE_df_mm_vM25,package="seq2pathway.data")
464: data(Msig_GENCODE_df_mm_vM1,package="seq2pathway.data")
489: c<-pathwaygene-a
498: mdat[i,7]<-pathwaygene
549: data(gencode_coding,package="seq2pathway.data")
647: rungene2pathway <-
704: colnames(res) <- c(paste(colnames(dat),"2pathscore",sep=""))
705: print("gene2pathway calculates score....... done")
711: rungene2pathway_EmpiricalP <-
770: colnames(res) <- c(paste(colnames(dat),"2pathscore",sep=""))
829: colnames(res_p) <- c(paste(colnames(dat),"2pathscore_Pvalue",sep=""))
832: print("pathwayscore Empirical Pvalue calculation..........done")
849:   success <- grepl(pattern1, cmdpath, fixed=TRUE) ||
850:     grepl(pattern2, cmdpath, fixed=TRUE)
851:   if (success) cmdpath else ""
1007:     #cat(paste("inputpath=","'",inputpath,"/'",sep=""),sep="\n")
1009:     #cat(paste("outputpath=","'",outputpath,"/'",sep=""),sep="\n")
1018:     cat(paste("pwd=","'",system.file(package="seq2pathway.data"),"/extdata/'",sep=""),sep="\n")
1103: data(GO_BP_list,package="seq2pathway.data")
1104: data(GO_MF_list,package="seq2pathway.data")
1105: data(GO_CC_list,package="seq2pathway.data")
1106: data(Des_BP_list,package="seq2pathway.data")
1107: data(Des_CC_list,package="seq2pathway.data")
1108: data(Des_MF_list,package="seq2pathway.data")
1134: #############################rungene2pathway,normalization,empiricalP,summary table
1166: GO_BP_FAIME<-rungene2pathway(dat=dat_CP,gsmap=GO_BP_list,alpha=alpha,logCheck=logCheck,
1171: GO_BP_FAIME_Pvalue<-rungene2pathway_EmpiricalP(dat=dat_CP,gsmap=GO_BP_list,
1174: ########gene2pathway table
1190: gene2pathway_result[[n.list]]<-GO_BP_N_P
1191: names(gene2pathway_result)[n.list]<-c("GO_BP")
1195: GO_MF_FAIME<-rungene2pathway(dat=dat_CP,gsmap=GO_MF_list,alpha=alpha,logCheck=logCheck,
1198: GO_MF_FAIME_Pvalue<-rungene2pathway_EmpiricalP(dat=dat_CP,gsmap=GO_MF_list,
1215: gene2pathway_result[[n.list]]<-GO_MF_N_P
1216: names(gene2pathway_result)[n.list]<-c("GO_MF")
1220: GO_CC_FAIME<-rungene2pathway(dat=dat_CP,gsmap=GO_CC_list,alpha=alpha,logCheck=logCheck,
1223: GO_CC_FAIME_Pvalue<-rungene2pathway_EmpiricalP(dat=dat_CP,gsmap=GO_CC_list,
1241: gene2pathway_result[[n.list]]<-GO_CC_N_P
1242: names(gene2pathway_result)[n.list]<-c("GO_CC")
1245: dat_FAIME<-rungene2pathway(dat=dat_CP,gsmap=DataBase,alpha=alpha,logCheck=logCheck,
1248: dat_FAIME_Pvalue<-rungene2pathway_EmpiricalP(dat=dat_CP,gsmap=DataBase,
1255: colnames(DB_N_P)<-c("score2pathscore_Normalized","score2pathscore_Pvalue")
1274: gene2pathway_result<-DB_N_P[,c(ncol(DB_N_P),1:(ncol(DB_N_P)-1))]
1276: print("gene2pathway analysis is done")
1279: if(exists("gene2pathway_result")&exists("FS_test")){
1283: TotalResult[[2]]<-gene2pathway_result
1284: names(TotalResult)[2]<-"gene2pathway_result.FAIME"
1286: names(TotalResult)[3]<-"gene2pathway_result.FET"
1289: }else if(exists("gene2pathway_result")&exists("FS_test")==FALSE){
1293: TotalResult[[2]]<-gene2pathway_result
1294: names(TotalResult)[2]<-"gene2pathway_result.FAIME"
1298: else if(exists("gene2pathway_result")==FALSE&exists("FS_test")){
1303: names(TotalResult)[2]<-"gene2pathway_result.FET"
1326: data(GO_BP_list,package="seq2pathway.data")
1327: data(GO_MF_list,package="seq2pathway.data")
1328: data(GO_CC_list,package="seq2pathway.data")
1329: data(Des_BP_list,package="seq2pathway.data")
1330: data(Des_CC_list,package="seq2pathway.data")
1331: data(Des_MF_list,package="seq2pathway.data")
1346: #############################rungene2pathway,normalization,empiricalP,summary table
1348: gene2pathway_result<-list()
1352:   GO_BP_method<-rungene2pathway(dat=dat,gsmap=GO_BP_list,alpha=alpha,logCheck=logCheck,
1358:     GO_BP_method_Pvalue<-rungene2pathway_EmpiricalP(dat=dat,gsmap=GO_BP_list,alpha=alpha,
1364:   ########gene2pathway table
1376:   gene2pathway_result[[n.list]]<-GO_BP_N_P
1377:   names(gene2pathway_result)[n.list]<-c("GO_BP")
1380:     GO_MF_method<-rungene2pathway(dat=dat,gsmap=GO_MF_list,alpha=alpha,logCheck=logCheck,
1384:       GO_MF_method_Pvalue<-rungene2pathway_EmpiricalP(dat=dat,gsmap=GO_MF_list,alpha=alpha,
1402:   gene2pathway_result[[n.list]]<-GO_MF_N_P
1403:   names(gene2pathway_result)[n.list]<-c("GO_MF")
1406:    GO_CC_method<-rungene2pathway(dat=dat,gsmap=GO_CC_list,alpha=alpha,logCheck=logCheck,
1410:       GO_CC_method_Pvalue<-rungene2pathway_EmpiricalP(dat=dat,gsmap=GO_CC_list,alpha=alpha,
1427:   gene2pathway_result[[n.list]]<-GO_CC_N_P
1428:   names(gene2pathway_result)[n.list]<-c("GO_CC")
1431: dat_method<-rungene2pathway(dat=dat,gsmap=DataBase,alpha=alpha,logCheck=logCheck,
1435: dat_method_Pvalue<-rungene2pathway_EmpiricalP(dat=dat,gsmap=DataBase,alpha=alpha,
1443: colnames(DB_N_P)<-c("score2pathscore_Normalized","score2pathscore_Pvalue")
1464: gene2pathway_result<-DB_N_P[,c(ncol(DB_N_P),1:(ncol(DB_N_P)-1))]
1466: print("gene2pathway analysis is done")
1470: if(exists("gene2pathway_result")&exists("FS_test")){
1472: TResult[[1]]<-gene2pathway_result
1473: names(TResult)[1]<-"gene2pathway_result.2"
1475: names(TResult)[2]<-"gene2pathway_result.FET"
1476: }else if(exists("gene2pathway_result")&exists("FS_test")==FALSE){
1477: TResult<-gene2pathway_result
1479: else if(exists("gene2pathway_result")==FALSE&exists("FS_test")){
biodbKegg:R/KeggPathwayConn.R: [ ]
61:         path <- self$getEntry(path.id)
59:     for (path.id in id) {
127:     for (path.id in id) {
304:     path_idx <- sub('^[^0-9]+', '', id)
322:     path_idx <- sub('^[^0-9]+', '', id)
29: KeggPathwayConn <- R6::R6Class("KeggPathwayConn",
40:     super$initialize(db.name='pathway', db.abbrev='path', ...)
62:         if ( ! is.null(path) && path$hasField('kegg.module.id')) {
65:             for (mod.id in path$getFieldValue('kegg.module.id')) {
144:             graph[[path.id]]=list(vertices=vert, edges=edg)
147:             graph[[path.id]]=NULL
309:         params=c(org_name='map', mapno=path_idx,
325:     img_filename <- paste0('pathwaymap-', path_idx)
331:             biodb::error0('Impossible to find pathway image path inside',
335:         tmp_file <- file.path(cache$getTmpFolderPath(),
2: #' The connector class to KEGG Pathway database.
16: #' conn=mybiodb$getFactory()$createConn('kegg.pathway')
18: #' # Retrieve all reactions related to a mouse pathway:
21: #' # Get a pathway graph
44: #' Retrieves all reactions part of a KEGG pathway. Connects to
45: #'     KEGG databases, and walk through all pathways submitted, and
58:     # Loop on all Pathway IDs
89: #' Takes a list of pathways IDs and converts them to the specified organism,
92: #' @param org The organism in which to search for pathways, as a KEGG organism
113: #' Builds a pathway graph in the form of two tables of vertices and edges,
115: #' @param id A character vector of KEGG pathway entry IDs.
120: #' @return A named list whose names are the pathway IDs, and values are lists
126:     # Loop on all pathway IDs
158: #' Builds a pathway graph, as an igraph object, using KEGG database.
159: #' @param id A character vector of KEGG pathway entry IDs.
196: #' Create a pathway graph picture, with some of its elements colorized.
197: #' @param id A KEGG pathway ID.
227: #' Extracts shapes from a pathway map image.
228: #' @param id A KEGG pathway ID.
303:     # Extract pathway number
308:         'show_pathway'),
329:             'src="([^"]+)"(\\s+.*)?\\s+(name|id)="pathwayimage"')
332:                 ' HTML page for pathway ID ', id, '.')
342:     img_file <- cache$getFilePath(cid, img_filename, 'png')
22: #' graph=conn$buildPathwayGraph('mmu00260')
98: convertToOrgPathways=function(id, org) {
122: buildPathwayGraph=function(id, directed=FALSE, drop=TRUE) {
166: getPathwayIgraph=function(id, directed=FALSE, drop=TRUE) {
173:         g <- self$buildPathwayGraph(id=id, directed=directed, drop=FALSE)
210:         pix <- private$getPathwayImage(id)
213:         shapes <- self$extractPathwayMapShapes(id=id, color2ids=color2ids)
233: ,extractPathwayMapShapes=function(id, color2ids) {
237:     html <- private$getPathwayHtml(id)
301: ,getPathwayHtml=function(id) {
319: getPathwayImage=function(id) {
321:     html <- private$getPathwayHtml(id)
NoRCE:R/pathway.R: [ ]
351:   path <- merge(merge1, symb, by = "gene")
65:     pathTable <- unique(keggPathwayDB(org_assembly))
71:     pathfreq <- as.data.frame(table(annot$pathway))
99:     pathT <- as.character(freq$Var1[enrich])
118:     pathways <- data.frame(unique(pathT))
203:     pathTable <- unique(reactomePathwayDB(org_assembly))
209:     pathfreq <- as.data.frame(table(annot$pathway))
235:     pathT <- as.character(freq$Var1[enrich])
540:   pathTable <- unique(WikiPathwayDB(org_assembly))
545:   pathfreq <- as.data.frame(table(annot$pathID))
571:   pathT <- as.character(freq$Var1[enrich])
578:   pathTerms <- as.character(r$pathTerm[match(pathT, r$pathID)])
628: pathwayEnrichment <- function(genes,
678:   pathfreq <- as.data.frame(table(annot$pathTerm))
710:   pathT <- as.character(freq$Var1[enrich])
718:   pathTerms <- as.character(r$pathTerm[match(pathT, r$pathID)])
270: reactomePathwayDB <- function(org_assembly = c("hg19",
357: keggPathwayDB <- function(org_assembly = c("hg19",
433: WikiPathwayDB <- function(org_assembly = c("hg19",
15: #' @param gmtFile File path of the gmt file
91:         file.path(x[1], x[2]))
95:         file.path(x[1], x[2]))
155: #' @param gmtFile File path of the gmt file
228:       file.path(x[1], x[2]))
231:       file.path(x[1], x[2]))
353:   return(path)
499: #' @param gmtFile File path of the gmt file
563:       file.path(x[1], x[2]))
567:       file.path(x[1], x[2]))
608: #' @param gmtFile File path of the gmt file
703:     file.path(x[1], x[2]))
706:     file.path(x[1], x[2]))
1: #' KEGG pathway enrichment
22: #' @return KEGG pathway enrichment results
68:     annot <- pathTable[which(pathTable$symbol %in% genes$g),]
72:     pathfreq <- pathfreq[which(pathfreq$Freq > 0),]
75:     geneSize = length(unique(pathTable$symbol))
77:     bckfreq <- as.data.frame(table(pathTable$pathway))
78:     notGene <- bckfreq[bckfreq$Var1 %in% pathfreq$Var1,]
79:     freq <- merge(pathfreq, notGene, by = "Var1")
104:     r <- annot[annot$pathway %in% pathT,]
106:     for (i in seq_along(pathT))
108:       if (length(which(pathT[i] == r$pathway)) > 0)
113:               as.character(r[which(pathT[i] == r$pathway),]$symbol)),
114:                      paste(pathT[i])))
119:     tmp <- character(length(pathT))
120:     if (nrow(pathways) > 0) {
122:         unlist(lapply(seq_len(nrow(pathways)), function(x)
123:           tmp[x] <- try(KEGGREST::keggGet(pathT[x])[[1]]$NAME)
129:         ID = pathT,
141: #' Reactome pathway enrichment
163: #' @return Reactome pathway enrichment results
206:     annot <- pathTable[which(pathTable$symbol %in% genes$g),]
210:     pathfreq <- pathfreq[which(pathfreq$Freq > 0),]
212:     geneSize = length(unique(pathTable$symbol))
214:     bckfreq <- as.data.frame(table(pathTable$pathway))
215:     notGene <- bckfreq[bckfreq$Var1 %in% pathfreq$Var1,]
216:     freq <- merge(pathfreq, notGene, by = "Var1")
240:     r <- annot[annot$pathway %in% pathT,]
244:     for (i in seq_along(pathT))
246:       if (length(which(pathT[i] == r$pathway)) > 0)
251:               list(as.character(r[which(pathT[i] == r$pathway),]$symbol)),
252:                      paste(pathT[i])))
258:         ID = pathT,
259:         Term = as.character(rt[order(match(rt$pathway, pathT)), ]$name),
279:   table1 <- data.frame(pathway = rep(names(xx), lapply(xx, length)),
282:   pn <- data.frame(pathway = rep(names(pn), lapply(pn, length)),
288:     ty <- table1[grepl("^R-HSA", table1$pathway),]
289:     pn1 <- pn[grepl("^R-HSA", pn$pathway),]
296:     ty <- table1[grepl("^R-MMU", table1$pathway),]
297:     pn1 <- pn[grepl("^R-MMU", pn$pathway),]
304:     ty <- table1[grepl("^R-DRE", table1$pathway),]
305:     pn1 <- pn[grepl("^R-DRE", pn$pathway),]
312:     ty <- table1[grepl("^R-RNO", table1$pathway),]
313:     pn1 <- pn[grepl("^R-RNO", pn$pathway),]
320:     ty <- table1[grepl("^R-CEL", table1$pathway),]
321:     pn1 <- pn[grepl("^R-CEL", pn$pathway),]
328:     ty <- table1[grepl("^R-SCE", table1$pathway),]
329:     pn1 <- pn[grepl("^R-SCE", pn$pathway),]
342:     ty <- table1[grepl("^R-DME", table1$pathway),]
343:     pn1 <- pn[grepl("^R-DME", pn$pathway),]
349:                   by = "pathway",
369:     kegg <- org.Hs.eg.db::org.Hs.egPATH2EG
377:     kegg <- org.Mm.eg.db::org.Mm.egPATH2EG
385:     kegg <- org.Dr.eg.db::org.Dr.egPATH2EG
393:     kegg <- org.Rn.eg.db::org.Rn.egPATH2EG
401:     kegg <- org.Ce.eg.db::org.Ce.egPATH2EG
409:     kegg <- org.Sc.sgd.db::org.Sc.sgdPATH2ORF
417:     kegg <- org.Dm.eg.db::org.Dm.egPATH2EG
423:   pathTable <-
424:     data.frame(pathway = paste0(prefix, rep(names(kegg2),
429:   pathTable <- merge(pathTable, x, by = "gene")
430:   return(pathTable)
472:     do.call(rbind, strsplit(as.character(gmtFile$pathTerm), '%'))
478:         pathID = tmp[, 3],
479:         pathTerm = tmp[, 1]
506: #' @return Wiki Pathway Enrichment
543:   annot <- pathTable[which(pathTable$gene %in% genes$g),]
546:   pathfreq <- pathfreq[which(pathfreq$Freq > 0),]
548:   geneSize = length(unique(pathTable$gene))
549:   bckfreq <- as.data.frame(table(pathTable$pathID))
550:   notGene <- bckfreq[bckfreq$Var1 %in% pathfreq$Var1,]
551:   freq <- merge(pathfreq, notGene, by = "Var1")
576:   r <- annot[annot$pathID %in% pathT,]
579:   for (i in seq_along(pathT))
581:     if (length(which(pathT[i] == r$pathID)) > 0)
585:           list(as.character(r[which(pathT[i] == r$pathID),]$gene)),
586:                           paste(pathT[i])))
593:       ID = pathT,
594:       Term = pathTerms,
604: #' For a given gmt file of a specific pathway database, pathway enrichment
626: #' @return Pathway Enrichment
670:     pathTable <-
675:     pathTable <- geneListEnrich(f = gmtFile, isSymbol = isSymbol)
677:   annot <- pathTable[which(pathTable$symbol %in% genes$g),]
679:   pathfreq <- pathfreq[which(pathfreq$Freq > 0),]
683:     geneSize = length(unique(pathTable$symbol))
688:   bckfreq <- as.data.frame(table(pathTable$pathTerm))
690:   notGene <- bckfreq[bckfreq$Var1 %in% pathfreq$Var1,]
691:   freq <- merge(pathfreq, notGene, by = "Var1")
716:   r <- annot[annot$pathTerm %in% pathT,]
720:   for (i in seq_along(pathT))
722:     if (length(which(pathT[i] == r$pathTerm)) > 0)
725:           list(as.character(r[which(pathT[i] == r$pathTerm),]$symbol)),
726:                           paste(pathT[i])))
731:       ID = pathT,
732:       Term = pathTerms,
742: #' Convert gmt formatted pathway file to the Pathway ID, Entrez, symbol
745: #' @param gmtName Custom pathway gmt file
814:     colnames(f) <- c('pathTerm', 'Entrez', 'symbol')
829:     colnames(f) <- c('pathTerm', 'symbol', 'Entrez')
851:     colnames(f) <- c('pathTerm', 'Entrez', 'symbol')
862:     colnames(f) <- c('pathTerm', 'symbol', 'Entrez')
278:   xx <- as.list(reactome.db::reactomePATHID2EXTID)
281:   pn <- as.list(reactome.db::reactomePATHID2NAME)
443:       rWikiPathways::downloadPathwayArchive(organism = "Homo sapiens",
447:       rWikiPathways::downloadPathwayArchive(organism = "Mus musculus",
451:       rWikiPathways::downloadPathwayArchive(organism = "Danio rerio",
455:       rWikiPathways::downloadPathwayArchive(organism = "Rattus norvegicus",
459:       rWikiPathways::downloadPathwayArchive(
463:       rWikiPathways::downloadPathwayArchive(
467:       rWikiPathways::downloadPathwayArchive(
485: #' WikiPathways Enrichment
CHRONOS:R/pathwayToGraph.R: [ ]
101:         path <- paste(dir, file, sep='//')
34:         paths <- list.files(xmlDir) 
83: pathwayToGraph <- function (i, ...)
3: createPathwayGraphs <- function(org, pathways, edgeTypes, doubleEdges, choice,
141: getPathwayType                    <- function(filepath, file)
159: metabolicPathwayToGraph           <- function(filepath)
347: nonMetabolicPathwayToGraph <- function(filepath, doubleEdges, groupMode)
102:         gr   <- metabolicPathwayToGraph(path)
119:         path <- paste(dir, file, sep='//')
120:         gr   <- nonMetabolicPathwayToGraph(path, doubleEdges, groupMode)
225: removeCompoundsMetabolicGraph     <- function(path)
228:     if(path$name != gsub('ec','',path$name)) { nodeType<-"enzyme" }
229:     enzymes  <- which(path$vertices$type == nodeType)
230:     vid      <- path$vertices$id
233:     if ( length(path$edges) > 0 )
243:             for (r1 in path$edges[path$edges$e1 == 
244:                                 path$vertices[,'id'][enzymes[j]],]$e2)  
247:                 for (r2 in path$edges[path$edges$e1 == 
248:                                 path$vertices[,'id'][which(vid == r1)],]$e2)
252:                     nid <- vid[which(path$vertices$id == r2)]
267:     xid    <- path$vertices$id[enzymes]
268:     names  <- path$vertices$names[enzymes]       
513: removeCompoundsNonMetabolicGraph <- function(path, unique, edgeTypes)
515:     if (is.null(path)) return(NULL)
516:     vid      <- as.numeric(path$vertices$id)
517:     etype    <- path$vertices$type
519:     if(path$name != gsub('ko','',path$name)) { nodeType <- "ortholog" }
522:     genesIndx <- which(path$vertices$type == nodeType)
528:         neighbors <- path$edges$e2[path$edges$e1 == vid[gi]]
546:                 idx1 <- which( path$edges$e1 == vid[gi] )
547:                 idx2 <- which( path$edges$e2 == vid[nbrId] )
549:                 TT   <- c( TT, paste((path$edges$type[idx]), collapse='_') )
557:                 cpdNeighbors <- path$edges$e2[ 
558:                                         which(path$edges$e1 == vid[nbrId]) ]
586:         names            <- unique(path$vertices$names[genesIndx])
598:             idx1 <- which(path$vertices$id == source[i])
599:             idx2 <- which(path$vertices$id == destin[i])
600:             source[i] <- names[ names == path$vertices$names[idx1] ]
601:             destin[i] <- names[ names == path$vertices$names[idx2] ]
623:         gids                <- path$vertices$id[genesIndx]
624:         names               <- unname(path$vertices$names[genesIndx])
31:     # Choose valid pathways
32:     if (missing(pathways))  
37:     if (!missing(pathways)) 
39:         paths <- paste(org, pathways, '.xml', sep='') 
44:     # Create compact adjacency matrices for given pathways.
45:     types  <- getPathwayType(paste(xmlDir, paths, sep='//'))
46:     N <- length(paths)
56:                     funcName=pathwayToGraph,
59:                     N=length(paths),
61:                     xmlDir, paths, types, FALSE, edgeTypes, 
64:     names(cAdjMats) <- gsub('.xml', '', paths)
67:     eAdjMats <- .doSafeParallel(funcName=pathwayToGraph,
70:                                 N=length(paths),
72:                                 xmlDir, paths, types, TRUE, edgeTypes, 
75:     names(eAdjMats) <- gsub('.xml', '', paths)
143:     types <- vector(mode='numeric', length=length(filepath))
144:     for (i in 1:length(filepath))
146:         num <- tail(unlist(strsplit(filepath[i], '//')), 1)
156: # Graph from Metabolic Pathways
161:     xmlDoc <- tryCatch(xmlTreeParse(filepath,error=NULL),
344: # Graph from Mon Metabolic Pathways
350:     xmlDoc         <- tryCatch(xmlTreeParse(filepath,error=NULL),
49:         'nonMetabolicPathwayToGraph', 'expandMetabolicGraph', 
51:         'metabolicPathwayToGraph', 'expandNonMetabolicGraph',
609:                 # Set new interaction types to apathetic
732:     # apathetic  3
KnowSeq:R/DEGsToPathways.R: [ ]
43:         path <- path.index[path.index != ""]
41:         path.index <- substr(get_pathway_text,start,final)
26:       pathway_start <- str_locate_all(pattern = "PATHWAY", get_GO_text)[[1]][2]
27:       pathway_end <- str_locate_all(pattern = "BRITE", get_GO_text)[[1]][1]
28:       pathways <- substr(get_GO_text,pathway_start+1,pathway_end-1)
34:         pathway <- as.character(unlist(str_extract_all(unlist(pathways)[i],"hsa[a-zA-Z0-9]{5}")))
36:         get_pathway <- GET(paste("http://rest.kegg.jp/get/map",substr(pathway,4,nchar(pathway)),sep = ""))
37:         get_pathway_text <- content(get_pathway, "text")
71:   repeated.pathways <- names(which(table(KEGG.data$KEGG_hsa) > 1))
10: DEGsToPathways <- function(geneList){
42:         path.index <- strsplit(path.index,split = " ")[[1]]
44:         path <- path[2]
59:         KEGG.data <- rbind(KEGG.data,c(as.character(path),as.character(name), as.character(description),as.character(class),as.character(gene.name)))
66:   names(KEGG.data) <- c("KEGG_Path","Name","Description","Class","Genes")
1: #' The function uses the DEGs to retrieves the different pathways in which those DEGs involve any interaction.
3: #' The function uses the DEGs to retrieves the different pathways in which those DEGs involve any interaction.
4: #' @param geneList A list which contains the DEGs that will be used to retrieve the related pathways to them.
5: #' @return A list with the pathways that contain relation to the DEGs within the geneList parameter.
18:   cat("Retrieving information about KEGG pathways...\n")
29:       pathways <- strsplit(pathways,split = "\n")
31:       index <- grep("hsa", unlist(pathways))
35:         if (length(pathway) == 0) break
39:         start <- str_locate_all(pattern = "ENTRY", get_pathway_text)[[1]][2]
40:         final <- str_locate_all(pattern = "Pathway", get_pathway_text)[[1]][2]
46:         start <- str_locate_all(pattern = "\nNAME ", get_pathway_text)[[1]][2]
47:         final <- str_locate_all(pattern = "\nDESCRIPTION", get_pathway_text)[[1]][2]
48:         name <- substr(get_pathway_text,start + 8,final - 12)
50:         start <- str_locate_all(pattern = "\nDESCRIPTION ", get_pathway_text)[[1]][2]
51:         final <- str_locate_all(pattern = "\nCLASS", get_pathway_text)[[1]][2]
52:         description <- substr(get_pathway_text,start + 1,final - 6)
55:         start <- str_locate_all(pattern = "\nCLASS ", get_pathway_text)[[1]][2]
56:         final <- str_locate_all(pattern = "\nPATHWAY_MAP", get_pathway_text)[[1]][2]
57:         class <- substr(get_pathway_text,start + 7,final - 12)
69:   # Collapse repeated pathways
72:   for (pathway in repeated.pathways){
73:     index <- which(KEGG.data$KEGG_hsa == pathway,)
85:   #cat("Retrieving information about Reactome pathways...\n")
7: #' DEGsToPathways(c("BRCA1","MLANA"))
Rhdf5lib:R/zzz.R: [ ]
21:   path <- Sys.getenv(
31:   patharch <- paste0(path, arch)
36:     ## so we use the 8+3 form of the path and replace slashes
22:     x = "RHDF5LIB_RPATH",
37:     patharch <- gsub(x = utils::shortPathName(patharch),
49:                                       patharch, winlibs)
52:                                       patharch, patharch, .getDynamicLinks())
60:                                       patharch, winlibs)
63:                                       patharch, patharch, patharch, .getDynamicLinks())
71:                                       patharch, winlibs)
74:                                       patharch, patharch, patharch, .getDynamicLinks())
82:                                       patharch, winlibs)
85:                                       patharch, patharch, patharch, patharch, patharch, .getDynamicLinks())
18: #' @rawNamespace if(tools:::.OStype() == "windows") { importFrom(utils, shortPathName) }
peakPantheR:R/methods_peakPantheRAnnotation.R: [ ]
1724:             device = "png", path = saveFolder, dpi = 100, width = 21,
1853:     path_cpdMeta <- paste(saveFolder, "/", annotationName,
1871:     path_specMeta <- paste(saveFolder, "/", annotationName,
1883:         path_var <- paste(saveFolder, "/", annotationName, "_", i, ".csv",
1918:     path_summary <- paste(saveFolder, "/", annotationName, "_summary.csv",
1116:     .filepath <- x@filepath[i]
1863:     tmp_filepath <- filepath(object)
2045:     .spectraPaths <- resSpectra$spectraPaths
2182: resetAnnot_spectraPathMetadata <- function(previousAnnotation, spectraPaths,
2186:         .spectraPaths <- filepath(previousAnnotation)
1076:     return(tools::file_path_sans_ext(basename(object@filepath)))
1386: #' @param saveFolder (str) Path of folder where annotationParameters_summary.csv
1399: #' spectraPaths <- c('./path/file1', './path/file2', './path/file3')
1610: #' @param saveFolder (str) Path of folder where annotationParameters_summary.csv
1703:     # @param saveFolder (str) Path where plots will be saved
1727:         # output path
1758: #' @param saveFolder (str) Path of folder where the annotation result csv will
1855:     utils::write.csv(tmp_outCpdMeta, file = path_cpdMeta, row.names = FALSE,
1858:     if (verbose) { message("Compound metadata saved at ", path_cpdMeta) }
1873:     utils::write.csv(tmp_outSpecMeta, file = path_specMeta, row.names = FALSE,
1876:     if (verbose) { message("Spectra metadata saved at ", path_specMeta) }
1885:         utils::write.csv(tmp_var, file = path_var, row.names = TRUE,
1889:             message("Peak measurement \"", i, "\" saved at ", path_var)
1920:     utils::write.csv(tmp_summary, file = path_summary, row.names = TRUE,
1923:     if (verbose) { message("Summary saved at ", path_summary) }
24:             length(object@filepath), " samples. \n", sep = "")
53: # @filepath length. Slot type is not checked as \code{setClass} enforces it.
78: #' # Paths to spectra files
119: #' # Paths to spectra files
160: #' # Paths to spectra files
206: #' # Paths to spectra files
253: #' # Paths to spectra files
286: # filepath
287: setGeneric("filepath", function(object, ...) standardGeneric("filepath"))
288: #' filepath accessor
290: #' @return (str) A character vector of file paths, of length number of spectra
293: #' @aliases filepath
300: #' # Paths to spectra files
319: #' filepath(annotation)
324: setMethod("filepath", "peakPantheRAnnotation", function(object) {
325:     object@filepath
343: #' # Paths to spectra files
386: #' # Paths to spectra files
430: #' # Paths to spectra files
472: #' # Paths to spectra files
512: #' # Paths to spectra files
552: #' # Paths to spectra files
593: #' # Paths to spectra files
636: #' # Paths to spectra files
695: #' # Paths to spectra files
742: #' # Paths to spectra files
788: #' # Paths to spectra files
817: #' nbSamples accessor established on filepath
828: #' # Paths to spectra files
852:     return(length(object@filepath))
868: #' # Paths to spectra files
913: #' # Paths to spectra files
946:     nbSample <- length(object@filepath)
953:         rownames(tmpAnnotation) <- object@filepath
961:         rownames(tmpAnnotation) <- object@filepath
977:     rownames(tmpAnnotation) <- object@filepath
1000: #' # Paths to spectra files
1041: #' filename accessor by spliting filepath
1052: #' # Paths to spectra files
1134:         FIR = .FIR, uROI = .uROI, filepath = .filepath,
1214: #' # Paths to spectra files
1398: #' # Paths to spectra files
1416: #' savePath        <- tempdir()
1419: #' outputAnnotationParamsCSV(emptyAnnotation, saveFolder=savePath, verbose=TRUE)
1488: #' # Paths to spectra files
1627: #' # Paths to spectra files
1652: #' savePath1       <- tempdir()
1653: #' outputAnnotationDiagnostic(annotation, saveFolder=savePath1, savePlots=FALSE,
1771: #' # Paths to spectra files
1796: #' savePath1       <- tempdir()
1797: #' outputAnnotationResult(annotation, saveFolder=savePath1,
1867:     tmp_outSpecMeta <- data.frame(filepath = tmp_filepath,
1941: #' the slots (\code{filepath} (from \code{spectraPaths}), \code{ROI},
1947: #' @param spectraPaths NULL or a character vector of spectra file paths, to set
1972: #' (\code{cpdID}, \code{cpdName}, \code{ROI}, \code{filepath}, \code{TIC},
1984: #' # Paths to spectra files
2188:             message("  Previous \"filepath\" value kept")
2415: #' # Paths to spectra files
80: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
95: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
121: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
136: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
162: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
177: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
208: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
223: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
255: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
270: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
302: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
317: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
345: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
360: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
388: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
403: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
432: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
447: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
474: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
489: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
514: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
529: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
554: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
569: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
595: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
610: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
638: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
653: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
697: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
712: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
744: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
759: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
790: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
805: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
830: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
845: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
870: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
885: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
915: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
930: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1002: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1017: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1054: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1069: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1216: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1231: #' emptyAnnotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1412: #' emptyAnnotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1490: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1505: #' emptyAnnotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1629: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1644: #' emptyAnnotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1773: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1788: #' emptyAnnotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1931:     function(previousAnnotation, spectraPaths = NULL, targetFeatTable = NULL,
1939: #' \code{spectraPaths}) or compounds (\code{targetFeatTable}) are passed, the
1986: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
2000: #' smallAnnotation  <- peakPantheRAnnotation(spectraPaths=spectraPaths, 
2011: #' newSpectraPaths  <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
2015: #'                                     spectraPaths=newSpectraPaths,
2026:     function(previousAnnotation, spectraPaths, targetFeatTable, uROI, FIR,
2042:     # spectraPaths, spectraMetadata
2043:     resSpectra <- resetAnnot_spectraPathMetadata(previousAnnotation,
2044:                                         spectraPaths, spectraMetadata, verbose)
2061:     # Create new object In all case (old or new value) spectraPaths and
2063:     peakPantheRAnnotation(spectraPaths = .spectraPaths,
2181: # resetAnnotation spectraPaths, spectraMetadata
2185:     if (all(is.null(spectraPaths))) {
2208:         .spectraPaths <- spectraPaths
2210:             message("  New \"spectraPaths\" value set")
2229:     return(list(spectraPaths = .spectraPaths,
2417: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
2431: #' smallAnnotation  <- peakPantheRAnnotation(spectraPaths=spectraPaths,
ggtree:R/tree-utilities.R: [ ]
720:     path <- c(anc_from[1:i], rev(anc_to[1:(j-1)]))
726:     path <- get.path(phylo, from, to)
694:     path_length <- sapply(1:(root-1), function(x) get.path_length(tr, root, x))
710: get.path <- function(phylo, from, to) {
978:     pathLength <- sapply(1:length(tr$tip.label), function(i) {
725: get.path_length <- function(phylo, from, to, weight=NULL) {
695:     i <- which.max(path_length)
696:     return(get.path(tr, root, i))
699: ##' path from start node to end node
702: ##' @title get.path
721:     return(path)
728:         return(length(path)-1)
743:     for(i in 1:(length(path)-1)) {
744:         ee <- get_edge_index(df, path[i], path[i+1])
979:         get.path_length(tr, i, root, yscale)
982:     ordered_tip <- order(pathLength, decreasing = TRUE)
SeqArray:R/Internal.R: [ ]
664:     path <- name.gdsn(node, TRUE)
175: .var_path <- function(var.name, prefix)
173: # Variable path
667:         varname <- .var_path(substring(varname, 2L), "@")
668:     fullvarname <- paste(path, varname, sep="/")
676:         if (path == "genotype")
679:             varname2 <- path
693:             if (path == "genotype")
ORFik:R/experiment.R: [ ]
286:   for (path in filepaths) {
39:       cbu.path <- "/export/valenfs/data/processed_data/experiment_tables_for_R/"
230:     cbu.path <- "/export/valenfs/data/processed_data/experiment_tables_for_R/"
913:     cbu.path <- "/export/valenfs/data/processed_data/experiment_tables_for_R/"
277: findFromPath <- function(filepaths, candidates, slot = "auto") {
501: filepath <- function(df, type, basename = FALSE) {
505:   paths <- lapply(df$filepath, function(x, df, type) {
642:       paths <- filepath(df, type)
358:     reversePaths <- df$reverse[!(df$reverse %in% c("", "paired-end"))]
7: #' @param file relative path to a ORFik experiment. That is a .csv file following
10: #' also be full path to file, then in.dir argument is ignored.
13: #' it to disc. Does not apply if file is not a path, but a data.frame. Also
14: #' does not apply if file was given as full path.
28: #' # save.experiment(df, file = "path/to/save/experiment")
30: #' # read.experiment("path/to/save/experiment")
32: #' # read.experiment("experiment", in.dir = "path/to/save/")
40:       if (file.exists(pasteDir(cbu.path, basename(file))))
41:         file <- pasteDir(cbu.path, basename(file))
103: #' @param txdb A path to TxDb (prefered) or gff/gtf (not adviced, slower)
105: #' @param fa A path to fasta genome/sequences used for libraries, remember the
169: #' # Save with: save.experiment(df, file = "path/to/save/experiment.csv")
231:     if (dir.exists(cbu.path)) { # This will only trigger on CBU server @ UIB
233:       message(cbu.path)
234:       saveDir <- cbu.path
253: #' #save.experiment(df, file = "path/to/save/experiment.csv")
255: #' #save.experiment(df, file = "path/to/save/experiment")
270: #' @param filepaths path to all files
287:     hit <- names(unlist(sapply(candidates, grep, x = path)))
290:     hitRel <- names(unlist(sapply(candidates, grep, x = gsub(".*/", "", path))))
831:       fext[compressed] <-file_ext(file_path_sans_ext(files[compressed],
903: #' ## Path above is default path, so no dir argument needed
907: #' #list.experiments(dir = "MY/CUSTOM/PATH)
911:   experiments <- list.files(path = dir, pattern = "\\.csv")
914:     if (dir.exists(cbu.path)) { # If on UIB SERVER
915:       dir <- cbu.path
916:       experiments <- list.files(path = dir, pattern = "\\.csv")
22: #' df <- read.experiment(filepath) # <- valid ORFik .csv file
198:     df[4,] <- c("libtype", "stage", "rep", "condition", "fraction","filepath",
205:     df[4,] <- c("libtype", "stage", "rep", "condition", "fraction","filepath")
208:   # set file paths
211:   df[5:(5+length(files)-1), 1] <- findFromPath(files, libNames(), libtype)
214:   df[5:(5+length(files)-1), 2] <- findFromPath(files, stages, stage)
216:   df[5:(5+length(files)-1), 3] <- findFromPath(files, repNames(), rep)
218:   df[5:(5+length(files)-1), 4] <- findFromPath(files, conditionNames(), condition)
220:   df[5:(5+length(files)-1), 5] <- findFromPath(files, fractionNames(), fraction)
355:   files <- df$filepath
356:   if (length(df$filepath) == 0) stop("df have no filepaths!")
426: #' Get variable name per filepath in experiment
488: #' Get relative paths instead of full. Only use for inspection!
489: #' @return a character vector of paths, or a list of character with 2 paths per,
496: #' filepath(df, "default")
498: #' # filepath(df, "bedo")
500: #' # filepath(df, "pshifted")
506:     i <- which(df$filepath == x)
509:       out.dir <- paste0(dirname(df$filepath[1]), "/pshifted/")
539:       out.dir <- paste0(dirname(df$filepath[1]), "/",type,"/")
555:     if (is.null(input)) stop("filepath type not valid!")
559:   if (all(lengths(paths) == 1)) {
560:     paths <- unlist(paths)
562:   return(paths)
643:       libs <- bplapply(seq_along(paths),
644:                        function(i, paths, df, chrStyle, param, strandMode, varNames) {
646:         fimport(paths[i], chrStyle, param, strandMode)
647:       }, BPPARAM = BPPARAM, paths = paths, chrStyle = chrStyle, df = df,
688: #' dirname(df$filepath[1]),
716:                        out.dir = dirname(df$filepath[1]),
758:                        remove.file_ext(df$filepath[i], basename = TRUE),
274: #' else must be a character vector of length 1 or equal length as filepaths.
279:     if(length(slot) != 1 & length(slot) != length(filepaths)) {
359:     files <- c(files, reversePaths)
378:     stop("Duplicated filepaths in experiment!")
478: #' Get filepaths to ORFik experiment
482: #' default filepaths without warning. \cr
PloGO2:inst/script/WGCNA_proteomics.R: [ ]
106: path <- system.file("files", package="PloGO2")
107: allDat = read.csv(file.path(path,"rice.csv") )
108: Group = read.csv(file.path(path, "group_rice.csv") ) [,2]
RepViz:R/plotGeneTrack.R: [ ]
125:                                  host = "grch37.ensembl.org", path = "/biomart/martservice",
130:                                  host = "grch38.ensembl.org", path = "/biomart/martservice",
138:                                  host = "grch37.ensembl.org", path = "/biomart/martservice",
hca:R/lol.R: [ ]
132:     path <- ls(x, all.names = FALSE)
208:     path <- lol_path(x)
290:     path <- lol_path(x)
272: lol_path <- function(x) x[["path"]]
172:     paths <- lol_path(x)
1: .lol_visit_impl <- function(x, path, index, dict)
5: .lol_visit_impl.default <- function(x, path, index, dict) {
6:     dict[[path]] <- append(dict[[path]], list(index))
7:     attr(dict[[path]], "leaf") <- TRUE
15: .lol_visit_impl.list <- function(x, path, index, dict) {
18:     dict[[path]] <- append(dict[[path]], list(index))
19:     attr(dict[[path]], "leaf") <- FALSE
29:     ## logic for building out path names
30:     ## starting with current node of the nested list and extending the path by
32:     if (identical(path, ".")) {
33:         path <- nms
36:             path <- paste0(path, nms)
38:             path <- paste0(path, ".", nms)
44:         .lol_visit_impl(x[[i]], path[[i]], append(index, i), dict)
48:     function(lol, dict, path = .lol_path(dict), class = "lol")
53:         list(lol = lol, dict = dict, path = path),
75: #'     path, number of occurrences, and leaf status of each unique
76: #'     path.
129: .lol_path <-
133:     is_leaf <- .lol_is_leaf(x)[path]
135:         path = path,
136:         n = unname(.lol_lengths(x)[path]),
139:     arrange(tbl, .data$path)
142: .lol_valid_path <-
143:     function(x, path)
145:     ok <- .is_character_0(path) || path %in% lol_path(x)$path
146:     ok || stop("'path' not in 'x':\n", "  path: '", path, "'")
153: #' @param path character(1) from the tibble returned by `lol_path(x)`.
156: #'     to contain just the elements matching `path` as 'top-level'
164:     function(x, path = character())
168:         .is_character_0(path) || .is_scalar_character(path),
169:         .lol_valid_path(x, path)
173:     idx <- paths$path[startsWith(paths$path, path)]
174:     paths <- paths[paths$path %in% idx,]
175:     dict <-  .lol_dict(x)[paths$path]
190: #'     of rows in `lol_path()`.
209:     ## FIXME: don't allow filtering on 'path$path'
210:     path <- filter(path, ...)
211:     dict <- .lol_dict(x)[path$path]
213:     .lol(.lol_lol(x), dict, path, class(x))
219: #'     corresponding to a single `path`.
222: #'     corresponds to an element found at `path` in the list-of-lists
227:     function(x, path)
231:         .is_scalar_character(path),
232:         .lol_valid_path(x, path)
235:     value <- lapply(.lol_dict(x)[[path]], function(idx) lol[[idx]])
236:     names(value) <-  rep(path, length(value))
257:     function(x, path)
259:     value <- lol_lpull(x, path)
265: #' @description `lol_path()` returns a tibble representing the paths
269: #' plol |> lol_path()
293:         "# number of distinct paths: ", NROW(path), "\n",
297:         "# lol_path():\n",
300:     print(path, ...)
17:     ## building out the various paths
67: #'     individual paths from across the list-of-lists.
74: #'     paths through the list, as well as a tibble summarizing the
177:     .lol(.lol_lol(x), dict, paths, class(x))
183: #' @description `lol_filter()` filters available paths based on
295:         "# number of leaf paths: ", sum(is_leaf), "\n",
famat:R/compl_data.R: [ ]
568:         path<-h[2]
710:         path<-paste(stringr::str_sub(k, 1, 3),
858:             path<-stringr::str_split(s[1], "__")[[1]]
366:     notin_path<-vapply(elem_names, function(e){
369:         nb_path<-length(first_item[first_item %in% "X"])
387:     kegg_path<-pathways[stringr::str_sub(pathways, 1, 3) == "hsa"]
390:     path_walks_k<-vapply(kegg_path, function(x){
396:     wp_path<-pathways[stringr::str_sub(pathways, 1, 2) == "WP"]
397:     path_walks_w<-vapply(wp_path, function(x){
404:     path_walks_r<-vapply(first_walks_r, function(x){
425:     path_walks<-rbind(final_walks_r, path_walks_k,path_walks_w)
536:     cluster_elem<-save_cluster_elem<-listele[[1]];notin_path<-listele[[2]]
585:                 path_inter<-tagged[tagged$path == path,]
601:     heatmap<-listhtmp[[1]]; notin_path<-listhtmp[[2]]; hierapath<-listhtmp[[3]]
670:     rea_path<-sorted_path[stringr::str_sub(sorted_path, 1, 3) == "R-H"]
708:     kegg_path<-sorted_path[stringr::str_sub(sorted_path, 1, 3) == "hsa"]
740:     wp_path<-sorted_path[stringr::str_sub(sorted_path, 1, 2) == "WP"]
771: type_path<-function(sorted_path, hierapath){
800:     path_types<-unique(types$root)
802:         type_path<-types[types[, 2] %in% p, 1]#concerned pathways
948: filter_path<-function(tagged,size){
949:     path_inter<-as.vector(tagged[,4])
950:     sorted_path<-apply(size,1,function(x){ #sort pathways obtained
951:         path_elem<-as.integer(x[4])+as.integer(x[8])
965:     central<-listparam[[5]]; no_path<-listparam[[6]];
969:     sorted_path<-filter_path(tagged,size)
971:     path_walks<-listpath[[1]]; max<-listpath[[2]]
977:     heatmap<-listtab[[1]]; notin_path<-listtab[[2]]; hierapath<-listtab[[3]]
996:         path_cat<-stringr::str_split(i[6], ", ")[[1]]
435:     pathidtoname <- as.list(reactome.db::reactomePATHID2NAME)
516:     hierapath<-vapply(root_ids, function(r){
542:     heatmap<-listhiera[[1]]; hierapath<-listhiera[[2]]
963:     size<-listparam[[1]]; pathways<-listparam[[2]]; tagged<-listparam[[3]];
970:     listpath<-sort_hiera(sorted_path)
370:         if(element == TRUE && nb_path == 0){list(e)}
373:     notin_path<-unname(unlist(notin_path))
381:     if (element == TRUE){return(list(cluster, notin_path))}
388:     kegg_path<-paste(stringr::str_sub(kegg_path,1,3),
389:                         stringr::str_sub(kegg_path,5),sep="")
393:     path_walks_k<-as.data.frame(sort(unlist(path_walks_k)))
394:     if(ncol(path_walks_k) == 0){path_walks_k<-data.frame(walks=character())}
400:     path_walks_w<-as.data.frame(sort(unlist(path_walks_w)))
401:     if(ncol(path_walks_w) == 0){path_walks_w<-data.frame(walks=character())}
412:     path_walks_r<-rm_vector(unname(unlist(path_walks_r)))
413:     path_walks_r<-path_walks_r[stringr::str_detect(path_walks_r, ">")]
415:     final_walks_r<-vapply(path_walks_r, function(x){
416:         dupl<-which(stringr::str_detect(path_walks_r, x))
417:         dupl<-dupl[-which(dupl == which(path_walks_r == x))]
424:     names(final_walks_r)<-names(path_walks_w)<-names(path_walks_k)<-"walks"
426:     max<-max(stringr::str_count(path_walks[,1],">"))+1
427:     return(list(path_walks, max))
434:                                         treeview, no_path, list_elem){
455:                 paste("'", size[size$path == node, 2], "/",
456:                         size[size$path == node, 4], sep=""),
457:                 paste("'", size[size$path == node, 6], "/",
458:                         size[size$path == node, 8], sep=""),NA)
463:     colnames(heatmap)<-c("path_name", "path_id", "meta_ratio", "gene_ratio",
466:     heatmap[which(heatmap[, 4] == "'/"), 4]<-"'0/0";tags<-no_path$tag
480: cluster_hiera<-function(heatmap, size, tagged, no_path){
532: cluster_htmp<-function(heatmap, tags, size, tagged, no_path){
538:     cluster_elem<-cluster_elem[!(cluster_elem %in% notin_path)]
539:     heatmap<-heatmap[,c("path_name", "path_id", "meta_ratio", "gene_ratio",
541:     listhiera<-cluster_hiera(heatmap, size, tagged, no_path)
550:         if(x[2] %in% tagged$path){
556:     names(heatmap)<-c("path_name", "path_id", "meta_ratio", "gene_ratio",
558:     return(list(heatmap, notin_path, hierapath, save_cluster_elem))
562: final_tab<-function(build_hm, pathways, size, sorted_path, no_path,
564:     heatmap<-hiera_info(pathways, size, sorted_path, build_hm,
565:                         no_path, list_elem)
566:     sub_htmp<-heatmap[2:nrow(heatmap),]; tags<-no_path$tag #direct interactions
569:         pre_elem<-c(size[size$path %in% path, 3], size[size$path %in% path, 7])
586:                 path_inter<-path_inter[path_inter$tag ==
588:                 if(nrow(path_inter)>0){list("X")}
600:     listhtmp<-cluster_htmp(heatmap, tags, size, tagged, no_path)
603:     return(list(heatmap, notin_path, hierapath, save_cluster_elem))
625: infos_elem<-function(genes, notin_path, meta, keggchebiname, no_path,
634:     genetab<-pre_genetab[which(!(pre_genetab[,1] %in% notin_path)),]
635:     gene_notin<-pre_genetab[which(pre_genetab[,1] %in% notin_path),]
653:     intetab<-apply(no_path, 1, function(p){
664:                         "go", "path", "type")
669: type_reactome<-function(sorted_path){
672:     rea_types<-vapply(rea_path,function(r){
707: type_kegg<-function(sorted_path){
709:     kegg_types<-vapply(kegg_path, function(k){
712:         hiera<-kegg_hiera[stringr::str_detect(kegg_hiera[, 1], path), ]
725:         else if (path == "hsa01100"){
739: type_wp<-function(sorted_path){
741:     wp_types<-vapply(wp_path, function(w){
772:     kegg_type<-type_kegg(sorted_path)#kegg types
773:     rea_types<-type_reactome(sorted_path)#Reactome types
774:     wp_types<-type_wp(sorted_path)#wikipathways types
801:     hieratypes<-vapply(path_types, function(p){
804:             if(length(intersect(type_path, h[["name"]]))>0){h[["index"]]}
807:             if(length(intersect(type_path, h[["name"]]))>0){h[["name"]]}
872:                     list(paste("x : ",element,"\ny : ",path[length(path)],
881:                     list(paste("x : ", element, "\ny : ", path[length(path)],
952:         if (path_elem>0){
954:             if(num/path_elem>=0.2){x[1]}
957:     sorted_path<-unname(unlist(sorted_path))
958:     sorted_path<-rm_vector(c(sorted_path[!is.na(sorted_path)],path_inter))
959:     return(sorted_path)
972:     path_walks<-tidyr::separate(path_walks, 1, as.character(c(seq_len(max))),
974:     treeview<-tree_view(path_walks);names(treeview)<-c(seq_len(ncol(treeview)))
975:     listtab<-final_tab(treeview, pathways, size, sorted_path, no_path,
981:     listelm<-infos_elem(gene_list, notin_path, meta_list, keggchebiname,
982:                         no_path, go_genelist)
986:     listype<-type_path(sorted_path, hierapath)
998:                                           %in% path_cat),2]), collapse=", ")
1002:     names(intetab)<-c("tag", "first_item", "link", "sec_item", "go", "path",
341: ##find which elements are found in the same pathways, and put them together
342: ##find which pathways contain the same elements also
343: ##if element=T, also return user's elements which aren't in pathways
385: #filter entire pathways hierarchy to build a hierarchy concerning our pathways
386: sort_hiera<-function(pathways){
406:         if(length(pathways[pathways %in% rea_walks])>0){
407:             rea_walks<-rm_vector(rea_walks[c(1, which(rea_walks%in%pathways))])
430: #add informations about pathway hierarchies to the final heatmap
432: #names and ids of pathways in hierarchies
433: hiera_info<-function(pathways, size, sorted_pathways,
443:         name<-pathways[pathways[,2] == node, 1]
447:                             pathways[pathways[,2] == node, 1], sep=""))
450:             htmp<-c(htmp,paste(space, stringr::str_sub(pathidtoname[[node]],
451:                                     15, nchar(pathidtoname[[node]])), sep=""))
479: ##the hierarchy pathways are added to the root
527:     hierapath[length(hierapath)]=NULL
528:     return(list(heatmap, hierapath))
544:     hierapath<-lapply(hierapath,function(x){
549:     heatmap<-apply(heatmap,1,function(x){#pathway with direct interaction ?
561: ##build heatmap of hierarchies of pathways and elements included in them
668: #reactome pathways types
706: #kegg pathways types
738: #wikipathways pathways types
747:                 if(root%in%c("classic metabolic pathway", "regulatory pathway")
770: #pathways types=roots of pathways hierarchy
799:     ##list of concerned hierarchies by pathways types
803:         index<-lapply(hierapath, function(h){
806:         name<-lapply(hierapath, function(h){
947: #filter pathways regarding user's element ratio and direct interactions
1010:                 hierapath, save_cluster_elem, centrality, inter_values,
671:     mapnameid <- as.list(reactome.db::reactomePATHID2NAME) #id-name mapping
MetaboSignal:R/General_internal_functions.R: [ ]
185:     path = all_paths[maxBW, ]
140:     path_individual = as.character(row)
278: path_as_network = function(path) {
123:   shortpath = rownames(as.matrix(unlist(ASP)))
347:     pathM = convertTable(response)
122: ASP_paths = function (ASP) {
360:     all_pathsGM_names = all_pathsGM
341: MS_FindPathway = function(match = NULL, organism_code = NULL) {
141:     BW = sapply(path_individual, get_bw_score, BW_matrix)
180:     ## Get global BW score for each path
186:     path = as.character(path)
187:     all_paths = matrix(path, ncol = length(path))
277: ##################### path_as_network ######################
280:     for (i in 1:(length(path) - 1)) {
281:         edge = c(path[i], path[i + 1])
348:     colnames(pathM) = c("path_ID", "path_Description")
17: #metabolite is a substrate. It is used to calculate shortest paths with SP mode.
121: ####################### ASP_paths #######################
124:   return(shortpath)
150: BW_ranked_SP = function (all_paths, BW_matrix, networkBW_i, mode) {
152:     all_nodes = unique(as.vector(all_paths))
181:     Global_BW_score = sapply (split(all_paths, row(all_paths)), get_global_BW_score,
189:     return(all_paths)
342:     file = paste("http://rest.kegg.jp/list/pathway/", organism_code, sep = "")
345:         stop("A valid organism_code is required for KEGG_entry = pathway")
349:     rownames(pathM) = NULL
351:         target_matrix = pathM
352:         target_column = pathM[, 2]
355:     } else (return(pathM))
359: network_names = function(all_pathsGM, organism_code) {
361:     all_nodes = unique(as.vector(all_pathsGM[, 1:2]))
365:         all_pathsGM_names[all_pathsGM_names == all_nodes[i]] = all_names[i]
367:     return(all_pathsGM_names)
340: #################### MS_FindPathway ####################
TPP2D:R/import_funcs.R: [ ]
348:   Experiment <- Path <- Compound <- NULL
570:  Path <- label <- conc <- Compound <- Experiment <- 
371:   givenPaths <- NULL
253:                "Experiment", "Path", "Path", 
254:                "Path", "Condition", "Replicate", 
334: #' @param infoTable character string of a file path to
372:   if (any("Path" %in% colnames(infoTable))) {
373:     if (all(infoTable$Path == "") || all(is.na(infoTable$Path))) {
374:       message("Removing empty 'Path' column from config table")
375:       infoTable <- infoTable %>% select(-Path)
378:       givenPaths <- infoTable$Path
443: #' @param configTable character string of a file path to a config table
485:   files <- configTable$Path
511:                   "RefCol", "Path", "Condition")
573:   if(any(grepl("Path", colnames(configWide)))){
575:       dplyr::select(-Path) %>%
756: #' @param configTable character string of a file path to a config table
433:       expCond = infoTable$Condition, files = givenPaths, 
ArrayExpress:R/parseMAGE.r: [ ]
516: 	path = mageFiles$path
30: isOneChannel = function(sdrf,path){
31: 	ph = try(read.AnnotatedDataFrame(sdrf, path = path, row.names = NULL, blank.lines.skip = TRUE, fill = TRUE, varMetadata.char = "$", quote="\""))
39: readPhenoData = function(sdrf,path){
42: 	ph = try(read.AnnotatedDataFrame(sdrf, path = path, row.names = NULL, blank.lines.skip = TRUE, fill = TRUE, varMetadata.char = "$", quote="\""))
105: readAEdata = function(path,files,dataCols,green.only){
108: 	source = getDataFormat(path,files)
121: 		rawdata = try(oligo::read.celfiles(filenames = file.path(path,unique(files))))
123: 			stop("Unable to read cel files in",path)
130: 			dataCols= try(getDataColsForAE1(path,files))
133: 		rawdata = try(read.maimages(files=files,path=path,source="generic",columns=dataCols,annotation=headers$ae1))
138: 		rawdata = try(read.maimages(files=files,path=path,source=source,columns=dataCols,green.only=green.only))
142: 		rawdata = try(read.maimages(files=files,path=path,source="generic",columns=dataCols,green.only=green.only))
149: 		stop("Unable to read data files in",path)
169: readFeatures<-function(adf,path,procADFref=NULL){
173: 	lines2skip = skipADFheader(adf,path,!is.null(procADFref))
174: 	features = try(read.table(file.path(path, adf), row.names = NULL, blank.lines.skip = TRUE, fill = TRUE, sep="\t", na.strings=c('?','NA'), sk...(40 bytes skipped)...
223: readExperimentData = function(idf, path){
224: 	idffile = scan(file.path(path,idf),character(),sep = "\n",encoding="UTF-8")
264: skipADFheader<-function(adf,path,proc=F){
270: 	con = file(file.path(path, adf), "r")	
319: getDataFormat=function(path,files){
326: 		allcnames = scan(file.path(path,files[1]),what = "",nlines = 200, sep = "\t",quiet=TRUE)
329: 			allcnames = scan(file.path(path,files[1]),what = "",nlines = 200, sep = "\t",quiet=TRUE,encoding="latin1")
345: 	allcnames = scan(file.path(path,files[1]),what = "",nlines = 1, sep = "\n",quiet=TRUE)
352: getDataColsForAE1 = function(path,files){
362: 						file.path(system.file("doc", package = "ArrayExpress"),"QT_list.txt"),
375: 	allcnames = scan(file.path(path,files[1]),what = "",nlines = 1, sep = "\t",quiet=TRUE)
430: 		if(!all(sapply(2:length(files), function(i) readLines(file.path(path,files[1]),1) == readLines(file.path(path,files[i]),1))))
518: 	try(file.remove(file.path(path, mageFiles$rawFiles)))
519: 	try(file.remove(file.path(path, mageFiles$processedFiles)))
521: 	try(file.remove(file.path(path, mageFiles$sdrf)))
522: 	try(file.remove(file.path(path, mageFiles$idf)))
523: 	try(file.remove(file.path(path, mageFiles$adf)))
524: 	try(file.remove(file.path(path, mageFiles$rawArchive)))
525: 	try(file.remove(file.path(path, mageFiles$processedArchive)))
megadepth:R/install.R: [ ]
146:         path <- Sys.getenv("APPDATA", "")
175:         path <- file.path(d, exec)
206:     path <- NULL # cache the path to megadepth
182:     path2 <- Sys.which(cmd)
143: bin_paths <- function(dir = "Megadepth",
15: #' found via the environment variable \code{PATH}.
17: #' If you want to install Megadepth to a custom path, you can set the global
35: #' @importFrom xfun is_windows is_macos same_path
75:     exec <- file.path(tempdir(), exec_name)
144:     extra_path = getOption("megadepth.dir")) {
147:         path <- if (fs::dir_exists(path)) {
148:             file.path(path, dir)
151:         path <- "~/Library/Application Support"
152:         path <- if (fs::dir_exists(path)) file.path(path, dir)
153:         path <- c("/usr/local/bin", path)
155:         path <- c("~/bin", "/snap/bin", "/var/lib/snapd/snap/bin")
157:     path <- c(extra_path, path, pkg_file(dir, mustWork = FALSE))
159:     path <- path[path != ""]
162:         path <- c(tempdir(), path)
164:     path
167: # find an executable from PATH, APPDATA, system.file(), ~/bin, etc
176:         if (utils::file_test("-x", path)) {
179:             path <- ""
183:     if (path == "" || xfun::same_path(path, path2)) {
184:         if (path2 == "") {
187:         return(cmd) # do not use the full path of the command
189:         if (path2 != "") {
194:                 path,
196:                 path2,
202:     normalizePath(path)
208:         if (is.null(path)) {
209:             path <<- find_exec(
215:         path
109:     dirs <- bin_paths()
139:     message("megadepth has been installed to ", normalizePath(destdir))
158:     # remove empty paths potentially created by pkgfile
169:     for (d in bin_paths(dir)) {
epivizrServer:R/middleware-plus-supporting.R: [ ]
438:     path <- req$PATH_INFO
217:   abs.path <- file.path(dir, relpath)
446:     abs.path <- resolve(root, path)
367:   pathPattern <- paste("^\\Q", prefix, "\\E/", sep = "")
371:       origPath <- req$PATH_INFO
376:       pathInfo <- substr(req$PATH_INFO, nchar(prefix)+1, nchar(req$PATH_INFO))
402:   pathPattern <- paste("^\\Q", prefix, "\\E/", sep = "")
407:       origPath <- req$PATH_INFO
412:       pathInfo <- substr(req$PATH_INFO, nchar(prefix)+1, nchar(req$PATH_INFO))
205: # Attempt to join a path and relative path, and turn the result into a
206: # (normalized) absolute path. The result will only be returned if it is an
218:   if (!file.exists(abs.path))
220:   abs.path <- normalizePath(abs.path, winslash='/', mustWork=TRUE)
224:   if (nchar(abs.path) <= nchar(dir) + 1)
226:   if (substr(abs.path, 1, nchar(dir)) != dir ||
227:       substr(abs.path, nchar(dir)+1, nchar(dir)+1) != '/') {
230:   return(abs.path)
344: # `PATH_INFO` field, but since it's such a common need, let's make it simple by
349: # the route off of the `PATH_INFO` (and add it to the end of `SCRIPT_NAME`).
351: # path has already been matched via routing.
369:     if (isTRUE(grepl(pathPattern, req$PATH_INFO))) {
374:         req$PATH_INFO <- origPath
378:       req$PATH_INFO <- pathInfo
405:     if (isTRUE(grepl(pathPattern, req$PATH_INFO))) {
410:         req$PATH_INFO <- origPath
414:       req$PATH_INFO <- pathInfo
440:     if (is.null(path))
443:     if (path == '/')
444:       path <- '/index.html'
447:     if (is.null(abs.path))
450:     content.type <- mime::guess_type(abs.path)
451:     response.content <- readBin(abs.path, 'raw', n=file.info(abs.path)$size)
216: resolve <- function(dir, relpath) {
221:   dir <- normalizePath(dir, winslash='/', mustWork=TRUE)
295: # representing paths to be used instead of handlers; any such strings we
scde:R/functions.R: [ ]
5439:             path <- env[['PATH_INFO']]
6044:             path <- env[['PATH_INFO']]
2147:                 pathsizes <- unlist(tapply(vi, gcll, length))
5059: pathway.pc.correlation.distance <- function(pcc, xv, n.cores = 10, target.ndf = NULL) {
6173:                        pathcl <- ifelse(is.null(req$params()$pathcl), 1, as.integer(req$params()$pathcl))
1877: pagoda.pathway.wPCA <- function(varinfo, setenv, n.components = 2, n.cores = detectCores(), min.pathway.size = 10, max.pathway.size = 1e3, n.randomizations = 10, n.internal.shuffles = 0, n.starts = 10, center = TRUE, batch....(55 bytes skipped)...
5558: t.view.pathways <- function(pathways, mat, matw, env, proper.names = rownames(mat), colcols = NULL, zlim = NULL, labRow = NA, vhc = ...(145 bytes skipped)...
5684: pagoda.show.pathways <- function(pathways, varinfo, goenv = NULL, n.genes = 20, two.sided = FALSE, n.pc = rep(1, length(pathways)), colcols = NULL, zlim = NULL, showRowLabels = FALSE, cexCol = 1, cexRow = 1, nstarts = 10, ce...(117 bytes skipped)...
5698: c.view.pathways <- function(pathways, mat, matw, goenv = NULL, batch = NULL, n.genes = 20, two.sided = TRUE, n.pc = rep(1, length(pathways)), colcols = NULL, zlim = NULL, labRow = NA, vhc = NULL, cexCol = 1, cexRow = 1, nstarts = 50, ...(93 bytes skipped)...
461: ##' @param name URL path name for this app
5443:             switch(path,
6047:             switch(path,
1: ##' Single-cell Differential Expression (with Pathway And Gene set Overdispersion Analysis)
6: ##' The scde package also contains the pagoda framework which applies pathway and gene set overdispersion analysis
9: ##' See vignette("pagoda") for a brief tutorial on pathway and gene set overdispersion analysis to identify and characterize cell subpopulations.
1292: ...(39 bytes skipped)...lowed for the estimated adjusted variance (capping of adjusted variance is recommended when scoring pathway overdispersion relative to randomly sampled gene sets)
1789: ##' such as ribosomal pathway variation) and subtracts it from the data so that it is controlled
1815: ##' cc.pattern <- pagoda.show.pathways(ls(go.env)[1:2], varinfo, go.env, show.cell.dendrogram = TRUE, showRowLabels = TRUE)  # Look at...(30 bytes skipped)...
1845: ##' @param min.pathway.size minimum number of observed genes that should be contained in a valid gene set
1846: ##' @param max.pathway.size maximum number of observed genes in a valid gene set
1847: ...(103 bytes skipped)...ith each gene set (can be kept at 5 or 10, but should be increased to 50-100 if the significance of pathway overdispersion will be determined relative to random gene set models)
1873: ##' pwpca <- pagoda.pathway.wPCA(varinfo, go.env, n.components=1, n.cores=10, n.internal.shuffles=50)
1901:         gsl <- gsl[gsl.ng >= min.pathway.size & gsl.ng<= max.pathway.size]
1905:         message("processing ", length(gsl), " valid pathways")
1954: ##' @param pwpca result of the pagoda.pathway.wPCA() call with n.randomizations > 1
1965: ##' pwpca <- pagoda.pathway.wPCA(varinfo, go.env, n.components=1, n.cores=10, n.internal.shuffles=50)
2148:                 names(pathsizes) <- pathsizes
2151:                     rsdv <- unlist(lapply(names(pathsizes), function(s) {
2156:                     return(data.frame(n = as.integer(pathsizes), var = unlist(sdv), round = i, rvar = rsdv))
2160:                 data.frame(n = as.integer(pathsizes), var = unlist(sdv), round = i)
2216: ##' @param pwpca output of pagoda.pathway.wPCA()
2242: ##' pwpca <- pagoda.pathway.wPCA(varinfo, go.env, n.components=1, n.cores=10, n.internal.shuffles=50)
2393:     # determine genes driving significant pathways
2435: ##' @param pwpca output of pagoda.pathway.wPCA()
2453: ##' pwpca <- pagoda.pathway.wPCA(varinfo, go.env, n.components=1, n.cores=10, n.internal.shuffles=50)
2460:     pclc <- pathway.pc.correlation.distance(c(pwpca, clpca$cl.goc), tam$xv, target.ndf = 100, n.cores = n.cores)
2521: ##' pwpca <- pagoda.pathway.wPCA(varinfo, go.env, n.components=1, n.cores=10, n.internal.shuffles=50)
2603: ##' pwpca <- pagoda.pathway.wPCA(varinfo, go.env, n.components=1, n.cores=10, n.internal.shuffles=50)
2654: ##' @param tamr Combined pathways that show similar expression patterns. Output of \code{\link{pagoda.reduce.redundancy}}
2655: ##' @param row.clustering Dendrogram of combined pathways clustering
2667: ##' pwpca <- pagoda.pathway.wPCA(varinfo, go.env, n.components=1, n.cores=10, n.internal.shuffles=50)
2724: ##' @param tamr Combined pathways that show similar expression patterns. Output of \code{\link{pagoda.reduce.redundancy}}
2725: ##' @param tam Combined pathways that are driven by the same gene sets. Output of \code{\link{pagoda.reduce.loading.redundancy}}...(0 bytes skipped)...
2728: ...(15 bytes skipped)...a Weighted PC magnitudes for each gene set provided in the \code{env}. Output of \code{\link{pagoda.pathway.wPCA}}
2732: ##' @param row.clustering Dendrogram of combined pathways clustering. Default NULL.
2733: ##' @param title Title text to be used in the browser label for the app. Default, set as 'pathway clustering'
2739: ...(47 bytes skipped)... env, pwpca, clpca = NULL, col.cols = NULL, cell.clustering = NULL, row.clustering = NULL, title = "pathway clustering", zlim = c(-1, 1)*quantile(tamr$xv, p = 0.95)) {
2764:     # prepare pathway df
3559: .onUnload <- function(libpath) {
3560:     library.dynam.unload("scde", libpath, verbose = TRUE)
5108:         #set scale at top pathway?
5560:     lab <- which(proper.names %in% na.omit(unlist(mget(pathways, envir = env, ifnotfound = NA))))
5564:         lab <- which(proper.names %in% pathways)
5569:     #table(rownames(mat) %in% mget(pathways, envir = env))
5660: ##' View pathway or gene weighted PCA
5662: ##' Takes in a list of pathways (or a list of genes), runs weighted PCA, optionally showing the result.
5663: ##' @param pathways character vector of pathway or gene names
5665: ##' @param goenv environment mapping pathways to genes
5668: ...(5 bytes skipped)...param n.pc optional integer vector giving the number of principal component to show for each listed pathway
5681: ##' @param ... additional arguments are passed to the \code{c.view.pathways}
5687:     x <- c.view.pathways(pathways, varinfo$mat, varinfo$matw, goenv, batch = varinfo$batch, n.genes = n.genes, two.sided = two.si...(213 bytes skipped)...
5695: # takes in a list of pathways with a list of corresponding PC numbers
5696: # recalculates PCs for each individual pathway, weighting gene loading in each pathway and then by total
5697: # pathway variance over the number of genes (rough approximation)
5699:     # are these genes or pathways being passed?
5701:         x <- pathways %in% ls(goenv)
5703:         x <- rep(FALSE, length(pathways))
5705:     if(sum(x) > 0) { # some pathways matched
5707:         message("WARNING: partial match to pathway names. The following entries did not match: ", paste(pathways[!x], collapse = " "))
5709:         # look up genes for each pathway
5710:         pathways <- pathways[x]
5711:         p.genes <- mget(pathways, goenv, ifnotfound = NA)
5713:         x <- pathways %in% rownames(mat)
5716: ...(9 bytes skipped)...       message("WARNING: partial match to gene names. The following entries did not match: ", paste(pathways[!x], collapse = " "))
5718:             p.genes <- list("genes" = pathways[x])
5719:             pathways <- c("genes");
5720:         } else { # neither genes nor pathways are passed
5721:             stop("ERROR: provided names do not match either gene nor pathway names (if the pathway environment was provided)")
5728:     # recalculate wPCA for each pathway
5729:     ppca <- pagoda.path...(130 bytes skipped)...s), n.cores = 1, n.randomizations = 0, n.starts = 2, n.components = max(n.pc), verbose = FALSE, min.pathway.size = 0, max.pathway.size = Inf, n.internal.shuffles = 0)
5731:     if(length(ppca) > 1) { # if more than one pathway was supplied, combine genes using appropriate loadings and use consensus PCA (1st PC) as a patte...(2 bytes skipped)...
5733:         scaled.gene.loadings <- unlist(lapply(seq_along(pathways), function(i) {
5734:             gl <- ppca[[pathways[i]]]$xp$rotation[, n.pc[i], drop = TRUE]*as.numeric(ppca[[pathways[i]]]$xp$sd)[n.pc[i]]/sqrt(ppca[[pathways[i]]]$n)
5735:             names(gl) <- rownames(ppca[[pathways[i]]]$xp$rotation)
5777:     } else { # only one pathway was provided
5970: ##' @field results Output of the pathway clustering and redundancy reduction
5972: ##' @field pathways
5983:     fields = c('results', 'genes', 'pathways', 'mat', 'matw', 'goenv', 'renv', 'name', 'trim', 'batch'),
5986:         initialize = function(results, pathways, genes, mat, matw, goenv, batch = NULL, name = "pathway overdispersion", trim = 1.1/ncol(mat)) {
5995:             pathways <<- pathways
6012:                 gcl <- t.view.pathways(genes, mat = mat, matw = matw, env = goenv, vhc = results$hvc, plot = FALSE, trim = ltrim)
6058: ...(21 bytes skipped)...                <link rel = "stylesheet" type = "text/css" href = "http://pklab.med.harvard.edu/sde/pathcl.css" / >
6064: ...(10 bytes skipped)...                           <script type = "text/javascript" src = "http://pklab.med.harvard.edu/sde/pathcl.js" > </script >
6072:                    '/pathcl.json' = { # report pathway clustering heatmap data
6126:                    '/pathwaygenes.json' = { # report heatmap data for a selected set of genes
6133:                        x <- c.view.pathways(gsub("^#PC\\d+# ", "", pws), mat, matw, goenv = goenv, n.pc = n.pcs, n.genes = ngenes, two.side...(75 bytes skipped)...
6134:                        #x <- t.view.pathways(gsub("^#PC\\d+# ", "", pws), mat, matw, env = goenv, vhc = results$hvc, plot = FALSE, trim = lt...(14 bytes skipped)...
6174:                        ii <- which(results$ct == pathcl)
6251:                    '/pathways.json' = {
6252:                        lgt <- pathways
GeneTonic:R/GeneTonic.R: [ ]
1865:       path <- system.file("doc", "GeneTonic_manual.html", package = "GeneTonic")
1866:       if (path == "") {
1869:         browseURL(path)
BrainSABER:R/buildAIBSARNA.R: [ ]
66:     path <- bfcrpath(bfc, url)
70:         file=unz(path, "expression_matrix.csv"),
75:     pd <- read.csv(file=unz(path, "columns_metadata.csv"),
80:     fd <- read.csv(file=unz(path, "rows_metadata.csv"),
mAPKL:R/mAPKL.R: [ ]
64:     path <- as.integer(dataType)
54: ## path : 6-ratio data without normalization    or
69:     cluster_analysis <- cluster.Sim(ordIntensities_f[,start:end], path, min.clu,
SMITE:R/SMITE.R: [ ]
1277:                             path <- goseq::goseq(pwf, "hg19", "knownGene",
1196:             PATHID2NAME <- AnnotationDbi::as.list(reactome.db::reactomePATHID2NAME)
1210:             pathways <- KEGGREST::keggList("pathway", "hsa") ## returns the list of human pathways
1279:                             path <- cbind(path,(as.character(sapply(
1280:                                 path$category, function(i){PATHID2NAME[[i]]}))))
1281:                             colnames(path)[6] <- "cat_name"
1282:                             subset(path, path$over_represented_pvalue < p_thresh)
1189:                 AnnotationDbi::as.list(reactome.db::reactomeEXTID2PATHID)
1201:             link_kegg<- KEGGREST::keggLink("pathway", "hsa") ## returns pathways for each kegg gene
1202:             list_link <- split(unname(link_kegg), names(link_kegg)) ## combines each pathway into list object for each gene
1211:             PATHID2NAME <- as.list(pathways)
pathVar:R/pipeline.final.R: [ ]
634:     path <- pvalue_results@pwayCounts[[pathway]]
780:     path1 <- pvalue_results@pwayCounts1[[pathway]]
781:     path2 <- pvalue_results@pwayCounts2[[pathway]]
99: pathVarOneSample <- function(dat.mat, pways, test = c("chisq", "exact"), varStat = c("sd", 
131:     pathwayCounts <- lapply(lapply(olap.pways, function(x) table(x, deparse.level = 0)), function(x) if (len...(10 bytes skipped)...
206: pathVarTwoSamplesCont <- function(dat.mat, pways, groups, boot = 1000, varStat = c("sd", "mean", 
290: pathVarTwoSamplesDisc <- function(dat.mat, pways, groups, perc = c(1/3, 2/3), test = c("chisq", 
344:     pathwayCounts1 <- lapply(lapply(olap.pways1, function(x) table(x, deparse.level = 0)), 
354:     pathwayCounts2 <- lapply(lapply(olap.pways2, function(x) table(x, deparse.level = 0)), 
853:     pathDat1 <- as.data.frame(table(mixDat1))
855:     pathDat2 <- as.data.frame(table(mixDat2))
943:     pathname <- sapply(listPath, function(x) if (length(unlist(strsplit(x, "/"))) > 1) {
796:     plotPath1 <- ggplot(path1, aes(x = Cluster, y = Number_of_genes, fill = Cluster)) + geom_bar(stat = "identity", 
800:     plotPath2 <- ggplot(path2, aes(x = Cluster, y = Number_of_genes, fill = Cluster)) + geom_bar(stat = "identity", 
659:         plotPathway <- d + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), 
738:             plotPathway <- d + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), 
806:         plotPathway1 <- plotPath1 + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), 
809:         plotPathway2 <- plotPath2 + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), 
871:     plotPathDat1 <- ggplot(path...(136 bytes skipped)...("Number of genes") + theme(legend.position = "none") + ggtitle("Group 1") + xlab("") + ylim(0, max(pathDat1[,2], pathDat2[,2]))
872:     plotPathDat2 <- ggplot(path...(136 bytes skipped)...("Number of genes") + theme(legend.position = "none") + ggtitle("Group 2") + xlab("") + ylim(0, max(pathDat1[,2], pathDat2[,2]))
26: ...(25 bytes skipped)...ptions are TRUE or FALSE. If TRUE then the first column of the tab delimited file is expected to be path IDs. If FALSE, then the first column is expected to be pathway names.
645:     path <- as.data.frame(path)
646:     colnames(path) <- c("Cluster", "Number_of_genes")
653:     d <- ggplot(path, aes(x = Cluster, y = Number_of_genes, fill = Cluster)) + geom_bar(stat = "identity", 
663:             plotPathway <- plotPathway + annotate("text", x = sigCat, y = path[sigCat + 0.1, 
789:     path1 <- as.data.frame(path1)
790:     colnames(path1) <- c("Cluster", "Number_of_genes")
792:     path2 <- as.data.frame(path2)
793:     colnames(path2) <- c("Cluster", "Number_of_genes")
794:     yLimMax <- max(path1[, 2], path2[, 2])
813:             plotPathway1 <- plotPathway1 + annotate("text", x = sigCat, y = path1[sigCat + 
815:             plotPathway2 <- plotPathway2 + annotate("text", x = sigCat, y = path2[sigCat + 
20: #makeDBList put your pathways text file into a list
21: #pway$PATHNAME is the pathway names from the file
22: #pway$PATHID is a vector of pathway ID numbers is there are any. Otherwise it will be a vector filled with NA
23: #pway$GENES is a list of vectors, where each vector are the genes for a single pathway
25: #file is a tab delimited text file, where first and second columns are pathwayID and pathway name. The third (or last column is the genes associated with each pathway, seperated by commas.
33:         pways$PATHNAME <- as.vector(pwayTable[, 2])
34:         pways$PATHID <- as.vector(pwayTable[, 1])
35:         pways$GENES <- list(length(pways$PATHID))
37:         for (i in 1:length(pways$PATHID)) {
43:                 pways$PATHID <- pways$PATHID[-i]
44:                 pways$PATHNAME <- pways$PATHNAME[-i]
49:         pways$PATHNAME <- as.vector(pwayTable[, 1])
50:         pways$PATHID <- rep("NA", length(pways$PATHNAME))
51:         pways$GENES <- list(length(pways$PATHID))
53:         for (i in 1:length(pways$PATHID)) {
59:                 pways$PATHID <- pways$PATHID[-i]
60:                 pways$PATHNAME <- pways$PATHNAME[-i]
64:     names(pways$GENES) <- pways$PATHNAME
69: #pathVarOneSample
73: # 3. For each pathway, we extract the gene in our dataset and in which cluster they belong.
74: # 4. For each pathway, we look how the gene counts in each category and compare it to the reference counts with all th...(59 bytes skipped)...
78: # Output 1: tablePway columns are :pathway name, path...(46 bytes skipped)...or exact test,the percentage of genes from our dataset related to the total number of genes in each pathway, the number of genes from our dataset inside the pathway and the total number of genes inside the pathway
79: #Output 2: NAPways corresponds to the pathway names of the pathway having less than 10 genes for the Chi-Squared or also more than 500 genes for the exact tes.
80: # Output 3: genesInPway correspond to each pathway with the genes from the datasets belonging to it and in which cluster they were classsify.
83: # Output 6: pwayCounts is the genes counts of the each pathway in each cluster.
91: #Input 2: pways contains the pathways of interest (KEGG, REACTOME, etc...) in the same format that makeDBList
103:     # check if any GENES are in the pathway.
106:         stop("None of the genes in the data set are found in the given gene set or pathway")
125:     # olap.pways contains the genes are in each pathway with their cluster number
127:     names(olap.pways) <- pways$PATHNAME
130:     # list of tables of the number of genes in each cluster per pathway
140:     # Chi-Square or Exact test to compare the reference and the pathway distribution
142:         # chisq test and ajustment of the pvalue for each pathway
143:         pvals.pways <- sapply(pathwayCounts, function(x) if (sum(x) >= 10) {
154:         # Exact test and ajustment of the pvalue for each pathway
157:         # We perform the multinomial test on the pathway containing between 10 and 500 genes because a bigger number will involve too many possibilities ...(11 bytes skipped)...
158:         pvals.pways <- sapply(pathwayCounts, function(x) if (sum(x) >= 10 & sum(x) < 500) {
170:     xtab <- data.table(PwayName = pways$PATHNAME[not_na], PwayID = pways$PATHID[not_na], APval = apvals.pways, 
172:         NumOfGenesFromDataSetInPathway = lengths(olap.pways[not_na]), PathwaySize = pways$SIZE[not_na])
176: ...(50 bytes skipped)...ab, NAPways=pval.NA, genesInPway=olap.pways, refProb=pexp, refCounts=pexp * length(mix), pwayCounts=pathwayCounts, numOfClus=nmix, varStat=varStat, genesInClus=mix, var=vs)
181: #pathVarTwoSamplesCont
184: # 2. For each pathway, we extract the gene in our dataset.
185: # 3. For each pathway, we look how its genes are distributed and compare the 2 groups using the bootstrap Kolmogorov-S...(12 bytes skipped)...
189: # Output 1: tablePway columns are :pathway name, pathway IDs, adjusted p-value ffrom the boot KS test, the number of genes from our dataset inside the pathway and the total number of genes inside the pathway.
190: #Output 2: NAPways corresponds to the pathway names of the pathway having no genes inside the dataset.
191: # Output 3: genesInPway correspond to the genes from the dataset belonging to each pathway
200: #Input 2: pways contains the pathways of interest (KEGG, REACTOME, etc...) in the same format that makeDBList
209:     # check if any GENES are in the pathway
212:         stop("None of the genes in the data set are found in the given gene set or pathway")
236:     # olap.pways contains the genes from the dataset in each pathway
238:     names(olap.pways) <- pways$PATHNAME
239:     # We compare the two densities (one for each group) of the genes of each pathway with the Kolmogorov-Smirnow test.       
251:     xtab <- data.table(PwayName = pways$PATHNAME[not_na], PwayID = pways$PATHID[not_na], APval = apvals, 
253:         NumOfGenesFromDataSetInPathway = lengths(olap.pways[not_na]), PathwaySize = pways$SIZE[not_na])
261: #pathVarTwoSamplesDisc
265: # 3. For each pathway, we extract the gene in our dataset and in which cluster they belong.
266: # 4. For each pathway, we look at the gene counts in each category and compare the 2 samples to each other with all th...(60 bytes skipped)...
269: # Output 1: tablePway columns are :pathway name, path...(11 bytes skipped)...justed p-value, the percentage of genes in our dataset related to the total number of genes in each pathway, the number of genes from our dataset inside the pathway and the total number of genes inside the pathway.
270: #Output 2: NAPways corresponds to the pathway names of the pathway having no genes inside the dataset.
271: # Output 3: genesInPway1 corresponds to the genes from the dataset belonging to each pathway in the first sample
272: # Output 4: genesInPway2 corresponds to the genes from the dataset belonging to each pathway in the second sample
273: # Output 5: pwayCounts1 corresponds to a list of tables of the number of genes in each cluster per pathway for group 1
274: # Output 6: pwayCounts2 corresponds to a list of tables of the number of genes in each cluster per pathway for group 2
283: #Input 2: pways contains the pathways of interest (KEGG, REACTOME, etc...) in the same format that makeDBList
294:     # check if any GENES are in the pathway
297:         stop("None of the genes in the data set are found in the given gene set or pathway")
338:     # olap.pways contains the genes from the dataset in each pathway
340:     names(olap.pways1) <- pways$PATHNAME
342:     names(olap.pways2) <- pways$PATHNAME
343:     # list of tables of the number of genes in each cluster per pathway
353:     # list of tables of the number of genes in each cluster per pathway
364:         # chisq test and ajustment of the pvalue for each pathway
365:         pvals.pways <- sapply(pways$PATHNAME, function(x) if (sum(pathwayCounts1[x][[1]]) >= 
367:             exp.val <- pathwayCounts1[x][[1]]  #forgot the.val
368:             chi <- sum((pathwayCounts2[x][[1]] - exp.val)^2/exp.val)
374:         pval.NA <- pways$PATHNAME[-not_na]
377:         # Exact test and ajustment of the pvalue for each pathway
380:         # We perform the multinomial test on the pathway containing between 10 and 500 genes because a bigger number will involve too many possibilities ...(11 bytes skipped)...
381:         pvals.pways <- sapply(pways$PATHNAME, function(x) if (sum(pathwayCounts1[x][[1]]) >= 
382:             10 & sum(pathwayCounts1[x][[1]]) < 500) {
383:             pexp <- pathwayCounts1[x][[1]]/sum(pathwayCounts1[x][[1]])
384:             multinomial.test(as.vector(pathwayCounts2[x][[1]]), as.vector(pexp), useChisq = FALSE)$p.value
391:         pval.NA <- pways$PATHNAME[-not_na]
395:     xtab <- data.table(PwayName = pways$PATHNAME[not_na], PwayID = pways$PATHID[not_na], APval = apvals.pways, 
397:         NumOfGenesFromDataSetInPway = lengths(olap.pways1[not_na]), PathwaySize = pways$SIZE[not_na])
402: ...(36 bytes skipped)...", tablePway=xtab, NAPways=pval.NA, genesInPway1=olap.pways1, genesInPway2=olap.pways2, pwayCounts1=pathwayCounts1, pwayCounts2=pathwayCounts2, groups=groups, groupNames=groupNames, var1=var_1, var2=var_2, varStat=varStat)
409: #It is a function that returns the significant pathway(s),which category(ies) from this pathway are significant and which gene(s) belongs to this(ese) category(ies).
413: # Output 1: genesInSigPways1 contains the genes per significant pathway belonging to the significant category.
414: #Output 2: sigCatPerPway contains the category(ies) per pathway that are significant.
418: #Input 1: pvalue_results is result from the pathVarOneSample function
430:         warning("There are no significant pathways. Quitting significant_category function and returning empty object")
434:     # PathName that were significant in xtab.
436:     # The list of table with the number of genes in each cluster from the significant pathways
442:     # results contain the p-value for each category in each pathway computed with the binomial test.
450:     # For each significant pathway we look which category(ies) is are significant and the genes
477: #It is a function that returns the significant pathways and which genes belongs to these #pathways.
481: # Output 1: genesInSigPways1 contains the genes belonging to each significant pathway
485: #Input 1: pvalue_results is result from the pathVarTwoSamplesCont function
493:         warning("There are no significant pathways. Quitting significant_category function and returning empty object")
497:     # Pathways that were significant in xtab.
499:     # Genes from the dataset inside each significant pathway
507: #It is a function that returns the significant pathways and which genes belong to these pathways
511: # Output 1: genesInSigPways1 contains the genes belonging to each significant pathway in significant categories in the first sample
512: # Output 2: genesInSigPways2 contains the genes belonging to each significant pathway in significant categories in the second sample
513: # Output 3: sigCatPerPway contains the significant categories in each pathway
517: #Input 1: pvalue_results is result from the pathVarTwoSamplesDisc function
527:         warning("There are no significant pathways. Quitting significant_category function and returning empty object")
531:     # PathName that were significant in xtab.
533:     # The list of table with the number of genes in each cluster from the significant pathways
540:     # results contain the p-value for each category in each pathway computed with the binomial
550:     # For each significant pathway we look which category(ies) are significant and the genes belonging to this(ese) category(ies). ...(81 bytes skipped)...
576: ...(77 bytes skipped)...es cases and then use sigOneSample, sigTwoSamplesCont, or sigTwoSamplesDisc to find the significant pathways.
582: #Input 1: pvalue_results is result from the pathVarOneSample, pathVarTwoSamplesCont, or pathVarTwoSamplesDisc function.
602: #It is a function that returns the plot of the reference counts along with the plot of a chosen #pathway. This function is made for output from pathVarOneSample.
605: # plot of the reference and a pathway counts
608: #Input 1: pvalue_results is result from the pathVarOneSample function
609: #Input 2: pathway is the chosen pathway you want to plot.
613: #If sig is not NULL, the function will check if the pathway is a significant one and if yes the
619: plotOneSample <- function(pvalue_results, pathway, sig) {
620:     mp <- pathway
621:     # If the name of the pathway is two long it will cut it into two lines in the plot.
644:     # data frame for the pathway distribution
656:     # If the pathway is one of the significant ones, the title will be in red. and the categories, if any, we be high...(24 bytes skipped)...
657:     if (pathway %in% names(category)) {
658:         sigCat <- category[[pathway]]
670:     # plot the reference and pathway counts side by side
676: ...(34 bytes skipped)... plot of the two densities (one for each group) of the statistics (sd, mad, cv or mean) of a chosen pathway. This function is made for output from pathVarTwoSamplesCont.
682: #Input 1: pvalue_results is result from the pathVarTwoSamplesCont function
683: #Input 2: pathway is the chosen pathway you want to plot.
687: #If sig is not NULL, the function will check if the pathway is a significant one and if yes the title will be printed in red.
690: plotTwoSamplesCont <- function(pvalue_results, pathway, sig) {
691:     mp <- pathway
692:     # If the name of the pathway is two long it will cut it into two lines in the plot.
705:     # If the number of genes of the pathway is less than 3, it is not possible to draw a density and it will return an empty plot with this ...(8 bytes skipped)...
706:     if (xtab[PwayName == pathway, NumOfGenesFromDataSetInPathway] < 3) {
717:         genes <- pvalue_results@genesInPway[[pathway]]
726: ...(0 bytes skipped)...        # Plot of the two densities (one for each group) of the variability of the genes inside the pathway.
736:         # If we included the results of sigTwoSamplesCont, it will verify if the pathway is one of them and if yes the title will be printed in red.
737:         if (pathway %in% significant) {
752: ##It is a function that returns 2 plots of the 2 samples for a chosen pathway. This function is made for output from pathVarTwoSamplesDisc.
755: # plot of the 2 samples for a significant pathway
758: #Input 1: pvalue_results is result from the pathVarTwoSamplesDisc function
759: #Input 2: pathway is the chosen pathway you want to plot.
763: #If sig is not NULL, the function will check if the pathway is a significant one and if yes the title will be printed in red.
766: plotTwoSamplesDisc <- function(pvalue_results, pathway, sig) {
767:     mp <- pathway
768:     # If the name of the pathway is two long it will cut it into two lines in the plot.
791:     # data frame for the pathway distribution
803:     # If the pathway is one of the significant ones, the title will be in red. and the categories, if any, we be high...(24 bytes skipped)...
804:     if (pathway %in% names(category)) {
805:         sigCat <- category[[pathway]]
819:         plotPathway1 <- plotPath1 + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), 
821:         plotPathway2 <- plotPath2 + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), 
824:     # plot the reference and pathway counts side by side
854:     colnames(pathDat1) <- c("Cluster", "Number_of_genes")
856:     colnames(pathDat2) <- c("Cluster", "Number_of_genes")
862:     results <- apply(rbind(pathDat2[,2],pathDat1[,2]/pathDat1[,2]/sum(pathDat1[,2])), 2, function(y) multinomial.test(c(y[1], sum(pathDat2[,2]) - y[1]), prob = c(y[2],1 - y[2]))$p.value)
874:         plotPathDat1 <- plotPathDat1 + annotate("text", x = category, y = pathDat1[category +
876:         plotPathDat2 <- plotPathDat2 + annotate("text", x = category, y = pathDat2[category +
895: ...(46 bytes skipped)...rom the one sample or two samples cases and then use plotOneSample or plotTwoSamples for the chosen pathway.
898: # plot of the results of the one or two samples case for a chosen pathway.
901: #Input 1: pvalue_results is the result from the pathVarOneSample, pathVarTwoSamplesCont, or pathVarTwoSamplesDisc function
902: #Input 2: pathway is the chosen pathway you want to plot.
906: #If sig is not NULL, the function will check if the pathway is a significant one. And they will be highlighted in the resulting plot (see plotOneSample or p...(14 bytes skipped)...
909: plotPway <- function(pvalue_results, pathway, sig = NULL) {
912:         plotOneSample(pvalue_results, pathway, sig)
914:         plotTwoSamplesCont(pvalue_results, pathway, sig)
916:         plotTwoSamplesDisc(pvalue_results, pathway, sig)
923: #Save as a pdf the plots for the one or two samples case of the significant pathway or a chosen list of pathway..
926: # Save as a pdf the plots of the significant pathway or a chosen list of pathway.
929: #Input 1: pvalue_results is the result from the pathVarOneSample, pathVarTwoSamplesCont, or pathVarTwoSamplesDisc function
931: #Input 3: listPath is "significant" if you want to save the plots of the significant pathways or can be a list of names of pathway of interest.
934: #If sig is not NULL, the function will check if the pathway is a significant one. And they will be highlighted in the resulting plot (see plotOneSample or p...(14 bytes skipped)...
937: saveAsPDF <- function(pvalue_results, sig, listPath = "significant") {
938:     # If listPath='significant' we will save as pdf all the plots corresponding to the significant pathway from sig. Other wise it will save the pathways given to listPath.
939:     if (listPath[1] == "significant") {
940:         listPath <- names(sig@genesInSigPways1)
942:     # The name of the file will be the pathname where we replace '/' by '_'
948:     # save as PDF all the pathways significant or given in listPath
949:     for (i in 1:length(pathname)) {
950:         pdf(file = paste(pathname[i], ".pdf", sep = ""), width = 10, height = 7)
951:         plotPway(pvalue_results, listPath[i], sig)
959: #It is a function that returns one list of genes for group 1 and one for group 2 of a chosen pathway having their statistics (sd, mad, cv or mean) inside a chosen interval.
962: # Output 1: genes1 contains the genes belonging to the pathway in the given window for group 1.
963: # Output 2: genes2 contains the genes belonging to the pathway in the given window for group 2.
964: # Output 3: genesAll contains the genes from the dataset belonging to the pathway
967: #Input 1: pvalue_results is result from the pathVarTwoSamplesCont function
968: #Input 2: pathway is the chosen pathway.
973: getGenes <- function(pvalue_results, pathway, window) {
978:     genes <- olap.pways[[pathway]]
981:     # Take the genes from group 1 from the pathway belonging to the window
983:     # Take the genes from group 3 from the pathway belonging to the window
985:     # Take all the genes from the pathway
431:         sig <- new("significantPathway", genesInSigPways1=list(), sigCatPerPway=list(), thresPValue=numeric())
471:     sig <- new("significantPathway", genesInSigPways1=genes, sigCatPerPway=category, thresPValue=pvalue)
494:         sig <- new("significantPathway2", genesInSigPways1=list(), thresPValue=numeric())
501:     sig <- new("significantPathway2", genesInSigPways1=genes, thresPValue=pvalue)
528:         sig <- new("significantPathway3", genesInSigPways1=list(), genesInSigPways2=list(), sigCatPerPway=list(), thresPValue=numeric()...(1 bytes skipped)...
570:     sig <- new("significantPathway3", genesInSigPways1=genes1, genesInSigPways2=genes2, sigCatPerPway=category, thresPValue=pvalue)...(0 bytes skipped)...
667:         plotPathway <- d + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), 
671:     grid.arrange(arrangeGrob(plotRef, plotPathway, nrow = 1))
742:             plotPathway <- d + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), 
746:     plot(plotPathway)
825:     grid.arrange(arrangeGrob(plotPathway1, plotPathway2, nrow = 1))
879:         plotPathDat1 <- plotPathDat1 + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background...(63 bytes skipped)...
880:         plotPathDat2 <- plotPathDat2 + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background...(63 bytes skipped)...
884:         grid.arrange(arrangeGrob(plotPathDat1, plotPathDat2, nrow = 1))
887:         grid.arrange(arrangeGrob(plotPathDat1, plotPathDat2, nrow = 1))
dir.expiry:R/clearDirectories.R: [ ]
99:     path <- file.path(dir, version)
111:     acc.path <- file.path(dir, expfile)
5: #' @param dir String containing the path to a package cache containing any number of versioned directories.
16: #' If the last access date is too old, the corresponding subdirectory in \code{path} is treated as expired and is deleted.
40: #' version.dir <- file.path(cache.dir, version)
70:     plock <- .plock_path(dir)
100:     vlock <- .vlock_path(path)
112:     last.used <- as.integer(read.dcf(acc.path)[,"AccessDate"])
116:         unlink(acc.path, force=TRUE)
117:         unlink(paste0(acc.path, lock.suffix), force=TRUE)
118:         unlink(path, recursive=TRUE, force=TRUE)
MOGAMUN:R/MOGAMUN_FUN.R: [ ]
1232:     for (Path in Dirs) {
1233:         PathForPlots <- ExperimentsPath <- paste0(Path, "/") # path for plots
1659:     GeneralPath <- ExperimentDir
1666:         ExpPath <- paste0(GeneralPath, "/", d, "/")
1289:     # get all files in the path that match the pattern
1763: #         ExperimentsPath - path to the results
1234:         Population <- GetIndividualsAllRuns(ExperimentsPath) # get results
1249:             SimilarityBetweenRunsBoxplot(PathForPlots, Nodes1stRank_AllRuns)
1253:         AccPF <- ObtainAccParetoFront(PathForPlots, Inds1stRank_AllRuns, 
1258:         FilterNetworks(ExperimentsPath, LoadedData, AccPF) 
1265:         SaveFilteredAccPF(DiversePopulation, ExperimentsPath, Threshold) 
1278: # INPUT:  ExperimentsPath - folder containing the results to be processed 
1280: GetIndividualsAllRuns <- function(ExperimentsPath) {
1290:     ResFiles <- list.files(ExperimentsPath, pattern = PatResFiles)
1295:         con <- base::file(paste0(ExperimentsPath, ResFiles[counter]), open="r")
1328: # INPUTS: PathForPlots - folder to save the plot
1331: SimilarityBetweenRunsBoxplot <- function(PathForPlots, Nodes1stRank_AllRuns) {
1362:     svg(paste0(PathForPlots, "A_Boxplot_similarities_between_runs.svg"))
1372: # INPUTS: PathForPlots - folder to save the plot
1378: ObtainAccParetoFront <- function(PathForPlots, Inds1stRank_AllRuns, 
1389:         svg(paste0(PathForPlots, "A_ScatterPlot_AccPF_ALL_INDS.svg"))
1397:         svg(paste0(PathForPlots, "A_ScatterPlot_AccPF_LEGEND_ALL_INDS.svg"))
1409:     svg(paste0(PathForPlots, "A_ScatterPlot_AccPF.svg"))
1466: # INPUTS: ExperimentsPath - folder to save the filtered networks
1471: FilterNetworks <- function(ExperimentsPath, LoadedData, AccPF) {
1495:         write.table(MyFilteredNetwork, file = paste0(ExperimentsPath, 
1501:     myDataFiles <- list.files(ExperimentsPath, pattern = '_FILTERED.csv')
1508:         data <- read.table(paste0(ExperimentsPath, myDataFiles[i]), 
1516:     write.table(myFullListOfInteractions, file = paste0(ExperimentsPath, 
1614: #         ExperimentsPath - folder to save the filtered networks
1617: SaveFilteredAccPF <- function(DiversePopulation, ExperimentsPath, Threshold) {
1621:         write(paste(Ind, collapse=" ", sep=""), file = paste0(ExperimentsPath, 
1643:     write.csv(AllNodesDF_Acc, paste0(ExperimentsPath, 
1662:     Dirs <- list.dirs(GeneralPath, recursive = FALSE, full.names = FALSE)
1669:         Network <- read.csv( paste0(ExpPath, 
1698:         CreateActiveModules(d, ExpPath)
1703:                 filename = paste0(ExpPath, "A_Acc_PF_", d))
1704:         } else { saveSession(filename = paste0(ExpPath, "A_Acc_PF_", d)) }
1765: CreateActiveModules <- function(d, ExperimentsPath) {
1772:         read.csv(paste0(ExperimentsPath, list.files(ExperimentsPath,
1799: MogamunBody <- function(RunNumber, LoadedData, BestIndsPath) {
1800:     BestIndsFile <- paste0(BestIndsPath, "_Run_", RunNumber, ".txt")
1829:         file = paste0(BestIndsPath,"StatisticsPerGeneration_Run", RunNumber, 
ribor:R/helper_functions.R: [ ]
163:     path  <- path(ribo.object)
66:     ribo.path <- ribo
11: #' file.path <- system.file("extdata", "HEK293_ingolia.ribo", package = "ribor")
12: #' sample <- Ribo(file.path)
18:     return(h5read(path(ribo.object),
25:     row.names <- h5read(path(ribo.object),
27:     lengths   <- h5read(path(ribo.object),
50: #' @param ribo a path to the ribo file or a 'Ribo' object
58: #' file.path <- system.file("extdata", "HEK293_ingolia.ribo", package = "ribor")
59: #' sample <- Ribo(file.path, rename = rename_default)
65:     #ensure that the ribo path is retrieved
68:         ribo.path <- path(ribo)
73:     original <- h5read(ribo.path, 
113: get_content_info <- function(ribo.path) {
114:     file_info     <- h5ls(ribo.path, recursive = TRUE, all = FALSE)
126:     ls <- h5ls(ribo.path)
135:         attribute      <- h5readAttributes(ribo.path, name)
164:     attribute <- h5readAttributes(path, "/")
264:                             path,
267:     experiment <- strsplit(path, split="/")[[1]][3]
268:     output <- t(h5read(file=file, index=index, name=path))
snapcount:R/basic_query_functions.R: [ ]
273:     path <- paste(compilation, paste0(endpoint, "?"), sep = "/")
319:     paste0(pkg_globals$snaptron_host, path, paste(query, collapse = "&"))
TEQC:R/multiTEQCreport.R: [ ]
42:   Path <- getwd()
44:   print(paste("results and report are saved in folder", Path))
47:   imgDir <- file.path(destDir, "image")
82:   write.table(speci, file=file.path(destDir, "fractionReadsOnTarget.txt"), sep="\t", quote=FALSE)
86:   write.table(targcov, file=file.path(destDir, "targetCoverageStats.txt"), sep="\t", quote=FALSE)
100:   write.table(sensi, file=file.path(destDir, "sensitivity.txt"), sep="\t", row.names=FALSE, quote=FALSE)
103:   write.table(perTargCov, file=file.path(destDir, "targetCoverage.txt"), sep="\t", quote=FALSE)
136:   htmlFile <- file.path(destDir, "index.html")
150:   file.copy(cssFile, file.path(destDir, names(cssFile)))
151:   file.copy(system.file("template", "image", biocFile, package="TEQC"), file.path(destDir, "image", biocFile))
167:     imgDir <- file.path(dir, "image")
170:     jpeg(file.path(imgDir, figFile), ...)
172:     png(file.path(imgDir, figFile), ...)
174:     tiff(file.path(imgDir, figFile), ...)
178:     pdf(file.path(imgDir, pdfFile), ...)
183:     hwriteImage(file.path(".", "image", figFile), link=file.path(".", "image", pdfFile))
207:     imgDir <- file.path(dir, "image")
210:     jpeg(file.path(imgDir, figFile), ...)
212:     png(file.path(imgDir, figFile), ...)
214:     tiff(file.path(imgDir, figFile), ...)
218:     pdf(file.path(imgDir, pdfFile), ...)
223:     hwriteImage(file.path(".", "image", figFile), link=file.path(".", "image", pdfFile))
246:     imgDir <- file.path(dir, "image")
249:     jpeg(file.path(imgDir, figFile), ...)
251:     png(file.path(imgDir, figFile), ...)
253:     tiff(file.path(imgDir, figFile), ...)
257:     pdf(file.path(imgDir, pdfFile), ...)
262:     hwriteImage(file.path(".", "image", figFile), link=file.path(".", "image", pdfFile))
289:     imgDir <- file.path(dir, "image")
292:     jpeg(file.path(imgDir, figFile), width=1000, ...)
294:     png(file.path(imgDir, figFile), width=1000, ...)
296:     tiff(file.path(imgDir, figFile),width=1000, ...)
300:     pdf(file.path(imgDir, pdfFile), width=14, ...)
305:     hwriteImage(file.path(".", "image", figFile), link=file.path(".", "image", pdfFile))
335:     imgDir <- file.path(dir, "image")
338:     jpeg(file.path(imgDir, figFile), width=800, height=800, ...)
340:     png(file.path(imgDir, figFile), width=800, height=800, ...)
342:     tiff(file.path(imgDir, figFile), width=800, height=800, ...)
346:     pdf(file.path(imgDir, pdfFile), width=12, height=12, ...)
351:     hwriteImage(file.path(".", "image", figFile), link=file.path(".", "image", pdfFile))
TrajectoryGeometry:R/TrajectoryGeometry.R: [ ]
796:         path = samplePath(attributes, pseudotime, nWindows = nWindows)
302: pathToSphericalData = function(path,from,to,d,statistic)
431:             randomPath = path
492:         randomPath = matrix(0,nrow=n,ncol=d)
628: pathProgression = function(path,from=1,to=nrow(path),d=ncol(path),
670: samplePath = function(attributes, pseudotime, nWindows = 10){
678:     pathLength = end - start
681:     sampledPath = matrix(, nrow = 0, ncol = ncol(attributes))
1135:     pathLineWidth = 3
45: testPathForDirectionality = function(path,from=1,to=nrow(path),d=ncol(path),
61:     randomPaths = generateRandomPaths(path,
106: projectPathToSphere = function(path,from=1,to=nrow(path),d=ncol(path))
374: generateRandomPaths = function(path,from=1,to=nrow(path),d=ncol(path),
421:     randomPathList = list()
475: generateRandomPathsBySteps = function(path,randomizationParams,N)
489:     randomPathList = list()
564: getDistanceDataForPaths = function(paths,statistic)
1114: plotPathProjectionCenterAndCircle = function(path,
7: #' Test a path for directionality
9: #' This is the core function of this package.  It takes a path, and a
11: #' for the directionality of that path.
13: #' @param path - An n x m matrix representing a series of n points in
15: #' @param from - The starting place along the path which will be
17: #' @param to - The end point of the path.  This defaults to
18: #'     nrow(path).
20: #'     ncol(path)
25: #'     comparison to the given path.
27: #'   pValue - the p-value for the path and statistic in question;
28: #'   sphericalData - a list containing the projections of the path to
39: #' p = testPathForDirectionality(path=straight_path,
42: #' q = testPathForDirectionality(path=crooked_path,from=6,
48:     testPathForDirectionalityTest(path,from,to,d,
53:     path = path[from:to,seq_len(d)]
57:     sphericalData = getSphericalData(path,statistic)
86: #' Project a path onto the unit sphere
88: #' This function takes a path in d dimensional space and projects it onto
92: #' @param path - This is an mxn dimensional matrix. Each row is
94: #' @param from - The starting place along the path which will be
96: #' @param to - The end point of the path.  This defaults to
97: #'     nrow(path).
99: #'     ncol(path)
100: #' @return This returns a projection of the path onto the d-1 sphere
104: #' projection1 = projectPathToSphere(straight_path)
105: #' projection2 = projectPathToSphere(crooked_path,from=6)
108:     projectPathToSphereTest(path,from,to,d)
112:     path = path[from:to,seq_len(d)]
113:     n = nrow(path)
121:         v = path[i,] - path[1,]
150: #' projection = projectPathToSphere(straight_path)
221: #' distances = findSphericalDistance(straight_path_center,
222: #'     straight_path_projection)
253: #' given by the dimensions of the path
255: #' @param path - an m x n matrix.  Each row is considered a point
258: #'     projections of the path to the sphere, the center for those
263: #' sphericalData = getSphericalData(straight_path,'max')
264: getSphericalData = function(path,statistic)
266:     getSphericalDataTest(path,statistic)
269:     to = nrow(path)
270:     d = ncol(path)
272:     return(pathToSphericalData(path,from,to,d,statistic))
277: #' Find the spherical data for a given path
279: #' This function takes a path and returns a list containing
284: #' @param path - This is an mxn dimensional matrix. Each row is
286: #' @param from - The starting place along the path which will be
288: #' @param to - The end point of the path.  This defaults to
289: #'     nrow(path).
291: #'     ncol(path)
294: #'     projections of the path to the sphere, the center for those
299: #' sphericalData = pathToSphericalData(straight_path,from=1,
300: #'                                     to=nrow(straight_path), d=3,
304:     pathToSphericalDataTest(path,from,to,d,statistic)
309:     path = path[from:to,seq_len(d)]
310:     n = nrow(path)
313:     ## Get the projections of the path to the sphere
314:     projections = projectPathToSphere(path)
345: #' Produce random paths modeled on a given path
347: #' This function takes a path and produces N random paths of the same
349: #' permuting the entries in path or by taking steps from the initial
350: #' point of path.  Exact behaviour is controlled by
353: #' @param path - This is an mxn dimensional matrix. Each row is
355: #' @param from - The starting place along the path which will be
357: #' @param to - The end point of the path.  This defaults to
358: #'     nrow(path).
360: #'     ncol(path)
366: #' @return This function returns a list of random paths.  Each path is
371: #' randomPaths = generateRandomPaths(crooked_path,from=6,to=nrow(crooked_path),
372: #'               d=ncol(crooked_path),randomizationParams=randomizationParams,
377:     generateRandomPathsTest(path,from,to,d,randomizationParams,N)
388:     path = path[from:to,seq_len(d)]
391:         return(generateRandomPathsByPermutation(path,
396:         return(generateRandomPathsBySteps(path,
407: ## ' This function produces randomized paths from a given path via
413: ## ' @param path - An n x d matrix.
419:     function(path,randomizationParams,N)
422:     n = nrow(path)
423:     d = ncol(path)
447:         a = as.numeric(path)
450:             b = as.numeric(path)
463: ## ' This function produces randomized paths from a given path by taking
465: ## ' have the same Euclidean length as those of the original path or
467: ## ' requiring the path to stay in the non-negative orthant or allowing
470: ## ' @param path - An n x d matrix.
477:     n = nrow(path)
478:     d = ncol(path)
484:         stepLengths = getStepLengths(path)
493:         randomPath[1,] = path[1,]
515: #' This finds the lengths of the steps along a path
517: #' @param path - This is an mxn dimensional matrix. Each row is
519: #' @param from - The starting place along the path which will be
521: #' @param to - The end point of the path.  This defaults to
522: #'     nrow(path).
524: #'     ncol(path)
525: #' @return This function returns the length of each step in a path.
528: #' stepLengths = getStepLengths(path=crooked_path)
529: #' stepLengths = getStepLengths(path=crooked_path,from=4)
530: getStepLengths = function(path,from=1,to=nrow(path),d=ncol(path))
532:     getStepLengthsTest(path,from,to,d)
536:     path = path[from:to,seq_len(d)]
537:     n = nrow(path)
541:         stepLengths[i] = Norm(path[i+1,] - path[i,])
551: #' for the appropriate center for each path.  Each path
562: #'     generateRandomPaths(path=straight_path,randomizationParam='bySteps',N=5)
604: #' Measure a path's progression
606: #' This function measures the progress of a path in a specified
611: #' @param path - An n x d matrix
612: #' @param from - The point along the path to be taken as the starting
614: #' @param to - The point along the path to be used as the end point.
615: #'     This defaults to nrow(path).
616: #' @param d - The dimension to be used.  This defaults to ncol(path).
620: #'     of the path along the line through its starting point in the
625: #'     pathProgression(straight_path,direction=straight_path_center)
627: #'     pathProgression(crooked_path,from=6,direction=crooked_path_center)
631:     pathProgressionTest(path,from,to,d,direction)
633:     path = path[from:to,seq_len(d)]
635:     distance = numeric(nrow(path)-1)
636:     for(i in 2:nrow(path))
638:         delta = path[i,] - path[1,]
646: #' Sample a path from single cell data
652: #' coordinates of the sampled path. The matrix of attribute values should
657: #' the sampled path give the window number a cell was sampled from.
664: #' @return sampledPath - A path consisting of a matrix of attributes of sampled
675:     ## Set parameters for path.
726: #' and comparing each path to random paths.
731: #' The function returns a list of Answers for each comparison of a sampled path
732: #' to a random path.
746: #'     comparison to the given path (defaults to 1000).
748: #'   information comparing a sampled path to random paths.
750: #'   pValue - the p-value for the path and statistic in question;
751: #'   sphericalData - a list containing the projections of the path to
797:         answers[[i]] = testPathForDirectionality(path, randomizationParams =
835: #'     comparison to the given path (defaults to 1000).
839: #'    entry for each sampled path.
841: #'    sampled path in question
843: #'    pValue - the p-value for the path and statistic in question;
844: #'    sphericalData - a list containing the projections of the path to
1070: #' Plot a path, its projection, its center and its circle
1072: #' This function assumes you have a path in dimension 3 and you have
1075: #' appropriate statistic.  Scales the path to keep it comparable to
1079: #' @param path - A path of dimension 3 in the form of an N x 3 matrix.
1083: #' @param to - Likewise.  It defaults to nrow(path).
1085: #'     path.
1088: #' @param color - The color to use for this path and its associated
1093: #'     path. Defaults to 8.
1095: #'     projected path. Defaults to 8.
1096: #' @param scale - The path will be start (its actual start) at 0 and
1108: #' plotPathProjectionCenterAndCircle(path=straight_path,
1109: #'                                  projection=straight_path_projection,
1110: #'                                  center=straight_path_center,
1111: #'                                  radius=straight_path_radius,
1116:                                             to=nrow(path),
1127:     plotPathProjectionCenterAndCircleTest(path,from,to,projection,
1143:     ## Translate the path to begin at the origin and scale:
1144:     N = nrow(path)
1146:     offset = path[1,]
1149:         path[i,] = path[i,] - offset
1150:         distances[i] = Norm(path[i,])
1152:     path = (scale / max(distances)) * path
1163:     ## Plot the path and mark the relevant portion:
1164:     points3d(path,size=pathPointSize,color=color)
1165:     lines3d(path,lwd=pathLineWidth,color=color)
1167:     points3d(path[from:to,],size=pathPointSize+relevantPortionPointHump,
1169:     lines3d(path[from:to,],lwd=pathLineWidth+relevantPortionLineHump,
4: ## Code for testing directionality in paths:
23: #'     control the production of randomized paths for comparison.
24: #' @param N - The number of random paths to generated for statistical
32: #'     paths;
60:     ## Generate random paths:
66:     ## Compute the distance statistics for random paths:
250: #' This is a simplified wrapper for pathToSphericalData
365: #' @param N - The number of random paths required.
404: ## ' Produce randomized paths by permutation
416: ## ' @param N - The number of paths required.
417: ## ' @return This function returns a list of random paths.
435:                 randomPath[,j] = randomPath[perm,j]
437:             randomPathList[[i]] = randomPath
460: ## ' Produce randomized paths by steps
473: ## ' @param N - The number of paths required.
474: ## ' @return This function returns a list of random paths.
488:     ## Generate the random paths:
496:             randomPath[j+1,] = randomPath[j,] +
501:             idx = randomPath < 0
502:             randomPath[idx] = - randomPath[idx]
505:         randomPathList[[i]] = randomPath
547: #' Produce distance statistics for random paths
549: #' This function takes a list of paths and a choice of
553: #' will be the randomized paths.  It is therefore assumed
556: #' @param paths - A list of paths.  Each of these is an n x d matrix.
561: #' paths =
563: #' distance = getDistanceDataForPaths(paths=paths,statistic='max')
566:     getDistanceDataForPathsTest(paths,statistic)
568:     n = nrow(paths[[1]])
569:     N = length(paths)
573:     ## Iterate over paths:
576:         sphericalData = getSphericalData(paths[[i]],statistic)
668: #' samplePath(chol_attributes, chol_pseudo_time_normalised)
669: #' samplePath(hep_attributes, hep_pseudo_time_normalised)
679:     windowSize = pathLength/nWindows
710:     sampledPath = rbind(sampledPath, chosenAttributes)
717:     rownames(sampledPath) = windowNumber
718:     return(sampledPath)
725: #' This function analyses a single cell trajectory by sampling multiple paths
738: #'     control the production of randomized paths for comparison.
740: #' @param nSamples - The number of sampled paths to generate (default 1000).
745: #' @param N - The number of random paths to generated for statistical
755: #'     paths;
794:     ## Sample paths and test each one for directionality
800:             print(paste(i, "sampled paths analysed"))
818: #'     control the production of randomized paths for comparison.
829: #' @param nSamples - The number of sampled paths to generate (defaults to 1000).
834: #' @param N - The number of random paths to generated for statistical
842: #'    to random paths. The entries consist of:
848: #'     paths;
967: ## Code for plotting paths and their spherical data:
1077: #' called repeatedly to add additional paths in different colors.
1092: #' @param pathPointSize - Sets the size of points which represent the
1100: #'     here when plotting multiple paths.
1104: #'     additional paths to the same figure.
1122:                                             pathPointSize = 8,
1129:                                         pathPointSize,projectionPointSize,
1194: #' metrics for sampled paths to random paths. It can also create plots for
1195: #' comparing two sets of sampled paths by providing the traj2Data argument.
1205: #'  stats - output of wilcox test (paired if comparing sampled to random paths,
1206: #'  unpaired if comparing sampled paths for two different trajectories)
1270:     ## Code for comparing sampled pathways to random pathways
1286:         ## Use paired wilcox test to compare values sampled and random pathways,
1287:         ## as random trajectories are parametised based on the sampled pathways
1317: #'     paths for different trajectory different starting points
1319: #'    comparing sampled paths to random paths for different trajectory starting
67:     distances = getDistanceDataForPaths(randomPaths,statistic)
418: generateRandomPathsByPermutation =
439:         return(randomPathList)
453:             randomPathList[[i]] = matrix(b,nrow=n)
455:         return(randomPathList)
508:     return(randomPathList)
672:     samplePathTest(attributes, pseudotime, nWindows)
biodb:R/BiodbConn.R: [ ]
713:     path <- cch$getFilePath(self$getCacheId(), name='download', ext=ext)
147: #' Get the path to the persistent cache file.
706: #' Gets the path where the downloaded content is written.
707: #' @return The path where the downloaded database is written.
715:     logDebug0('Download path of ', self$getId(), ' is "', path, '".')
717:     return(path)
722: #' @param src Path to the downloaded file.
151: #' containing the paths to the cache files corresponding to the requested
156:     fp <- c$getFilePath(self$getCacheId(), entry.id, self$getEntryFileExt())
708: getDownloadPath=function() {
772:         if ( ! file.exists(self$getDownloadPath()))
774:                 self$getDownloadPath())
BiocFileCache:R/BiocFileCache-class.R: [ ]
495:     path <- .sql_get_rpath(x, rids)
531:     update_time_and_path <- function(x, i) {
402:     rpath <- .sql_add_resource(x, rname, rtype, fpath, ext)
985:         fpath <- .sql_get_fpath(x, rid)
1169:     paths <- .sql_get_rpath(x, bfcrid(x))
1296:             newpath <- file.path(dir, basename(orig))
1369:     exportPath <- file.path(exdir, "BiocFileCacheExport")
1115:     rpaths <- .sql_get_rpath(x, rids)
1417:     rpaths <- .sql_get_rpath(x, rids)
35: #'   \item{'cache': }{character(1) on-disk location (directory path) of the
54: #'   \item{'rpath': }{resource path. This is the path to the local
75: #' @param cache character(1) On-disk location (directory path) of
101:                  "  Problematic cache: ", path.expand(olddefault),"\n",
116:             cache <- file.path(tempdir(), "BiocFileCache")
224: #' @describeIn BiocFileCache Get a file path for select resources from
239: #' @describeIn BiocFileCache Set the file path of selected resources
241: #' @param value character(1) Replacement file path.
282: #' @return For 'bfcnew': named character(1), the path to save your
286: #' path <- bfcnew(bfc0, "NewResource")
287: #' path
328: #' @param fpath For bfcadd(), character(1) path to current file
330: #'     assumed to also be the path location. For bfcupdate()
333: #'     if the resource is a local file, a relative path in the cache,
336: #'     relative or web paths, based on the path prefix.
340: #'     in current location but save the path in the cache. If 'rtype
356: #' @return For 'bfcadd': named character(1), the path to save your
482: #' @return For 'bfcpath': the file path location to load
496:     path
515: #'     in the cache the path is returned, if it is not it will try to
520: #' @return For 'bfcrpath': The local file path location to load.
549:             names(update_time_and_path(x, res))
576:         update_time_and_path(x, rids)
657:                     "Setting a new remote path results in immediate\n",
1053: #' @return For 'bfcdownload': character(1) path to downloaded resource
1168:     files <- file.path(bfccache(x), setdiff(dir(bfccache(x)),c(.CACHE_FILE, .CACHE_FILE_LOCK)))
1237: #' @return character(1) The outputFile path.
1259:     dir <- file.path(tempdir(), "BiocFileCacheExport")
1300:                 newpath <- file.path(dir, filename)
1327:         outputFile = file.path(origdir, outputFile)
1337:     .util_unlink(file.path(dir, .CACHE_FILE_LOCK))
58: #'   \item{'fpath': }{If rtype is "web", this is the link to the
228: #' @return For '[[': named character(1) rpath for the given resource
236:     .sql_get_rpath(x, i)
251:     .sql_set_rpath(x, i, value)
254:         warning("updating rpath, changing rtype to 'local'")
305:         x, rname, fpath = rname, rtype=c("auto", "relative", "local", "web"),
317:         x, rname, fpath = rname, rtype=c("auto", "relative", "local", "web"),
322:     bfcadd(x=BiocFileCache(), rname=rname, fpath=fpath, rtype=rtype,
338: #'     \code{copy} of \code{fpath} in the cache directory; \code{move}
375: #' bfcadd(bfc0, "TestWeb", fpath=url)
380:         x, rname, fpath = rname,
388:         is.character(fpath), length(fpath) > 0L, !any(is.na(fpath))
394:     stopifnot((length(action) == 1) || (length(action) == length(fpath)))
395:     stopifnot((length(rtype) == 1) || (length(rtype) == length(fpath)))
396:     if (length(action) == 1) action = rep(action, length(fpath))
397:     if (length(rtype) == 1) rtype = rep(rtype, length(fpath))
399:     rtype <- .util_standardize_rtype(rtype, fpath, action)
400:     stopifnot(all(rtype == "web" | file.exists(fpath)))
403:     rid <- names(rpath)
405:     for(i in seq_along(rpath)){
409:                 copy = file.copy(fpath[i], rpath[i]),
410:                 move = file.rename(fpath[i], rpath[i]),
412:                     .sql_set_rpath(x, rid[i], fpath[i])
413:                     rpath[i] <- bfcrpath(x, rids = rid[i])
421:     rpath
455:     tbl <- mutate(tbl, rpath = unname(bfcrpath(x, rids=rids)))
467: setGeneric("bfcpath",
468:     function(x, rids) standardGeneric("bfcpath"),
473: #' @aliases bfcpath,missing-method
474: #' @exportMethod bfcpath
475: setMethod("bfcpath", "missing",
478:     bfcpath(x=BiocFileCache(), rids=rids)
484: #' bfcpath(bfc0, rid3)
485: #' @aliases bfcpath
486: #' @exportMethod bfcpath
487: setMethod("bfcpath", "BiocFileCacheBase",
500: setGeneric("bfcrpath",
501:     function(x, rnames, ..., rids, exact = TRUE) standardGeneric("bfcrpath"),
506: #' @aliases bfcrpath,missing-method
507: #' @exportMethod bfcrpath
508: setMethod("bfcrpath", "missing",
511:     bfcrpath(x=BiocFileCache(), rnames=rnames, ..., rids=rids, exact=exact)
514: #' @describeIn BiocFileCache display rpath of resource. If 'rnames' is
522: #' bfcrpath(bfc0, rids = rid3)
523: #' @aliases bfcrpath
524: #' @exportMethod bfcrpath
525: setMethod("bfcrpath", "BiocFileCacheBase",
532:         .sql_get_rpath(x, i)
573:         bfcrpath(x, rids = rids0)
596: #' @param rpath character() vector of replacement rpaths.
600: #' bfcupdate(bfc0, rid3, rpath=fl3, rname="NewRname")
602: #' bfcupdate(bfc0, "BFC5", fpath="http://google.com")
606:     function(x, rids, rname=NULL, rpath=NULL, fpath=NULL,
612:         is.null(rpath) || (length(rids) == length(rpath)),
613:         is.null(fpath) || (length(rids) == length(fpath))
617:         is.null(rpath) || is.character(rpath),
618:         is.null(fpath) || is.character(fpath)
631:         if (!is.null(rpath)) {
632:             if (!file.exists(rpath[i]))
636:                     "\n  rpath: ", sQuote(rpath[i]),
637:                     "\n  reason: rpath does not exist.",
640:             .sql_set_rpath(x, rids[i], rpath[i])
643:                 warning("updating rpath, changing rtype to 'local'")
648:         if (!is.null(fpath)) {
666:                     x, rids[i], proxy, config, "bfcupdate()", fpath[i], ...
668:                 .sql_set_fpath(x, rids[i], fpath[i])
850:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
859:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
872: #'     matches pattern agains rname, rpath, and fpath. If exact
877: #'     \code{bfcrpath}, the default is \code{TRUE} (exact matching).
889:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
962: #'     'rid'. \code{TRUE}: fpath \code{etag} or \code{modified} time of
963: #'     web resource more recent than in BiocFileCache; \code{FALSE}: fpath
988:         cache_info <- .httr_get_cache_info(fpath)
1070:     if (ask && any(file.exists(.sql_get_rpath(x, rid)))) {
1081:     bfcrpath(x, rids=rid)
1170:     # normalizePath on windows
1173:         files = normalizePath(files)
1174:         paths = normalizePath(paths)
1176:     untracked <- setdiff(files, paths)
1231: #' @param outputFile character(1) The <filepath>/basename for the
1295:             orig <- .sql_get_rpath(x, i)
1297:             if (file.exists(newpath)) {
1302:             file.copy(orig, newpath)
1370:     stopifnot(!dir.exists(exportPath))
1380:     bfc = BiocFileCache(exportPath)
348: #'     \code{httr::GET}. For 'bfcrpaths': Additional arguments passed
481: #' @describeIn BiocFileCache display rpaths of resource.
1116:     cached <- startsWith(rpaths, bfccache(x))
1119:     status <- .util_unlink(rpaths[cached])
1418:     cached <- startsWith(rpaths, bfccache(x))
1421:         txt0 <- paste("file ", sQuote(rpaths))
1430:     .util_unlink(rpaths[cached])
mdp:R/mdp.R: [ ]
71:         path = directory
497:         path = directory
193:             pathway_results <- pathway_summary(sample_results,
705: pathway_summary <- function(sample_results, path, file_name,
720:     pathway_scores <- data.frame(Geneset = names(sample_results),
726:     top_pathway <- pathway_scores[1:3, "Geneset"]
76:         path = "."
178:                     directory = path,
186:                     directory = path,
194:                                                 path, file_name,
205:                     file = file.path(path, paste0(file_name, "zscore.tsv")),
208:                     file = file.path(path, paste0(file_name, "gene_scores.tsv")),
211:                     file = file.path(path, paste0(file_name, "sample_scores.tsv")),
503:         path = "."
628:         grDevices::pdf(file.path(path, sample_name))
699: #' @param path directory to save images
734:                 directory = path, title = top_pathway,
15: #' @param pathways (optional) \code{list} whose names are pathways and elements are
16: #' genes in the pathway. see details section for more information
41: #' \item Pathways - if genesets are provided, they are ranked according to the
48: #' # run with pathways
49: #' pathway_file <- system.file('extdata', 'ReactomePathways.gmt',
51: #' mypathway <- fgsea::gmtPathways(pathway_file) # load a gmt file
53: #' pathways=mypathway)
56: #' @section Loading pathways:
57: #' a \code{list} of pathways can be loaded from a .gmt file using the
63: mdp <- function(data, pdata, control_lab, directory = "", pathways,
118:     if (!missing(pathways)) {
119:         if (!is.list(pathways)) {
120:             stop("Please provide pathways in a list format (see help for more details")
167:                                             pathways, pdata)
192:         if (!missing(pathways)) {
217:     if (missing(pathways)) {
237:                         pathway_results)
244:                             "pathways")
427: #' Compute sample scores for each pathway
432: #' @param pathways list of pathways
436:                                     test_samples, pathways, pdata) {
443:     if (!missing(pathways)) {
444:         genesets <- c(genesets, pathways)
696: #' print pathways
697: #' generates a summary plot for pathways and sample score plot of best gene set
704: #' for each pathway
723:     pathway_scores <- pathway_scores[order(-pathway_scores$Sig2noise), ]
725:     # find best pathway
727:     top_pathway <- top_pathway[top_pathway != "allgenes" &
728:                                 top_pathway != "perturbedgenes"]
729:     top_pathway <- top_pathway[1]
732:     sample_plot(sample_results[[top_pathway]],
738:     return(pathway_scores)
58: #' \code{fgsea} function using \code{fgsea::gmtPathways('gmt.file.location')}
733:                 filename = paste0(file_name, "bestPathway"),
PoTRA:R/PoTRA_corN.R: [ ]
76:             path<-data.frame(matrix(0,length.intersect,(Num.sample.normal+Num.sample.case)))
56:         graph.path<-igraph.from.graphNEL(g)    
42:     pathwaynames <- c()
40:     length.pathway<-c()
58:         #plot(graph.path, edge.arrow.size=.5, vertex.color="gold", vertex.size=5, 
66:         graph.path<-induced_subgraph(graph.path, as.character(intersect(unlist(nodelist),unlist(genelist_reformatted))))
67:         #plot(graph.path)   
82:                 path[j,]<-mydata[which(genelist_reformatted==a[j]),]  #collect expression data of genes for a specific pathway across normal and tumor samples.
87:             cor.normal <- apply(path[,1:Num.sample.normal], 1, function(x) { apply(path[,1:Num.sample.normal], 1, function(y) { cor.test(x,y)[[3]] })})
103:             cor.case <- apply(path[,(Num.sample.normal+1):(Num.sample.normal+Num.sample.case)], 1, function(x) { apply(path[,(Num.sample.normal+1):(Num.sample.normal+Num.sample.case)], 1, function(y) { cor.test(x,y)[[3]] })...(2 bytes skipped)...
1: #' The PoTRA analysis is based on topological ranks of genes in biological pathways. PoTRA can be used to detect pathways involved in disease. The PoTRA package contains one function for creating the PoTRA results obj...(4 bytes skipped)...
7: #' @param Pathway.database The pathway database, such as KEGG, Reactome, Biocarta and PharmGKB. 
14: ...(29 bytes skipped)...ta=mydata, genelist=genelist, Num.sample.normal=Num.sample.normal, Num.sample.case=Num.sample.case, Pathway.database=Pathway.database, PR.quantile=PR.quantile)
16: #' Pathway.database (options): 
17: #' humanKEGG=pathways('hsapiens','kegg')
18: #' humanReactome=pathways('hsapiens','reactome')
19: #' humanBiocarta=pathways('hsapiens','biocarta')
20: #' humanPharmGKB=pathways('hsapiens','pharmgkb')
22: #' Pathway.database=humanKEGG
23: #' Pathway.database=humanReactome
24: #' Pathway.database=humanBiocarta
25: #' Pathway.database=humanPharmGKB
28: PoTRA.corN <- function(mydata,genelist,Num.sample.normal,Num.sample.case,Pathway.database,PR.quantile) {
44:     #humanPharmGKB <- pathways("hsapiens", "pharmgkb")
45:     #humanBiocarta <- pathways("hsapiens", "biocarta")
46:     #humanKEGG <- pathways("hsapiens", "kegg")
48:     for (x in 1:length(Pathway.database[1:length(Pathway.database)])){
51:         p0 <-Pathway.database[[x]]
52:         pathwaynames[x] <- p0@title
54:         g<-pathwayGraph(p) 
65:         length.pathway[x]<-length.intersect
74:             #collect expression data of genes for a specific pathway across normal and tumor samples.
162:     return(list(Fishertest.p.value=Fishertest,KStest.p.value=kstest,LengthOfPathway=length.path...(62 bytes skipped)...rOfHubGenes.case=TheNumOfHubGene.case,TheNumberOfEdges.normal=E.normal,TheNumberOfEdges.case=E.case,PathwayName=pathwaynames))
ReactomeContentService4R:R/getContent.R: [ ]
13:   path <- "data/discover"
92:   path <- "data/eventsHierarchy"
115:   path <- "data/orthology"
151:   path <- "data/participants"
254:   path <- "data/pathways/low/entity"
324:   path <- "data/person"
364:   path <- "search/facet"
410:   path <- "data/query/enhanced"
452:   path <- "data/schema"
542:   path <- "search/query"
586:   path <- "data/species"
261:   pathways <- .retrieveData(url, as="text")
272:     top.pathways <- foreach(id=pathways$dbId, .export=c(".retrieveData", ".checkStatus"), .combine=dfcomb) %dopar% {
253: getPathways <- function(id, species=NULL, allForms=FALSE, top.level=FALSE) {
332:     authoredPathways <- .retrieveData(ap.url, as="text")
14:   url <- file.path(getOption("base.address"), path, event.id)
61:     url <- file.path(getOption("base.address"), "data/complex", id, 
64:     url <- file.path(getOption("base.address"), "data/complexes", resource, id)
66:     url <- file.path(getOption("base.address"), "data/entity", id, retrieval)
94:   url <- file.path(getOption("base.address"), path, taxon.id)
118:   url <- file.path(getOption("base.address"), path, id, "species", species.id)
154:   url <- file.path(getOption("base.address"), path, event.id) #all participants
162:     url <- file.path(url, "participatingPhysicalEntities")
164:     url <- file.path(url, "referenceEntities")
166:     # in a different path/method - /data/pathway/{id}/containedEvents
167:     url <- file.path(getOption("base.address"), "data/pathway", event.id, "containedEvents")
256:   url <- file.path(getOption("base.address"), path, id)
257:   if (allForms) url <- file.path(url, "allForms")
274:       ancestors.url <- file.path(getOption("base.address"), "data/event", id, "ancestors")
327:     url <- file.path(getOption("base.address"), path, id)
331:     ap.url <- file.path(url, "authoredPathways")
338:       tmp.url <- file.path(getOption("base.address"), path, id, attribute)
371:   url <- file.path(getOption("base.address"), path)
411:   url <- file.path(getOption("base.address"), path, id)
453:   url <- file.path(getOption("base.address"), path, class)
457:   cnt.url <- file.path(url, "count")
484:   if (minimised) url <- file.path(url, "min")
485:   if (reference) url <-file.path(url, "reference")
543:   url <- file.path(getOption("base.address"), paste0(path, "?query=", gsub("\\s", "%20", query)))
589:                 file.path(getOption("base.address"), path, "main"),
590:                 file.path(getOption("base.address"), path, "all"))
75: #' Events (Pathways and Reactions) in Reactome are organized in a hierarchical 
129: #' Data in Reactome are organized in a hierarchical manner - Pathways contain Reactions, 
136: ...(11 bytes skipped)...g{ReferenceEntities}: retrieves the ReferenceEntities for all PhysicalEntities in every constituent Pathway/Reaction
139: #' @param event.id a stable or db id of an Event (pathways and reactions)
168:     msg <- "'Events' are found in the 'hasEvent' attribute of Pathways"
234: #' Pathway related queries
238: #' @param id a stable or db id of a PhysicalEntity or Event present in the pathways
240: #' @param allForms if set to \code{TRUE}, all low level pathways that contain the given PhysicalEntity (not Event) in all forms returned
241: #' @param top.level if set to \code{TRUE}, only top-level pathways returned
242: #' @return a dataframe containing requested pathways
263:   # map to top level pathways
281:     rownames(top.pathways) <- seq(1, nrow(top.pathways))
282:     return(top.pathways)
284:     return(pathways)
330:     # add authored pathways if any
532: #' searchQuery(query="Biological oxidation", species="Mus musculus", types=c("Pathway", "Reaction"))
576: #' either manually curated or computationally inferred pathways
137: #' - \strong{EventsInPathways}: recursively retrieves all the Events contained in any given Event
140: ...(26 bytes skipped)...ipants to be retrieved, including "AllInstances", "PhysicalEntities", "ReferenceEntities", "EventsInPathways"
144: #' getParticipants("R-HSA-69306", "EventsInPathways")
150:                                                   "ReferenceEntities", "EventsInPathways")) {
165:   } else if (retrieval == "EventsInPathways") {
236: #' To get the Events that contain the given PhysicalEntity or Event (i.e. subpathway).
244: #' getPathways("R-HSA-199420", "Homo sapiens")
245: #' @rdname getPathways
277:       ancestors[ancestors$schemaClass == "TopLevelPathway",]
333:     if (length(authoredPathways) != 0) all.info[["authoredPathways"]] <- authoredPathways
SPIA:R/spia.R: [ ]
111:     path<-names(datp)[i]
62:   path.names<-NULL
51:   datpT=.myDataEnv[["path.info"]]
79:     path.names<-c(path.names,datpT[[jj]]$title)
84:   names(path.names)<-names(datpT)
86:   tor<-lapply(datp,function(d){sum(abs(d))})==0 | hasR | is.na(path.names)
88:   path.names<-path.names[!tor]
112:     M<-datp[[path]]
203:       cat(paste("Done pathway ",i," : ",substr(path.names[names(datp)[i]],1,30),"..",sep=""))
215:   Name=path.names[names(datp)]
1: spia<-function(de=NULL,all=NULL,organism="hsa",data.dir=NULL,pathids=NULL,nB=2000,plots=FALSE,verbose=TRUE,beta=NULL,combine="fisher"){
33:       cat("The KEGG pathway data for your organism is not present in the extdata folder of the SPIA package!!!")
53:   if (!is.null(pathids)){
54:     if( all(pathids%in%names(datpT))){
55:       datpT=datpT[pathids]
57:       stop( paste("pathids must be a subset of these pathway ids: ",paste(names(datpT),collapse=" "),sep=" "))
123:       KEGGLINK[i]<-paste("http://www.genome.jp/dbget-bin/show_pathway?",organism,names(datp)[i],"+",gnns,sep="")
133:         plot(X,pfs-X,main=paste("pathway ID=",names(datp)[i],sep=""),
186:           plot(density(pfstmp,bw=bwidth),cex.lab=1.2,col="black",lwd=2,main=paste("pathway ID=",names(datp)[i],"  P PERT=",round(pb[i],5),sep=""),
190:           plot(as.numeric(names(pfsTab)), as.numeric(pfsTab), cex.lab=1.2,col="black",main=paste("pathway ID=",names(datp)[i],"  P PERT=",round(pb[i],5),sep=""),
206:   }#end for each pathway
rtracklayer:R/ucsc.R: [ ]
1597:     path <- ucscURLTable[key]
364:   label_path <- "//select[@name = 'hgta_track']/option/text()"
366:   track_path <- "//select[@name = 'hgta_track']/option/@value"
365:   labels <- sub("\n.*$", "", sapply(getNodeSet(doc, label_path), xmlValue))
367:   tracks <- unlist(getNodeSet(doc, track_path))
1572:             upload <- fileUpload(path(object), "text/plain")
1598:     if (is.na(path))
1601:         path <- paste0(path, '?redirect="manual"')
1603:     paste(object@url, path, sep="")
flowGraph:R/04_flowgraph_plots.R: [ ]
1574:                         path <- paste0(
1536:             plot_path_ <- paste0(
2: #' @description Creates a cell hierarchy plot given a flowGraph object. If a path is not provided for \code{fg_plot} to save the plot, please use \code{plot_gr} to view plot given t...(28 bytes skipped)...
89: #' @param path A string indicating the path to where the function should save
104: #'  the plot by filling out the \code{path} parameter with a full path to the
117: #'    path=NULL) # set path to a full path to save plot as a PNG
142:     path=NULL, width=9, height=9
279:         if (!is.null(path) & !interactive)
281:                 grepl("[.]png$",path, ignore.case=TRUE),
282:                 path, paste0(path, ".png")),
285:         if (!is.null(path) & interactive & !visNet_plot)
287:                 gp, ifelse(grepl("[.]html$",path, ignore.case=TRUE),
288:                            path, paste0(path, ".html")))
289:         if (!is.null(path) & interactive & visNet_plot)
291:                 gp, file=ifelse(grepl("[.]html$",path, ignore.case=TRUE),
292:                                 path, paste0(path, ".html")),
295:     if (is.null(path)) message("use function plot_gr to plot fg_plot output")
407: #'    path=NULL) # set path to a full path to save plot as a PNG
719: #' @param path A string indicating the path to where the function should save
754:     main=NULL, interactive=FALSE, path=NULL
822:             if (!is.null(path))
824:                     qp, ifelse(grepl("[.]html$",path, ignore.case=TRUE),
825:                                path, paste0(path, ".html")))
829:         if (!is.null(path))
832:                     ifelse(grepl("[.]png$",path, ignore.case=TRUE),
833:                            path, paste0(path, ".png")),
903: #' @param path A string indicating the path to where the function should save
940:     main=NULL, path=NULL
1031:     if (!is.null(path))
1033:             ifelse(grepl("[.]png$",path, ignore.case=TRUE),
1034:                    path, paste0(path, ".png")),
1051:     main=NULL, path=NULL
1063:             main=main, path=path,
1202:     if (!is.null(path)) {
1205:                 "[.]png$",path, ignore.case=TRUE),
1206:                 path, paste0(path, ".png")),
1281: #' @param path A string indicating the path to where the function should save
1316:     main=NULL, interactive=FALSE, path=NULL
1386:         if (!is.null(path))
1389:                     "[.]png$",path, ignore.case=TRUE),
1390:                     path, paste0(path, ".png")), plot=gp)
1426:         if (!is.null(path))
1428:                 gp, ifelse(grepl("[.]html$", path, ignore.case=TRUE),
1429:                            path, paste0(path, ".html")))
1443: #' @param plot_path A string indicating the folder path to where the function
1520:     fg, plot_path, plot_types="node", interactive=FALSE,
1537:                 plot_path, "/", type, "/", paste0(sm, collapse="_"))
1538:             while (dir.exists(plot_path_) & !overwrite)
1539:                 plot_path_ <- paste0(plot_path_,"_")
1540:             dir.create(plot_path_, recursive=TRUE, showWarnings=FALSE)
1551:                     path=paste0(plot_path_, "/pVSdifference.png"))
1567:                     rdir_ <- paste0(plot_path_, "/boxplots")
1580:                             path=path, paired=paired,
1595:                     path=paste0(plot_path_,"/qq.png"),
1605:                         path=paste0(plot_path_,"/cell_hierarchy.png"),
1628:                             paste0(plot_path_,"/cell_hierarchy_",
qusage:R/qusage.R: [ ]
532:           path = q$pathways[[i]]
537:         path = QSarray$pathways[[i]]
379:   PDFs = pathMeans = Sizes = NULL
792:     SDPath = apply(calcBayesCI(QSarray,low=0.5,up=0.8413448)[,path.index,drop=F],2,function(x)x[2]-x[1])
800:       XPath = getXcoords(QSarray,i,addVIF=addVIF)
808:         PDFPath<-approx( XPath, QSarray$path.PDF[,i],X_Sample,rule=2)$y
47:     qs.results.comb$path.mean = 2 * qs.results.comb$path.mean
59:     for(i in c("var.method","labels","pairVector","pathways","path.size")){
408:   geneResults$path.mean = pathMeans
409:   geneResults$path.size = Sizes
412:   geneResults$path.PDF = PDFs
503:   if(!is.null(geneResults$path.PDF)){ ##if defined, rescale the pdf with the new vif values
504:     geneResults$path.PDF = t(t(geneResults$path.PDF) / pdfScaleFactor(geneResults))
524:   if(is.null(QSarray$path.PDF)){stop("convolution results not found.")}
525:   p = sapply(1:ncol(QSarray$path.PDF), function(i){
526:     if(!is.null(QSarray$path.size) && QSarray$path.size[i]==0){return(NA)}
533:           mean(q$mean[-path])
538:         null.hyp = mean(QSarray$mean[-path])
545: #         path = QSarray$pathways[[i]]
546: #         null.hyp=mean(getExAbs(QSarray$dof[path])*QSarray$SD[path])
551:     PDF_NORM<-QSarray$path.PDF[,i]/sum(QSarray$path.PDF[,i])
552: #     sum(QSarray$path.PDF[1:findInterval(0,x),i]) / sum(QSarray$path.PDF[,i])
571: twoWay.pVal <- function(grp1, grp2, path.index1 = 1:numPathways(grp1), path.index2 = 1:numPathways(grp2), 
575:   return(twoCurve.pVal(grp1, grp2, path.index1, path.index2, alternative, direction,addVIF))
582:                         path.index1 = 1:numPathways(grp1),
583:                         path.index2 = 1:numPathways(grp2), 
589: #   if(ncol(grp1$path.PDF)!=ncol(grp2$path.PDF) | all(colnames(grp1$path.PDF) != colnames(grp2$path.PDF))){
592:   if(length(path.index1)!=length(path.index2)){
595: #     if(sum(names(grp1$path.mean[path.index1])!=names(grp2$path.mean[path.index2]))){
599:   x1 = sapply(path.index1,function(i){getXcoords(grp1,i,addVIF=addVIF)})
600:   x2 = sapply(path.index2,function(i){getXcoords(grp2,i,addVIF=addVIF)})
605:   p = sapply(1:length(path.index1), function(i){
607:     PDF1<-approx( x1[,i], grp1$path.PDF[,path.index1[i]],seq(Min[i],Max[i],length.out=Length1+Length2),rule=2)$y
608:     PDF2<-approx( x2[,i], grp2$path.PDF[,path.index2[i]],seq(Min[i],Max[i],length.out=Length1+Length2),rule=2)$y
615: ## path.index can either be an integer between 1 and length(path.means), or the name of the pathway.
618: getXcoords = function(QSarray,path.index=1, addVIF=!is.null(QSarray$vif)){ #,absolute=FALSE){
619:   if(length(path.index)>1){stop("path.index must be of length 1")}
622:   sif = ifelse(addVIF,sqrt(QSarray$vif[path.index]),1)
626:   seq(-1,1,length.out=QSarray$n.points)* QSarray$ranges[path.index]* sif + QSarray$path.mean[path.index]
630: #    MeanAbs<-mean(abs(QSarray$mean[QSarray$pathways[[path.index]]]))
631: #    seq(-1,1,length.out=QSarray$n.points)* QSarray$ranges[path.index]* sif / QSarray$path.size[path.index] + MeanAbs
642:   pdfSum = colSums(QSarray$path.PDF)
655:   cis = sapply(1:ncol(QSarray$path.PDF), function(i){
657:         any(is.na(QSarray$path.PDF[,i]))){return(c(NA,NA))}
659:     cdf = cumsum(QSarray$path.PDF[,i])
668:   colnames(cis) = colnames(QSarray$path.PDF)
771:                                  path.index=1:numPathways(QSarray), ##The pathways to calculate the pVals for.
778:   ##check path.index
779:   if(is.character(path.index)){
780:     path.index = match(path.index, names(QSarray$pathways))
793:     if(!addVIF)SDPath = SDPath / sqrt(QSarray$vif[path.index])
799:     for(i in path.index){
824:             TMP<-pnorm( ( Means[j] - QSarray$path.mean[i]  ) / sqrt( SDPath[i]^2 + (DOF[j])/(DOF[j]-2)*SD[j]^2) )
835:     for(i in path.index){
842:           if(compareTo=="mean")SUBSTRACT=QSarray$path.mean[i]
875:         if(!CompareWithZero)SUBSTRACT=QSarray$path.mean[i]
17:                   geneSets,          ##a list of pathways to be compared. Each item in the list is a vector of names that correspond to the row names of ...(5 bytes skipped)...
74:                          geneSets,          ##a list of pathways to be compared. Each item in the list is a vector of names that correspond to the row names of ...(5 bytes skipped)...
308:  if(!is.null(QSarray$pathways)){stop("too late...aggregateGeneSet already being called")}
320: ##Simple function to read in a .gmt file and return a list of pathways
322:   if(!grepl("\\.gmt$",file)[1]){stop("Pathway information must be a .gmt file")}
331: #######Combine individual gene differential expresseion for each pathway (Neg) ~ 1 minute
334:                            geneSets,     ##a list of pathways to be compared, each item in the list is a vector of names that correspond to the gene names fr...(25 bytes skipped)...
336:                            silent=TRUE   ##If false, print a "." every fifth pathway, as a way to keep track of progress
401:     pathMeans = c(pathMeans, mean(Means[Indexes]))
405:   colnames(PDFs) = names(pathMeans) = names(Sizes) = names(geneSets)
407:   geneResults$pathways = geneSets
425: #                    geneSets=NULL, ##a list of pathways calculate the vif for, each item in the list is a vector of names that correspond to the gene n...(32 bytes skipped)...
430:     if(is.null(geneResults$pathways)){stop("Pathway Information not found. Please provide a list of gene sets.")}
431:     geneSets = geneResults$pathways
439: #     geneResults$pathways = geneSets
516: ## function for calculating a p-value for each pathway convolution as output by aggregateGeneSet.
519: ...(59 bytes skipped)... true (and alternative="two.sided"), p-values will be returned as eiter positive or negative if the pathway is greater or less than 0, respectively.
521: ...(15 bytes skipped)...      selfContained=TRUE                ##If false, rather than comparing to 0, it will compare the pathway mean to the mean of all genes not in the pathway.
578: ## A method to compare the pathway convolutions in two QSarray objects. 
588:   ##if the names of the pathways don't match, 
590: #     stop("Pathways in grp1 do not match pathways in grp2")
593:     stop("Number of pathways in grp1 do not match number of pathways in grp2")
596: #         warning("Some of the comparisons are made between different pathways")
614: ## Calculates the x-coordinates for the PDF of a given pathway.
629: #    ###First calculate the new mean of the pathway based on the absolute values of the means
656:     if( (!is.null(QSarray$pathways) && length(QSarray$pathways[[i]])==0 ) ||
772:                                  silent=TRUE,   ##If false, print a "." every fifth pathway, as a way to keep track of progress  
784:   if(is.null(QSarray$pathways)){stop("Pathway Information not found. Please run aggregateGeneSet first.")}
785:   geneSets = QSarray$pathways
805:         Min<-min(c(XGene[1]+ Means[Indexes],XPath[1]))
806:         Max<-max(c(XGene[NPoints]+ Means[Indexes],XPath[QSarray$n.points]))
815:             PS<-c(PS,compareTwoDistsFaster(PDFGene,PDFPath, alternative="two.sided"))                    
860: ...(17 bytes skipped)...             CompareWithZero=TRUE ###Logical, if TRUE compares with mean of zero, else with mean of pathway
862:   if(is.null(QSarray$pathways)){stop("Pathway Information not found. Please provide a list of gene sets.")}
863:   geneSets = QSarray$pathways
898: #                    geneSets=NULL, ##a list of pathways calculate the vif for, each item in the list is a vector of names that correspond to the gene n...(32 bytes skipped)...
901:   if(is.null(geneResults$pathways)){stop("Pathway Information not found. Please provide a list of gene sets.")}
902:   geneSets = geneResults$pathways  
640:   sif = sapply(1:numPathways(QSarray),function(i){ifelse(addVIF,sqrt(QSarray$vif[i]),1)})
VarCon:inst/extdata/app.R: [ ]
235:   path <- reactiveValues(
240:   path2 <- reactiveValues(
244:   path3 <- reactiveValues(
24:   uploadReferenceDNA <- eventReactive(path$pth,{
26:     testFASTA <- strsplit(path$pth,"\\.")[[1]]
28:       referenceDnaStringSet2 <- readDNAStringSet(path$pth, format="fasta",use.names=TRUE)
34:       load(path$pth)
42:   uploadTranscriptTable <- eventReactive(path3$pth3,{
45:     testCSV <- strsplit(path3$pth3,"\\.")[[1]]
47:       transCoord <- read.csv(path3$pth3, sep=";")
48:     }else{ transCoord <- readRDS(path3$pth3)}
78:     gene2transcript <- read.csv(path2$pth2, sep=";", stringsAsFactors=FALSE)
99:     gene2transcript <- read.csv(path2$pth2, sep=";", stringsAsFactors=FALSE)
126:     gene2transcript <- read.csv(path2$pth2, sep=";", stringsAsFactors=FALSE)
145:     gene2transcript <- read.csv(path2$pth2, sep=";", stringsAsFactors=FALSE)
176:     gene2transcript <- read.csv(path2$pth2, sep=";", stringsAsFactors=FALSE)
205:     gene2transcript <- read.csv(path2$pth2, sep=";", stringsAsFactors=FALSE)
251:     path$pth <- file.choose()
255:     path2$pth2 <- file.choose()
259:     path3$pth3 <- file.choose()
234:   ## Define reactive paths
ISAnalytics:R/internal-functions.R: [ ]
414:                 path = project_folder, recurse = TRUE,
717:                 path = association_file,
379:     path_cols <- .path_cols_names()
484:     path_col_names <- .path_cols_names()
1209:     path_col_names <- .path_cols_names()
523:     stats_paths <- purrr::pmap_dfr(temp, function(...) {
592:     stats_paths <- .stats_report(association_file, prefixes)
8: #' @importFrom fs path_ext
9: #' @importFrom tools file_path_sans_ext
11: .check_file_extension <- function(file_path) {
13:     last <- fs::path_ext(file_path)
17:         file_path[compressed] <- tools::file_path_sans_ext(
18:             file_path[compressed]
20:         last <- fs::path_ext(file_path)
151: .read_with_fread <- function(path, to_drop, df_type, annotated, sep) {
154:             file = path,
174:             file = path,
190: .read_with_readr <- function(path, to_drop, df_type, annotated, sep) {
209:         file = path,
245: .read_af <- function(path, padding, date_format, delimiter) {
248:     file_ext <- .check_file_extension(path)
262:         headers_peek <- readr::read_delim(path,
270:         headers_peek <- readxl::read_excel(path, n_max = 0)
289:             df <- readr::read_delim(path,
299:             df <- readxl::read_excel(path,
356: # @param root_folder Path to the root folder
359: #' @importFrom fs dir_ls path dir_exists
367: # corresponding path on disk if found, NA otherwise.
387:                         !!path_cols$project := NA_character_,
388:                         !!path_cols$quant := NA_character_,
389:                         !!path_cols$iss := NA_character_
392:             project_folder <- fs::path(
393:                 fs::path(root_folder),
396:             quant_folder <- paste0(fs::path(
398:                 fs::path(cur$concatenatePoolIDSeqRun)
400:             iss_folder <- paste0(fs::path(
402:                 fs::path(cur$concatenatePoolIDSeqRun)
408:                         !!path_cols$project := NA_character_,
409:                         !!path_cols$quant := NA_character_,
410:                         !!path_cols$iss := NA_character_
422:                 path = project_folder, recurse = TRUE,
432:                         !!path_cols$project := project_folder,
433:                         !!path_cols$quant := quant_found,
434:                         !!path_cols$iss := iss_found
441:             Found = ifelse(!is.na(.data[[path_cols$project]]), TRUE, FALSE),
442:             .before = .data[[path_cols$project]]
450: # file by adding a column `Path` where the absolute path on disk for the
451: # project and pool is found, if no path is found NA is inserted instead.
475: # Finds automatically the path on disk to each stats file.
482: # Path_iss (or designated dynamic name), stats_files, info
489:             .data[[path_col_names$iss]]
499:     if (all(is.na(temp[[path_col_names$iss]]))) {
506:         if (is.na(temp_row[[path_col_names$iss]])) {
514:         files <- fs::dir_ls(temp_row[[path_col_names$iss]],
713:     ## Import association file if provided a path
723:     if (!.path_cols_names()$quant %in% colnames(association_file)) {
724:         rlang::abort(.af_missing_path_error(.path_cols_names()$quant),
725:             class = "missing_path_col"
729:         dplyr::filter(!is.na(.data[[.path_cols_names()$quant]]))
739:     # If it's a path to file import the association file
1200: #' @importFrom fs dir_ls as_fs_path
1214:             .data[[path_col_names$quant]]
1248:             matches <- fs::dir_ls(temp_row[[path_col_names$quant]],
1295: # @param dupl The tibble containing quantification types and path to the files
1343: # * Removing files not found (files for which Files_count$Found == 0 and Path
1474: #' @importFrom fs path_ext
1481: .import_single_matrix <- function(path, to_exclude = NULL, separator = "\t") {
1482:     stopifnot(!missing(path) & is.character(path))
1484:     if (!file.exists(path)) {
1485:         rlang::abort(paste("File not found at", path))
1487:     if (!fs::is_file(path)) {
1488:         rlang::abort(paste("Path exists but is not a file"))
1492:     is_compressed <- fs::path_ext(path) %in% .compressed_formats()
1495:         compression_type <- fs::path_ext(path)
1502:     peek_headers <- readr::read_delim(path,
1517:             path = path, to_drop = to_exclude,
1523:             path = path, to_drop = to_exclude,
1710: #' @importFrom fs as_fs_path
1748:                     dplyr::mutate(Files_found = fs::as_fs_path(
1768:                     dplyr::mutate(Files_found = fs::as_fs_path(
1854: # * Removing files not found (files for which Files_count$Found == 0 and Path
2860: # @param file_path The file path as a string
2861: #' @importFrom fs dir_create path_wd path
2866: .write_recalibr_map <- function(map, file_path) {
2867:     if (fs::is_dir(file_path)) {
2868:         if (!fs::dir_exists(file_path)) {
2869:             fs::dir_create(file_path)
2872:         file_path <- fs::path(file_path, gen_filename)
2874:         if (fs::path_ext(file_path) == "") {
2875:             file_path <- fs::path_ext_set(file_path, "tsv.gz")
2880:             data.table::fwrite(map, file = file_path, sep = "\t", na = "")
2883:                 file_path
3451:                 x = "Did you provide the correct path?"
3468:                 x = "Did you provide the correct path?"
7: # Returns the file format for each of the file paths passed as a parameter.
369:     if (!"PathToFolderProjectID" %in% colnames(df)) {
370:         rlang::abort(.af_missing_pathfolder_error())
376:             .data$PathToFolderProjectID
384:             if (is.na(cur$PathToFolderProjectID)) {
394:                 cur$PathToFolderProjectID
459: # @return An updated association file with absolute paths
465:                 -.data$PathToFolderProjectID,
498:     # If paths are all NA return
578:     stats_paths
591:     # Obtain paths
593:     stats_paths <- stats_paths %>%
595:     if (all(is.na(stats_paths$stats_files))) {
596:         stats_paths <- stats_paths %>%
602:         return(list(stats = NULL, report = stats_paths))
609:             tasks = length(stats_paths$stats_files),
616:             tasks = length(stats_paths$stats_files),
642:         BiocParallel::bplapply(stats_paths$stats_files,
657:     stats_paths <- stats_paths %>%
659:     stats_paths <- purrr::pmap_dfr(stats_paths, function(...) {
676:     stats_paths <- stats_paths %>%
678:     stats_dfs <- stats_dfs[stats_paths$Imported]
681:         return(list(stats = NULL, report = stats_paths))
688:     list(stats = stats_dfs, report = stats_paths)
1567: # @param files Files_found table were absolute paths of chosen files
IONiseR:R/fast5Readers.R: [ ]
375:         path <- paste0("/Analyses/Basecall_", d, "_000/Log")
376:         exists <- .groupExistsObj(fid, group = path)
378:             did <- H5Dopen(fid, path)
DMRforPairs:R/functions.R: [ ]
457:     path = "figures"
450:     dir.create(file.path(getwd(), experiment.name))
452:     dir.create(file.path(paste(getwd(), experiment.name, sep = "/"), 
456:     setwd(file.path(getwd(), experiment.name))
485:                 path = path)
487:             tested$Figure[cr] = paste("<a href=\"./", path, "/", 
490:             tested$Statistics[cr] = paste("<a href=\"./", path, "/", 
493:             write.table(file = paste("./", path, "/", tested$regionID[cr], 
507:                 scores = FALSE, path = path)
509:             tested$Figure[cr] = paste("<a href=\"./", path, "/", 
512:             tested$Statistics[cr] = paste("<a href=\"./", path, "/", 
519:             write.table(file = paste("./", path, "/", tested$regionID[cr], 
533:                 scores = FALSE, path = path)
539:             tested$Figure[cr] = paste("<a href=\"./", path, "/", 
542:             tested$Statistics[cr] = paste("<a href=\"./", path, "/", 
545:             write.table(file = paste("./", path, "/", tested$regionID[cr], 
606:             path, "/", tested_4html_selected$ID, ".png\" height=\"63\" width=\"125\">", 
624:             path, "/", tested_4html_selected$ID, ".png\" height=\"63\" width=\"125\">", 
639:     regionID, clr = NA, annotate = TRUE, scores = TRUE, path) {
642:     path = paste("./", path, "/", sep = "")
651:         clr = clr, annotate = annotate, scores = scores, path = path)
656:     annotate = TRUE, path) {
659:     path = paste("./", path, "/", sep = "")
673:             annotate = annotate, scores = TRUE, path = path)
679:     ID = "CustomRegion", clr = NA, annotate = TRUE, path) {
680:     path = paste("./", path, "/", sep = "")
693:             annotate = annotate, scores = TRUE, path = path)
699:     ID = NA, clr = NA, annotate = TRUE, scores = NA, path) {
730:     png(paste(path, ID, ".png", sep = ""), width = 500, height = 250)
750:     pdf(paste(path, ID, ".pdf", sep = ""), width = 10, height = 10)
Rqc:R/utils.R: [ ]
94:     path <- dirname(file)
99:     data.frame(filename, pair, format, group, reads, total.reads, path, 
GSCA:inst/shiny/server.R: [ ]
357:                         path <- system.file("extdata",package=paste0(input$Summarycompselect,"Expr"))
716:                                           path <- system.file("extdata",package=paste0(input$Summarycompselect,"Expr"))
358:                         load(paste0(path,"/geneid.rda"))
378:                                     load(paste0(path,"/quality.rda"))
388:                                     load(paste0(path,"/quality.rda"))
475:                               path <- system.file("extdata",package=paste0(input$Summarycompselect,"Expr"))
482:                                           tmpgeneexpr <- rbind(tmpgeneexpr,t(h5read(paste0(path,"/data",h5id,".h5"),"expr",index=list(NULL,match(currenth5gene,h5gene))))/1000)
485:                                     tmpgeneexpr <- t(h5read(paste0(path,"/data.h5"),"expr",index=list(NULL,match(currentgeneset[,2],Maindata$geneid))))/1000
724: ...(9 bytes skipped)...                                                   tmpgeneexpr <- rbind(tmpgeneexpr,t(h5read(paste0(path,"/data",h5id,".h5"),"expr",index=list(NULL,match(currenth5gene,h5gene))))/1000)
727:                                                 tmpgeneexpr <- t(h5read(paste0(path,"/data.h5"),"expr",index=list(NULL,match(currentgeneset[,2],Maindata$geneid))))/1000
118:                         tmpfile <- read.table(GenesetFileHandle$datapath,header=input$InputGenesetheader,sep=input$InputGenesetsep,quote=input$InputGenesetquote,stringsAsFa...(30 bytes skipped)...
401:                         tmptab <- read.table(input$Summaryuploadtabfile$datapath,stringsAsFactors=F,blank.lines.skip=TRUE)
405: ...(8 bytes skipped)...                Maindata$uploadgeneexpr <- as.matrix(read.table(input$Summaryuploadgeneexprfile$datapath,stringsAsFactors=F,blank.lines.skip=TRUE,row.names=1))
1917:                               tmp <- read.table(input$GSCAinteractiveload$datapath)
1946: ...(35 bytes skipped)... updateTextInput(session,"Formulainputtext","Input Formula",readLines(input$GSCAinteractiveload$datapath))
2412:                         Utidata$Maindata <- Utidata$rawdata <- read.table(UtiFileHandle$datapath,header=input$Utiheader,sep=input$Utisep,quote=input$Utiquote,stringsAsFactors=F,blank.lines.skip=TR...(15 bytes skipped)...
TIN:R/correlationPlot.R: [ ]
104:     path<-getwd()
105:     cat("Plot was saved in ",paste(path,"/",fileName,sep=""),"\n")
exomeCopy:R/main_functions.R: [ ]
199:   path <- viterbiPath(nm.fit$par,fx.par,data,nstates,stFn,trFn,emFn)
105:   V.path <- matrix(0,nrow=nstates,ncol=T)
90: viterbiPath <- function(par,fx.par,data,nstates,stFn,trFn,emFn) {
106: ...(78 bytes skipped)...start.probs=as.double(start.probs),A=as.double(A),emit.probs=as.double(emit.probs),V=as.double(V),V.path=as.integer(V.path),path=as.integer(numeric(T)),trans.prob=as.double(numeric(nstates^2)),trans.prob.max=as.double(numeric(ns...(57 bytes skipped)...
107:   return(viterbi.call$path + 1)
201:   log.odds <- log(emit.probs[cbind(path,seq(path))]+1e-6) - log(emit.probs[normal.state,]+1e-6)
203:   fit <- new("ExomeCopy",sample.name=sample.name,type=type,path=Rle(path),ranges=granges(gr),O.norm=as.numeric(O/mu.hat),log.odds=log.odds,fx.par=fx.par,init.par=init.par,f...(89 bytes skipped)...
cTRAP:R/shinyInterface.R: [ ]
475:                 if (is.function(path)) path <- path()
418:                                         path=".", globalUI=FALSE) {
476:                 ENCODEsamples <- loadENCODEsamples(ENCODEmetadata, path=path)
1194:     inputFile  <- file.path(token, sprintf("input_%s.Rda",  rand))
1195:     outputFile <- file.path(token, sprintf("output_%s.rds", rand))
1380: .predictTargetingDrugsServer <- function(id, x, path=".", globalUI=FALSE,
1405:                 corMatrix, path=path)
1469: .drugSetEnrichmentAnalyserServer <- function(id, x, path=NULL) {
1492:                                            path=path)
1665:                                  file="ENCODEmetadata.rds", path=".") {
1670:         .diffExprENCODEloaderServer(id, metadata, cellLine, gene, path=path)
MesKit:R/phyloTreeAnno.R: [ ]
672:    path <- list()
570:    trunkPath <- rev(c(mainTrunk,rootNode))
674:       subPath <- c()
509:    ## label represents the common evolution path of samples
688:       path[[name]] <- subPath
695:    result <- path[[names(which.max(distanceTable))]]
571:    if(length(trunkPath) > 0){
572:      # subdat_list <- lapply(2:length(trunkPath), function(i){
573:      #   x1 <- treeData[treeData$end_num == trunkPath[i-1],]$x2
574:      #   y1 <- treeData[treeData$end_num == trunkPath[i-1],]$y2
577:      #   distance <- treeEdge[treeEdge$endNum == trunkPath[i],]$length
589:      #                                    'node' = trunkPath[i-1],'end_num' = trunkPath[i])
596:       for(i in 2:length(trunkPath)){
597:          x1 <- treeData[treeData$end_num == trunkPath[i-1],]$x2
598:          y1 <- treeData[treeData$end_num == trunkPath[i-1],]$y2
601:          distance <- treeEdge[treeEdge$endNum == trunkPath[i],]$length
613:                                           'node' = trunkPath[i-1],'end_num' = trunkPath[i])
682:          subPath <- append(subPath,end)