[R, ShortRead] Subscript contains out-of-bounds indices
1
0
Entering edit mode
3.7 years ago
a.puwanat ▴ 10

Hello everyone,

I am using an R package, ShortRead, to read a fasta file. The look of the info in the fasta file is like the following:

>81001@A01|ORF_ID: 403|ORF_SIZE:159|TEMPLATE_ACCESSION: BC009508.2, BC010491.1|GENE_ID: 112597|PERFECT_MATCH
ATGACAGACACCGAAAATCACGACTCAGCCCCCTCCAGCACCTCTACCTGTTGCCCGCCGATCACAGCCGGAATGCAGCTGAAAGATTCCCTGGGGCCTGGTTCCAACCGCCCACTGTGGACTCTGAGGCCTCTGCATTTGCGGGTGGTCTGCCTGA

>81001@A02|ORF_ID: 228|ORF_SIZE:135|TEMPLATE_ACCESSION: BC016025.1|GENE_ID: 9168|PERFECT_MATCH
ATGGCAGACAAACCAGACATGGGGGAAATCGCCAGCTTCGATAAGGCCAAGCTGAAGAAAACGGAGACGCAGGAAAAGAACACCCTGCCGACCAAAGAGACCATTGAGCAGGAGAAGCGGAGTGAAATTTCCTAA

I used to be able to execute a ShortRead function, readFasta, to read the fasta file, but when I just came back to use it again, it gave me an error saying,

Error: Subscript contains out-of-bounds indices

Could anyone help me with this ? I am an R beginner, and I could not troubleshoot this problem. Thank you so much for your help !

R • 1.4k views
ADD COMMENT
1
Entering edit mode

Can you add the full command you are currently using?

ADD REPLY
0
Entering edit mode

Yes, thank you so much @rpolicastro !

It is:

library(ShortRead)

fa <- file.path("horf81_cloneInfo20120427.fa")

rfa <- readFasta(fa)

As simple as this. Please kindly let me know if you need additional information. Thank you so much !

ADD REPLY
0
Entering edit mode

Additionally, I tried to use the example command from https://www.rdocumentation.org/packages/ShortRead/versions/1.30.0/topics/readFasta

The code loos like this:

f1 <- system.file("extdata", "someORF.fa", package="Biostrings")

rfa <- readFasta(f1)

I ran these lines as for troubleshooting, but I got the same error. I confirmed that I have the file "someORF.fa" from downloading Biostrings package.

ADD REPLY
1
Entering edit mode

What version of ShortRead do you have? You can check with sessionInfo() or packageVersion("ShortRead").

ADD REPLY
0
Entering edit mode

I ran a command like this as you suggested:

The result looks like this:

R version 4.0.2 (2020-06-22)

Platform: x86_64-w64-mingw32/x64 (64-bit)

Running under: Windows 10 x64 (build 19041)

Matrix products: default

locale:

[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    

LC_MONETARY=English_United States.1252

[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:

character(0)

other attached packages:

[1] ShortRead_1.46.0

loaded via a namespace (and not attached):
 [1] rstudioapi_0.13             XVector_0.28.0              GenomicRanges_1.40.0        BiocGenerics_0.36.0         zlibbioc_1.34.0            
 [6] GenomicAlignments_1.24.0    IRanges_2.24.0              grDevices_4.0.2             BiocParallel_1.22.0         lattice_0.20-41            
[11] jpeg_0.1-8.1                hwriter_1.3.2               GenomeInfoDb_1.24.2         tools_4.0.2                 utils_4.0.2                
[16] SummarizedExperiment_1.18.2 parallel_4.0.2              grid_4.0.2                  Biobase_2.48.0              png_0.1-7                  
[21] latticeExtra_0.6-29         stats_4.0.2                 datasets_4.0.2              matrixStats_0.58.0          base_4.0.2                 
[26] crayon_1.4.1                Matrix_1.2-18               GenomeInfoDbData_1.2.3      RColorBrewer_1.1-2          graphics_4.0.2             
[31] S4Vectors_0.28.0            bitops_1.0-6                RCurl_1.98-1.2              DelayedArray_0.14.1         compiler_4.0.2             
[36] methods_4.0.2               Biostrings_2.56.0           Rsamtools_2.4.0             stats4_4.0.2               
>
ADD REPLY
0
Entering edit mode

Sorry, @rpolicastro. I just saw the later command.

It is 1.46.0. Please let me know if I could assist you with other things. Thanks !!

ADD REPLY
1
Entering edit mode
3.7 years ago
a.puwanat ▴ 10

Hi everyone,

I would like to give an update that I was able to solve the problem ! Thanks to @rpolicastro, I realized that there is an issue with my installed ShortRead version. I deleted the old ShortRead package and installed the newest version (1.48.0). It works now ! Thanks @rpolicastro !!

ADD COMMENT

Login before adding your answer.

Traffic: 1418 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