annotate datatypes/Datatype.py @ 72:2440ce10848b draft

planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit a60f8496cccf4c5a07ba7d75876198eda997f07d
author yating-l
date Wed, 27 Sep 2017 15:34:20 -0400
parents 4ca7cbf2d9b8
children 0bc486356e2a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
66
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
1 #!/usr/bin/python
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
2 # -*- coding: utf8 -*-
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
3
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
4 """
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
5 Super Class of the managed datatype
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
6 """
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
7
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
8 import os
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
9 import tempfile
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
10 import collections
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
11 import util
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
12 import logging
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
13 import abc
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
14 from abc import ABCMeta
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
15 from TrackDb import TrackDb
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
16 from datatypes.validators.DataValidation import DataValidation
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
17
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
18
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
19 class Datatype(object):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
20 __metaclass__ = ABCMeta
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
21
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
22 twoBitFile = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
23 chromSizesFile = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
24 input_fasta_file = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
25 extra_files_path = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
26 tool_directory = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
27
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
28 mySpecieFolderPath = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
29 myTrackFolderPath = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
30
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
31
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
32 def __init__(self):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
33 not_init_message = "The {0} is not initialized." \
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
34 "Did you use pre_init static method first?"
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
35 if Datatype.input_fasta_file is None:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
36 raise TypeError(not_init_message.format('reference genome'))
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
37 if Datatype.extra_files_path is None:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
38 raise TypeError(not_init_message.format('track Hub path'))
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
39 if Datatype.tool_directory is None:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
40 raise TypeError(not_init_message.format('tool directory'))
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
41 self.inputFile = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
42 self.trackType = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
43 self.dataType = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
44 self.track = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
45 self.trackSettings = dict()
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
46 self.extraSettings = collections.OrderedDict()
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
47
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
48 @staticmethod
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
49 def pre_init(reference_genome, two_bit_path, chrom_sizes_file,
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
50 extra_files_path, tool_directory, specie_folder, tracks_folder):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
51 Datatype.extra_files_path = extra_files_path
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
52 Datatype.tool_directory = tool_directory
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
53
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
54 # TODO: All this should be in TrackHub and not in Datatype
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
55 Datatype.mySpecieFolderPath = specie_folder
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
56 Datatype.myTrackFolderPath = tracks_folder
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
57
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
58 Datatype.input_fasta_file = reference_genome
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
59
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
60 # 2bit file creation from input fasta
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
61 Datatype.twoBitFile = two_bit_path
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
62 Datatype.chromSizesFile = chrom_sizes_file
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
63
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
64 def generateCustomTrack(self):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
65 self.validateData()
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
66 self.initSettings()
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
67 #Create the track file
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
68 self.createTrack()
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
69 # Create the TrackDb Object
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
70 self.createTrackDb()
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
71 logging.debug("- %s %s created", self.dataType, self.trackName)
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
72
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
73
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
74 @abc.abstractmethod
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
75 def validateData(self):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
76 """validate the input data with DataValidation"""
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
77
72
2440ce10848b planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit a60f8496cccf4c5a07ba7d75876198eda997f07d
yating-l
parents: 66
diff changeset
78 def initSettings(self):
66
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
79 #Initialize required fields: trackName, longLabel, shortLable
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
80 self.trackName = self.trackSettings["name"]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
81 if self.trackSettings["long_label"]:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
82 self.longLabel = self.trackSettings["long_label"]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
83 else:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
84 self.longLabel = self.trackName
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
85 if not "short_label" in self.trackSettings:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
86 self.shortLabel = ""
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
87 else:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
88 self.shortLabel = self.trackSettings["short_label"]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
89 self.trackDataURL = os.path.join(self.myTrackFolderPath, self.trackName)
72
2440ce10848b planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit a60f8496cccf4c5a07ba7d75876198eda997f07d
yating-l
parents: 66
diff changeset
90
66
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
91
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
92 @abc.abstractmethod
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
93 def createTrack(self):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
94 """Create the final track file"""
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
95
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
96 def createTrackDb(self):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
97 self.track = TrackDb(self.trackName, self.longLabel, self.shortLabel, self.trackDataURL, self.trackType, self.extraSettings)
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
98
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
99
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
100
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
101
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
102
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
103
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
104
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
105 '''
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
106 def __init__(self):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
107 not_init_message = "The {0} is not initialized." \
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
108 "Did you use pre_init static method first?"
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
109 if Datatype.input_fasta_file is None:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
110 raise TypeError(not_init_message.format('reference genome'))
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
111 if Datatype.extra_files_path is None:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
112 raise TypeError(not_init_message.format('track Hub path'))
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
113 if Datatype.tool_directory is None:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
114 raise TypeError(not_init_message.format('tool directory'))
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
115 self.track = None
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
116 self.extra_settings = collections.OrderedDict()
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
117
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
118
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
119 @staticmethod
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
120 def pre_init(reference_genome, two_bit_path, chrom_sizes_file,
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
121 extra_files_path, tool_directory, specie_folder, tracks_folder):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
122 Datatype.extra_files_path = extra_files_path
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
123 Datatype.tool_directory = tool_directory
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
124
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
125 # TODO: All this should be in TrackHub and not in Datatype
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
126 Datatype.mySpecieFolderPath = specie_folder
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
127 Datatype.myTrackFolderPath = tracks_folder
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
128
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
129 Datatype.input_fasta_file = reference_genome
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
130
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
131 # 2bit file creation from input fasta
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
132 Datatype.twoBitFile = two_bit_path
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
133 Datatype.chromSizesFile = chrom_sizes_file
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
134
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
135 @staticmethod
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
136 def get_largest_scaffold_name(self):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
137 # We can get the biggest scaffold here, with chromSizesFile
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
138 with open(Datatype.chromSizesFile.name, 'r') as chrom_sizes:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
139 # TODO: Check if exists
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
140 return chrom_sizes.readline().split()[0]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
141
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
142
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
143 def createTrack(self, trackName, longLabel, shortLabel, trackDataURL, trackType, extra_settings=None):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
144 self.track = TrackDb(trackName, longLabel, shortLabel, trackDataURL, trackType, extra_settings)
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
145
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
146 def initRequiredSettings(self, trackSettings, trackDataURL = None, trackType = None):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
147
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
148 #Initialize required fields: trackName, longLabel, shortLable
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
149
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
150 self.trackSettings = trackSettings
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
151 self.trackName = self.trackSettings["name"]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
152 #self.priority = self.trackSettings["order_index"]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
153 #self.track_color = self.trackSettings["track_color"]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
154 # TODO: Think about how to avoid repetition of the group_name everywhere
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
155 #self.group_name = self.trackSettings["group_name"]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
156 #self.database = self.trackSettings["database"]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
157 if self.trackSettings["long_label"]:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
158 self.longLabel = self.trackSettings["long_label"]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
159 else:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
160 self.longLabel = self.trackName
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
161 if not "short_label" in self.trackSettings:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
162 self.shortLabel = ""
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
163 else:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
164 self.shortLabel = self.trackSettings["short_label"]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
165 self.trackDataURL = trackDataURL
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
166 self.trackType = trackType
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
167
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
168 def setExtLink(self, database, inputFile, seqType=None, useIframe=True, iframeHeight=None, iframeWidth=None):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
169 if "NCBI" in database:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
170 if not seqType:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
171 self.seqType = int(self.getSeqType(inputFile))
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
172 else:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
173 self.seqType = seqType
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
174 if self.seqType < 0:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
175 print self.seqType
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
176 raise Exception("Sequence Type is not set for bigPsl. Stopping the application")
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
177 if self.seqType == 2:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
178 self.extra_settings["url"] = "https://www.ncbi.nlm.nih.gov/protein/$$"
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
179 elif self.seqType == 1:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
180 self.extra_settings["url"] = "https://www.ncbi.nlm.nih.gov/nuccore/$$"
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
181 else:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
182 raise Exception("Sequence Type {0} is not valid for bigPsl. Stopping the application".format(self.seqType))
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
183 elif "UniProt" in database:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
184 self.extra_settings["url"] = "http://www.uniprot.org/uniprot/$$"
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
185 elif "FlyBase" in database:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
186 self.extra_settings["url"] = "http://flybase.org/reports/$$"
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
187 else:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
188 self.extra_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term=$$"
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
189 self.extra_settings["urlLabel"] = database + " Details:"
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
190 if useIframe:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
191 self.extra_settings["iframeUrl"] = self.extra_settings["url"]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
192 if not iframeHeight:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
193 iframeHeight = "600"
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
194 if not iframeWidth:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
195 iframeWidth = "800"
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
196 self.extra_settings["iframeOptions"] = "height= %s width= %s" % (iframeHeight, iframeWidth)
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
197
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
198 def getSeqType(self, inputFile):
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
199 with open(inputFile, "r") as bigpsl:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
200 sampleSeq = bigpsl.readline().split()
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
201 if len(sampleSeq) == 25:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
202 return sampleSeq[-1]
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
203 else:
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
204 return "-1"
4ca7cbf2d9b8 planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 159730602ff500b59aefc7080fb49b726c88d655-dirty
yating-l
parents:
diff changeset
205 '''