View source: R/par-01-parSeqSim.R
parSeqSim | R Documentation |
Parallel calculation of protein sequence similarity based on sequence alignment.
parSeqSim(
protlist,
cores = 2,
batches = 1,
verbose = FALSE,
type = "local",
submat = "BLOSUM62",
gap.opening = 10,
gap.extension = 4
)
protlist |
A length |
cores |
Integer. The number of CPU cores to use for parallel execution,
default is |
batches |
Integer. How many batches should we split the pairwise similarity computations into. This is useful when you have a large number of protein sequences, enough number of CPU cores, but not enough RAM to compute and fit all the pairwise similarities into a single batch. Defaults to 1. |
verbose |
Print the computation progress?
Useful when |
type |
Type of alignment, default is |
submat |
Substitution matrix, default is |
gap.opening |
The cost required to open a gap of any length in the alignment. Defaults to 10. |
gap.extension |
The cost to extend the length of an existing gap by 1. Defaults to 4. |
A n
x n
similarity matrix.
Nan Xiao <https://nanx.me>
See parSeqSimDisk
for the disk-based version.
## Not run:
# Be careful when testing this since it involves parallelization
# and might produce unpredictable results in some environments
library("Biostrings")
library("foreach")
library("doParallel")
s1 <- readFASTA(system.file("protseq/P00750.fasta", package = "protr"))[[1]]
s2 <- readFASTA(system.file("protseq/P08218.fasta", package = "protr"))[[1]]
s3 <- readFASTA(system.file("protseq/P10323.fasta", package = "protr"))[[1]]
s4 <- readFASTA(system.file("protseq/P20160.fasta", package = "protr"))[[1]]
s5 <- readFASTA(system.file("protseq/Q9NZP8.fasta", package = "protr"))[[1]]
plist <- list(s1, s2, s3, s4, s5)
(psimmat <- parSeqSim(plist, cores = 2, type = "local", submat = "BLOSUM62"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.