Skip to content

Commit

Permalink
changes to reflect numpy and pandas deprecation for geneprofile
Browse files Browse the repository at this point in the history
  • Loading branch information
Acribbs committed Apr 1, 2024
1 parent 1ec3733 commit e39589a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cgat/BamTools/geneprofile.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ class IntervalsCounter:
if self.normalization in ("max", "sum", "total-max", "total-sum"):
self.dtype = numpy.float
else:
self.dtype = numpy.int
self.dtype = numpy.int64
self.aggregate_counts.append(numpy.zeros(length, dtype=self.dtype))

def setOutputProfiles(self, outfile_profiles):
Expand All @@ -587,7 +587,7 @@ class IntervalsCounter:
self.dtype = numpy.float
self.format = "%6.4f"
else:
self.dtype = numpy.int
self.dtype = numpy.int64
self.format = "%i"

for x,c in enumerate(self.aggregate_counts):
Expand Down
12 changes: 6 additions & 6 deletions cgat/Stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def doFDRPython(pvalues,
vlambda = numpy.arange(0, 0.95, 0.05)

m = len(pvalues)
pvalues = numpy.array(pvalues, dtype=numpy.float)
pvalues = numpy.array(pvalues, dtype=numpy.float64)

if pi0 is None:
if type(vlambda) == float:
Expand All @@ -525,7 +525,7 @@ def doFDRPython(pvalues,
pi0 = min(pi0, 1.0)
else:

pi0 = numpy.zeros(len(vlambda), numpy.float)
pi0 = numpy.zeros(len(vlambda), numpy.float64)

for i in range(len(vlambda)):
pi0[i] = numpy.mean([x >= vlambda[i]
Expand Down Expand Up @@ -558,8 +558,8 @@ def doFDRPython(pvalues,

minpi0 = min(pi0)

mse = numpy.zeros(len(vlambda), numpy.float)
pi0_boot = numpy.zeros(len(vlambda), numpy.float)
mse = numpy.zeros(len(vlambda), numpy.float64)
pi0_boot = numpy.zeros(len(vlambda), numpy.float64)

for i in range(100):
# sample pvalues
Expand Down Expand Up @@ -674,7 +674,7 @@ def getHeaders(cls):


def filterMasked(xvals, yvals, missing=("na", "Nan", None, ""),
dtype=numpy.float):
dtype=numpy.float64):
"""convert xvals and yvals to numpy array skipping pairs with
one or more missing values."""
xmask = [i in missing for i in xvals]
Expand Down Expand Up @@ -1041,7 +1041,7 @@ def adjustPValues(pvalues, method='fdr', n=None):
method = "BH"

# optional, remove NA values
p = numpy.array(pvalues, dtype=numpy.float)
p = numpy.array(pvalues, dtype=numpy.float64)
lp = len(p)

assert n <= lp
Expand Down

0 comments on commit e39589a

Please sign in to comment.