Found 50860 results in 5453 files, showing top 50 files (show more).
biodbKegg:R/KeggPathwayConn.R: [ ]
61:         path <- self$getEntry(path.id)
59:     for (path.id in id) {
127:     for (path.id in id) {
304:     path_idx <- sub('^[^0-9]+', '', id)
322:     path_idx <- sub('^[^0-9]+', '', id)
29: KeggPathwayConn <- R6::R6Class("KeggPathwayConn",
40:     super$initialize(db.name='pathway', db.abbrev='path', ...)
62:         if ( ! is.null(path) && path$hasField('kegg.module.id')) {
65:             for (mod.id in path$getFieldValue('kegg.module.id')) {
144:             graph[[path.id]]=list(vertices=vert, edges=edg)
147:             graph[[path.id]]=NULL
309:         params=c(org_name='map', mapno=path_idx,
325:     img_filename <- paste0('pathwaymap-', path_idx)
331:             biodb::error0('Impossible to find pathway image path inside',
335:         tmp_file <- file.path(cache$getTmpFolderPath(),
2: #' The connector class to KEGG Pathway database.
16: #' conn=mybiodb$getFactory()$createConn('kegg.pathway')
18: #' # Retrieve all reactions related to a mouse pathway:
21: #' # Get a pathway graph
44: #' Retrieves all reactions part of a KEGG pathway. Connects to
45: #'     KEGG databases, and walk through all pathways submitted, and
58:     # Loop on all Pathway IDs
89: #' Takes a list of pathways IDs and converts them to the specified organism,
92: #' @param org The organism in which to search for pathways, as a KEGG organism
113: #' Builds a pathway graph in the form of two tables of vertices and edges,
115: #' @param id A character vector of KEGG pathway entry IDs.
120: #' @return A named list whose names are the pathway IDs, and values are lists
126:     # Loop on all pathway IDs
158: #' Builds a pathway graph, as an igraph object, using KEGG database.
159: #' @param id A character vector of KEGG pathway entry IDs.
196: #' Create a pathway graph picture, with some of its elements colorized.
197: #' @param id A KEGG pathway ID.
227: #' Extracts shapes from a pathway map image.
228: #' @param id A KEGG pathway ID.
303:     # Extract pathway number
308:         'show_pathway'),
329:             'src="([^"]+)"(\\s+.*)?\\s+(name|id)="pathwayimage"')
332:                 ' HTML page for pathway ID ', id, '.')
342:     img_file <- cache$getFilePath(cid, img_filename, 'png')
22: #' graph=conn$buildPathwayGraph('mmu00260')
98: convertToOrgPathways=function(id, org) {
122: buildPathwayGraph=function(id, directed=FALSE, drop=TRUE) {
166: getPathwayIgraph=function(id, directed=FALSE, drop=TRUE) {
173:         g <- self$buildPathwayGraph(id=id, directed=directed, drop=FALSE)
210:         pix <- private$getPathwayImage(id)
213:         shapes <- self$extractPathwayMapShapes(id=id, color2ids=color2ids)
233: ,extractPathwayMapShapes=function(id, color2ids) {
237:     html <- private$getPathwayHtml(id)
301: ,getPathwayHtml=function(id) {
319: getPathwayImage=function(id) {
321:     html <- private$getPathwayHtml(id)
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
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
recountmethylation:inst/extdata/scripts/data_analyses.R: [ ]
26: path <- system.file("extdata", "metadata", package = "recountmethylation")
20: savepath <- paste(dfp, env.name, sep = "/")
27: mdpath <- paste(path, list.files(path)[1], sep = "/")
327:   save(ds, file = file.path("data_analyses", "df-l2med-signals.rda"))
28: md <- get(load(mdpath))
AffiXcan:R/AffiXcan.R: [ ]
642:     for(path in tbaPaths) {
643:         tba <- readRDS(path)
6: #' @param tbaPaths A vector of strings, which are the paths to
186: #' @param tbaPaths A vector of strings, which are the paths to
623: #' @param tbaPaths, A vector of strings, which are the paths to
654: #' @param tbaPaths A vector of strings, which are the paths to
1064: #' @param tbaPaths A vector of strings, which are the paths to
38: #'  objects listed in the param tbaPaths. Each of these lists contain two
92: #' trainingTbaPaths <- system.file("extdata","training.tba.toydata.rds",
102: #' tbaPaths=trainingTbaPaths, regionAssoc=regionAssoc, cov=trainingCovariates,
105: affiXcanTrain <- function(exprMatrix, assay, tbaPaths, regionAssoc, cov=NULL,
107:     regionsCount <- overlookRegions(tbaPaths)
131:         pca <- affiXcanPca(tbaPaths, varExplained, scale, regionsCount,
141:             pcs <- affiXcanPcs(tbaPaths, affiXcanTraining, scale, BPPARAM,
194: #' every MultiAssayExperiment RDS object indicated in the param tbaPaths; it is
200: #' of MultiAssayExperiment objects from tbaPaths) of the samples that have to
205: #' listed in the param tbaPaths. Each of these lists contain two objects:
221: #' tbaPaths <- system.file("extdata","training.tba.toydata.rds",
223: #' regionsCount <- overlookRegions(tbaPaths)
235: #' pca <- affiXcanPca(tbaPaths=tbaPaths, varExplained=80, scale=TRUE,
238: affiXcanPca <- function(tbaPaths, varExplained=80, scale=TRUE, regionsCount,
244:     for(i in seq(1,length(tbaPaths))) {
246:         tbaMatrixMAE <- readRDS(tbaPaths[i])
376: #' of MultiAssayExperiment objects from tbaPaths) of the samples that have to
401: #' tbaPaths <- system.file("extdata","training.tba.toydata.rds",
403: #' regionsCount <- overlookRegions(tbaPaths)
416: #' pca <- affiXcanPca(tbaPaths=tbaPaths, varExplained=80, scale=TRUE,
516: #' tbaPaths <- system.file("extdata","training.tba.toydata.rds",
518: #' regionsCount <- overlookRegions(tbaPaths)
531: #' pca <- affiXcanPca(tbaPaths=tbaPaths, varExplained=80, scale=TRUE,
627: #' MultiAssayExperiment RDS object indicated in the param tbaPaths
633: #' testingTbaPaths <- system.file("extdata","testing.tba.toydata.rds",
636: #' regionsCount <- overlookRegions(tbaPaths=testingTbaPaths)
638: overlookRegions <- function(tbaPaths) {
663: #' of MultiAssayExperiment objects from tbaPaths) of the samples that have not
680: #' trainingTbaPaths <- system.file("extdata","training.tba.toydata.rds",
682: #' testingTbaPaths <- system.file("extdata","testing.tba.toydata.rds",
688: #' tbaPaths=trainingTbaPaths, regionAssoc=regionAssoc, cov=trainingCovariates,
691: #' pcs <- affiXcanPcs(tbaPaths=testingTbaPaths, affiXcanTraining=training,
694: affiXcanPcs <- function(tbaPaths, affiXcanTraining, scale, BPPARAM=bpparam(),
700:     for(i in seq(1,length(tbaPaths))) {
703:         tbaMatrixMAE <- readRDS(tbaPaths[i])
746: #' trainingTbaPaths <- system.file("extdata","training.tba.toydata.rds",
756: #' tbaPaths=trainingTbaPaths, regionAssoc=regionAssoc, cov=trainingCovariates,
801: #' trainingTbaPaths <- system.file("extdata","training.tba.toydata.rds",
811: #' tbaPaths=trainingTbaPaths, regionAssoc=regionAssoc, cov=trainingCovariates,
814: #' testingTbaPaths <- system.file("extdata","testing.tba.toydata.rds",
817: #' pcs <- affiXcanPcs(tbaPaths=testingTbaPaths, affiXcanTraining=training,
863: #' trainingTbaPaths <- system.file("extdata","training.tba.toydata.rds",
873: #' tbaPaths=trainingTbaPaths, regionAssoc=regionAssoc, cov=trainingCovariates,
876: #' testingTbaPaths <- system.file("extdata","testing.tba.toydata.rds",
879: #' pcs <- affiXcanPcs(tbaPaths=testingTbaPaths, affiXcanTraining=training,
967: #' trainingTbaPaths <- system.file("extdata","training.tba.toydata.rds",
977: #' tbaPaths=trainingTbaPaths, regionAssoc=regionAssoc, cov=trainingCovariates,
980: #' imputedExpr <- affiXcanImpute(tbaPaths=trainingTbaPaths,
1029: #' trainingTbaPaths <- system.file("extdata","training.tba.toydata.rds",
1039: #' tbaPaths=trainingTbaPaths, regionAssoc=regionAssoc, cov=trainingCovariates,
1042: #' imputedExpr <- affiXcanImpute(tbaPaths=trainingTbaPaths,
1078: #' trainingTbaPaths <- system.file("extdata","training.tba.toydata.rds",
1088: #' tbaPaths=trainingTbaPaths, regionAssoc=regionAssoc,
1091: #' testingTbaPaths <- system.file("extdata","testing.tba.toydata.rds",
1094: #' exprmatrix <- affiXcanImpute(tbaPaths=testingTbaPaths,
1096: affiXcanImpute <- function(tbaPaths, affiXcanTraining, scale=TRUE,
1098:     regionsCount <- overlookRegions(tbaPaths)
1104:                     tbaPaths refers to ", regionsCount, " regions\n"))
1109:     pcs <- affiXcanPcs(tbaPaths, affiXcanTraining, scale, BPPARAM)
MetaboSignal:R/General_internal_functions.R: [ ]
185:     path = all_paths[maxBW, ]
140:     path_individual = as.character(row)
278: path_as_network = function(path) {
123:   shortpath = rownames(as.matrix(unlist(ASP)))
347:     pathM = convertTable(response)
122: ASP_paths = function (ASP) {
360:     all_pathsGM_names = all_pathsGM
341: MS_FindPathway = function(match = NULL, organism_code = NULL) {
141:     BW = sapply(path_individual, get_bw_score, BW_matrix)
180:     ## Get global BW score for each path
186:     path = as.character(path)
187:     all_paths = matrix(path, ncol = length(path))
277: ##################### path_as_network ######################
280:     for (i in 1:(length(path) - 1)) {
281:         edge = c(path[i], path[i + 1])
348:     colnames(pathM) = c("path_ID", "path_Description")
17: #metabolite is a substrate. It is used to calculate shortest paths with SP mode.
121: ####################### ASP_paths #######################
124:   return(shortpath)
150: BW_ranked_SP = function (all_paths, BW_matrix, networkBW_i, mode) {
152:     all_nodes = unique(as.vector(all_paths))
181:     Global_BW_score = sapply (split(all_paths, row(all_paths)), get_global_BW_score,
189:     return(all_paths)
342:     file = paste("https://rest.kegg.jp/list/pathway/", organism_code, sep = "")
345:         stop("A valid organism_code is required for KEGG_entry = pathway")
349:     rownames(pathM) = NULL
351:         target_matrix = pathM
352:         target_column = pathM[, 2]
355:     } else (return(pathM))
359: network_names = function(all_pathsGM, organism_code) {
361:     all_nodes = unique(as.vector(all_pathsGM[, 1:2]))
365:         all_pathsGM_names[all_pathsGM_names == all_nodes[i]] = all_names[i]
367:     return(all_pathsGM_names)
340: #################### MS_FindPathway ####################
ISAnalytics:R/internal-functions.R: [ ]
1497:             path = project_folder, recurse = TRUE,
1947:                 path = association_file,
3801:                                 path = report_path,
1440:     path_cols <- .path_cols_names()
2356:     path_col_names <- .path_cols_names()
1736:     stats_paths <- purrr::pmap_dfr(temp, function(...) {
1824:     stats_paths <- .stats_report(association_file,
368:     corr_fold <- fs::path(dir, "fs")
372:         proj_fold <- fs::path(corr_fold, proj)
373:         quant_fold <- fs::path(proj_fold, "quantification")
378:             pool_fold <- fs::path(quant_fold, .y)
390:                 file = fs::path(pool_fold, paste(prefix,
397:                 file = fs::path(pool_fold, paste(prefix,
408:             proj_fold <- fs::path(corr_fold, proj)
409:             iss_fold <- fs::path(proj_fold, "iss")
412:                 pool_fold <- fs::path(iss_fold, .y)
420:                         file = fs::path(pool_fold, filename),
449:     err_fold <- fs::path(dir, "fserr")
457:         proj_fold <- fs::path(err_fold, proj)
458:         quant_fold <- fs::path(proj_fold, "quantification")
477:             pool_fold <- fs::path(quant_fold, .y)
490:                     file = fs::path(pool_fold, paste(prefix,
498:                 file = fs::path(pool_fold, paste(prefix,
509:             proj_fold <- fs::path(err_fold, proj)
510:             iss_fold <- fs::path(proj_fold, "iss")
519:                 pool_fold <- fs::path(iss_fold, .y)
528:                             file = fs::path(pool_fold, filename),
561: #' @importFrom fs path_ext
562: #' @importFrom tools file_path_sans_ext
564: .check_file_extension <- function(file_path) {
566:     last <- fs::path_ext(file_path)
570:         file_path[compressed] <- tools::file_path_sans_ext(
571:             file_path[compressed]
573:         last <- fs::path_ext(file_path)
981: .read_with_fread <- function(path, additional_cols, annotated, sep) {
1010:         file = path,
1047: .read_with_readr <- function(path, additional_cols, annotated, sep) {
1072:         file = path,
1107: .import_single_matrix <- function(path,
1139:     is_compressed <- fs::path_ext(path) %in% .compressed_formats()
1142:         compression_type <- fs::path_ext(path)
1155:     peek_headers <- readr::read_delim(path,
1177:             path = path, additional_cols = additional_cols,
1182:             path = path, additional_cols = additional_cols,
1296: .read_af <- function(path, date_format, delimiter) {
1299:     file_ext <- .check_file_extension(path)
1313:         headers_peek <- readr::read_delim(path,
1321:         headers_peek <- readxl::read_excel(path, n_max = 0)
1342:             df <- readr::read_delim(path,
1352:             df <- readxl::read_excel(path,
1420: # - root_folder: Path to the root folder
1423: # ProjectID - ConcatenatePoolIDSeqRun - PathToFolderProjectID - Found - Path -
1424: # Path_quant - Path_iss (NOTE: headers are dynamic!)
1448:                 fs::path(
1449:                     fs::path(root_folder),
1460:             !!path_cols$project := NA_character_,
1461:             !!path_cols$quant := NA_character_,
1462:             !!path_cols$iss := NA_character_
1466:         project_folder <- fs::path(
1467:             fs::path(root_folder),
1471:             paste0(fs::path(
1473:                 fs::path(cur[[concat_pool_col]])
1489:             paste0(fs::path(
1491:                 fs::path(cur[[concat_pool_col]])
1505:             path = project_folder, recurse = TRUE,
1515:                     !!path_cols$project := project_folder,
1516:                     !!path_cols$quant := quant_found,
1517:                     !!path_cols$iss := iss_found
1548: .manage_association_file <- function(af_path,
1558:         path = af_path,
1689: # Finds automatically the path on disk to each stats file.
1696: # Path_iss (or designated dynamic name), stats_files, info
1701:     path_iss_col) {
1704:             dplyr::all_of(c(proj_col, pool_col, path_iss_col))
1712:     if (all(is.na(temp[[path_iss_col]]))) {
1719:         if (is.na(temp_row[[path_iss_col]])) {
1727:         files <- fs::dir_ls(temp_row[[path_iss_col]],
1809: # - path_iss_col: name of the column that contains the path
1818:     path_iss_col,
1828:         path_iss_col = path_iss_col
1939: .pre_manage_af <- function(association_file, import_af_args, report_path) {
1940:     if (!is.null(report_path) && !fs::is_dir(report_path)) {
1941:         report_path <- fs::path_dir(report_path)
1943:     ## Import association file if provided a path
1948:                 report_path = report_path,
1954:     if (!.path_cols_names()$quant %in% colnames(association_file)) {
1955:         rlang::abort(.af_missing_path_error(.path_cols_names()$quant),
1956:             class = "missing_path_col"
1960:         dplyr::filter(!is.na(.data[[.path_cols_names()$quant]]))
2345: #' @importFrom fs dir_ls as_fs_path
2359:             dplyr::all_of(c(proj_col, pool_col, path_col_names$quant))
2382:             matches <- fs::dir_ls(temp_row[[path_col_names$quant]],
2433: # @param dupl The tibble containing quantification types and path to the files
2481: # * Removing files not found (files for which Files_count$Found == 0 and Path
2656: #' @importFrom fs as_fs_path
2699:                     dplyr::mutate(Files_found = fs::as_fs_path(
2723:                     dplyr::mutate(Files_found = fs::as_fs_path(
2812: # * Removing files not found (files for which Files_count$Found == 0 and Path
2992:             list(path = x),
3740:     report_path) {
3787:                         fs::dir_create(report_path)
3817:                                 path = report_path,
4217: # @param file_path The file path as a string
4218: #' @importFrom fs dir_create path_wd path
4223: .write_recalibr_map <- function(map, file_path) {
4224:     if (!fs::file_exists(file_path)) {
4225:         ext <- fs::path_ext(file_path)
4228:             fs::dir_create(file_path)
4230:             tmp_filename <- fs::path(file_path, gen_filename)
4232:             tmp_filename <- fs::path_ext_remove(file_path)
4234:                 ext <- paste(fs::path_ext(tmp_filename), ext, sep = ".")
4235:                 tmp_filename <- fs::path_ext_remove(tmp_filename)
4253:     } else if (fs::is_dir(file_path)) {
4255:         tmp_filename <- fs::path(file_path, gen_filename)
4257:         tmp_filename <- file_path
5051:                 x = "Did you provide the correct path?"
5068:                 x = "Did you provide the correct path?"
560: # Returns the file format for each of the file paths passed as a parameter.
1431:         rlang::abort(.af_missing_pathfolder_error(proj_fold_col))
1531: # containing paths to project folder, quant folders and iss folders
1711:     # If paths are all NA return
1791:     stats_paths
1823:     # Obtain paths
1830:     stats_paths <- stats_paths %>%
1832:     if (all(is.na(stats_paths$stats_files))) {
1833:         stats_paths <- stats_paths %>%
1839:         return(list(stats = NULL, report = stats_paths))
1870:         data_list = stats_paths$stats_files,
1886:     stats_paths <- stats_paths %>%
1888:     stats_paths <- purrr::pmap_dfr(stats_paths, function(...) {
1905:     stats_paths <- stats_paths %>%
1907:     stats_dfs <- stats_dfs$res[stats_paths$Imported]
1910:         return(list(stats = NULL, report = stats_paths))
1917:     list(stats = stats_dfs, report = stats_paths)
2972: # @param files Files_found table where absolute paths of chosen files
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)
1003:         fpath <- .sql_get_fpath(x, rid)
1187:     paths <- .sql_get_rpath(x, bfcrid(x))
1314:             newpath <- file.path(dir, basename(orig))
1387:     exportPath <- file.path(exdir, "BiocFileCacheExport")
1133:     rpaths <- .sql_get_rpath(x, rids)
1435:     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)
672:                     "Setting a new remote path results in immediate\n",
1071: #' @return For 'bfcdownload': character(1) path to downloaded resource
1186:     files <- file.path(bfccache(x), setdiff(dir(bfccache(x)),c(.CACHE_FILE, .CACHE_FILE_LOCK)))
1255: #' @return character(1) The outputFile path.
1277:     dir <- file.path(tempdir(), "BiocFileCacheExport")
1318:                 newpath <- file.path(dir, filename)
1345:         outputFile = file.path(origdir, outputFile)
1355:     .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)
646:         if (!is.null(rpath)) {
647:             if (!file.exists(rpath[i]))
651:                     "\n  rpath: ", sQuote(rpath[i]),
652:                     "\n  reason: rpath does not exist.",
655:             .sql_set_rpath(x, rids[i], rpath[i])
658:                 warning("updating rpath, changing rtype to 'local'")
663:         if (!is.null(fpath)) {
681:                     x, rids[i], proxy, config, "bfcupdate()", fpath[i], ...
683:                 .sql_set_fpath(x, rids[i], fpath[i])
865:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
874:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
887: #'     matches pattern agains rname, rpath, and fpath. If exact
892: #'     \code{bfcrpath}, the default is \code{TRUE} (exact matching).
904:     function(x, query, field=c("rname", "rpath", "fpath"), ..., exact = FALSE)
980: #'     'rid'. \code{TRUE}: fpath \code{etag} or \code{modified} time of
981: #'     web resource more recent than in BiocFileCache; \code{FALSE}: fpath
1006:         cache_info <- .httr_get_cache_info(fpath)
1088:     if (ask && any(file.exists(.sql_get_rpath(x, rid)))) {
1099:     bfcrpath(x, rids=rid)
1188:     # normalizePath on windows
1191:         files = normalizePath(files)
1192:         paths = normalizePath(paths)
1194:     untracked <- setdiff(files, paths)
1249: #' @param outputFile character(1) The <filepath>/basename for the
1313:             orig <- .sql_get_rpath(x, i)
1315:             if (file.exists(newpath)) {
1320:             file.copy(orig, newpath)
1388:     stopifnot(!dir.exists(exportPath))
1398:     bfc = BiocFileCache(exportPath)
349: #'     \code{httr::GET}. For 'bfcrpaths': Additional arguments passed
483: #' @describeIn BiocFileCache display rpaths of resource.
1134:     cached <- startsWith(rpaths, bfccache(x))
1137:     status <- .util_unlink(rpaths[cached])
1436:     cached <- startsWith(rpaths, bfccache(x))
1439:         txt0 <- paste("file ", sQuote(rpaths))
1448:     .util_unlink(rpaths[cached])
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_")
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())
snapcount:R/basic_query_functions.R: [ ]
273:     path <- paste(compilation, paste0(endpoint, "?"), sep = "/")
319:     paste0(pkg_globals$snaptron_host, path, paste(query, collapse = "&"))
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)})
SpliceWiz:R/BuildRef.R: [ ]
1191:         path <- tryCatch(BiocFileCache::bfcadd(bfc, url),
536: .validate_path <- function(reference_path, subdirs = NULL) {
636:     map_path <- file.path(normalizePath(reference_path), "Mappability")
996:     r_path <- file.path(reference_path, "resource")
997:     gtf_path <- file.path(r_path, "transcripts.gtf.gz")
1167: .get_cache_file_path <- function(cache, rpath) {
10: #' subdirectory within the given `reference_path`. Resources are retrieved via
12: #' 1. User-supplied FASTA and GTF file. This can be a file path, or a web link
28: #' of the specified reference path. If `use_STAR_mappability` is set to `TRUE`
33: #' `getNonPolyARef()` returns the path of the non-polyA reference file for the
55: #' file, open the file specified in the path returned by
60: #' @param reference_path (REQUIRED) The directory path to store the generated
62: #' @param fasta The file path or web link to the user-supplied genome
65: #'   been run using the same `reference_path`.
66: #' @param gtf The file path or web link  to the user-supplied transcript
70: #'   `reference_path`.
76: #'   the file `SpliceWiz.ref.gz` is present inside `reference_path`.
135: #' * `reference_path/resource/genome.2bit`: Local copy of the genome sequences
137: #' * `reference_path/resource/transcripts.gtf.gz`: Local copy of the gene
141: #'   which is written to the given directory specified by `reference_path`.
143: #' * `reference_path/settings.Rds`: An RDS file containing parameters used
145: #' * `reference_path/SpliceWiz.ref.gz`: A gzipped text file containing collated
147: #' * `reference_path/fst/`: Contains fst files for subsequent easy access to
149: #' * `reference_path/cov_data.Rds`: An RDS file containing data required to
153: #'   subdirectory inside the designated `reference_path`
155: #' For `getNonPolyARef()`: Returns the file path to the BED file for
161: #' example_ref <- file.path(tempdir(), "Reference")
163: #'     reference_path = example_ref,
168: #'     reference_path = example_ref
173: #' example_ref <- file.path(tempdir(), "Reference")
175: #'     reference_path = example_ref,
180: #' # Get the path to the Non-PolyA BED file for hg19
192: #'     reference_path = "./Reference_user",
204: #'     reference_path = "./Reference_FTP",
220: #'     reference_path = "./Reference_AH",
232: #'     reference_path = "./Reference_UCSC",
242: #' #      inside the given `reference_path`.
247: #'     reference_path = "./Reference_with_STAR",
257: #'     reference_path = "./Reference_with_STAR",
261: #'     reference_path = reference_path,
266: #'     reference_path = "./Reference_with_STAR",
285: #' of the given reference path
288:         reference_path = "./Reference",
294:         reference_path = reference_path,
304: #' given reference path
307:         reference_path = "./Reference",
315:     .validate_path(reference_path, subdirs = "resource")
317:             file.exists(file.path(reference_path, "SpliceWiz.ref.gz"))) {
321:     extra_files <- .fetch_genome_defaults(reference_path,
330:         reference_path = reference_path,
340:     .process_gtf(reference_data$gtf_gr, reference_path, verbose = verbose)
346:     reference_data$genome <- .check_2bit_performance(reference_path,
353:     saveRDS(chromosomes, file.path(reference_path, "chromosomes.Rds"))
355:     .process_introns(reference_path, reference_data$genome,
359:     .gen_irf(reference_path, extra_files, reference_data$genome, chromosomes,
366:             .gen_nmd(reference_path, reference_data$genome,
370:         .gen_nmd(reference_path, reference_data$genome, 
376:     .gen_splice(reference_path, verbose = verbose)
378:     if (file.exists(file.path(reference_path, "fst", "Splice.fst")) &
379:         file.exists(file.path(reference_path, "fst", "Proteins.fst"))) {
381:         .gen_splice_proteins(reference_path, reference_data$genome, 
389:     cov_data <- .prepare_covplot_data(reference_path)
390:     saveRDS(cov_data, file.path(reference_path, "cov_data.Rds"))
394:     settings.list <- readRDS(file.path(reference_path, "settings.Rds"))
402:     saveRDS(settings.list, file.path(reference_path, "settings.Rds"))
415:         reference_path,
428:             file.exists(file.path(reference_path, "SpliceWiz.ref.gz"))) {
435:     getResources(reference_path = reference_path,
439:     STAR_buildRef(reference_path = reference_path,
454:     buildRef(reference_path = reference_path,
462: #' @describeIn Build-Reference-methods Returns the path to the BED file 
495: Get_Genome <- function(reference_path, validate = TRUE,
497:     if (validate) .validate_reference(reference_path)
498:     twobit <- file.path(reference_path, "resource", "genome.2bit")
501:     } else if (file.exists(file.path(reference_path, "settings.Rds"))) {
502:         settings <- readRDS(file.path(reference_path, "settings.Rds"))
505:         .log("In Get_Genome, invalid reference_path supplied")
513: Get_GTF_file <- function(reference_path) {
514:     .validate_reference(reference_path)
515:     if (file.exists(file.path(reference_path,
517:         return(file.path(reference_path, "resource", "transcripts.gtf.gz"))
519:         .log("In Get_GTF_file, invalid reference_path supplied")
538:         reference_path != "" &&
540:             ifelse(normalizePath(dirname(reference_path)) != "", TRUE, TRUE),
546:         .log(paste("Error in 'reference_path',",
547:             paste0("base path of '", reference_path, "' does not exist")
551:     base <- normalizePath(dirname(reference_path))
552:     if (!dir.exists(file.path(base, basename(reference_path))))
553:         dir.create(file.path(base, basename(reference_path)))
557:             dir_to_make <- file.path(base, basename(reference_path), subdirs)
561:     return(file.path(base, basename(reference_path)))
564: .validate_reference_resource <- function(reference_path, from = "") {
565:     ref <- normalizePath(reference_path)
570:             "in reference_path =", reference_path,
571:             ": this path does not exist"))
573:     if (!file.exists(file.path(ref, "settings.Rds"))) {
575:             "in reference_path =", reference_path,
578:     settings.list <- readRDS(file.path(ref, "settings.Rds"))
582:             "in reference_path =", reference_path,
588: .validate_reference <- function(reference_path, from = "") {
589:     ref <- normalizePath(reference_path)
594:             "in reference_path =", reference_path,
595:             ": this path does not exist"))
597:     if (!file.exists(file.path(ref, "settings.Rds"))) {
599:             "in reference_path =", reference_path,
602:     if (!file.exists(file.path(ref, "SpliceWiz.ref.gz"))) {
604:             "in reference_path =", reference_path,
607:     settings.list <- readRDS(file.path(ref, "settings.Rds"))
611:             "in reference_path =", reference_path,
621: .fetch_genome_defaults <- function(reference_path, genome_type,
637:     map_file <- file.path(map_path, "MappabilityExclusion.bed.gz")
649:                     path = map_path, overwrite = TRUE
677:     local.nonPolyAFile <- file.path(reference_path, "resource", 
679:     local.MappabilityFile <- file.path(reference_path, "resource", 
681:     local.BlacklistFile <- file.path(reference_path, "resource", 
760: .get_reference_data <- function(reference_path, fasta, gtf,
766:     .validate_path(reference_path, subdirs = "resource")
768:         twobit <- file.path(reference_path, "resource", "genome.2bit")
775:         gtf <- file.path(reference_path, "resource", "transcripts.gtf.gz")
796:         reference_path = reference_path,
803:         reference_path = reference_path,
825:         reference_path = reference_path
828:     saveRDS(settings.list, file.path(reference_path, "settings.Rds"))
830:     settings.list <- readRDS(file.path(reference_path, "settings.Rds"))
863:         reference_path = "./Reference",
873:         .fetch_fasta_save_2bit(genome, reference_path, overwrite)
878:         twobit <- file.path(reference_path, "resource", "genome.2bit")
884:             genome <- Get_Genome(reference_path, validate = FALSE,
894:             twobit <- file.path(reference_path, "resource", "genome.2bit")
900:                 genome <- Get_Genome(reference_path, validate = FALSE,
918:         .fetch_fasta_save_2bit(genome, reference_path, overwrite)
926:         genome <- Get_Genome(reference_path, validate = FALSE,
950:     genome, reference_path, overwrite, verbose = TRUE
952:     genome.fa <- file.path(reference_path, "resource", "genome.fa")
965:         genome, reference_path, overwrite, verbose = TRUE
967:     genome.2bit <- file.path(reference_path, "resource", "genome.2bit")
969:             normalizePath(rtracklayer::path(genome)) ==
979:                 file.exists(rtracklayer::path(genome))) {
980:             file.copy(rtracklayer::path(genome), genome.2bit)
991:         reference_path = "./Reference",
1003:         if (overwrite || !file.exists(gtf_path)) {
1007:                 if (file.exists(gtf_path)) file.remove(gtf_path)
1008:                 file.copy(cache_loc, gtf_path)
1013:         if (file.exists(gtf_path)) {
1018:             gtf_gr <- rtracklayer::import(gtf_path, "gtf")
1029:             if (file.exists(gtf_path)) {
1034:                 gtf_gr <- rtracklayer::import(gtf_path, "gtf")
1048:         if (!file.exists(gtf_path) ||
1049:                 normalizePath(gtf_file) != normalizePath(gtf_path)) {
1050:             if (overwrite || !file.exists(gtf_path)) {
1055:                     if (file.exists(gtf_path)) file.remove(gtf_path)
1056:                     file.copy(gtf_file, gtf_path)
1058:                     gzip(filename = gtf_file, destname = gtf_path,
1188:             return(.get_cache_file_path(cache, res$rpath[nrow(res)]))
1198:         if (identical(path, NA)) {
1202:             return(.get_cache_file_path(cache, res$rpath[nrow(res)]))
1208:         return(.get_cache_file_path(cache, res$rpath[nrow(res)]))
1307: .process_gtf <- function(gtf_gr, reference_path, verbose = TRUE) {
1309:     .validate_path(reference_path, subdirs = "fst")
1313:         file.path(reference_path, "fst", "gtf_fixed.fst"))
1317:     Genes_group <- .process_gtf_genes(gtf_gr, reference_path, verbose)
1319:     .process_gtf_transcripts(gtf_gr, reference_path, verbose)
1321:     .process_gtf_misc(gtf_gr, reference_path, verbose)
1323:     .process_gtf_exons(gtf_gr, reference_path, Genes_group, verbose)
1329: .process_gtf_genes <- function(gtf_gr, reference_path, verbose = TRUE) {
1385:         file.path(reference_path, "fst", "Genes.fst")
1394: .process_gtf_transcripts <- function(gtf_gr, reference_path, verbose = TRUE) {
1418:         file.path(reference_path, "fst", "Transcripts.fst")
1422: .process_gtf_misc <- function(gtf_gr, reference_path, verbose = TRUE) {
1433:         file.path(reference_path, "fst", "Proteins.fst")
1444:         file.path(reference_path, "fst", "Misc.fst")
1449:     gtf_gr, reference_path, Genes_group, verbose = TRUE
1480:         file.path(reference_path, "fst", "Exons.fst"))
1483:         file.path(reference_path, "fst", "Exons.Group.fst")
1545: .check_2bit_performance <- function(reference_path, genome, verbose = TRUE) {
1548:             read.fst(file.path(reference_path, "fst", "Exons.fst")),
1571:     reference_path, genome, useExtendedTranscripts = TRUE, verbose = TRUE
1576:     data <- .process_introns_data(reference_path, genome, 
1590:         file.path(reference_path, "fst", "junctions.fst"))
1595: .process_introns_data <- function(reference_path, genome,
1598:         read.fst(file.path(reference_path, "fst", "Exons.fst")),
1601:         read.fst(file.path(reference_path, "fst", "Transcripts.fst")),
1603:     if(file.exists(file.path(reference_path, "fst", "Proteins.fst"))) {
1605:             read.fst(file.path(reference_path, "fst", "Proteins.fst")),
1612:         read.fst(file.path(reference_path, "fst", "Exons.Group.fst")),
1927:     reference_path, extra_files, genome, chromosome_aliases, verbose = TRUE
1933:     data <- .gen_irf_prep_data(reference_path)
1945:         ), stranded = TRUE, reference_path, data2[["introns.unique"]]
1952:         ), stranded = FALSE, reference_path, data2[["introns.unique"]]
1955:     ref.cover <- .gen_irf_refcover(reference_path)
1957:     ref.ROI <- .gen_irf_ROI(reference_path, extra_files, genome,
1960:     readcons <- .gen_irf_readcons(reference_path,
1963:     ref.sj <- .gen_irf_sj(reference_path)
1965:     ref.tj <- .gen_irf_tj(reference_path)
1977:     .gen_irf_final(reference_path, ref.cover, readcons, ref.ROI, 
1985: .gen_irf_prep_data <- function(reference_path) {
1987:         read.fst(file.path(reference_path, "fst", "Genes.fst")),
2000:         read.fst(file.path(reference_path, "fst", "junctions.fst"))
2003:         read.fst(file.path(reference_path, "fst", "Exons.fst")),
2007:         read.fst(file.path(reference_path, "fst", "Transcripts.fst")),
2224:         reference_path, introns.unique) {
2279:     rtracklayer::export(IntronCover, file.path(reference_path,
2282:     write.fst(IntronCover.summa, file.path(
2283:         reference_path, "fst",
2340: .gen_irf_refcover <- function(reference_path) {
2341:     tmpdir.IntronCover <- fread(file.path(
2342:         reference_path, "tmpdir.IntronCover.bed"
2345:     tmpnd.IntronCover <- fread(file.path(
2346:         reference_path, "tmpnd.IntronCover.bed"
2359: .gen_irf_ROI <- function(reference_path, extra_files, genome,
2424: .gen_irf_readcons <- function(reference_path,
2453: .gen_irf_sj <- function(reference_path) {
2457:         read.fst(file.path(reference_path, "fst", "junctions.fst"))
2478: .gen_irf_tj <- function(reference_path) {
2482:         read.fst(file.path(reference_path, "fst", "junctions.fst"))
2541: .gen_irf_final <- function(reference_path,
2545:     IRF_file <- file.path(reference_path, "SpliceWiz.ref")
2589:     if (file.exists(file.path(reference_path, "tmpdir.IntronCover.bed"))) {
2590:         file.remove(file.path(reference_path, "tmpdir.IntronCover.bed"))
2592:     if (file.exists(file.path(reference_path, "tmpnd.IntronCover.bed"))) {
2593:         file.remove(file.path(reference_path, "tmpnd.IntronCover.bed"))
2600: .gen_nmd <- function(reference_path, genome, verbose = TRUE, 
2604:     Exons.tr <- .gen_nmd_exons_trimmed(reference_path)
2605:     protein.introns <- .gen_nmd_protein_introns(reference_path, Exons.tr)
2619:     write.fst(NMD.Table, file.path(reference_path, "fst", "IR.NMD.fst"))
2624: .gen_nmd_exons_trimmed <- function(reference_path) {
2626:         read.fst(file.path(reference_path, "fst", "Exons.fst"))
2629:         read.fst(file.path(reference_path, "fst", "Misc.fst"))
2662: .gen_nmd_protein_introns <- function(reference_path, Exons.tr) {
2664:         read.fst(file.path(reference_path, "fst", "junctions.fst"))
2667:         read.fst(file.path(reference_path, "fst", "Misc.fst"))
3094: .gen_splice <- function(reference_path, verbose = TRUE) {
3097:         read.fst(file.path(reference_path, "fst", "junctions.fst"))
3100:         reference_path, candidate.introns)
3134:     introns_found_RI <- .gen_splice_RI(candidate.introns, reference_path)
3150:         .gen_splice_save(AS_Table, candidate.introns, reference_path)
3161: .gen_splice_skipcoord <- function(reference_path, candidate.introns) {
3163:         read.fst(file.path(reference_path, "fst", "Genes.fst"))
3821: .gen_splice_RI <- function(candidate.introns, reference_path) {
3823:         read.fst(file.path(reference_path, "fst", "Exons.fst")),
3827:         read.fst(file.path(reference_path, "fst", "Introns.Dir.fst")))
3865: .gen_splice_save <- function(AS_Table, candidate.introns, reference_path) {
3877:         reference_path)
3878:     AS_Table <- .gen_splice_name_events(AS_Table, reference_path)
3908:         reference_path) {
3910:         read.fst(file.path(reference_path, "fst", "Exons.fst")),
3998:         file.path(reference_path, "fst", "Splice.options.fst"))
4004: .gen_splice_name_events <- function(AS_Table, reference_path) {
4052:         file.path(reference_path, "fst", "Splice.fst"))
4060: .gen_splice_proteins <- function(reference_path, genome, verbose = TRUE) {
4065:         read.fst(file.path(reference_path, "fst", "Splice.fst"))
4068:         read.fst(file.path(reference_path, "fst", "Proteins.fst"))
4107:         file.path(reference_path, "fst", "Splice.Extended.fst"))
14: #'    to specify the files or web paths to use.
970:             normalizePath(genome.2bit)) {
1168:     if(grepl(cache, rpath, fixed = TRUE)) {
1169:         return(rpath)
1171:         return(paste(cache, rpath, sep = "/"))
1186:         res <- BiocFileCache::bfcquery(bfc, url, "fpath", exact = TRUE)
1205:         res <- BiocFileCache::bfcquery(bfc, url, "fpath", exact = TRUE)
TIN:R/correlationPlot.R: [ ]
104:     path<-getwd()
105:     cat("Plot was saved in ",paste(path,"/",fileName,sep=""),"\n")
DMRforPairs:R/functions.R: [ ]
457:     path = "figures"
450:     dir.create(file.path(getwd(), experiment.name))
452:     dir.create(file.path(paste(getwd(), experiment.name, sep = "/"), 
456:     setwd(file.path(getwd(), experiment.name))
485:                 path = path)
487:             tested$Figure[cr] = paste("<a href=\"./", path, "/", 
490:             tested$Statistics[cr] = paste("<a href=\"./", path, "/", 
493:             write.table(file = paste("./", path, "/", tested$regionID[cr], 
507:                 scores = FALSE, path = path)
509:             tested$Figure[cr] = paste("<a href=\"./", path, "/", 
512:             tested$Statistics[cr] = paste("<a href=\"./", path, "/", 
519:             write.table(file = paste("./", path, "/", tested$regionID[cr], 
533:                 scores = FALSE, path = path)
539:             tested$Figure[cr] = paste("<a href=\"./", path, "/", 
542:             tested$Statistics[cr] = paste("<a href=\"./", path, "/", 
545:             write.table(file = paste("./", path, "/", tested$regionID[cr], 
606:             path, "/", tested_4html_selected$ID, ".png\" height=\"63\" width=\"125\">", 
624:             path, "/", tested_4html_selected$ID, ".png\" height=\"63\" width=\"125\">", 
639:     regionID, clr = NA, annotate = TRUE, scores = TRUE, path) {
642:     path = paste("./", path, "/", sep = "")
651:         clr = clr, annotate = annotate, scores = scores, path = path)
656:     annotate = TRUE, path) {
659:     path = paste("./", path, "/", sep = "")
673:             annotate = annotate, scores = TRUE, path = path)
679:     ID = "CustomRegion", clr = NA, annotate = TRUE, path) {
680:     path = paste("./", path, "/", sep = "")
693:             annotate = annotate, scores = TRUE, path = path)
699:     ID = NA, clr = NA, annotate = TRUE, scores = NA, path) {
730:     png(paste(path, ID, ".png", sep = ""), width = 500, height = 250)
750:     pdf(paste(path, ID, ".pdf", sep = ""), width = 10, height = 10)
EnMCB:R/utils.R: [ ]
219:           path = getwd(),dpi = 300,units = "in",width = 10, height = 5,
275:            path = getwd(),dpi = 300,units = "in",width = 5, height = 4.5,
388:                     path = getwd(),dpi = 300,units = "in",width = 5, height = 5,
18:   BiocFileCache::bfcadd(ca, rname="IlluminaHumanMethylation450kanno.ilmn12.hg19", fpath=tf,
191:          path = getwd(),dpi = 300,units = "in",width = 5, height = 4.5,
321:          path = getwd(),dpi = 300,units = "in",width = 5, height = 4.5,
8:   if (length(q$rpath)>0) return(readRDS(rev(q$rpath)[1])) # if multiple, use last
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, 
Rqc:R/utils.R: [ ]
94:     path <- dirname(file)
99:     data.frame(filename, pair, format, group, reads, total.reads, path, 
ChemmineR:R/AllClasses.R: [ ]
1734: 	path <- conMA(x, exclude="H")
1979:             path <- .linearCon(x=con)
1800: 	conpath <- t(sapply(path, function(x) x[c(1, length(x))]))
1812: 	pathlist <- cyclist$path
1813: 	conpath <- cyclist$conpath
1814: 	pathlistnew <- list() 
1735: 	noconnect <- rowSums(path) != 0 # Removes atoms with no connections
1736: 	path <- path[noconnect, noconnect]
1737: 	if(all(dim(path) == 0)) { return(path) } 
1738: 	term <- which(rowSums(path > 0)==1)
1740: 		path <- path[-term,-term]
1741: 		if(any(dim(path) == 0) | is.vector(path)) { break() }
1742: 		term <- which(rowSums(path > 0)==1)
1744: 	return(path)
1779: .update <- function(con, path) {
1780: 	## Remove non-terminal atoms in each path
1781: 	center_atoms <- unique(unlist(lapply(path, function(x) x[-c(1, length(x))])))
1791: 		path <- c(path, remainbonds)
1792: 		names(path) <- seq(along=path)
1794: 	## Collect complete rings and remove them from path object
1795: 	index <- unlist(lapply(path, function(y) any(duplicated(y))))
1796: 	rings <- path[index]
1797: 	path <- path[!index]
1798: 	names(path) <- seq(along=path)
1799: 	## Connection list for path component
1806: 	return(list(con=con, conpath=conpath, path=path, rings=rings))
1850: 		## Collect complete rings and remove them from path object
1980:             cyclist <- .update(con=con, path=path)
13: .sdfDownload <- function(mypath="ftp://ftp.ncbi.nih.gov/pubchem/Compound/CURRENT-Full/SDF/", myfile="Compound_00650001_00675000.sdf...(7 bytes skipped)...
14: 	system(paste("wget ", mypath, myfile, sep=""))
17: # .sdfDownload(mypath="ftp://ftp.ncbi.nih.gov/pubchem/Compound/CURRENT-Full/SDF/", myfile="Compound_00650001_00675000.sdf...(6 bytes skipped)...
1747: ## (b) Function to return the longest possible linear bond paths where:
1801: 	ends <- unique(as.vector(conpath))
1802: 	conpath <- lapply(ends, function(x) as.numeric(names(which(rowSums(conpath==x) > 0))))
1803: 	names(conpath) <- ends
1804: 	conpath <- conpath[sapply(conpath, length) > 1] # removes ends that occur only once 
1816: 	## Loop to join linear paths/fragments stored in pathlist
1817: 	for(i in names(conpath)) {
1818: 		if(length(conpath) == 0 | !any(names(conpath) == i)) { next() }
1819: 		pos <- t(combn(conpath[[i]], m=2))
1821: 			p1 <- pathlist[[pos[j,1]]]
1822: 			p2 <- pathlist[[pos[j,2]]]
1827: 				pathlistnew[[length(pathlistnew)+1]] <- c(rev(p2[-1]), p1)
1830: 				pathlistnew[[length(pathlistnew)+1]] <- c(p1, rev(p2[-length(p2)]))
1833: 				pathlistnew[[length(pathlistnew)+1]] <- c(p2, p1[-1])
1836: 				pathlistnew[[length(pathlistnew)+1]] <- c(p1, p2[-1])
1840: 		if(length(pathlistnew) == 0) { next() }
1842: 		dups <- duplicated(sapply(pathlistnew, function(x) paste(sort(unique(x)), collapse="_")))
1843: 		pathlistnew <- pathlistnew[!dups]
1846: 			l <- sapply(pathlistnew, length)
1847: 			pathlistnew <- pathlistnew[l <= upper]
1848: 			if(length(pathlistnew) == 0) { next() }
1851: 		index <- unlist(lapply(pathlistnew, function(y) any(duplicated(y[c(1, length(y))]))))
1852: 		rings[[length(rings)+1]] <- pathlistnew[index]
1853: 		pathlistnew <- pathlistnew[!index]
1854: 		## Remove paths with internal duplicates 
1855: 		if(length(pathlistnew) > 0) {
1856: 			index <- unlist(lapply(pathlistnew, function(y) any(duplicated(y))))
1857: 			pathlistnew <- pathlistnew[!index]
1859: 		## Update pathlist and conpath
1860: 		pathlist <- c(pathlist[-conpath[[i]]], pathlistnew)
1861: 		dups <- duplicated(sapply(pathlist, function(x) paste(sort(unique(x)), collapse="_")))
1862: 		pathlist <- pathlist[!dups]
1863: 		names(pathlist) <- seq(along=pathlist)
1864: 		conpath <- t(sapply(pathlist, function(x) x[c(1, length(x))]))
1865: 		ends <- unique(as.vector(conpath))
1866: 		conpath <- lapply(ends, function(x) as.numeric(names(which(rowSums(conpath==x) > 0))))
1867: 		names(conpath) <- ends
1868: 		conpath <- conpath[sapply(conpath, length) > 1] # removes ends that occur only once
1869: 		pathlistnew <- list()
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)
RepViz:R/plotGeneTrack.R: [ ]
125:                                  host = "grch37.ensembl.org", path = "/biomart/martservice",
130:                                  host = "grch38.ensembl.org", path = "/biomart/martservice",
138:                                  host = "grch37.ensembl.org", path = "/biomart/martservice",
hca:R/lol.R: [ ]
132:     path <- ls(x, all.names = FALSE)
208:     path <- lol_path(x)
290:     path <- lol_path(x)
272: lol_path <- function(x) x[["path"]]
172:     paths <- lol_path(x)
1: .lol_visit_impl <- function(x, path, index, dict)
5: .lol_visit_impl.default <- function(x, path, index, dict) {
6:     dict[[path]] <- append(dict[[path]], list(index))
7:     attr(dict[[path]], "leaf") <- TRUE
15: .lol_visit_impl.list <- function(x, path, index, dict) {
18:     dict[[path]] <- append(dict[[path]], list(index))
19:     attr(dict[[path]], "leaf") <- FALSE
29:     ## logic for building out path names
30:     ## starting with current node of the nested list and extending the path by
32:     if (identical(path, ".")) {
33:         path <- nms
36:             path <- paste0(path, nms)
38:             path <- paste0(path, ".", nms)
44:         .lol_visit_impl(x[[i]], path[[i]], append(index, i), dict)
48:     function(lol, dict, path = .lol_path(dict), class = "lol")
53:         list(lol = lol, dict = dict, path = path),
75: #'     path, number of occurrences, and leaf status of each unique
76: #'     path.
129: .lol_path <-
133:     is_leaf <- .lol_is_leaf(x)[path]
135:         path = path,
136:         n = unname(.lol_lengths(x)[path]),
139:     arrange(tbl, .data$path)
142: .lol_valid_path <-
143:     function(x, path)
145:     ok <- .is_character_0(path) || path %in% lol_path(x)$path
146:     ok || stop("'path' not in 'x':\n", "  path: '", path, "'")
153: #' @param path character(1) from the tibble returned by `lol_path(x)`.
156: #'     to contain just the elements matching `path` as 'top-level'
164:     function(x, path = character())
168:         .is_character_0(path) || .is_scalar_character(path),
169:         .lol_valid_path(x, path)
173:     idx <- paths$path[startsWith(paths$path, path)]
174:     paths <- paths[paths$path %in% idx,]
175:     dict <-  .lol_dict(x)[paths$path]
190: #'     of rows in `lol_path()`.
209:     ## FIXME: don't allow filtering on 'path$path'
210:     path <- filter(path, ...)
211:     dict <- .lol_dict(x)[path$path]
213:     .lol(.lol_lol(x), dict, path, class(x))
219: #'     corresponding to a single `path`.
222: #'     corresponds to an element found at `path` in the list-of-lists
227:     function(x, path)
231:         .is_scalar_character(path),
232:         .lol_valid_path(x, path)
235:     value <- lapply(.lol_dict(x)[[path]], function(idx) lol[[idx]])
236:     names(value) <-  rep(path, length(value))
257:     function(x, path)
259:     value <- lol_lpull(x, path)
265: #' @description `lol_path()` returns a tibble representing the paths
269: #' plol |> lol_path()
293:         "# number of distinct paths: ", NROW(path), "\n",
297:         "# lol_path():\n",
300:     print(path, ...)
17:     ## building out the various paths
67: #'     individual paths from across the list-of-lists.
74: #'     paths through the list, as well as a tibble summarizing the
177:     .lol(.lol_lol(x), dict, paths, class(x))
183: #' @description `lol_filter()` filters available paths based on
295:         "# number of leaf paths: ", sum(is_leaf), "\n",
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))
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=""));}
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)
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"))
ggtree:R/tree-utilities.R: [ ]
724:     path <- c(anc_from[1:i], rev(anc_to[1:(j-1)]))
730:     path <- get.path(phylo, from, to)
698:     path_length <- sapply(1:(root-1), function(x) get.path_length(tr, root, x))
714: get.path <- function(phylo, from, to) {
980:     pathLength <- sapply(1:length(tr$tip.label), function(i) {
729: get.path_length <- function(phylo, from, to, weight=NULL) {
699:     i <- which.max(path_length)
700:     return(get.path(tr, root, i))
703: ##' path from start node to end node
706: ##' @title get.path
725:     return(path)
732:         return(length(path)-1)
747:     for(i in 1:(length(path)-1)) {
748:         ee <- get_edge_index(df, path[i], path[i+1])
981:         get.path_length(tr, i, root, yscale)
984:     ordered_tip <- order(pathLength, decreasing = TRUE)
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]
isobar:R/ProteinGroup-class.R: [ ]
424:                       host="www.ebi.ac.uk",path="/uniprot/biomart/martservice")
famat:R/compl_data.R: [ ]
568:         path<-h[2]
710:         path<-paste(stringr::str_sub(k, 1, 3),
858:             path<-stringr::str_split(s[1], "__")[[1]]
366:     notin_path<-vapply(elem_names, function(e){
369:         nb_path<-length(first_item[first_item %in% "X"])
387:     kegg_path<-pathways[stringr::str_sub(pathways, 1, 3) == "hsa"]
390:     path_walks_k<-vapply(kegg_path, function(x){
396:     wp_path<-pathways[stringr::str_sub(pathways, 1, 2) == "WP"]
397:     path_walks_w<-vapply(wp_path, function(x){
404:     path_walks_r<-vapply(first_walks_r, function(x){
425:     path_walks<-rbind(final_walks_r, path_walks_k,path_walks_w)
536:     cluster_elem<-save_cluster_elem<-listele[[1]];notin_path<-listele[[2]]
585:                 path_inter<-tagged[tagged$path == path,]
601:     heatmap<-listhtmp[[1]]; notin_path<-listhtmp[[2]]; hierapath<-listhtmp[[3]]
670:     rea_path<-sorted_path[stringr::str_sub(sorted_path, 1, 3) == "R-H"]
708:     kegg_path<-sorted_path[stringr::str_sub(sorted_path, 1, 3) == "hsa"]
740:     wp_path<-sorted_path[stringr::str_sub(sorted_path, 1, 2) == "WP"]
771: type_path<-function(sorted_path, hierapath){
800:     path_types<-unique(types$root)
802:         type_path<-types[types[, 2] %in% p, 1]#concerned pathways
948: filter_path<-function(tagged,size){
949:     path_inter<-as.vector(tagged[,4])
950:     sorted_path<-apply(size,1,function(x){ #sort pathways obtained
951:         path_elem<-as.integer(x[4])+as.integer(x[8])
965:     central<-listparam[[5]]; no_path<-listparam[[6]];
969:     sorted_path<-filter_path(tagged,size)
971:     path_walks<-listpath[[1]]; max<-listpath[[2]]
977:     heatmap<-listtab[[1]]; notin_path<-listtab[[2]]; hierapath<-listtab[[3]]
996:         path_cat<-stringr::str_split(i[6], ", ")[[1]]
435:     pathidtoname <- as.list(reactome.db::reactomePATHID2NAME)
516:     hierapath<-vapply(root_ids, function(r){
542:     heatmap<-listhiera[[1]]; hierapath<-listhiera[[2]]
963:     size<-listparam[[1]]; pathways<-listparam[[2]]; tagged<-listparam[[3]];
970:     listpath<-sort_hiera(sorted_path)
370:         if(element == TRUE && nb_path == 0){list(e)}
373:     notin_path<-unname(unlist(notin_path))
381:     if (element == TRUE){return(list(cluster, notin_path))}
388:     kegg_path<-paste(stringr::str_sub(kegg_path,1,3),
389:                         stringr::str_sub(kegg_path,5),sep="")
393:     path_walks_k<-as.data.frame(sort(unlist(path_walks_k)))
394:     if(ncol(path_walks_k) == 0){path_walks_k<-data.frame(walks=character())}
400:     path_walks_w<-as.data.frame(sort(unlist(path_walks_w)))
401:     if(ncol(path_walks_w) == 0){path_walks_w<-data.frame(walks=character())}
412:     path_walks_r<-rm_vector(unname(unlist(path_walks_r)))
413:     path_walks_r<-path_walks_r[stringr::str_detect(path_walks_r, ">")]
415:     final_walks_r<-vapply(path_walks_r, function(x){
416:         dupl<-which(stringr::str_detect(path_walks_r, x))
417:         dupl<-dupl[-which(dupl == which(path_walks_r == x))]
424:     names(final_walks_r)<-names(path_walks_w)<-names(path_walks_k)<-"walks"
426:     max<-max(stringr::str_count(path_walks[,1],">"))+1
427:     return(list(path_walks, max))
434:                                         treeview, no_path, list_elem){
455:                 paste("'", size[size$path == node, 2], "/",
456:                         size[size$path == node, 4], sep=""),
457:                 paste("'", size[size$path == node, 6], "/",
458:                         size[size$path == node, 8], sep=""),NA)
463:     colnames(heatmap)<-c("path_name", "path_id", "meta_ratio", "gene_ratio",
466:     heatmap[which(heatmap[, 4] == "'/"), 4]<-"'0/0";tags<-no_path$tag
480: cluster_hiera<-function(heatmap, size, tagged, no_path){
532: cluster_htmp<-function(heatmap, tags, size, tagged, no_path){
538:     cluster_elem<-cluster_elem[!(cluster_elem %in% notin_path)]
539:     heatmap<-heatmap[,c("path_name", "path_id", "meta_ratio", "gene_ratio",
541:     listhiera<-cluster_hiera(heatmap, size, tagged, no_path)
550:         if(x[2] %in% tagged$path){
556:     names(heatmap)<-c("path_name", "path_id", "meta_ratio", "gene_ratio",
558:     return(list(heatmap, notin_path, hierapath, save_cluster_elem))
562: final_tab<-function(build_hm, pathways, size, sorted_path, no_path,
564:     heatmap<-hiera_info(pathways, size, sorted_path, build_hm,
565:                         no_path, list_elem)
566:     sub_htmp<-heatmap[2:nrow(heatmap),]; tags<-no_path$tag #direct interactions
569:         pre_elem<-c(size[size$path %in% path, 3], size[size$path %in% path, 7])
586:                 path_inter<-path_inter[path_inter$tag ==
588:                 if(nrow(path_inter)>0){list("X")}
600:     listhtmp<-cluster_htmp(heatmap, tags, size, tagged, no_path)
603:     return(list(heatmap, notin_path, hierapath, save_cluster_elem))
625: infos_elem<-function(genes, notin_path, meta, keggchebiname, no_path,
634:     genetab<-pre_genetab[which(!(pre_genetab[,1] %in% notin_path)),]
635:     gene_notin<-pre_genetab[which(pre_genetab[,1] %in% notin_path),]
653:     intetab<-apply(no_path, 1, function(p){
664:                         "go", "path", "type")
669: type_reactome<-function(sorted_path){
672:     rea_types<-vapply(rea_path,function(r){
707: type_kegg<-function(sorted_path){
709:     kegg_types<-vapply(kegg_path, function(k){
712:         hiera<-kegg_hiera[stringr::str_detect(kegg_hiera[, 1], path), ]
725:         else if (path == "hsa01100"){
739: type_wp<-function(sorted_path){
741:     wp_types<-vapply(wp_path, function(w){
772:     kegg_type<-type_kegg(sorted_path)#kegg types
773:     rea_types<-type_reactome(sorted_path)#Reactome types
774:     wp_types<-type_wp(sorted_path)#wikipathways types
801:     hieratypes<-vapply(path_types, function(p){
804:             if(length(intersect(type_path, h[["name"]]))>0){h[["index"]]}
807:             if(length(intersect(type_path, h[["name"]]))>0){h[["name"]]}
872:                     list(paste("x : ",element,"\ny : ",path[length(path)],
881:                     list(paste("x : ", element, "\ny : ", path[length(path)],
952:         if (path_elem>0){
954:             if(num/path_elem>=0.2){x[1]}
957:     sorted_path<-unname(unlist(sorted_path))
958:     sorted_path<-rm_vector(c(sorted_path[!is.na(sorted_path)],path_inter))
959:     return(sorted_path)
972:     path_walks<-tidyr::separate(path_walks, 1, as.character(c(seq_len(max))),
974:     treeview<-tree_view(path_walks);names(treeview)<-c(seq_len(ncol(treeview)))
975:     listtab<-final_tab(treeview, pathways, size, sorted_path, no_path,
981:     listelm<-infos_elem(gene_list, notin_path, meta_list, keggchebiname,
982:                         no_path, go_genelist)
986:     listype<-type_path(sorted_path, hierapath)
998:                                           %in% path_cat),2]), collapse=", ")
1002:     names(intetab)<-c("tag", "first_item", "link", "sec_item", "go", "path",
341: ##find which elements are found in the same pathways, and put them together
342: ##find which pathways contain the same elements also
343: ##if element=T, also return user's elements which aren't in pathways
385: #filter entire pathways hierarchy to build a hierarchy concerning our pathways
386: sort_hiera<-function(pathways){
406:         if(length(pathways[pathways %in% rea_walks])>0){
407:             rea_walks<-rm_vector(rea_walks[c(1, which(rea_walks%in%pathways))])
430: #add informations about pathway hierarchies to the final heatmap
432: #names and ids of pathways in hierarchies
433: hiera_info<-function(pathways, size, sorted_pathways,
443:         name<-pathways[pathways[,2] == node, 1]
447:                             pathways[pathways[,2] == node, 1], sep=""))
450:             htmp<-c(htmp,paste(space, stringr::str_sub(pathidtoname[[node]],
451:                                     15, nchar(pathidtoname[[node]])), sep=""))
479: ##the hierarchy pathways are added to the root
527:     hierapath[length(hierapath)]=NULL
528:     return(list(heatmap, hierapath))
544:     hierapath<-lapply(hierapath,function(x){
549:     heatmap<-apply(heatmap,1,function(x){#pathway with direct interaction ?
561: ##build heatmap of hierarchies of pathways and elements included in them
668: #reactome pathways types
706: #kegg pathways types
738: #wikipathways pathways types
747:                 if(root%in%c("classic metabolic pathway", "regulatory pathway")
770: #pathways types=roots of pathways hierarchy
799:     ##list of concerned hierarchies by pathways types
803:         index<-lapply(hierapath, function(h){
806:         name<-lapply(hierapath, function(h){
947: #filter pathways regarding user's element ratio and direct interactions
1010:                 hierapath, save_cluster_elem, centrality, inter_values,
671:     mapnameid <- as.list(reactome.db::reactomePATHID2NAME) #id-name mapping
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.
BEclear:R/imputeMissingDataForBlock.R: [ ]
83:   path <- paste(dir, filename, sep = "/")
84:   save(D1, file = path)
ompBAM:R/ompBAM.R: [ ]
144:     path <- file.path(dir, pkg)
65:     proj_path <- .check_ompBAM_path(path)
172: .check_ompBAM_path <- function(path) {   
178:         proj_path <- normalizePath(path)
49: #' @param path The path to the desired directory in which to set up a new
53: #' path <- file.path(tempdir(), "myPkgName")
54: #' use_ompBAM(path)
58: use_ompBAM <- function(path = ".") {
66:     proj_name <- basename(proj_path)   
68:     usethis::create_package(proj_path, open = FALSE)
69:     usethis::proj_set(proj_path, force = TRUE)
71:     makevars <- file.path(proj_path, "src", "Makevars.in")
72:     makevars_win <- file.path(proj_path, "src", "Makevars.win")
73:     configure <- file.path(proj_path, "configure")
74:     configure.win <- file.path(proj_path, "configure.win")
75:     example_code <- file.path(proj_path, "src/ompBAM_example.cpp")
76:     R_import_file <- file.path(proj_path, "R/ompBAM_imports.R")
82:     file.copy(system.file(file.path('examples', 'ompBAMExample', "src", 
84:     file.copy(system.file(file.path('examples', 'ompBAMExample', "src", 
87:     file.copy(system.file(file.path('examples','ompBAMExample',"configure"), 
89:     file.copy(system.file(file.path('examples','ompBAMExample',"configure.win"),
92:     file.copy(system.file(file.path('extdata', 'ompBAM_example.cpp'), 
97:     .omp_use_dependency("Rcpp", "Imports", proj_path)
98:     .omp_use_dependency("zlibbioc", "Imports", proj_path)
99:     .omp_use_dependency("ompBAM", "LinkingTo", proj_path)
100:     .omp_use_dependency("Rcpp", "LinkingTo", proj_path)
101:     .omp_use_dependency("zlibbioc", "LinkingTo", proj_path)
103:     end_msg <- paste(proj_name, "successfully created in", proj_path)
121: #' # The directory containing the source code is given by the path here
123: #' print(system.file(file.path('examples', "ompBAMExample"), 
137:     from <- system.file(file.path('examples', pkg), package = 'ompBAM')
146:     devtools::load_all(path)
149: #' Returns the path of a test BAM file
157: #' @param dataset Returns the path to either the "Unsorted" or "scRNAseq" BAM.
158: #' @return A file path to the specified BAM file.
165:         system.file(file.path('extdata', 'THP1_ND_1.bam'), package = 'ompBAM'))
167:         system.file(file.path('extdata', 'MGE_E35_1.bam'), package = 'ompBAM'))
171: # Sanity checks on provided path for smooth package creation.
173:     if(!dir.exists(dirname(path))) {
174:         errormsg <- paste(dirname(path), "needs to exist")
177:     if(dir.exists(path)) {
180:         proj_path <- file.path(normalizePath(dirname(path)), basename(path))
182:     makevars <- file.path(proj_path, "src", "Makevars")
183:     makevars_win <- file.path(proj_path, "src", "Makevars.win")
191:     example_code <- file.path(proj_path, "src/ompBAM_example.cpp")
199:     R_import_file <- file.path(proj_path, "R/ompBAM_imports.R")
207:     return(proj_path)
228: .omp_use_dependency <- function(package, type, proj_path) {
233:     deps <- desc::desc_get_deps(proj_path)
243:         desc::desc_set_dep(package, type, file = proj_path)
263:             desc::desc_del_dep(package, existing_type, file = proj_path)
264:             desc::desc_set_dep(package, type, file = proj_path)
RBGL:R/interfaces.R: [ ]
308:     path <- f
305: extractPath <- function(s, f, pens) {
307: # linear path from node s to node f
311:     while (path[1] != s) {
312:         if (i > maxl)        # no path available
314:             path <- "NA" 
317:         path <- c(pens[f], path)
321:     as.numeric(path)
373:          # obtain weights in g for path of nodes in char vec nl
394:                           path_detail=as.vector(ans[[i]]), 
182:     ans <- .Call("BGL_dijkstra_shortest_paths_D", 
365:                    nG[extractPath(nodeind(thiss), nodeind(thisf[j]), curdi)]
410:     ans <- .Call("BGL_johnson_all_pairs_shortest_paths_D", 
428:     ans <- .Call("BGL_floyd_warshall_all_pairs_shortest_paths_D", 
450:     ans <- .Call("BGL_bellman_ford_shortest_paths", 
478:     ans <- .Call("BGL_dag_shortest_paths", 
nempi:other/TCGA.r: [ ]
23: path <- "mutclust/"
31:     if (file.exists(paste0(path, type, "_final.rda")) & !newmut & !newllr & !newsave) {
32:         load(paste0(path, type, "_final.rda"))
39:         if (file.exists(paste0(path, type, "_meth.rda"))) {
40:             load(paste0(path, type, "_meth.rda"))
80:             save(meth, file = paste0(path, type, "_meth.rda"))
86:         if (file.exists(paste0(path, type, "_cnv.rda"))) {
87:             load(paste0(path, type, "_cnv.rda"))
102:             save(cnv, file = paste0(path, type, "_cnv.rda"))
108:         if (file.exists(paste0(path, type, "_query.rda"))) {
109:             load(paste0(path, type, "_query.rda"))
128:             save(data, file = paste0(path, type, "_query.rda"))
137:         if (file.exists(paste0(path, type, "_mut.rda"))) {
138:             load(paste0(path, type, "_mut.rda"))
155:             save(mut, file = paste0(path, type, "_mut.rda"))
159:         if (file.exists(paste0(path, type, "_clin.rda"))) {
160:             load(paste0(path, type, "_clin.rda"))
163:             save(clinical, file = paste0(path, type, "_clin.rda"))
167:         if (file.exists(paste0(path, type, "_mut0.rda")) & !newmut) {
168:             load(paste0(path, type, "_mut0.rda"))
234:             save(M0, Mtype0, file = paste0(path, type, "_mut0.rda"))
263:         if (file.exists(paste0(path, type, "_llr.rda")) & !newllr) {
264:             load(paste0(path, type, "_llr.rda"))
345:             save(tmp, DF, file = paste0(path, type, "_llr.rda"))
381:         save(clinical, D, M, Mtype, DF, class, meth, cnv, file = paste0(path, type, "_final.rda"))
406: path <- "mutclust/"
408: load(paste0(path, type, "_final.rda"))
545: path <- ""
552:     load(paste0(path, type, "_nempi.rda"))
570:     load(paste0(path, type, "_nempi.rda"))
588:     load(paste0(path, type, "_nempi.rda"))
611:     load(paste0(path, type, "_nempi.rda"))
629:     load(paste0(path, type, "_nempi.rda"))
683: ## save(nempires, knnres, rfres, mfres, svmres, nnres, Rho, D2, Pmut, Pmeth, Pcnv, file = paste0(path, type, "_nempi.rda"))
685: path <- "mutclust/"; type <- "TCGA-BRCA"
687: load(paste0(path, type, "_nempi.rda"))
908: load(paste0(path, type, "_nempi.rda"))
GeneGeneInteR:R/PLSPM.R: [ ]
207:     Path = inner_results[[2]]
1162:   Path = path_matrix
2176:     Path <- pathmod[[2]]
48:   my.path <- rbind(Gene1,Gene2)
209:     Path_effects = get_effects(Path)
363: check_path <- function(path_matrix)
1173:     path_lm = summary(lm(Y_lvs[,k1] ~ Y_lvs[,k2]))
1202:   path_effects = as.list(seq_len(lvs-1))
2177:     path.orig <- as.vector(Path[path_matrix==1])
2179:     Path.efs <- get_effects(Path)
2186:     path.labs <- NULL
2175:     pathmod <- get_paths(path_matrix, Y.lvs)
2194:     PATHS <- matrix(NA, bootnum, sum(path_matrix))
1805: get_path_scheme <- function(path_matrix, LV)
1156: get_paths <-  function(path_matrix, Y_lvs, full=TRUE)
1207:     indirect_paths = matrix(c(0,0,0,0), 2, 2)
1208:     total_paths = Path
55:   try(mod1 <- plspm(XCases,my.path,my.blocks, modes = my.modes), silent=TRUE)
59:   	res <- list(statistic=NA,p.value=NA,method="Partial Least Squares Path Modeling",parameter=list.param)
64:   try(mod0 <- plspm(XControls,my.path,my.blocks, modes = my.modes),silent=TRUE)
68:   	res <- list(statistic=NA,p.value=NA,method="Partial Least Squares Path Modeling",parameter=list.param)
91: 		try(mod1 <- plspm(XCases,my.path,my.blocks, modes = my.modes), silent=TRUE)
93: 		try(mod0 <- plspm(XControls,my.path,my.blocks, modes = my.modes),silent=TRUE)
110: #	res <- list(statistic=stat,p.value=pval,method="Partial Least Squares Path Modeling",parameter=list.param)
123: 		method="Gene-based interaction based on Partial Least Squares Path Modeling",
138:   function(Data, path_matrix, blocks, modes = NULL, scaling = NULL,  
146:     valid = check_args(Data=Data, path_matrix=path_matrix, blocks=blocks, 
153:     path_matrix = valid$path_matrix
167:     gens = get_generals(MV, path_matrix)
188:       weights = get_weights(X, path_matrix, blocks, specs)
194:       weights = get_weights_nonmetric(X, path_matrix, blocks, specs)
203:     # Path coefficients and total effects
205:     inner_results = get_paths(path_matrix, LV)
241:     inner_summary = get_inner_summary(path_matrix, blocks, specs$modes,
245:     gof = get_gof(communality, R2, blocks, path_matrix)
259:         bootstrap = get_boots(MV, path_matrix, blocks, specs, br)
264:     model = list(IDM=path_matrix, blocks=blocks, specs=specs,
270:                path_coefs = Path, 
274:                effects = Path_effects,
289:   cat("Partial Least Squares Path Modeling (PLS-PM)", "\n")
294:   cat("\n3  $path_coefs     ", "path coefficients matrix")
314:   function(Data, path_matrix, blocks, scaling, modes, scheme,
319:     path_matrix = check_path(path_matrix)
327:     good_model = check_model(path_matrix, blocks)
331:          path_matrix = path_matrix,
365:   if (is_not_matrix(path_matrix))
366:     stop("\n'path_matrix' must be a matrix.")
368:   if (!is_square_matrix(path_matrix))
369:     stop("\n'path_matrix' must be a square matrix.")
371:   if (nrow(path_matrix) == 1)
372:     stop("\n'path_matrix' must have more than one row")
374:   if (!is_lower_triangular(path_matrix))
375:     stop("\n'path_matrix' must be a lower triangular matrix")
378:   for (j in seq_len(ncol(path_matrix))) 
380:     for (i in seq_len(nrow(path_matrix)))
382:       if (length(intersect(path_matrix[i,j], c(1,0))) == 0)
383:         stop("\nElements in 'path_matrix' must be '1' or '0'")
387:   if (lacks_dimnames(path_matrix)) {
388:     LV_names = paste("LV", seq_len(ncol(path_matrix)), sep = "")
389:     dimnames(path_matrix) = list(LV_names, LV_names)
391:   if (has_rownames(path_matrix) && lacks_colnames(path_matrix)) {
392:     colnames(path_matrix) = rownames(path_matrix)
394:   if (has_colnames(path_matrix) && lacks_rownames(path_matrix)) {
395:     rownames(path_matrix) = colnames(path_matrix)
399:   path_matrix
458: check_model <- function(path_matrix, blocks)
460:   # compatibility between path_matrix and blocks
461:   if (length(blocks) != nrow(path_matrix))
462:     stop("\nNumber of rows in 'path_matrix' different from length of 'blocks'.")
687:   SCHEMES = c("centroid", "factorial", "path")
884: get_generals <- function(MV, path_matrix)
890:        lvs = nrow(path_matrix),
891:        lvs_names = rownames(path_matrix))
1035: get_weights <- function(X, path_matrix, blocks, specs)
1037:   lvs = nrow(path_matrix)
1055:                 "centroid" = sign(cor(Y) * (path_matrix + t(path_matrix))),
1056:                 "factorial" = cor(Y) * (path_matrix + t(path_matrix)),
1057:                 "path" = get_path_scheme(path_matrix, Y))
1083:     dimnames(W) = list(colnames(X), rownames(path_matrix))    
1158:   lvs_names = colnames(path_matrix)
1159:   endogenous = as.logical(rowSums(path_matrix))
1164:   R2 = rep(0, nrow(path_matrix))
1171:     k2 = which(path_matrix[k1,] == 1)
1174:     Path[k1,k2] = path_lm$coef[-1,1]
1175:     residuals[[aux]] = path_lm$residuals  
1176:     R2[k1] = path_lm$r.squared
1177:     inn_val = c(path_lm$r.squared, path_lm$coef[,1])
1180:     rownames(path_lm$coefficients) = inn_labels
1181:     results[[aux]] <- path_lm$coefficients
1184:     # paste(rep("path_",length(k2)),names(k2),sep=""))
1192:   list(results, Path, R2, residuals)
1195: get_effects <- function(Path)
1198:   lvs = nrow(Path)
1199:   lvs_names = rownames(Path)
1203:   path_effects[[1]] = Path
1212:       path_effects[[k]] = path_effects[[k-1]] %*% Path        
1215:     for (k in 2:length(path_effects)) {
1216:       indirect_paths = indirect_paths + path_effects[[k]]        
1218:     total_paths = Path + indirect_paths
1227:         direct = c(direct, Path[i,j])
1325:   function(path_matrix, blocks, modes, communality, redundancy, R2)
1328:     exo_endo = rep("Exogenous", nrow(path_matrix))
1329:     exo_endo[rowSums(path_matrix) != 0] = "Endogenous"
1330:     avg_comu = rep(0, nrow(path_matrix))
1331:     avg_redu = rep(0, nrow(path_matrix))
1332:     AVE = rep(0, nrow(path_matrix))
1334:     for (k in seq_len(nrow(path_matrix)))
1352:                row.names = rownames(path_matrix))
1355: get_gof <- function(comu, R2, blocks, path_matrix)
1357:   lvs = nrow(path_matrix)
1359:   endo = rowSums(path_matrix)
1392: get_weights <- function(X, path_matrix, blocks, specs)
1394:   lvs = nrow(path_matrix)
1412:                 "centroid" = sign(cor(Y) * (path_matrix + t(path_matrix))),
1413:                 "factorial" = cor(Y) * (path_matrix + t(path_matrix)),
1414:                 "path" = get_path_scheme(path_matrix, Y))
1440:     dimnames(W) = list(colnames(X), rownames(path_matrix))    
1478:   function(X, path_matrix, blocks, specs)
1480:     lvs = nrow(path_matrix)
1541:     link = t(path_matrix) + path_matrix
1556:                   "path" = get_path_scheme(path_matrix, Y))
1751:       dimnames(W) = list(colnames(X), rownames(path_matrix))
1752:       dimnames(Y) = list(rownames(X), rownames(path_matrix))
1808:   E = path_matrix
1810:   for (k in seq_len(ncol(path_matrix))) 
1813:     follow <- path_matrix[k,] == 1
1817:     predec <- path_matrix[,k] == 1
2141:   function(DM, path_matrix, blocks, specs, br)
2146:     lvs = nrow(path_matrix)
2147:     lvs.names = rownames(path_matrix)
2151:     endo = sign(rowSums(path_matrix))
2162:       out.ws = get_weights(X, path_matrix, blocks, specs)
2168:       out.ws = get_weights_nonmetric(X, path_matrix, blocks, specs)
2190:         if (path_matrix[i,j]==1) 
2191:           path.labs <- c(path.labs, paste(lvs.names[j],"->",lvs.names[i]))
2195:     TOEFS <- matrix(NA, bootnum, nrow(Path.efs))
2207:         w.boot = get_weights(X.boot, path_matrix, blocks, specs)
2215:         w.boot = get_weights_nonmetric(X.boot, path_matrix, blocks, specs)
2225:       pathmod <- get_paths(path_matrix, Y.boot)
2228:       PATHS[i,] <- as.vector(P.boot[path_matrix==1])
2249:     # Path coefficients
2250:     colnames(PATHS) = path.labs
2251:     PB = get_boot_stats(PATHS, path.orig)
2256:     colnames(TOEFS) = Path.efs[, 1]
2257:     TE = get_boot_stats(TOEFS, Path.efs[,4]) 
1214:     indirect_paths = matrix(0, lvs, lvs)
1228:         indirect = c(indirect, indirect_paths[i,j])
1229:         total = c(total, total_paths[i,j])
2178:     r2.orig <- pathmod[[3]][endo==1]
2226:       P.boot <- pathmod[[2]]
2230:       RSQRS[i,] <- pathmod[[3]][endo==1]
2262:          paths = PB, 
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))
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"),
monocle:R/order_cells.R: [ ]
1724:   path <- shortest_paths(g, from = starting_cell, end_cells)
90:     path_vertex <- as.vector(get.all.shortest.paths(net, from = 1, to = i, mode="out")$res[[1]])
412:   FF_path <- unlist(get.shortest.paths(new_subtree, from=as.vector(first_fwd), to=as.vector(last_fwd), mode="out", output="vpath")$vpath)
413:   FR_path <- unlist(get.shortest.paths(new_subtree, from=as.vector(first_fwd), to=as.vector(last_rev), mode="out", output="vpath")$vpath)
414:   RF_path <- unlist(get.shortest.paths(new_subtree, from=as.vector(first_rev), to=as.vector(last_fwd), mode="out", output="vpath")$vpath)
415:   RR_path <- unlist(get.shortest.paths(new_subtree, from=as.vector(first_rev), to=as.vector(last_rev), mode="out", output="vpath")$vpath)
433:   path_weights <- c(FF_weight, FR_weight, RF_weight, RR_weight)
435:   opt_path <- paths[[opt_path_idx]]
459: measure_diameter_path <- function(pq_tree, curr_node, path_lengths)
1741:     path_cells <- names(traverse_res$shortest_path[[1]])
432:   paths <- list(FF_path, FR_path, RF_path, RR_path)
174:   first_diam_path_node_idx <- head(as.vector(diam), n=1)
175:   last_diam_path_node_idx <- tail(as.vector(diam), n=1)
189:     diam_path_names <- V(mst)[as.vector(diam)]$name
434:   opt_path_idx <- head((which(path_weights == min(path_weights))), 1)
91:     pd_subset <- subset(pd, State %in% path_vertex & is.na(scale_pseudotime))
94:     # print(path_vertex)
137: #' @param use_weights Whether to use edge weights when finding the diameter path of the tree.
138: #' @param root_node The name of the root node to use for starting the path finding.
169:   V(new_subtree)[root_node_id]$diam_path_len = length(diam)
177:       (igraph::degree(mst, first_diam_path_node_idx) == 1 &&
178:        igraph::degree(mst, last_diam_path_node_idx) == 1))
186:     #diam_path_vertex_names <- as.vector()
190:     last_bb_point_idx <- which(diam_path_names == last_bb_point)[1]
191:     first_bb_point_idx <- which(diam_path_names == first_bb_point)[1]
243: ...(48 bytes skipped)...x(V(sub_pq$subtree)[v]$name, type=V(sub_pq$subtree)[v]$type, color=V(sub_pq$subtree)[v]$color, diam_path_len=V(sub_pq$subtree)[v]$diam_path_len)
364:   #print ("opt_path:")
417:   # print (FF_path)
418:   # print (FR_path)
419:   # print (RF_path)
420:   # print (RR_path)
422:   FF_weight <- sum(E(new_subtree, path=FF_path)$weight)
423:   FR_weight <- sum(E(new_subtree, path=FR_path)$weight)
424:   RF_weight <- sum(E(new_subtree, path=RF_path)$weight)
425:   RR_weight <- sum(E(new_subtree, path=RR_path)$weight)
437:   # print ("opt_path:")
438:   # print (opt_path)
441:   stopifnot (length(opt_path) == length(q_level_list))
443:   directions <- V(new_subtree)[opt_path]$type
455:   return(list(ql=q_levels, wt=min(path_weights)))
465:     path_lengths[curr_node] = 0
466:     return(path_lengths)
484:     path_lengths[curr_node] = children_count
553: #' @param reverse_main_path Whether to reverse the direction of the trajectory
556: ...(8 bytes skipped)...good_branched_ordering <- function(orig_pq_tree, curr_node, dist_matrix, num_branches, reverse_main_path=FALSE)
574:   branch_node_counts <- V(pq_tree)[type == "Q"]$diam_path_len
721: ...(34 bytes skipped)..._helper(branch_tree, curr_branch, cell_ordering_tree, branch_pseudotimes, dist_matrix, reverse_main_path)
1719: # #' @return a list of shortest path...(46 bytes skipped)...estic distance between initial cell and terminal cells and branch point passes through the shortest path
1726:   return(list(shortest_path = path$vpath, distance = distance, branch_points = intersect(branchPoints, unlist(path$vpath))))
1743:     subset_cell <- c(subset_cell, path_cells)
47: #' @importFrom igraph graph.adjacency V graph.dfs get.all.shortest.paths
140: #' @importFrom igraph graph.empty get.edgelist get.all.shortest.paths
151:     sp <- get.all.shortest.paths(mst, from=V(mst)[root_node])
377: #' @importFrom igraph V vertex edge graph.empty get.shortest.paths E
1055: #' @param num_paths the number of end-point cell states to allow in the biological process.
1065:                        num_paths = NULL,
1084:     if (is.null(num_paths)){
1085:       num_paths = 1
1102: ...(4 bytes skipped)...order_list <- extract_good_branched_ordering(res$subtree, res$root, cellPairwiseDistances(cds), num_paths, FALSE)
1118:     if (is.null(num_paths) == FALSE){
1119:       message("Warning: num_paths only valid for method 'ICA' in reduceDimension()")
1166:     if (is.null(num_paths) == FALSE){
1167:       message("Warning: num_paths only valid for method 'ICA' in reduceDimension()")
1720: #' @importFrom igraph shortest.paths shortest_paths degree
1722:   distance <- shortest.paths(g, v=starting_cell, to=end_cells)
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")
onlineFDR:renv/activate.R: [ ]
167:       path <- tryCatch(method(version), error = identity)
591:     path <- Sys.getenv("RENV_PATHS_LIBRARY", unset = NA)
681:     path <- renv_bootstrap_paths_renv("profile", profile = FALSE)
122:     lockpath <- Sys.getenv("RENV_PATHS_LOCKFILE", unset = "renv.lock")
746:     descpath <- file.path(path, "DESCRIPTION")
909:   libpath <- file.path(root, prefix)
727:   renv_bootstrap_path_absolute <- function(path) {
736:   renv_bootstrap_paths_renv <- function(..., profile = TRUE, project = NULL) {
54:   # mask 'utils' packages, will come first on the search path
168:       if (is.character(path) && file.exists(path))
169:         return(path)
277:     urls <- file.path(repos, "src/contrib/Archive/renv", name)
278:     destfile <- file.path(tempdir(), name)
303:     # if the user has provided the path to a tarball via
313:       tarball <- file.path(tarball, name)
329:     fmt <- "* Bootstrapping with tarball at path '%s'."
361:     url <- file.path("https://api.github.com/repos/rstudio/renv/tarball", version)
363:     destfile <- file.path(tempdir(), name)
389:     r <- file.path(bin, exe)
393:       "-l", shQuote(path.expand(library)),
394:       shQuote(path.expand(tarball))
428:     # build list of path components
581:     # otherwise, disambiguate based on project's path
592:     if (!is.na(path))
593:       return(paste(c(path, prefix), collapse = "/"))
595:     path <- renv_bootstrap_library_root_impl(project)
596:     if (!is.null(path)) {
598:       return(paste(c(path, prefix, name), collapse = "/"))
614:       return(file.path(userdir, "library"))
682:     if (!file.exists(path))
686:     contents <- readLines(path, warn = FALSE)
702:       return(file.path("profiles", profile, "renv"))
729:     substr(path, 1L, 1L) %in% c("~", "/", "\\") || (
730:       substr(path, 1L, 1L) %in% c(letters, LETTERS) &&
731:       substr(path, 2L, 3L) %in% c(":/", ":\\")
738:     root <- if (renv_bootstrap_path_absolute(renv)) NULL else project
744:   renv_bootstrap_project_type <- function(path) {
772:     path.expand(chartr("\\", "/", dir))
792:         return(file.path(root, "R/renv"))
797:       file.path(Sys.getenv("LOCALAPPDATA"), "R/cache/R/renv")
902:   # construct path to library root
123:     if (!file.exists(lockpath))
126:     lockfile <- tryCatch(renv_json_read(lockpath), error = identity)
444:     prefix <- Sys.getenv("RENV_PATHS_PREFIX", unset = NA)
449:     auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA)
577:     asis <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT_ASIS", unset = "FALSE")
601:     renv_bootstrap_paths_renv("library", project = project)
607:     root <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT", unset = NA)
657:   renv_bootstrap_load <- function(project, libpath, version) {
660:     if (!requireNamespace("renv", lib.loc = libpath, quietly = TRUE))
737:     renv <- Sys.getenv("RENV_PATHS_RENV", unset = "renv")
747:     if (!file.exists(descpath))
751:       read.dcf(descpath, all = TRUE),
908:   # construct full libpath
912:   if (renv_bootstrap_load(project, libpath, version))
922:   bootstrap(version, libpath)
929:   if (requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) {
SMITE:R/SMITE.R: [ ]
1277:                             path <- goseq::goseq(pwf, "hg19", "knownGene",
1196:             PATHID2NAME <- AnnotationDbi::as.list(reactome.db::reactomePATHID2NAME)
1210:             pathways <- KEGGREST::keggList("pathway", "hsa") ## returns the list of human pathways
1279:                             path <- cbind(path,(as.character(sapply(
1280:                                 path$category, function(i){PATHID2NAME[[i]]}))))
1281:                             colnames(path)[6] <- "cat_name"
1282:                             subset(path, path$over_represented_pvalue < p_thresh)
1189:                 AnnotationDbi::as.list(reactome.db::reactomeEXTID2PATHID)
1201:             link_kegg<- KEGGREST::keggLink("pathway", "hsa") ## returns pathways for each kegg gene
1202:             list_link <- split(unname(link_kegg), names(link_kegg)) ## combines each pathway into list object for each gene
1211:             PATHID2NAME <- as.list(pathways)
rtracklayer:R/ucsc.R: [ ]
1606:     path <- ucscURLTable[key]
364:   label_path <- "//select[@name = 'hgta_track']/option/text()"
366:   track_path <- "//select[@name = 'hgta_track']/option/@value"
365:   labels <- sub("\n.*$", "", sapply(getNodeSet(doc, label_path), xmlValue))
367:   tracks <- unlist(getNodeSet(doc, track_path))
1581:             upload <- fileUpload(path(object), "text/plain")
1607:     if (is.na(path))
1610:         path <- paste0(path, '?redirect="manual"')
1612:     paste(object@url, path, sep="")
R453Plus1Toolbox:R/methods-AVASet.R: [ ]
270:                 path = file.path(dirname, s, r)
370:                 path = file.path(dirname, s, r)
774: 	    path = unique(c(subset(RData, sample==s)$currentPath, subset(RData, sample==s)$currentPath))
23: 	dir_root = file.path(dirname, "Amplicons")
24: 	dir_results = file.path(dir_root,"Results")
25: 	dir_projectDef = file.path(dir_root,"ProjectDef")
26: 	dir_variants = file.path(dir_results, "Variants")
27: 	dir_align = file.path(dir_results, "Align")
37:             | !file.exists(file.path(dir_variants, "currentVariantDefs.txt"))
38:             | !file.exists(file.path(dir_projectDef, "ampliconsProject.txt"))
95:       doAmplicon = file.path(avaBin, "doAmplicon")
217:               file_sample = file.path(dirname, file_sample)
218:               file_amp = file.path(dirname, file_amp)              
219:               file_reference = file.path(dirname, file_reference)
220:               file_variant = file.path(dirname, file_variant)
221:               file_variantHits = file.path(dirname, file_variantHits)
271:                 files = list.files(path)
281:                   amps_align[[i]]= readLines(file.path(path, file))
325:               file_sample = file.path(dirname, file_sample)
326:               file_amp = file.path(dirname, file_amp)              
327:               file_reference = file.path(dirname, file_reference)
371:                 files = list.files(path)
381:                   amps_align[[i]]= readLines(file.path(path, file))
675:     text = readLines(file.path(dir_projectDef, "ampliconsProject.txt"))
689:     	warning(paste("sample information missing in", file.path(dir_projectDef, "ampliconsProject.txt")))
757: 	    	warning(paste("Read data or MID entries missing in", file.path(dir_projectDef, "ampliconsProject.txt")))
775: 	    if(!any(is.na(path))){
776: 	        path = sapply(strsplit(path, split="\\."), function(x)x[1])
777: 	        ptp = paste(substr(path, 1, nchar(path)-2), collapse=",")
778: 	        lane = paste(substr(path, nchar(path)-1, nchar(path)), collapse=",")
822:         variantDefs=read.table(file=file.path(dir_variants, "currentVariantDefs.txt"), sep="\t",
902:             if(file.exists(file.path(dir_variants, s_id))){
903:                 detections = dir(file.path(dir_variants, s_id), pattern=".txt$", ignore.case=FALSE)
905:                     det = read.table(file.path(dir_variants, s_id, d), sep="\t",
949:         pfLines=readLines(file.path(dir_projectDef, "ampliconsProject.txt"))
997:         pfLines=readLines(file.path(dir_projectDef, "ampliconsProject.txt"))
1052:             thisSampleDir=file.path(dir_align, samples$SampleID[s])
1055:                 thisRefDir=file.path(thisSampleDir, r)
1056:                 alignFile=file.path(thisRefDir, paste(samples$SampleID[s],
700:             	"annotation", "currentPath", "name", "originalPath", "readDataGroup", "sequenceBlueprint"),
760: 	    	RData = data.frame(sample=samples, currentPath=rep(NA, numSamples), 
peakPantheR:R/methods_peakPantheRAnnotation.R: [ ]
1724:             device = "png", path = saveFolder, dpi = 100, width = 21,
1853:     path_cpdMeta <- paste(saveFolder, "/", annotationName,
1871:     path_specMeta <- paste(saveFolder, "/", annotationName,
1883:         path_var <- paste(saveFolder, "/", annotationName, "_", i, ".csv",
1918:     path_summary <- paste(saveFolder, "/", annotationName, "_summary.csv",
1116:     .filepath <- x@filepath[i]
1863:     tmp_filepath <- filepath(object)
2045:     .spectraPaths <- resSpectra$spectraPaths
2182: resetAnnot_spectraPathMetadata <- function(previousAnnotation, spectraPaths,
2186:         .spectraPaths <- filepath(previousAnnotation)
1076:     return(tools::file_path_sans_ext(basename(object@filepath)))
1386: #' @param saveFolder (str) Path of folder where annotationParameters_summary.csv
1399: #' spectraPaths <- c('./path/file1', './path/file2', './path/file3')
1610: #' @param saveFolder (str) Path of folder where annotationParameters_summary.csv
1703:     # @param saveFolder (str) Path where plots will be saved
1727:         # output path
1758: #' @param saveFolder (str) Path of folder where the annotation result csv will
1855:     utils::write.csv(tmp_outCpdMeta, file = path_cpdMeta, row.names = FALSE,
1858:     if (verbose) { message("Compound metadata saved at ", path_cpdMeta) }
1873:     utils::write.csv(tmp_outSpecMeta, file = path_specMeta, row.names = FALSE,
1876:     if (verbose) { message("Spectra metadata saved at ", path_specMeta) }
1885:         utils::write.csv(tmp_var, file = path_var, row.names = TRUE,
1889:             message("Peak measurement \"", i, "\" saved at ", path_var)
1920:     utils::write.csv(tmp_summary, file = path_summary, row.names = TRUE,
1923:     if (verbose) { message("Summary saved at ", path_summary) }
24:             length(object@filepath), " samples. \n", sep = "")
53: # @filepath length. Slot type is not checked as \code{setClass} enforces it.
78: #' # Paths to spectra files
119: #' # Paths to spectra files
160: #' # Paths to spectra files
206: #' # Paths to spectra files
253: #' # Paths to spectra files
286: # filepath
287: setGeneric("filepath", function(object, ...) standardGeneric("filepath"))
288: #' filepath accessor
290: #' @return (str) A character vector of file paths, of length number of spectra
293: #' @aliases filepath
300: #' # Paths to spectra files
319: #' filepath(annotation)
324: setMethod("filepath", "peakPantheRAnnotation", function(object) {
325:     object@filepath
343: #' # Paths to spectra files
386: #' # Paths to spectra files
430: #' # Paths to spectra files
472: #' # Paths to spectra files
512: #' # Paths to spectra files
552: #' # Paths to spectra files
593: #' # Paths to spectra files
636: #' # Paths to spectra files
695: #' # Paths to spectra files
742: #' # Paths to spectra files
788: #' # Paths to spectra files
817: #' nbSamples accessor established on filepath
828: #' # Paths to spectra files
852:     return(length(object@filepath))
868: #' # Paths to spectra files
913: #' # Paths to spectra files
946:     nbSample <- length(object@filepath)
953:         rownames(tmpAnnotation) <- object@filepath
961:         rownames(tmpAnnotation) <- object@filepath
977:     rownames(tmpAnnotation) <- object@filepath
1000: #' # Paths to spectra files
1041: #' filename accessor by spliting filepath
1052: #' # Paths to spectra files
1134:         FIR = .FIR, uROI = .uROI, filepath = .filepath,
1214: #' # Paths to spectra files
1398: #' # Paths to spectra files
1416: #' savePath        <- tempdir()
1419: #' outputAnnotationParamsCSV(emptyAnnotation, saveFolder=savePath, verbose=TRUE)
1488: #' # Paths to spectra files
1627: #' # Paths to spectra files
1652: #' savePath1       <- tempdir()
1653: #' outputAnnotationDiagnostic(annotation, saveFolder=savePath1, savePlots=FALSE,
1771: #' # Paths to spectra files
1796: #' savePath1       <- tempdir()
1797: #' outputAnnotationResult(annotation, saveFolder=savePath1,
1867:     tmp_outSpecMeta <- data.frame(filepath = tmp_filepath,
1941: #' the slots (\code{filepath} (from \code{spectraPaths}), \code{ROI},
1947: #' @param spectraPaths NULL or a character vector of spectra file paths, to set
1972: #' (\code{cpdID}, \code{cpdName}, \code{ROI}, \code{filepath}, \code{TIC},
1984: #' # Paths to spectra files
2188:             message("  Previous \"filepath\" value kept")
2415: #' # Paths to spectra files
80: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
95: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
121: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
136: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
162: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
177: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
208: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
223: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
255: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
270: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
302: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
317: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
345: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
360: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
388: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
403: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
432: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
447: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
474: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
489: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
514: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
529: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
554: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
569: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
595: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
610: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
638: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
653: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
697: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
712: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
744: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
759: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
790: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
805: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
830: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
845: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
870: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
885: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
915: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
930: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1002: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1017: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1054: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1069: #' annotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1216: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1231: #' emptyAnnotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1412: #' emptyAnnotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1490: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1505: #' emptyAnnotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1629: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1644: #' emptyAnnotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1773: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
1788: #' emptyAnnotation <- peakPantheRAnnotation(spectraPaths=spectraPaths,
1931:     function(previousAnnotation, spectraPaths = NULL, targetFeatTable = NULL,
1939: #' \code{spectraPaths}) or compounds (\code{targetFeatTable}) are passed, the
1986: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
2000: #' smallAnnotation  <- peakPantheRAnnotation(spectraPaths=spectraPaths, 
2011: #' newSpectraPaths  <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
2015: #'                                     spectraPaths=newSpectraPaths,
2026:     function(previousAnnotation, spectraPaths, targetFeatTable, uROI, FIR,
2042:     # spectraPaths, spectraMetadata
2043:     resSpectra <- resetAnnot_spectraPathMetadata(previousAnnotation,
2044:                                         spectraPaths, spectraMetadata, verbose)
2061:     # Create new object In all case (old or new value) spectraPaths and
2063:     peakPantheRAnnotation(spectraPaths = .spectraPaths,
2181: # resetAnnotation spectraPaths, spectraMetadata
2185:     if (all(is.null(spectraPaths))) {
2208:         .spectraPaths <- spectraPaths
2210:             message("  New \"spectraPaths\" value set")
2229:     return(list(spectraPaths = .spectraPaths,
2417: #' spectraPaths <- c(system.file('cdf/KO/ko15.CDF', package = 'faahKO'),
2431: #' smallAnnotation  <- peakPantheRAnnotation(spectraPaths=spectraPaths,
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)...
BiRewire:R/BiRewire.R: [ ]
635:     			PATH<-paste(path,'/',i,'/',sep='')
710:     			PATH<-paste(path,'/',i,'/',sep='')
916:     			PATH<-paste(path,'/',i,'/',sep='')
601: birewire.sampler.bipartite<-function(incidence,K,path,max.iter="n", accuracy=0.00005,verbose=TRUE,MAXITER_MUL=10,exact=FALSE,write.sparse=TRUE)
617: 		if(!file.exists(path))
619:     					dir.create(path) 
636: 				if(!file.exists(PATH))
638:       					dir.create(PATH)
647: ...(21 bytes skipped)...LUTO(as.simple_sparse_array(as.matrix(get.incidence(incidence,names=TRUE,sparse=FALSE))),file=paste(PATH,'network_',(i-1)*1000+j,sep=''))
650: 										write.table(get.incidence(incidence,names=TRUE,sparse=FALSE),file=paste(PATH,'network_',(i-1)*1000+j,sep=''),append=F)
656: ...(4 bytes skipped)...						write_stm_CLUTO(as.simple_sparse_array(as.matrix(incidence,names=TRUE,names=TRUE)),file=paste(PATH,'network_',(i-1)*1000+j,sep=''))
659: 										write.table(incidence,file=paste(PATH,'network_',(i-1)*1000+j,sep=''),append=FALSE)
676: birewire.sampler.undirected<-function(adjacency,K,path,max.iter="n", accuracy=0.00005,verbose=TRUE,MAXITER_MUL=10,exact=FALSE,write.sparse=TRUE)
692: 		if(!file.exists(path))
694:     					dir.create(path) 
711: 				if(!file.exists(PATH))
713:       					dir.create(PATH)
722: ...(21 bytes skipped)...LUTO(as.simple_sparse_array(as.matrix(get.adjacency(adjacency,names=TRUE,sparse=FALSE))),file=paste(PATH,'network_',(i-1)*1000+j,sep=''))
725: 										write.table(get.adjacency(adjacency,sparse=FALSE,names=TRUE),file=paste(PATH,'network_',(i-1)*1000+j,sep=''),append=F)
731: 										write_stm_CLUTO(as.simple_sparse_array(as.matrix(adjacency)),file=paste(PATH,'network_',(i-1)*1000+j,sep=''))
734: 										write.table(adjacency,file=paste(PATH,'network_',(i-1)*1000+j,sep=''),append=FALSE)
891: birewire.sampler.dsg<-function(dsg,K,path,delimitators=list(negative='-',positive='+'),exact=FALSE,verbose=TRUE, max.iter.pos='n',max.iter.ne...(59 bytes skipped)...
901: 		if(!file.exists(path))
903:     					dir.create(path) 
917: 				if(!file.exists(PATH))
919:       					dir.create(PATH)
925:     						dsg=birewire.rewire.dsg(dsg=dsg,delimitators=delimitators,exact=exact,path=paste(PATH,'network_',(i-1)*1000+j,'.sif',sep=''),
947: ...(22 bytes skipped)...unction(dsg,exact=FALSE,verbose=1,max.iter.pos='n',max.iter.neg='n',accuracy=0.00005,MAXITER_MUL=10,path=NULL,delimitators=list(positive='+',negative= '-'),check_pos_neg=FALSE,in_sampler=FALSE)
963: 	if(!is.null(path))
975: ...(144 bytes skipped)... return the DSG (in order to not interrupt the chain) but it will not be saved (if you pass a valid path")	
980: 			birewire.save.dsg(g=birewire.build.dsg(dsg,delimitators),file=path)
1105: birewire.load.dsg<-function(path)
1109: 		return(unique(read.table(path,stringsAsFactors=F)))
savR:R/savR-methods.R: [ ]
270:   path <- location(project)
373:   path <- getInterOpFilePath(project, format)
571:   path <- normalizePath(paste(project@location, "InterOp", format@filename, sep="/"))
611:   path <- getInterOpFilePath(project,format)
519:     filePath <- suppressWarnings(normalizePath(paste(project@location, "InterOp", format@filename, sep="/") ))
585: getInterOpFilePath <- function(project, format) {
271:   if (!file.exists(path))
272:     stop(paste("Project", path, "does not exist."))
285:   path <- normalizePath(paste(reports, "Intensity", sep="/"))
289:         Cairo::Cairo(file=paste(path, "/Chart_", cycle, "_", tolower(base), ".png", sep=""), width=300, height=800, dpi=72, type="png", ...(11 bytes skipped)...
304:   path <- normalizePath(paste(reports, "NumGT30", sep="/"))
307:       Cairo::Cairo(file=paste(path, "/Chart_", cycle, ".png", sep=""), width=300, height=800, dpi=72, type="png", bg="white")
323:   path <- normalizePath(paste(reports, "ByCycle", sep="/"))
326:       Cairo::Cairo(file=paste(path, "/QScore_L", lane, ".png", sep=""), width=800, height=400, dpi=72, type="png", bg="white")
341:   path <- normalizePath(paste(reports, "FWHM", sep="/"))
345:         Cairo::Cairo(file=paste(path, "/Chart_", cycle, "_", tolower(base), ".png", sep=""), width=300, height=800, dpi=72, type="png", ...(11 bytes skipped)...
374:   fh <- file(path, "rb")
572:   fh <- file(path, "rb")
612:   fh <- file(path, "rb")
7:   retval <- new("savProject", location=normalizePath(object))
10:   ri <- normalizePath(paste(object, "RunInfo.xml", sep="/"))
273:   reports <- normalizePath(destination, mustWork=F)
521:     if (file.exists(filePath)) {
586:   return(normalizePath(paste(project@location, "InterOp", format@filename, sep="/")))
12:   retval@runid <- XML::xmlAttrs(XML::xpathApply(runinfo, "/RunInfo/Run")[[1]])["Id"]
13:   retval@number <- as.integer(XML::xmlAttrs(xpathApply(runinfo, "/RunInfo/Run")[[1]])["Number"])
14:   retval@flowcell <- XML::xmlValue(XML::xpathApply(runinfo, "/RunInfo/Run/Flowcell")[[1]])
15:   retval@instrument <- XML::xmlValue(XML::xpathApply(runinfo, "/RunInfo/Run/Instrument")[[1]])
16:   retval@date <- XML::xmlValue(XML::xpathApply(runinfo, "/RunInfo/Run/Date")[[1]])
18:   for (x in XML::xpathApply(runinfo, "/RunInfo/Run/Reads/Read")) {
30:   layout <- XML::xpathApply(runinfo, "/RunInfo/Run/FlowcellLayout")[[1]]
HiCBricks:R/Brick_functions.R: [ ]
2002:     Path <- Create_Path(c(Root.folders['matrices'],chr,chr))
498:         Bintable.group.path <- Create_Path(
1361:     Group.path <- Create_Path(c(Reference.object$hdf.matrices.root,chr1,chr2))
1456:     Group.path <- Create_Path(c(Reference.object$hdf.matrices.root,chr,chr))
2522:     Group.path <- Create_Path(c(Reference.object$hdf.matrices.root,
2585:     Group_path <- Create_Path(c(Reference_object$hdf.matrices.root, 
2678:     Group.path <- Create_Path(c(Reference.object$hdf.matrices.root, chr1,
205:     Config_filepath <- .make_configuration_path(output_directory)
895:     Brick_filepath <- BrickContainer_get_path_to_file(Brick,
964:     Brick_filepath <- BrickContainer_get_path_to_file(Brick, 
1339:     Brick_filepath <- BrickContainer_get_path_to_file(Brick, 
1434:     Brick_filepath <- BrickContainer_get_path_to_file(Brick, 
1849:     Brick_filepath <- BrickContainer_get_path_to_file(Brick = Brick, 
2034:     Brick_filepath <- BrickContainer_get_path_to_file(Brick = Brick, 
2524:     Brick_filepath <- BrickContainer_get_path_to_file(Brick = Brick, 
2587:     Brick_filepath <- BrickContainer_get_path_to_file(Brick = Brick, 
2676:     Brick_filepath <- BrickContainer_get_path_to_file(Brick = Brick, 
703:     Brick_paths <- BrickContainer_get_path_to_file(Brick = Brick,
760:     Brick_filepaths <- BrickContainer_list_files(Brick = Brick, 
812:     Brick_filepaths <- BrickContainer_get_path_to_file(Brick,
18: #' A string containing the path to the file to load as the binning table for
141: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
143: #' out_dir <- file.path(tempdir(), "Creator_test")
145: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
178:             "without an explicit path", "definition!", "If you want to create",
180:             "please provide", "the complete path. Or, you can",
182:             paste("file.path(getwd())", sep = ""), 
300: #' the function will provide the path to the created/tracked HDF file.
306: #' out_dir <- file.path(tempdir(),"mcool_test_dir")
307: #' dir.create(path = out_dir)
311: #' destfile = file.path(out_dir,"H1-hESC-HiC-4DNFI7JNCNFB.mcool"))
313: #' mcool <- file.path(out_dir,"H1-hESC-HiC-4DNFI7JNCNFB.mcool")
332:         stop("mcool must be provided as mcool= /path/to/something")
339:         mcool.version <- GetAttributes(Path = Create_Path(
355:         mcool.version <- GetAttributes(Path = NULL, File=mcool, 
391: #' out_dir <- file.path(tempdir(),"mcool_test_dir")
392: #' dir.create(path = out_dir)
397: #' destfile = file.path(out_dir,"H1-hESC-HiC-4DNFI7JNCNFB.mcool"))
399: #' mcool <- file.path(out_dir,"H1-hESC-HiC-4DNFI7JNCNFB.mcool")
452: #' out_dir <- file.path(tempdir(), "mcool_test_dir")
453: #' dir.create(path = out_dir)
457: #' destfile = file.path(out_dir, "H1-hESC-HiC-4DNFI7JNCNFB.mcool"))
459: #' mcool <- file.path(out_dir, "H1-hESC-HiC-4DNFI7JNCNFB.mcool")
476:     mcool.version <- GetAttributes(Path = NULL, File=mcool,
502:         Bintable.group.path <- Create_Path(Bintable.group)
504:     Handler <- ._Brick_Get_Something_(Group.path = Bintable.group.path,
517: #' A string specifying the path to the Brick store created with 
534: #' Bintable_path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
537: #' out_dir <- file.path(tempdir(), "HiCBricks_chrominfo_test")
541: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable_path, 
670: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
673: #' out_dir <- file.path(tempdir(), "add_ranges_test")
677: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
709:     bplapply(Brick_paths, function(Brick_path){
710:         ._Brick_Add_Ranges_(Brick = Brick_path,
711:         Group.path = Create_Path(c(Reference.object$hdf.ranges.root,
739: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
742: #' out_dir <- file.path(tempdir(), "list_matrices_test")
746: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
766:             Path = Create_Path(
794: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
797: #' out_dir <- file.path(tempdir(), "list_rangekeys_test")
801: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
815:         Group.path = Create_Path(Reference.object$hdf.ranges.root),
836: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
839: #' out_dir <- file.path(tempdir(), "list_rangekeys_exists_test")
843: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
876: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
879: #' out_dir <- file.path(tempdir(), "list_ranges_mcols_test")
883: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
936: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
939: #' out_dir <- file.path(tempdir(), "list_get_ranges_test")
943: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
971:         chromosomes <- ._Brick_Get_Something_(Group.path = Create_Path(
980:             Group.path = Create_Path(
985:         Lengths <- ._Brick_Get_Something_(Group.path = Create_Path(
995:     Dataset <- ._Brick_Get_Something_(Group.path = Create_Path(
1020:                     Group.path = Create_Path(
1038:                     Group.path = Create_Path(c(
1071: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1074: #' out_dir <- file.path(tempdir(), "list_get_bintable_test")
1077: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1134: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1137: #' out_dir <- file.path(tempdir(), "fetch_range_index_test")
1140: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1232: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"),
1235: #' out_dir <- file.path(tempdir(), "region_position_test")
1238: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1303: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1306: #' out_dir <- file.path(tempdir(), "matrix_load_test")
1309: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1314: #' Matrix_file <- system.file(file.path("extdata", 
1367:         Matrix.file = matrix_file, delim = delim, Group.path = Group.path, 
1400: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1403: #' out_dir <- file.path(tempdir(), "matrix_load_dist_test")
1406: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1411: #' Matrix_file <- system.file(file.path("extdata", 
1462:         Matrix.file = matrix_file, delim = delim, Group.path = Group.path,
1481: #' @param mcool \strong{Required}. Path to an mcool file.
1504: #' out_dir <- file.path(tempdir(),"mcool_load_test")
1505: #' dir.create(path = out_dir)
1509: #' destfile = file.path(out_dir,"H1-hESC-HiC-4DNFI7JNCNFB.mcool"))
1511: #' mcool <- file.path(out_dir,"H1-hESC-HiC-4DNFI7JNCNFB.mcool")
1568:     RetVar <- .process_mcool(Brick = Brick, mcool_path = mcool, 
1585: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1588: #' out_dir <- file.path(tempdir(), "matrix_isdone_test")
1591: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1596: #' Matrix_file <- system.file(file.path("extdata", 
1629: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1632: #' out_dir <- file.path(tempdir(), "matrix_issparse_test")
1635: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1640: #' Matrix_file <- system.file(file.path("extdata", 
1681: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1684: #' out_dir <- file.path(tempdir(), "matrix_maxdist_test")
1687: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1692: #' Matrix_file <- system.file(file.path("extdata", 
1736: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1739: #' out_dir <- file.path(tempdir(), "matrix_exists_test")
1742: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1747: #' Matrix_file <- system.file(file.path("extdata", 
1775: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1778: #' out_dir <- file.path(tempdir(), "matrix_minmax_test")
1781: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1786: #' Matrix_file <- system.file(file.path("extdata", 
1821: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1824: #' out_dir <- file.path(tempdir(), "matrix_dimension_test")
1827: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1832: #' Matrix_file <- system.file(file.path("extdata", 
1851:     Extents <- ._GetDimensions(group.path = Create_Path(
1853:         dataset.path = Reference.object$hdf.matrix.name,
1870: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1873: #' out_dir <- file.path(tempdir(), "matrix_filename_test")
1876: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1881: #' Matrix_file <- system.file(file.path("extdata", 
1936: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
1939: #' out_dir <- file.path(tempdir(), "val_by_dist_test")
1942: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
1947: #' Matrix_file <- system.file(file.path("extdata", 
2040:         diag(._Brick_Get_Something_(Group.path = Path, Brick = Brick_filepath,
2087: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
2090: #' out_dir <- file.path(tempdir(), "get_matrix_coords_test")
2093: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
2098: #' Matrix_file <- system.file(file.path("extdata", 
2200: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
2203: #' out_dir <- file.path(tempdir(), "get_matrix_test")
2206: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
2211: #' Matrix_file <- system.file(file.path("extdata", 
2309: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
2312: #' out_dir <- file.path(tempdir(), "get_row_vector_test")
2315: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
2320: #' Matrix_file <- system.file(file.path("extdata", 
2463: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
2466: #' out_dir <- file.path(tempdir(), "get_vector_val_test")
2472: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
2477: #' Matrix_file <- system.file(file.path("extdata", 
2526:     Vector <- ._Brick_Get_Something_(Group.path = Group.path, 
2550: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
2553: #' out_dir <- file.path(tempdir(), "get_vector_val_test")
2558: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
2563: #' Matrix_file <- system.file(file.path("extdata", 
2589:     dataset_handle <- ._Brick_Get_Something_(Group.path = Group_path, 
2625: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
2628: #' out_dir <- file.path(tempdir(), "get_matrix_mcols_test")
2631: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
2636: #' Matrix_file <- system.file(file.path("extdata", 
2680:     Vector <- ._Brick_Get_Something_(Group.path = Group.path, 
2694: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
2697: #' out_dir <- file.path(tempdir(), "list_matrix_mcols_test")
2700: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
2717: #' BrickContainer, a string of length 1 as resolution and a path specifying
2724: #' @param out_file Path to the output file to write.
2735: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
2738: #' out_dir <- file.path(tempdir(), "write_file")
2741: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
2746: #' Matrix_file <- system.file(file.path("extdata", 
2755: #' out_file = file.path(out_dir, "example_out.txt"), 
2768:         stop(out_file, " already exists at path")
2820: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
2823: #' out_dir <- file.path(tempdir(), "get_vector_val_test")
2828: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
2833: #' Matrix_file <- system.file(file.path("extdata", 
2870: #' @param table_file Path to the file that will be loaded
2887: #' Bintable.path <- system.file(file.path("extdata", "Bintable_100kb.bins"), 
2890: #' out_dir <- file.path(tempdir(), "get_vector_val_test")
2895: #' My_BrickContainer <- Create_many_Bricks(BinTable = Bintable.path, 
2900: #' Matrix_file <- system.file(file.path("extdata", 
2909: #' out_file = file.path(out_dir, "example_out.txt"), 
2914: #' table_file = file.path(out_dir, "example_out.txt"), 
188:     output_directory <- normalizePath(output_directory)
219:     if(file.exists(Config_filepath)){
223:         Container <- load_BrickContainer(Config_filepath)
282:         Config_filepath)
283:     .write_configuration_file(Container, Config_filepath)
907:     mcol.df <- .prepare_ranges_metadata_mcols(Brick = Brick_filepath, 
973:         Brick = Brick_filepath,
982:             Brick = Brick_filepath,
987:         Brick = Brick_filepath,
997:         Brick = Brick_filepath, 
1022:                 Brick = Brick_filepath, Name = FUN_name, Start = m.start, 
1040:                         rangekey)), Brick = Brick_filepath,
1341:     if(length(Brick_filepath) == 0){
1366:     RetVar <- ._ProcessMatrix_(Brick = Brick_filepath, 
1436:     if(length(Brick_filepath) == 0){
1461:     RetVar <- ._Process_matrix_by_distance(Brick = Brick_filepath,
1854:         File = Brick_filepath, return.what = "size")
2527:         Brick = Brick_filepath, Name = Reference.object$hdf.matrix.name, 
2590:         Brick = Brick_filepath, Name = Reference_object$hdf.matrix.name, 
2681:         Brick = Brick_filepath, Name = what, return.what = "data")
2781:             Brick_filepath = a_row$filepath,
763:     chr1.list <- lapply(seq_len(nrow(Brick_filepaths)), function(i){
764:         Row <- Brick_filepaths[i,]
770:             File = Row$filepaths,
816:         Brick = Brick_filepaths[1], return.what = "group_handle")