df <- data.frame(CHROM = c("A", "B"),
POS = c(234, 240),
REF = c("G", "A"),
ALT = c("A", "G")
)
sizes <- data.frame(segment = c("A", "B"),
SegmentSize = c(2280, 2274)
)
df
sizes
# Add a new column of sizes of the segments which are necessary for
# downstream calculations such as transition:transversion (tstv) and dNdS.
add_metadata(df, sizes, c('CHROM'), c('segment'))
Run the code above in your browser using DataLab