seqinfo got changed after `library(rtracklayer)`
1
0
Entering edit mode
Ge Tan ▴ 20
@ge-tan-7918
Last seen 5 weeks ago
Switzerland

Hi,

I am having difficulty to change the circular information in the seqinfo of a DNAStringSet after loading rtracklayer. Here's the minimal code to reproduce the issue.

> library(Biostrings)
> filepath1 <- system.file("extdata", "someORF.fa", package="Biostrings")
> x1 <- readDNAStringSet(filepath1)
> seqinfo(x1)
Seqinfo object with 7 sequences from an unspecified genome:
  seqnames                                                                                seqlengths
  YAL001C TFC3 SGDID:S0000001, Chr I from 152168-146596, reverse complement, Verified ORF       5573
  YAL002W VPS8 SGDID:S0000002, Chr I from 142709-148533, Verified ORF                           5825
  YAL003W EFB1 SGDID:S0000003, Chr I from 141176-144162, Verified ORF                           2987
  YAL005C SSA1 SGDID:S0000004, Chr I from 142433-138505, reverse complement, Verified ORF       3929
  YAL007C ERP2 SGDID:S0000005, Chr I from 139347-136700, reverse complement, Verified ORF       2648
  YAL008W FUN14 SGDID:S0000006, Chr I from 135916-138512, Verified ORF                          2597
  YAL009W SPO7 SGDID:S0000007, Chr I from 134856-137635, Verified ORF                           2780
                                                                                          isCircular
  YAL001C TFC3 SGDID:S0000001, Chr I from 152168-146596, reverse complement, Verified ORF         NA
  YAL002W VPS8 SGDID:S0000002, Chr I from 142709-148533, Verified ORF                             NA
  YAL003W EFB1 SGDID:S0000003, Chr I from 141176-144162, Verified ORF                             NA
  YAL005C SSA1 SGDID:S0000004, Chr I from 142433-138505, reverse complement, Verified ORF         NA
  YAL007C ERP2 SGDID:S0000005, Chr I from 139347-136700, reverse complement, Verified ORF         NA
  YAL008W FUN14 SGDID:S0000006, Chr I from 135916-138512, Verified ORF                            NA
  YAL009W SPO7 SGDID:S0000007, Chr I from 134856-137635, Verified ORF                             NA
                                                                                          genome
  YAL001C TFC3 SGDID:S0000001, Chr I from 152168-146596, reverse complement, Verified ORF   <NA>
  YAL002W VPS8 SGDID:S0000002, Chr I from 142709-148533, Verified ORF                       <NA>
  YAL003W EFB1 SGDID:S0000003, Chr I from 141176-144162, Verified ORF                       <NA>
  YAL005C SSA1 SGDID:S0000004, Chr I from 142433-138505, reverse complement, Verified ORF   <NA>
  YAL007C ERP2 SGDID:S0000005, Chr I from 139347-136700, reverse complement, Verified ORF   <NA>
  YAL008W FUN14 SGDID:S0000006, Chr I from 135916-138512, Verified ORF                      <NA>
  YAL009W SPO7 SGDID:S0000007, Chr I from 134856-137635, Verified ORF                       <NA>
> isCircular(x1) <- rep(TRUE, length(x1))
## The `isCircular` column is TRUE.
> seqinfo(x1)
Seqinfo object with 7 sequences (7 circular) from an unspecified genome:
  seqnames                                                                                seqlengths
  YAL001C TFC3 SGDID:S0000001, Chr I from 152168-146596, reverse complement, Verified ORF       5573
  YAL002W VPS8 SGDID:S0000002, Chr I from 142709-148533, Verified ORF                           5825
  YAL003W EFB1 SGDID:S0000003, Chr I from 141176-144162, Verified ORF                           2987
  YAL005C SSA1 SGDID:S0000004, Chr I from 142433-138505, reverse complement, Verified ORF       3929
  YAL007C ERP2 SGDID:S0000005, Chr I from 139347-136700, reverse complement, Verified ORF       2648
  YAL008W FUN14 SGDID:S0000006, Chr I from 135916-138512, Verified ORF                          2597
  YAL009W SPO7 SGDID:S0000007, Chr I from 134856-137635, Verified ORF                           2780
                                                                                          isCircular
  YAL001C TFC3 SGDID:S0000001, Chr I from 152168-146596, reverse complement, Verified ORF       TRUE
  YAL002W VPS8 SGDID:S0000002, Chr I from 142709-148533, Verified ORF                           TRUE
  YAL003W EFB1 SGDID:S0000003, Chr I from 141176-144162, Verified ORF                           TRUE
  YAL005C SSA1 SGDID:S0000004, Chr I from 142433-138505, reverse complement, Verified ORF       TRUE
  YAL007C ERP2 SGDID:S0000005, Chr I from 139347-136700, reverse complement, Verified ORF       TRUE
  YAL008W FUN14 SGDID:S0000006, Chr I from 135916-138512, Verified ORF                          TRUE
  YAL009W SPO7 SGDID:S0000007, Chr I from 134856-137635, Verified ORF                           TRUE
                                                                                          genome
  YAL001C TFC3 SGDID:S0000001, Chr I from 152168-146596, reverse complement, Verified ORF   <NA>
  YAL002W VPS8 SGDID:S0000002, Chr I from 142709-148533, Verified ORF                       <NA>
  YAL003W EFB1 SGDID:S0000003, Chr I from 141176-144162, Verified ORF                       <NA>
  YAL005C SSA1 SGDID:S0000004, Chr I from 142433-138505, reverse complement, Verified ORF   <NA>
  YAL007C ERP2 SGDID:S0000005, Chr I from 139347-136700, reverse complement, Verified ORF   <NA>
  YAL008W FUN14 SGDID:S0000006, Chr I from 135916-138512, Verified ORF                      <NA>
  YAL009W SPO7 SGDID:S0000007, Chr I from 134856-137635, Verified ORF                       <NA>
