This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Randomising the content of a site in a nucleotide alignment without altering composition

Hi everyone,

I have a DNA sequence alignment in a .fasta format that I'd like to read in using R, choose one of a given set of variant sites (columns if we think of a DNA sequence alignment as a matrix where rows are sequences), and then randomise this site x times to produce x alignments that are identical with the exception of the 'shuffling' of the site of interest.

What is important here is that I'd like to keep the base composition of the given site. For example, if a given site has a 'C' frequency of 0.7 and a 'T' frequency of 0.3, I would like to retain this. All I want to do is shuffle which sequences have which nucleotide.

Does anyone know of a software package that can do this? Or alternatively of a quick way in R that I can isolate the colum of interest and simply rearrange its contents in a random way?

Thank you

r sequence

0 answers

No answers yet.

Log in to answer this question.