Title: | R wrapper for Progenetix |
---|---|
Description: | The package is an R wrapper for Progenetix REST API built upon the Beacon v2 protocol. Its purpose is to provide a seamless way for retrieving genomic data from Progenetix database—an open resource dedicated to curated oncogenomic profiles. Empowered by this package, users can effortlessly access and visualize data from Progenetix. |
Authors: | Hangjia Zhao [aut, cre] , Michael Baudis [aut] |
Maintainer: | Hangjia Zhao <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.3.0 |
Built: | 2024-10-30 09:30:58 UTC |
Source: | https://github.com/bioc/pgxRpi |
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
This function retrieves available filters in the Progenetix database via the Beacon v2 API.
pgxFilter( prefix = NULL, return_all_prefix = FALSE, domain = "http://progenetix.org", entry_point = "beacon" )
pgxFilter( prefix = NULL, return_all_prefix = FALSE, domain = "http://progenetix.org", entry_point = "beacon" )
prefix |
A string specifying the prefix of filters, such as 'NCIT'. Default is NULL, which means that all available filters will be returned. When specified, it returns all filters with the specified prefix. |
return_all_prefix |
A logical value determining whether to return all valid prefixes of filters used in database.
If TRUE, the |
domain |
A string specifying the domain of the query data resource. Default is "http://progenetix.org". |
entry_point |
A string specifying the entry point of the Beacon v2 API. Default is "beacon", resulting in the endpoint being "http://progenetix.org/beacon". |
Filter terms used in the data resource that you query.
pgxFilter(prefix = "NCIT")
pgxFilter(prefix = "NCIT")
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 columns and rows 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 = NULL, dataset = NULL, codematches = FALSE, save_file = FALSE, filename = "variant", num_cores = 1, domain = "http://progenetix.org", entry_point = "beacon" )
pgxLoader( type = NULL, output = NULL, biosample_id = NULL, individual_id = NULL, filters = NULL, limit = 0, skip = NULL, dataset = NULL, codematches = FALSE, save_file = FALSE, filename = "variant", num_cores = 1, domain = "http://progenetix.org", entry_point = "beacon" )
type |
A string specifying output data type. Available options are "biosamples", "individuals", "analyses", "g_variants", "cnv_frequency", "cnv_fraction", and "sample_count". The options "biosamples", "individuals", and "analyses" return corresponding information. "g_variants" returns variants data. The options "cnv_frequency", "cnv_fraction" and "sample_count" are based on data in Progenetix, returning precomputed CNV frequency, CNV fraction per sample, and the count of samples for the given filter, respectively. |
output |
A string specifying output data format. The available options depend on 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 c("NCIT:C7376", "PMID:22824167").
When multiple filters are used, they are combined using AND logic when the parameter |
limit |
Integer to specify the number of returned profiles. Default is 0 (return all). |
skip |
Integer to specify the number of skipped profiles. E.g. if skip = 2, limit=500, the first 2*500 =1000 profiles are skipped and the next 500 profiles are returned. Default is NULL (no skip). |
dataset |
A string specifying the dataset to query from the Beacon response. Default is NULL, which includes results from all datasets. |
codematches |
A logical value determining whether to exclude samples from child concepts of specified filters in the ontology tree.
If TRUE, only samples exactly matching the specified filters will be included. Do not use this parameter when |
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. Only used if the parameter |
num_cores |
Integer to specify the number of cores used for the variant query. Only used when the parameter |
domain |
A string specifying the domain of the query data resource. Default is "http://progenetix.org". |
entry_point |
A string specifying the entry point of the Beacon v2 API. Default is "beacon", resulting in the endpoint being "http://progenetix.org/beacon". |
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)