Hello Bioc-sig list,

I am unable to use Views on a DNAString object using R 2.14.0devel I believe
that the error is unintended because it pops up when running the
XStringViews examples. The same code works well in R 2.12.0 and 2.13.0

If the error is not intended, then please teach me how to solve it.

Thank you and greetings,
Leonardo


2.14.0devel code:


> library(Biostrings)
Loading required package: IRanges

Attaching package: ‘IRanges’

The following object(s) are masked from ‘package:base’:

    cbind, eval, intersect, Map, mapply, order, paste, pmax, pmax.int,
    pmin, pmin.int, rbind, rep.int, setdiff, table, union

> dna <- DNAString("ATCG")
> ir <- IRanges(1:2, width=2)
> ir
IRanges of length 2
    start end width
[1]     1   2     2
[2]     2   3     2
>
> Views(dna, start = start(ir), end = end(ir))
Error in initialize(value, ...) :
  invalid names for slots of class "XStringViews": ranges
> Views(dna, ir)
Error in initialize(value, ...) :
  invalid names for slots of class "XStringViews": ranges

### From the error message I thought that maybe it was a matter of adding
"names" After all, Views does have a "names" argument.
### However, the error is still there.

> args(Views)
function (subject, start = NULL, end = NULL, width = NULL, names = NULL)
NULL
> Views(dna, start = start(ir), end = end(ir), names = letters[1:2])
Error in initialize(value, ...) :
  invalid names for slots of class "XStringViews": ranges
>
> ?XStringViews
starting httpd help server ... done
> example(XStringViews)

XStrnV>   v12 <- Views(DNAString("TAATAATG"), start=-2:9, end=0:11)
Error in initialize(value, ...) :
  invalid names for slots of class "XStringViews": ranges
> sessionInfo()
R version 2.14.0 Under development (unstable) (2011-06-09 r56106)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

other attached packages:
[1] Biostrings_2.21.4 IRanges_1.11.8

loaded via a namespace (and not attached):
[1] tools_2.14.0
>





R 2.12.0 code:




> library(Biostrings)
Loading required package: IRanges

Attaching package: 'IRanges'

The following object(s) are masked from 'package:base':

    cbind, eval, Map, mapply, order, paste, pmax, pmax.int, pmin,
    pmin.int, rbind, rep.int, table

> dna <- DNAString("ATCG")
> ir <- IRanges(1:2, width=2)
> ir
IRanges of length 2
    start end width
[1]     1   2     2
[2]     2   3     2
> Views(dna, start = start(ir), end = end(ir))
  Views on a 4-letter DNAString subject
subject: ATCG
views:
    start end width
[1]     1   2     2 [AT]
[2]     2   3     2 [TC]
> DNAStringSet(Views(dna, start = start(ir), end = end(ir)))
  A DNAStringSet instance of length 2
    width seq
[1]     2 AT
[2]     2 TC
> Views(dna, ir)
  Views on a 4-letter DNAString subject
subject: ATCG
views:
    start end width
[1]     1   2     2 [AT]
[2]     2   3     2 [TC]
> example(XStringViews)

XStrnV>   v12 <- Views(DNAString("TAATAATG"), start=-2:9, end=0:11)

XStrnV>   XStringViews(v12, subjectClass="RNAString")
  Views on a 8-letter RNAString subject
subject: UAAUAAUG
views:
     start end width
 [1]    -2   0     3 [   ]
 [2]    -1   1     3 [  U]
 [3]     0   2     3 [ UA]
 [4]     1   3     3 [UAA]
 [5]     2   4     3 [AAU]
 [6]     3   5     3 [AUA]
 [7]     4   6     3 [UAA]
 [8]     5   7     3 [AAU]
 [9]     6   8     3 [AUG]
[10]     7   9     3 [UG ]
[11]     8  10     3 [G  ]
[12]     9  11     3 [   ]

XStrnV>   XStringViews(AAString("MARKSLEMSIR*"))
  Views on a 12-letter AAString subject
subject: MARKSLEMSIR*
views:
    start end width
[1]     1  12    12 [MARKSLEMSIR*]

XStrnV>   XStringViews("abcdefghij", subjectClass="BString")
  Views on a 10-letter BString subject
subject: abcdefghij
views:
    start end width
[1]     1  10    10 [abcdefghij]
> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

other attached packages:
[1] Biostrings_2.18.0 IRanges_1.8.0

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








R 2.13.0 code


> library(Biostrings)
Loading required package: IRanges

Attaching package: 'IRanges'

The following object(s) are masked from 'package:base':

    cbind, eval, intersect, Map, mapply, order, paste, pmax, pmax.int,
    pmin, pmin.int, rbind, rep.int, setdiff, table, union

> dna <- DNAString("ATCG")
> ir <- IRanges(1:2, width=2)
> ir
IRanges of length 2
    start end width
[1]     1   2     2
[2]     2   3     2
> Views(dna, ir)
  Views on a 4-letter DNAString subject
subject: ATCG
views:
    start end width
[1]     1   2     2 [AT]
[2]     2   3     2 [TC]
> DNAStringSet(Views(dna, ir))
  A DNAStringSet instance of length 2
    width seq
[1]     2 AT
[2]     2 TC
> example(XStringViews)

XStrnV>   v12 <- Views(DNAString("TAATAATG"), start=-2:9, end=0:11)

XStrnV>   XStringViews(v12, subjectClass="RNAString")
  Views on a 8-letter RNAString subject
subject: UAAUAAUG
views:
     start end width
 [1]    -2   0     3 [   ]
 [2]    -1   1     3 [  U]
 [3]     0   2     3 [ UA]
 [4]     1   3     3 [UAA]
 [5]     2   4     3 [AAU]
 [6]     3   5     3 [AUA]
 [7]     4   6     3 [UAA]
 [8]     5   7     3 [AAU]
 [9]     6   8     3 [AUG]
[10]     7   9     3 [UG ]
[11]     8  10     3 [G  ]
[12]     9  11     3 [   ]

XStrnV>   XStringViews(AAString("MARKSLEMSIR*"))
  Views on a 12-letter AAString subject
subject: MARKSLEMSIR*
views:
    start end width
[1]     1  12    12 [MARKSLEMSIR*]

XStrnV>   XStringViews("abcdefghij", subjectClass="BString")
  Views on a 10-letter BString subject
subject: abcdefghij
views:
    start end width
[1]     1  10    10 [abcdefghij]
> sessionInfo()
R version 2.13.0 (2011-04-13)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

other attached packages:
[1] Biostrings_2.20.1 IRanges_1.10.4

loaded via a namespace (and not attached):
[1] tools_2.13.0
>

	[[alternative HTML version deleted]]

