with open('30second_genes_list.txt', 'w') as f:
# declare the method
selector = FwdSelect()
# fit the selector with the cell data
selector.fit(df.values)
# rank the features
idx = selector.ordered_features
# get top 20 features
ls = [gene_list[e] for e in idx][:20]
# write down selected genes into a file
f.write('\n'.join(ls))
网友评论