I have two segments of a random fasta file
1 Segment1 AAGGTTCC
2 Segment2 CCTTGGAA
I have another random data set containing dinucleotides' energy values as
AA -1.0
AG -2.0
GG -1.5
GT -1.7
TT -1.2
TC -1.8
CC -1.4
CT -2.5
TG -2.1
GA -2.3
Here, I want to analyze and compare the nucleotides of the two fasta segments with the given energy values in a 'sliding window algorithm' such that the energy output value for fasta segment1 would be average of all the possile dinucleotide combination in an overlapping sliding window manner which will give the answer as -10.6 i.e. {(-1.0)+ (-2.0) + (-1.5) + (-1.7) + (-1.2) + (-1.8) + (-1.4)}/7 and the same computation would be performed for segment2, using the help of for and if else loop preferably.