How do I generate a random dna sequence without specific codons?
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all,
I am trying to figure out how to use randseq to generate a random dna sequence that excludes stop codons TAG, TAA, and TGA. I think it has to do with 'Case', but I am having difficulty finding information elsewhere.
Thank you!
0 Commenti
Risposte (1)
Akira Agata
il 7 Mar 2018
randseq function does not have the option to exclude stop codons. The following is one possible solution to generate random sequence without stop codons.
% List of all possible combination
C = {'A','T','G','C'};
[x,y,z] = meshgrid(C,C,C);
list = strcat(x(:), y(:), z(:));
% Delete stop codons from the list
idx = ismember(list,{'TAG','TAA','TGA'});
list(idx) = [];
% Generate random sequence with N codons
N = 10;
idx = randi([1 numel(list)],1,N);
randSeq = [list{idx}];
The result is:
>> randSeq
randSeq =
'TGCATTTACAATGCCTCTCTAATTGAGCGT'
1 Commento
Akira Agata
il 7 Mar 2018
More simple solution is to use randseq function and erase stop codons, like the following. But please note that this solution can not guarantee the output sequence length.
% Generate random sequence
randSeq = randseq(60);
% Erase stop codons
randSeq = erase(randSeq,{'TAG','TAA','TGA'});
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!