提交 898acb06 编写于 作者: rictjo's avatar rictjo

simp

上级 3e6127a3
......@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name = "impetuous-gfa",
version = "0.21.2",
version = "0.21.4",
author = "Richard Tjörnhammar",
author_email = "richard.tjornhammar@gmail.com",
description = "Impetuous Quantification, Alignments, Enrichments and Group Analysis",
......
......@@ -39,9 +39,9 @@ def padded_rolling_average( tv , tau ) :
return ( tv )
if len(tv)<tau :
return ( [ np.mean(v_) for v_ in tv ] )
centered = lambda x:(np.min(x),np.max(x)) ; N=len(tv);
centered = lambda x:(x[0],x[1]) ; N=len(tv);
w = int(np.floor(np.abs(tau)*0.5)) ;
jid = lambda i,w,N:[int((i-w)>0)*(i-w)%N,i,int(i+w<N)*(i+w)%N+int(i+w>=N)*(N-1)]
jid = lambda i,w,N:[int((i-w)>0)*((i-w)%N),int(i+w<N)*((i+w)%N)+int(i+w>=N)*(N-1)]
idx = [ centered( jid(i,w,N) ) for i in range(N) ]
mvalues = [ np.mean(tv[i[0]:i[1]]) for i in idx ]
return ( mvalues )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册