madeBED {ramwas} | R Documentation

## Export MWAS results in BED format.

### Description

Functions for exporting MWAS results in BED format files.

Function `madeBED` saves MWAS findings in BED format for all variables (CpGs), while `madeBEDrange` selects only variables on a given chromosome between given locations.

Functions `madeBEDgraph` and `madeBEDgraphRange` do the same, but create a file in BedGraph format.

### Usage

    madeBED(x, filename)
    madeBEDrange(x, filename, chr, start, end)
    madeBEDgraph(x, filename)
    madeBEDgraphRange(x, filename, chr, start, end)

### Arguments

`x` | Name of MWAS directory (parameter `dirmwas`) or list of RaMWAS parameters as described in the "RW6_param.Rmd" vignette. Try: `vignette("RW6_param","ramwas")`.
`filename` | Name of the BED file to create. If file exists, it's overwritten.
`chr` | Chromosome name or number.
`start` | Start position of the genomic region of interest.
`end` | End position of the genomic region of interest.

### Details

The function returns the MWAS results with locations.

### Value

Returns a data.frame with BED file content:

`chrom` | Chromosome
`chromStart` | Start position
`chromEnd` | End position
`name` | Empty name column. BED format only
`score` | p-value

### Author(s)

Andrey A Shabalin andrey.shabalin@gmail.com

### See Also

See vignettes: `browseVignettes("ramwas")`.

### Examples

    ## Not run:
    # Extract BED file using parameter vector
    madeBED(param, "file.bed")
    madeBEDrange(param, "file.bed", 1, 123321, 223321)

    # Extract BED file using directory name
    madeBED("/data/myMWAS", "file.bed")
    madeBEDrange("/data/myMWAS", "file.bed", 1, 123321, 223321)

    ## End(Not run)

[Package ramwas version 1.18.0 Index]