I have the following character string:
str(seqN)
chr [1:704] "010000100100001010000100010001000100000100101000010001001000001001001000001000010010000100100100010000101000010"| __truncated__ ...
Yes they are very long strings (704 strings of length 1000) composed of 0s and 1s. They are meant to be a sequence already one-hot encoded.
Since I want to feed that to a Convolutional model, I need a certain input shape, so I want to split each string into subgroups of length 4 (to match the one-hot encoding).
The problem is that R doesn't let me split that string, as if the string was unsplittable.
For example, If I execute this code:
seqN2 <- array_reshape(seqN,c(704,250,4))
It gives me this error:
Error in py_call_impl(callable, dots$args, dots$keywords) :
ValueError: cannot reshape array of size 704 into shape (704,250,4)
What should I do to achieve that shape I need (704,250,4)?