Hi,
I have a dataframe tab5 of 6500 lines that contains a column 'ALT' which is a list of DNAStringSet instances of length 1
head(tab5$ALT)
[[1]]
A DNAStringSet instance of length 1
width seq
[1] 1 C
[[2]]
A DNAStringSet instance of length 1
width seq
[1] 1 T
If I do:
head(tab5)
dbsnp_id GT_parent1 GT_embryo GT_parent2 chr start REF ALT QUAL
1 rs7521546 1/1 0/1 0/0 chr1 3518944 T C 7828.9
The ALT column just shows the nucleotide, like it should.
However when trying to write this as a table
write.table(tab5, file = "test.txt", sep = "\t", row.names = FALSE)
I get the following in my 'ALT' column
new("DNAStringSet", pool = new("SharedRaw_Pool", xp_list = list(<pointer: 0x0>), .link_to_cached_object_list = list(<environment>)), ranges = new("GroupedIRanges", group = 1, start = 606, width = 1, NAMES = NULL, elementType = "ANY", elementMetadata = NULL, metadata = list()), elementType = "DNAString", elementMetadata = NULL, metadata = list())
How is this possible? I've already tried to convert the 'ALT' column to a character, but this doesn't change a thing.
How did you do that? Did you try
tab5$ALT <- as.character(tab5$ALT)
?yes, and if I do that, see the same for each element
Are you trying to write
tab5
ortab7
?tab5, sorry, mistake in the code above, changed it now.