SAM significant genes calculates the fold-change value just like the way below.

why it calculated over the unlogged value? Mev Internally converts the values into log2?

private double getFoldChange(int gene) {

float[] currentGene = new float[numExps];

for (int i = 0; i < numExps; i++) {

currentGene[i] = imputedMatrix.A[gene][i];

}

double unloggedCurrentGene[] = new double[currentGene.length];

for (int i = 0; i < unloggedCurrentGene.length; i++) {

unloggedCurrentGene[i] = Math.pow(2, (double)currentGene[i]);

}

double[] groupAValues = new double[1];

double[] groupBValues = new double[1];

if (studyDesign == SAMInitDialog.TWO_CLASS_UNPAIRED) {

int groupACounter = 0;

int groupBCounter = 0;

for (int i = 0; i < groupAssignments.length; i++) {

if (groupAssignments[i] == SAMInitDialog.GROUP_A) {

groupACounter++;

} else if (groupAssignments[i] == SAMInitDialog.GROUP_B) {

groupBCounter++;

}

}

groupAValues = new double[groupACounter];

groupBValues = new double[groupBCounter];

int groupAIndex = 0;

int groupBIndex = 0;

for (int i = 0; i < groupAssignments.length; i++) {

if (groupAssignments[i] == SAMInitDialog.GROUP_A) {

groupAValues[groupAIndex] = unloggedCurrentGene[i];

groupAIndex++;

} else if (groupAssignments[i] == SAMInitDialog.GROUP_B) {

groupBValues[groupBIndex] = unloggedCurrentGene[i];

groupBIndex++;

}

}

} else if (studyDesign == SAMInitDialog.TWO_CLASS_PAIRED) {

groupAValues = new double[pairedGroupAExpts.length];

groupBValues = new double[pairedGroupBExpts.length];

for (int i = 0; i < groupAValues.length; i++) {

groupAValues[i] = unloggedCurrentGene[pairedGroupAExpts[i]];

groupBValues[i] = unloggedCurrentGene[pairedGroupBExpts[i]];

}

}

double meanA = getMean(groupAValues);

double meanB = getMean(groupBValues);

return (double)(meanB/meanA);

}

best regards

Kenji