I am trying to use the ggsignif to add significance annotations on my facets but I failed. My data has the p-value already calculated and the significance annotation is included in a column. However, I did not find an easy way to add the significance annotation onto the graph following the Advanced Example on their GitHub page: GitHub - const-ae/ggsignif: Easily add significance brackets to your ggplots
I have a sample data set from my experiment:
|DrugAConc|DrugBConc|CellLines|AverageAbsorb|StdDevAbsorb|CountAbsorb|CellViability|PooledStdDev|StdError|tValue|pValue|SignificanceOfChange|
|---|---|---|---|---|---|---|---|---|---|---|---|
|0|0|A2058|0.16|0.029297326|3|1|0.022524061|0.018390819|-9.153117849|0.00079083|***|
|0|0|A375|0.223666667|0.005567764|3|1|0.009678154|0.00790218|-13.24529058|0.00018775|***|
|0|0|FB|0.328333333|0.012503333|3|1|0.012503333|0.010208929|0|1|NS|
|0|1.5625|A2058|0.113666667|0.003605551|3|0.710416667|0.006055301|0.004944132|-26.42863461|1.22E-05|***|
|0|1.5625|A375|0.176333333|0.006658328|3|0.788375559|0.007234178|0.005906682|-11.51238602|0.000325053|***|
|0|1.5625|FB|0.244333333|0.007767453|3|0.744162437|0.007767453|0.006342099|0|1|NS|
|0|3.125|A2058|0.105666667|0.005|3|0.660416667|0.005887841|0.004807402|-23.15873319|2.06E-05|***|
|0|3.125|A375|0.146333333|0.010785793|3|0.654247392|0.008962886|0.007318166|-9.656335396|0.000643387|***|
|0|3.125|FB|0.217|0.006658328|3|0.660913706|0.006658328|0.005436502|0|1|NS|
|0|6.25|A2058|0.084666667|0.004582576|3|0.529166667|0.006377042|0.005206833|-22.53449087|2.30E-05|***|
|0|6.25|A375|0.12|0.010503968|3|0.536512668|0.009237604|0.007542472|-10.87176676|0.000406297|***|
|0|6.25|FB|0.202|0.007767453|3|0.615228426|0.007767453|0.006342099|0|1|NS|
|1.667|0|A2058|0.198|0.009451631|3|1.2375|0.009009255|0.007356025|-15.99595688|8.93E-05|***|
|1.667|0|A375|0.226|0.002081666|3|1.010432191|0.006218253|0.005077182|-17.66071522|6.04E-05|***|
|1.667|0|FB|0.315666667|0.008544004|3|0.96142132|0.008544004|0.00697615|0|1|NS|
|1.667|1.5625|A2058|0.140666667|0.01473092|3|0.879166667|0.010440307|0.008524475|-12.66940257|0.000223512|***|
|1.667|1.5625|A375|0.171|0.006806859|3|0.764530551|0.00486484|0.003972125|-19.55292565|4.03E-05|***|
|1.667|1.5625|FB|0.248666667|0.001|3|0.757360406|0.001|0.000816497|0|1|NS|
|1.667|3.125|A2058|0.129333333|0.007505553|3|0.808333333|0.008534245|0.006968182|-14.01609079|0.000150331|***|
|1.667|3.125|A375|0.150666667|0.005567764|3|0.673621461|0.007756718|0.006333333|-12.05263158|0.000271738|***|
|1.667|3.125|FB|0.227|0.009451631|3|0.691370558|0.009451631|0.007717225|0|1|NS|
|1.667|6.25|A2058|0.107|0.010016653|3|0.66875|0.010969655|0.008956686|-10.16000796|0.000528488|***|
|1.667|6.25|A375|0.127666667|0.008185353|3|0.570789866|0.010181683|0.008313309|-8.460329215|0.001069541|**|
|1.667|6.25|FB|0.198|0.011846237|3|0.603045685|0.011846237|0.009672412|0|1|NS|
I have 3 cell lines which include 1 control. The SignificanceOfChange were obtained from comparing the 2 experimental cell lines to the 1 control cell line (so the control celll line has NS in SignifAnnotation)
and part of my current bar chart looks like this (x-axis is CellLine, y-axis is CellViability , and each facet represents a different combination of DrugAConc and DrugBConc )
I think maybe with a for loop, I can iterate through each of the row in my dataframe and add the signif annotation one-by-one? However, I cannot get a annotation_df to work as it does in their Advanced Example. Could someone help me out on this? Thanks!