For a group of samples this function creates the list of paths to the raw input files which can then be used in loadCoverage. The raw input files are either BAM files or BigWig files.
rawFiles(
datadir = NULL,
sampledirs = NULL,
samplepatt = NULL,
fileterm = "accepted_hits.bam"
)
The main directory where each of the sampledirs
is a
sub-directory of datadir
.
A character vector with the names of the sample
directories. If datadir
is NULL
it is then assumed that
sampledirs
specifies the full path to each sample.
If specified and sampledirs
is set to NULL
,
then the directories matching this pattern in datadir
(set to
.
if it's set to NULL
) are used as the sample directories.
Name of the BAM or BigWig file used in each sample. By
default it is set to accepted_hits.bam
since that is the automatic
name generated when aligning with TopHat. If NULL
it is then ignored
when reading the rawfiles. This can be useful if all the raw files are
stored in a single directory.
A vector with the full paths to the raw files and sample names stored as the vector names.
This function can also be used to identify a set of BigWig files.
## Get list of BAM files included in derfinder
datadir <- system.file("extdata", "genomeData", package = "derfinder")
files <- rawFiles(
datadir = datadir, samplepatt = "*accepted_hits.bam$",
fileterm = NULL
)
files
#> ERR009101_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009101_accepted_hits.bam"
#> ERR009102_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009102_accepted_hits.bam"
#> ERR009105_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009105_accepted_hits.bam"
#> ERR009107_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009107_accepted_hits.bam"
#> ERR009108_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009108_accepted_hits.bam"
#> ERR009112_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009112_accepted_hits.bam"
#> ERR009115_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009115_accepted_hits.bam"
#> ERR009116_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009116_accepted_hits.bam"
#> ERR009131_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009131_accepted_hits.bam"
#> ERR009138_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009138_accepted_hits.bam"
#> ERR009144_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009144_accepted_hits.bam"
#> ERR009145_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009145_accepted_hits.bam"
#> ERR009148_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009148_accepted_hits.bam"
#> ERR009151_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009151_accepted_hits.bam"
#> ERR009152_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009152_accepted_hits.bam"
#> ERR009153_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009153_accepted_hits.bam"
#> ERR009159_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009159_accepted_hits.bam"
#> ERR009161_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009161_accepted_hits.bam"
#> ERR009163_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009163_accepted_hits.bam"
#> ERR009164_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009164_accepted_hits.bam"
#> ERR009167_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/ERR009167_accepted_hits.bam"
#> SRR031812_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/SRR031812_accepted_hits.bam"
#> SRR031835_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/SRR031835_accepted_hits.bam"
#> SRR031867_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/SRR031867_accepted_hits.bam"
#> SRR031868_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/SRR031868_accepted_hits.bam"
#> SRR031900_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/SRR031900_accepted_hits.bam"
#> SRR031904_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/SRR031904_accepted_hits.bam"
#> SRR031914_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/SRR031914_accepted_hits.bam"
#> SRR031936_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/SRR031936_accepted_hits.bam"
#> SRR031958_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/SRR031958_accepted_hits.bam"
#> SRR031960_accepted_hits.bam
#> "/__w/_temp/Library/derfinder/extdata/genomeData/SRR031960_accepted_hits.bam"