Skip to content

Commit

Permalink
made a script for summarizing 2 locus SFS output from ms2TwoSite
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewkern committed Oct 9, 2018
1 parent 07a15b3 commit 6bb7fca
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions twoSite2SFS.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import sys
import numpy as np

fn = sys.argv[1]
if fn == "stdin":
fhandle = sys.stdin
else:
fhandle = open(sys.argv[1])

for f in fhandle:
if "n" in f:
for line in fhandle:
N = int(line.split()[0])
sfs = np.zeros([N,N,N])
break
elif "//" in f:
print(sfs.flatten())
else:
toks = f.strip().split()
sfs[int(toks[1]),int(toks[2]),int(toks[3])] += 1



0 comments on commit 6bb7fca

Please sign in to comment.