-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading show() method for XStringSet objects #25
Comments
Somehow related is the initial value displayed for
|
This has not much to do with the |
There also some other inconsistencies for showing the name of elements. The length of names seems to be treated differently. Probably a historic reason based on the positioning of the names (left vs. right.) library(Biostrings)
library(GenomicRanges)
seq <- RNAStringSet(c("UAUCUGGUUGAUCCUGCCAGUAGUCAUAUGCUUGUCUCAAAGAUUAAGCCAUGCAUGUCUAAGUAUAAGCAAUUUAUACAGUGAAACUGCGAAUGGCUCA",
"CCGAGAGGUCUUGGUAAUCUUGUGAAACUCCGUCGUGCUGGGGAUAGAGCAUUGUAAUUAUUGCUCUUCAACGAGGAAUUCCUAGUAAGCGCAAGUCAUCA"))
names(seq) <- c("TheFirstVeryLongNameAndItIsGettingEvenLongerByTheLetter",
"TheSecondVeryLongNameAndItIsGettingEvenLongerByTheLetter")
gr <- GRanges(c("chr1:5-10:+","chr1:6-10:+"))
names(gr) <- names(seq)
seq
#> A RNAStringSet instance of length 2
#> width seq names
#> [1] 100 UAUCUGGUUGAUCCUGCCAGU...GUGAAACUGCGAAUGGCUCA TheFirstVeryLongN...
#> [2] 101 CCGAGAGGUCUUGGUAAUCUU...CUAGUAAGCGCAAGUCAUCA TheSecondVeryLong...
gr
#> GRanges object with 2 ranges and 0 metadata columns:
#> seqnames
#> <Rle>
#> TheFirstVeryLongNameAndItIsGettingEvenLongerByTheLetter chr1
#> TheSecondVeryLongNameAndItIsGettingEvenLongerByTheLetter chr1
#> ranges
#> <IRanges>
#> TheFirstVeryLongNameAndItIsGettingEvenLongerByTheLetter 5-10
#> TheSecondVeryLongNameAndItIsGettingEvenLongerByTheLetter 6-10
#> strand
#> <Rle>
#> TheFirstVeryLongNameAndItIsGettingEvenLongerByTheLetter +
#> TheSecondVeryLongNameAndItIsGettingEvenLongerByTheLetter +
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths |
Right, long names are truncated. But maybe that's a good thing and we should keep that when we move them to the left. I don't know. Yeah, these things predate GRanges. The |
This is a follow up of https://support.bioconductor.org/p/122340/#122400
The
show()
method for XStringSet objects currently suggests the existence of aseq()
getter for these objects:but there is no such getter.
Same issue with the
show()
method for XString objects:Also it would be good to make these
show()
methods more consistent with othershow()
methods in S4Vectors/IRanges/GenomicRanges:In particular the names on a DNAStringSet object should be displayed on the left. Also its metadata columns should be displayed (right now they are not):
The text was updated successfully, but these errors were encountered: