Mercurial > repos > yating-l > jbrowsearchivecreator
annotate tracks/BamFeatures.py @ 17:315a40b0b694 draft
planemo upload for repository https://github.com/goeckslab/jbrowse-archive-creator.git commit 891eca7a697643c9b5365781bbab5b655972ffdc
author | yating-l |
---|---|
date | Mon, 25 Jun 2018 16:05:01 -0400 |
parents | 237707a6b74d |
children | 62dee5369e80 |
rev | line source |
---|---|
6
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
1 #!/usr/bin/env python |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
2 import os |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
3 import json |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
4 import logging |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
5 |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
6 from TrackDb import TrackDb |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
7 from util import subtools |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
8 from util import santitizer |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
9 |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
10 |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
11 class BamFeatures(TrackDb): |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
12 def __init__(self, trackName, trackLabel, trackDataURL, trackType, dataType, extraSettings=None): |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
13 super(BamFeatures, self).__init__(trackName, trackLabel, trackDataURL, trackType, dataType, extraSettings) |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
14 |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
15 def prepareExtraSetting(self): |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
16 if 'category' not in self.extraSettings or not self.extraSettings['category']: |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
17 self.extraSettings['category'] = "Default group" |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
18 bam_track = dict() |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
19 bam_track['type'] = 'JBrowse/View/Track/Alignments2' |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
20 bam_track['storeClass'] = 'JBrowse/Store/SeqFeature/BAM' |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
21 bam_track['urlTemplate'] = os.path.join('bbi', self.trackName) |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
22 bam_track['baiUrlTemplate'] = os.path.join('bbi', self.extraSettings['index']) |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
23 bam_track['label'] = self.trackLabel |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
24 bam_track['category'] = self.extraSettings['category'] |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
25 #extraConfigs = json.dumps(bam_track) |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
26 extraConfigs = bam_track |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
27 return extraConfigs |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
28 |
237707a6b74d
planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a500f7ab2119cc5faaf80393bd87428389d06880-dirty
yating-l
parents:
diff
changeset
|
29 |