ramwas0createArtificialData: Create Artificial Data Set

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/rw0simdata.r

Description

Creates a set of artificial BAM files and supplementary files which can be used to test run the pipeline. The BAMs contain reads aligned only to one human chromosome, with methylation effects embedded for simulated age and case-control status.

Usage

1
2
3
4
5
6
ramwas0createArtificialData(dir,
                            nsamples = 20,
                            nreads = 1e6,
                            ncpgs = 500e3,
                            randseed = 18090212,
                            threads = 1)

Arguments

dir

Directory for generated RaMWAS project files and BAMs.

nsamples

Number of samples/BAMs to create.

nreads

Number of reads in each BAM file.

ncpgs

Number of CpGs in the generated genome (with a single chromosome).

randseed

Random number generator seed for consistency of the output.

threads

Number of CPU cores to use for data generation.

Details

The function generates a number of files within dir directory.

  1. bam_list.txt - list of created BAM files. To be used in filebamlist and filebam2sample parameters in the pipeline.

  2. covariates.txt - table with age and sex status covariates. For use in filecovariates parameter in the pipeline.

  3. Single_chromosome.rds - CpG location file with the selected chromosome only.

  4. bams - directory with all the BAM files.

The generated BAMs have 600 CpGs affected by sex, namely fully methylated or not methylated at all, depending on sex. The methylation level of 1% of all CpGs is affected by age. The methylation of those CpGs is equal to age/100 or 1-age/100. The age is generated randomly in the range from 20 to 80.

Value

The function creates multiple files but returns no value.

Author(s)

Andrey A Shabalin andrey.shabalin@gmail.com

See Also

See vignettes: browseVignettes("ramwas").

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
### Location for the artificial project
dr = paste0(tempdir(), "/simulated_project")

ramwas0createArtificialData(
    dr,
    nsamples = 4,
    nreads = 10e3,
    ncpgs = 1e3)

# Artificial project files created in:
dr
# The generated files are:"
as.matrix(list.files(dr, recursive=TRUE))

### Clean up
unlink(paste0(dr,"/*"), recursive=TRUE)

ramwas documentation built on Nov. 8, 2020, 8:24 p.m.