Mercurial > repos > yating-l > jbrowsearchivecreator
annotate tracks/BamFeatures.py @ 20:85971ec2a527 draft default tip
planemo upload for repository https://github.com/goeckslab/jbrowse-archive-creator.git commit 81d946d4544a4ea7e5b55f90caef971eca6abba0
author | sargentl |
---|---|
date | Fri, 21 Sep 2018 16:30:54 -0400 |
parents | 62dee5369e80 |
children |
rev | line source |
---|---|
19
62dee5369e80
planemo upload for repository https://github.com/goeckslab/jbrowse-archive-creator.git commit afd782e8741a859506794bea92475f620265c50e
sargentl
parents:
6
diff
changeset
|
1 #!/usr/bin/env python2 |
6
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 |