Skip to content

Commit

Permalink
dealing with errors from updated software version
Browse files Browse the repository at this point in the history
  • Loading branch information
KatyBrown committed May 13, 2024
1 parent fadba67 commit 9ee480c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
psutil>=5.8.0
matplotlib==3.3.4
matplotlib>=3.3.4
numpy>=1.19
scikit_image>=0.19.2
pandas>=0.25.3
Expand Down
8 changes: 7 additions & 1 deletion tests/pwmTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def setUp(self):
sep="\t", header=None, index_col=0)
tab.columns = pd.RangeIndex(np.shape(tab)[1])
self.matrices[mat][string] = tab
if mat == 'pfm':
self.matrices[mat][string] = self.matrices[
mat][string].astype(np.int64)

for stat in ['alpha', 'freq']:
self.matrices[stat][string] = np.load(
Expand Down Expand Up @@ -73,6 +76,7 @@ def testgetCoreRes(self, typ, expected):
def testmakePFM(self, typ, subtyp):
arr = self.arrs[subtyp]
PFM, RNA = matrices.makePFM(arr, typ)
PFM.dtype = np.int64
pandas.testing.assert_frame_equal(PFM, self.matrices['pfm'][subtyp],
check_names=False)

Expand All @@ -84,6 +88,7 @@ def testmakePPM(self, typ, subtyp, RNA):
PFM = self.matrices['pfm'][subtyp]
alpha = self.matrices['alpha'][subtyp]
PPM = matrices.makePPM(PFM, alpha).round(3)
PPM.dtype = np.int64
pandas.testing.assert_frame_equal(PPM, self.matrices['ppm'][subtyp])


Expand All @@ -94,6 +99,7 @@ def testmakePWM(self, typ, subtyp, RNA):
PPM = self.matrices['ppm'][subtyp]
freq = self.matrices['freq'][subtyp]
PWM = matrices.makePWM(PPM, freq)
PWM.dtype = np.int64
pandas.testing.assert_frame_equal(PWM, self.matrices['pwm'][subtyp])


Expand All @@ -116,7 +122,7 @@ def testmakePWM(self, typ, subtyp, RNA):
['xxx', 'nt', 'dna', True, np.zeros((1, 1))]])
def testgetFreq(self, freqtype, typ, subtyp, RNA, expected):
logger = logging.getLogger('path.to.module.under.test')
PFM = self.matrices['pfm'][subtyp]
PFM = self.matrices['pfm'][subtyp].astype(np.int64)
if freqtype == 'calc2':
PFM2 = self.matrices['pfm']['dna_large']
else:
Expand Down

0 comments on commit 9ee480c

Please sign in to comment.