Skip to content

Commit de83811

Browse files
committed
funciton for correlation that will filter for NaN values
1 parent d041a33 commit de83811

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/seqfun.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import matplotlib.colors as colors
44
import matplotlib.cm as cmx
55
import scipy.misc
6-
6+
import scipy.stats as st
77

88
def reverseComplement(seq, rna=None):
99
"""
@@ -140,3 +140,7 @@ def is_outlier(points, thresh=None):
140140

141141
def remove_outlier(points, thresh=None):
142142
return points[np.logical_not(is_outlier(points, thresh=thresh))]
143+
144+
def getCorrelation(vec1, vec2):
145+
index = np.all(np.isfinite(np.vstack([vec1, vec2])), axis=0)
146+
return st.pearsonr(vec1[index], vec2[index])[0]

0 commit comments

Comments
 (0)