I am trying to write a program that will count the repeats of a given DNA strand:
I am using a Counter library, something like this code shown below
from collections import Counter s="XXXXXAGCCTGCCAAGCAAACTTCACTGGAGXXXXXTGTGCGTAGCATGCTAGTAACTGCAXXXXXTCTGAATCTTTCAGCTGCTTGTXXXXXTGGGCCTCTCACAAGGCAGAGTGTCTTCATGGGACTTTGATATTTATTTTTGTACAACCTAAGAGGAACAAATCCTTTGACACTGACAAATTGGCTTCCATATTTTATACCTTAATCATCTCCATGTTGAATTCATTGATCAACAGTTTAAGAAAAAAAGATGTAAAAATGCTTTTAGAAAGAGAGGCAAAGTTATGCACAATAACTTCTCATGAAGTCACAGTTTGTTAAAAGTTGCCTTAGTTCACAATAAATAATTATGTATGCTCTATAATTTCAGTGA" def chunk_string(s, n): return [s[i:i+n] for i in range(len(s)-n+1)] counter = Counter(chunk_string(s, 5))
Repeat supposed to be "declared" as an identical sequence on the same strand (like
XXXXX here that occurs 4 times). However, I can also have this repeat (for ex.
XXXXX in this particular test case) on the OPPOSITE strand.
How am I suppose to intake the opposite strand in case of using
.fasta files? As I know for today - fasta is presented only in a single strand way. Or am I completely mixed the terms?