> library(rtracklayer)
Loading required package: GenomicRanges
Warning message:
package ‘GenomicRanges’ was built under R version 4.1.2
## After loading rtracklayer, the `isCircular` column becomes NA again.
> seqinfo(x1)
Seqinfo object with 7 sequences from an unspecified genome:
  seqnames                                                                                seqlengths
  YAL001C TFC3 SGDID:S0000001, Chr I from 152168-146596, reverse complement, Verified ORF       5573
  YAL002W VPS8 SGDID:S0000002, Chr I from 142709-148533, Verified ORF                           5825
  YAL003W EFB1 SGDID:S0000003, Chr I from 141176-144162, Verified ORF                           2987
  YAL005C SSA1 SGDID:S0000004, Chr I from 142433-138505, reverse complement, Verified ORF       3929
  YAL007C ERP2 SGDID:S0000005, Chr I from 139347-136700, reverse complement, Verified ORF       2648
  YAL008W FUN14 SGDID:S0000006, Chr I from 135916-138512, Verified ORF                          2597
  YAL009W SPO7 SGDID:S0000007, Chr I from 134856-137635, Verified ORF                           2780
                                                                                          isCircular
  YAL001C TFC3 SGDID:S0000001, Chr I from 152168-146596, reverse complement, Verified ORF         NA
  YAL002W VPS8 SGDID:S0000002, Chr I from 142709-148533, Verified ORF                             NA
  YAL003W EFB1 SGDID:S0000003, Chr I from 141176-144162, Verified ORF                             NA
  YAL005C SSA1 SGDID:S0000004, Chr I from 142433-138505, reverse complement, Verified ORF         NA
  YAL007C ERP2 SGDID:S0000005, Chr I from 139347-136700, reverse complement, Verified ORF         NA
  YAL008W FUN14 SGDID:S0000006, Chr I from 135916-138512, Verified ORF                            NA
  YAL009W SPO7 SGDID:S0000007, Chr I from 134856-137635, Verified ORF                             NA
                                                                                          genome
  YAL001C TFC3 SGDID:S0000001, Chr I from 152168-146596, reverse complement, Verified ORF   <NA>
  YAL002W VPS8 SGDID:S0000002, Chr I from 142709-148533, Verified ORF                       <NA>
  YAL003W EFB1 SGDID:S0000003, Chr I from 141176-144162, Verified ORF                       <NA>
  YAL005C SSA1 SGDID:S0000004, Chr I from 142433-138505, reverse complement, Verified ORF   <NA>
  YAL007C ERP2 SGDID:S0000005, Chr I from 139347-136700, reverse complement, Verified ORF   <NA>
  YAL008W FUN14 SGDID:S0000006, Chr I from 135916-138512, Verified ORF                      <NA>
  YAL009W SPO7 SGDID:S0000007, Chr I from 134856-137635, Verified ORF                       <NA>
> sessionInfo( )
R version 4.1.1 (2021-08-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
 [1] rtracklayer_1.54.0   GenomicRanges_1.46.1 Biostrings_2.62.0    GenomeInfoDb_1.30.0  XVector_0.34.0      
 [6] IRanges_2.28.0       S4Vectors_0.32.3     BiocGenerics_0.40.0  colorout_1.2-2       BiocManager_1.30.16 

loaded via a namespace (and not attached):
 [1] zlibbioc_1.40.0             GenomicAlignments_1.30.0    BiocParallel_1.28.2        
 [4] lattice_0.20-45             rjson_0.2.20                tools_4.1.1                
 [7] grid_4.1.1                  SummarizedExperiment_1.24.0 parallel_4.1.1             
[10] Biobase_2.54.0              matrixStats_0.61.0          yaml_2.2.1                 
[13] crayon_1.4.2                BiocIO_1.4.0                Matrix_1.3-4               
[16] GenomeInfoDbData_1.2.7      restfulr_0.0.13             bitops_1.0-7               
[19] RCurl_1.98-1.5              DelayedArray_0.20.0         compiler_4.1.1             
[22] MatrixGenerics_1.6.0        Rsamtools_2.10.0            XML_3.99-0.8
rtracklayer GenomeInfoDb • 194 views
ADD COMMENT
0
Entering edit mode

Is rtracklayer masking the function, here? So before loading that library you probably used GenomeInfoDb_1.30.0::seqinfo() and now you use rtracklayer:: seqinfo()?

ADD REPLY
0
Entering edit mode

Not quite. Function masking is not the cause here. GenomeInfoDb::seqinfo(x1) gives the same output with circular information in NA. The rtracklayer package itself breaks (or internally masks) other functions in GenomeInfoDb.

ADD REPLY
1
Entering edit mode
@michael-lawrence-3846
Last seen 5 weeks ago
United States

There was an old method seqinfo,DNAStringSet() in rtracklayer, which has been made obsolete by seqinfo,List() in GenomicRanges. I just dropped the one in rtracklayer, version 1.55.3.

ADD COMMENT
0
Entering edit mode

Thanks for the fix. I can confirm it works now with rtracklayer version 1.55.3.

ADD REPLY

Login before adding your answer.

Traffic: 255 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6