我有類似下面的一個表,並想以計算本因素的不同組合。例如所有時間的數量(1表示存在,0表示不存在)。第一次缺席的時間是休息時間,第二時間缺席的次數是其他時間的休息時間,還有一些缺席休息時間的休息時間。計算爲存在或不存在因子的組合在表中
在殼是很簡單的檢查時間的數目都是本
AWK「{如果(($ 2 == 1)& &($ 90元== 1)& &($ 4 == 1) & &($ ==您1)& &($ 6 == 1))打印$ 1}「ALL_Freq_motif_AE_Uper
但問題是計算所有可能的組合的存在。
表看起來是這樣的:
CEBP HEB TAL1 RUNX1 SPI1
1 1 1 1 1
0 1 1 1 1
1 1 0 0 1
1 1 1 1 0
0 0 0 1 1
現在不同組合,從該表中出現
1的組合,所有都存在。
2第一不存在,並且所有其它的是本
3最後爲不存在,但其他都存在
4的第三和第四不存在但其它的本
5前三缺席但其他都存在。
在表這樣其具有與n行的數目的列的固定數量的,如何可以計算存在和不存在這些的組合?
請幫忙。
謝謝
你能證明你已經嘗試過的代碼?所以答案可以更好地適應,並嘗試幫助你? – 2012-08-08 11:54:30
這不僅僅是按所有列分組的選擇計數(*)嗎? – frankc 2012-08-08 15:05:02