R/convert.genes.to.GRanges.R

Defines functions convert.genes.to.GRanges

# Given a set of genes from the get.MGI.features() function, convert them
# to GRanges.
convert.genes.to.GRanges <- 
function(mgi) {

  if(is.null(mgi)) {
    stop("convert.genes.to.GRanges: mgi cannot be null.")
  } # if(is.null(mgi))

  gr = GRanges(seqnames = mgi$seqid, ranges = IRanges(start = mgi$start,
         end = mgi$stop))
  metadata(gr) = list(Name = mgi$Name)

  return(gr)
}

Try the SNPtools package in your browser

Any scripts or data that you put into this service are public.

SNPtools documentation built on May 29, 2017, 3:12 p.m.