'name': 'HapMap_pops', 'default' : HapMap3_pops, 'label' : 'Name of populations', 'description': '''Which HapMap populations to use?''', 'allowedTypes': [ListType, TupleType], 'chooseFrom': HapMap3_pops, 'validate': simuOpt.valueListOf(HapMap2_pops + HapMap3_pops), }, { 'name': 'markerList', 'default': 'hh550v3_snptable.txt', 'label': 'Marker list file', 'description': '''A file with a list of marker names. If there are more than one fields at a line, the rest of them are ignored.''', 'allowedTypes': [StringType], 'validate': simuOpt.valueOr(simuOpt.valueEqual(''), simuOpt.valueValidFile()), }, { 'name': 'chroms', 'default': [2,5,10], 'label': 'Chromosomes to use', 'description': 'A list of chromosomes (1-22) to use.', 'allowedTypes': [TupleType, ListType], 'chooseFrom':range(1,23), 'validate': simuOpt.valueListOf(simuOpt.valueBetween(1, 22)), }, { 'name': 'numMarkers', 'default': [2000,2000,2000], 'label': 'Number of markers to use', 'description': '''Number of markers to use for each chromosome. This
3. Returns the names of the files created. """ import simuOpt import analysisMethods options = [ {'name': 'formatters', 'default': [], 'chooseFrom':[x.split('.')[2] for x in analysisMethods.getAnalysisMethods()], 'label': 'Formatters', 'description': 'Names of analysis methods for which input files will be created.' }, {'name': 'inputfile', 'default': 'rep_1.pop', 'label': 'simuPOP Population', 'allowedTypes': types.StringType, 'validate': simuOpt.valueValidFile(), 'description': 'A simupop population file to parse and format.' } ] short_desc = """ Main formatting function to parse simuPOP population file and output the files necessary To run one or more analysis methods. """ if __name__ == "__main__": pars = simuOpt.Params(options, short_desc) if not pars.getParam(): sys.exit(1)
from simuPOP.utils import simulateForwardTrajectory, simulateBackwardTrajectory, migrSteppingStoneRates import os, sys, math, types, time options = [ { 'longarg': 'initPop=', 'default': 'init.pop', 'label': 'Initia population', 'allowedTypes': types.StringType, 'validate': simuOpt.valueValidFile(), 'description': 'An initial population created using script selectedMarkers.py' }, { 'longarg': 'dumpRec=', 'default': '', 'allowedTypes': types.StringType, 'description': '''This is a hidden option, if set, all recombination events will be dumped to the specified file. Please refer to the simuPOP user's guide for explanation of this file.''' },