Which distance matrix, distance measure, correlation type, promoter analysis should I chose to rank genes according to their time series trajectory similarities to infer gene function? Why are the time series trajectories for some GO terms anti-correlated? How can I calculate the correlation for a group of genes with more than 2 members? How can I compare the correlation between groups if I get positive and negative correlation, which cancel each other when added together? Is there any Python code for the R Time Wrap package?

I want that my time series similarity ranking will give the same relative ranking between as if I ranked the genes based on their promoter similarity/Transcription Factor Binding Site (TFBS) Distribution? Where can I find or generate distance matrices for genes? I prefer Python Code and Yeast data.

Please provide links because I am almost blind and searching takes me too much effort and time.