Closed qifei9 closed 1 year ago
Hi,
Unfortunately, the tictoc package defines a print()
method for List objects that breaks print()
on all List derivatives in Bioconductor:
library(IRanges)
x1 <- IntegerList(a=11:13, b=21:22, compress=FALSE)
x1
# IntegerList of length 2
# [["a"]] 11 12 13
# [["b"]] 21 22
is(x1, "List")
# [1] TRUE
library(GenomicRanges)
x2 <- GRangesList(a=GRanges("chr1:99-299"), b=GRanges("chr2:88-95"))
x2
# GRangesList object of length 2:
# $a
# GRanges object with 1 range and 0 metadata columns:
# seqnames ranges strand
# <Rle> <IRanges> <Rle>
# [1] chr1 99-299 *
# -------
# seqinfo: 2 sequences from an unspecified genome; no seqlengths
#
# $b
# GRanges object with 1 range and 0 metadata columns:
# seqnames ranges strand
# <Rle> <IRanges> <Rle>
# [1] chr2 88-95 *
# -------
# seqinfo: 2 sequences from an unspecified genome; no seqlengths
is(x2, "List")
# [1] TRUE
library(Biostrings)
x3 <- DNAStringSet(c("AAACTT", "GTTAT"))
x3
# DNAStringSet object of length 2:
# width seq
# [1] 6 AAACTT
# [2] 5 GTTAT
is(x3, "List")
# [1] TRUE
Before loading tictoc, print()
works fine on x1
, x2
, and x3
. However, after loading it:
library(tictoc)
print(x1)
# NULL
print(x2)
# NULL
print(x3)
# NULL
This is because tictoc:::print.List()
gets in the way.
We will soon implement a workaround in Bioconductor. The workaround will consist in defining the following print()
methods:
print.SimpleList <- print.default
print.CompressedList <- print.default
print.XVectorList <- print.default
This "repairs" print()
on x1
, x2
, and x3
.
In the mean time, please refrain from using print()
and use show()
instead (the latter is preferred anyways).
Additionally, someone maybe should contact the tictoc folks and kindly point them to the fact that their List class causes some really unfortunate conflicts with the widely used List class and subclasses defined in Bioconductor (the latters have been around for at least 12 years).
See https://github.com/waldronlab/MultiAssayExperiment/issues/321 for a similar issue caused by tictoc's List class and methods.
Cheers, H.
Many thanks for your reply and explanation! @hpages
Hi @qifei9, I am the maintainer of the tictoc package and the problem is now fixed in the new version of tictoc v1.2. (update from CRAN). Thank you for reporting and thanks @LiNk-NY for posting.
Hi @qifei9, I am the maintainer of the tictoc package and the problem is now fixed in the new version of tictoc v1.2. (update from CRAN). Thank you for reporting and thanks @LiNk-NY for posting.
Many thanks to your work! and also many thanks to @LiNk-NY and all the developers of Biostrings
!
yeah thanks @sizrailev , this is great!
Once the "tictoc" package is loaded, the
DNAStringSet
object becomeNULL
. ThereadDNAStringSet
can read the seq in, but cannot assign theDNAStringSet
object to variables.sessionInfo: