I am new to R and trying to figure out how to print/save a class S4 object that is nested into a list.
This is the structure of the list. The list contains many of these mm9 fasta sequence subsets like the one in the figure. They contain different numbers of rows listing the matches between an input sequence across many fasta files:
If I try to use write.table
like:
write.table(tgt_cacgtg, file="tgt_cacgtg.csv", sep=",")
I get:
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, arguments imply differing number of rows: 1, 6, 5, 2, 7, 4, 11, 3, 17, 8, 9
If I try to use sink
I get a txt file that lists a max of 11 rows per mm9 fasta sequence and gives me something like this otherwise:
$`mm9_chr7_149721485_149878684_+_tgt17'
Views on a 157199-letter BString subject
subject: ggaccagctcagcaggggcagggggcaggagcagatccctggag...gagtctgtgttctcactccggcctaaaacttttgccacactctc
views:
start end width
[1] 3291 3296 6 [cacgtg]
[2] 11561 11566 6 [cacgtg]
[3] 16247 16252 6 [cacgtg]
[4] 24249 24254 6 [cacgtg]
[5] 26048 26053 6 [cacgtg]
... ... ... ... ...
[13] 86453 86458 6 [cacgtg]
[14] 119849 119854 6 [cacgtg]
[15] 129404 129409 6 [cacgtg]
[16] 145612 145617 6 [cacgtg]
[17] 150437 150442 6 [cacgtg]
Any suggestion on how I can save the class S4 into a file?