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 !
Can you add the full command you are currently using?
Yes, thank you so much @rpolicastro !
It is:
As simple as this. Please kindly let me know if you need additional information. Thank you so much !
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.
What version of ShortRead do you have? You can check with
sessionInfo()
orpackageVersion("ShortRead")
.I ran a command like this as you suggested:
The result looks like this:
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 !!