% window_toad % Dirk Husmeier % August 2003 % This program moves a window of specified length % and with a specified step size along the % sequence alignment. For each window position the % program computes and plots the % - average proportion of topology-defining sites, % - average proportion of sites supporting topology 1, % - average proportion of sites supporting topology 2, % - average proportion of sites supporting topology 3. clf clear load topos.in % Vector of topology labels load topoDefSites.in % Vector of topo def sites Nmax= input('Length of the alignment?'); WIN= input('Window size?') STEP= input('Step size?') Nsteps= floor((Nmax-WIN)/STEP)-1; % Number of different window positions for i=1:Nsteps t_left=(i-1)*STEP+1; t_right= t_left-1+WIN; t_position(i)=t_left-1+WIN/2; % Binary indicator vector of topo def sites in window TopoDefSitesInWin=(topoDefSites>=t_left).*(topoDefSites=t_left)*(topoDefSites