| Title: | rtemis Bio-informatics |
|---|---|
| Description: | Bio-informatics utilities extending rtemis package. |
| Authors: | E.D. Gennatas [aut, cre] (ORCID: <https://orcid.org/0000-0001-9280-3609>) |
| Maintainer: | E.D. Gennatas <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.4.2 |
| Built: | 2026-05-13 00:20:31 UTC |
| Source: | https://github.com/rtemis-org/rtemis.bio |
Bioinformatics utilities
Maintainer: E.D. Gennatas [email protected] (ORCID)
Useful links:
Perform amino acid substitutions
aa_sub(x, substitutions, verbosity = 1L)aa_sub(x, substitutions, verbosity = 1L)
x |
Character vector: Amino acid sequence. e.g. |
substitutions |
Character vector: Substitutions to perform in the format
"OriginalPositionNew", e.g. |
verbosity |
Integer: Verbosity level. |
Character vector with substitutions performed.
EDG
Xt objectAggregate method for Xt object
## S3 method for class 'Xt' aggregate( x, groupname, fn = mean, backend = getOption("rtemis_backend", "base"), ... )## S3 method for class 'Xt' aggregate( x, groupname, fn = mean, backend = getOption("rtemis_backend", "base"), ... )
x |
|
groupname |
Character: Grouping variable. |
fn |
Function: Function to apply to each group. |
backend |
Character: "base", "data.table", or "dplyr"; backend to use for aggregation. |
... |
Additional arguments passed to |
EDG
as_A3
as_A3(x)as_A3(x)
x |
List: Named list with elements |
A3 object.
EDG
as_Xt
as_Xt(x)as_Xt(x)
x |
Object to convert to |
Xt object.
EDG
A3 objectCreates an A3 object given amino acid sequence and annotations.
create_A3( sequence, site = NULL, region = NULL, ptm = NULL, cleavage_site = NULL, variant = NULL, uniprotid = NULL, description = NULL, reference = NULL )create_A3( sequence, site = NULL, region = NULL, ptm = NULL, cleavage_site = NULL, variant = NULL, uniprotid = NULL, description = NULL, reference = NULL )
sequence |
Character: Amino acid sequence. |
site |
Named list of vectors of integer indices of sites, e.g.
|
region |
Named list of integer indices,
e.g. |
ptm |
Named list of vectors with indices of post-translational modifications, e.g.
|
cleavage_site |
Named list of cleavage sites, e.g.
|
variant |
List of lists with variant information. Each list must contain a
|
uniprotid |
Character: Uniprot ID. |
description |
Character: Description of the data / experiment. |
reference |
Character: Link to reference (journal publication, preprint, etc.) |
We choose to keep NULL elements as empty lists in JSON, since we want users to be able to easily add annotations, whether programmaticaly, using a web app, or manually.
A3 object
EDG
Xt objectCreates an Xt object from time series data.
create_Xt( x, y, x2 = NULL, y2 = NULL, zt = NULL, shade = NULL, group = NULL, xunits = NULL, yunits = NULL, y2units = NULL, description = NULL, reference = NULL )create_Xt( x, y, x2 = NULL, y2 = NULL, zt = NULL, shade = NULL, group = NULL, xunits = NULL, yunits = NULL, y2units = NULL, description = NULL, reference = NULL )
x |
Named list of datetime vectors. |
y |
Named list of numeric vectors: When plotted, these will correspond to the left y-axis. |
x2 |
Named list of datetime vectors: When plotted, these will correspond to the
right x-axis. If not provided, |
y2 |
Named list of numeric vectors: When plotted, these will correspond to the right y-axis. |
zt |
Numeric vector: Zeitgeber time. If provided, this will be used to label x-axis ticks.
Assumes a single datetime vector in |
shade |
Binary vector: |
group |
Named list of factors: Grouping variable(s). |
xunits |
Character: Units for |
yunits |
Character: Units for |
y2units |
Character: Units for |
description |
Character: Description of the data / experiment. |
reference |
Character: Link to reference (journal publication, preprint, etc.) |
Xt object
EDG
Get the sequence of a gene
gene2sequence( gene, organism = "hsapiens", biomart = "ensembl", host = "https://www.ensembl.org", seq_type = "coding", verbosity = 1L )gene2sequence( gene, organism = "hsapiens", biomart = "ensembl", host = "https://www.ensembl.org", seq_type = "coding", verbosity = 1L )
gene |
Character: Gene name. |
organism |
Character: Organism name. |
biomart |
Character: Biomart name. |
host |
Character: Host address. |
seq_type |
Character: Sequence type to retrieve. See biomaRt::getSequence. |
verbosity |
Integer: Verbosity level. |
data.frame with columns "gene", "ensembl_transcript_id" and "sequence".
EDG
Get AlphaFold info for a given UniProt ID
get_alphafold(uniprotid)get_alphafold(uniprotid)
uniprotid |
Character: UniProt ID. |
data frame with AlphaFold info.
EDG
Xt objectCalculates light/dark ratio for each y and y2 timeseries in an Xt object.
light_dark_ratio( x, groupname = "Lights", fn = mean, backend = getOption("rtemis_backend", "data.table"), ... )light_dark_ratio( x, groupname = "Lights", fn = mean, backend = getOption("rtemis_backend", "data.table"), ... )
x |
|
groupname |
Character: Grouping variable. |
fn |
Function: Function to apply to each group. |
backend |
Character: "base", "data.table", or "dplyr"; backend to use for aggregation. |
... |
Additional arguments passed to |
data.frame with columns for group and summary statistic.
EDG
A3 objectPlot method for A3 object
## S3 method for class 'A3' plot(x, ...)## S3 method for class 'A3' plot(x, ...)
x |
|
... |
Additional arguments passed to rtemis::draw_protein. |
plotly object.
EDG
Xt objectPlot method for Xt object
## S3 method for class 'Xt' plot(x, ...)## S3 method for class 'Xt' plot(x, ...)
x |
|
... |
Additional arguments passed to rtemis::draw_xt. |
plotly object.
EDG
A3 object from JSON fileRead A3 object from JSON file
read_A3json(filepath, verbosity = 0L)read_A3json(filepath, verbosity = 0L)
filepath |
Character: Path to JSON file. |
verbosity |
Integer: if greater than 0, print messages. |
A3 object.
EDG
Xt object from JSON fileRead Xt object from JSON file
read_Xtjson(filepath, verbosity = 0L)read_Xtjson(filepath, verbosity = 0L)
filepath |
Character: Path to JSON file. |
verbosity |
Integer: if greater than 0, print messages. |
Note that factors saved under group are written as character by write_Xtjson and
when they are read back in, they are converted back to factors using factor. This means that
the levels will be set alphabetically. If needed, reorder them after reading in the JSON file
using factor.
Xt object.
EDG
A3 objectSummary method for A3 object
## S3 method for class 'A3' summary(object, ...)## S3 method for class 'A3' summary(object, ...)
object |
|
... |
Not used |
Called for side effects, prints summary to console.
EDG
Get protein sequence from UniProt
uniprot_get( accession, baseURL = "https://rest.uniprot.org/uniprotkb", verbosity = 1L )uniprot_get( accession, baseURL = "https://rest.uniprot.org/uniprotkb", verbosity = 1L )
accession |
Character: UniProt Accession number - e.g. "Q9UMX9". |
baseURL |
Character: UniProt rest API base URL. |
verbosity |
Integer: Verbosity level. |
List with three elements: Identifier, Annotation, and Sequence.
E.D. Gennatas
## Not run: mapt <- uniprot_get("Q9UMX9") ## End(Not run)## Not run: mapt <- uniprot_get("Q9UMX9") ## End(Not run)
A3 object to JSON fileWrite A3 object to JSON file
write_A3json(x, filepath, overwrite = FALSE)write_A3json(x, filepath, overwrite = FALSE)
x |
|
filepath |
Character: Path to save JSON file. |
overwrite |
Logical: If TRUE, overwrite existing file. |
Nothing. Writes JSON file.
EDG
Xt object to JSON fileWrite Xt object to JSON file
write_Xtjson(x, filepath, overwrite = FALSE)write_Xtjson(x, filepath, overwrite = FALSE)
x |
|
filepath |
Character: Path to save JSON file. |
overwrite |
Logical: If TRUE, overwrite existing file. |
Nothing. Writes JSON file.
EDG