I do a simple pairwise DNA sequence alignment with pairwiseAlignment from the Biostrings package in Bioconductor:
library('Biostrings')
seq1 = 'ATGCTA'
seq2 = 'ATGTA'
pairwiseAlignment(pattern = seq1, subject = seq2)
The output looks as follows:
Global PairwiseAlignedFixedSubject (1 of 1)
pattern: [1] ATGCTA
subject: [1] ATG-TA
score: -4.091219
For very long sequences, the output is truncated and only one line is shown:
Global PairwiseAlignedFixedSubject (1 of 1)
pattern: [1] AT-----------------------------...----------------TGTCTTCCAKATCTGGCGCGCCTGGGTTGATATC
subject: [1] ATTGGCGGCCGCGCCACCATGCCAGAGCCAG...GAAGGCTGTATGCTGTTGTCTTCAAGATCTGGTACCGCTGGGTTGATATC
score: -29418.8
How can I output the complete alignment to a text file?
Looking briefly to your long alignment shows an AT base pair much closer to the rest of the sequence. In fact alignment start at 1 for each sequence. Question to anyone: how to avoid such a suboptimal alignment ?