Mercurial > repos > fubar > jbrowse2
annotate autogenJB2.py @ 125:49f3d3878413 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author | fubar |
---|---|
date | Sat, 05 Oct 2024 23:58:05 +0000 |
parents | 878c27dfea9d |
children |
rev | line source |
---|---|
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
1 import argparse |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
2 import logging |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
3 import os |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
4 import sys |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
5 |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
6 from jbrowse2 import JbrowseConnector as jbC |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
7 |
67
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
8 |
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
9 logging.basicConfig(level=logging.DEBUG) |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
10 log = logging.getLogger("jbrowse") |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
11 |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
12 if __name__ == "__main__": |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
13 parser = argparse.ArgumentParser(description="", epilog="") |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
14 parser.add_argument("--sessName", help="Session name", default="AutoJBrowse") |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
15 parser.add_argument( |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
16 "--trackmeta", |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
17 help="Repeatable 'filename,filext,filepath,[bai/crai path for filesystem bam/cram]' for JBrowse2 tracks", |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
18 default=[], |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
19 action="append", |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
20 ) |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
21 parser.add_argument( |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
22 "--referencemeta", |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
23 help="Repeatable 'filename, filext, filepath, ... ,' for JBrowse2 reference tracks - usually only one needed", |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
24 default=[], |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
25 action="append", |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
26 ) |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
27 parser.add_argument( |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
28 "--pafmeta", |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
29 help="Repeatable. Each is a 'pafname, filext, filepath, ... ,' for a JBrowse2 paf track", |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
30 default=[], |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
31 action="append", |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
32 ) |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
33 parser.add_argument( |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
34 "--pafreferencemeta", |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
35 help="Repeatable. Each is a 'pafname,refpath,refname' Every pafname must have one or more", |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
36 default=[], |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
37 action="append", |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
38 ) |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
39 parser.add_argument( |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
40 "--jbrowse2path", help="Path to JBrowse2 directory in biocontainer or Conda" |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
41 ) |
39
bc57164eb270
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit ace841acd53be99494ed9bba8bb9e2ae212d3661
fubar
parents:
38
diff
changeset
|
42 parser.add_argument("--outdir", help="Output directory", required=True) |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
43 parser.add_argument("--version", "-V", action="version", version="%(prog)s 2.10.2") |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
44 args = parser.parse_args() |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
45 sessName = args.sessName |
77
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
46 default_session_data = {} |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
47 # --trackmeta $jbrowseme[$key],$jbrowseme[$key].ext,'$key' |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
48 trackList = [x.strip().split(",") for x in args.trackmeta if x > ""] |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
49 refList = [x.strip().split(",") for x in args.referencemeta if x > ""] |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
50 if len(refList) > 0: |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
51 listgenomes = [f for f in refList if f[1] in ["fasta", "fasta.gz"]] |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
52 # assume no pafs here |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
53 if len(listgenomes) > 0: |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
54 genome_paths = [x[0] for x in listgenomes] |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
55 genome_names = [x[2] for x in listgenomes] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
56 guseuri = [] |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
57 for x in genome_paths: |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
58 if x.startswith("http://") or x.startswith("https://"): |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
59 guseuri.append("yes") |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
60 else: |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
61 guseuri.append("no") |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
62 jc = jbC( |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
63 outdir=args.outdir, |
39
bc57164eb270
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit ace841acd53be99494ed9bba8bb9e2ae212d3661
fubar
parents:
38
diff
changeset
|
64 jbrowse2path=args.jbrowse2path, |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
60
diff
changeset
|
65 ) |
67
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
66 genomes = ( |
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
67 [ |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
68 { |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
69 "path": x, |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
70 "label": genome_names[i], |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
71 "useuri": guseuri[i], |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
72 "meta": { |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
73 "name": genome_names[i], |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
74 "dataset_dname": genome_names[i], |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
75 }, |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
76 } |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
77 for i, x in enumerate(genome_paths) |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
78 ], |
67
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
79 ) |
62
ab0d6782a95f
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2b6d4a24585beb1ba5055e5d34aacb3b299b1943-dirty
fubar
parents:
60
diff
changeset
|
80 assref_name = jc.process_genomes(genomes[0]) |
77
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
81 if not default_session_data.get(assref_name, None): |
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
82 default_session_data[assref_name] = { |
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
83 "tracks": [], |
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
84 "style": {}, |
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
85 "style_labels": {}, |
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
86 "visibility": { |
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
87 "default_on": [], |
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
88 "default_off": [], |
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
89 }, |
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
90 } |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
91 listtracks = trackList |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
92 # foo.paf must have a foo_paf.fasta or fasta.gz to match |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
93 tnames = [x[2] for x in listtracks] |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
94 texts = [x[1] for x in listtracks] |
113
878c27dfea9d
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 45375b64cbc99173525a2b374d71a13e650ce1b0
bgruening
parents:
98
diff
changeset
|
95 if len(listtracks) == 0: |
878c27dfea9d
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 45375b64cbc99173525a2b374d71a13e650ce1b0
bgruening
parents:
98
diff
changeset
|
96 sys.stderr.write( |
878c27dfea9d
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 45375b64cbc99173525a2b374d71a13e650ce1b0
bgruening
parents:
98
diff
changeset
|
97 "Please add at least one track (bam,bed,bigwig,blastxml,cram,gff,hic,maf,paf or vcf) to the collection. No suitable track files for autogenJB2 - nothing to process" |
878c27dfea9d
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 45375b64cbc99173525a2b374d71a13e650ce1b0
bgruening
parents:
98
diff
changeset
|
98 ) |
878c27dfea9d
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 45375b64cbc99173525a2b374d71a13e650ce1b0
bgruening
parents:
98
diff
changeset
|
99 sys.exit(5) |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
100 for i, track in enumerate(listtracks): |
67
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
101 track_conf = { |
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
102 "trackfiles": [], |
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
103 "category": "autogenerated", |
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
104 "assemblyNames": assref_name, |
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
105 } |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
106 tpath, trext, trackname = track[:3] |
48
460d5b6c5d98
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a-dirty
fubar
parents:
46
diff
changeset
|
107 track_conf["dataset_id"] = trackname |
52
ae12977c0e5e
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4-dirty
fubar
parents:
48
diff
changeset
|
108 useuri = "no" |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
109 if tpath.startswith("http://") or tpath.startswith("https://"): |
52
ae12977c0e5e
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4-dirty
fubar
parents:
48
diff
changeset
|
110 useuri = "yes" |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
111 if trext == "paf": |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
112 refname = trackname + "_paf.fasta" |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
113 refdat = [x[2] for x in listtracks if x[2] == refname] |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
114 if not refdat: |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
115 jc.logging.warn( |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
116 "No reference file %s corresponding to paf file %s found. Not building - there must be a corresponding fasta for each paf" |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
117 % (refname, trackname) |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
118 ) |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
119 sys.exit(3) |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
120 else: |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
121 track_conf.update( |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
122 { |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
123 "conf": { |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
124 "options": { |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
125 "paf": { |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
126 "genome": refdat, |
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
127 "genome_label": trackname, |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
128 } |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
129 } |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
130 } |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
131 } |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
132 ) |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
133 elif trext == "bam": |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
134 ipath = track[3] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
135 if not os.path.exists(ipath): |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
136 ipath = os.path.realpath( |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
137 os.path.join(jc.outdir, trackname + ".bai") |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
138 ) |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
139 cmd = [ |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
140 "samtools", |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
141 "index", |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
142 "-b", |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
143 "-o", |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
144 ipath, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
145 os.path.realpath(track[0]), |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
146 ] |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
147 sys.stdout.write("#### calling %s" % " ".join(cmd)) |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
148 jc.subprocess_check_call(cmd) |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
149 track_conf.update( |
98
b1260bca5fdc
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 44d8fc559ecf5463a8f753561976fa26686c96f6
bgruening
parents:
97
diff
changeset
|
150 {"conf": {"options": {"bam": {"bam_index": " %s ~ %s," % (tpath, ipath)}}}} |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
151 ) |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
152 elif trext == "cram": |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
153 ipath = track[3] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
154 if not os.path.exists(ipath): |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
155 ipath = os.path.realpath( |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
156 os.path.join("./", trackname + ".crai") |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
157 ) |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
158 cmd = [ |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
159 "samtools", |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
160 "index", |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
161 "-c", |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
162 "-o", |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
163 ipath, |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
164 os.path.realpath(track[0]), |
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
165 ] |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
166 jc.subprocess_check_call(cmd) |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
167 track_conf.update( |
93
4c517a0041a8
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit aeef2fbc0f90a9366851941ff51baeba410c56e4
fubar
parents:
92
diff
changeset
|
168 {"conf": {"options": {"cram": {"cram_index": "%s ~ %s," % (tpath, ipath)}}}} |
57
94264fe60478
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 4b5df41484f6bdf316edaf95b53c92d328ec1674-dirty
fubar
parents:
53
diff
changeset
|
169 ) |
48
460d5b6c5d98
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a-dirty
fubar
parents:
46
diff
changeset
|
170 track_conf["path"] = tpath |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
171 track_conf["format"] = trext |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
172 track_conf["name"] = trackname |
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
173 track_conf["label"] = trackname |
52
ae12977c0e5e
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 44df75b3714aa9e02983e0b67ef43fc0eee4a8d4-dirty
fubar
parents:
48
diff
changeset
|
174 track_conf["trackfiles"].append((tpath, trext, useuri, trackname, {})) |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
175 keys = jc.process_annotations(track_conf) |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
176 |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
177 if keys: |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
178 for key in keys: |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
179 if trext in [ |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
180 "bigwig", |
67
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
181 "gff", |
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
182 "gff3", |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
183 "vcf", |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
184 "maf", |
72
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
185 "bed", |
2bdb748df098
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 9d5e563dde653450723415b0fccd2ebb4b82477e
fubar
parents:
71
diff
changeset
|
186 "hic" |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
187 ]: |
77
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
188 default_session_data[assref_name]["visibility"]["default_on"].append(key) |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
189 else: |
77
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
190 default_session_data[assref_name]["visibility"]["default_off"].append( |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
191 key |
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
192 ) |
60
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
57
diff
changeset
|
193 if trext in ["gff", "gff3", "bed", "vcf", "maf", "blastxml"]: |
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
57
diff
changeset
|
194 ttype = "LinearBasicDisplay" |
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
57
diff
changeset
|
195 if trext == "vcf": |
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
57
diff
changeset
|
196 ttype = "LinearVariantDisplay" |
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
57
diff
changeset
|
197 style_json = { |
67
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
198 "type": ttype, |
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
199 "trackShowLabels": False, |
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
200 "trackShowDescriptions": False, |
60
81d535970196
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 403a35e1245fa5e62f4be6116a725b9e4d9c353a
fubar
parents:
57
diff
changeset
|
201 } |
77
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
202 default_session_data[assref_name]["style"][key] = style_json |
3dcda36b97b4
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit d03454f949af9f3fff638f6a3e52fe42bc96be3b-dirty
fubar
parents:
72
diff
changeset
|
203 default_session_data[assref_name]["tracks"].append(key) |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
204 # general_data = { |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
205 # "analytics": root.find("metadata/general/analytics").text, |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
206 # "primary_color": root.find("metadata/general/primary_color").text, |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
207 # "secondary_color": root.find("metadata/general/secondary_color").text, |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
208 # "tertiary_color": root.find("metadata/general/tertiary_color").text, |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
209 # "quaternary_color": root.find("metadata/general/quaternary_color").text, |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
210 # "font_size": root.find("metadata/general/font_size").text, |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
211 # } |
66
bc10ad1dfb98
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
65
diff
changeset
|
212 jc.add_general_configuration({}) |
65
c81902830900
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e
fubar
parents:
62
diff
changeset
|
213 trackconf = jc.config_json.get("tracks", []) |
c81902830900
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e
fubar
parents:
62
diff
changeset
|
214 for gnome in jc.genome_names: |
c81902830900
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e
fubar
parents:
62
diff
changeset
|
215 trackconf += jc.tracksToAdd[gnome] |
71
e26a8a6d2d2e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cf208cecf0140ff43d145a44713ab7108057fb8b
fubar
parents:
69
diff
changeset
|
216 logging.debug( |
69
7230a2422507
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2c7d6c19a42c421de987ebfdf927c64062ebd79f-dirty
fubar
parents:
67
diff
changeset
|
217 "++++ adding trackconf=%s for gnome %s" % (trackconf, gnome) |
67
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
218 ) |
65
c81902830900
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e
fubar
parents:
62
diff
changeset
|
219 jc.config_json["tracks"] = trackconf |
69
7230a2422507
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2c7d6c19a42c421de987ebfdf927c64062ebd79f-dirty
fubar
parents:
67
diff
changeset
|
220 assconf = jc.config_json.get("assemblies", []) |
7230a2422507
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2c7d6c19a42c421de987ebfdf927c64062ebd79f-dirty
fubar
parents:
67
diff
changeset
|
221 assconf += jc.assemblies |
7230a2422507
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2c7d6c19a42c421de987ebfdf927c64062ebd79f-dirty
fubar
parents:
67
diff
changeset
|
222 jc.config_json["assemblies"] = assconf |
71
e26a8a6d2d2e
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit cf208cecf0140ff43d145a44713ab7108057fb8b
fubar
parents:
69
diff
changeset
|
223 logging.debug("+++assemblies=%s, gnames=%s" % (assconf, jc.genome_names)) |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
224 jc.write_config() |
67
cefe9dbf1d80
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 6dac6d6debf44c68eae2785e926fb8420f76958e-dirty
fubar
parents:
66
diff
changeset
|
225 default_session_data.update({"session_name": sessName}) |
35
15da358c3108
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 80b849766a962bac4bd0bb8cb69c118cc42699cd-dirty
fubar
parents:
30
diff
changeset
|
226 track_conf.update(default_session_data) |
84
5c295cc220ed
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2dad2139324940fbff8aa089a72641800211e2d9-dirty
fubar
parents:
77
diff
changeset
|
227 jc.add_default_session(default_session_data) |
5c295cc220ed
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 2dad2139324940fbff8aa089a72641800211e2d9-dirty
fubar
parents:
77
diff
changeset
|
228 # jc.add_defsess_to_index(default_session_data) |
30
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
229 # jc.text_index() not sure what broke here. |
8f02a84ee278
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 48bc917d34af182e9158915862c8a35723660919
fubar
parents:
diff
changeset
|
230 else: |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
231 sys.stderr.write( |
113
878c27dfea9d
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 45375b64cbc99173525a2b374d71a13e650ce1b0
bgruening
parents:
98
diff
changeset
|
232 "Please add a fasta genome reference to the collection. No suitable reference fasta for autogenJB2 - nothing to process" |
46
4181e97c70a7
planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 3a43e9e0ffce0966101203102e769d1ced28618a
fubar
parents:
39
diff
changeset
|
233 ) |