-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetParam.py
75 lines (60 loc) · 3.53 KB
/
setParam.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#######################################################################
################# Parameters used in the CARP program #################
# Marie Zufferey - UNIL - December 2015 ###############################
# License: Open Source AGPL v3 ########################################
#######################################################################
# You can edit this file to change some default parameters.
#************
# General parameters
#************
# needed to test if Windows or Python
from subprocess import Popen, PIPE
import platform
# Set working directory (needed for read and save files)
if platform.system() != "Windows":
wd = Popen("pwd", shell=True, stdout=PIPE).communicate()[0].decode("ascii").strip()+"/" # for UNIX
else:
wd = ""
# Separator used in the input files (if only one input file, set the same for both)
sepP = "," # [char] Separator used in the polymorphisms file
sepH = "," # [char] Separator used in the haplogroups file
# Which column contains the haplogroup information
haploCol = 1 # [integer] column that contains HG information (numbering not include row names)
# Which row to use as header ? (if only one input file, set the same for both)
hdrP = 0 # [integer] row number(s) to use as the column names for the file with recent polymorphism
hdrH = 0 # [integer] row number(s) to use as the column names for the file with haplogroups
# Format of the output
treePlotFormat = "png" # [char] Format of the tree plot: png or svg
# in order to save tree
treeFormat = "newick" # [char] Format of the tree: Newick or NEXUS
# ! Warning ! : if you change the treePlotFormat and treeFormat parameters,
# you need to comment/uncomment some lines in "CARPfcts.py" script
# (see explanations provided in this file)
plotName = "TreePlot"
treeName = "TreeText"
#************
# Parameters for Y-STR data only
#************
popCol = 0 # [integer] In which column are the population name (#)
# set 0 if no column with population
polyCol1 = 2 # [integer] first column that contains microsatellites data
polyCol2 = 0 # [integer] last column that contains microsatellites data
# if microsatellite until from polyCol1 to the end of the file -> polyCol2 = 0
#************
# The following parameters are overwritten if the program is launched from commmand line
#************
# Verbose program or not ?
verb = False # [boolean] True or False
# Comment one of the two following lines (...TreeP if paternal lineage, ...TreeM if maternal lineage)
# or give the path to your own file
allHaploTreeName = "allHaploTreeP.newick" # for paternal lineage
# allHaploTreeName = "allHaploTreeM.newick" # for maternal lineage
# Path to the files containing haplogroup and recent polymorphism data
if platform.system() != "Windows":
polyFile = "foo.csv" # [char] path to the file containing recent polymorphism data
haploFile = "foo.csv" # [char] path to the file containing the haplogroup data
else:
polyFile = "data\\foo.csv" # [char] path to the file containing recent polymorphism data
haploFile = "data\\foo_HG.csv" # [char] path to the file containing the haplogroup data
# Construct the tree using sequence data or microsatellite recent polymorphism data ?
analysis = "str" # [char] "seq" or "str"