[BioC] matchTable for pairwiseAlignment in Biostrings?

Valerie Obenchain vobencha at fhcrc.org
Thu Aug 22 22:38:05 CEST 2013


Hi Brian,

I don't know of a function that creates such a table but I think you can 
create this with the start() and end() accessors.

pat <- DNAStringSet(c("CACCAGCT", "TTCGCC", "CGGTC"))
sub <- DNAString("ACTTCACCAGCTGACCTCG")
res <- pairwiseAlignment(pat, sub)

 > res
Global PairwiseAlignmentsSingleSubject (1 of 3)
pattern: [1] CACCAGCT
subject: [5] CACCAGCT
score: -48.14596

DataFrame(subjectStart=start(subject(res)),
           subjectEnd=end(subject(res)),
           patternStart=start(pattern(res)),
           patternEnd=end(pattern(res)))

DataFrame with 3 rows and 4 columns
   subjectStart subjectEnd patternStart patternEnd
      <integer>  <integer>    <integer>  <integer>
1            5         12            1          8
2            3          8            1          6
3            1          5            1          5


Valerie

On 08/21/2013 08:40 AM, Brian Herb wrote:
> Hi all,
>
> I feel like I'm missing some obvious function, but is there a simple way to
> output a table of matching start and end positions between the subject and
> pattern in a pairwiseAlignment result (say from a global-local alignment)?
> For example:
>
>    s.pos1 s.pos2 p.pos1 p.pos2
>   [1,]    354    359      1      6
>   [2,]    360    364      9     19
>
> where s.pos1 and s.pos2 are the start and end of a section of the subject
> that corresponds to the start and end (p.pos1 and p.pos2)  of the pattern,
> taking into account insertions and deletions. I know the insertion and
> deletion information is easily available, but I haven't found a function in
> the literature that that summarizes them into a mummer like output of
> corresponding start and end positions.
>



More information about the Bioconductor mailing list