Count number of conditions each effect is significant in

get_n_significant_conditions(
  m,
  thresh = 0.05,
  conditions = NULL,
  sig_fn = get_lfsr
)

Arguments

m

the mash result (from joint or 1by1 analysis)

thresh

indicates the threshold below which to call signals significant

conditions

which conditions to include in check (default to all)

sig_fn

the significance function used to extract significance from mash object; eg could be ashr::get_lfsr or ashr::get_lfdr

Value

a vector containing the number of significant conditions

Examples

simdata = simple_sims(50,5,1)
data = mash_set_data(simdata$Bhat, simdata$Shat)
m = mash(data, cov_canonical(data))
#>  - Computing 200 x 141 likelihood matrix.
#>  - Likelihood calculations took 0.00 seconds.
#>  - Fitting model with 141 mixture components.
#>  - Model fitting took 0.16 seconds.
#>  - Computing posterior matrices.
#>  - Computation allocated took 0.00 seconds.
get_n_significant_conditions(m)
#>   effect_1   effect_2   effect_3   effect_4   effect_5   effect_6   effect_7 
#>          0          0          0          0          0          0          0 
#>   effect_8   effect_9  effect_10  effect_11  effect_12  effect_13  effect_14 
#>          0          0          0          0          0          0          0 
#>  effect_15  effect_16  effect_17  effect_18  effect_19  effect_20  effect_21 
#>          0          0          0          0          0          0          0 
#>  effect_22  effect_23  effect_24  effect_25  effect_26  effect_27  effect_28 
#>          0          0          0          0          0          0          0 
#>  effect_29  effect_30  effect_31  effect_32  effect_33  effect_34  effect_35 
#>          0          0          0          0          0          0          0 
#>  effect_36  effect_37  effect_38  effect_39  effect_40  effect_41  effect_42 
#>          0          0          0          0          0          0          0 
#>  effect_43  effect_44  effect_45  effect_46  effect_47  effect_48  effect_49 
#>          0          0          0          0          0          0          0 
#>  effect_50  effect_51  effect_52  effect_53  effect_54  effect_55  effect_56 
#>          0          0          0          0          0          0          0 
#>  effect_57  effect_58  effect_59  effect_60  effect_61  effect_62  effect_63 
#>          0          0          0          0          0          0          0 
#>  effect_64  effect_65  effect_66  effect_67  effect_68  effect_69  effect_70 
#>          0          3          0          0          0          0          0 
#>  effect_71  effect_72  effect_73  effect_74  effect_75  effect_76  effect_77 
#>          0          0          0          0          0          0          0 
#>  effect_78  effect_79  effect_80  effect_81  effect_82  effect_83  effect_84 
#>          0          0          0          0          0          0          0 
#>  effect_85  effect_86  effect_87  effect_88  effect_89  effect_90  effect_91 
#>          0          0          0          0          0          0          0 
#>  effect_92  effect_93  effect_94  effect_95  effect_96  effect_97  effect_98 
#>          2          0          1          0          0          0          0 
#>  effect_99 effect_100 effect_101 effect_102 effect_103 effect_104 effect_105 
#>          0          0          0          0          0          0          0 
#> effect_106 effect_107 effect_108 effect_109 effect_110 effect_111 effect_112 
#>          0          0          0          0          0          0          0 
#> effect_113 effect_114 effect_115 effect_116 effect_117 effect_118 effect_119 
#>          0          0          0          0          0          0          0 
#> effect_120 effect_121 effect_122 effect_123 effect_124 effect_125 effect_126 
#>          0          0          0          0          0          0          0 
#> effect_127 effect_128 effect_129 effect_130 effect_131 effect_132 effect_133 
#>          0          0          0          0          0          0          0 
#> effect_134 effect_135 effect_136 effect_137 effect_138 effect_139 effect_140 
#>          0          0          0          0          0          0          0 
#> effect_141 effect_142 effect_143 effect_144 effect_145 effect_146 effect_147 
#>          0          0          0          0          0          0          0 
#> effect_148 effect_149 effect_150 effect_151 effect_152 effect_153 effect_154 
#>          0          0          0          0          0          0          0 
#> effect_155 effect_156 effect_157 effect_158 effect_159 effect_160 effect_161 
#>          0          0          0          4          0          0          0 
#> effect_162 effect_163 effect_164 effect_165 effect_166 effect_167 effect_168 
#>          0          0          0          0          0          0          0 
#> effect_169 effect_170 effect_171 effect_172 effect_173 effect_174 effect_175 
#>          0          0          0          0          0          0          0 
#> effect_176 effect_177 effect_178 effect_179 effect_180 effect_181 effect_182 
#>          0          0          0          0          0          0          4 
#> effect_183 effect_184 effect_185 effect_186 effect_187 effect_188 effect_189 
#>          0          0          0          5          0          0          0 
#> effect_190 effect_191 effect_192 effect_193 effect_194 effect_195 effect_196 
#>          0          0          0          0          0          0          0 
#> effect_197 effect_198 effect_199 effect_200 
#>          0          0          0          0