Skip to content

Commit

Permalink
fix issue #73
Browse files Browse the repository at this point in the history
  • Loading branch information
nargesr committed Nov 7, 2023
1 parent 822885c commit 72da209
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions PyWGCNA/wgcna.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def runWGCNA(self):

return self

def analyseWGCNA(self, order=None, geneList=None, show=True):
def analyseWGCNA(self, order=None, geneList=None, show=True, alternative='two-sided'):
"""
Analysing results: 1.calculating module trait relationship 2.plotting module heatmap eigengene 3.finding GO term for each module
Expand All @@ -381,6 +381,8 @@ def analyseWGCNA(self, order=None, geneList=None, show=True):
:type geneList: pandas dataframe
:param show: indicate if you want to see plots in when you run your code
:type show: bool
:param alternative: Defines the alternative hypothesis for calculating correlation for module-trait relationship. Default is ‘two-sided’. The following options are available: 'two-sided’: the correlation is nonzero, ‘less’: the correlation is negative (less than zero), ‘greater’: the correlation is positive (greater than zero)
:type alternative: str
"""
print(f"{BOLD}{OKBLUE}Analysing WGCNA...{ENDC}")

Expand All @@ -397,7 +399,7 @@ def analyseWGCNA(self, order=None, geneList=None, show=True):

for i in self.MEs.columns:
for j in datTraits.columns:
tmp = stats.pearsonr(self.MEs[i], datTraits[j], alternative='greater')
tmp = stats.pearsonr(self.MEs[i], datTraits[j], alternative=alternative)
self.moduleTraitCor.loc[i, j] = tmp[0]
self.moduleTraitPvalue.loc[i, j] = tmp[1]

Expand Down

0 comments on commit 72da209

Please sign in to comment.