Search code examples
ralignmentsequencebioconductorsequence-alignment

Print sequence alignment to file


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] ATTGGCGGCCGCGCCACCATGCCAGAGCCAGCGAAGTCTGCTCCCGCCCCG...GAAGGCTGTATGCTGTTGTCTTCAAGATCTGGTACCGCTGGGTTGATATC 
score: -29418.8

How can I output the complete alignment to a text file?


Solution

  • Here is a link to the discussion on the bioconductor mailing list. So far there is no easy way to print the alignment formatted, but maybe it's worth implementing.

    https://stat.ethz.ch/pipermail/bioconductor/2012-April/044904.html