I have a dataset that measures the expression levels of large numbers of genes simultaneously.
Here is some part of my data frame
Column 0 refers to gene types and other columns are patient samples. Samples in the datasets represent patients. For each patient, 7070 genes expressions (values) are measured in order to classify the patient’s disease into one of the following cases: EPD, JPA, MED, MGL, RHB.
I would like to generate subsets with top 2,4,6,8,10,12,15,20,25, and 30 top genes with the highest absolute T-value for each class.
I try to use scipy.stats.ttest_ind for every possible pair.
def calculate_t():
t_res = []
for cls in range(np.max(classes)):
samp = np.where(classes == cls)[0]
for gene in range(train.shape[1]):
for other_genes in range(gene, train.shape[1]):
t_res.append(ttest_ind(train[samp, gene], train[samp, other_genes])[:])
return t_res
I didn't continue because I thought it would take too long.
I would appreciate it if anyone has any ideas. Have a nice day.
