A dataframe containing cytoband annotation details extracted from the hg19 gennome. It is used for CNV frequency visualization.
hg19_cytoband
hg19_cytoband
An object of class data.frame
with 862 rows and 5 columns.
cytoband of hg19 genome
http://hgdownload.cse.ucsc.edu/goldenpath/hg19/database/cytoBand.txt.gz
A dataframe containing cytoband annotation details extracted from the hg38 gennome. It is used for CNV frequency visualization.
hg38_cytoband
hg38_cytoband
An object of class data.frame
with 862 rows and 5 columns.
cytoband of hg38 genome
http://hgdownload.cse.ucsc.edu/goldenpath/hg38/database/cytoBand.txt.gz
Thie function plots the frequency of deletions and duplications
pgxFreqplot( data, chrom = NULL, layout = c(1, 1), filters = NULL, circos = FALSE, assembly = "hg38" )
pgxFreqplot( data, chrom = NULL, layout = c(1, 1), filters = NULL, circos = FALSE, assembly = "hg38" )
data |
CNV frequency object returned by the |
chrom |
A vector specifying which chromosomes to plot. If NULL, the plot will cover the entire genome. If specified, the frequencies are plotted with one panel for each chromosome. Default is NULL. |
layout |
Number of rows and columns in plot. Only used in plot by chromosome. Default is c(1,1). |
filters |
Index or string value indicating which filter to plot. The length of filters
is limited to one if the parameter |
circos |
A logical value indicating whether to return a circos plot. If TRUE, it returns a circos plot that can display and compare multiple filters. Default is FALSE. |
assembly |
A string specifying the genome assembly version to apply to CNV frequency plotting. Allowed options are "hg19" and "hg38". Default is "hg38". |
The binned CNV frequency plot
## load necessary data (this step can be skipped in real implementation) data("hg38_cytoband") ## get frequency data freq <- pgxLoader(type="cnv_frequency", output ='pgxfreq', filters="NCIT:C3512") ## visualize pgxFreqplot(freq)
## load necessary data (this step can be skipped in real implementation) data("hg38_cytoband") ## get frequency data freq <- pgxLoader(type="cnv_frequency", output ='pgxfreq', filters="NCIT:C3512") ## visualize pgxFreqplot(freq)
This function loads various data from Progenetix
database via the Beacon v2 API with some extensions (BeaconPlus).
pgxLoader( type = NULL, output = NULL, biosample_id = NULL, individual_id = NULL, filters = NULL, limit = 0, skip = 0, dataset = NULL, codematches = FALSE, save_file = FALSE, filename = "variants.tsv", domain = "http://progenetix.org", entry_point = "beacon", num_cores = 1 )
pgxLoader( type = NULL, output = NULL, biosample_id = NULL, individual_id = NULL, filters = NULL, limit = 0, skip = 0, dataset = NULL, codematches = FALSE, save_file = FALSE, filename = "variants.tsv", domain = "http://progenetix.org", entry_point = "beacon", num_cores = 1 )
type |
A string specifying the type of output data. Available options include:
|
output |
A string specifying the format of the output data. The available options depend on the value of the
|
biosample_id |
Identifiers used in the query database for identifying biosamples. |
individual_id |
Identifiers used in the query database for identifying individuals. |
filters |
Identifiers used in public repositories, bio-ontology terms, or custom terms such as |
limit |
Integer to specify the number of returned profiles. Default is |
skip |
An integer specifying the number of profiles to skip. For example, if |
dataset |
Datasets to query from the Beacon response. Default is |
codematches |
A logical value indicating whether to exclude samples from child concepts of the specified filters in the ontology tree.
If |
save_file |
A logical value determining whether to save variant data as a local file instead of direct return. Only used when the parameter |
filename |
A string specifying the path and name of the file to be saved. This parameter is used only when |
domain |
The domain of the query data resource. Default is |
entry_point |
The entry point of the Beacon v2 API. Default is |
num_cores |
An integer specifying the number of cores to use for parallel processing during Beacon v2 phenotypic/meta-data queries from multiple domains or variant data queries from multiple biosamples. Default is |
Data from Progenetix database
## query metadata biosamples <- pgxLoader(type="biosamples", filters = "NCIT:C3512") ## query variants seg <- pgxLoader(type="g_variants", biosample_id = "pgxbs-kftvgx4y") ## query CNV frequency freq <- pgxLoader(type="cnv_frequency", output ='pgxfreq', filters="NCIT:C3512")
## query metadata biosamples <- pgxLoader(type="biosamples", filters = "NCIT:C3512") ## query variants seg <- pgxLoader(type="g_variants", biosample_id = "pgxbs-kftvgx4y") ## query CNV frequency freq <- pgxLoader(type="cnv_frequency", output ='pgxfreq', filters="NCIT:C3512")
This function provides the survival plot from individual metadata.
pgxMetaplot(data, group_id, condition, return_data = FALSE, ...)
pgxMetaplot(data, group_id, condition, return_data = FALSE, ...)
data |
The data frame returned by the |
group_id |
A string specifying which column is used for grouping in the Kaplan-Meier plot. |
condition |
A string for splitting individuals into younger and older groups,
following the ISO 8601 duration format. Only used if |
return_data |
A logical value determining whether to return the metadata used for plotting. Default is FALSE. |
... |
Other parameters relevant to KM plot. These include |
The KM plot from input data
individuals <- pgxLoader(type="individuals",filters="NCIT:C3512") pgxMetaplot(individuals, group_id="age_iso", condition="P65Y")
individuals <- pgxLoader(type="individuals",filters="NCIT:C3512") pgxMetaplot(individuals, group_id="age_iso", condition="P65Y")
This function extracts segment variants, CNV frequency, and metadata from local "pgxseg" files and supports survival data visualization.
pgxSegprocess( file, group_id = "group_id", show_KM_plot = FALSE, return_metadata = FALSE, return_seg = FALSE, return_frequency = FALSE, assembly = "hg38", cnv_column_idx = 6, bin_size = 1e+06, overlap = 1000, soft_expansion = 0.1, ... )
pgxSegprocess( file, group_id = "group_id", show_KM_plot = FALSE, return_metadata = FALSE, return_seg = FALSE, return_frequency = FALSE, assembly = "hg38", cnv_column_idx = 6, bin_size = 1e+06, overlap = 1000, soft_expansion = 0.1, ... )
file |
A string specifying the path and name of the "pgxseg" file where the data is to be read. |
group_id |
A string specifying which id is used for grouping in KM plot or CNV frequency calculation. Default is "group_id". |
show_KM_plot |
A logical value determining whether to return the Kaplan-Meier plot based on metadata. Default is FALSE. |
return_metadata |
A logical value determining whether to return metadata. Default is FALSE. |
return_seg |
A logical value determining whether to return segment data. Default is FALSE. |
return_frequency |
A logical value determining whether to return CNV frequency data. The frequency calculation is based on segments in segment data and specified group id in metadata. Default is FALSE. |
assembly |
A string specifying the genome assembly version to apply to CNV frequency calculation and plotting. Allowed options are "hg19" and "hg38". Default is "hg38". |
cnv_column_idx |
Index of the column specifying the CNV state used for calculating CNV frequency. The index must be at least 6, with the default set to 6. The CNV states should either contain "DUP" for duplications and "DEL" for deletions, or level-specific CNV states represented using Experimental Factor Ontology (EFO) codes. |
bin_size |
Size of genomic bins used in CNV frequency calculation to split the genome, in base pairs (bp). Default is 1,000,000. |
overlap |
Numeric value defining the amount of overlap between bins and segments considered as bin-specific CNV, in base pairs (bp). Default is 1,000. |
soft_expansion |
Fraction of |
... |
Other parameters relevant to KM plot. These include |
Segments data, CNV frequency object, meta data or KM plots from local "pgxseg" files
file_path <- system.file("extdata", "example.pgxseg",package = 'pgxRpi') info <- pgxSegprocess(file=file_path,show_KM_plot = TRUE, return_seg = TRUE, return_metadata = TRUE)
file_path <- system.file("extdata", "example.pgxseg",package = 'pgxRpi') info <- pgxSegprocess(file=file_path,show_KM_plot = TRUE, return_seg = TRUE, return_metadata = TRUE)
Thie function calculates the frequency of deletions and duplications
segtoFreq( data, cnv_column_idx = 6, cohort_name = "unspecified cohort", assembly = "hg38", bin_size = 1e+06, overlap = 1000, soft_expansion = 0.1 )
segtoFreq( data, cnv_column_idx = 6, cohort_name = "unspecified cohort", assembly = "hg38", bin_size = 1e+06, overlap = 1000, soft_expansion = 0.1 )
data |
Segment data containing CNV states. The first four columns should represent sample ID, chromosome, start position, and end position, respectively. The fifth column can contain the number of markers or other relevant information. The column representing CNV states (with a column index of 6 or higher) should either contain "DUP" for duplications and "DEL" for deletions, or level-specific CNV states such as "EFO:0030072", "EFO:0030071", "EFO:0020073", and "EFO:0030068", which correspond to high-level duplication, low-level duplication, high-level deletion, and low-level deletion, respectively. |
cnv_column_idx |
Index of the column specifying the CNV state. Default is 6, based on the "pgxseg" format used in Progenetix.
If the input segment data follows the general |
cohort_name |
A string specifying the cohort name. Default is "unspecified cohort". |
assembly |
A string specifying the genome assembly version for CNV frequency calculation. Allowed options are "hg19" or "hg38". Default is "hg38". |
bin_size |
Size of genomic bins used to split the genome, in base pairs (bp). Default is 1,000,000. |
overlap |
Numeric value defining the amount of overlap between bins and segments considered as bin-specific CNV, in base pairs (bp). Default is 1,000. |
soft_expansion |
Fraction of |
The binned CNV frequency stored in "pgxfreq" format
## load necessary data (this step can be skipped in real implementation) data("hg38_cytoband") ## get pgxseg data seg <- read.table(system.file("extdata", "example.pgxseg",package = 'pgxRpi'),header=TRUE,sep = "\t") ## calculate frequency data freq <- segtoFreq(seg) ## visualize pgxFreqplot(freq)
## load necessary data (this step can be skipped in real implementation) data("hg38_cytoband") ## get pgxseg data seg <- read.table(system.file("extdata", "example.pgxseg",package = 'pgxRpi'),header=TRUE,sep = "\t") ## calculate frequency data freq <- segtoFreq(seg) ## visualize pgxFreqplot(freq)