For the following program:
library(Biostrings)
library(IRanges) #added this when I saw it mentioned in docs
s1 <- "DNA here" #insert desired sequence between quotes
matchPattern("ATG", s1) # Find all ATGs in the sequence s1
I get output that looks like this:
Views on a 3933-letter BString subject
subject:
CTGCTGGCCCAGCCGGAGCACGCACCG...TGAAACCGCCGTCGGTCGCGGGCGTCG
views:
start end width
[1] 30 32 3 [ATG]
[2] 63 65 3 [ATG]
[3] 88 90 3 [ATG]
[4] 302 304 3 [ATG]
[5] 327 329 3 [ATG]
... ... ... ... ...
[32] 3543 3545 3 [ATG]
[33] 3670 3672 3 [ATG]
[34] 3747 3749 3 [ATG]
[35] 3777 3779 3 [ATG]
[36] 3781 3783 3 [ATG]
I want to see all the output, not just the head and tail. I cannot figure out how to write it.
I have tried doing
matches <- matchPattern("ATG", s1)
and then writing to the screen with write.XStringViews(matches, file="", fasta, width=80) But I get
Error: could not find function "write.XStringViews"
The 'matches' variable shows up in my Global Environment, but it shows just the initial numbers, so not a good alternative, unless I can figure out a way to show all of it.
The write.XStringViews code is in the Biostrings documentation, but I cannot make it work. Any ideas on how to view or write the entire output are welcome. Sadly, one page I looked at had <promise>
next to the write.XStringViews command, so it might not be possible, but if anybody knows how to remove the head and tail restriction on the output.