How do I generate a random dna sequence without specific codons?
6 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Akira Agata
2018 年 3 月 7 日
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 件のコメント
Akira Agata
2018 年 3 月 7 日
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'});
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!