This is a test version of Biostars. For the public version, visit https://www.biostars.org.
R, msa and sequence alignment progress?

Hi,

I am trying to do some msa using R.

enter image description here

When I try to use clustaW and see my alignment it doesn't show anything. Is that because the file is too big and clustaW is still running? Is there any way to see the progress of the alignment if it is the case?

I am doing the following:

library(msa)

mySequenceFile <- system.file ("sequences", "allSequences.fasta", package ="msa")

mySequence <- readAAStringSet(mySequenceFile)

mySequence <- readDNAStringSet(mySequenceFile)

mySequences

myAlignment <- msa(mySequence, "ClustalW") myAlignment

Thanks

msa clustaw r

1 answer

The information is lacking here. It is not the same aligning 21 sequences that are 500 bp long and 21 sequences that are 30 kb long. I am only guessing, but you seem to be in the latter category. If so, most common alignment programs (such as clustalw) are not meant for aligning sequences of that length, especially if there are many of them.

If you want to get a visual progress update, I suggest you run the commands directly rather than through R interface. Both Clustal Omega (aka, clustalo) and Muscle will produce screen update, and are more recent and likely better aligners than clustalw.

I left the PC running for about 20 minutes and it aligned everything. On the top it was showing R was running stuff and I didn't notice. I will try to align it with Muscle.

What should I use instead of clustaW for this type of sequences?

Thanks

You mean beside clustalo and muscle? Also, you didn't tell us what type of sequences you have.

By type I actually meant size of sequences, so that may have been unclear. As I indicated above, these programs are not meant for aligning very long sequences, and definitely not for aligning large genomes.

Also, I gave you two choices (clustalo and muscle) other than ClustalW. Either one should do a good job and be faster than ClustalW. Are you asking for other options?

By using R:enter image description here

library(seqinr)

library(adegenet)

library(ape)

library(ggtree)

library(DECIPHER)

library(Biostrings)

library(viridis)

library(ggplot2)

library(msa)

mySequenceFile <- system.file ("sequences", "allSequences.fasta", package ="msa")

mySequence <- readDNAStringSet(mySequenceFile)

mySequence

myAlignment <- msa(mySequence, "ClustalOmega")

myAlignment

alignnment <- msaConvert(myAlignment, "seqinr::alignment")

distMatrix <- dist.alignment(alignnment, "similarity")

clustering <- hclust(distMatrix)

plot(clustering)

dendrogram <- as.dendrogram(clustering)

phylotree = as.phylo(clustering)

plot(phylotree, type="radial")

By using BLASTN with an extra sequence vs the all sequences file enter image description here

Nevermind, I actually was being a bit silly and plotting the wrong thing. Managed to get the same tree for the aligned sequences after playing around the trees.

enter image description here

Log in to answer this question.