Found 93028 results in 9025 files, showing top 50 files (show more).
seq2pathway:R/seq2pathway.r: [ ]
928:    path <-paste(system.file(package="seq2pathway"),
856: get_python3_command_path <- function()
859:   python3_command_path <- Sys.which2("python")
1029:     script_path <- file.path(tempdir(), name)
275: pathwaygene<-length(intersect(toupper(gene_list[[i]]),
484: pathwaygene<-length(intersect(toupper(gsmap$genesets[[i]]),
843:   cmdpath <- Sys.which(cmdname)
1051: runseq2pathway<-function(inputfile,
1161: gene2pathway_result<-list()
1310: gene2pathway_test<-function(dat,DataBase="GOterm",FisherTest=TRUE,
1344: gene2pathway_result<-list()
854: #get_python3_command_path: funtion from Herve Pages, Bioconductor Maintainance Team, Oct 9 2020
858: #  python3_command_path <- Sys.which2("python3") #3/3/2021 by Holly
860:   if (python3_command_path != "")
864:           return(python3_command_path)}
873: #  python3_command_path <- Sys.which2("python")
874:   python3_command_path <- Sys.which2("python3")  #3/3/2021 by Holly
875:   if (python3_command_path != ""){
876:     print(paste0("python3 found: ",python3_command_path))
877:     return(python3_command_path)}
880:        "  'python3' (or 'python') executable is in your PATH.")
924:     ### assign the path of main function
932:     path <-paste(system.file(package="seq2pathway"),
976: 		sink(file.path(tempdir(),name,fsep = .Platform$file.sep))} 
994:     cat("'", path, "').load_module()",sep="")
1030:     if (!file.exists(script_path))
1032:     mypython <- get_python3_command_path()
1034:     response <- system2(mypython, args=script_path,
75: data(gencode_coding,package="seq2pathway.data")
155: data(gencode_coding,package="seq2pathway.data")
214: ####load GP pathway information
216:    data(GO_BP_list,package="seq2pathway.data")
217:    data(GO_MF_list,package="seq2pathway.data")
218:    data(GO_CC_list,package="seq2pathway.data") 
219:    data(Des_BP_list,package="seq2pathway.data")
220:    data(Des_MF_list,package="seq2pathway.data")
221:    data(Des_CC_list,package="seq2pathway.data")
223:          data(GO_BP_list,package="seq2pathway.data") 
224:          data(Des_BP_list,package="seq2pathway.data")
226:               data(GO_MF_list,package="seq2pathway.data") 
227:               data(Des_MF_list,package="seq2pathway.data")
229:                   data(GO_CC_list,package="seq2pathway.data")
230:                   data(Des_CC_list,package="seq2pathway.data")
237: data(GO_GENCODE_df_hg_v36,package="seq2pathway.data")
240: data(GO_GENCODE_df_hg_v19,package="seq2pathway.data")
243: data(GO_GENCODE_df_mm_vM25,package="seq2pathway.data")
246: data(GO_GENCODE_df_mm_vM1,package="seq2pathway.data")
280: c<-pathwaygene-a
289: mdat[i,7]<-pathwaygene
321: pathwaygene<-length(intersect(toupper(GO_BP_list[[i]]),
326: c<-pathwaygene-a
335: mdat[i,7]<-pathwaygene
367: pathwaygene<-length(intersect(toupper(GO_CC_list[[i]]),
372: c<-pathwaygene-a
381: mdat[i,7]<-pathwaygene
413: pathwaygene<-length(intersect(toupper(GO_MF_list[[i]]),
418: c<-pathwaygene-a
427: mdat[i,7]<-pathwaygene
455: data(Msig_GENCODE_df_hg_v36,package="seq2pathway.data")
458: data(Msig_GENCODE_df_hg_v19,package="seq2pathway.data")
461: data(Msig_GENCODE_df_mm_vM25,package="seq2pathway.data")
464: data(Msig_GENCODE_df_mm_vM1,package="seq2pathway.data")
489: c<-pathwaygene-a
498: mdat[i,7]<-pathwaygene
549: data(gencode_coding,package="seq2pathway.data")
647: rungene2pathway <-
704: colnames(res) <- c(paste(colnames(dat),"2pathscore",sep=""))
705: print("gene2pathway calculates score....... done")
711: rungene2pathway_EmpiricalP <-
770: colnames(res) <- c(paste(colnames(dat),"2pathscore",sep=""))
829: colnames(res_p) <- c(paste(colnames(dat),"2pathscore_Pvalue",sep=""))
832: print("pathwayscore Empirical Pvalue calculation..........done")
849:   success <- grepl(pattern1, cmdpath, fixed=TRUE) ||
850:     grepl(pattern2, cmdpath, fixed=TRUE)
851:   if (success) cmdpath else ""
1007:     #cat(paste("inputpath=","'",inputpath,"/'",sep=""),sep="\n")
1009:     #cat(paste("outputpath=","'",outputpath,"/'",sep=""),sep="\n")
1018:     cat(paste("pwd=","'",system.file(package="seq2pathway.data"),"/extdata/'",sep=""),sep="\n")
1103: data(GO_BP_list,package="seq2pathway.data")
1104: data(GO_MF_list,package="seq2pathway.data")
1105: data(GO_CC_list,package="seq2pathway.data")
1106: data(Des_BP_list,package="seq2pathway.data")
1107: data(Des_CC_list,package="seq2pathway.data")
1108: data(Des_MF_list,package="seq2pathway.data")
1134: #############################rungene2pathway,normalization,empiricalP,summary table
1166: GO_BP_FAIME<-rungene2pathway(dat=dat_CP,gsmap=GO_BP_list,alpha=alpha,logCheck=logCheck,
1171: GO_BP_FAIME_Pvalue<-rungene2pathway_EmpiricalP(dat=dat_CP,gsmap=GO_BP_list,
1174: ########gene2pathway table
1190: gene2pathway_result[[n.list]]<-GO_BP_N_P
1191: names(gene2pathway_result)[n.list]<-c("GO_BP")
1195: GO_MF_FAIME<-rungene2pathway(dat=dat_CP,gsmap=GO_MF_list,alpha=alpha,logCheck=logCheck,
1198: GO_MF_FAIME_Pvalue<-rungene2pathway_EmpiricalP(dat=dat_CP,gsmap=GO_MF_list,
1215: gene2pathway_result[[n.list]]<-GO_MF_N_P
1216: names(gene2pathway_result)[n.list]<-c("GO_MF")
1220: GO_CC_FAIME<-rungene2pathway(dat=dat_CP,gsmap=GO_CC_list,alpha=alpha,logCheck=logCheck,
1223: GO_CC_FAIME_Pvalue<-rungene2pathway_EmpiricalP(dat=dat_CP,gsmap=GO_CC_list,
1241: gene2pathway_result[[n.list]]<-GO_CC_N_P
1242: names(gene2pathway_result)[n.list]<-c("GO_CC")
1245: dat_FAIME<-rungene2pathway(dat=dat_CP,gsmap=DataBase,alpha=alpha,logCheck=logCheck,
1248: dat_FAIME_Pvalue<-rungene2pathway_EmpiricalP(dat=dat_CP,gsmap=DataBase,
1255: colnames(DB_N_P)<-c("score2pathscore_Normalized","score2pathscore_Pvalue")
1274: gene2pathway_result<-DB_N_P[,c(ncol(DB_N_P),1:(ncol(DB_N_P)-1))]
1276: print("gene2pathway analysis is done")
1279: if(exists("gene2pathway_result")&exists("FS_test")){
1283: TotalResult[[2]]<-gene2pathway_result
1284: names(TotalResult)[2]<-"gene2pathway_result.FAIME"
1286: names(TotalResult)[3]<-"gene2pathway_result.FET"
1289: }else if(exists("gene2pathway_result")&exists("FS_test")==FALSE){
1293: TotalResult[[2]]<-gene2pathway_result
1294: names(TotalResult)[2]<-"gene2pathway_result.FAIME"
1298: else if(exists("gene2pathway_result")==FALSE&exists("FS_test")){
1303: names(TotalResult)[2]<-"gene2pathway_result.FET"
1326: data(GO_BP_list,package="seq2pathway.data")
1327: data(GO_MF_list,package="seq2pathway.data")
1328: data(GO_CC_list,package="seq2pathway.data")
1329: data(Des_BP_list,package="seq2pathway.data")
1330: data(Des_CC_list,package="seq2pathway.data")
1331: data(Des_MF_list,package="seq2pathway.data")
1346: #############################rungene2pathway,normalization,empiricalP,summary table
1348: gene2pathway_result<-list()
1352:   GO_BP_method<-rungene2pathway(dat=dat,gsmap=GO_BP_list,alpha=alpha,logCheck=logCheck,
1358:     GO_BP_method_Pvalue<-rungene2pathway_EmpiricalP(dat=dat,gsmap=GO_BP_list,alpha=alpha,
1364:   ########gene2pathway table
1376:   gene2pathway_result[[n.list]]<-GO_BP_N_P
1377:   names(gene2pathway_result)[n.list]<-c("GO_BP")
1380:     GO_MF_method<-rungene2pathway(dat=dat,gsmap=GO_MF_list,alpha=alpha,logCheck=logCheck,
1384:       GO_MF_method_Pvalue<-rungene2pathway_EmpiricalP(dat=dat,gsmap=GO_MF_list,alpha=alpha,
1402:   gene2pathway_result[[n.list]]<-GO_MF_N_P
1403:   names(gene2pathway_result)[n.list]<-c("GO_MF")
1406:    GO_CC_method<-rungene2pathway(dat=dat,gsmap=GO_CC_list,alpha=alpha,logCheck=logCheck,
1410:       GO_CC_method_Pvalue<-rungene2pathway_EmpiricalP(dat=dat,gsmap=GO_CC_list,alpha=alpha,
1427:   gene2pathway_result[[n.list]]<-GO_CC_N_P
1428:   names(gene2pathway_result)[n.list]<-c("GO_CC")
1431: dat_method<-rungene2pathway(dat=dat,gsmap=DataBase,alpha=alpha,logCheck=logCheck,
1435: dat_method_Pvalue<-rungene2pathway_EmpiricalP(dat=dat,gsmap=DataBase,alpha=alpha,
1443: colnames(DB_N_P)<-c("score2pathscore_Normalized","score2pathscore_Pvalue")
1464: gene2pathway_result<-DB_N_P[,c(ncol(DB_N_P),1:(ncol(DB_N_P)-1))]
1466: print("gene2pathway analysis is done")
1470: if(exists("gene2pathway_result")&exists("FS_test")){
1472: TResult[[1]]<-gene2pathway_result
1473: names(TResult)[1]<-"gene2pathway_result.2"
1475: names(TResult)[2]<-"gene2pathway_result.FET"
1476: }else if(exists("gene2pathway_result")&exists("FS_test")==FALSE){
1477: TResult<-gene2pathway_result
1479: else if(exists("gene2pathway_result")==FALSE&exists("FS_test")){
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
NoRCE:R/pathway.R: [ ]
353:   path <- merge(merge1, symb, by = "gene")
66:     pathTable <- unique(keggPathwayDB(org_assembly))
72:     pathfreq <- as.data.frame(table(annot$pathway))
100:     pathT <- as.character(freq$Var1[enrich])
119:     pathways <- data.frame(unique(pathT))
205:     pathTable <- unique(reactomePathwayDB(org_assembly))
211:     pathfreq <- as.data.frame(table(annot$pathway))
237:     pathT <- as.character(freq$Var1[enrich])
542:   pathTable <- unique(WikiPathwayDB(org_assembly))
547:   pathfreq <- as.data.frame(table(annot$pathID))
573:   pathT <- as.character(freq$Var1[enrich])
580:   pathTerms <- as.character(r$pathTerm[match(pathT, r$pathID)])
630: pathwayEnrichment <- function(genes,
679:   pathfreq <- as.data.frame(table(annot$pathTerm))
711:   pathT <- as.character(freq$Var1[enrich])
719:   pathTerms <- as.character(r$pathTerm[match(pathT, r$pathID)])
272: reactomePathwayDB <- function(org_assembly = c("hg19",
359: keggPathwayDB <- function(org_assembly = c("hg19",
435: WikiPathwayDB <- function(org_assembly = c("hg19",
15: #' @param gmtFile File path of the gmt file
92:         file.path(x[1], x[2]))
96:         file.path(x[1], x[2]))
156: #' @param gmtFile File path of the gmt file
230:       file.path(x[1], x[2]))
233:       file.path(x[1], x[2]))
355:   return(path)
501: #' @param gmtFile File path of the gmt file
565:       file.path(x[1], x[2]))
569:       file.path(x[1], x[2]))
610: #' @param gmtFile File path of the gmt file
704:     file.path(x[1], x[2]))
707:     file.path(x[1], x[2]))
1: #' KEGG pathway enrichment
22: #' @return KEGG pathway enrichment results
69:     annot <- pathTable[which(pathTable$symbol %in% genes$g),]
73:     pathfreq <- pathfreq[which(pathfreq$Freq > 0),]
76:     geneSize = length(unique(pathTable$symbol))
78:     bckfreq <- as.data.frame(table(pathTable$pathway))
79:     notGene <- bckfreq[bckfreq$Var1 %in% pathfreq$Var1,]
80:     freq <- merge(pathfreq, notGene, by = "Var1")
105:     r <- annot[annot$pathway %in% pathT,]
107:     for (i in seq_along(pathT))
109:       if (length(which(pathT[i] == r$pathway)) > 0)
114:               as.character(r[which(pathT[i] == r$pathway),]$symbol)),
115:                      paste(pathT[i])))
120:     tmp <- character(length(pathT))
121:     if (nrow(pathways) > 0) {
123:         unlist(lapply(seq_len(nrow(pathways)), function(x)
124:           tmp[x] <- try(KEGGREST::keggGet(pathT[x])[[1]]$NAME)
130:         ID = pathT,
142: #' Reactome pathway enrichment
164: #' @return Reactome pathway enrichment results
208:     annot <- pathTable[which(pathTable$symbol %in% genes$g),]
212:     pathfreq <- pathfreq[which(pathfreq$Freq > 0),]
214:     geneSize = length(unique(pathTable$symbol))
216:     bckfreq <- as.data.frame(table(pathTable$pathway))
217:     notGene <- bckfreq[bckfreq$Var1 %in% pathfreq$Var1,]
218:     freq <- merge(pathfreq, notGene, by = "Var1")
242:     r <- annot[annot$pathway %in% pathT,]
246:     for (i in seq_along(pathT))
248:       if (length(which(pathT[i] == r$pathway)) > 0)
253:               list(as.character(r[which(pathT[i] == r$pathway),]$symbol)),
254:                      paste(pathT[i])))
260:         ID = pathT,
261:         Term = as.character(rt[order(match(rt$pathway, pathT)), ]$name),
281:   table1 <- data.frame(pathway = rep(names(xx), lapply(xx, length)),
284:   pn <- data.frame(pathway = rep(names(pn), lapply(pn, length)),
290:     ty <- table1[grepl("^R-HSA", table1$pathway),]
291:     pn1 <- pn[grepl("^R-HSA", pn$pathway),]
298:     ty <- table1[grepl("^R-MMU", table1$pathway),]
299:     pn1 <- pn[grepl("^R-MMU", pn$pathway),]
306:     ty <- table1[grepl("^R-DRE", table1$pathway),]
307:     pn1 <- pn[grepl("^R-DRE", pn$pathway),]
314:     ty <- table1[grepl("^R-RNO", table1$pathway),]
315:     pn1 <- pn[grepl("^R-RNO", pn$pathway),]
322:     ty <- table1[grepl("^R-CEL", table1$pathway),]
323:     pn1 <- pn[grepl("^R-CEL", pn$pathway),]
330:     ty <- table1[grepl("^R-SCE", table1$pathway),]
331:     pn1 <- pn[grepl("^R-SCE", pn$pathway),]
344:     ty <- table1[grepl("^R-DME", table1$pathway),]
345:     pn1 <- pn[grepl("^R-DME", pn$pathway),]
351:                   by = "pathway",
371:     kegg <- org.Hs.eg.db::org.Hs.egPATH2EG
379:     kegg <- org.Mm.eg.db::org.Mm.egPATH2EG
387:     kegg <- org.Dr.eg.db::org.Dr.egPATH2EG
395:     kegg <- org.Rn.eg.db::org.Rn.egPATH2EG
403:     kegg <- org.Ce.eg.db::org.Ce.egPATH2EG
411:     kegg <- org.Sc.sgd.db::org.Sc.sgdPATH2ORF
419:     kegg <- org.Dm.eg.db::org.Dm.egPATH2EG
425:   pathTable <-
426:     data.frame(pathway = paste0(prefix, rep(names(kegg2),
431:   pathTable <- merge(pathTable, x, by = "gene")
432:   return(pathTable)
474:     do.call(rbind, strsplit(as.character(gmtFile$pathTerm), '%'))
480:         pathID = tmp[, 3],
481:         pathTerm = tmp[, 1]
508: #' @return Wiki Pathway Enrichment
545:   annot <- pathTable[which(pathTable$gene %in% genes$g),]
548:   pathfreq <- pathfreq[which(pathfreq$Freq > 0),]
550:   geneSize = length(unique(pathTable$gene))
551:   bckfreq <- as.data.frame(table(pathTable$pathID))
552:   notGene <- bckfreq[bckfreq$Var1 %in% pathfreq$Var1,]
553:   freq <- merge(pathfreq, notGene, by = "Var1")
578:   r <- annot[annot$pathID %in% pathT,]
581:   for (i in seq_along(pathT))
583:     if (length(which(pathT[i] == r$pathID)) > 0)
587:           list(as.character(r[which(pathT[i] == r$pathID),]$gene)),
588:                           paste(pathT[i])))
595:       ID = pathT,
596:       Term = pathTerms,
606: #' For a given gmt file of a specific pathway database, pathway enrichment
628: #' @return Pathway Enrichment
671:     pathTable <-
676:     pathTable <- geneListEnrich(f = gmtFile, isSymbol = isSymbol)
678:   annot <- pathTable[which(pathTable$symbol %in% genes$g),]
680:   pathfreq <- pathfreq[which(pathfreq$Freq > 0),]
684:     geneSize = length(unique(pathTable$symbol))
689:   bckfreq <- as.data.frame(table(pathTable$pathTerm))
691:   notGene <- bckfreq[bckfreq$Var1 %in% pathfreq$Var1,]
692:   freq <- merge(pathfreq, notGene, by = "Var1")
717:   r <- annot[annot$pathTerm %in% pathT,]
721:   for (i in seq_along(pathT))
723:     if (length(which(pathT[i] == r$pathTerm)) > 0)
726:           list(as.character(r[which(pathT[i] == r$pathTerm),]$symbol)),
727:                           paste(pathT[i])))
732:       ID = pathT,
733:       Term = pathTerms,
743: #' Convert gmt formatted pathway file to the Pathway ID, Entrez, symbol
746: #' @param gmtName Custom pathway gmt file
815:     colnames(f) <- c('pathTerm', 'Entrez', 'symbol')
830:     colnames(f) <- c('pathTerm', 'symbol', 'Entrez')
852:     colnames(f) <- c('pathTerm', 'Entrez', 'symbol')
863:     colnames(f) <- c('pathTerm', 'symbol', 'Entrez')
280:   xx <- as.list(reactome.db::reactomePATHID2EXTID)
283:   pn <- as.list(reactome.db::reactomePATHID2NAME)
445:       rWikiPathways::downloadPathwayArchive(organism = "Homo sapiens",
449:       rWikiPathways::downloadPathwayArchive(organism = "Mus musculus",
453:       rWikiPathways::downloadPathwayArchive(organism = "Danio rerio",
457:       rWikiPathways::downloadPathwayArchive(organism = "Rattus norvegicus",
461:       rWikiPathways::downloadPathwayArchive(
465:       rWikiPathways::downloadPathwayArchive(
469:       rWikiPathways::downloadPathwayArchive(
487: #' WikiPathways Enrichment
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)
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;
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;
megadepth:R/install.R: [ ]
147:         path <- Sys.getenv("APPDATA", "")
176:         path <- file.path(d, exec)
207:     path <- NULL # cache the path to megadepth
183:     path2 <- Sys.which(cmd)
143: bin_paths <- function(
15: #' found via the environment variable \code{PATH}.
17: #' If you want to install Megadepth to a custom path, you can set the global
35: #' @importFrom xfun is_windows is_macos same_path
75:     exec <- file.path(tempdir(), exec_name)
145:         extra_path = getOption("megadepth.dir")) {
148:         path <- if (fs::dir_exists(path)) {
149:             file.path(path, dir)
152:         path <- "~/Library/Application Support"
153:         path <- if (fs::dir_exists(path)) file.path(path, dir)
154:         path <- c("/usr/local/bin", path)
156:         path <- c("~/bin", "/snap/bin", "/var/lib/snapd/snap/bin")
158:     path <- c(extra_path, path, pkg_file(dir, mustWork = FALSE))
160:     path <- path[path != ""]
163:         path <- c(tempdir(), path)
165:     path
168: # find an executable from PATH, APPDATA, system.file(), ~/bin, etc
177:         if (utils::file_test("-x", path)) {
180:             path <- ""
184:     if (path == "" || xfun::same_path(path, path2)) {
185:         if (path2 == "") {
188:         return(cmd) # do not use the full path of the command
190:         if (path2 != "") {
195:                 path,
197:                 path2,
203:     normalizePath(path)
209:         if (is.null(path)) {
210:             path <<- find_exec(
216:         path
109:     dirs <- bin_paths()
139:     message("megadepth has been installed to ", normalizePath(destdir))
159:     # remove empty paths potentially created by pkgfile
170:     for (d in bin_paths(dir)) {
BiocBook:R/init.R: [ ]
217:     path <- file.path("inst", "assets", "_book.yml")
246:     gert::git_init(path = repo) 
207:         file.path(tmpdir, 'BiocBook.template'), 
218:     .fix_placeholders(file.path(repo, path), pkg = repo, usr = user)
219:     cli::cli_alert_success(cli::col_grey("Filled out `{cli::col_cyan(path)}` fields"))
222:     path <- "README.md"
223:     .fix_placeholders(file.path(repo, path), pkg = repo, usr = user)
224:     cli::cli_alert_success(cli::col_grey("Filled out `{cli::col_cyan(path)}` fields"))
227:     path <- "DESCRIPTION"
228:     .fix_placeholders(file.path(repo, path), pkg = repo, usr = user)
229:     cli::cli_alert_success(cli::col_grey("Filled out `{cli::col_cyan(path)}` fields"))
230:     cli::cli_alert_info(cli::col_grey("Please finish editing the `{cli::col_cyan(path)}` fields, including:"))
236:     path <- file.path("inst", "index.qmd")
237:     .fix_placeholders(file.path(repo, path), pkg = repo, usr = user)
238:     cli::cli_alert_success(cli::col_grey("Filled out `{cli::col_cyan(path)}` fields"))
239:     cli::cli_alert_info(cli::col_grey("Please finish editing the `{cli::col_cyan(path)}` fields, including the `Welcome` section"))
255:     version <- read.dcf(file.path(repo, "DESCRIPTION"))[1,"BiocBookTemplate"]
325:             path = "_temp",
362:         charToRaw('{ "source": { "branch": "gh-pages", "path": "/docs" } }'), 
386:         file.path("inst", "assets", "cover.png")
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]
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)...
ISAnalytics:R/internal-functions.R: [ ]
1626:             path = project_folder, recurse = TRUE,
3357:                                 path = report_path,
1569:     path_cols <- .path_cols_names()
2142:     path_col_names <- .path_cols_names()
1870:     stats_paths <- purrr::pmap(temp, function(...) {
1961:     stats_paths <- .stats_report(association_file,
409:     corr_fold <- fs::path(dir, "fs")
413:         proj_fold <- fs::path(corr_fold, proj)
414:         quant_fold <- fs::path(proj_fold, "quantification")
419:             pool_fold <- fs::path(quant_fold, .y)
431:                 file = fs::path(pool_fold, paste(prefix,
438:                 file = fs::path(pool_fold, paste(prefix,
449:             proj_fold <- fs::path(corr_fold, proj)
450:             iss_fold <- fs::path(proj_fold, "iss")
453:                 pool_fold <- fs::path(iss_fold, .y)
461:                         file = fs::path(pool_fold, filename),
490:     err_fold <- fs::path(dir, "fserr")
498:         proj_fold <- fs::path(err_fold, proj)
499:         quant_fold <- fs::path(proj_fold, "quantification")
518:             pool_fold <- fs::path(quant_fold, .y)
531:                     file = fs::path(pool_fold, paste(prefix,
539:                 file = fs::path(pool_fold, paste(prefix,
550:             proj_fold <- fs::path(err_fold, proj)
551:             iss_fold <- fs::path(proj_fold, "iss")
560:                 pool_fold <- fs::path(iss_fold, .y)
569:                             file = fs::path(pool_fold, filename),
602: #' @importFrom fs path_ext
603: #' @importFrom tools file_path_sans_ext
605: .check_file_extension <- function(file_path) {
607:     last <- fs::path_ext(file_path)
611:         file_path[compressed] <- tools::file_path_sans_ext(
612:             file_path[compressed]
614:         last <- fs::path_ext(file_path)
1063: .read_with_fread <- function(path, additional_cols, annotated, sep) {
1092:         file = path,
1130: .read_with_readr <- function(path, additional_cols, annotated, sep) {
1155:         file = path,
1251:         path,
1282:     peek_headers <- readr::read_delim(path,
1303:         is_compressed <- fs::path_ext(path) %in% .compressed_formats()
1306:             compression_type <- fs::path_ext(path)
1326:             path = path, additional_cols = additional_cols,
1331:             path = path, additional_cols = additional_cols,
1423: .read_af <- function(path, date_format, delimiter) {
1426:     file_ext <- .check_file_extension(path)
1440:         headers_peek <- readr::read_delim(path,
1448:         headers_peek <- readxl::read_excel(path, n_max = 0)
1469:             df <- readr::read_delim(path,
1479:             df <- readxl::read_excel(path,
1547: # - root_folder: Path to the root folder
1549: #' @importFrom fs path dir_ls
1551: # ProjectID - ConcatenatePoolIDSeqRun - PathToFolderProjectID - Found - Path -
1552: # Path_quant - Path_iss (NOTE: headers are dynamic!)
1577:                 fs::path(
1578:                     fs::path(root_folder),
1589:             !!path_cols$project := NA_character_,
1590:             !!path_cols$quant := NA_character_,
1591:             !!path_cols$iss := NA_character_
1595:         project_folder <- fs::path(
1596:             fs::path(root_folder),
1600:             paste0(fs::path(
1602:                 fs::path(cur[[concat_pool_col]])
1618:             paste0(fs::path(
1620:                 fs::path(cur[[concat_pool_col]])
1634:             path = project_folder, recurse = TRUE,
1644:                     !!path_cols$project := project_folder,
1645:                     !!path_cols$quant := quant_found,
1646:                     !!path_cols$iss := iss_found
1681:         af_path,
1691:         path = af_path,
1822: # Finds automatically the path on disk to each stats file.
1829: # Path_iss (or designated dynamic name), stats_files, info
1835:         path_iss_col) {
1838:             dplyr::all_of(c(proj_col, pool_col, path_iss_col))
1846:     if (all(is.na(temp[[path_iss_col]]))) {
1853:         if (is.na(temp_row[[path_iss_col]])) {
1861:         files <- fs::dir_ls(temp_row[[path_iss_col]],
1945: # - path_iss_col: name of the column that contains the path
1955:         path_iss_col,
1965:         path_iss_col = path_iss_col
2076:     if (!.path_cols_names()$quant %in% colnames(association_file)) {
2077:         rlang::abort(.af_missing_path_error(.path_cols_names()$quant),
2078:             class = "missing_path_col"
2082:         dplyr::filter(!is.na(.data[[.path_cols_names()$quant]]))
2131: #' @importFrom fs dir_ls as_fs_path
2145:             dplyr::all_of(c(proj_col, pool_col, path_col_names$quant))
2168:             matches <- fs::dir_ls(temp_row[[path_col_names$quant]],
2269: #' @importFrom fs as_fs_path
2312:                     dplyr::mutate(Files_found = fs::as_fs_path(
2336:                     dplyr::mutate(Files_found = fs::as_fs_path(
2426: # * Removing files not found (files for which Files_count$Found == 0 and Path
2589:     wrapper <- function(path, import_matrix_args, progress) {
2591:             path = path,
3296:         report_path) {
3343:                         fs::dir_create(report_path)
3373:                                 path = report_path,
4457:                 x = "Did you provide the correct path?"
4474:                 x = "Did you provide the correct path?"
601: # Returns the file format for each of the file paths passed as a parameter.
1560:         rlang::abort(.af_missing_pathfolder_error(proj_fold_col))
1661: # containing paths to project folder, quant folders and iss folders
1845:     # If paths are all NA return
1927:     stats_paths
1960:     # Obtain paths
1967:     stats_paths <- stats_paths |>
1969:     if (all(is.na(stats_paths$stats_files))) {
1970:         stats_paths <- stats_paths |>
1976:         return(list(stats = NULL, report = stats_paths))
2006:         data_list = stats_paths$stats_files,
2022:     stats_paths <- stats_paths |>
2024:     stats_paths <- purrr::pmap(stats_paths, function(...) {
2042:     stats_paths <- stats_paths |>
2044:     stats_dfs <- stats_dfs$res[stats_paths$Imported]
2047:         return(list(stats = NULL, report = stats_paths))
2054:     list(stats = stats_dfs, report = stats_paths)
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))
ACE:R/ACE.R: [ ]
134: 		  readCounts <- QDNAseq::binReadCounts(bins, path = inputdir)
960:         if (dirname(filename)==".") {newpath <- file.path(outputdir,filename)}
131: 		  currentdir <- file.path(outputdir,paste0(b,"kbp"))
136: 		    saveRDS(readCounts, file = file.path(outputdir, paste0(b, "kbp-raw.rds")))
146: 		  saveRDS(copyNumbersSegmented, file = file.path(outputdir,paste0(b,"kbp.rds")))
157: 			currentdir <- file.path(outputdir,paste0(substr(files[f],0,nchar(files[f])-4)))
159: 			copyNumbersSegmented <- readRDS(file.path(inputdir,files[f]))
166: 	write.table(parameters, file=file.path(outputdir,"parameters.tsv"), quote = FALSE, sep = "\t", na = "", row.names = FALSE)
182: 	  qdir <- file.path(currentdir,paste0(q,"N"))
189:   	dir.create(file.path(qdir,"likelyfits"))  
258:   		fp <- file.path(qdir,pd$name[a])
263:   		dir.create(file.path(fp,"graphs"))
284:   		imagefunction(file.path(fp,paste0(pd$name[a],"_errorlist.",imagetype)))
320:   		  fn <- file.path(fp,"graphs",paste0(pd$name[a], " - ",q,"N fit ", m, ".",imagetype))
348:   		      imagefunction(file.path(qdir,"likelyfits",paste0(pd$name[a],"_bestfit_",q,"N.",imagetype)),width=10.5)
350:   		      imagefunction(file.path(qdir,"likelyfits",paste0(pd$name[a],"_bestfit_",q,"N.",imagetype)),width=720)
358:   		      imagefunction(file.path(qdir,"likelyfits",paste0(pd$name[a],"_lastminimum_",q,"N.",imagetype)),width=10.5)
360:   		      imagefunction(file.path(qdir,"likelyfits",paste0(pd$name[a],"_lastminimum_",q,"N.",imagetype)),width=720)
377:   		  pdf(file.path(fp,paste0("summary_",pd$name[a],".pdf")),width=10.5)
382:   		    imagefunction(file.path(fp,paste0("summary_",pd$name[a],".",imagetype)), width = 720)
386:     		  imagefunction(file.path(fp,paste0("summary_",pd$name[a],".",imagetype)), width = 2160, height = 480*ceiling(length(plots)/3...(3 bytes skipped)...
399:     	  pdf(file.path(qdir,"summary_likelyfits.pdf"),width=10.5)
402:       	pdf(file.path(qdir,"summary_errors.pdf"))
406:     	  imagefunction(file.path(qdir,paste0("summary_likelyfits.",imagetype)), width = 2160, height = 480*length(pd$name))
409:       	imagefunction(file.path(qdir,paste0("summary_errors.",imagetype)), width = 1920, height = 480*ceiling(length(pd$name)/4))
415:   	    pdf(file.path(qdir,"summary_errors.pdf"))
419:   	    imagefunction(file.path(qdir,paste0("summary_errors.",imagetype)), width = 1920, height = 480*ceiling(length(pd$name)/4))
425:   	write.table(fitpicker, file=file.path(qdir,paste0("fitpicker_",q,"N.tsv")), quote = FALSE, sep = "\t", na = "", row.names = FALSE)
830: # frequency in percentage). It can also be a file path to a tab-delimited
832: # by getadjustedsegments. Again, this can be either a data frame or a file path
1003:       copyNumbersSegmented <- readRDS(file.path(inputdir,files[1]))
1005:     if(missing(modelsfile)){models <- try(read.table(file.path(inputdir,"models.tsv"), header = TRUE, comment.char = "", sep = "\t"))
1009:       if (dir.exists(file.path(inputdir,"variantdata"))) {
1010:         variantdata <- file.path(inputdir,"variantdata")
1072:           if (!dir.exists(file.path(outputdir,"newplots"))) {dir.create(file.path(outputdir,"newplots"))}
1074:             imagefunction(file.path(outputdir,"newplots",paste0(pd$name[a],".",imagetype)),width=10.5)
1078:             imagefunction(file.path(outputdir,"newplots",paste0(pd$name[a],".",imagetype)), width=720)
1091:           variantfile <- file.path(variantdata,paste0(prefix,pd$name[a],postfix,varext))
1092:           folder <- file.path(outputdir,"variantdata")
1104:           if (!dir.exists(file.path(outputdir,"segmentfiles"))) {dir.create(file.path(outputdir,"segmentfiles"))}
1105:           fn <- file.path(outputdir,"segmentfiles",paste0(pd$name[a],"_segments.",segext))
961:         else {newpath <- sub(dirname(filename),outputdir,filename)}
962:         fn <- gsub(".csv","_ACE.csv",newpath)
MuData:R/write_h5mu.R: [ ]
313:     path <- paste(H5Iget_name(parent), key, sep="/")
315:                                      filepath=file, name=path, chunkdim=chunkdim, parent=parent, datasetname=key)
gDRstyle:R/build_tools.R: [ ]
105:   remotes::install_local(path = repo_path)
15: #' @param base_dir String, path to dir with token file
24:   gh_access_token_file <- file.path(base_dir, filename)
89: #' @param repo_path String of repository directory.
100: installLocalPackage <- function(repo_path,
133:   deps_yaml <- file.path(base_dir, "/dependencies.yaml")
snapcount:R/basic_query_functions.R: [ ]
273:     path <- paste(compilation, paste0(endpoint, "?"), sep = "/")
319:     paste0(pkg_globals$snaptron_host, path, paste(query, collapse = "&"))
BiocFileCache:R/BiocFileCache-class.R: [ ]
497:     path <- .sql_get_rpath(x, rids)
533:     update_time_and_path <- function(x, i) {
542:             locfile_path <- file.path(bfccache(x), id)
404:     rpath <- .sql_add_resource(x, rname, rtype, fpath, ext, fname)
1009:         fpath <- .sql_get_fpath(x, rid)
1193:     paths <- .sql_get_rpath(x, bfcrid(x))
1320:             newpath <- file.path(dir, basename(orig))
1393:     exportPath <- file.path(exdir, "BiocFileCacheExport")
1139:     rpaths <- .sql_get_rpath(x, rids)
1441:     rpaths <- .sql_get_rpath(x, rids)
34: #'   \item{'cache': }{character(1) on-disk location (directory path) of the
53: #'   \item{'rpath': }{resource path. This is the path to the local
74: #' @param cache character(1) On-disk location (directory path) of
105:             cache <- file.path(tempdir(), "BiocFileCache")
213: #' @describeIn BiocFileCache Get a file path for select resources from
228: #' @describeIn BiocFileCache Set the file path of selected resources
230: #' @param value character(1) Replacement file path.
279: #' @return For 'bfcnew': named character(1), the path to save your
283: #' path <- bfcnew(bfc0, "NewResource")
284: #' path
329: #' @param fpath For bfcadd(), character(1) path to current file
331: #'     assumed to also be the path location. For bfcupdate()
334: #'     if the resource is a local file, a relative path in the cache,
337: #'     relative or web paths, based on the path prefix.
341: #'     in current location but save the path in the cache. If 'rtype
357: #' @return For 'bfcadd': named character(1), the path to save your
484: #' @return For 'bfcpath': the file path location to load
498:     path
517: #'     in the cache the path is returned, if it is not it will try to
522: #' @return For 'bfcrpath': The local file path location to load.
543:             locfile <- .lock2(locfile_path, exclusive = TRUE)
552:                     names(update_time_and_path(x, res))
561:                 .unlock2(locfile_path)
564:             names(update_time_and_path(x, res))
591:         update_time_and_path(x, rids)
678:                     "Setting a new remote path results in immediate\n",
1077: #' @return For 'bfcdownload': character(1) path to downloaded resource
1192:     files <- file.path(bfccache(x), setdiff(dir(bfccache(x)),c(.CACHE_FILE, .CACHE_FILE_LOCK)))
1261: #' @return character(1) The outputFile path.
1283:     dir <- file.path(tempdir(), "BiocFileCacheExport")
1324:                 newpath <- file.path(dir, filename)
1351:         outputFile = file.path(origdir, outputFile)
1361:     .util_unlink(file.path(dir, .CACHE_FILE_LOCK))
57: #'   \item{'fpath': }{If rtype is "web", this is the link to the
217: #' @return For '[[': named character(1) rpath for the given resource
225:     .sql_get_rpath(x, i)
240:     .sql_set_rpath(x, i, value)
243:         warning("updating rpath, changing rtype to 'local'")
304:         x, rname, fpath = rname, rtype=c("auto", "relative", "local", "web"),
317:         x, rname, fpath = rname, rtype=c("auto", "relative", "local", "web"),
323:     bfcadd(x=BiocFileCache(), rname=rname, fpath=fpath, rtype=rtype,
339: #'     \code{copy} of \code{fpath} in the cache directory; \code{move}
376: #' bfcadd(bfc0, "TestWeb", fpath=url)
381:         x, rname, fpath = rname,
389:         is.character(fpath), length(fpath) > 0L, !any(is.na(fpath))
395:     stopifnot((length(action) == 1) || (length(action) == length(fpath)))
396:     stopifnot((length(rtype) == 1) || (length(rtype) == length(fpath)))
397:     if (length(action) == 1) action = rep(action, length(fpath))
398:     if (length(rtype) == 1) rtype = rep(rtype, length(fpath))
400:     rtype <- .util_standardize_rtype(rtype, fpath, action)
401:     stopifnot(all(rtype == "web" | file.exists(fpath)))
405:     rid <- names(rpath)
407:     for(i in seq_along(rpath)){
411:                 copy = file.copy(fpath[i], rpath[i]),
412:                 move = file.rename(fpath[i], rpath[i]),
414:                     .sql_set_rpath(x, rid[i], fpath[i])
415:                     rpath[i] <- bfcrpath(x, rids = rid[i])
423:     rpath
457:     tbl <- mutate(tbl, rpath = unname(bfcrpath(x, rids=rids)))
469: setGeneric("bfcpath",
470:     function(x, rids) standardGeneric("bfcpath"),
475: #' @aliases bfcpath,missing-method
476: #' @exportMethod bfcpath
477: setMethod("bfcpath", "missing",
480:     bfcpath(x=BiocFileCache(), rids=rids)
486: #' bfcpath(bfc0, rid3)
487: #' @aliases bfcpath
488: #' @exportMethod bfcpath
489: setMethod("bfcpath", "BiocFileCacheBase",
502: setGeneric("bfcrpath",
503:     function(x, rnames, ..., rids, exact = TRUE) standardGeneric("bfcrpath"),
508: #' @aliases bfcrpath,missing-method
509: #' @exportMethod bfcrpath
510: setMethod("bfcrpath", "missing",
513:     bfcrpath(x=BiocFileCache(), rnames=rnames, ..., rids=rids, exact=exact)
516: #' @describeIn BiocFileCache display rpath of resource. If 'rnames' is
524: #' bfcrpath(bfc0, rids = rid3)
525: #' @aliases bfcrpath
526: #' @exportMethod bfcrpath
527: setMethod("bfcrpath", "BiocFileCacheBase",
534:         .sql_get_rpath(x, i)
588:         bfcrpath(x, rids = rids0)
611: #' @param rpath character() vector of replacement rpaths.
615: #' bfcupdate(bfc0, rid3, rpath=fl3, rname="NewRname")
617: #' bfcupdate(bfc0, "BFC5", fpath="http://google.com")
621:     function(x, rids, ..., rname=NULL, rpath=NULL, fpath=NULL,
627:         is.null(rpath) || (length(rids) == length(rpath)),
628:         is.null(fpath) || (length(rids) == length(fpath))
632:         is.null(rpath) || is.character(rpath),
633:         is.null(fpath) || is.character(fpath)
636:     if(is.null(rname) && is.null(rpath) && is.null(fpath)) {
638:              "\n  Please set rname, rpath, or fpath",
652:         if (!is.null(rpath)) {
653:             if (!file.exists(rpath[i]))
657:                     "\n  rpath: ", sQuote(rpath[i]),
658:                     "\n  reason: rpath does not exist.",
661:             .sql_set_rpath(x, rids[i], rpath[i])
664:                 warning("updating rpath, changing rtype to 'local'")
669:         if (!is.null(fpath)) {
687:                     x, rids[i], proxy, config, "bfcupdate()", fpath[i], ...
689:                 .sql_set_fpath(x, rids[i], fpath[i])
871:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
880:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
893: #'     matches pattern agains rname, rpath, and fpath. If exact
898: #'     \code{bfcrpath}, the default is \code{TRUE} (exact matching).
910:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
986: #'     'rid'. \code{TRUE}: fpath \code{etag} or \code{modified} time of
987: #'     web resource more recent than in BiocFileCache; \code{FALSE}: fpath
1012:         cache_info <- .httr_get_cache_info(fpath)
1094:     if (ask && any(file.exists(.sql_get_rpath(x, rid)))) {
1105:     bfcrpath(x, rids=rid)
1194:     # normalizePath on windows
1197:         files = normalizePath(files)
1198:         paths = normalizePath(paths)
1200:     untracked <- setdiff(files, paths)
1255: #' @param outputFile character(1) The <filepath>/basename for the
1319:             orig <- .sql_get_rpath(x, i)
1321:             if (file.exists(newpath)) {
1326:             file.copy(orig, newpath)
1394:     stopifnot(!dir.exists(exportPath))
1404:     bfc = BiocFileCache(exportPath)
349: #'     \code{httr::GET}. For 'bfcrpaths': Additional arguments passed
483: #' @describeIn BiocFileCache display rpaths of resource.
1140:     cached <- startsWith(rpaths, bfccache(x))
1143:     status <- .util_unlink(rpaths[cached])
1442:     cached <- startsWith(rpaths, bfccache(x))
1445:         txt0 <- paste("file ", sQuote(rpaths))
1454:     .util_unlink(rpaths[cached])
qusage:R/qusage.R: [ ]
532:           path = q$pathways[[i]]
537:         path = QSarray$pathways[[i]]
379:   PDFs = pathMeans = Sizes = NULL
792:     SDPath = apply(calcBayesCI(QSarray,low=0.5,up=0.8413448)[,path.index,drop=F],2,function(x)x[2]-x[1])
800:       XPath = getXcoords(QSarray,i,addVIF=addVIF)
808:         PDFPath<-approx( XPath, QSarray$path.PDF[,i],X_Sample,rule=2)$y
47:     qs.results.comb$path.mean = 2 * qs.results.comb$path.mean
59:     for(i in c("var.method","labels","pairVector","pathways","path.size")){
408:   geneResults$path.mean = pathMeans
409:   geneResults$path.size = Sizes
412:   geneResults$path.PDF = PDFs
503:   if(!is.null(geneResults$path.PDF)){ ##if defined, rescale the pdf with the new vif values
504:     geneResults$path.PDF = t(t(geneResults$path.PDF) / pdfScaleFactor(geneResults))
524:   if(is.null(QSarray$path.PDF)){stop("convolution results not found.")}
525:   p = sapply(1:ncol(QSarray$path.PDF), function(i){
526:     if(!is.null(QSarray$path.size) && QSarray$path.size[i]==0){return(NA)}
533:           mean(q$mean[-path])
538:         null.hyp = mean(QSarray$mean[-path])
545: #         path = QSarray$pathways[[i]]
546: #         null.hyp=mean(getExAbs(QSarray$dof[path])*QSarray$SD[path])
551:     PDF_NORM<-QSarray$path.PDF[,i]/sum(QSarray$path.PDF[,i])
552: #     sum(QSarray$path.PDF[1:findInterval(0,x),i]) / sum(QSarray$path.PDF[,i])
571: twoWay.pVal <- function(grp1, grp2, path.index1 = 1:numPathways(grp1), path.index2 = 1:numPathways(grp2), 
575:   return(twoCurve.pVal(grp1, grp2, path.index1, path.index2, alternative, direction,addVIF))
582:                         path.index1 = 1:numPathways(grp1),
583:                         path.index2 = 1:numPathways(grp2), 
589: #   if(ncol(grp1$path.PDF)!=ncol(grp2$path.PDF) | all(colnames(grp1$path.PDF) != colnames(grp2$path.PDF))){
592:   if(length(path.index1)!=length(path.index2)){
595: #     if(sum(names(grp1$path.mean[path.index1])!=names(grp2$path.mean[path.index2]))){
599:   x1 = sapply(path.index1,function(i){getXcoords(grp1,i,addVIF=addVIF)})
600:   x2 = sapply(path.index2,function(i){getXcoords(grp2,i,addVIF=addVIF)})
605:   p = sapply(1:length(path.index1), function(i){
607:     PDF1<-approx( x1[,i], grp1$path.PDF[,path.index1[i]],seq(Min[i],Max[i],length.out=Length1+Length2),rule=2)$y
608:     PDF2<-approx( x2[,i], grp2$path.PDF[,path.index2[i]],seq(Min[i],Max[i],length.out=Length1+Length2),rule=2)$y
615: ## path.index can either be an integer between 1 and length(path.means), or the name of the pathway.
618: getXcoords = function(QSarray,path.index=1, addVIF=!is.null(QSarray$vif)){ #,absolute=FALSE){
619:   if(length(path.index)>1){stop("path.index must be of length 1")}
622:   sif = ifelse(addVIF,sqrt(QSarray$vif[path.index]),1)
626:   seq(-1,1,length.out=QSarray$n.points)* QSarray$ranges[path.index]* sif + QSarray$path.mean[path.index]
630: #    MeanAbs<-mean(abs(QSarray$mean[QSarray$pathways[[path.index]]]))
631: #    seq(-1,1,length.out=QSarray$n.points)* QSarray$ranges[path.index]* sif / QSarray$path.size[path.index] + MeanAbs
642:   pdfSum = colSums(QSarray$path.PDF)
655:   cis = sapply(1:ncol(QSarray$path.PDF), function(i){
657:         any(is.na(QSarray$path.PDF[,i]))){return(c(NA,NA))}
659:     cdf = cumsum(QSarray$path.PDF[,i])
668:   colnames(cis) = colnames(QSarray$path.PDF)
771:                                  path.index=1:numPathways(QSarray), ##The pathways to calculate the pVals for.
778:   ##check path.index
779:   if(is.character(path.index)){
780:     path.index = match(path.index, names(QSarray$pathways))
793:     if(!addVIF)SDPath = SDPath / sqrt(QSarray$vif[path.index])
799:     for(i in path.index){
824:             TMP<-pnorm( ( Means[j] - QSarray$path.mean[i]  ) / sqrt( SDPath[i]^2 + (DOF[j])/(DOF[j]-2)*SD[j]^2) )
835:     for(i in path.index){
842:           if(compareTo=="mean")SUBSTRACT=QSarray$path.mean[i]
875:         if(!CompareWithZero)SUBSTRACT=QSarray$path.mean[i]
17:                   geneSets,          ##a list of pathways to be compared. Each item in the list is a vector of names that correspond to the row names of ...(5 bytes skipped)...
74:                          geneSets,          ##a list of pathways to be compared. Each item in the list is a vector of names that correspond to the row names of ...(5 bytes skipped)...
308:  if(!is.null(QSarray$pathways)){stop("too late...aggregateGeneSet already being called")}
320: ##Simple function to read in a .gmt file and return a list of pathways
322:   if(!grepl("\\.gmt$",file)[1]){stop("Pathway information must be a .gmt file")}
331: #######Combine individual gene differential expresseion for each pathway (Neg) ~ 1 minute
334:                            geneSets,     ##a list of pathways to be compared, each item in the list is a vector of names that correspond to the gene names fr...(25 bytes skipped)...
336:                            silent=TRUE   ##If false, print a "." every fifth pathway, as a way to keep track of progress
401:     pathMeans = c(pathMeans, mean(Means[Indexes]))
405:   colnames(PDFs) = names(pathMeans) = names(Sizes) = names(geneSets)
407:   geneResults$pathways = geneSets
425: #                    geneSets=NULL, ##a list of pathways calculate the vif for, each item in the list is a vector of names that correspond to the gene n...(32 bytes skipped)...
430:     if(is.null(geneResults$pathways)){stop("Pathway Information not found. Please provide a list of gene sets.")}
431:     geneSets = geneResults$pathways
439: #     geneResults$pathways = geneSets
516: ## function for calculating a p-value for each pathway convolution as output by aggregateGeneSet.
519: ...(59 bytes skipped)... true (and alternative="two.sided"), p-values will be returned as eiter positive or negative if the pathway is greater or less than 0, respectively.
521: ...(15 bytes skipped)...      selfContained=TRUE                ##If false, rather than comparing to 0, it will compare the pathway mean to the mean of all genes not in the pathway.
578: ## A method to compare the pathway convolutions in two QSarray objects. 
588:   ##if the names of the pathways don't match, 
590: #     stop("Pathways in grp1 do not match pathways in grp2")
593:     stop("Number of pathways in grp1 do not match number of pathways in grp2")
596: #         warning("Some of the comparisons are made between different pathways")
614: ## Calculates the x-coordinates for the PDF of a given pathway.
629: #    ###First calculate the new mean of the pathway based on the absolute values of the means
656:     if( (!is.null(QSarray$pathways) && length(QSarray$pathways[[i]])==0 ) ||
772:                                  silent=TRUE,   ##If false, print a "." every fifth pathway, as a way to keep track of progress  
784:   if(is.null(QSarray$pathways)){stop("Pathway Information not found. Please run aggregateGeneSet first.")}
785:   geneSets = QSarray$pathways
805:         Min<-min(c(XGene[1]+ Means[Indexes],XPath[1]))
806:         Max<-max(c(XGene[NPoints]+ Means[Indexes],XPath[QSarray$n.points]))
815:             PS<-c(PS,compareTwoDistsFaster(PDFGene,PDFPath, alternative="two.sided"))                    
860: ...(17 bytes skipped)...             CompareWithZero=TRUE ###Logical, if TRUE compares with mean of zero, else with mean of pathway
862:   if(is.null(QSarray$pathways)){stop("Pathway Information not found. Please provide a list of gene sets.")}
863:   geneSets = QSarray$pathways
898: #                    geneSets=NULL, ##a list of pathways calculate the vif for, each item in the list is a vector of names that correspond to the gene n...(32 bytes skipped)...
901:   if(is.null(geneResults$pathways)){stop("Pathway Information not found. Please provide a list of gene sets.")}
902:   geneSets = geneResults$pathways  
640:   sif = sapply(1:numPathways(QSarray),function(i){ifelse(addVIF,sqrt(QSarray$vif[i]),1)})
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"),
SeqArray:R/Internal.R: [ ]
697:     path <- name.gdsn(node, TRUE)
175: .var_path <- function(var.name, prefix)
173: # Variable path
700:         varname <- .var_path(substring(varname, 2L), "@")
701:     fullvarname <- paste(path, varname, sep="/")
709:         if (path == "genotype")
712:             varname2 <- path
726:             if (path == "genotype")
BEclear:R/imputeMissingDataForBlock.R: [ ]
83:   path <- paste(dir, filename, sep = "/")
84:   save(D1, file = path)
spikeLI:R/collapse.R: [ ]
18:         path <- system("pwd",TRUE);
20:                 {postscript(paste(path,paste("/",probe_set[1],sep=""),sep=""));}
21:         else    {postscript(paste(path,paste("/",filename,sep=""),sep=""));}
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)
EpiMix:R/TCGA_Download_Preprocess.R: [ ]
1643:     path <- eh[[hub_id]]
176:         nameForDownloadedFileFullPath <- paste0(saveDir, nameForDownloadedFile)
41: #' @param saveDir path to directory to save downloaded files.
50: #' @return DownloadedFile path to directory with downloaded files.
405: #' @param METdirectory path to the 27K or 450K data
1497: #' @param TargetDirectory Path to save the sample.info. Default: ''.
1636: #' @return local file path where the lncRNA expression data are saved
1644:     return(path)
7: #' @return list with paths to downloaded files for both 27k and 450k methylation data.
116:         # warnMessage <- paste0('\nNot returning any viable url data paths
193:                 untar(nameForDownloadedFileFullPath, exdir = saveDir)
965: #' @return list with paths to downloaded files for gene expression.
biodb:R/BiodbConn.R: [ ]
734:     path <- cch$getFilePath(self$getCacheId(), name='download', ext=ext)
147: #' Get the path to the persistent cache file.
727: #' Gets the path where the downloaded content is written.
728: #' @return The path where the downloaded database is written.
736:     logDebug0('Download path of ', self$getId(), ' is "', path, '".')
738:     return(path)
743: #' @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())
729: getDownloadPath=function() {
793:         if ( ! file.exists(self$getDownloadPath()))
795:                 self$getDownloadPath())
diffHic:src/report_hic_pairs.cpp: [ ]
313:     std::string path;
208:     Bamfile(const char * path) : holding(false) { 
209:         in = sam_open(path, "rb");
212:             out << "failed to open BAM file at '" << path << "'";
267:         path=converter.str();
292:             out=std::fopen(path.c_str(), "a");
294:             out=std::fopen(path.c_str(), "w"); // Overwrite any existing file, just to be safe.
298:             err << "failed to open output file at '" << path << "'"; 
326:     const Rcpp::String bampath=check_string(bamfile, "BAM file path");
512:                 outpaths[j]=collected[i][j].path;
595:     Rcpp::String bampath=check_string(incoming, "BAM file path");
334:     Bamfile input(bampath.get_cstring());
596:     Bamfile input(bampath.get_cstring());
507:     Rcpp::List filepaths(nc);
509:         Rcpp::StringVector outpaths(i+1);
515:         filepaths[i]=outpaths;
518:     return Rcpp::List::create(filepaths, 
alabaster.ranges:R/readAtomicVectorList.R: [ ]
69:     path <- acquireFile(project, info$path)
33:     fpath <- file.path(path, "partitions.h5")
5: #' @param path String containing a path to a directory, itself created with the \code{\link{saveObject}} method for \linkS4class{Compressed...(13 bytes skipped)...
25: readAtomicVectorList <- function(path, ...) {
26:     .read_compressed_list(path, "atomic_vector_list", ...)
30: .read_compressed_list <- function(path, name, ...) {
31:     concat <- altReadObject(file.path(path, "concatenated"), ...)
47:         mcols.path=file.path(path, "element_annotations"),
48:         metadata.path=file.path(path, "other_annotations"),
59:     concat.info <- acquireMetadata(project, info$atomic_vector_list$concatenated$resource$path)
72:     groups <- .quickReadCsv(path, 
34:     fhandle <- H5Fopen(fpath)
TEQC:R/multiTEQCreport.R: [ ]
42:   Path <- getwd()
44:   print(paste("results and report are saved in folder", Path))
47:   imgDir <- file.path(destDir, "image")
82:   write.table(speci, file=file.path(destDir, "fractionReadsOnTarget.txt"), sep="\t", quote=FALSE)
86:   write.table(targcov, file=file.path(destDir, "targetCoverageStats.txt"), sep="\t", quote=FALSE)
100:   write.table(sensi, file=file.path(destDir, "sensitivity.txt"), sep="\t", row.names=FALSE, quote=FALSE)
103:   write.table(perTargCov, file=file.path(destDir, "targetCoverage.txt"), sep="\t", quote=FALSE)
136:   htmlFile <- file.path(destDir, "index.html")
150:   file.copy(cssFile, file.path(destDir, names(cssFile)))
151:   file.copy(system.file("template", "image", biocFile, package="TEQC"), file.path(destDir, "image", biocFile))
167:     imgDir <- file.path(dir, "image")
170:     jpeg(file.path(imgDir, figFile), ...)
172:     png(file.path(imgDir, figFile), ...)
174:     tiff(file.path(imgDir, figFile), ...)
178:     pdf(file.path(imgDir, pdfFile), ...)
183:     hwriteImage(file.path(".", "image", figFile), link=file.path(".", "image", pdfFile))
207:     imgDir <- file.path(dir, "image")
210:     jpeg(file.path(imgDir, figFile), ...)
212:     png(file.path(imgDir, figFile), ...)
214:     tiff(file.path(imgDir, figFile), ...)
218:     pdf(file.path(imgDir, pdfFile), ...)
223:     hwriteImage(file.path(".", "image", figFile), link=file.path(".", "image", pdfFile))
246:     imgDir <- file.path(dir, "image")
249:     jpeg(file.path(imgDir, figFile), ...)
251:     png(file.path(imgDir, figFile), ...)
253:     tiff(file.path(imgDir, figFile), ...)
257:     pdf(file.path(imgDir, pdfFile), ...)
262:     hwriteImage(file.path(".", "image", figFile), link=file.path(".", "image", pdfFile))
289:     imgDir <- file.path(dir, "image")
292:     jpeg(file.path(imgDir, figFile), width=1000, ...)
294:     png(file.path(imgDir, figFile), width=1000, ...)
296:     tiff(file.path(imgDir, figFile),width=1000, ...)
300:     pdf(file.path(imgDir, pdfFile), width=14, ...)
305:     hwriteImage(file.path(".", "image", figFile), link=file.path(".", "image", pdfFile))
335:     imgDir <- file.path(dir, "image")
338:     jpeg(file.path(imgDir, figFile), width=800, height=800, ...)
340:     png(file.path(imgDir, figFile), width=800, height=800, ...)
342:     tiff(file.path(imgDir, figFile), width=800, height=800, ...)
346:     pdf(file.path(imgDir, pdfFile), width=12, height=12, ...)
351:     hwriteImage(file.path(".", "image", figFile), link=file.path(".", "image", pdfFile))
ORFik:R/experiment.R: [ ]
22:   for (path in filepaths) {
663:     save_path <- file.path(out_dir, paste0(name, ".ofst"))
803:     cbu.path <- "/export/valenfs/data/processed_data/experiment_tables_for_R/"
13: findFromPath <- function(filepaths, candidates, slot = "auto") {
253: filepath <- function(df, type, basename = FALSE,
263:   paths <- lapply(df$filepath, function(x, df, type) {
335: filepath_errors <- function(format) {
661:     specific_paths <- filepaths[libs[[name]]]
94:     reversePaths <- df$reverse[!(df$reverse %in% c("", "paired-end"))]
659:   filepaths <- filepath(df, type)
6: #' @param filepaths path to all files
23:     hit <- names(unlist(sapply(candidates, grep, x = path)))
26:     hitRel <- names(unlist(sapply(candidates, grep, x = gsub(".*/", "", path))))
234: #' path to base folder to search for library variant directories.
235: #' If single path (length == 1), it will apply to all libraries in df.
249: #' # Other format path
271:       out.dir.type <- file.path(base_folder, rel_folder["pshifted"])
296:       out.dir.type <- file.path(base_folder, rel_folder[t])
621: #' @param out_dir Ouput directory, default \code{file.path(dirname(df$filepath[1]), "ofst_merged")},
635: #' #fimport(file.path(tempdir(), "all.ofst"))
637: #' #read_fst(file.path(tempdir(), "all.ofst"))
642: mergeLibs <- function(df, out_dir = file.path(libFolder(df), "ofst_merged"), mode = "all",
664:     write_fst(ofst_merge(specific_paths, specific_names, keep_all_scores), save_path)
718:       fext[compressed] <-file_ext(file_path_sans_ext(files[compressed],
792: #' ## Path above is default path, so no dir argument needed
796: #' #list.experiments(dir = "MY/CUSTOM/PATH)
801:   experiments <- list.files(path = dir, pattern = "\\.csv")
804:     if (dir.exists(cbu.path)) { # If on UIB SERVER
805:       dir <- cbu.path
806:       experiments <- list.files(path = dir, pattern = "\\.csv")
91:   files <- df$filepath
92:   if (length(df$filepath) == 0) stop("df have no filepaths!")
154: #' Get variable name per filepath in experiment
226: #' Get relative paths instead of full. Only use for inspection!
239: #' @return a character vector of paths, or a list of character with 2 paths per,
246: #' filepath(df, "default")
248: #' filepath(df[9,], "default")
250: #' filepath(df[9,], "ofst")
252: #' filepath(df[9,], "pshifted") # <- falls back to ofst
264:     i <- which(df$filepath == x)
288:         } else stop(filepath_errors(type))
307:         } else stop(filepath_errors(t))
325:     if (is.null(input)) stop("filepath type not valid!")
329:   if (all(lengths(paths) == 1)) {
330:     paths <- unlist(paths)
332:   return(paths)
371: #' @param paths character vector, the filpaths to use,
372: #' default \code{filepath(df, type)}. Change type argument if not correct.
419: outputLibs <- function(df, type = "default", paths = filepath(df, type),
444:         libs <- lapply(seq_along(paths),
445:                        function(i, paths, df, chrStyle, param, strandMode, varNames, verbose) {
447:                            fimport(paths[i], chrStyle, param, strandMode)
448:                          }, paths = paths, chrStyle = chrStyle, df = df,
452:         libs <- bplapply(seq_along(paths),
453:                          function(i, paths, df, chrStyle, param, strandMode, varNames, verbose) {
455:                            fimport(paths[i], chrStyle, param, strandMode)
456:                          }, paths = paths, chrStyle = chrStyle, df = df,
589:                        remove.file_ext(df$filepath[i], basename = TRUE),
10: #' else must be a character vector of length 1 or equal length as filepaths.
15:     if(length(slot) != 1 & length(slot) != length(filepaths)) {
95:     files <- c(files, reversePaths)
114:     stop("Duplicated filepaths in experiment!")
213: #' Get filepaths to ORFik experiment
217: #' then default filepaths without warning. \cr
epivizrServer:R/middleware-plus-supporting.R: [ ]
438:     path <- req$PATH_INFO
217:   abs.path <- file.path(dir, relpath)
446:     abs.path <- resolve(root, path)
367:   pathPattern <- paste("^\\Q", prefix, "\\E/", sep = "")
371:       origPath <- req$PATH_INFO
376:       pathInfo <- substr(req$PATH_INFO, nchar(prefix)+1, nchar(req$PATH_INFO))
402:   pathPattern <- paste("^\\Q", prefix, "\\E/", sep = "")
407:       origPath <- req$PATH_INFO
412:       pathInfo <- substr(req$PATH_INFO, nchar(prefix)+1, nchar(req$PATH_INFO))
205: # Attempt to join a path and relative path, and turn the result into a
206: # (normalized) absolute path. The result will only be returned if it is an
218:   if (!file.exists(abs.path))
220:   abs.path <- normalizePath(abs.path, winslash='/', mustWork=TRUE)
224:   if (nchar(abs.path) <= nchar(dir) + 1)
226:   if (substr(abs.path, 1, nchar(dir)) != dir ||
227:       substr(abs.path, nchar(dir)+1, nchar(dir)+1) != '/') {
230:   return(abs.path)
344: # `PATH_INFO` field, but since it's such a common need, let's make it simple by
349: # the route off of the `PATH_INFO` (and add it to the end of `SCRIPT_NAME`).
351: # path has already been matched via routing.
369:     if (isTRUE(grepl(pathPattern, req$PATH_INFO))) {
374:         req$PATH_INFO <- origPath
378:       req$PATH_INFO <- pathInfo
405:     if (isTRUE(grepl(pathPattern, req$PATH_INFO))) {
410:         req$PATH_INFO <- origPath
414:       req$PATH_INFO <- pathInfo
440:     if (is.null(path))
443:     if (path == '/')
444:       path <- '/index.html'
447:     if (is.null(abs.path))
450:     content.type <- mime::guess_type(abs.path)
451:     response.content <- readBin(abs.path, 'raw', n=file.info(abs.path)$size)
216: resolve <- function(dir, relpath) {
221:   dir <- normalizePath(dir, winslash='/', mustWork=TRUE)
295: # representing paths to be used instead of handlers; any such strings we
TPP2D:R/import_funcs.R: [ ]
348:   Experiment <- Path <- Compound <- NULL
570:  Path <- label <- conc <- Compound <- Experiment <- 
371:   givenPaths <- NULL
253:                "Experiment", "Path", "Path", 
254:                "Path", "Condition", "Replicate", 
334: #' @param infoTable character string of a file path to
372:   if (any("Path" %in% colnames(infoTable))) {
373:     if (all(infoTable$Path == "") || all(is.na(infoTable$Path))) {
374:       message("Removing empty 'Path' column from config table")
375:       infoTable <- infoTable %>% select(-Path)
378:       givenPaths <- infoTable$Path
443: #' @param configTable character string of a file path to a config table
485:   files <- configTable$Path
511:                   "RefCol", "Path", "Condition")
573:   if(any(grepl("Path", colnames(configWide)))){
575:       dplyr::select(-Path) %>%
756: #' @param configTable character string of a file path to a config table
433:       expCond = infoTable$Condition, files = givenPaths, 
RProtoBufLib:inst/include/cytolib/GatingSet.pb.h: [ ]
6488: inline const std::string& BOOL_GATE_OP::path(int index) const {
6536: BOOL_GATE_OP::path() const {
6482: inline int BOOL_GATE_OP::path_size() const {
6485: inline void BOOL_GATE_OP::clear_path() {
6492: inline std::string* BOOL_GATE_OP::mutable_path(int index) {
6496: inline void BOOL_GATE_OP::set_path(int index, const std::string& value) {
6500: inline void BOOL_GATE_OP::set_path(int index, std::string&& value) {
6504: inline void BOOL_GATE_OP::set_path(int index, const char* value) {
6509: inline void BOOL_GATE_OP::set_path(int index, const char* value, size_t size) {
6514: inline std::string* BOOL_GATE_OP::add_path() {
6518: inline void BOOL_GATE_OP::add_path(const std::string& value) {
6522: inline void BOOL_GATE_OP::add_path(std::string&& value) {
6526: inline void BOOL_GATE_OP::add_path(const char* value) {
6531: inline void BOOL_GATE_OP::add_path(const char* value, size_t size) {
6541: BOOL_GATE_OP::mutable_path() {
1576:   static const int kPathFieldNumber = 1;
1573:   // repeated string path = 1;
1574:   int path_size() const;
1575:   void clear_path();
1577:   const std::string& path(int index) const;
1578:   std::string* mutable_path(int index);
1579:   void set_path(int index, const std::string& value);
1580:   void set_path(int index, std::string&& value);
1581:   void set_path(int index, const char* value);
1582:   void set_path(int index, const char* value, size_t size);
1583:   std::string* add_path();
1584:   void add_path(const std::string& value);
1585:   void add_path(std::string&& value);
1586:   void add_path(const char* value);
1587:   void add_path(const char* value, size_t size);
1588:   const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& path() const;
1589:   ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_path();
1608:   ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> path_;
6481: // repeated string path = 1;
6483:   return path_.size();
6486:   path_.Clear();
6489:   // @@protoc_insertion_point(field_get:pb.BOOL_GATE_OP.path)
6490:   return path_.Get(index);
6493:   // @@protoc_insertion_point(field_mutable:pb.BOOL_GATE_OP.path)
6494:   return path_.Mutable(index);
6497:   // @@protoc_insertion_point(field_set:pb.BOOL_GATE_OP.path)
6498:   path_.Mutable(index)->assign(value);
6501:   // @@protoc_insertion_point(field_set:pb.BOOL_GATE_OP.path)
6502:   path_.Mutable(index)->assign(std::move(value));
6506:   path_.Mutable(index)->assign(value);
6507:   // @@protoc_insertion_point(field_set_char:pb.BOOL_GATE_OP.path)
6510:   path_.Mutable(index)->assign(
6512:   // @@protoc_insertion_point(field_set_pointer:pb.BOOL_GATE_OP.path)
6515:   // @@protoc_insertion_point(field_add_mutable:pb.BOOL_GATE_OP.path)
6516:   return path_.Add();
6519:   path_.Add()->assign(value);
6520:   // @@protoc_insertion_point(field_add:pb.BOOL_GATE_OP.path)
6523:   path_.Add(std::move(value));
6524:   // @@protoc_insertion_point(field_add:pb.BOOL_GATE_OP.path)
6528:   path_.Add()->assign(value);
6529:   // @@protoc_insertion_point(field_add_char:pb.BOOL_GATE_OP.path)
6532:   path_.Add()->assign(reinterpret_cast<const char*>(value), size);
6533:   // @@protoc_insertion_point(field_add_pointer:pb.BOOL_GATE_OP.path)
6537:   // @@protoc_insertion_point(field_list:pb.BOOL_GATE_OP.path)
6538:   return path_;
6542:   // @@protoc_insertion_point(field_mutable_list:pb.BOOL_GATE_OP.path)
6543:   return &path_;
CBNplot:R/utilities.R: [ ]
310:     path <- BiocFileCache::bfcrpath(bfc, url)
311:     pathRel <- read.csv(path, sep="\t", header=FALSE)
312:     pathRelG <- graph_from_edgelist(as.matrix(pathRel), directed = FALSE)
313:     incPath <-  V(pathRelG)[names(V(pathRelG)) %in% res$ID]
351: obtainPath <- function(res, geneSymbol) {
464:         pathwayMatrix <- exp[ intersect(rownames(exp), genesInPathway),
469:             pathwayMatrixPca <- prcomp(t(pathwayMatrix), scale. = FALSE)$x[,1]
314:     incPathG <- igraph::subgraph(pathRelG, incPath)
423: bnpathtest <- function (results, exp, expSample=NULL, algo="hc",
455:         genesInPathway <- strsplit(res[i, ]$geneID, "/")[[1]]
563:     genesInPathway <- unlist(strsplit(res[pathNum, ]$geneID, "/"))
19: #'                   pathNum=1, returnNet=TRUE)
138: #'                   pathNum=1, returnNet=TRUE)
337: #' obtainPath
348: #' obtainPath(res = exampleEaRes, geneSymbol="ERCC7")
371: #'         exp = exampleGeneExp, pathNum = 1, R = 10, returnNet=TRUE)
373: #'         exp = exampleGeneExp, pathNum = 1, R = 10, returnNet=TRUE)
395: #' Testing various R for bayesian network between pathways
409: #' @param nCategory the number of pathways to be included
466:         if (dim(pathwayMatrix)[1]==0) {
467:             message("no gene in the pathway present in expression data")
470:             avExp <- apply(pathwayMatrix, 2, mean)
471:             corFlag <- cor(pathwayMatrixPca, avExp)
472:             if (corFlag < 0){pathwayMatrixPca <- pathwayMatrixPca*-1}
473:             # pathwayMatrixSum <- apply(pathwayMatrix, 2, sum)
475:             pcs <- cbind(pcs, pathwayMatrixPca)
530: #' @param pathNum the pathway number (the number of row of the original result,
540: #' algo="hc", Rrange=seq(10, 30, 10), pathNum=1, scoreType="bge")
545:                         pathNum=NULL, convertSymbol=TRUE, expRow="ENSEMBL",
308:     url <- "https://reactome.org/download/current/ReactomePathwaysRelation.txt"
315:     incPathG <- set.vertex.attribute(incPathG, "name",
316:         value=res[names(V(incPathG)), "Description"])
318:     ovlG <- as_edgelist(igraph::intersection(incPathG, undirG))
393: #' bnpathtest
418: #' res <- bnpathtest(results = exampleEaRes, exp = exampleGeneExp,
458:                 genesInPathway <- clusterProfiler::bitr(genesInPathway,
566:             genesInPathway <- clusterProfiler::bitr(genesInPathway,
573:     pcs <- exp[ intersect(rownames(exp), genesInPathway), expSample ]
interactiveDisplay:inst/www/js/d3.v2.js: [ ]
6081:     function path(d, i) {
1451:   function d3_layout_bundlePath(link) {
1910:   function d3_path_circle(radius) {
1119:     var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
1120:     while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]);
1121:     return path.join("");
1124:     var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
1125:     while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]);
1126:     return path.join("");
1141:     var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1;
1143:       path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1];
1151:       path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," ...(21 bytes skipped)...
1155:         path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
1160:       path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1];
1162:     return path;
1176: ...(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 ];
1177:     d3_svg_lineBasisBezier(path, px, py);
1184:       d3_svg_lineBasisBezier(path, px, py);
1192:       d3_svg_lineBasisBezier(path, px, py);
1194:     return path.join("");
1198:     var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ];
1204:     path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, ...(6 bytes skipped)...
1212:       d3_svg_lineBasisBezier(path, px, py);
1214:     return path.join("");
1217:     var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = [];
1223:     path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py)...(4 bytes skipped)...
1231:       d3_svg_lineBasisBezier(path, px, py);
1233:     return path.join("");
1251:   function d3_svg_lineBasisBezier(path, x, y) {
1252:     path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1...(207 bytes skipped)...
4383:         var tick = g.selectAll("g").data(ticks, String), tickEnter = tick.enter().insert("g", "path").style("opacity", 1e-6), tickExit = d3.transition(tick.exit()).style("opacity", 1e-6).remove(), ti...(67 bytes skipped)...
4384:         var range = d3_scaleRange(scale), path = g.selectAll(".domain").data([ 0 ]), pathEnter = path.enter().append("path").attr("class", "domain"), pathUpdate = d3.transition(path);
6080:   d3.geo.path = function() {
6082:       if (typeof pointRadius === "function") pointCircle = d3_path_circle(pointRadius.apply(this, arguments));
6111:     var pointRadius = 4.5, pointCircle = d3_path_circle(pointRadius), projection = d3.geo.albersUsa(), buffer = [];
6178:     var areaType = path.area = d3_geo_type({
6201:     var centroidType = path.centroid = d3_geo_type({
6220:     path.projection = function(x) {
6222:       return path;
6224:     path.pointRadius = function(x) {
6227:         pointCircle = d3_path_circle(pointRadius);
6229:       return path;
6231:     return path;
4401:             pathUpdate.attr("d", "M" + range[0] + "," + tickEndSize + "V0H" + range[1] + "V" + tickEndSize);
4414:             pathUpdate.attr("d", "M" + range[0] + "," + -tickEndSize + "V0H" + range[1] + "V" + -tickEndSize);
4427:             pathUpdate.attr("d", "M" + -tickEndSize + "," + range[0] + "H0V" + range[1] + "H" + -tickEndSize);
4440:             pathUpdate.attr("d", "M" + tickEndSize + "," + range[0] + "H0V" + range[1] + "H" + tickEndSize);
4923:       var paths = [], i = -1, n = links.length;
4924:       while (++i < n) paths.push(d3_layout_bundlePath(links[i]));
4925:       return paths;
6083:       pathType(d);
6112:     var pathType = d3_geo_type({
6115:         while (++i < n) buffer.push(pathType(features[i].geometry));
6118:         pathType(o.geometry);
6175:         while (++i < n) buffer.push(pathType(geometries[i]));
flowGraph:R/04_flowgraph_plots.R: [ ]
1574:                         path <- paste0(
1536:             plot_path_ <- paste0(
2: #' @description Creates a cell hierarchy plot given a flowGraph object. If a path is not provided for \code{fg_plot} to save the plot, please use \code{plot_gr} to view plot given t...(28 bytes skipped)...
89: #' @param path A string indicating the path to where the function should save
104: #'  the plot by filling out the \code{path} parameter with a full path to the
117: #'    path=NULL) # set path to a full path to save plot as a PNG
142:     path=NULL, width=9, height=9
279:         if (!is.null(path) & !interactive)
281:                 grepl("[.]png$",path, ignore.case=TRUE),
282:                 path, paste0(path, ".png")),
285:         if (!is.null(path) & interactive & !visNet_plot)
287:                 gp, ifelse(grepl("[.]html$",path, ignore.case=TRUE),
288:                            path, paste0(path, ".html")))
289:         if (!is.null(path) & interactive & visNet_plot)
291:                 gp, file=ifelse(grepl("[.]html$",path, ignore.case=TRUE),
292:                                 path, paste0(path, ".html")),
295:     if (is.null(path)) message("use function plot_gr to plot fg_plot output")
407: #'    path=NULL) # set path to a full path to save plot as a PNG
719: #' @param path A string indicating the path to where the function should save
754:     main=NULL, interactive=FALSE, path=NULL
822:             if (!is.null(path))
824:                     qp, ifelse(grepl("[.]html$",path, ignore.case=TRUE),
825:                                path, paste0(path, ".html")))
829:         if (!is.null(path))
832:                     ifelse(grepl("[.]png$",path, ignore.case=TRUE),
833:                            path, paste0(path, ".png")),
903: #' @param path A string indicating the path to where the function should save
940:     main=NULL, path=NULL
1031:     if (!is.null(path))
1033:             ifelse(grepl("[.]png$",path, ignore.case=TRUE),
1034:                    path, paste0(path, ".png")),
1051:     main=NULL, path=NULL
1063:             main=main, path=path,
1202:     if (!is.null(path)) {
1205:                 "[.]png$",path, ignore.case=TRUE),
1206:                 path, paste0(path, ".png")),
1281: #' @param path A string indicating the path to where the function should save
1316:     main=NULL, interactive=FALSE, path=NULL
1386:         if (!is.null(path))
1389:                     "[.]png$",path, ignore.case=TRUE),
1390:                     path, paste0(path, ".png")), plot=gp)
1426:         if (!is.null(path))
1428:                 gp, ifelse(grepl("[.]html$", path, ignore.case=TRUE),
1429:                            path, paste0(path, ".html")))
1443: #' @param plot_path A string indicating the folder path to where the function
1520:     fg, plot_path, plot_types="node", interactive=FALSE,
1537:                 plot_path, "/", type, "/", paste0(sm, collapse="_"))
1538:             while (dir.exists(plot_path_) & !overwrite)
1539:                 plot_path_ <- paste0(plot_path_,"_")
1540:             dir.create(plot_path_, recursive=TRUE, showWarnings=FALSE)
1551:                     path=paste0(plot_path_, "/pVSdifference.png"))
1567:                     rdir_ <- paste0(plot_path_, "/boxplots")
1580:                             path=path, paired=paired,
1595:                     path=paste0(plot_path_,"/qq.png"),
1605:                         path=paste0(plot_path_,"/cell_hierarchy.png"),
1628:                             paste0(plot_path_,"/cell_hierarchy_",
Rqc:R/utils.R: [ ]
94:     path <- dirname(file)
99:     data.frame(filename, pair, format, group, reads, total.reads, path, 
MSstatsBig:R/backends.R: [ ]
11:   sparklyr::spark_read_csv(connection, "mstinput", path = input_file,
ChemmineR:R/AllClasses.R: [ ]
1741: 	path <- conMA(x, exclude="H")
1986:             path <- .linearCon(x=con)
1807: 	conpath <- t(sapply(path, function(x) x[c(1, length(x))]))
1819: 	pathlist <- cyclist$path
1820: 	conpath <- cyclist$conpath
1821: 	pathlistnew <- list() 
1742: 	noconnect <- rowSums(path) != 0 # Removes atoms with no connections
1743: 	path <- path[noconnect, noconnect]
1744: 	if(all(dim(path) == 0)) { return(path) } 
1745: 	term <- which(rowSums(path > 0)==1)
1747: 		path <- path[-term,-term]
1748: 		if(any(dim(path) == 0) | is.vector(path)) { break() }
1749: 		term <- which(rowSums(path > 0)==1)
1751: 	return(path)
1786: .update <- function(con, path) {
1787: 	## Remove non-terminal atoms in each path
1788: 	center_atoms <- unique(unlist(lapply(path, function(x) x[-c(1, length(x))])))
1798: 		path <- c(path, remainbonds)
1799: 		names(path) <- seq(along=path)
1801: 	## Collect complete rings and remove them from path object
1802: 	index <- unlist(lapply(path, function(y) any(duplicated(y))))
1803: 	rings <- path[index]
1804: 	path <- path[!index]
1805: 	names(path) <- seq(along=path)
1806: 	## Connection list for path component
1813: 	return(list(con=con, conpath=conpath, path=path, rings=rings))
1857: 		## Collect complete rings and remove them from path object
1987:             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)...
1754: ## (b) Function to return the longest possible linear bond paths where:
1808: 	ends <- unique(as.vector(conpath))
1809: 	conpath <- lapply(ends, function(x) as.numeric(names(which(rowSums(conpath==x) > 0))))
1810: 	names(conpath) <- ends
1811: 	conpath <- conpath[sapply(conpath, length) > 1] # removes ends that occur only once 
1823: 	## Loop to join linear paths/fragments stored in pathlist
1824: 	for(i in names(conpath)) {
1825: 		if(length(conpath) == 0 | !any(names(conpath) == i)) { next() }
1826: 		pos <- t(combn(conpath[[i]], m=2))
1828: 			p1 <- pathlist[[pos[j,1]]]
1829: 			p2 <- pathlist[[pos[j,2]]]
1834: 				pathlistnew[[length(pathlistnew)+1]] <- c(rev(p2[-1]), p1)
1837: 				pathlistnew[[length(pathlistnew)+1]] <- c(p1, rev(p2[-length(p2)]))
1840: 				pathlistnew[[length(pathlistnew)+1]] <- c(p2, p1[-1])
1843: 				pathlistnew[[length(pathlistnew)+1]] <- c(p1, p2[-1])
1847: 		if(length(pathlistnew) == 0) { next() }
1849: 		dups <- duplicated(sapply(pathlistnew, function(x) paste(sort(unique(x)), collapse="_")))
1850: 		pathlistnew <- pathlistnew[!dups]
1853: 			l <- sapply(pathlistnew, length)
1854: 			pathlistnew <- pathlistnew[l <= upper]
1855: 			if(length(pathlistnew) == 0) { next() }
1858: 		index <- unlist(lapply(pathlistnew, function(y) any(duplicated(y[c(1, length(y))]))))
1859: 		rings[[length(rings)+1]] <- pathlistnew[index]
1860: 		pathlistnew <- pathlistnew[!index]
1861: 		## Remove paths with internal duplicates 
1862: 		if(length(pathlistnew) > 0) {
1863: 			index <- unlist(lapply(pathlistnew, function(y) any(duplicated(y))))
1864: 			pathlistnew <- pathlistnew[!index]
1866: 		## Update pathlist and conpath
1867: 		pathlist <- c(pathlist[-conpath[[i]]], pathlistnew)
1868: 		dups <- duplicated(sapply(pathlist, function(x) paste(sort(unique(x)), collapse="_")))
1869: 		pathlist <- pathlist[!dups]
1870: 		names(pathlist) <- seq(along=pathlist)
1871: 		conpath <- t(sapply(pathlist, function(x) x[c(1, length(x))]))
1872: 		ends <- unique(as.vector(conpath))
1873: 		conpath <- lapply(ends, function(x) as.numeric(names(which(rowSums(conpath==x) > 0))))
1874: 		names(conpath) <- ends
1875: 		conpath <- conpath[sapply(conpath, length) > 1] # removes ends that occur only once
1876: 		pathlistnew <- list()
TIN:R/correlationPlot.R: [ ]
104:     path<-getwd()
105:     cat("Plot was saved in ",paste(path,"/",fileName,sep=""),"\n")
isobar:R/ProteinGroup-class.R: [ ]
424:                       host="www.ebi.ac.uk",path="/uniprot/biomart/martservice")
biocViews:R/repository.R: [ ]
14:         path <- packagesPaths[[type]]
181:     DESCRIPTION_path <- file.path(tmp_pkgdir, "DESCRIPTION")
182:     CITATION_path <- file.path(tmp_pkgdir, "inst", "CITATION")
183:     paths <- c(DESCRIPTION_path, CITATION_path)
193:     DESCRIPTION_tpath <- paste0(pkgname, "/DESCRIPTION")
194:     CITATION_tpath <- paste0(pkgname, "/inst/CITATION")
648:         cPath <- reposInfo[, ctype]
649:         buildPkgPath <- function(pkgs, vers) {
900:     cssPath <- system.file(file.path("css", paste(cssName, ".in", sep="")),
919:     cssPath <- system.file(file.path("css", paste(cssName, ".in", sep="")),
11:     packagesPaths <- file.path(reposRoot, contribPaths)
195:     tpaths <- c(DESCRIPTION_tpath, CITATION_tpath)
20:         message("- write_PACKAGES() to ", path, " ... ", appendLF=FALSE)
21:         t <- system.time(write_PACKAGES(path, type=type))[["elapsed"]]
55:     pkgDir <- file.path(unpackDir, pkg, subDir)
65:     ## reposRoot - Top level path for CRAN-style repos
75:         destDir <- file.path(reposRoot, "manuals")
88:             pkgDir <- file.path(unpackDir, pkg, "man")
89:             RCmd <- file.path(Sys.getenv("R_HOME"), "bin", "R")
104:     tarballs <- list.files(file.path(reposRoot, srcContrib),
130:         refmanDir <- file.path(reposRootPath, refman.dir, pkg, refmanSubDir)
147:         unpack(tarball, unpackDir, file.path(pkg, fileName))
150:     tarballs <- list.files(file.path(reposRoot, srcContrib),
180:     tmp_pkgdir <- file.path(tmpdir, pkgname)
191:     ## Note that the path separator is **always** / in a tarball, even
192:     ## on Windows, so do NOT use file.path() here.
210:     if (!file.exists(DESCRIPTION_path))  # should never happen
216:     if (file.exists(CITATION_path)) {
218:         citation <- try(readCitationFile(CITATION_path, meta=description),
233:     destfile <- file.path(destdir, "citation.html")
280:         file.path(reposRoot, srcContrib),
292:         .write_citation_as_HTML(pkgname, citation, file.path(destDir, pkgname))
300:     ## reposRoot - Top level path for CRAN-style repos
314:       destDir <- file.path(reposRoot, "news")
324:         srcDir <- file.path(srcDir, pkg)
325:         destDir <- file.path(destDir, pkg)
328:         destFile <- file.path(destDir, "NEWS")
332:     tarballs <- list.files(file.path(reposRoot, srcContrib),
354:     ## reposRoot - Top level path for CRAN-style repos
364:         destDir <- file.path(reposRoot, "vignettes")
367:         cleanUnpackDir(tarball, unpackDir, subDir=file.path("inst", "doc"))
374:     tarballs <- list.files(file.path(reposRoot, srcContrib),
388:     ## reposRoot - Top level path for CRAN-style repos
398:       destDir <- file.path(reposRoot, "vignettes")
420:     tarballs <- list.files(file.path(reposRoot, srcContrib),
444:         filedir <- file.path(reposRootPath, dir, pkg)
445:         file <- file.path(filedir, filename)
458:         vigDir <- file.path(reposRootPath, vignette.dir, pkg, vigSubDir)
481:             files <- file.path(reposRootPath, files)
535:     fn <- file.path(reposRootPath, "REPOSITORY")
541:     reposInfo <- read.dcf(file.path(reposRootPath, "REPOSITORY"))
562:     out <- file(file.path(dir, fname), "wt")
564:     ##outgz <- gzfile(file.path(dir, gzname), "wt")
601:     ## Read REPOSITORY file for contrib path info
612:         pkg.dir <- file.path(reposRootPath, reposInfo[, os])
641:     ## Integrate version and archive file path info for the different contrib
642:     ## paths in this repos.  We duplicate the source path info here, but that
661:         packagesFile <- file.path(reposRootPath, cPath, "PACKAGES")
664:                     file.path(reposRootPath, cPath),
665:                     "\nSkipping this contrib path.")
676:                     file.path(reposRootPath, cPath),
677:                     "\nSkipping this contrib path.")
693:     ## Add vignette path info
784:                    desc <- tools:::.read_description(file.path(meatPath, missing_pkgs[i], "DESCRIPTION"))
859:     viewsFile <- file.path(reposRoot, "VIEWS")
894:     writePackageDetailHtml(pkgList, file.path(reposRoot, "html"),
902:     res <- try(copySubstitute(cssPath, file.path(reposRoot, cssName),
913:         f <- file.path(htmlDir, htmlFilename(pkg))
921:     res <- try(copySubstitute(cssPath, file.path(htmlDir, cssName),
936:     f <- file.path(reposRoot, htmlFilename(repos))
941:     con <- file(file.path(dir, "SYMBOLS"), open="w")
965:         tarballs <- list.files(file.path(dir, "src/contrib"),
1: genReposControlFiles <- function(reposRoot, contribPaths, manifestFile=NA, meatPath=NA)
10:     ## Write PACKAGES files for all contrib paths
28:             write_VIEWS(reposRoot, manifestFile=manifestFile, meatPath=meatPath)
127: getRefmanLinks <- function(pkgList, reposRootPath, refman.dir) {
184:     status <- unlink(paths)
441: getFileExistsAttr <- function(pkgList, reposRootPath, dir, filename) {
452: getFileLinks <- function(pkgList, reposRootPath, vignette.dir, ext,
472: getDocumentTitles <- function(docs, ext="pdf", src=c("Rnw", "Rmd"), reposRootPath, fun) {
530: write_REPOSITORY <- function(reposRootPath, contribPaths)
539: read_REPOSITORY <- function(reposRootPath)
585: ##   meatPath <- "~biocbuild/bbs-3.14-bioc/MEAT0"
587: ##   write_VIEWS(reposRoot, manifestFile=manifestFile, meatPath=meatPath)
588: write_VIEWS <- function(reposRootPath, fields = NULL,
590:                         manifestFile=NA, meatPath=NA
602:     reposInfo <- read_REPOSITORY(reposRootPath)
609:     convertToMat <- function(reposRootPath, reposInfo, os, fields, verbose){
628:     dbMat = convertToMat(reposRootPath, reposInfo, os, fields, verbose)
632:             dbMat2 = convertToMat(reposRootPath, reposInfo, os, fields, verbose)
659:             paste(cPath, "/", pkgs, "_", vers, ext, sep="")
684:         dbMat[dbMatIdx, col] <- buildPkgPath(cDat[cDatGood, "Package"],
694:     vigs <- getFileLinks(dbMat[, "Package"], reposRootPath, vignette.dir, "pdf")
695:     vtitles <- getDocumentTitles(vigs, reposRootPath=reposRootPath, fun=getPdfTitle)
697:     rfiles <- getFileLinks(dbMat[, "Package"], reposRootPath, vignette.dir, "R")
699:     htmlDocs <- getFileLinks(dbMat[, "Package"], reposRootPath, vignette.dir, "html", TRUE)
701:     htmlTitles <- getDocumentTitles(htmlDocs, ext="html", src=c("Rmd", "Rhtml"), reposRootPath, getHtmlTitle)
718:     readmes <- getFileExistsAttr(dbMat[, "Package"], reposRootPath, "readmes", "README")
719:     news <- getFileExistsAttr(dbMat[, "Package"], reposRootPath, "news", "NEWS")
720:     install <- getFileExistsAttr(dbMat[, "Package"], reposRootPath, "install", "INSTALL")
721:     license <- getFileExistsAttr(dbMat[, "Package"], reposRootPath, "licenses",
781:             if (!is.na(meatPath)){
824:     .write_repository_db(dbMat, reposRootPath, "VIEWS")
8:     t <- system.time(write_REPOSITORY(reposRoot, contribPaths))[["elapsed"]]
12:     names(packagesPaths) <- names(contribPaths)
13:     for (type in names(packagesPaths)) {
196:     status <- untar(tarball, tpaths, exdir=tmpdir)
523:         res <- xpathApply(doc, "//title", xmlValue)
532:     contrib <- as.list(contribPaths)
533:     names(contrib) <- gsub("-", ".", names(contribPaths))
534:     contrib[["provides"]] <- paste(names(contribPaths), collapse=", ")
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)
BSgenome:R/OnDiskLongTable-class.R: [ ]
159:         path <- rowids_paths[[i]]
62: .valid_OnDiskLongTable_dirpath <- function(dirpath)
129: .check_OnDiskLongTable_dirpath <- function(dirpath)
244: .make_filepath <- function(dirpath, opath)
249:     filepath <- .make_filepath(dirpath, opath)
256:     filepath <- .make_filepath(dirpath, opath)
315:         paths_in_1string <- paste0(paths[fail_idx], collapse=", ")
324:         paths_in_1string <- paste0(paths[fail_idx], collapse=", ")
341:         colpath <- colpaths[[c]]
401:         colpath <- colpaths[[c]]
496:         opath <- paste0("rowids", i)
179:             rowids_paths <- .get_rowids_filepaths(x@dirpath)
332:     rowids_paths <- .get_rowids_filepaths(dirpath)
377:     rowids_paths <- .get_rowids_filepaths(dirpath)
623:             rowids_paths <- character(0)
151: .get_rowids_filepaths <- function(dirpath)
334:     colpaths <- file.path(dirpath, .col_physname(seq_len(ncol(df))))
392:     colpaths <- file.path(dirpath, .col_physname(seq_len(ncol(df))))
160:         rowids <- readRDS(path)
242: ### 'opath' is the relative path (with respect to 'dirpath') to the file that
245:     file.path(dirpath, paste0(opath, ".rds"))
284:     #    block_physname <- file.path(batch_physname, col_physname)
286:         block_physname <- file.path(col_physname, batch_physname)
386:                   file.path(dirpath, "header.rds")))
540:                   "Please make sure that '", dirpath, "' is the path to ",
12:         dirpath="character",
45:         dirpath=NA_character_,
64:     if (!is.character(dirpath) || length(dirpath) != 1L)
65:         return(wmsg("'dirpath' must be a single string"))
66:     if (is.na(dirpath))
68:     if (dirpath == "")
69:         return(wmsg("'dirpath' must be a non-empty string"))
70:     if (!dir.exists(dirpath))
71:         return(wmsg("directory not found: ", dirpath))
121:     c(.valid_OnDiskLongTable_dirpath(x@dirpath),
131:     errmsg <- .valid_OnDiskLongTable_dirpath(dirpath)
134:     if (is.na(dirpath))
135:         stop("'dirpath' must be a single string")
152:     dir(dirpath, pattern="rowids[1-9]?\\.rds", full.names=TRUE)
155: .load_rowids <- function(rowids_paths, envir, total_nb_rowids)
157:     objnames <- sub("\\.rds$", "", basename(rowids_paths))
176:     if (!is.na(x@dirpath)) {
180:             if (length(rowids_paths) != 0L)
181:                 .load_rowids(rowids_paths, ans, nrow(x))
247: .read_object <- function(dirpath, opath)
250:     suppressWarnings(readRDS(filepath))
253: .write_object <- function(object, dirpath, opath,
257:     if (!overwrite && file.exists(filepath))
258:         stop(wmsg("file already exists: ", filepath))
259:     saveRDS(object, file=filepath, compress=compress)
291: .read_OnDiskLongTable_block <- function(dirpath, b, c, bybatch=FALSE)
294:     .read_object(dirpath, block_physname)
298:                                          dirpath, b, c, bybatch=FALSE,
302:     .write_object(block_data, dirpath, block_physname, compress=compress)
310: .remove_files <- function(paths)
312:     fail_idx <- which(!suppressWarnings(file.remove(paths)))
316:         stop(wmsg("failed to remove file(s): ", paths_in_1string))
320: .remove_dirs <- function(paths)
322:     fail_idx <- which(as.logical(unlink(paths, recursive=TRUE)))
325:         stop(wmsg("failed to remove dir(s): ", paths_in_1string))
329: .write_zero_row_OnDiskLongTable <- function(df, dirpath, spatial_index)
333:     .remove_files(rowids_paths)
339:     .write_object(header, dirpath, "header", overwrite=TRUE)
342:         if (!dir.create(colpath, showWarnings=TRUE, mode="0775"))
343:             stop(wmsg("failed to create directory: ", colpath))
345:     .write_object(integer(0), dirpath, "breakpoints", overwrite=TRUE)
347:         .write_object(spatial_index[0], dirpath, "spatial_index",
359: .write_OnDiskLongTable_column <- function(df_col, dirpath,
367:         .write_OnDiskLongTable_block(block_data, dirpath, b, c,
372: .append_df_to_OnDiskLongTable <- function(df, dirpath,
378:     if (length(rowids_paths) != 0L)
383:     old_colnames <- names(.read_object(dirpath, "header"))
389:     breakpoints0 <- .read_object(dirpath, "breakpoints")
397:         spatial_index0 <- .read_object(dirpath, "spatial_index")
402:         if (!dir.exists(colpath))
403:             stop(wmsg("directory not found: ", colpath))
404:         .write_OnDiskLongTable_column(df[[c]], dirpath,
412:     .write_object(breakpoints, dirpath, "breakpoints", overwrite=TRUE)
423:         .write_object(spatial_index, dirpath, "spatial_index", overwrite=TRUE)
449: writeOnDiskLongTable <- function(df, dirpath=".",
455:     .check_OnDiskLongTable_dirpath(dirpath)
484:         .write_zero_row_OnDiskLongTable(df, dirpath, spatial_index)
485:     .append_df_to_OnDiskLongTable(df, dirpath, batchsize, spatial_index,
490:                                    dirpath=".", compress=FALSE)
497:         .write_object(object, dirpath, opath, compress=compress)
505:                                        dirpath=".", compress=FALSE)
514:     .check_OnDiskLongTable_dirpath(dirpath)
516:     breakpoints <- .read_object(dirpath, "breakpoints")
520:                   "with the OnDiskLongTable object in ", dirpath))
523:         .write_object(rowids, dirpath, "rowids", compress=compress)
526:                                dirpath=dirpath, compress=compress)
535: .friendly_read_object <- function(dirpath, opath)
537:     object <- try(.read_object(dirpath, opath), silent=TRUE)
539:         stop(wmsg("Cannot open ", .make_filepath(dirpath, opath), ". ",
546: OnDiskLongTable <- function(dirpath=".")
548:     .check_OnDiskLongTable_dirpath(dirpath)
549:     header <- .friendly_read_object(dirpath, "header")
550:     breakpoints <- .friendly_read_object(dirpath, "breakpoints")
551:     spatial_index <- try(.read_object(dirpath, "spatial_index"), silent=TRUE)
558:     new2("OnDiskLongTable", dirpath=dirpath,
622:         if (is.na(object@dirpath)) {
625:             rowids_paths <- .get_rowids_filepaths(object@dirpath)
628:         if (length(rowids_paths) != 0L) {
683:         function(b) .read_OnDiskLongTable_block(x@dirpath, b, c))
871:             block_data <- .read_OnDiskLongTable_block(x@dirpath, b, c)
335:     .remove_dirs(colpaths)
crlmm:R/cnrma-functions.R: [ ]
42: 	path <- system.file("extdata", package=pkgname)
1391: 	path <- system.file("extdata", package=pkgname)
43: 	##multiple.builds <- length(grep("hg19", list.files(path)) > 0)
44: 	snp.file <- list.files(path, pattern="snpProbes_hg")
47: 		snp.file <- list.files(path, pattern="snpProbes.rda")
51: 			snp.file <- list.files(path, pattern="snpProbes_hg")
61: ##		load(file.path(path, "snpProbes.rda"))
62: ##	} else load(file.path(path, paste("snpProbes_", genome, ".rda", sep="")))
63: 	load(file.path(path, snp.file))
71: 		load(file.path(path, cn.file))
73: 		##			load(file.path(path, "cnProbes.rda"))
74: 		##		} else load(file.path(path, paste("cnProbes_", genome, ".rda", sep="")))
1392: 	load(file.path(path, "cnProbes.rda"))
1393: 	load(file.path(path, "snpProbes.rda"))
1465: 				   path,
1468: 	load(file.path(path, "snpFile.rda"))
1470: 	load(file.path(path, "cnFile.rda"))
GeneTonic:R/GeneTonic.R: [ ]
2302:       path <- system.file("doc", "GeneTonic_manual.html", package = "GeneTonic")
2303:       if (path == "") {
2306:         browseURL(path)
2360:           reactive_values$in_gtl <- readRDS(input$uploadgtl$datapath)
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)
MOGAMUN:R/MOGAMUN_FUN.R: [ ]
1232:     for (Path in Dirs) {
1233:         PathForPlots <- ExperimentsPath <- paste0(Path, "/") # path for plots
1659:     GeneralPath <- ExperimentDir
1666:         ExpPath <- paste0(GeneralPath, "/", d, "/")
1289:     # get all files in the path that match the pattern
1763: #         ExperimentsPath - path to the results
1234:         Population <- GetIndividualsAllRuns(ExperimentsPath) # get results
1249:             SimilarityBetweenRunsBoxplot(PathForPlots, Nodes1stRank_AllRuns)
1253:         AccPF <- ObtainAccParetoFront(PathForPlots, Inds1stRank_AllRuns, 
1258:         FilterNetworks(ExperimentsPath, LoadedData, AccPF) 
1265:         SaveFilteredAccPF(DiversePopulation, ExperimentsPath, Threshold) 
1278: # INPUT:  ExperimentsPath - folder containing the results to be processed 
1280: GetIndividualsAllRuns <- function(ExperimentsPath) {
1290:     ResFiles <- list.files(ExperimentsPath, pattern = PatResFiles)
1295:         con <- base::file(paste0(ExperimentsPath, ResFiles[counter]), open="r")
1328: # INPUTS: PathForPlots - folder to save the plot
1331: SimilarityBetweenRunsBoxplot <- function(PathForPlots, Nodes1stRank_AllRuns) {
1362:     svg(paste0(PathForPlots, "A_Boxplot_similarities_between_runs.svg"))
1372: # INPUTS: PathForPlots - folder to save the plot
1378: ObtainAccParetoFront <- function(PathForPlots, Inds1stRank_AllRuns, 
1389:         svg(paste0(PathForPlots, "A_ScatterPlot_AccPF_ALL_INDS.svg"))
1397:         svg(paste0(PathForPlots, "A_ScatterPlot_AccPF_LEGEND_ALL_INDS.svg"))
1409:     svg(paste0(PathForPlots, "A_ScatterPlot_AccPF.svg"))
1466: # INPUTS: ExperimentsPath - folder to save the filtered networks
1471: FilterNetworks <- function(ExperimentsPath, LoadedData, AccPF) {
1495:         write.table(MyFilteredNetwork, file = paste0(ExperimentsPath, 
1501:     myDataFiles <- list.files(ExperimentsPath, pattern = '_FILTERED.csv')
1508:         data <- read.table(paste0(ExperimentsPath, myDataFiles[i]), 
1516:     write.table(myFullListOfInteractions, file = paste0(ExperimentsPath, 
1614: #         ExperimentsPath - folder to save the filtered networks
1617: SaveFilteredAccPF <- function(DiversePopulation, ExperimentsPath, Threshold) {
1621:         write(paste(Ind, collapse=" ", sep=""), file = paste0(ExperimentsPath, 
1643:     write.csv(AllNodesDF_Acc, paste0(ExperimentsPath, 
1662:     Dirs <- list.dirs(GeneralPath, recursive = FALSE, full.names = FALSE)
1669:         Network <- read.csv( paste0(ExpPath, 
1698:         CreateActiveModules(d, ExpPath)
1703:                 filename = paste0(ExpPath, "A_Acc_PF_", d))
1704:         } else { saveSession(filename = paste0(ExpPath, "A_Acc_PF_", d)) }
1765: CreateActiveModules <- function(d, ExperimentsPath) {
1772:         read.csv(paste0(ExperimentsPath, list.files(ExperimentsPath,
1799: MogamunBody <- function(RunNumber, LoadedData, BestIndsPath) {
1800:     BestIndsFile <- paste0(BestIndsPath, "_Run_", RunNumber, ".txt")
1829:         file = paste0(BestIndsPath,"StatisticsPerGeneration_Run", RunNumber, 
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",
matter:R/signal.R: [ ]
213: 		path <- data.frame(x=lx, y=ly)
264: 	path <- .Call(C_warpDTW, x, y, tx, ty,
315: 	path <- .Call(C_warpCOW, x, y, tx, ty,
231: 		path <- NULL
236: 	attr(xout, "path") <- path
266: 	i <- rev(path[!is.na(path[,1L]),1L]) + 1L
267: 	j <- rev(path[!is.na(path[,2L]),2L]) + 1L
268: 	path <- data.frame(x=tx[i], y=ty[j])
270: 	tout <- approx(ty[path$y], tx[path$x],
273: 	attr(xout, "path") <- path
318: 	i <- path[,1L] + 1L
319: 	j <- path[,2L] + 1L
320: 	path <- data.frame(x=tx[i], y=ty[j])
326: 	attr(xout, "path") <- path
oligoClasses:R/methods-GenomeAnnotatedDataFrame.R: [ ]
259:   path <- system.file("extdata", package=pkgname)
260:   if(path=="") stop("Are you sure ", pkgname, " is installed?")
262:   snpBuilds <- list.files(path, pattern="snpProbes_")