To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 62ee2852 authored by Eva Bons's avatar Eva Bons

installable via setup.py

parent 0096d0f1
from gui import gui_run
import os
from collections import OrderedDict
import matplotlib
matplotlib.use('TkAgg')
from appJar import gui
import yaml
import scenarios
from collections import OrderedDict
import fasta_tools
from IPython.utils.capture import capture_output
def select():
......@@ -69,35 +70,39 @@ def settings_press(btn):
elif btn == 'view nj tree':
app.thread(fasta_tools.njTree(fasta_string=settings['fasta_text']))
os.chdir(os.path.dirname(os.path.abspath(__file__)))
with gui('SeqSim') as app:
dir_path = os.path.dirname(os.path.realpath(__file__))
dir_path_up = os.sep.join(dir_path.split(os.sep)[:-1])
sim_settings_path = dir_path_up+os.sep+'SeqSimEvo'+os.sep+'simulation_settings/'
Organism_options = os.listdir(sim_settings_path)
app.addLabelOptionBox('Organism',Organism_options)
scenario_settings_path = dir_path_up+os.sep+'Scenarios'+os.sep+'settings_files/'
Scenario_options = os.listdir(scenario_settings_path)
app.addLabelOptionBox('Scenario',Scenario_options)
app.addButton('select',select)
app.addLabel('Org','Organism settings')
app.setLabelBg('Org','grey')
app.addTextArea('OrgSet')
app.getTextAreaWidget('OrgSet').config(font="Courier 20")
app.addButton('save organism settings',settings_press)
app.addLabel('Scen','Scenario settings')
app.setLabelBg('Scen','grey')
app.addTextArea('ScenSet')
app.getTextAreaWidget('ScenSet').config(font="Courier 20")
app.addButtons(['save scenario settings','run'],settings_press)
app.addLabel('fasta','simulation output')
app.setLabelBg('fasta','grey')
app.addTextArea('fasta_text')
app.getTextAreaWidget('fasta_text').config(font="Courier 20")
app.addButtons(['save fasta','view highlighter','view nj tree'],settings_press)
def gui_run():
os.chdir(os.path.dirname(os.path.abspath(__file__)))
with gui('SeqSim') as app:
global app
dir_path = os.path.dirname(os.path.realpath(__file__))
dir_path_up = os.sep.join(dir_path.split(os.sep)[:-1])
sim_settings_path = dir_path_up+os.sep+'SeqSimEvo'+os.sep+'simulation_settings/'
Organism_options = os.listdir(sim_settings_path)
app.addLabelOptionBox('Organism',Organism_options)
scenario_settings_path = dir_path_up+os.sep+'Scenarios'+os.sep+'settings_files/'
Scenario_options = os.listdir(scenario_settings_path)
app.addLabelOptionBox('Scenario',Scenario_options)
app.addButton('select',select)
app.addLabel('Org','Organism settings')
app.setLabelBg('Org','grey')
app.addTextArea('OrgSet')
app.getTextAreaWidget('OrgSet').config(font="Courier 20")
app.addButton('save organism settings',settings_press)
app.addLabel('Scen','Scenario settings')
app.setLabelBg('Scen','grey')
app.addTextArea('ScenSet')
app.getTextAreaWidget('ScenSet').config(font="Courier 20")
app.addButtons(['save scenario settings','run'],settings_press)
app.addLabel('fasta','simulation output')
app.setLabelBg('fasta','grey')
app.addTextArea('fasta_text')
app.getTextAreaWidget('fasta_text').config(font="Courier 20")
app.addButtons(['save fasta','view highlighter','view nj tree'],settings_press)
if __name__ == '__main__':
gui_run()
import os
import sys
dir_path = os.path.dirname(os.path.realpath(__file__))
dir_path_up = os.sep.join(dir_path.split(os.sep)[:-1])
sys.path.append(dir_path_up+os.sep+'Scenarios')
from virus_passaging import passaging
import time
import matplotlib.pyplot as plt
import numpy
import time
import tqdm
dir_path = os.path.dirname(os.path.realpath(__file__))
dir_path_up = os.sep.join(dir_path.split(os.sep)[:-1])
sys.path.append(dir_path_up+os.sep+'Scenarios')
from virus_passaging import passaging
class progress_plot():
def __init__(self):
......
import multiple_compartments
import recreate_dataset
import simple_sim
import virus_passaging
......@@ -6,10 +6,10 @@ unique mutations per sequence sample is matched as closely as possible. A versio
of this code was used for https://doi.org/10.1093/ve/vey029
"""
from __future__ import print_function
import SeqSimEvo as sim
from collections import Counter
import numpy as np
import pickle
import SeqSimEvo as sim
class stats(object):
def __init__(self):
......
......@@ -5,9 +5,10 @@ preforms a simple simulation of sequence evolution
'''
from __future__ import print_function
import SeqSimEvo as seq_sim
import argparse
import SeqSimEvo as seq_sim
def run(scenario_settings, sim_settings):
sim = seq_sim.Simulation(simulation_settings=sim_settings)
......
......@@ -5,15 +5,16 @@ Created on Thu Dec 15 13:42:33 2016
"""
from __future__ import print_function
import sys
import numpy as np
np.set_printoptions(threshold=sys.maxsize, suppress=True)
from collections import Counter
import random
from copy import copy, deepcopy
import time
import yaml
import os
import inspect
import numpy as np
np.set_printoptions(threshold=sys.maxsize, suppress=True)
import yaml
import scipy.stats as scats
class Seq(object):
......@@ -537,7 +538,7 @@ class Population():
def copy(self):
''' create a deep copy of the population'''
return Population(self.sim.copy(self.sim.settings['name']+'_copy'),deepcopy(self.changes),deepcopy(self.changed),self.n_seq)
return Population(self.sim.copy(str(self.sim.settings['name'])+'_copy'),deepcopy(self.changes),deepcopy(self.changed),self.n_seq)
def print_sample(self, seq_ids):
''' print a summary of the mutations that have occured
......
(c) 2019 Eva Bons
# seq_sim - simulations of viral diversification
## installation
......
"""A setuptools based setup module.
See:
https://packaging.python.org/guides/distributing-packages-using-setuptools/
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from os import path
# io.open is needed for projects that support Python 2.7
# It ensures open() defaults to text mode with universal newlines,
# and accepts an argument to specify the text encoding
# Python 3 only projects can skip this import
from io import open
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'readme.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='SeqSimEvo',
version='0.1',
description='Simulation of sequence evolution with selection',
long_description=long_description,
long_description_content_type='text/markdown',
url='', # TODO: add
author='Eva Bons',
author_email='eva.bons@gmail.com',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
python_requires='>=2.7',
install_requires=['matplotlib==2.2','appJar','pyyaml','numpy==1.15','tqdm','scipy==1.1'],
package_data={
'Scenarios': ['settings_files/*'],
'SeqSimEvo': ['simulation_settings/*']
},
entry_points={
'console_scripts': [
'SeqSimEvo=GUI:gui_run',
],
},
project_urls={ # Optional
'Bug Reports': '',
'Funding': '',
'Source': '',
},
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment