Mercurial > repos > thanhlv > data_manager_build_ariba_database
annotate data_manager/ariba_database_builder.py @ 5:78bf08fa1e75 draft
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
| author | thanhlv |
|---|---|
| date | Sun, 19 May 2019 08:12:57 -0400 |
| parents | be46816110b4 |
| children | 218301fbbb99 |
| rev | line source |
|---|---|
|
4
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
1 import sys |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
2 import subprocess |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
3 import shlex |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
4 import shutil |
|
0
a8bb47cc7625
planemo upload for repository tbd commit 0af229dbbda0496819ca95938c2e0628db689134
thanhlv
parents:
diff
changeset
|
5 import argparse |
|
a8bb47cc7625
planemo upload for repository tbd commit 0af229dbbda0496819ca95938c2e0628db689134
thanhlv
parents:
diff
changeset
|
6 import json |
|
a8bb47cc7625
planemo upload for repository tbd commit 0af229dbbda0496819ca95938c2e0628db689134
thanhlv
parents:
diff
changeset
|
7 import os |
|
a8bb47cc7625
planemo upload for repository tbd commit 0af229dbbda0496819ca95938c2e0628db689134
thanhlv
parents:
diff
changeset
|
8 import shutil |
|
4
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
9 import errno |
|
0
a8bb47cc7625
planemo upload for repository tbd commit 0af229dbbda0496819ca95938c2e0628db689134
thanhlv
parents:
diff
changeset
|
10 |
|
a8bb47cc7625
planemo upload for repository tbd commit 0af229dbbda0496819ca95938c2e0628db689134
thanhlv
parents:
diff
changeset
|
11 |
|
4
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
12 data_table_name = "ariba_databases" |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
13 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
14 mlst_dict = { |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
15 "achs" : "Achromobacter spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
16 "acib1" : "Acinetobacter baumannii#1", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
17 "acib2" : "Acinetobacter baumannii#2", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
18 "aers" : "Aeromonas spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
19 "anap" : "Anaplasma phagocytophilum", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
20 "arcs" : "Arcobacter spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
21 "aspf" : "Aspergillus fumigatus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
22 "bacc" : "Bacillus cereus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
23 "bacl" : "Bacillus licheniformis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
24 "bacs" : "Bacillus subtilis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
25 "barb" : "Bartonella bacilliformis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
26 "barh" : "Bartonella henselae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
27 "bors" : "Bordetella spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
28 "borr" : "Borrelia spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
29 "brah" : "Brachyspira hampsonii", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
30 "brach" : "Brachyspira hyodysenteriae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
31 "brai" : "Brachyspira intermedia", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
32 "brap" : "Brachyspira pilosicoli", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
33 "bras" : "Brachyspira spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
34 "brus" : "Brucella spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
35 "bucc" : "Burkholderia cepacia complex", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
36 "burp" : "Burkholderia pseudomallei", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
37 "camc" : "Campylobacter concisus/curvus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
38 "camf" : "Campylobacter fetus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
39 "camh" : "Campylobacter helveticus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
40 "rlis" : "Campylobacter hyointestinalis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
41 "cami" : "Campylobacter insulaenigrae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
42 "camj" : "Campylobacter jejuni", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
43 "caml" : "Campylobacter lanienae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
44 "rari" : "Campylobacter lari", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
45 "cams" : "Campylobacter sputorum", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
46 "camu" : "Campylobacter upsaliensis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
47 "cana" : "Candida albicans", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
48 "cang" : "Candida glabrata", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
49 "cank" : "Candida krusei", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
50 "cant" : "Candida tropicalis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
51 "cals" : "Candidatus Liberibacter solanacearum", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
52 "carm" : "Carnobacterium maltaromaticum", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
53 "chls" : "Chlamydiales spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
54 "citf" : "Citrobacter freundii", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
55 "clos" : "Clonorchis sinensis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
56 "clob" : "Clostridium botulinum", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
57 "clod" : "Clostridium difficile", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
58 "mcum" : "Clostridium septicum", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
59 "cord" : "Corynebacterium diphtheriae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
60 "cros" : "Cronobacter spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
61 "dicn" : "Dichelobacter nodosus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
62 "edws" : "Edwardsiella spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
63 "entc" : "Enterobacter cloacae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
64 "entf" : "Enterococcus faecalis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
65 "sium" : "Enterococcus faecium", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
66 "escc1" : "Escherichia coli#1", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
67 "escc2" : "Escherichia coli#2", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
68 "flap" : "Flavobacterium psychrophilum", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
69 "gala" : "Gallibacterium anatis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
70 "haei" : "Haemophilus influenzae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
71 "haep" : "Haemophilus parasuis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
72 "helc" : "Helicobacter cinaedi", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
73 "help" : "Helicobacter pylori", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
74 "hels" : "Helicobacter suis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
75 "kink" : "Kingella kingae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
76 "klea" : "Klebsiella aerogenes", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
77 "kleo" : "Klebsiella oxytoca", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
78 "klep" : "Klebsiella pneumoniae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
79 "kuds" : "Kudoa septempunctata", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
80 "lacs" : "Lactobacillus salivarius", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
81 "leps" : "Leptospira spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
82 "leps2" : "Leptospira spp.#2", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
83 "leps3" : "Leptospira spp.#3", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
84 "lism" : "Listeria monocytogenes", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
85 "macc" : "Macrococcus canis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
86 "scus" : "Macrococcus caseolyticus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
87 "manh" : "Mannheimia haemolytica", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
88 "melp" : "Melissococcus plutonius", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
89 "morc" : "Moraxella catarrhalis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
90 "mycs" : "Mycobacteria spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
91 "myca" : "Mycobacterium abscessus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
92 "mycm" : "Mycobacterium massiliense", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
93 "mycoa" : "Mycoplasma agalactiae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
94 "mycb" : "Mycoplasma bovis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
95 "mych" : "Mycoplasma hyopneumoniae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
96 "anis" : "Mycoplasma hyorhinis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
97 "myci" : "Mycoplasma iowae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
98 "mycp" : "Mycoplasma pneumoniae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
99 "mycos" : "Mycoplasma synoviae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
100 "neis" : "Neisseria spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
101 "orit" : "Orientia tsutsugamushi", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
102 "ornr" : "Ornithobacterium rhinotracheale", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
103 "pael" : "Paenibacillus larvae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
104 "pasm1" : "Pasteurella multocida#1", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
105 "pasm2" : "Pasteurella multocida#2", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
106 "pedp" : "Pediococcus pentosaceus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
107 "phod" : "Photobacterium damselae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
108 "piss" : "Piscirickettsia salmonis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
109 "porg" : "Porphyromonas gingivalis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
110 "proa" : "Propionibacterium acnes", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
111 "psea" : "Pseudomonas aeruginosa", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
112 "psef" : "Pseudomonas fluorescens", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
113 "psep" : "Pseudomonas putida", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
114 "rhos" : "Rhodococcus spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
115 "riea" : "Riemerella anatipestifer", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
116 "sale" : "Salmonella enterica", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
117 "sapp" : "Saprolegnia parasitica", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
118 "sins" : "Sinorhizobium spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
119 "staa" : "Staphylococcus aureus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
120 "stae" : "Staphylococcus epidermidis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
121 "stah" : "Staphylococcus haemolyticus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
122 "snis" : "Staphylococcus hominis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
123 "stal" : "Staphylococcus lugdunensis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
124 "stap" : "Staphylococcus pseudintermedius", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
125 "stem" : "Stenotrophomonas maltophilia", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
126 "stra" : "Streptococcus agalactiae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
127 "sbcx" : "Streptococcus bovis/equinus complex (SBSEC)", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
128 "strc" : "Streptococcus canis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
129 "stde" : "Streptococcus dysgalactiae equisimilis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
130 "strg" : "Streptococcus gallolyticus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
131 "stro" : "Streptococcus oralis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
132 "strp" : "Streptococcus pneumoniae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
133 "snes" : "Streptococcus pyogenes", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
134 "strs" : "Streptococcus suis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
135 "strt" : "Streptococcus thermophilus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
136 "strt2" : "Streptococcus thermophilus#2", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
137 "stru" : "Streptococcus uberis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
138 "strz" : "Streptococcus zooepidemicus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
139 "sspp" : "Streptomyces spp", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
140 "tays" : "Taylorella spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
141 "tens" : "Tenacibaculum spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
142 "trep" : "Treponema pallidum", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
143 "triv" : "Trichomonas vaginalis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
144 "ures" : "Ureaplasma spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
145 "vibc" : "Vibrio cholerae", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
146 "vibc2" : "Vibrio cholerae#2", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
147 "vibp" : "Vibrio parahaemolyticus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
148 "vibs" : "Vibrio spp.", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
149 "vibt" : "Vibrio tapetis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
150 "vibv" : "Vibrio vulnificus", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
151 "wolb" : "Wolbachia", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
152 "xylf" : "Xylella fastidiosa", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
153 "yerp" : "Yersinia pseudotuberculosis", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
154 "yerr" : "Yersinia ruckeri", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
155 "yers" : "Yersinia spp." |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
156 } |
|
0
a8bb47cc7625
planemo upload for repository tbd commit 0af229dbbda0496819ca95938c2e0628db689134
thanhlv
parents:
diff
changeset
|
157 |
|
a8bb47cc7625
planemo upload for repository tbd commit 0af229dbbda0496819ca95938c2e0628db689134
thanhlv
parents:
diff
changeset
|
158 |
|
4
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
159 genes_dict = { |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
160 "card" : "CARD", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
161 "resfinder" : "Resfinder", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
162 "plasmidfinder" : "Plasmidfinder", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
163 "megares" : "Megares", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
164 "argannot" : "Argannot", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
165 "vfdb_core" : "vfdb_core", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
166 "vfdb_full" : "vfdb_full", |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
167 "virulencefinder" : "virulencefinder" |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
168 } |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
169 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
170 def run_ariba(cmd): |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
171 _cmd = shlex.split(cmd) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
172 subprocess.check_call(_cmd) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
173 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
174 def build_mlst(mlst_db): |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
175 mlst_species = mlst_dict[mlst_db] |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
176 run_ariba("ariba pubmlstget '{}' out".format(mlst_species)) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
177 output_path = os.getcwd() |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
178 old = "{}/out/ref_db".format(output_path, mlst_db) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
179 new = "{}/{}".format(output_path, mlst_db) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
180 shutil.move(old, new) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
181 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
182 def build_curated_db(gen_db): |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
183 run_ariba("ariba getref {} out".format(gen_db)) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
184 run_ariba("ariba prepareref -f out.fa -m out.tsv {}".format(gen_db)) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
185 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
186 def build_custom_db(fasta, coding, db_name): |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
187 run_ariba("ariba prepareref --all_coding {} -f {} {}".format(coding, fasta, db_name)) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
188 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
189 def _add_data_table_entry(data_manager_dict, data_table_name, data_table_entry): |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
190 data_manager_dict['data_tables'] = data_manager_dict.get( 'data_tables', {} ) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
191 data_manager_dict['data_tables'][ data_table_name ] = data_manager_dict['data_tables'].get( data_table_name, [] ) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
192 data_manager_dict['data_tables'][ data_table_name ].append( data_table_entry ) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
193 return data_manager_dict |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
194 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
195 def main(): |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
196 parser = argparse.ArgumentParser() |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
197 parser.add_argument('params') |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
198 parser.add_argument( '-t', '--dbtype', dest='database_type', help='database type' ) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
199 parser.add_argument( '-d', '--db', dest='db_name', help='database name' ) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
200 parser.add_argument( '-c', '--coding', dest='coding', help='' ) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
201 parser.add_argument( '-f', '--fasta', dest='fasta', help='' ) |
|
0
a8bb47cc7625
planemo upload for repository tbd commit 0af229dbbda0496819ca95938c2e0628db689134
thanhlv
parents:
diff
changeset
|
202 args = parser.parse_args() |
|
4
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
203 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
204 if args.database_type == "curated": |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
205 build_curated_db(args.db_name) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
206 name = genes_dict[args.db_name] |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
207 elif args.database_type == "mlst": |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
208 build_mlst(args.db_name) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
209 name = mlst_dict[args.db_name] |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
210 elif args.database_type == "fasta": |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
211 build_custom_db(args.fasta, args.coding, args.db_name) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
212 name = args.db_name |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
213 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
214 params = json.loads(open(args.params).read()) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
215 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
216 target_directory = params['output_data'][0]['extra_files_path'] |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
217 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
218 if not os.path.isdir(target_directory): |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
219 os.mkdir(target_directory) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
220 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
221 output_path = os.getcwd() |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
222 shutil.copytree(os.path.join(output_path, args.db_name), os.path.join(target_directory, args.db_name)) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
223 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
224 data_manager_dict = {} |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
225 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
226 data_table_entry = { |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
227 "value": args.db_name, |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
228 "name": name, |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
229 "path": os.path.join(target_directory, args.db_name) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
230 } |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
231 _add_data_table_entry(data_manager_dict, data_table_name, data_table_entry) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
232 open(args.params, 'wb').write(json.dumps(data_manager_dict)) |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
233 |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
234 if __name__ == "__main__": |
|
be46816110b4
planemo upload for repository https://github.com/thanhleviet/galaxy-tools commit 98648bbb7796db528b5685d44a2a5b761c53c19b-dirty
thanhlv
parents:
3
diff
changeset
|
235 main() |
