This question is actually for DNA codon analysis, to put it in a simple way, let’s say I have a file like this:
atgaaaccaaag…
and I want to count the number of ‘aaa’ triplet present in this file. Importantly, the triplets start from the very beginning (which means atg,aaa,cca,aag,…) So the result should be 1 instead of 2 ‘aaa’ in this example.
Is there any Python or Shellscript methods to do this? Thanks!
This question is actually for DNA codon analysis, to put it in a simple
Share
first readin the file
then split it into 3’s
then count em
like so