% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/locus.from.rsid.R
\name{snps.from.file}
\alias{snps.from.file}
\title{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")
}
\arguments{
\item{file}{Character; a character containing the path to a bed file or a vcf file
see Details for a description of the required format}

\item{dbSNP}{OPTIONAL; an object of class SNPlocs to lookup rsids; see \code{availible.SNPs} in
\code{\link[BSgenome]{injectSNPs}} to check for availible SNPlocs}

\item{search.genome}{an object of class BSgenome for the species you are interrogating;
see \code{\link[BSgenome]{available.genomes}} for a list of species}

\item{format}{Character; one of \code{bed} or \code{vcf}}
}
\value{
a GRanges object containing:
 \item{SNP_id}{The rsid of the snp with the "rs" portion stripped}
 \item{alleles_as_ambig}{THE IUPAC ambiguity code between the reference and
 alternate allele for this SNP}
 \item{REF}{The reference allele for the SNP}
 \item{ALT}{The alternate allele for the SNP}
}
\description{
Import SNPs from a BED file or VCF file for use in motifbreakR
}
\details{
\code{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
 \code{motifbreakR} see \url{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.  \code{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
}
\examples{
library(BSgenome.Drerio.UCSC.danRer7)
 library(SNPlocs.Hsapiens.dbSNP.20120608)
 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")
}
\seealso{
See \code{\link{motifbreakR}} for analysis; See \code{\link{snps.from.rsid}}
  for an alternate method for generating a list of variants.
}

