Annotate a VCF data frame with transcript strand information
Source:R/transcript_strand.R
add_transcript_strand.RdFor each variant, finds overlapping transcripts in trans_ranges via
GenomicRanges::findOverlaps() with type = "within", and appends
columns trans.start.pos, trans.end.pos, trans.strand,
trans.Ensembl.gene.ID, trans.gene.symbol, plus bothstrand (TRUE if
the variant falls on transcripts from both strands) and count (number
of overlapping transcripts).
Arguments
- df
A VCF as a data frame / data.table with columns
CHROM,POS,ALT.- ref_genome
A BSgenome object or a character identifier accepted by
normalize_genome_arg().- trans_ranges
Optional
data.tableof transcript ranges with columnschrom,start,end,strand,Ensembl.gene.ID,gene.symbol. IfNULL, the shipped table forref_genomeis used.- name_of_vcf
Optional VCF name used in warning/error messages.