view 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
line wrap: on
line source

#!/usr/bin/env python2
import os
import json
import logging

from TrackDb import TrackDb
from util import subtools
from util import santitizer


class BamFeatures(TrackDb):
    def __init__(self, trackName, trackLabel, trackDataURL, trackType, dataType, extraSettings=None):
        super(BamFeatures, self).__init__(trackName, trackLabel, trackDataURL, trackType, dataType, extraSettings)
 
    def prepareExtraSetting(self):
        if 'category' not in self.extraSettings or not self.extraSettings['category']:
            self.extraSettings['category'] = "Default group"
        bam_track = dict()
        bam_track['type'] = 'JBrowse/View/Track/Alignments2'
        bam_track['storeClass'] = 'JBrowse/Store/SeqFeature/BAM'
        bam_track['urlTemplate'] = os.path.join('bbi', self.trackName)
        bam_track['baiUrlTemplate'] = os.path.join('bbi', self.extraSettings['index'])
        bam_track['label'] = self.trackLabel
        bam_track['category'] = self.extraSettings['category']
        #extraConfigs = json.dumps(bam_track)
        extraConfigs = bam_track
        return extraConfigs