code editing convertSampleDataIntoCoIntensityNetwork function 11-06-2014d1616
2014-11-07code editing convertSampleDataIntoCoIntensityNetwork function 11-06-2014d1616
11-07-2014d1327
I think using all 45,000 genes from some of the gene expression datasets will produce networks that are too big to analyze with a normal analysis. I think I will just randomly select 500 genes.
11-07-2014d1011
I'll try to precalculate parts for lists.
formula for pearsons correlation coefficient here
Is Sum((xi-xbar)*(yi-ybar)) the same as Sum(xi-xbar)*Sum(yi-ybar)?
I'll do a little test with a few lists.
- "C:\Sync\pDR\2014\2014\11-07-2014d1014\Calculation test 11-07-2014d1014.xlsx"
- -This spreadsheet also has a spreadsheet calculating later verifcations of the correlation calculation.
No they are not the same thing. Sum(xi-xbar)*Sum(yi-ybar) will always be 0.
code before trying to split matrix into blocks
public void convertSampleDataIntoCoIntensityNetwork(double[][] values, double threshold, String output_directory)
{
PearsonsCorrelation pc = new PearsonsCorrelation();
String[] sarray = new String[values.length];
useful_tools.createTextFile(output_directory, "row1.txt", Arrays.toString(values[0]));
//fill up the similarity score with absolute value correlation coefficient values, but just write each row to a separate text file
String edges = "";
for(int i=0; i<values.length; i++)
{
System.out.println(i);
String current_row = "";
for(int j=i+1; j<values.length; j++)
{
double calculated_similarity_score = Math.abs(pc.correlation(values[i], values[j]));
int link=0;
if(calculated_similarity_score>threshold)
{
link = 1;
if(i==(values.length-1) && link==1)
edges+=i+"\t"+j;
else if(link==1)
edges+=i+"\t"+j+"\r\n";
}
}
useful_tools.createTextFile(output_directory, "network.txt", edges);
}
}