# HG changeset patch # User yating-l # Date 1529529885 14400 # Node ID 3f9971a9109652ccd08efa4a6ebfb74a27947ed7 # Parent 43a700afd45734ab524dab27c26e214e9306c2cc planemo upload for repository https://github.com/goeckslab/jbrowse-archive-creator.git commit e526b4e8bef4677b832e940bacb8969a18efc3e3 diff -r 43a700afd457 -r 3f9971a91096 datatypes/interval/BedBlastAlignments.py --- a/datatypes/interval/BedBlastAlignments.py Tue Jun 19 17:59:51 2018 -0400 +++ b/datatypes/interval/BedBlastAlignments.py Wed Jun 20 17:24:45 2018 -0400 @@ -13,7 +13,7 @@ def __init__(self, input_bed_blast_alignments_false_path, data_bed_blast_alignments): super(BedBlastAlignments, self).__init__(input_bed_blast_alignments_false_path, data_bed_blast_alignments) - #self.seqType = 1 + self.seqType = 2 #self.trackType = "G-OnRamp_plugin/BlastAlignment" def initSettings(self): diff -r 43a700afd457 -r 3f9971a91096 datatypes/interval/BedBlatAlignments.py --- a/datatypes/interval/BedBlatAlignments.py Tue Jun 19 17:59:51 2018 -0400 +++ b/datatypes/interval/BedBlatAlignments.py Wed Jun 20 17:24:45 2018 -0400 @@ -13,7 +13,7 @@ def __init__(self, input_bed_blast_alignments_false_path, data_bed_blast_alignments): super(BedBlatAlignments, self).__init__(input_bed_blast_alignments_false_path, data_bed_blast_alignments) - #self.seqType = 1 + self.seqType = 1 #self.trackType = "G-OnRamp_plugin/BlatAlignment" def initSettings(self): diff -r 43a700afd457 -r 3f9971a91096 datatypes/interval/BigPsl.py --- a/datatypes/interval/BigPsl.py Tue Jun 19 17:59:51 2018 -0400 +++ b/datatypes/interval/BigPsl.py Wed Jun 20 17:24:45 2018 -0400 @@ -6,7 +6,6 @@ from Interval import Interval from util.index.DatabaseIndex import DatabaseIndex -from util.index.TrixIndex import TrixIndex from datatypes.validators.DataValidation import DataValidation from datatypes.converters.DataConversion import DataConversion @@ -25,7 +24,10 @@ def initSettings(self): super(BigPsl, self).initSettings() - self.extraSettings["glyph"] = "JBrowse/View/FeatureGlyph/Segments" + self.extraSettings["glyph"] = "JBrowse/View/FeatureGlyph/Segments" + if "database" in self.trackSettings: + self.database_settings = DatabaseIndex(database=self.trackSettings["database"], seqType=self.seqType).setExtLink() + self.extraSettings["menuTemplate"] = self.database_settings def validateData(self): diff -r 43a700afd457 -r 3f9971a91096 datatypes/interval/BlastXml.py --- a/datatypes/interval/BlastXml.py Tue Jun 19 17:59:51 2018 -0400 +++ b/datatypes/interval/BlastXml.py Wed Jun 20 17:24:45 2018 -0400 @@ -6,6 +6,7 @@ from Interval import Interval from datatypes.converters.DataConversion import DataConversion +from util.index.DatabaseIndex import DatabaseIndex from util import subtools @@ -16,13 +17,18 @@ self.inputFile = input_blast_alignments_false_path self.trackSettings = data_blast_alignments self.dataType = "blastxml" + self.seqType = 2 #self.trackType = "G-OnRamp_plugin/BlatAlignment" def initSettings(self): super(BlastXml, self).initSettings() self.extraSettings["glyph"] = "JBrowse/View/FeatureGlyph/Segments" self.extraSettings["subfeatureClasses"] = "match_part" - + if "database" in self.trackSettings: + self.database_settings = DatabaseIndex(database=self.trackSettings["database"], seqType=self.seqType).setExtLink() + self.extraSettings["menuTemplate"] = self.database_settings + + def validateData(self): return diff -r 43a700afd457 -r 3f9971a91096 jbrowseArchiveCreator.xml --- a/jbrowseArchiveCreator.xml Tue Jun 19 17:59:51 2018 -0400 +++ b/jbrowseArchiveCreator.xml Wed Jun 20 17:24:45 2018 -0400 @@ -1,4 +1,4 @@ - + This Galaxy tool is used to prepare your files to be ready for displaying on JBrowse with Apollo plugin @@ -108,20 +108,21 @@ $extra_data_dict) #end if #if $f.formatChoice.bedChoice.bed_select == "bed_blast_alignment_option" - ##set database = str($f.formatChoice.bedChoice.database) - ##silent $extra_data_dict.update({"database": $database}) + #set database = str($f.formatChoice.bedChoice.database) + #silent $extra_data_dict.update({"database": $database}) #silent $prepare_json("BedBlastAlignments", $f.formatChoice.bedChoice.BED_blast_alignment, $index_track_final, $extra_data_dict) #end if #if $f.formatChoice.bedChoice.bed_select == "bed_blat_alignment_option" - ##set database = str($f.formatChoice.bedChoice.database) - ##silent $extra_data_dict.update({"database": $database}) + #set database = str($f.formatChoice.bedChoice.database) + #silent $extra_data_dict.update({"database": $database}) #silent $prepare_json("BedBlatAlignments", $f.formatChoice.bedChoice.BED_blat_alignment, $index_track_final, $extra_data_dict) #end if #end if #if $f.formatChoice.format_select == "blastxml" - #silent $extra_data_dict.update({"nameIndex": str($f.formatChoice.nameIndex)}) + #set database = str($f.formatChoice.database) + #silent $extra_data_dict.update({"database": $database, "nameIndex": str($f.formatChoice.nameIndex)}) #silent $prepare_json("BlastXml", $f.formatChoice.BlastXML, $index_track_final, extra_data_dict) #end if @@ -251,6 +252,12 @@ type="data" label="Bed Blast Alignments (Bed12+12) File" /> + + + + + + @@ -260,6 +267,10 @@ type="data" label="Bed BLAT Alignments (bigPsl) File" /> + + + + @@ -279,6 +290,12 @@ type="data" label="Blast Alignments File" /> + + + + + + diff -r 43a700afd457 -r 3f9971a91096 tracks/CanvasFeatures.py --- a/tracks/CanvasFeatures.py Tue Jun 19 17:59:51 2018 -0400 +++ b/tracks/CanvasFeatures.py Wed Jun 20 17:24:45 2018 -0400 @@ -35,6 +35,9 @@ track['label'] = self.trackLabel track['category'] = self.extraSettings['category'] track['style'] = self.extraSettings['style'] + if "menuTemplate" in self.extraSettings: + track["menuTemplate"] = [{}, self.extraSettings["menuTemplate"]] + #self.track["menuTemplate"] += [{"label" : "View details"}, {"label" : "Highlight this gene"}, self.extraSettings["menuTemplate"]] extraConfigs = track return extraConfigs diff -r 43a700afd457 -r 3f9971a91096 tracks/HTMLFeatures.py --- a/tracks/HTMLFeatures.py Tue Jun 19 17:59:51 2018 -0400 +++ b/tracks/HTMLFeatures.py Wed Jun 20 17:24:45 2018 -0400 @@ -31,7 +31,11 @@ self.extraSettings['config']['category'] = "Default group" else: self.extraSettings['config']['category'] = self.extraSettings['category'] - + + if "menuTemplate" in self.extraSettings: + self.extraSettings["clientConfig"]["menuTemplate"] = [{}, self.extraSettings["menuTemplate"]] + #self.extraSettings["clentConfig"]["menuTemplate"] += [{"label" : "View details"}, {"label" : "Highlight this gene"}, self.extraSettings["menuTemplate"]] + extraConfigs['config'] = json.dumps(self.extraSettings["config"]) extraConfigs['clientConfig'] = json.dumps(self.extraSettings["clientConfig"]) return extraConfigs diff -r 43a700afd457 -r 3f9971a91096 tracks/TrackDb.py --- a/tracks/TrackDb.py Tue Jun 19 17:59:51 2018 -0400 +++ b/tracks/TrackDb.py Wed Jun 20 17:24:45 2018 -0400 @@ -42,7 +42,7 @@ ) self.track_db["nameIndex"] = self.extraSettings['nameIndex'] - + extraConfigs = self.prepareExtraSetting() self.logger.debug("Generate extraConfigs = %s", json.dumps(extraConfigs)) self.track_db["options"] = extraConfigs diff -r 43a700afd457 -r 3f9971a91096 util/index/DatabaseIndex.py --- a/util/index/DatabaseIndex.py Tue Jun 19 17:59:51 2018 -0400 +++ b/util/index/DatabaseIndex.py Wed Jun 20 17:24:45 2018 -0400 @@ -7,38 +7,33 @@ def __init__(self, database, **args): self.database = database self.seqType=args.get("seqType") - self.useIframe=args.get("useIframe") - self.iframeHeight=args.get("iframeHeight") - self.iframeWidth=args.get("iframeWidth") + def setExtLink(self): - return self.setDatabaseLink(self.database, self.seqType, self.useIframe, self.iframeHeight, self.iframeWidth) + return self.setDatabaseLink(self.database, self.seqType) - def setDatabaseLink(self, database, seqType=None, useIframe=None, iframeHeight=None, iframeWidth=None): + def setDatabaseLink(self, database, seqType=None): database_settings = collections.OrderedDict() + database_settings.update({"label": "View feature details in the database", + "action": "iframeDialog", + "iconClass": "dijitIconDatabase", + "title": "feature {name}"}) + if "NCBI" in database: if not seqType: - database_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term=$$" + database_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term={name}" elif seqType == 2: - database_settings["url"] = "https://www.ncbi.nlm.nih.gov/protein/$$" + database_settings["url"] = "https://www.ncbi.nlm.nih.gov/protein/{name}" elif seqType == 1: - database_settings["url"] = "https://www.ncbi.nlm.nih.gov/nuccore/$$" + database_settings["url"] = "https://www.ncbi.nlm.nih.gov/nuccore/{name}" else: raise Exception("Sequence Type {0} is not valid, should be either protein (seqType==2) or nucleotide (seqType==1). Stopping the application".format(seqType)) elif "UniProt" in database: - database_settings["url"] = "http://www.uniprot.org/uniprot/$$" + database_settings["url"] = "http://www.uniprot.org/uniprot/{name}" elif "FlyBase" in database: - database_settings["url"] = "http://flybase.org/reports/$$" + database_settings["url"] = "http://flybase.org/reports/{name}" else: - database_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term=$$" - database_settings["urlLabel"] = database + " Details:" - if useIframe or useIframe is None: - database_settings["iframeUrl"] = database_settings["url"] - if not iframeHeight: - iframeHeight = "600" - if not iframeWidth: - iframeWidth = "800" - database_settings["iframeOptions"] = "height= %s width= %s" % (iframeHeight, iframeWidth) + database_settings["url"] = "https://www.ncbi.nlm.nih.gov/gquery/?term={name}" return database_settings