generate random DNA sequence

I would like to randomly generate a set of 7-bases DNA sequences with a weighted probability. I want to have 20 sequences.
I code it as
for i=20
R_1{i}= randsample('ACGT',1,true,[1 0 0 0]);
R_2{i}= randsample('ACGT',1,true,[0.5 0 0.5 0]);
R_3{i}= randsample('ACGT',1,true,[0.25 0.25 0.25 0.25]);
R_4{i}= randsample('ACGT',1,true,[0.5 0 0 0.5]);
R_5{i}= randsample('ACGT',1,true,[0 0 0 1]);
R_6{i}= randsample('ACGT',1,true,[0.5 0 0 0.5]);
R_7{i}= randsample('ACGT',1,true,[0.5 0 0.5 0]);
end
But, it turns out that each cell has no string.
How can I code it correctly? In addition, how can I concatenate them into a single string as a DNA sequence?

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 7 月 1 日

0 投票

You wrote
for i=20
which should have been
for i = 1 : 20

カテゴリ

ヘルプ センター および File ExchangeGenomics and Next Generation Sequencing についてさらに検索

製品

タグ

質問済み:

2016 年 7 月 1 日

回答済み:

2016 年 7 月 1 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by