snps.from.file: Import SNPs from a BED file or VCF file for use in...

View source: R/locus.from.rsid.R

snps.from.fileR Documentation

Import SNPs from a BED file or VCF file for use in motifbreakR

Description

Import SNPs from a BED file or VCF file for use in motifbreakR

Usage

snps.from.file(
  file = NULL,
  dbSNP = NULL,
  search.genome = NULL,
  format = "bed",
  indels = FALSE,
  biomart.dataset = NULL,
  check.unnamed.for.rsid = FALSE
)

variants.from.file(
  file = NULL,
  dbSNP = NULL,
  search.genome = NULL,
  biomart.dataset = NULL,
  format = "bed"
)

Arguments

file

Character; a character containing the path to a bed file or a vcf file see Details for a description of the required format

dbSNP

OPTIONAL; an object of class SNPlocs to lookup rsids; see availible.SNPs in injectSNPs to check for availible SNPlocs

search.genome

an object of class BSgenome for the species you are interrogating; see available.genomes for a list of species

format

Character; one of bed or vcf

indels

Logical; allow the import of indels.

biomart.dataset

a Mart object from useEnsembl specifying the snps biomart, which dataset i.e., hsapiens_snp, and which version i.e., 111 or GRCm39. This will override SNPlocs and must be compatible with search.genome selection, and will query from biomaRt, which may be considerably faster than a lookup from a SNPlocs object.

check.unnamed.for.rsid

Logical; check snps in the form chr:pos:ref:alt for corresponding rsid, lookup may be slow, requires either param dbSNP or biomart.dataset.

Details

snps.from.file takes a character vector describing the file path to a bed file that contains the necissary information to generate the input for motifbreakR see http://www.genome.ucsc.edu/FAQ/FAQformat.html#format1 for a complete description of the BED format. Our convention deviates in that there is a required format for the name field. name is defined as chromosome:start:REF:ALT or the rsid from dbSNP (if you've included the optional SNPlocs argument). For example if you were to include rs123 in it's alternate format it would be entered as chr7:24966446:C:A

Value

a GRanges object containing:

SNP_id

The rsid of the snp with the "rs" portion stripped

alleles_as_ambig

THE IUPAC ambiguity code between the reference and alternate allele for this SNP

REF

The reference allele for the SNP

ALT

The alternate allele for the SNP

Functions

  • variants.from.file(): Allows the use of indels by default

See Also

See motifbreakR for analysis; See snps.from.rsid for an alternate method for generating a list of variants.

Examples

 library(BSgenome.Drerio.UCSC.danRer7)
 library(SNPlocs.Hsapiens.dbSNP155.GRCh37)
 snps.bed.file <- system.file("extdata", "danRer.bed", package = "motifbreakR")
 # see the contents
 read.table(snps.bed.file, header = FALSE)
 #import the BED file
 snps.mb <- snps.from.file(snps.bed.file,
                           search.genome = BSgenome.Drerio.UCSC.danRer7,
                           format = "bed")


Simon-Coetzee/motifBreakR documentation built on Aug. 6, 2024, 5:17 a.m.