I am new to Matlab and I am trying to create random DNA sequence generator and so far I only found a way in generating A, C, G, T with equal probabilities, how do I assign different probabilities to each letter? All probabilities must add up to 1.
total_bp=10;
%open file
SeqLength=100;
bases = repmat('ACGT', 1, SeqLength/4);
for i=1:total_bp
%random DNA sequence
SeqLength=100;
Seq = bases(randperm(SeqLength));
display(num2str(Seq))
end
fclose('all');
Aucun commentaire:
Enregistrer un commentaire