File: getcolproc.r

package info (click to toggle)
r-bioc-arrayexpress 1.66.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 460 kB
  • sloc: makefile: 2
file content (23 lines) | stat: -rw-r--r-- 843 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
getcolproc = function(files){
  path = paste(files$path, "/", sep="")
  procfile = files$processedArchive[1]
  ph = try(read.AnnotatedDataFrame(basename(files$sdrf), path = path, row.names = NULL, blank.lines.skip = TRUE, fill = TRUE, varMetadata.char = "$", quote="\""))
  derivedMatrixCol = getSDRFcolumn("DerivedArrayMatrix",varLabels(ph))
  derivedFileCol = getSDRFcolumn("DerivedArrayFile",varLabels(ph))
  
  if(length(derivedMatrixCol) != 0)
    skiplines = 1
  else if(length(derivedFileCol) != 0)
    skiplines = 0
  else
    warning("Unable to find Derived Data column in SDRF")
  
  coln = scan(file.path(procfile),what = "",nlines = 1, skip = skiplines, sep = "\t")
  return(unique(coln))
}

getcolraw = function(rawfiles){
  rawfile = rawfiles[1]
  coln = scan(file.path(rawfile),what = "",nlines = 1, sep = "\t")
  return(coln)
}