blat2exons: Take coordinates of blat matches and split into a single line...

View source: R/dna.R

blat2exonsR Documentation

Take coordinates of blat matches and split into a single line for each exon

Description

Take coordinates of blat matches and split into a single line for each exon

Usage

blat2exons(
  chroms,
  names,
  starts,
  ends,
  strands = rep("+", length(names)),
  lengths = TRUE,
  extraCols = NULL,
  extraSplits = NULL,
  prefix = "ex",
  adjustStart = 0
)

Arguments

chroms

Chromosome or other identifier

names

Name of gene of other container of exons

starts

Start coordinates of exons

ends

End coordinates of exons if lengths is FALSE or length of exon if lengths is TRUE

strands

Strand (for numbering exons in reverse on - strand)

lengths

logical whether ends are end coordinates or lengths

extraCols

a dataframe of extra columns (1 per batch of starts) to be added to the output

extraSplits

a dataframe of extra comma-separated values (1 string of comma separated values per batch of starts, 1 value per start-stop pair) to be added to the output

prefix

prefix to be added to exon names

adjustStart

add adjustStart to starts (good for 0 index start, 1 index ends of UCSC)

Value

data.frame with a row for each exon or piece of alignment and columns chrom, name, exonName, start, end and strand

Examples

blat2exons(
  c('chr1','chr1','chr2'),
  c('read1','read2','read1'),
  c('1,100','50,150,300','1000,2000,3000'),
  c('20,200','50,50,100','999,999,1234'),
  c('+','-','+')
)

sherrillmix/dnar documentation built on July 18, 2022, 10:07 p.m.