MakeIGVSampleMetadata: Make sample metadata file for use with IGV.

Description Usage Arguments Value Author(s) Examples

View source: R/tracktablesFunctions.R

Description

Creates sample metadata file for IGV from a Samplesheet of metadata and FileSheet of file locations.

Usage

1
MakeIGVSampleMetadata(SampleSheet, fileSheet, igvdirectory)

Arguments

SampleSheet

A data.frame object with metadata information for samples. First column must contain unique sample ids.

fileSheet

A data.frame of file locations. First column must contain the unique sample ids.

igvdirectory

A character of the directory to which sample metadata file is written.

Value

A character of file location for the IGV sample information file.

Author(s)

Thomas Carroll

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
fileLocations <- system.file("extdata",package="tracktables")

bigwigs <- dir(fileLocations,pattern="*.bw",full.names=TRUE)

intervals <- dir(fileLocations,pattern="*.bed",full.names=TRUE)

bigWigMat <- cbind(gsub("_Example.bw","",basename(bigwigs)),
                   bigwigs)

intervalsMat <- cbind(gsub("_Peaks.bed","",basename(intervals)),
                      intervals)

fileSheet <- merge(bigWigMat,intervalsMat,all=TRUE)

fileSheet <- as.matrix(cbind(fileSheet,NA))

colnames(fileSheet) <- c("SampleName","bigwig","interval","bam")

SampleSheet <- cbind(as.vector(fileSheet[,"SampleName"]),
                     c("EBF","H3K4me3","H3K9ac","RNAPol2"),
                     c("ProB","ProB","ProB","ProB"))

colnames(SampleSheet) <- c("SampleName","Antibody","Species")
MakeIGVSampleMetadata(SampleSheet,fileSheet,igvdirectory=getwd())

tracktables documentation built on Nov. 8, 2020, 5:28 p.m.