[Bioc-sig-seq] PairwiseAlignedXStringSet to PairwiseAlignedFixedSubject

Stefan Bentink bentink at jimmy.harvard.edu
Wed Aug 4 17:04:59 CEST 2010


Dear List Members,
I'm using the function pairwiseAlignment from the Biostrings package. 
Depending on the
input, the function returns either a PairwiseAlignedFixedSubject (if you 
align a single pattern
with a single subject) or a PairwiseAlignedXStringSet (if you align 
multiple patterns with one
or more subjects). There are some accessors which work on 
PairwiseAlignedFixedSubject
objects but not on PairwiseAlignedXStringSet objects. To use those 
accessors on a single
element from a PairwiseAlignedXStringSet, one would have to make it a 
PairwiseAlignedFixedSubject.
Is there any way to do that? Subsetting doesn't work since it still 
returns a PairwiseAlignedXStringSet.
Thanks,
Stefan


Code example:
library(Biostrings)
pattern1 <- c("ACGT")
pattern2 <- c("CAGT")
subject1 <- c("CAACGTGGAT")
subject2 <- c("GAACAGTAAT")

mat <- nucleotideSubstitutionMatrix(match = 1, mismatch = 0, baseOnly = 
FALSE)
pwAligned <- 
pairwiseAlignment(c(pattern1,pattern2),c(subject1,subject2),substitutionMatrix=mat,type="local")

##This throws an error message:
##as.character(pwAligned[1])
##how to make pwAligned[1] a PairwiseAlignedFixedSubject?


 > sessionInfo()
R version 2.12.0 Under development (unstable) (2010-04-07 r51635)
x86_64-unknown-linux-gnu

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] BSgenome.Hsapiens.UCSC.hg19_1.3.16 BSgenome_1.17.6
[3] Biostrings_2.17.26                 GenomicRanges_1.1.19
[5] IRanges_1.7.15

loaded via a namespace (and not attached):
[1] Biobase_2.9.0 tools_2.12.0




-- 
Stefan Bentink
Research Fellow
Department of Biostatistics and
Computational Biology
Dana-Farber Cancer Institute
44 Binney St.
Boston, MA 02115

Tel: (+1) 617-582-7604
Fax: (+1) 617-582-7760

bentink at jimmy.harvard.edu
http://www.hsph.harvard.edu/research/stefan-bentink/



More information about the Bioc-sig-sequencing mailing list