matlab - Placing a character randomly in a bio-seq -


Assume that we have a bio_sequence:

  VYDDGYHNGN  

and we are in place of 'random numbers'. In random positions along the sequence, like this:

  .. Vikwaykdeedi ... Jiaik.ac.ankjian ..  
< P> Is there a function or optimal solution for this function in MATLAB?

According to your observations, consider the following that:

  • dots the number of Total is a random integer is divided into the nearest integer equal to 0 and close to 0.2 times the sequence length.
  • Dot spaces are also distributed randomly and evenly.

code:

 % // data seq = 'VYDDGYHNGN'; % // let's do m = numel (seq); % // sequence length = rand ([0 round (.2 * m)]); % / Dot number of dots p = m + n; Result = repeat ('.', 1, p); % // Start the result of all dots results (sort (random command (p, m))) = cec;  
% // place sequence evenly in random posts

Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

python - mayavi mapping a discrete colorbar on a surface -