add_metadata | R Documentation |
Adds metadata information to the vcf dataframe
add_metadata(df, metadf, by_vcf, by_meta)
df |
A rearranged vcf dataframe (arrange_data) |
metadf |
A metadata dataframe |
by_vcf |
A vector of column names in the vcf dataframe that should be used to merge the vcf data with the metadata |
by_meta |
A vector of column names in the metadata dataframe that should be used to merge the metadata with the vcf data |
A vcf dataframe with metadata included
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'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.