Hi,
Apologies, ive been looking at this for so long, i forget that its actually not that clear.
The original file that i am working with looks somthing like this
Quote:
Mam189 Mam329 84.07
Mam189 Mam82 66.37
Mam189 Mam83 66.81
Mam82 Mam487 71.24
Mam82 Mam484 70.80
Mam82 Mam150 73.89
Mam426 Mam181 78.32
Mam426 Mam264 78.76
Mam426 Mam485 78.76
In the first colum is DNA sequence data for Mam189, Mam82 and Mam426 that i am comparing to other sequence data, listed in the second colum. The thrid colum is the sequence similarity between the data listed in colum 1 and colum 2.
The code above essentially takes everything that Mam189 is compared to and gives an average of the third colum. The output would read
I would like to be able to feed in a list of names, so that the code would be able to iterate over a list and give the average for Mam189, Mam82, Mam426.
I've only had experience using a for loop before, but it wont work in this case. Not sure what the best approach is to deal with this.
Any advice would be much appreciated.