Description Usage Arguments Details Value Author(s) Examples
constructs a dataframe where each row corresponds to one index of one protein sequence from the input dataset. It can be used to generate training and test sets to train a NADDA classification model or to predict the conserved indices of input sequences based on a trained model.
1 2 3 |
obj |
A filepath to a fasta file containing protein sequences or an AAStringSet object containing the sequences |
klen |
length of the k-mers to be used |
parallel |
Indicating whether the operation should be performed in parallel |
nproc |
Currently not supported. Will use all processors available to the job on cluster |
normalize |
A boolean value, indicating whether the k-mer frequencies should be normalized |
impute |
A boolean value, indicating whether imputed values should be inserted at the beginning and the end of the profiles |
winlen |
An integer, size the window used for generation of each instance |
imputing_length |
An integer, number of frequencies from the beginning and end of a sequence profile that should be used to impute the new values |
distributed |
A boolean, indicating whether the data is spread among multiple processors. |
If parallel is set to TRUE and distributed is set to FALSE, the method distributes the data between different processors and sets distributed to TRUE. Otherwise, if the parallel is set to FALSE and distributed is set to TRUE, the kmer frequencies are computed on each processor separately but then communicated between each other, and therefore at the end all processors have the same set of frequencies for kmers stored, using which they will generate frequency profiles for their chunk of sequences. If you prefer to run the operation in serial, set both parallel and distributed to FALSE.
Returns a list with one vector for each protein sequence in the dataset. A vector for sequence s contains |s| - klen + 1 indices if impute is set to FALSE (where |s| is the length of the sequence). Otherwise it will include one index for each position in the sequence but also winlen %\% 2 indices at the beginning and end of each sequence.
Armen Abnousi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | library(Biostrings)
library(data.table)
## Generate a set of three example protein sequences
seqs <- AAStringSet(c("seq1"="MLVVD",
"seq2"="PVVRA",
"seq3"="LVVR"))
## Count the kmers and generate a dataframe of the frequencies
profs <- generate_profiles(seqs, klen = 3, parallel = FALSE, winlen = 5, normalize = FALSE)
head(profs)
profs
##[[1]]
##[[1]]$freqs
##[1] 1.5 1.5 1.0 2.0 1.0 1.5 1.5 1.5 1.5
##[[1]]$seq
##[1] "seq1"
##
##[[2]]
##[[2]]$freqs
##[1] 1.5 1.5 1.0 2.0 1.0 1.5 1.5 1.5 1.5
##[[2]]$seq
##[[1]] "seq2"
##
##[[3]]
##[[3]]$freqs
##[1] 2 2 2 2 2 2 2 2
##[[3]]$seq
##[1] "seq3"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.