Skip to content

Commit

Permalink
fix missing import for Misc in make_data_dict call
Browse files Browse the repository at this point in the history
  • Loading branch information
dportik committed Aug 22, 2020
1 parent 4da6b72 commit a745616
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Plotting/Make_Plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import numpy
import dadi
import Plotting_Functions
from dadi import Numerics, PhiManip, Integration
from dadi import Numerics, PhiManip, Integration, Misc
from dadi.Spectrum_mod import Spectrum

#===========================================================================
Expand All @@ -63,7 +63,7 @@

#**************
#path to your input file
snps = "/Users/portik/Documents/GitHub/Testing_version/dadi_pipeline/Example_Data/dadi_2pops_North_South_snps.txt"
snps = "/Users/portik/Documents/GitHub/dadi_pipeline/Two_Population_Pipeline/Example_Data/dadi_2pops_North_South_snps.txt"

#Create python dictionary from snps file
dd = Misc.make_data_dict(snps)
Expand All @@ -78,7 +78,7 @@

#Convert this dictionary into folded AFS object
#[polarized = False] creates folded spectrum object
fs = dadi.Spectrum.from_data_dict(dd, pop_ids=pop_ids, projections = proj, polarized = False)
fs = Spectrum.from_data_dict(dd, pop_ids=pop_ids, projections = proj, polarized = False)

#print some useful information about the afs or jsfs
print("\n\n============================================================================")
Expand Down Expand Up @@ -121,11 +121,11 @@ def sym_mig(params, ns, pts):
"""
nu1, nu2, m, T = params

xx = dadi.Numerics.default_grid(pts)
phi = dadi.PhiManip.phi_1D(xx)
phi = dadi.PhiManip.phi_1D_to_2D(xx, phi)
phi = dadi.Integration.two_pops(phi, xx, T, nu1, nu2, m12=m, m21=m)
fs = dadi.Spectrum.from_phi(phi, ns, (xx,xx))
xx = Numerics.default_grid(pts)
phi = PhiManip.phi_1D(xx)
phi = PhiManip.phi_1D_to_2D(xx, phi)
phi = Integration.two_pops(phi, xx, T, nu1, nu2, m12=m, m21=m)
fs = Spectrum.from_phi(phi, ns, (xx,xx))
return fs

#create a prefix based on the population names to label the output files
Expand Down
Binary file added Plotting/Plotting_Functions.pyc
Binary file not shown.

0 comments on commit a745616

Please sign in to comment.