| annotate | R Documentation |
Finds the overlap between a gene annotation file and a recurrent CNV file using genomic ranges, and annotates each CNV region with the corresponding gene symbol. Requires the GenomicRanges package.
annotate(
genes_file,
risk_file,
output_dir = ".",
seqnames_field_genes = "Chr",
start_field_genes = "Start",
end_field_genes = "End",
gene_symbol_field = "GeneSymbol",
seqnames_field_risk = "Chr",
start_field_risk = "Start",
end_field_risk = "End",
sample_field = "Sample",
segment_mean_field = "Segment_Mean"
)
genes_file |
Character. Path to the gene annotation CSV file. Must contain chromosome, start, end, and gene symbol columns (see parameters below for defaults). |
risk_file |
Character. Path to the recurrent CNV CSV file (e.g.,
the file path returned by |
output_dir |
Character. Directory where the annotated CSV will be
saved. Default is the current directory ( |
seqnames_field_genes |
Character. Column name for chromosome in
the gene file. Default is |
start_field_genes |
Character. Column name for start position in
the gene file. Default is |
end_field_genes |
Character. Column name for end position in the
gene file. Default is |
gene_symbol_field |
Character. Column name for gene symbols in
the gene file. Default is |
seqnames_field_risk |
Character. Column name for chromosome in
the CNV file. Default is |
start_field_risk |
Character. Column name for start position in
the CNV file. Default is |
end_field_risk |
Character. Column name for end position in the
CNV file. Default is |
sample_field |
Character. Column name for sample IDs in the CNV
file. Default is |
segment_mean_field |
Character. Column name for segment mean
values in the CNV file. Default is |
This function uses GenomicRanges::findOverlaps with
type = "within" to find genes that fall entirely within each
CNV region. This function is cancer-type agnostic and can be applied
to CNV data from any solid tumour with a compatible gene annotation
reference file.
A data frame containing annotated CNV regions with columns:
Sample, GeneSymbol, Segment_Mean, Chr,
Start, End. The result is also written to a timestamped
CSV file in output_dir.
genes_file <- system.file("extdata", "gene_annotation.csv",
package = "RiskyCNV")
cnv_file <- system.file("extdata", "annotated_cnv.csv",
package = "RiskyCNV")
annotated <- annotate(
genes_file = genes_file,
risk_file = cnv_file,
output_dir = tempdir()
)
head(annotated)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.