Skip to content

Commit

Permalink
Make posthoc stats saving optional
Browse files Browse the repository at this point in the history
  • Loading branch information
kynnemall authored Nov 26, 2021
1 parent 4cbfc7b commit 1140acc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions superviolin/superviolin/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,10 @@ def get_statistics(self, centre_val="mean", paired="no",

# round p values to 3 decimal places in posthoc tests
posthoc = posthoc.round(3)
# save statistics to file
posthoc.to_csv(f"posthoc_statistics_{self.y}.txt", sep="\t")
print("Posthoc statistics saved to txt file")
# save statistics to file if they aren't being returned at end of method
if not return_:
posthoc.to_csv(f"posthoc_statistics_{self.y}.txt", sep="\t")
print("Posthoc statistics saved to txt file")
elif num_groups == 2:
if paired == "no":
# independent t-test
Expand Down Expand Up @@ -716,4 +717,4 @@ def get_statistics(self, centre_val="mean", paired="no",
return p, paired
else:
return p, posthoc


0 comments on commit 1140acc

Please sign in to comment.