annotate Datatype.py @ 0:abcfd662b679 draft default tip

planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
author yating-l
date Thu, 22 Dec 2016 17:53:00 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
1 #!/usr/bin/python
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
2 # -*- coding: utf8 -*-
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
3
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
4 """
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
5 Super Class of the managed datatype
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
6 """
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
7
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
8 import os
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
9 import tempfile
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
10
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
11 from util import subtools
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
12 from Track import Track
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
13 from TrackDb import TrackDb
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
14
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
15
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
16 class Datatype(object):
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
17
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
18 twoBitFile = None
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
19
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
20 input_fasta_file = None
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
21 extra_files_path = None
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
22 tool_directory = None
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
23
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
24 mySpecieFolderPath = None
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
25 myTrackFolderPath = None
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
26
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
27 twoBitFile = None
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
28 chromSizesFile = None
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
29
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
30 track = None
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
31
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
32 def __init__(self):
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
33
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
34 not_init_message = "The {0} is not initialized." \
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
35 "Did you use pre_init static method first?"
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
36 if Datatype.input_fasta_file is None:
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
37 raise TypeError(not_init_message.format('reference genome'))
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
38 if Datatype.extra_files_path is None:
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
39 raise TypeError(not_init_message.format('track Hub path'))
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
40 if Datatype.tool_directory is None:
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
41 raise TypeError(not_init_message.format('tool directory'))
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
42
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
43 @staticmethod
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
44 def pre_init(reference_genome, two_bit_path, chrom_sizes_file,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
45 extra_files_path, tool_directory, specie_folder, tracks_folder):
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
46 Datatype.extra_files_path = extra_files_path
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
47 Datatype.tool_directory = tool_directory
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
48
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
49 # TODO: All this should be in TrackHub and not in Datatype
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
50 Datatype.mySpecieFolderPath = specie_folder
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
51 Datatype.myTrackFolderPath = tracks_folder
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
52
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
53 Datatype.input_fasta_file = reference_genome
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
54
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
55 # 2bit file creation from input fasta
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
56 Datatype.twoBitFile = two_bit_path
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
57 Datatype.chromSizesFile = chrom_sizes_file
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
58
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
59 @staticmethod
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
60 def get_largest_scaffold_name(self):
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
61 # We can get the biggest scaffold here, with chromSizesFile
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
62 with open(Datatype.chromSizesFile.name, 'r') as chrom_sizes:
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
63 # TODO: Check if exists
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
64 return chrom_sizes.readline().split()[0]
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
65
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
66 # TODO: Rename for PEP8
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
67 def getShortName( self, name_to_shortify ):
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
68 # Slice to get from Long label the short label
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
69 short_label_slice = slice(0, 15)
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
70
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
71 return name_to_shortify[short_label_slice]
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
72
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
73 # TODO: Better handle parameters, use heritance mecanism
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
74 # TODO: Use default parameters for some, like visibility
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
75 def createTrack(self,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
76 file_path=None,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
77 track_name=None, long_label=None, thick_draw_item='off',
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
78 short_label=None, track_type=None, visibility=None, priority=None,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
79 track_file=None, track_color='#000000', group_name="Default"):
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
80
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
81 # TODO: Remove the hardcoded "tracks" by the value used as variable from myTrackFolderPath
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
82 data_url = "tracks/%s" % file_path
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
83
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
84 if not short_label:
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
85 short_label = self.getShortName(long_label)
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
86
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
87 # Replace '_' by ' ', to invert the sanitization mecanism
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
88 # TODO: Find a better way to manage the sanitization of file path
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
89 long_label = long_label.replace("_", " ")
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
90 short_label = short_label.replace("_", " ")
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
91
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
92 #TODO: Check if rgb or hexa
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
93 # Convert hexa to rgb array
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
94 hexa_without_sharp = track_color.lstrip('#')
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
95 rgb_array = [int(hexa_without_sharp[i:i+2], 16) for i in (0, 2, 4)]
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
96 rgb_ucsc = ','.join(map(str, rgb_array))
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
97
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
98 track_db = TrackDb(
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
99 trackName=track_name,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
100 longLabel=long_label,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
101 shortLabel=short_label,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
102 trackDataURL=data_url,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
103 trackType=track_type,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
104 visibility=visibility,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
105 thickDrawItem=thick_draw_item,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
106 priority=priority,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
107 track_color=rgb_ucsc,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
108 group_name=group_name
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
109 )
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
110
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
111 # Return the Bam Track Object
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
112 self.track = Track(
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
113 trackFile=track_file,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
114 trackDb=track_db,
abcfd662b679 planemo upload for repository https://github.com/Yating-L/hubarchivecreator-test.git commit 199ae2b10f3b3e58cb4d4a3b9fb4b35db415c538-dirty
yating-l
parents:
diff changeset
115 )