Found 136981 results in 12971 files, showing top 150 files (show more).
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)
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")){
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
mzR:src/boost/boost/filesystem/path.hpp: [ ]
55:   class BOOST_FILESYSTEM_DECL path
131:     path(){}                                          
133:     path(const path& p) : m_pathname(p.m_pathname) {}
136:     path(Source const& source,
143:     path(const value_type* s) : m_pathname(s) {}
144:     path(value_type* s) : m_pathname(s) {}
145:     path(const string_type& s) : m_pathname(s) {}
146:     path(string_type& s) : m_pathname(s) {}
149:     path(Source const& source, const codecvt_type& cvt)
155:     path(InputIterator begin, InputIterator end)
167:     path(InputIterator begin, InputIterator end, const codecvt_type& cvt)
486:     bool has_root_path() const       { return has_root_directory() || has_root_name(); }
489:     bool has_relative_path() const   { return !relative_path().empty(); }
490:     bool has_parent_path() const     { return !parent_path().empty(); }
528:     path   branch_path() const      { return parent_path(); }
530:     bool   has_branch_path() const  { return !parent_path().empty(); }
829: namespace path_traits
610:   typedef path wpath;
16: #define BOOST_FILESYSTEM_PATH_HPP
642:     const path*             m_path_ptr;  // path being iterated over
572:     string_type  m_pathname;  // Windows: as input; backslashes NOT converted to slashes,
1: //  filesystem path.hpp  ---------------------------------------------------------------//
11: //  path::stem(), extension(), and replace_extension() are based on
15: #ifndef BOOST_FILESYSTEM_PATH_HPP
25: #include <boost/filesystem/path_traits.hpp>  // includes <cwchar>
51:   //                                    class path                                      //
76:     //  Following the principle of least astonishment, path input arguments
78:     //  class path behave as if they were directly passed to or
81:     //  POSIX specfies that path strings are passed unchanged to and from the
86:     //  are converted to/from char using the path locale or, if a conversion
90:     //  The path locale, which is global to the thread, can be changed by the
137:       typename boost::enable_if<path_traits::is_pathable<
140:       path_traits::dispatch(source, m_pathname);
151:       path_traits::dispatch(source, m_pathname, cvt);
162:         path_traits::convert(seq.c_str(), seq.c_str()+seq.size(), m_pathname);
174:         path_traits::convert(seq.c_str(), seq.c_str()+seq.size(), m_pathname, cvt);
180:     path& operator=(const path& p)
187:       typename boost::enable_if<path_traits::is_pathable<
188:         typename boost::decay<Source>::type>, path&>::type
192:       path_traits::dispatch(source, m_pathname);
198:     path& operator=(const value_type* ptr)  // required in case ptr overlaps *this
200:     path& operator=(value_type* ptr)  // required in case ptr overlaps *this
202:     path& operator=(const string_type& s) {m_pathname = s; return *this;}
203:     path& operator=(string_type& s)       {m_pathname = s; return *this;}
205:     path& assign(const value_type* ptr, const codecvt_type&)  // required in case ptr overlaps *this
208:     path& assign(Source const& source, const codecvt_type& cvt)
211:       path_traits::dispatch(source, m_pathname, cvt);
216:     path& assign(InputIterator begin, InputIterator end)
223:         path_traits::convert(seq.c_str(), seq.c_str()+seq.size(), m_pathname);
229:     path& assign(InputIterator begin, InputIterator end, const codecvt_type& cvt)
236:         path_traits::convert(seq.c_str(), seq.c_str()+seq.size(), m_pathname, cvt);
244:       typename boost::enable_if<path_traits::is_pathable<
245:         typename boost::decay<Source>::type>, path&>::type
252:     path& operator+=(const path& p)         { m_pathname += p.m_pathname; return *this; }
253:     path& operator+=(const value_type* ptr) { m_pathname += ptr; return *this; }
254:     path& operator+=(value_type* ptr)       { m_pathname += ptr; return *this; }
255:     path& operator+=(const string_type& s)  { m_pathname += s; return *this; }
256:     path& operator+=(string_type& s)        { m_pathname += s; return *this; }
257:     path& operator+=(value_type c)          { m_pathname += c; return *this; }
260:       typename boost::enable_if<is_integral<CharT>, path&>::type
270:     path& concat(Source const& source)
272:       path_traits::dispatch(source, m_pathname);
277:     path& concat(Source const& source, const codecvt_type& cvt)
279:       path_traits::dispatch(source, m_pathname, cvt);
284:     path& concat(InputIterator begin, InputIterator end)
290:       path_traits::convert(seq.c_str(), seq.c_str()+seq.size(), m_pathname);
295:     path& concat(InputIterator begin, InputIterator end, const codecvt_type& cvt)
301:       path_traits::convert(seq.c_str(), seq.c_str()+seq.size(), m_pathname, cvt);
310:     path& operator/=(const path& p);
313:       typename boost::enable_if<path_traits::is_pathable<
314:         typename boost::decay<Source>::type>, path&>::type
320:     path& operator/=(const value_type* ptr);
321:     path& operator/=(value_type* ptr)
325:     path& operator/=(const string_type& s) { return this->operator/=(path(s)); }
326:     path& operator/=(string_type& s)       { return this->operator/=(path(s)); }
328:     path& append(const value_type* ptr)  // required in case ptr overlaps *this
334:     path& append(const value_type* ptr, const codecvt_type&)  // required in case ptr overlaps *this
341:     path& append(Source const& source);
344:     path& append(Source const& source, const codecvt_type& cvt);
347:     path& append(InputIterator begin, InputIterator end);
350:     path& append(InputIterator begin, InputIterator end, const codecvt_type& cvt);
355:     path&  make_preferred()
361:     path&  remove_filename();
362:     path&  remove_trailing_separator();
363:     path&  replace_extension(const path& new_extension = path());
364:     void   swap(path& rhs)     { m_pathname.swap(rhs.m_pathname); }
375:     //  The string or path returned by an observer are specified as being formatted
401:         path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(),
409:         path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(),
427:         path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(),
435:         path_traits::convert(&*m_pathname.begin(), &*m_pathname.begin()+m_pathname.size(),
467:     int compare(const path& p) const BOOST_NOEXCEPT;  // generic, lexicographical
468:     int compare(const std::string& s) const { return compare(path(s)); }
469:     int compare(const value_type* s) const  { return compare(path(s)); }
473:     path  root_path() const; 
474:     path  root_name() const;         // returns 0 or 1 element path
476:     path  root_directory() const;    // returns 0 or 1 element path
477:     path  relative_path() const;
478:     path  parent_path() const;
479:     path  filename() const;          // returns 0 or 1 element path
480:     path  stem() const;              // returns 0 or 1 element path
481:     path  extension() const;         // returns 0 or 1 element path
525:     path&  normalize()              { return m_normalize(); }
526:     path&  remove_leaf()            { return remove_filename(); }
527:     path   leaf() const             { return filename(); }
546:     //basic_path(const string_type& str, name_check) { operator/=(str); }
547:     //basic_path(const typename string_type::value_type* s, name_check)
552:     //basic_path& canonize();
556: //                            class path private members                                //
567:       passing m_pathname.c_str() to the O/S API or when obtaining a path from the
583:     string_type::size_type m_parent_path_end() const;
585:     path& m_normalize();
590:     friend bool operator<(const path& lhs, const path& rhs);
592:     // see path::iterator::increment/decrement comment below
593:     static void m_path_iterator_increment(path::iterator & it);
594:     static void m_path_iterator_decrement(path::iterator & it);
596:   };  // class path
601:       int lex_compare(path::iterator first1, path::iterator last1,
602:         path::iterator first2, path::iterator last2);
604:       const path&  dot_path();
606:       const path&  dot_dot_path();
614:   //                             class path::iterator                                   //
617:   class path::iterator
619:       path::iterator,
620:       path const,
625:     friend class boost::filesystem::path;
626:     friend void m_path_iterator_increment(path::iterator & it);
627:     friend void m_path_iterator_decrement(path::iterator & it);
629:     const path& dereference() const { return m_element; }
633:       return m_path_ptr == rhs.m_path_ptr && m_pos == rhs.m_pos;
637:     // separate translation unit dll's, so forward to class path static members
638:     void increment() { m_path_iterator_increment(*this); }
639:     void decrement() { m_path_iterator_decrement(*this); }
641:     path                    m_element;   // current element
644:                                          // m_path_ptr->m_pathname.
646:                                          // position of the last separator in the path.
648:                                          // m_pos == m_path_ptr->m_pathname.size()
649:   }; // path::iterator
657:   //  std::lexicographical_compare would infinately recurse because path iterators
658:   //  yield paths, so provide a path aware version
659:   inline bool lexicographical_compare(path::iterator first1, path::iterator last1,
660:     path::iterator first2, path::iterator last2)
663:   inline bool operator==(const path& lhs, const path& rhs)              {return lhs.compare(rhs) == 0;}
664:   inline bool operator==(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) == 0;} 
665:   inline bool operator==(const path::string_type& lhs, const path& rhs) {return rhs.compare(lhs) == 0;}
666:   inline bool operator==(const path& lhs, const path::value_type* rhs)  {return lhs.compare(rhs) == 0;}
667:   inline bool operator==(const path::value_type* lhs, const path& rhs)  {return rhs.compare(lhs) == 0;}
669:   inline bool operator!=(const path& lhs, const path& rhs)              {return lhs.compare(rhs) != 0;}
670:   inline bool operator!=(const path& lhs, const path::string_type& rhs) {return lhs.compare(rhs) != 0;} 
671:   inline bool operator!=(const path::string_type& lhs, const path& rhs) {return rhs.compare(lhs) != 0;}
672:   inline bool operator!=(const path& lhs, const path::value_type* rhs)  {return lhs.compare(rhs) != 0;}
673:   inline bool operator!=(const path::value_type* lhs, const path& rhs)  {return rhs.compare(lhs) != 0;}
677:   inline bool operator<(const path& lhs, const path& rhs)  {return lhs.compare(rhs) < 0;}
678:   inline bool operator<=(const path& lhs, const path& rhs) {return !(rhs < lhs);}
679:   inline bool operator> (const path& lhs, const path& rhs) {return rhs < lhs;}
680:   inline bool operator>=(const path& lhs, const path& rhs) {return !(lhs < rhs);}
682:   inline std::size_t hash_value(const path& x)
686:     for(const path::value_type* it = x.c_str(); *it; ++it)
694:   inline void swap(path& lhs, path& rhs)                   { lhs.swap(rhs); }
696:   inline path operator/(const path& lhs, const path& rhs)  { return path(lhs) /= rhs; }
704:   operator<<(std::basic_ostream<Char, Traits>& os, const path& p)
712:   operator>>(std::basic_istream<Char, Traits>& is, path& p)
733: //                     class path member template implementation                        //
737:   path& path::append(InputIterator begin, InputIterator end)
744:     path_traits::convert(seq.c_str(), seq.c_str()+seq.size(), m_pathname);
751:   path& path::append(InputIterator begin, InputIterator end, const codecvt_type& cvt)
758:     path_traits::convert(seq.c_str(), seq.c_str()+seq.size(), m_pathname, cvt);
765:   path& path::append(Source const& source)
767:     if (path_traits::empty(source))
770:     path_traits::dispatch(source, m_pathname);
777:   path& path::append(Source const& source, const codecvt_type& cvt)
779:     if (path_traits::empty(source))
782:     path_traits::dispatch(source, m_pathname, cvt);
789: //                     class path member template specializations                       //
793:   std::string path::string<std::string>() const
797:   std::wstring path::string<std::wstring>() const
801:   std::string path::string<std::string>(const codecvt_type& cvt) const
805:   std::wstring path::string<std::wstring>(const codecvt_type& cvt) const
809:   std::string path::generic_string<std::string>() const
813:   std::wstring path::generic_string<std::wstring>() const
817:   std::string path::generic_string<std::string>(const codecvt_type& cvt) const
821:   std::wstring path::generic_string<std::wstring>(const codecvt_type& cvt) const
825:   //                     path_traits convert function implementations                     //
826:   //                        requiring path::codecvt() be visable                          //
837:     convert(from, from_end, to, path::codecvt());
845:     convert(from, from_end, to, path::codecvt());
853:     convert(from, 0, to, path::codecvt());
861:     convert(from, 0, to, path::codecvt());
863: }  // namespace path_traits
871: #endif  // BOOST_FILESYSTEM_PATH_HPP
60:     //  represent paths.
98:     //  See m_pathname comments for further important rationale.
101:     //  differently, or format directory paths differently from file paths. 
182:       m_pathname = p.m_pathname;
191:       m_pathname.clear();
199:                                           {m_pathname = ptr; return *this;}
201:                                           {m_pathname = ptr; return *this;}
206:                                           {m_pathname = ptr; return *this;}
210:       m_pathname.clear();
218:       m_pathname.clear();
231:       m_pathname.clear();
354:     void   clear()             { m_pathname.clear(); }
368:     //  For operating systems that format file paths differently than directory
369:     //  paths, return values from observers are formatted as file names unless there
371:     //  paths. POSIX and Windows make no such distinction.
387:     const string_type&  native() const { return m_pathname; }          // Throws: nothing
388:     const value_type*   c_str() const  { return m_pathname.c_str(); }  // Throws: nothing
400:       if (!m_pathname.empty())
408:       if (!m_pathname.empty())
415:     const std::wstring&  wstring() const { return m_pathname; }
416:     const std::wstring&  wstring(const codecvt_type&) const { return m_pathname; }
420:     const std::string&  string() const { return m_pathname; }
421:     const std::string&  string(const codecvt_type&) const { return m_pathname; }
426:       if (!m_pathname.empty())
434:       if (!m_pathname.empty())
458:     const std::string&  generic_string() const  { return m_pathname; }
459:     const std::string&  generic_string(const codecvt_type&) const  { return m_pathname; }
475:                                      // even on POSIX, root_name() is non-empty() for network paths
485:     bool empty() const               { return m_pathname.empty(); } // name consistent with std containers
491:     bool has_filename() const        { return !m_pathname.empty(); }
529:     bool   has_leaf() const         { return !m_pathname.empty(); }
565:       m_pathname has the type, encoding, and format required by the native
569:       characters; POSIX just treats paths as a sequence of bytes. Windows
579:     //  Returns: If separator is to be appended, m_pathname.size() before append. Otherwise 0.
699:   //    use boost::io::quoted() to handle spaces in paths
700:   //    use '&' as escape character to ease use for Windows paths
cisPath:inst/extdata/D3/cisPath.js: [ ]
127: var path = svg.append('svg:g').selectAll('path'),
2499: function ShowShortestPath(){
2: var basePath1="./PPIinfo/";
3: var basePath2="./PPIinfo/";
2630: function ShowShortestPath1(){
2711: var swiss2paths={};
2765: function showPath10(){
2778: function addResultPath10(p){
2784: function addFirstPath10(p){
2800: function addLastPath10(p){
2823: function addPreviousPath10(p){
2842: function addNextPath10(p){
2560: var resultPaths=[];
2561: function ShowPaths(allPaths){
2616: function ShowPathView(index){
2712: function generatePaths(swiss, root){
2729: function ShowShortestPathExp(){
2763: var showPathFirst=0;
2764: var showPathEnd=10;
3044: function getCisPathJS(){
3065: function getCisPathJSRetry(urltry){
3096: function getPathsForTargetProtein(swissID){
3118: function getPathsForTargetProteinRetry(urltry){
53:   .append('svg:path')
68:   .append('svg:path')
94:   .append('svg:path')
109:   .append('svg:path')
115: var drag_line = svg.append('svg:path')
166:   path.attr('d', function(d) {
360:   // path (link) group
381:   path = path.data(links);
384:   path.classed('selected', function(d) { return d === selected_link; })
393:   path.enter().append('svg:path')
414:   path.exit().remove();
2384: ///////////////////////////////////////////////////////////////////////shortest path
2504:        alert("No path between this two proteins!");
2508:        alert("No path between this two proteins!");
2568:     addTh(mycurrent_row, "Path");
2601:         mycurrent_button.id = "path"+x;
2614:     ShowPathView("path0");
2701:        alert("Sorry, detect no path from "+swiss1+" to "+ swiss2);
3097:    var url="./js/"+swissID+"_path.js";
954: 	 document.getElementById("detectPath").disabled=true;
1380:   idx=pathLen-1-idx;
1415: 	var url=basePath2+sourceSwiss+".js";
1679: 	var url=basePath2+swiss1+".js";
1684:            if(this.url==(basePath2+swiss1+".js")){
1820:   var url=basePath2+"A0A5B9.js";
1827:         debugObj("basePath1:"+basePath1);
1831:         basePath1="../geneset20140628/";
1832:         basePath2="../20140628PPI/";
1833:         debugObj("basePath1:"+basePath1);
1845:   var url=basePath2+"gene2swiss.js";
1899: 	var url=basePath2+"swiss2gene.js";
1954: 	var url=basePath2+"swiss2swiss.js";
2021: 	var url=basePath1+"PPI.js";
2411:     	 ShowShortestPath();
2421:           document.getElementById("detectPath").disabled=false;
2426:        document.getElementById("detectPath").disabled=true;
2438:           document.getElementById("detectPath").disabled=false;
2443:        document.getElementById("detectPath").disabled=true;
2515:     document.getElementById("detectPath").disabled=true;
2530:           document.getElementById("detectPath").disabled=false;
2543:            setTimeout("ShowShortestPath1()",1000);
2549:     setTimeout("ShowShortestPath1()",1000);
2574: 	    mycurrent_row.id="pathrow"+x;
2608: 	showPath10();
2611:     document.getElementById("detectPath").disabled=false;
2625: 	  	document.getElementById("pathrow"+x).className="rowNotSelected";
2627: 	document.getElementById("pathrow"+i).className="rowSelected";
2705:     swiss2paths={};
2707:     debugObj(swiss2paths[swiss2]);
2708:     debugObj(swiss2paths[swiss2].length);
2709:     ShowPaths(swiss2paths[swiss2]);
2713:     swiss2paths[swiss]=[];
2715:        swiss2paths[swiss].push(swiss);
2724:         for(var y in swiss2paths[nodes[x]]){
2725:             swiss2paths[swiss].push(swiss2paths[nodes[x]][y]+"#"+swiss);
2760:     ShowShortestPath();
2771:     addResultPath10(p);
2772:     addFirstPath10(p);
2773:     addPreviousPath10(p);
2774:     addNextPath10(p);
2775:     addLastPath10(p);
2796:     resultSPAN.addEventListener("click", function(e){showPathFirst=0;showPath10();}, false);
2819:     resultSPAN.addEventListener("click", function(e){showPathFirst=newFirst;showPath10();}, false);
2838:     resultSPAN.addEventListener("click", function(e){showPathFirst=newFirst;showPath10();}, false);
2857:     resultSPAN.addEventListener("click", function(e){showPathFirst=newFirst;showPath10();}, false);
2879: 	  	document.getElementById("pathrow"+i).style.display="none";
2882:         document.getElementById("pathrow"+i).style.display="";
3020: ...(31 bytes skipped)...ange", function(e){document.getElementById('targetPtxt').value=this.value;checkValid2();ShowShortestPath();}, false);
3108:         json.paths.pop();
3109:     	ShowPaths(json.paths);
3138:         json.paths.pop();
3139:     	ShowPaths(json.paths);
956: 	 document.getElementById("allShortestPaths").style.display="none";
957: 	 document.getElementById("allShortestPathsP").style.display="none";
1253: 	graphName = "cisPathValue#"+graphName;
1267:       if(key.substr(0,13)!="cisPathValue#"){
1285: 	graphName = "cisPathValue#"+graphName;
1306: 	graphName = "cisPathValue#"+graphName;
1327:       if(key.substr(0,13)!="cisPathValue#"){
1418:     callback: "cisPathCallBack",
1682:        callback: "cisPathCallBack",
1823:     callback: "cisPathCallBack",
1850:     callback: "cisPathCallBack",
1880:     callback: "cisPathCallBack",
1905:     callback: "cisPathCallBack",
1935:     callback: "cisPathCallBack",
1960:     callback: "cisPathCallBack",
1990:     callback: "cisPathCallBack",
2025:     callback: "cisPathCallBack",
2063:     callback: "cisPathCallBack",
2110: 	getCisPathJS();
2378:     var graphName="cisPathHTML";
2476: function ShowShortestPathWorker(){
2477:    var worker = new Worker("./D3/cisPathWorker.js");
2480:       var resultPaths=event.data.resultPaths;
2481:       ShowPaths(resultPaths);
2484:       var resultPaths=[];
2485:       ShowPaths(resultPaths);
2514:     document.getElementById("detectPathExp").disabled=true;
2521:     document.getElementById("allShortestPaths").style.display="none";
2522:     document.getElementById("allShortestPathsP").style.display="none";
2529:           document.getElementById("detectPathExp").disabled=false;
2533:           getPathsForTargetProtein(swiss2);
2539:            ShowShortestPathWorker();
2562:     resultPaths=allPaths;
2563:     var table=document.getElementById("allShortestPaths");
2571: 	for(var x in allPaths){
2572: 	    var nodes=allPaths[x].split("#");
2602:         mycurrent_button.addEventListener("click", function(e){ShowPathView(this.id);}, false);
2607: 	showPathFirst=0;
2610:     document.getElementById("detectPathExp").disabled=false;
2612:     document.getElementById("allShortestPaths").style.display="";
2613:     document.getElementById("allShortestPathsP").style.display="";
2617:     var total=resultPaths.length;
2619:     var nodes=resultPaths[i].split("#");
2706:     generatePaths(swiss2, swiss1);
2723:         generatePaths(nodes[x], root);
2767:     var p=document.getElementById("allShortestPathsP");
2780:     var content="Results: "+showPathFirst+"-"+showPathEnd+" of "+resultPaths.length+" ";
2790:     if(showPathFirst==0){
2805: 	var newFirst=(resultPaths.length-resultPaths.length%10);
2806: 	if(newFirst==resultPaths.length){
2807: 	   newFirst=resultPaths.length-10;
2813:     if(showPathEnd==resultPaths.length){
2828:     if(showPathFirst==0){
2834:     var newFirst=showPathFirst-10;
2847:     if(showPathEnd==resultPaths.length){
2853:     var newFirst=showPathFirst+10;
2854:     if(newFirst >= resultPaths.length){
2855:        newFirst = (resultPaths.length-resultPaths.length%10);
2863: 	var total=resultPaths.length;
2864: 	if(showPathFirst >= total){
2865: 	   showPathFirst=(total-total%10);
2867: 	if(showPathFirst == total){
2868: 	   showPathFirst = total-10;
2870:     if(showPathFirst < 0){
2871: 	   showPathFirst = 0;
2873: 	showPathFirst=showPathFirst-(showPathFirst%10);
2874: 	showPathEnd=showPathFirst+10;
2875: 	if(showPathEnd > total){
2876: 	   showPathEnd = total;
2881:     for(var i=showPathFirst;i<showPathEnd;i++){
3049:     callback: "cisPathCallBack",
3061:         getCisPathJSRetry(this.url);
3078:     callback: "cisPathCallBack",
3090:         getCisPathJSRetry(this.url);
3101:      callback: "cisPathCallBack",
3114:         getPathsForTargetProteinRetry(this.url);
3131:     callback: "cisPathCallBack",
3144:         getPathsForTargetProteinRetry(this.url);
3151: 	document.getElementById("detectPathExp").disabled=true;
3156: 	document.getElementById("detectPathExp").disabled=false;
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"))
cisPath:inst/extdata/D3/cisPathWeb.js: [ ]
127: var path = svg.append('svg:g').selectAll('path'),
2501: function ShowShortestPath(){
2: var basePath1="./PPIinfo/";
3: var basePath2="./PPIinfo/";
2632: function ShowShortestPath1(){
2719: var swiss2paths={};
2753: function showPath10(){
2766: function addResultPath10(p){
2772: function addFirstPath10(p){
2788: function addLastPath10(p){
2811: function addPreviousPath10(p){
2830: function addNextPath10(p){
2548: var resultPaths=[];
2549: function ShowPaths(allPaths){
2615: function ShowPathView(index){
2720: function generatePaths(swiss, root){
2737: function ShowShortestPathExp(){
2751: var showPathFirst=0;
2752: var showPathEnd=10;
53:   .append('svg:path')
68:   .append('svg:path')
94:   .append('svg:path')
109:   .append('svg:path')
115: var drag_line = svg.append('svg:path')
166:   path.attr('d', function(d) {
360:   // path (link) group
381:   path = path.data(links);
384:   path.classed('selected', function(d) { return d === selected_link; })
393:   path.enter().append('svg:path')
414:   path.exit().remove();
2386: ///////////////////////////////////////////////////////////////////////shortest path
2506:        alert("No path between this two proteins!");
2510:        alert("No path between this two proteins!");
2554:     	 alert("Sorry, detect no path from "+swiss1+" to "+ swiss2);
2566:     addTh(mycurrent_row, "Path");
2599:         mycurrent_button.id = "path"+x;
2613:       ShowPathView("path0");
2705:        alert("Sorry, detect no path from "+name1+" to "+ name2);
954: 	 document.getElementById("detectPath").disabled=true;
1380:   idx=pathLen-1-idx;
1415: 	var url=basePath2+sourceSwiss+".js";
1679: 	var url=basePath2+swiss1+".js";
1684:            if(this.url==(basePath2+swiss1+".js")){
1820:   var url=basePath2+"A0A5B9.js";
1827:         debugObj("basePath1:"+basePath1);
1831:         basePath1="../geneset20140628/";
1832:         basePath2="../20140628PPI/";
1833:         debugObj("basePath1:"+basePath1);
1845:   var url=basePath2+"gene2swiss.js";
1899: 	var url=basePath2+"swiss2gene.js";
1954: 	var url=basePath2+"swiss2swiss.js";
2021: 	var url=basePath1+"PPI.js";
2413:     	 ShowShortestPath();
2423:           document.getElementById("detectPath").disabled=false;
2428:        document.getElementById("detectPath").disabled=true;
2440:           document.getElementById("detectPath").disabled=false;
2445:        document.getElementById("detectPath").disabled=true;
2517:     document.getElementById("detectPath").disabled=true;
2531:            setTimeout("ShowShortestPath1()",1000);
2537:     setTimeout("ShowShortestPath1()",1000);
2558:        document.getElementById("detectPath").disabled=false;
2572: 	    mycurrent_row.id="pathrow"+x;
2606: 	showPath10();
2610:     document.getElementById("detectPath").disabled=false;
2627: 	  	document.getElementById("pathrow"+x).className="rowNotSelected";
2629: 	document.getElementById("pathrow"+i).className="rowSelected";
2709:        document.getElementById("detectPath").disabled=false;
2713:     swiss2paths={};
2715:     debugObj(swiss2paths[swiss2]);
2716:     debugObj(swiss2paths[swiss2].length);
2717:     ShowPaths(swiss2paths[swiss2]);
2721:     swiss2paths[swiss]=[];
2723:        swiss2paths[swiss].push(swiss);
2732:         for(var y in swiss2paths[nodes[x]]){
2733:             swiss2paths[swiss].push(swiss2paths[nodes[x]][y]+"#"+swiss);
2748:     ShowShortestPath();
2759:     addResultPath10(p);
2760:     addFirstPath10(p);
2761:     addPreviousPath10(p);
2762:     addNextPath10(p);
2763:     addLastPath10(p);
2784:     resultSPAN.addEventListener("click", function(e){showPathFirst=0;showPath10();}, false);
2807:     resultSPAN.addEventListener("click", function(e){showPathFirst=newFirst;showPath10();}, false);
2826:     resultSPAN.addEventListener("click", function(e){showPathFirst=newFirst;showPath10();}, false);
2845:     resultSPAN.addEventListener("click", function(e){showPathFirst=newFirst;showPath10();}, false);
2867: 	  	document.getElementById("pathrow"+i).style.display="none";
2870:         document.getElementById("pathrow"+i).style.display="";
956: 	 document.getElementById("allShortestPaths").style.display="none";
957: 	 document.getElementById("allShortestPathsP").style.display="none";
1253: 	graphName = "cisPathValue#"+graphName;
1267:       if(key.substr(0,13)!="cisPathValue#"){
1285: 	graphName = "cisPathValue#"+graphName;
1306: 	graphName = "cisPathValue#"+graphName;
1327:       if(key.substr(0,13)!="cisPathValue#"){
1418:     callback: "cisPathCallBack",
1682:        callback: "cisPathCallBack",
1823:     callback: "cisPathCallBack",
1850:     callback: "cisPathCallBack",
1880:     callback: "cisPathCallBack",
1905:     callback: "cisPathCallBack",
1935:     callback: "cisPathCallBack",
1960:     callback: "cisPathCallBack",
1990:     callback: "cisPathCallBack",
2025:     callback: "cisPathCallBack",
2063:     callback: "cisPathCallBack",
2380:     var graphName="cisPathHTML";
2478: function ShowShortestPathWorker(){
2479:    var worker = new Worker("./D3/cisPathWorker.js");
2482:       var resultPaths=event.data.resultPaths;
2483:       ShowPaths(resultPaths);
2486:       var resultPaths=[];
2487:       ShowPaths(resultPaths);
2516:     document.getElementById("detectPathExp").disabled=true;
2523:     document.getElementById("allShortestPaths").style.display="none";
2524:     document.getElementById("allShortestPathsP").style.display="none";
2527:            ShowShortestPathWorker();
2550:     resultPaths=allPaths;
2551:     if(resultPaths.length==0){
2557:        document.getElementById("detectPathExp").disabled=false;
2561:     var table=document.getElementById("allShortestPaths");
2569: 	for(var x in allPaths){
2570: 	    var nodes=allPaths[x].split("#");
2600:         mycurrent_button.addEventListener("click", function(e){ShowPathView(this.id);}, false);
2605: 	showPathFirst=0;
2609:     document.getElementById("detectPathExp").disabled=false;
2611:     document.getElementById("allShortestPaths").style.display="";
2612:     document.getElementById("allShortestPathsP").style.display="";
2616:     var total=resultPaths.length;
2618:     if(i>=resultPaths.length){
2621:     var nodes=resultPaths[i].split("#");
2708:        document.getElementById("detectPathExp").disabled=false;
2714:     generatePaths(swiss2, swiss1);
2731:         generatePaths(nodes[x], root);
2755:     var p=document.getElementById("allShortestPathsP");
2768:     var content="Results: "+showPathFirst+"-"+showPathEnd+" of "+resultPaths.length+" ";
2778:     if(showPathFirst==0){
2793: 	var newFirst=(resultPaths.length-resultPaths.length%10);
2794: 	if(newFirst==resultPaths.length){
2795: 	   newFirst=resultPaths.length-10;
2801:     if(showPathEnd==resultPaths.length){
2816:     if(showPathFirst==0){
2822:     var newFirst=showPathFirst-10;
2835:     if(showPathEnd==resultPaths.length){
2841:     var newFirst=showPathFirst+10;
2842:     if(newFirst >= resultPaths.length){
2843:        newFirst = (resultPaths.length-resultPaths.length%10);
2851: 	var total=resultPaths.length;
2852: 	if(showPathFirst >= total){
2853: 	   showPathFirst=(total-total%10);
2855: 	if(showPathFirst == total){
2856: 	   showPathFirst = total-10;
2858:     if(showPathFirst < 0){
2859: 	   showPathFirst = 0;
2861: 	showPathFirst=showPathFirst-(showPathFirst%10);
2862: 	showPathEnd=showPathFirst+10;
2863: 	if(showPathEnd > total){
2864: 	   showPathEnd = total;
2869:     for(var i=showPathFirst;i<showPathEnd;i++){
2942: 	document.getElementById("detectPathExp").disabled=true;
2947: 	document.getElementById("detectPathExp").disabled=false;
XNAString:src/ViennaRNA/landscape/findpath.c: [ ]
76: PRIVATE move_t                *path = NULL;
34: #define   PATH_DIRECT_FINDPATH     1U
77: PRIVATE int                   path_fwd; /* 1: s1->s2, else s2 -> s1 */
477: print_path(const char *seq,
835: free_path(vrna_path_t *path)
883: get_path(const char *seq,
243: vrna_path_findpath(vrna_fold_compound_t *fc,
288: vrna_path_options_findpath(int          width,
57: struct vrna_path_options_s {
153: vrna_path_free(vrna_path_t *path)
176: vrna_path_findpath_saddle(vrna_fold_compound_t  *vc,
186: vrna_path_findpath_saddle_ub(vrna_fold_compound_t *vc,
265: vrna_path_findpath_ub(vrna_fold_compound_t  *fc,
303: vrna_path_options_free(struct vrna_path_options_s *options)
431: vrna_path_direct(vrna_fold_compound_t       *fc,
445: vrna_path_direct_ub(vrna_fold_compound_t        *fc,
670: find_path_once(vrna_fold_compound_t *vc,
310: findpath_method(vrna_fold_compound_t  *fc,
88: #pragma omp threadprivate(BP_dist, path, path_fwd, backward_compat_compound)
132: find_path_once(vrna_fold_compound_t *vc,
155:   vrna_path_t *tmp = path;
158:     if (tmp->type == VRNA_PATH_TYPE_DOT_BRACKET) {
163:     } else if (tmp->type == VRNA_PATH_TYPE_MOVES) {
170:     free(path);
181:   return vrna_path_findpath_saddle_ub(vc, s1, s2, width, INT_MAX - 1);
197:   path_fwd  = dir = 0;
204:     path_fwd = !path_fwd;
208:     if (path)
209:       free(path);
211:     saddleE = find_path_once(vc, pt1, pt2, maxl, maxE);
217:       bestpath  = path;
218:       path      = NULL;
219:       dir       = path_fwd;
221:       free(path);
222:       path = NULL;
232:   path      = bestpath;
233:   path_fwd  = dir;
242: PUBLIC vrna_path_t *
248:   struct vrna_path_options_s  *opt;
249:   vrna_path_t                 *path;
251:   opt   = vrna_path_options_findpath(width, VRNA_PATH_TYPE_DOT_BRACKET);
252:   path  = vrna_path_direct_ub(fc,
260:   return path;
264: PUBLIC vrna_path_t *
271:   struct vrna_path_options_s  *opt;
272:   vrna_path_t                 *path;
274:   opt   = vrna_path_options_findpath(width, VRNA_PATH_TYPE_DOT_BRACKET);
275:   path  = vrna_path_direct_ub(fc,
283:   return path;
287: PUBLIC struct vrna_path_options_s *
291:   struct vrna_path_options_s *options =
292:     (struct vrna_path_options_s *)vrna_alloc(sizeof(struct vrna_path_options_s));
295:   options->method = PATH_DIRECT_FINDPATH;
309: PRIVATE vrna_path_t *
319:   vrna_path_t *route = NULL;
321:   E = vrna_path_findpath_saddle_ub(fc, s1, s2, width, maxE);
323:   /* did we find a better path than one with saddle maxE? */
325:     route = (vrna_path_t *)vrna_alloc((BP_dist + 2) * sizeof(vrna_path_t));
327:     qsort(path, BP_dist, sizeof(move_t), compare_moves_when);
330:       case VRNA_PATH_TYPE_MOVES:
331:         if (path_fwd) {
335:             route[d].move = vrna_move_init(path[d].i,
336:                                            path[d].j);
337:             route[d].en = (path[d].E / 100.0) - last_E;
338:             last_E      = path[d].E / 100.0;
347:             route[BP_dist - d - 2].move = vrna_move_init(path[d].i,
348:                                                          path[d].j);
349:             route[BP_dist - d - 2].en = last_E - (path[d].E / 100.0);
350:             last_E                    = path[d].E / 100;
359:       case VRNA_PATH_TYPE_DOT_BRACKET:
363:         if (path_fwd) {
364:           /* memorize start of path */
373:             i                 = path[d].i;
374:             j                 = path[d].j;
383:             route[d + 1].en = path[d].E / 100.0;
386:           /* memorize start of path */
395:             i                           = path[d].i;
396:             j                           = path[d].j;
405:             route[BP_dist - d - 1].en = path[d].E / 100.0;
413:     if (return_type & VRNA_PATH_TYPE_DOT_BRACKET) {
423:   free(path);
424:   path = NULL;
430: PUBLIC vrna_path_t *
434:                  struct vrna_path_options_s *options)
436:   return vrna_path_direct_ub(fc,
444: PUBLIC vrna_path_t *
449:                     struct vrna_path_options_s  *options)
452:   struct vrna_path_options_s  *o;
453:   vrna_path_t                 *route = NULL;
456:   o = options ? options : vrna_path_options_findpath(10,
457:                                                      VRNA_PATH_TYPE_DOT_BRACKET);
460:     case PATH_DIRECT_FINDPATH:
468:     vrna_path_options_free(o);
498:   qsort(path, BP_dist, sizeof(move_t), compare_moves_when);
501:     i = path[d].i;
502:     j = path[d].j;
511:     /* printf("%s %6.2f - %6.2f\n", s, vrna_eval_structure_simple(seq,s), path[d].E/100.0); */
524:   vrna_path_t *route, *r;
560:     if (path_fwd)
561:       print_path(seq, s1);
563:       print_path(seq, s2);
565:     free(path);
566:     path  = NULL;
567:     route = get_path(seq, s1, s2, maxkeep);
746:   path    = current[0].moves;
837:   vrna_path_free(path);
876:   maxE = vrna_path_findpath_saddle(vc, s1, s2, width);
882: PUBLIC vrna_path_t *
888:   vrna_path_t           *route = NULL;
916:   route = vrna_path_findpath(vc, s1, s2, maxkeep);
1: /* gcc -fopenmp -g3 -DTEST_FINDPATH findpath.c -o FINDpath -lRNA -lm -I../ -L./ */
21: #include "ViennaRNA/landscape/findpath.h"
122: #ifdef TEST_FINDPATH
124: /* TEST_FINDPATH, COFOLD */
194:   move_t  *bestpath = NULL;
214:       if (bestpath)
215:         free(bestpath);
412: #if _DEBUG_FINDPATH_
455:   /* we default to findpath method */
463:       route = findpath_method(fc, s1, s2, o->width, maxE, o->type);
474: #ifdef TEST_FINDPATH
595:   vrna_message_error("usage: findpath.c  [-m depth] [-d[0|1|2]] [-v]");
GMRP:R/path.R: [ ]
36: path<-matrix(0,(cn-1),(cn-1))
70: Path_value<-rep(NA,length(py)+1)
59: pathname<-colnames(path)
1: path <-
28: py<-rep(0,(cn-1)) # direction path coefficients
39: path[i,j]<-corrx[i,j]*py[j]
44: colnames(path)<-colnames(corrx)
45: rownames(path)<-rownames(corrx)
47: corr.outcome<-apply(path,1,sum)
48: path<-cbind(path,corr.outcome)
49: pn<-ncol(path)
57: colnames(path)[pn]<-outcome
62: path<-round(path,6)
65: R_square<-rep(NA,ncol(path))
66: Pe<-rep(NA,ncol(path))
68: #path<-rbind(path,R2)
71: Path_value[1:length(py)]<-round(py,6)
83: result<-rbind(betar,corrname,corr,pathname,path,Path_value,Pe,R_square)
cisPath:src/cisPath.cpp: [ ]
283: string path;
1491: string get_package_bin_path(string path)
122: vector<string> hasPath;
140: int outputPath = 1;
220: bool cispath(const char *input, const char *protein, const char *output)
300: vector<string> onePath;
301: int pathNum = 0;
302: bool printPath()
367: void getPath(string target)
390: bool showPath(string root)
528: bool detectPath(string root)
4123:     void R_init_cisPath(DllInfo *info)
3786: bool cispathWeb(const char *input, const char *protein, const char *output, const char * uniprot_sprot_file, con...(30 bytes skipped)...
3908: bool printPathWeb(){
3921: void getPathWeb(string& target){
3939: bool showPathWeb(string& root, string outputDir){
4015:     int cisPathC(char **input, char **protein, char **output,
4089:     static R_NativePrimitiveArgType cisPathC_t[] =
98: string get_package_bin_path(string path);
99: bool cp_html(string path, string outputDir);
210:     string package_path = get_package_bin_path(argv[0]);
211:     cp_html(package_path, outputDirName);
323:     path = realName;
346:         path = realName + " -> " + path;
351:     addRootLinks(childs, mainNodes); //only for path from root to root
359:         OUTJS1 << "\"" << path << "\"" << ";\n";
434:     OUTJSALL << "var id2Path={";
459:         string jsFile = outputDir + "/js/" + hasPath[i] + "_path.js";
1493:     string::size_type lastslash = path.rfind('/');
1496:         lastslash = path.rfind('\\');
1502:     return path.substr(0, lastslash + 1);
1529: bool cp_html(string path, string outputDir)
1531:     cp_file(path + "template/network.html", outputDir + "/network.html");
1532:     cp_file(path + "template/d3.js", outputDir + "/D3/d3.js");
1533:     cp_file(path + "template/d3.geom.js", outputDir + "/D3/d3.geom.js");
1534:     cp_file(path + "template/d3.layout.js", outputDir + "/D3/d3.layout.js");
1916:         if(tmp.substr(0, 12) == string("var id2Path="))
3909:     string path="";
3911:         if(path!=""){
3912:            path=onePath[i]+"#"+path;
3914:            path=onePath[i];
3917:     OUTJS1<<"\""<<path<<"\",\n";
3966:         string jsFile = outputDir + "/js/" + hasPath[i] + "_path.js";
91: bool cispath(const char *input, const char *protein, const char *output);
111: vector<string> hasPath;*/
146: ////////////////////g++ cisPath.cpp -o cisPath -DINDEP_PROGRAM
150:     //cerr << "cispath <PPIFile> <protein> <outputDir>";
162:     //cerr << "   -t targets.txt: output paths only for proteins";
212:     cispath(infoFile.c_str(), proteinName.c_str(), outputDirName.c_str());
216: bool detectPath(string root);
217: bool showPath(string root);
279:     detectPath(root_prot);
280:     showPath(root_prot);
304:     if(onePath.size() == 0)
315:     string current = onePath[0];
326:         addLink(current, onePath[index + 1], -1, 1);
333:         if(current == onePath[index + 1])
338:         current = onePath[index + 1];
352:     if((onePath.size() >= 4) && (pathNum > maxNum))
354:         outputPath = 0;
356:     if((pathNum >= 0) && (outputPath != 0))
358:         OUTJS1 << "allPaths[" << pathNum << "]=";
360:         OUTJS2 << "allGraphs[" << pathNum << "]=";
363:     pathNum++;
369:     onePath.push_back(target);
372:         printPath();
373:         onePath.pop_back();
376:     if(outputPath == 0)
378:         onePath.pop_back();
385:         getPath(tokens[i]);
387:     onePath.pop_back();
401:     string example = hasPath[hasPath.size() / 2];
402:     if((hasPath.size() >= 2) && (hasPath.size() <= 1155))
404:         example = hasPath[hasPath.size() - 1];
408:         for(int i = 1; i < (int)hasPath.size(); i++)
410:             if(targets.count(hasPath[i]) != 0)
412:                 example = hasPath[i];
436:     for(int i = 0; i < (int)hasPath.size(); i++)
438:         if((targetFile != "") && (targets.count(hasPath[i]) == 0))
447:         string pName = hasPath[i];
452:         pName = pName + "," + hasPath[i];
455:         OUTJSALL << "\"" << hasPath[i] << "\":1";
456:         onePath.clear();
457:         pathNum = 0;
458:         outputPath = 1;
466:         jsFile = outputDir + "/js/" + hasPath[i] + "_graph.js";
475:         getPath(hasPath[i]);
647:     hasPath = s;
1569:     hasPath.clear();
1576:     onePath.clear();
3863:      detectPath(root_prot);
3910:     for(int i=0; i<(int)onePath.size(); i++){
3922:     onePath.push_back(target);
3925:         onePath.pop_back();
3928:     if(outputPath == 0){
3929:         onePath.pop_back();
3937:     onePath.pop_back();
3957:     for(int i = 0; i < (int)hasPath.size(); i++){
3958:         if((targetFile != "") && (targets.count(hasPath[i]) == 0)){
3964:         OUTJSALL << "\"" << hasPath[i] << "\"";
3965:         onePath.clear();
3973:         OUTJS1<<"paths:[\n";
3974:         getPathWeb(hasPath[i]);
419:     OUTJSALL << "var allPaths=new Array();\n";
473:         OUTJS1 << "allPaths=new Array();\n";
3493:      OUT<<"cisPathCallBack({"<<"\n";
3517: bool processWebInput(const char *input, bool addSwiss2Swiss, bool detectPathFlag){
3599:         if(!detectPathFlag){
3724:      string resultStr="cisPathCallBack({\n";
3735:      OUT<<"cisPathCallBack({"<<"\n";
3784: void getPathWeb(string& target);
3785: bool showPathWeb(string& root, string outputDir);
3812:      bool detectPathFlag=true;
3814:           detectPathFlag=false;
3816:      if(!processWebInput(input, addSwiss2Swiss, detectPathFlag)){
3864:      showPathWeb(root_prot, output);
3924:         printPathWeb();
3935:         getPathWeb(tokens[i]);
3946:     OUTJSALL<<"cisPathCallBack({"<<"\n";
3972:         OUTJS1<<"cisPathCallBack({"<<"\n";
4003:         cispathWeb(argv[1], argv[2], argv[3], argv[4], argv[5]);
4006:         //cerr << "cispathWeb input sourceGene outputDir uniprot_sprot_file uniprot_trembl_file" << endl;
4030:         cispathWeb(input[0], protein[0], output[0], uniprot_sprot_file[0], uniprot_trembl_file[0]);
4108:         {".cisPathC", (DL_FUNC) &cisPathC, 9, cisPathC_t},
ShortRead:R/methods-RochePath.R: [ ]
72:     path <- readPath(object)
1: RochePath <- function(experimentPath=NA_character_,
16: .readFasta_RochePath <- function(dirPath,
30: .readQual_RochePath <- function(dirPath,
44: .readFastaQual_RochePath <- function(dirPath, fastaPattern = "\\.fna$",
71: .sampleNames_RochePath <- function(object) {
81: .runNames_RochePath <- function(object) {
73:     if (!is.na(path))
74:         sub("_.*", "", basename(.file_names(path, "\\.fna")))
2:                       readPath=experimentPath,
3:                       qualPath=readPath,
6:       .checkPath(experimentPath)
7:       .checkPath(readPath)
8:       .checkPath(qualPath)
10:     new("RochePath", ..., basePath=experimentPath,
11:         readPath=readPath, qualPath=qualPath)
14: .make_getter(c("readPath", "qualPath"))
21:   dirPath <- .file_names(readPath(dirPath)[run], pattern)[sample]
22:   if (any(is.na(dirPath)))
24:                    "readPath", "dirPath"))
25:   callGeneric(dirPath, ..., nrec=nrec, skip=skip)
28: setMethod(readFasta, "RochePath", .readFasta_RochePath)
35:   dirPath <- .file_names(qualPath(dirPath)[run], pattern)[sample]
36:   if (any(is.na(dirPath)))
38:                    "qualPath", "dirPath"))
39:   callGeneric(dirPath, ..., reads = reads)
42: setMethod(readQual, "RochePath", .readQual_RochePath)
48:   reads <- readFasta(dirPath, fastaPattern, sample, run)
49:   quals <- readQual(dirPath, reads, qualPattern, sample, run)
54: setMethod(read454, "RochePath",
55:           function(dirPath, ...) readFastaQual(dirPath, ...))
57: setMethod(readFastaQual, "RochePath", .readFastaQual_RochePath)
59: setMethod(readBaseQuality, "RochePath",
60:           function(dirPath, ...) .readFastaQual_RochePath(dirPath, ...))
62: .readFastaQual_character <- function(dirPath, fastaPattern = "\\.fna$",
66:   callGeneric(RochePath(dirPath), fastaPattern, qualPattern, sample, run)
79: setMethod(sampleNames, "RochePath", .sampleNames_RochePath)
82:   basename(readPath(object))
85: setMethod(runNames, "RochePath", .runNames_RochePath)
87: setMethod(show, "RochePath", function(object) {
92: setMethod(detail, "RochePath", function(x, ...) {
89:     .show_additionalPathSlots(object)
94:     .detail_additionalPathSlots(x)
chromDraw:src/libBoard/include/board/Path.h: [ ]
59: struct Path { 
61:   Path() : _closed( false ) { }
63:   Path( const std::vector<Point> & points, bool closed )
66:   Path( bool closed ) : _closed( closed ) { }    
43: #define _BOARD_PATH_H_
3:  * @file   Path.h
42: #ifndef _BOARD_PATH_H_
56:  * The path structure.
57:  * @brief A path, according to Postscript and SVG definition.
79:    * Barycenter of the path
85:    * Add a point at the end of the path.
91:   Path & operator<<( const Point & p );
99:   Path & pop_back();
131:   Path & rotate( double angle, const Point & center );
141:   Path rotated( double angle, const Point & center ) const;
150:   Path & rotate( double angle );
159:   Path rotated( double angle ) const;
169:   Path & translate( double dx, double dy );
179:   Path translated( double dx, double dy ) const;
189:   Path & scale( double sx, double sy );
198:   Path & scale( double s );
208:   Path scaled( double sx, double sy )  const;
210:   Path scaled( double s )  const;
239: Path::clear()
245: Path::closed() const
251: Path::empty() const
257: Path::size() const
263: Path::setClosed( bool closed )
270: #endif /* _PATH_H_ */
ImmuneSpaceR:tests/testthat/test-localPath.R: [ ]
12:     path <- .localStudyPath(link = link),
5: testPath <- function(labkey.url.base, link, pipelineRoot) {
10:   .localStudyPath <- con$.__enclos_env__$private$.localStudyPath
1: context("private$.localStudyPath()")
22:   res <- testPath(
31:   res <- testPath(
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)
ELMER:R/plots.R: [ ]
892:   readr::write_delim(pairs, path = filename, append = TRUE)
582:         write_tsv(cbind(as.data.frame(pairs)[,c(1:3,6)],corretlation.tab),path = file.name.table)
596:         write_tsv(cbind(as.data.frame(pairs)[,c(1:3,6)],corretlation.tab),path = file.name.table)
942:       filename <- file.path(dir,track.names[idx])
944:       filename <- file.path(dir,paste0(sample,".bw"))
962: #' dir(path = "analysis",
1036:                   ret <- summarizeTF(path = x,
1071:                         function(path){
1072:                           TF <- readr::read_csv(dir(path = path, pattern = ".significant.TFs.with.motif.summary.csv",
1074:                           motif <- readr::read_csv(dir(path = path, pattern = ".motif.enrichment.csv",
1097:                           function(path){
1098:                             TF <- readr::read_csv(dir(path = path, 
1101:                             motif <- readr::read_csv(dir(path = path, 
1109:                             TF.meth.cor <- get(load(dir(path = path, pattern = ".TFs.with.motif.pvalue.rda", recursive = T, full.names = T)))
1152:                              function(path){
1153:                                TF <- readr::read_csv(dir(path = path, 
1157:                                motif <- readr::read_csv(dir(path = path, 
1167:                                TF.meth.cor <- get(load(dir(path = path, 
1181:                                TF.meth.cor$analysis <- path
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)
Rgraphviz:src/graphviz/lib/common/types.h: [ ]
105:     typedef struct path {	/* internal specification for an edge spline */
110:     } path;
656: 	Ppolyline_t path;
685: #define ED_path(e) (((Agedgeinfo_t*)AGDATA(e))->path)
714: #define ED_path(e) (e)->u.path
97:     typedef struct pathend_t {
103:     } pathend_t;
158: 	/* we would have called it a path if that term wasn't already used */
174: 	 * It is used as the clipping path */
182: 	int (*pboxfn)(node_t* n, port* p, int side, boxf rv[], int *kptr); /* finds box path to reach port */
34: #include "pathgeom.h"
GeneTonic:R/GeneTonic.R: [ ]
1865:       path <- system.file("doc", "GeneTonic_manual.html", package = "GeneTonic")
1866:       if (path == "") {
1869:         browseURL(path)
IONiseR:R/fast5Readers.R: [ ]
375:         path <- paste0("/Analyses/Basecall_", d, "_000/Log")
376:         exists <- .groupExistsObj(fid, group = path)
378:             did <- H5Dopen(fid, path)
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",
ChemmineR:R/AllClasses.R: [ ]
1734: 	path <- conMA(x, exclude="H")
1979:             path <- .linearCon(x=con)
1800: 	conpath <- t(sapply(path, function(x) x[c(1, length(x))]))
1812: 	pathlist <- cyclist$path
1813: 	conpath <- cyclist$conpath
1814: 	pathlistnew <- list() 
1735: 	noconnect <- rowSums(path) != 0 # Removes atoms with no connections
1736: 	path <- path[noconnect, noconnect]
1737: 	if(all(dim(path) == 0)) { return(path) } 
1738: 	term <- which(rowSums(path > 0)==1)
1740: 		path <- path[-term,-term]
1741: 		if(any(dim(path) == 0) | is.vector(path)) { break() }
1742: 		term <- which(rowSums(path > 0)==1)
1744: 	return(path)
1779: .update <- function(con, path) {
1780: 	## Remove non-terminal atoms in each path
1781: 	center_atoms <- unique(unlist(lapply(path, function(x) x[-c(1, length(x))])))
1791: 		path <- c(path, remainbonds)
1792: 		names(path) <- seq(along=path)
1794: 	## Collect complete rings and remove them from path object
1795: 	index <- unlist(lapply(path, function(y) any(duplicated(y))))
1796: 	rings <- path[index]
1797: 	path <- path[!index]
1798: 	names(path) <- seq(along=path)
1799: 	## Connection list for path component
1806: 	return(list(con=con, conpath=conpath, path=path, rings=rings))
1850: 		## Collect complete rings and remove them from path object
1980:             cyclist <- .update(con=con, path=path)
13: .sdfDownload <- function(mypath="ftp://ftp.ncbi.nih.gov/pubchem/Compound/CURRENT-Full/SDF/", myfile="Compound_00650001_00675000.sdf...(7 bytes skipped)...
14: 	system(paste("wget ", mypath, myfile, sep=""))
17: # .sdfDownload(mypath="ftp://ftp.ncbi.nih.gov/pubchem/Compound/CURRENT-Full/SDF/", myfile="Compound_00650001_00675000.sdf...(6 bytes skipped)...
1747: ## (b) Function to return the longest possible linear bond paths where:
1801: 	ends <- unique(as.vector(conpath))
1802: 	conpath <- lapply(ends, function(x) as.numeric(names(which(rowSums(conpath==x) > 0))))
1803: 	names(conpath) <- ends
1804: 	conpath <- conpath[sapply(conpath, length) > 1] # removes ends that occur only once 
1816: 	## Loop to join linear paths/fragments stored in pathlist
1817: 	for(i in names(conpath)) {
1818: 		if(length(conpath) == 0 | !any(names(conpath) == i)) { next() }
1819: 		pos <- t(combn(conpath[[i]], m=2))
1821: 			p1 <- pathlist[[pos[j,1]]]
1822: 			p2 <- pathlist[[pos[j,2]]]
1827: 				pathlistnew[[length(pathlistnew)+1]] <- c(rev(p2[-1]), p1)
1830: 				pathlistnew[[length(pathlistnew)+1]] <- c(p1, rev(p2[-length(p2)]))
1833: 				pathlistnew[[length(pathlistnew)+1]] <- c(p2, p1[-1])
1836: 				pathlistnew[[length(pathlistnew)+1]] <- c(p1, p2[-1])
1840: 		if(length(pathlistnew) == 0) { next() }
1842: 		dups <- duplicated(sapply(pathlistnew, function(x) paste(sort(unique(x)), collapse="_")))
1843: 		pathlistnew <- pathlistnew[!dups]
1846: 			l <- sapply(pathlistnew, length)
1847: 			pathlistnew <- pathlistnew[l <= upper]
1848: 			if(length(pathlistnew) == 0) { next() }
1851: 		index <- unlist(lapply(pathlistnew, function(y) any(duplicated(y[c(1, length(y))]))))
1852: 		rings[[length(rings)+1]] <- pathlistnew[index]
1853: 		pathlistnew <- pathlistnew[!index]
1854: 		## Remove paths with internal duplicates 
1855: 		if(length(pathlistnew) > 0) {
1856: 			index <- unlist(lapply(pathlistnew, function(y) any(duplicated(y))))
1857: 			pathlistnew <- pathlistnew[!index]
1859: 		## Update pathlist and conpath
1860: 		pathlist <- c(pathlist[-conpath[[i]]], pathlistnew)
1861: 		dups <- duplicated(sapply(pathlist, function(x) paste(sort(unique(x)), collapse="_")))
1862: 		pathlist <- pathlist[!dups]
1863: 		names(pathlist) <- seq(along=pathlist)
1864: 		conpath <- t(sapply(pathlist, function(x) x[c(1, length(x))]))
1865: 		ends <- unique(as.vector(conpath))
1866: 		conpath <- lapply(ends, function(x) as.numeric(names(which(rowSums(conpath==x) > 0))))
1867: 		names(conpath) <- ends
1868: 		conpath <- conpath[sapply(conpath, length) > 1] # removes ends that occur only once
1869: 		pathlistnew <- list()
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)
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)...
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="")
gdsfmt:src/CoreArray/dFile.cpp: [ ]
1664: CdGDSObj *CdGDSFolder::Path(const UTF8String &FullName)
2171: CdGDSObj *CdGDSVirtualFolder::Path(const UTF8String &FullName)
1298: static const char *ERR_INVALID_PATH  = "The GDS node \"%s\" does not exist.";
1672: CdGDSObj *CdGDSFolder::PathEx(const UTF8String &FullName)
2177: CdGDSObj *CdGDSVirtualFolder::PathEx(const UTF8String &FullName)
1668: 		throw ErrGDSObj(ERR_INVALID_PATH, FullName.c_str());
2174: 	return fLinkFile->Root().Path(FullName);
1666: 	CdGDSObj *rv = PathEx(FullName);
2180: 	return fLinkFile->Root().PathEx(FullName);
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())
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)...
GeneGeneInteR:R/PLSPM.R: [ ]
207:     Path = inner_results[[2]]
1162:   Path = path_matrix
2176:     Path <- pathmod[[2]]
48:   my.path <- rbind(Gene1,Gene2)
209:     Path_effects = get_effects(Path)
363: check_path <- function(path_matrix)
1173:     path_lm = summary(lm(Y_lvs[,k1] ~ Y_lvs[,k2]))
1202:   path_effects = as.list(seq_len(lvs-1))
2177:     path.orig <- as.vector(Path[path_matrix==1])
2179:     Path.efs <- get_effects(Path)
2186:     path.labs <- NULL
2175:     pathmod <- get_paths(path_matrix, Y.lvs)
2194:     PATHS <- matrix(NA, bootnum, sum(path_matrix))
1805: get_path_scheme <- function(path_matrix, LV)
1156: get_paths <-  function(path_matrix, Y_lvs, full=TRUE)
1207:     indirect_paths = matrix(c(0,0,0,0), 2, 2)
1208:     total_paths = Path
55:   try(mod1 <- plspm(XCases,my.path,my.blocks, modes = my.modes), silent=TRUE)
59:   	res <- list(statistic=NA,p.value=NA,method="Partial Least Squares Path Modeling",parameter=list.param)
64:   try(mod0 <- plspm(XControls,my.path,my.blocks, modes = my.modes),silent=TRUE)
68:   	res <- list(statistic=NA,p.value=NA,method="Partial Least Squares Path Modeling",parameter=list.param)
91: 		try(mod1 <- plspm(XCases,my.path,my.blocks, modes = my.modes), silent=TRUE)
93: 		try(mod0 <- plspm(XControls,my.path,my.blocks, modes = my.modes),silent=TRUE)
110: #	res <- list(statistic=stat,p.value=pval,method="Partial Least Squares Path Modeling",parameter=list.param)
123: 		method="Gene-based interaction based on Partial Least Squares Path Modeling",
138:   function(Data, path_matrix, blocks, modes = NULL, scaling = NULL,  
146:     valid = check_args(Data=Data, path_matrix=path_matrix, blocks=blocks, 
153:     path_matrix = valid$path_matrix
167:     gens = get_generals(MV, path_matrix)
188:       weights = get_weights(X, path_matrix, blocks, specs)
194:       weights = get_weights_nonmetric(X, path_matrix, blocks, specs)
203:     # Path coefficients and total effects
205:     inner_results = get_paths(path_matrix, LV)
241:     inner_summary = get_inner_summary(path_matrix, blocks, specs$modes,
245:     gof = get_gof(communality, R2, blocks, path_matrix)
259:         bootstrap = get_boots(MV, path_matrix, blocks, specs, br)
264:     model = list(IDM=path_matrix, blocks=blocks, specs=specs,
270:                path_coefs = Path, 
274:                effects = Path_effects,
289:   cat("Partial Least Squares Path Modeling (PLS-PM)", "\n")
294:   cat("\n3  $path_coefs     ", "path coefficients matrix")
314:   function(Data, path_matrix, blocks, scaling, modes, scheme,
319:     path_matrix = check_path(path_matrix)
327:     good_model = check_model(path_matrix, blocks)
331:          path_matrix = path_matrix,
365:   if (is_not_matrix(path_matrix))
366:     stop("\n'path_matrix' must be a matrix.")
368:   if (!is_square_matrix(path_matrix))
369:     stop("\n'path_matrix' must be a square matrix.")
371:   if (nrow(path_matrix) == 1)
372:     stop("\n'path_matrix' must have more than one row")
374:   if (!is_lower_triangular(path_matrix))
375:     stop("\n'path_matrix' must be a lower triangular matrix")
378:   for (j in seq_len(ncol(path_matrix))) 
380:     for (i in seq_len(nrow(path_matrix)))
382:       if (length(intersect(path_matrix[i,j], c(1,0))) == 0)
383:         stop("\nElements in 'path_matrix' must be '1' or '0'")
387:   if (lacks_dimnames(path_matrix)) {
388:     LV_names = paste("LV", seq_len(ncol(path_matrix)), sep = "")
389:     dimnames(path_matrix) = list(LV_names, LV_names)
391:   if (has_rownames(path_matrix) && lacks_colnames(path_matrix)) {
392:     colnames(path_matrix) = rownames(path_matrix)
394:   if (has_colnames(path_matrix) && lacks_rownames(path_matrix)) {
395:     rownames(path_matrix) = colnames(path_matrix)
399:   path_matrix
458: check_model <- function(path_matrix, blocks)
460:   # compatibility between path_matrix and blocks
461:   if (length(blocks) != nrow(path_matrix))
462:     stop("\nNumber of rows in 'path_matrix' different from length of 'blocks'.")
687:   SCHEMES = c("centroid", "factorial", "path")
884: get_generals <- function(MV, path_matrix)
890:        lvs = nrow(path_matrix),
891:        lvs_names = rownames(path_matrix))
1035: get_weights <- function(X, path_matrix, blocks, specs)
1037:   lvs = nrow(path_matrix)
1055:                 "centroid" = sign(cor(Y) * (path_matrix + t(path_matrix))),
1056:                 "factorial" = cor(Y) * (path_matrix + t(path_matrix)),
1057:                 "path" = get_path_scheme(path_matrix, Y))
1083:     dimnames(W) = list(colnames(X), rownames(path_matrix))    
1158:   lvs_names = colnames(path_matrix)
1159:   endogenous = as.logical(rowSums(path_matrix))
1164:   R2 = rep(0, nrow(path_matrix))
1171:     k2 = which(path_matrix[k1,] == 1)
1174:     Path[k1,k2] = path_lm$coef[-1,1]
1175:     residuals[[aux]] = path_lm$residuals  
1176:     R2[k1] = path_lm$r.squared
1177:     inn_val = c(path_lm$r.squared, path_lm$coef[,1])
1180:     rownames(path_lm$coefficients) = inn_labels
1181:     results[[aux]] <- path_lm$coefficients
1184:     # paste(rep("path_",length(k2)),names(k2),sep=""))
1192:   list(results, Path, R2, residuals)
1195: get_effects <- function(Path)
1198:   lvs = nrow(Path)
1199:   lvs_names = rownames(Path)
1203:   path_effects[[1]] = Path
1212:       path_effects[[k]] = path_effects[[k-1]] %*% Path        
1215:     for (k in 2:length(path_effects)) {
1216:       indirect_paths = indirect_paths + path_effects[[k]]        
1218:     total_paths = Path + indirect_paths
1227:         direct = c(direct, Path[i,j])
1325:   function(path_matrix, blocks, modes, communality, redundancy, R2)
1328:     exo_endo = rep("Exogenous", nrow(path_matrix))
1329:     exo_endo[rowSums(path_matrix) != 0] = "Endogenous"
1330:     avg_comu = rep(0, nrow(path_matrix))
1331:     avg_redu = rep(0, nrow(path_matrix))
1332:     AVE = rep(0, nrow(path_matrix))
1334:     for (k in seq_len(nrow(path_matrix)))
1352:                row.names = rownames(path_matrix))
1355: get_gof <- function(comu, R2, blocks, path_matrix)
1357:   lvs = nrow(path_matrix)
1359:   endo = rowSums(path_matrix)
1392: get_weights <- function(X, path_matrix, blocks, specs)
1394:   lvs = nrow(path_matrix)
1412:                 "centroid" = sign(cor(Y) * (path_matrix + t(path_matrix))),
1413:                 "factorial" = cor(Y) * (path_matrix + t(path_matrix)),
1414:                 "path" = get_path_scheme(path_matrix, Y))
1440:     dimnames(W) = list(colnames(X), rownames(path_matrix))    
1478:   function(X, path_matrix, blocks, specs)
1480:     lvs = nrow(path_matrix)
1541:     link = t(path_matrix) + path_matrix
1556:                   "path" = get_path_scheme(path_matrix, Y))
1751:       dimnames(W) = list(colnames(X), rownames(path_matrix))
1752:       dimnames(Y) = list(rownames(X), rownames(path_matrix))
1808:   E = path_matrix
1810:   for (k in seq_len(ncol(path_matrix))) 
1813:     follow <- path_matrix[k,] == 1
1817:     predec <- path_matrix[,k] == 1
2141:   function(DM, path_matrix, blocks, specs, br)
2146:     lvs = nrow(path_matrix)
2147:     lvs.names = rownames(path_matrix)
2151:     endo = sign(rowSums(path_matrix))
2162:       out.ws = get_weights(X, path_matrix, blocks, specs)
2168:       out.ws = get_weights_nonmetric(X, path_matrix, blocks, specs)
2190:         if (path_matrix[i,j]==1) 
2191:           path.labs <- c(path.labs, paste(lvs.names[j],"->",lvs.names[i]))
2195:     TOEFS <- matrix(NA, bootnum, nrow(Path.efs))
2207:         w.boot = get_weights(X.boot, path_matrix, blocks, specs)
2215:         w.boot = get_weights_nonmetric(X.boot, path_matrix, blocks, specs)
2225:       pathmod <- get_paths(path_matrix, Y.boot)
2228:       PATHS[i,] <- as.vector(P.boot[path_matrix==1])
2249:     # Path coefficients
2250:     colnames(PATHS) = path.labs
2251:     PB = get_boot_stats(PATHS, path.orig)
2256:     colnames(TOEFS) = Path.efs[, 1]
2257:     TE = get_boot_stats(TOEFS, Path.efs[,4]) 
1214:     indirect_paths = matrix(0, lvs, lvs)
1228:         indirect = c(indirect, indirect_paths[i,j])
1229:         total = c(total, total_paths[i,j])
2178:     r2.orig <- pathmod[[3]][endo==1]
2226:       P.boot <- pathmod[[2]]
2230:       RSQRS[i,] <- pathmod[[3]][endo==1]
2262:          paths = PB, 
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) }
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)))
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
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"),
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"),
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))
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 ####################
methylPipe:R/Allfunctions.R: [ ]
223:       path <- paste0(files_location,"/",all_files[[i]])
28:     filename <- file.path(output_folder,
31:     filename <- file.path(output_folder,
58:     all_files <- list.files(path = files_location, pattern = ".sam")
63:     output.files[[read.context]] <- file.path(output_folder,
66:     read.files <- file.path(files_location, all_files)
97:         asBam(file.path(files_location, all_files[i]), destination=file.path(temp_folder, sample_name[i]), overwrite=TRUE)
101:     bam.files <- file.path(path = temp_folder, paste(sample_name, ".bam", sep=""))
112:             filename <- file.path(output_folder, paste0(sample_name[[i]],"_uncov", ".Rdata"))
220:     all_files <- list.files(path = files_location, pattern = ".txt")
224:       temp_data <- fread(path,nrows=10)
227:         cmd <- paste("sed -i 's/\"//g'",path)
229:         cmd <- paste("sed -i 's/^/chr/'",path) 
268:     Tabix_files <- list.files(path = files_location, pattern = "_tabix.txt")
11:     output_folder <- normalizePath(output_folder)  
50:     files_location <- normalizePath(files_location)
51:     output_folder <- normalizePath(output_folder)
132:   files_location <- normalizePath(files_location)
186: BSprepare <-  function(files_location, output_folder, tabixPath, bc=1.5/100) {
191:     if(!is.character(tabixPath))
192:         stop('tabixPath has to be of class character ..')
193:     if(!file.exists(paste(tabixPath, '/tabix', sep='')))
194:         stop('tabix not found at tabixPath ..')
195:     if(!file.exists(paste(tabixPath, '/bgzip', sep='')))
196:         stop('bgzip not found at tabixPath ..')
198:     files_location <- normalizePath(files_location)
199:     output_folder <- normalizePath(output_folder)
200:     tabixPath <- normalizePath(tabixPath)
276:         str <- paste0(tabixPath, '/bgzip ', output_folder, "/", filetb_name,"_out.txt")
280:         str <- paste(tabixPath, '/tabix -s 1 -b 2 -e 2 -f ', fileoutgz, sep='')
ISAnalytics:R/internal-functions.R: [ ]
431:             path = project_folder, recurse = TRUE,
734:                 path = association_file,
376:     path_cols <- .path_cols_names()
501:     path_col_names <- .path_cols_names()
1226:     path_col_names <- .path_cols_names()
540:     stats_paths <- purrr::pmap_dfr(temp, function(...) {
609:     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)
291:             df <- readr::read_delim(path,
301:             df <- readxl::read_excel(path,
358: # @param root_folder Path to the root folder
364: # corresponding path on disk if found, NA otherwise.
384:                 fs::path(
385:                     fs::path(root_folder),
396:             !!path_cols$project := NA_character_,
397:             !!path_cols$quant := NA_character_,
398:             !!path_cols$iss := NA_character_
402:         project_folder <- fs::path(
403:             fs::path(root_folder),
407:             paste0(fs::path(
409:                 fs::path(cur$concatenatePoolIDSeqRun)
423:             paste0(fs::path(
425:                 fs::path(cur$concatenatePoolIDSeqRun)
439:             path = project_folder, recurse = TRUE,
449:                     !!path_cols$project := project_folder,
450:                     !!path_cols$quant := quant_found,
451:                     !!path_cols$iss := iss_found
467: # file by adding a column `Path` where the absolute path on disk for the
468: # project and pool is found, if no path is found NA is inserted instead.
492: # Finds automatically the path on disk to each stats file.
499: # Path_iss (or designated dynamic name), stats_files, info
506:             .data[[path_col_names$iss]]
516:     if (all(is.na(temp[[path_col_names$iss]]))) {
523:         if (is.na(temp_row[[path_col_names$iss]])) {
531:         files <- fs::dir_ls(temp_row[[path_col_names$iss]],
730:     ## Import association file if provided a path
740:     if (!.path_cols_names()$quant %in% colnames(association_file)) {
741:         rlang::abort(.af_missing_path_error(.path_cols_names()$quant),
742:             class = "missing_path_col"
746:         dplyr::filter(!is.na(.data[[.path_cols_names()$quant]]))
756:     # If it's a path to file import the association file
1217: #' @importFrom fs dir_ls as_fs_path
1231:             .data[[path_col_names$quant]]
1265:             matches <- fs::dir_ls(temp_row[[path_col_names$quant]],
1312: # @param dupl The tibble containing quantification types and path to the files
1360: # * Removing files not found (files for which Files_count$Found == 0 and Path
1491: #' @importFrom fs path_ext
1498: .import_single_matrix <- function(path, to_exclude = NULL, separator = "\t") {
1499:     stopifnot(!missing(path) & is.character(path))
1501:     if (!file.exists(path)) {
1502:         rlang::abort(paste("File not found at", path))
1504:     if (!fs::is_file(path)) {
1505:         rlang::abort(paste("Path exists but is not a file"))
1509:     is_compressed <- fs::path_ext(path) %in% .compressed_formats()
1512:         compression_type <- fs::path_ext(path)
1519:     peek_headers <- readr::read_delim(path,
1534:             path = path, to_drop = to_exclude,
1540:             path = path, to_drop = to_exclude,
1727: #' @importFrom fs as_fs_path
1765:                     dplyr::mutate(Files_found = fs::as_fs_path(
1785:                     dplyr::mutate(Files_found = fs::as_fs_path(
1871: # * Removing files not found (files for which Files_count$Found == 0 and Path
2889: # @param file_path The file path as a string
2890: #' @importFrom fs dir_create path_wd path
2895: .write_recalibr_map <- function(map, file_path) {
2896:     if (fs::is_dir(file_path)) {
2897:         if (!fs::dir_exists(file_path)) {
2898:             fs::dir_create(file_path)
2901:         file_path <- fs::path(file_path, gen_filename)
2903:         if (fs::path_ext(file_path) == "") {
2904:             file_path <- fs::path_ext_set(file_path, "tsv.gz")
2909:             data.table::fwrite(map, file = file_path, sep = "\t", na = "")
2912:                 file_path
3480:                 x = "Did you provide the correct path?"
3497:                 x = "Did you provide the correct path?"
7: # Returns the file format for each of the file paths passed as a parameter.
366:     if (!"PathToFolderProjectID" %in% colnames(df)) {
367:         rlang::abort(.af_missing_pathfolder_error())
373:             .data$PathToFolderProjectID
378:         dplyr::select(.data$PathToFolderProjectID) %>%
381:             .data$PathToFolderProjectID
386:                     .data$PathToFolderProjectID
390:         dplyr::left_join(proj_folders_exist, by = "PathToFolderProjectID")
404:             cur$PathToFolderProjectID
476: # @return An updated association file with absolute paths
482:                 -.data$PathToFolderProjectID,
515:     # If paths are all NA return
595:     stats_paths
608:     # Obtain paths
610:     stats_paths <- stats_paths %>%
612:     if (all(is.na(stats_paths$stats_files))) {
613:         stats_paths <- stats_paths %>%
619:         return(list(stats = NULL, report = stats_paths))
626:             tasks = length(stats_paths$stats_files),
633:             tasks = length(stats_paths$stats_files),
659:         BiocParallel::bplapply(stats_paths$stats_files,
674:     stats_paths <- stats_paths %>%
676:     stats_paths <- purrr::pmap_dfr(stats_paths, function(...) {
693:     stats_paths <- stats_paths %>%
695:     stats_dfs <- stats_dfs[stats_paths$Imported]
698:         return(list(stats = NULL, report = stats_paths))
705:     list(stats = stats_dfs, report = stats_paths)
1584: # @param files Files_found table were absolute paths of chosen files
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
EnMCB:R/utils.R: [ ]
196:           path = getwd(),dpi = 300,units = "in",width = 10, height = 5,
252:            path = getwd(),dpi = 300,units = "in",width = 5, height = 4.5,
365:                     path = getwd(),dpi = 300,units = "in",width = 5, height = 5,
168:          path = getwd(),dpi = 300,units = "in",width = 5, height = 4.5,
298:          path = getwd(),dpi = 300,units = "in",width = 5, height = 4.5,
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]
recountmethylation:inst/scripts/data_analyses.R: [ ]
26: path <- system.file("extdata", "metadata", package = "recountmethylation")
20: savepath <- paste(dfp, env.name, sep = "/")
27: mdpath <- paste(path, list.files(path)[1], sep = "/")
327:   save(ds, file = file.path("data_analyses", "df-l2med-signals.rda"))
28: md <- get(load(mdpath))
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",
maigesPack:R/plot-methods.R: [ ]
190:         Path <- list(Type1=new("graphNEL", vertices, edgeL=arestas1),
326:         Path <- new("graphNEL", vertices, edgeL=arestas)
167:     graphPath <- function(data=NULL, cuttoffPvalue) {
309:     graphPath <- function(data=NULL, cuttoffCor=NULL, cuttoffP=NULL) {
194:         return(Path)
327:         return(Path)
287:     graph <- graphPath(x, cutPval)
426:         graph <- graphPath(x, cutCor, NULL)
431:         graph <- graphPath(x, NULL, cutPval)
BiocFileCache:R/BiocFileCache-class.R: [ ]
495:     path <- .sql_get_rpath(x, rids)
531:     update_time_and_path <- function(x, i) {
540:             locfile_path <- file.path(bfccache(x), id)
402:     rpath <- .sql_add_resource(x, rname, rtype, fpath, ext)
1001:         fpath <- .sql_get_fpath(x, rid)
1185:     paths <- .sql_get_rpath(x, bfcrid(x))
1312:             newpath <- file.path(dir, basename(orig))
1385:     exportPath <- file.path(exdir, "BiocFileCacheExport")
1131:     rpaths <- .sql_get_rpath(x, rids)
1433:     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.
541:             locfile <- .lock2(locfile_path, exclusive = TRUE)
550:                     names(update_time_and_path(x, res))
559:                 .unlock2(locfile_path)
562:             names(update_time_and_path(x, res))
589:         update_time_and_path(x, rids)
670:                     "Setting a new remote path results in immediate\n",
1069: #' @return For 'bfcdownload': character(1) path to downloaded resource
1184:     files <- file.path(bfccache(x), setdiff(dir(bfccache(x)),c(.CACHE_FILE, .CACHE_FILE_LOCK)))
1253: #' @return character(1) The outputFile path.
1275:     dir <- file.path(tempdir(), "BiocFileCacheExport")
1316:                 newpath <- file.path(dir, filename)
1343:         outputFile = file.path(origdir, outputFile)
1353:     .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)
586:         bfcrpath(x, rids = rids0)
609: #' @param rpath character() vector of replacement rpaths.
613: #' bfcupdate(bfc0, rid3, rpath=fl3, rname="NewRname")
615: #' bfcupdate(bfc0, "BFC5", fpath="http://google.com")
619:     function(x, rids, rname=NULL, rpath=NULL, fpath=NULL,
625:         is.null(rpath) || (length(rids) == length(rpath)),
626:         is.null(fpath) || (length(rids) == length(fpath))
630:         is.null(rpath) || is.character(rpath),
631:         is.null(fpath) || is.character(fpath)
644:         if (!is.null(rpath)) {
645:             if (!file.exists(rpath[i]))
649:                     "\n  rpath: ", sQuote(rpath[i]),
650:                     "\n  reason: rpath does not exist.",
653:             .sql_set_rpath(x, rids[i], rpath[i])
656:                 warning("updating rpath, changing rtype to 'local'")
661:         if (!is.null(fpath)) {
679:                     x, rids[i], proxy, config, "bfcupdate()", fpath[i], ...
681:                 .sql_set_fpath(x, rids[i], fpath[i])
863:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
872:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
885: #'     matches pattern agains rname, rpath, and fpath. If exact
890: #'     \code{bfcrpath}, the default is \code{TRUE} (exact matching).
902:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
978: #'     'rid'. \code{TRUE}: fpath \code{etag} or \code{modified} time of
979: #'     web resource more recent than in BiocFileCache; \code{FALSE}: fpath
1004:         cache_info <- .httr_get_cache_info(fpath)
1086:     if (ask && any(file.exists(.sql_get_rpath(x, rid)))) {
1097:     bfcrpath(x, rids=rid)
1186:     # normalizePath on windows
1189:         files = normalizePath(files)
1190:         paths = normalizePath(paths)
1192:     untracked <- setdiff(files, paths)
1247: #' @param outputFile character(1) The <filepath>/basename for the
1311:             orig <- .sql_get_rpath(x, i)
1313:             if (file.exists(newpath)) {
1318:             file.copy(orig, newpath)
1386:     stopifnot(!dir.exists(exportPath))
1396:     bfc = BiocFileCache(exportPath)
348: #'     \code{httr::GET}. For 'bfcrpaths': Additional arguments passed
481: #' @describeIn BiocFileCache display rpaths of resource.
1132:     cached <- startsWith(rpaths, bfccache(x))
1135:     status <- .util_unlink(rpaths[cached])
1434:     cached <- startsWith(rpaths, bfccache(x))
1437:         txt0 <- paste("file ", sQuote(rpaths))
1446:     .util_unlink(rpaths[cached])
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,
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)
Director:inst/www/js/d3.v3.js: [ ]
4199:   d3.geo.path = function() {
4201:     function path(object) {
6082:   function d3_layout_bundlePath(link) {
3936:   var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = {
3963:   var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1;
3971:   function d3_geo_pathBoundsPoint(x, y) {
4022:   function d3_geo_pathBufferCircle(radius) {
4038:   function d3_geo_pathCentroidPoint(x, y) {
4057:   function d3_geo_pathCentroidLineEnd() {
4246:   function d3_geo_pathProjectStream(project) {
4209:     path.area = function(object) {
4214:     path.centroid = function(object) {
4219:     path.bounds = function(object) {
4224:     path.projection = function(_) {
4229:     path.context = function(_) {
4235:     path.pointRadius = function(_) {
4238:       return path;
4242:       return path;
4244:     return path.projection(d3.geo.albersUsa()).context(null);
7979:       var rc, cr, rp, ap, p0 = 0, p1 = 0, x0, y0, x1, y1, x2, y2, x3, y3, path = [];
8027:             path.push("M", t30[0], "A", rc1, ",", rc1, " 0 0,", cr, " ", t30[1], "A", r1, ",", r1, " 0 ", 1 - cw ^ d...(128 bytes skipped)...
8029:             path.push("M", t30[0], "A", rc1, ",", rc1, " 0 1,", cr, " ", t12[0]);
8032:           path.push("M", x0, ",", y0);
8037:             path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t21[1], "A", r0, ",", r0, " 0 ", cw ^ d3_sv...(128 bytes skipped)...
8039:             path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]);
8042:           path.push("L", x2, ",", y2);
8045:         path.push("M", x0, ",", y0);
8046:         if (x1 != null) path.push("A", r1, ",", r1, " 0 ", l1, ",", cw, " ", x1, ",", y1);
8047:         path.push("L", x2, ",", y2);
8048:         if (x3 != null) path.push("A", r0, ",", r0, " 0 ", l0, ",", 1 - cw, " ", x3, ",", y3);
8050:       path.push("Z");
8051:       return path.join("");
8195:     var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
8196:     while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]);
8197:     if (n > 1) path.push("H", p[0]);
8198:     return path.join("");
8201:     var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
8202:     while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]);
8203:     return path.join("");
8206:     var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
8207:     while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]);
8208:     return path.join("");
8224:     var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1;
8226:       path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1];
8234:       path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," ...(20 bytes skipped)...
8238:         path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
8243:       path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1];
8245:     return path;
8259: ...(44 bytes skipped)...s[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lin...(21 bytes skipped)...
8267:       d3_svg_lineBasisBezier(path, px, py);
8270:     path.push("L", pi);
8271:     return path.join("");
8275:     var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ];
8281:     path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, ...(5 bytes skipped)...
8289:       d3_svg_lineBasisBezier(path, px, py);
8291:     return path.join("");
8294:     var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = [];
8300:     path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py)...(3 bytes skipped)...
8308:       d3_svg_lineBasisBezier(path, px, py);
8310:     return path.join("");
8329:   function d3_svg_lineBasisBezier(path, x, y) {
8330:     path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1...(206 bytes skipped)...
8987:         var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"), 
8988:         d3.transition(path));
3941:       d3_geo_pathAreaPolygon = 0;
3942:       d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart;
3945:       d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop;
3946:       d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2);
3949:   function d3_geo_pathAreaRingStart() {
3951:     d3_geo_pathArea.point = function(x, y) {
3952:       d3_geo_pathArea.point = nextPoint;
3956:       d3_geo_pathAreaPolygon += y0 * x - x0 * y;
3959:     d3_geo_pathArea.lineEnd = function() {
3964:   var d3_geo_pathBounds = {
3965:     point: d3_geo_pathBoundsPoint,
3972:     if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x;
3973:     if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x;
3974:     if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y;
3975:     if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y;
3977:   function d3_geo_pathBuffer() {
3978:     var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = [];
3993:         pointCircle = d3_geo_pathBufferCircle(_);
4025:   var d3_geo_pathCentroid = {
4026:     point: d3_geo_pathCentroidPoint,
4027:     lineStart: d3_geo_pathCentroidLineStart,
4028:     lineEnd: d3_geo_pathCentroidLineEnd,
4030:       d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart;
4033:       d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
4034:       d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart;
4035:       d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd;
4043:   function d3_geo_pathCentroidLineStart() {
4045:     d3_geo_pathCentroid.point = function(x, y) {
4046:       d3_geo_pathCentroid.point = nextPoint;
4047:       d3_geo_pathCentroidPoint(x0 = x, y0 = y);
4054:       d3_geo_pathCentroidPoint(x0 = x, y0 = y);
4058:     d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
4060:   function d3_geo_pathCentroidRingStart() {
4062:     d3_geo_pathCentroid.point = function(x, y) {
4063:       d3_geo_pathCentroid.point = nextPoint;
4064:       d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y);
4075:       d3_geo_pathCentroidPoint(x0 = x, y0 = y);
4077:     d3_geo_pathCentroid.lineEnd = function() {
4081:   function d3_geo_pathContext(context) {
4117:       context.closePath();
4210:       d3_geo_pathAreaSum = 0;
4211:       d3.geo.stream(object, projectStream(d3_geo_pathArea));
4212:       return d3_geo_pathAreaSum;
4216:       d3.geo.stream(object, projectStream(d3_geo_pathCentroid));