Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #46 from a-slide/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
a-slide authored Oct 20, 2020
2 parents 489f4c0 + 7a1d22f commit a4d8312
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "0.4.22" %}
{% set version = "0.4.23" %}
{% set name = "pycoMeth" %}

package:
Expand Down
53 changes: 27 additions & 26 deletions pycoMeth/Meth_Comp.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,32 +356,33 @@ def multitest_adjust(self):
pvalue_list.append(res["pvalue"])

# Adjust values
adj_pvalue_list = multipletests(
pvals = pvalue_list,
alpha = self.pvalue_threshold,
method = self.pvalue_adj_method)[1]

# add adjusted values to appropriate category
for i, adj_pvalue in zip(pvalue_idx, adj_pvalue_list):

# Fix and categorize p-values
if adj_pvalue is np.nan or adj_pvalue is None or adj_pvalue>1 or adj_pvalue<0:
adj_pvalue = 1.0
comment="Non-significant pvalue"

elif adj_pvalue <= self.pvalue_threshold:
# Correct very low pvalues to minimal float size
if adj_pvalue == 0:
adj_pvalue = self.min_pval
# update counter if pval is still significant after adjustment
comment = "Significant pvalue"
else:
comment= "Non-significant pvalue"

# update counters and update comment and adj pavalue
self.counter[comment]+=1
self.res_list[i]["comment"] = comment
self.res_list[i]["adj_pvalue"] = adj_pvalue
if pvalue_list:
adj_pvalue_list = multipletests(
pvals = pvalue_list,
alpha = self.pvalue_threshold,
method = self.pvalue_adj_method)[1]

# add adjusted values to appropriate category
for i, adj_pvalue in zip(pvalue_idx, adj_pvalue_list):

# Fix and categorize p-values
if adj_pvalue is np.nan or adj_pvalue is None or adj_pvalue>1 or adj_pvalue<0:
adj_pvalue = 1.0
comment="Non-significant pvalue"

elif adj_pvalue <= self.pvalue_threshold:
# Correct very low pvalues to minimal float size
if adj_pvalue == 0:
adj_pvalue = self.min_pval
# update counter if pval is still significant after adjustment
comment = "Significant pvalue"
else:
comment= "Non-significant pvalue"

# update counters and update comment and adj pavalue
self.counter[comment]+=1
self.res_list[i]["comment"] = comment
self.res_list[i]["adj_pvalue"] = adj_pvalue

#~~~~~~~~~~~~~~~~~~~~~~~~~~~Comp_Writer HELPER CLASS~~~~~~~~~~~~~~~~~~~~~~~~~~~#
class Comp_Writer():
Expand Down
2 changes: 1 addition & 1 deletion pycoMeth/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-

# Define self package variable
__version__ = "0.4.22"
__version__ = "0.4.23"
__description__ = 'DNA methylation analysis downstream to Nanopolish for Oxford Nanopore DNA sequencing datasets'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Define package info
name = "pycoMeth"
version = "0.4.22"
version = "0.4.23"
description = "DNA methylation analysis downstream to Nanopolish for Oxford Nanopore DNA sequencing datasets"
with open("README.md", "r") as fh:
long_description = fh.read()
Expand Down

0 comments on commit a4d8312

Please sign in to comment.