Title: | rtemis Bio-informatics |
---|---|
Description: | Bio-informatics utilities |
Authors: | E.D. Gennatas [aut, cre] |
Maintainer: | E.D. Gennatas <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.2.2 |
Built: | 2024-10-27 23:14:48 UTC |
Source: | https://github.com/egenn/rtemisbio |
Bioinformatics utilities
Maintainer: E.D. Gennatas [email protected] (ORCID)
a3
objectCreates an a3
object given amino acid sequence and annotations.
a3( seq, site = NULL, region = NULL, ptm = NULL, clv = NULL, variant = NULL, uniprotid = NULL, description = NULL, reference = NULL )
a3( seq, site = NULL, region = NULL, ptm = NULL, clv = NULL, variant = NULL, uniprotid = NULL, description = NULL, reference = NULL )
seq |
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.
|
clv |
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
Perform amino acid substitutions
aa_sub(x, substitutions, verbosity = 1)
aa_sub(x, substitutions, verbosity = 1)
x |
Character or charactr vector: Amino acid sequence. e.g. |
substitutions |
Character vector: Substitutions to perform in the format
"OriginalPositionNew", e.g. |
Character vector with substitutions performed.
EDG
xt
objectAggregate method for xt
object
## S3 method for class 'xt' aggregate( x, groupname, fn = mean, backend = getOption("rt.backend", "base"), ... )
## S3 method for class 'xt' aggregate( x, groupname, fn = mean, backend = getOption("rt.backend", "base"), ... )
x |
|
fn |
Function: Function to apply to each group. |
backend |
Character: "base", "data.table", or "dplyr"; backend to use for aggregation. |
... |
Additional arguments passed to |
group |
Character: Grouping variable. |
EDG
as.a3
as.a3(x)
as.a3(x)
x |
Object to convert to |
a3
object.
EDG
as.a3
## Default S3 method: as.a3(x)
## Default S3 method: as.a3(x)
x |
Object to convert to |
a3
object.
EDG
as.a3.list method
## S3 method for class 'list' as.a3(x)
## S3 method for class 'list' 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
as.xt
## Default S3 method: as.xt(x)
## Default S3 method: as.xt(x)
x |
Object to convert to |
xt
object.
EDG
as.xt.list method
## S3 method for class 'list' as.xt(x)
## S3 method for class 'list' as.xt(x)
x |
List: Named list with elements |
xt
object.
EDG
Get the sequence of a gene
gene2sequence( gene, organism = "hsapiens", biomart = "ensembl", host = "https://www.ensembl.org", seq_type = "coding", verbosity = 1 )
gene2sequence( gene, organism = "hsapiens", biomart = "ensembl", host = "https://www.ensembl.org", seq_type = "coding", verbosity = 1 )
gene |
Character: Gene name. |
organism |
Character: Organism name. |
biomart |
Character: Biomart name. |
host |
Character: Host address. |
data.frame with columns "gene", "ensembl_transcript_id" and "sequence".
EDG
Convert integer range to character with colon separator
int2range(x)
int2range(x)
x |
Integer vector. Must be consecutive integers from lowest to highest. |
Character with colon separator.
EDG
## Not run: x <- 34:42 int2range(x) int2range(28:34) int2range(c(3, 4, 5, 6)) # This will throw an error: int2range(c(3, 4, 5, 6, 8)) ## End(Not run)
## Not run: x <- 34:42 int2range(x) int2range(28:34) int2range(c(3, 4, 5, 6)) # This will throw an error: int2range(c(3, 4, 5, 6, 8)) ## End(Not run)
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("rt.backend", "data.table"), ... )
light_dark_ratio( x, groupname = "Lights", fn = mean, backend = getOption("rt.backend", "data.table"), ... )
x |
|
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::dplot3_protein. |
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::dplot3_xt. |
EDG
a3
objectPrint method for a3
object
## S3 method for class 'a3' print(x, head.n = 10, ...)
## S3 method for class 'a3' print(x, head.n = 10, ...)
x |
|
... |
Not used. |
EDG
xt
objectPrint method for xt
object
## S3 method for class 'xt' print(x, head.n = 10, ...)
## S3 method for class 'xt' print(x, head.n = 10, ...)
x |
|
... |
Not used. |
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 |
|
EDG
xt
objectCreates an xt
object from time series data.
toxt( x, y, x2 = NULL, y2 = NULL, zt = NULL, shade = NULL, group = NULL, xunits = NULL, yunits = NULL, y2units = NULL, description = NULL, reference = NULL )
toxt( 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 protein sequence from UniProt
uniprot_get( accession, baseURL = "https://rest.uniprot.org/uniprotkb", verbosity = 1 )
uniprot_get( accession, baseURL = "https://rest.uniprot.org/uniprotkb", verbosity = 1 )
accession |
Character: UniProt Accession number - e.g. "Q9UMX9" |
baseURL |
Character: UniProt rest API base URL. Default = "https://rest.uniprot.org/uniprotkb" |
verbose |
Logical: If TRUE, print messages to console |
List with two elements: Annotation & 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. |
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. |
EDG