Align a list of DNA sequence, extract only positions with SNPs for conpact view?
Entering edit mode
Vang Le ▴ 80
Last seen 3.5 years ago

I import data from JSON file which contain squence names and DNA sequences, and other things. How do I make multisequence alignment, extracts positions that has SNPs (flanking each end of a SNP with some character, 'N' or '-' for easy differentiation), and visual the alignment in a graph (i.e. ggplot)?

msa Biostrings • 1.0k views
Entering edit mode
UBodenhofer ▴ 290
Last seen 9 months ago
University of Applied Sciences Upper Au…

As you correctly point out, the pipeline you have in mind consists of three steps:

  • I suggest you try the 'rjson' package to read your JSON file. How to do that exactly depends on the actual format of your JSON file.
  • Suppose you have read the JSON file such that you finally have a named character vector x. You can use the 'msa' package and either run msa(x, type="dna") or something like msa(DNAStringSet(x)). (use the method argument to choose between the three different alignment algorithms; the default is ClustalW)
  • Once you have an alignment, you can start analyzing SNPs. Do I interpret your question correctly that you have previously unknown sequences (e.g. from a previously not sequenced species) and you want to identify novel SNP locations from sequences? If so, I am not aware of any Bioconductor package for doing that, but there might be other tools that are available freely.
Entering edit mode

msa (clsutalW) is sluggish. For now I subset alignment from the aligned fasta file which as aligned with mafft outside. Tried several papckages but wrapper for mafft is not straight to use.

You are correct about new SNPs. I

Entering edit mode

The 'msa' package also supports ClustalOmega and MUSCLE (as said, you can use the method argument to select one of the three algorithms). If you use a different algorithm outside of R/Bioconductor anyway (mafft, as you mentioned), then I suppose that R/Bioconductor would not be of great help to you.


Login before adding your answer.

Traffic: 547 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6