Closed sgravel closed 4 years ago
I think the issue is that my simulation and dom's code understand time in different directions. Shouldn't be too hard to fix.
I fixed the direction of time in the from_founders
method. But now I either get the error above or this error message:
~/opt/miniconda3/lib/python3.7/site-packages/msprime/simulations.py in simulate(sample_size, Ne, length, recombination_rate, recombination_map, mutation_rate, population_configurations, pedigree, migration_matrix, demographic_events, samples, model, record_migrations, random_seed, mutation_generator, num_replicates, replicate_index, from_ts, start_time, end_time, record_full_arg, num_labels, record_provenance, gene_conversion_rate, gene_conversion_track_length)
570 sim, mutation_generator, replicate_index + 1, provenance_dict, end_time)
571 # Return the last element of the iterator
--> 572 ts = next(iterator)
573 for ts in iterator:
574 continue
~/opt/miniconda3/lib/python3.7/site-packages/msprime/simulations.py in _replicate_generator(sim, mutation_generator, num_replicates, provenance_dict, end_time)
172
173 for j in range(num_replicates):
--> 174 sim.run(end_time)
175 replicate_provenance = None
176 if encoded_provenance is not None:
~/opt/miniconda3/lib/python3.7/site-packages/msprime/simulations.py in run(self, end_time)
869 end_time = np.inf if end_time is None else end_time
870 logger.debug("Running simulation until maximum: %f", end_time)
--> 871 self.ll_sim.run(end_time)
872 self.ll_sim.finalise_tables()
873
LibraryError: Bad simulator state. Initialise or reset must be called.
I got this error with Dom's pedigree file as well (data/wf_ped_1000probands_0_2_growthrate.txt
). Any ideas what could be going on?
This should be resolved in bc1fc0cec. Simulating with Pedigree.simulate_from_founders
should work. Looking into getting the balsac input and Dom's wf sim input working
Round-trip to and from BALSAC tables implemented in 2731971
I added a couple of methods to the
Pedigree
class to allow us to generate coalescent simulations on top of a particular pedigree. The methodgenerate_msprime_simulations
now provides an interface to generate simulations with the following parameters:Implementation follows example in Dom's repo. However, I keep getting the following error when trying to simulate with the genealogies we have:
Any ideas what could be the issue? @DomNelson, @ivan-krukov