I have the following vector Vec:
ACGTTGCAand I would like to divide it into a nested vector in which at the i-th position there will be a subsegment of Veclength 4, starting from the i-th position Vec.
For example, Vec[(β³Β―3+β΄Vec)β.+Β―1+β³4]returns:
ACGT
CGTT
GTTG
TTGC
TGCA
But the problem with the above output is that it is a character matrix, while I would like to get the following output:
ββββββββββββββββββββββββββββ
βββββββ¬βββββ¬βββββ¬βββββ¬ββββββ
ββACGTβCGTTβGTTGβTTGCβTGCAββ
βββββββ΄βββββ΄βββββ΄βββββ΄ββββββ
ββββββββββββββββββββββββββββ
For the next line: the
vecβ'Hy, only testing segmenting vec into pieces of 4'
correct result of what I'm looking for would be:
βββββββββββββββββββββββββββββββββββββββββββ
β ββββββ ββββββ ββββββ ββββββ β
β βHy, β βy, oβ β, onβ β onlβ (and so on) β
β ββββββ ββββββ ββββββ ββββββ β
βββββββββββββββββββββββββββββββββββββββββββ
In addition, is there a way to convert such a vector into a single vector in which subsequent lines will contain 4 characters?
Example: for a character symbol, the foobartestingresult is:
foob
ooba
obar
bart
arte
rtes
test
esti
stin
ting