Aligning genomic length sequence with DECIPHER can be done using the following steps:
- Load in the libraries and genome sequences:
library(DECIPHER)
long_seqs <- readDNAStringSet(file.path(getwd(), "datasets", "ch3", "plastid_genomes.fa")) long_seqs
- Prepare the sequences in a local database:
Seqs2DB(long_seqs, "XStringSet", "long_db", names(long_seqs))
- Find the blocks of synteny:
synteny <- FindSynteny("long_db")
pairs(synteny)
This will create a dotplot of syntenic blocks.
- Plot the syntenic blocks:
plot(synteny)
- Now, make an actual alignment:
alignment <- AlignSynteny(synteny, "long_db")
- And save the pairwise alignments one-by-one:
blocks <- unlist(alignment[[1]]) writeXStringSet(blocks, "genome_blocks_out.fa")