Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More feature types for adding, DNA display, and designer

  • Loading branch information...
commit 264c050e5551f9143e52fdc2a9797dd9b8620959 1 parent dea29f1
@magnusmanske magnusmanske authored
View
7 common.js
@@ -112,6 +112,13 @@ function loadBaseData () {
cd.re_s2n[l][s].push ( k ) ;
} ) ;
+ // Type colors
+ $.each ( cd.feature_types , function ( k , v ) {
+ gentle.features[k] = v.name || ucFirst ( k ) ;
+ if ( $('#dummy_feature_'+k).length == 0 ) $('body').append("<div id='dummy_feature_"+k+"' class='feat_"+k+"' style='display:none'></div>") ;
+ cd.feature_types[k].col = $('#dummy_feature_'+k).css ( 'background-color' ) || '#DDDDDD' ;
+ } ) ;
+
}
// This function allows for arbitrary text to be copied/pasted to the clipboard,
View
11 data/data.js
@@ -448,5 +448,16 @@ var cd = { // Common data, filled by loadBaseData()
'SHIFT' : 4 ,
'ALT' : 2 ,
'CTRL' : 1
+ } ,
+ "feature_types" : {
+ 'misc' : { 'annotation_row_offset':2 , 'name':'Misc' } ,
+ 'protein_bind' : { 'annotation_row_offset':2 , 'name':'Protein binding site' } ,
+ 'promoter' : { 'is_main_type':1 , 'annotation_row_offset':1 , 'name':'Promoter' } ,
+ 'gene' : { 'annotation_row_offset':0 , 'name':'Gene' } ,
+ 'note' : { 'annotation_row_offset':3 , 'name':'Note' } ,
+ 'terminator' : { 'is_main_type':1 , 'annotation_row_offset':1 , 'name':'Terminator' } ,
+ 'rbs' : { 'is_main_type':1 , 'annotation_row_offset':1 , 'name':'Ribosome binding site' } ,
+ 'ori' : { 'is_main_type':1 , 'annotation_row_offset':1 , 'name':'Replication origin' } ,
+ 'cds' : { 'is_main_type':1 , 'annotation_row_offset':1 , 'name':'Coding sequence' }
}
} ;
View
8 main.js
@@ -10,7 +10,7 @@
// gentle object containing core methods
var gentle = {
fileTypeList : [ 'fasta' , 'genebank' , 'plaintext' , 'sybil' ] ,
- features : { 'note':'Note' , 'gene':'Gene' , 'cds':'CDS' , 'promoter':'Promoter' , 'misc':'Misc' , 'protein_bind':'Protein binding site' } ,
+ features : {} , //{ 'note':'Note' , 'gene':'Gene' , 'cds':'CDS' , 'promoter':'Promoter' , 'misc':'Misc' , 'protein_bind':'Protein binding site' } ,
sequences : [] ,
current_sequence_entry : undefined ,
main_sequence_canvas : undefined ,
@@ -84,6 +84,12 @@ var gentle = {
if ( gentle.url_vars.newsequence !== undefined ) gentle.startNewSequenceDialog() ;
} ,
+ getFeatureType : function ( s ) {
+ var t = s.toLowerCase() ;
+ if ( undefined === cd.feature_types[t] ) return 'misc' ;
+ return t ;
+ } ,
+
addAlert : function ( type , message ) {
var h = '<div class="alert alert-' + type + '">' ;
h += '<a class="close" data-dismiss="alert">×</a>' ;
View
51 public/main.css
@@ -73,6 +73,37 @@
color:white;
}
+
+
+
+.designer_row_feature_terminator {
+ height:34px;
+ color:white;
+ background-color:black;
+}
+
+.designer_row_feature_rbs {
+ background-color:#27DE55;
+ height:34px;
+ color:black;
+}
+
+.designer_row_feature_ori {
+ background-color:#DFDF00;
+ height:34px;
+ color:black;
+}
+
+.designer_row_feature_protein_bind {
+ background-color:#9669FE;
+ height:34px;
+ color:black;
+}
+
+
+
+
+
.designer_row_feature_gene {
background-color:#2F74D0;
color:white;
@@ -335,6 +366,26 @@ h1 {
left:75px;
}
+.feat_terminator {
+ background-color:black;
+ left:75px;
+}
+
+.feat_rbs {
+ background-color:#27DE55;
+ left:75px;
+}
+
+.feat_ori {
+ background-color:#DFDF00;
+ left:75px;
+}
+
+.feat_protein_bind {
+ background-color:#9669FE;
+ left:75px;
+}
+
.feat_note {
background-color:#2DC800;
left:95px;
View
15 util/sequence/sequence_canvas_designer.js
@@ -24,13 +24,17 @@ SequenceCanvasDesigner.prototype.getSequenceSchemaHTML = function ( sequence , r
row : 'bottom' ,
featnum : k
} ;
- if ( v['_type'].match(/^promoter$/i) ) o.type = 'promoter' ;
- else if ( v['_type'].match(/^gene$/i) ) o.type = 'gene' ;
- else if ( v['_type'].match(/^CDS$/i) ) o.type = 'cds' ;
+
if ( undefined === o.name ) o.name = o.type ;
o.name = o.name.replace(/^"/,'').replace(/"$/,'') ;
- if ( o.type == 'promoter' || o.type == 'cds' ) o.row = 'main' ;
- else if ( o.type == 'gene' ) o.row = 'top' ;
+
+ $.each ( cd.feature_types , function ( k2 , v2 ) {
+ if ( v['_type'].toLowerCase() !== k2 ) return ;
+ o.type = k2 ;
+ if ( v2.is_main_type ) o.row = 'main' ;
+ } ) ;
+
+ if ( o.type == 'gene' ) o.row = 'top' ;
if ( o.type == 'cds' ) o.rc = v['_range'][0].rc ;
me.list[o.row].push ( o ) ;
} ) ;
@@ -195,5 +199,6 @@ function SequenceCanvasDesigner ( the_sequence , canvas_id ) {
this.canvas_id = 'sequence_canvas' ;
this.sequence = the_sequence ;
this.init () ;
+ the_sequence.undo.updateEditMenu() ;
gentle.set_hover ( '' ) ;
}
View
15 util/sequence/sequence_canvas_rows.js
@@ -267,23 +267,20 @@ SequenceCanvasRowAnnotation.prototype.show = function ( ctx ) {
'cds' : { offset:1 }
} ;
- $.each ( styles , function ( k , v ) {
- if ( $('#dummy_feature_'+k).length == 0 ) $('body').append("<div id='dummy_feature_"+k+"' class='feat_"+k+"' style='display:none'></div>") ;
- styles[k].col = $('#dummy_feature_'+k).css ( 'background-color' ) ;
- } ) ;
-
// Markup bases in this region
var bases = {} ;
$.each ( showfeat , function ( id , v ) {
- var cl = 'other' ;
+ var cl = gentle.getFeatureType ( v['_type'] ) ;
+/* var cl = 'other' ;
if ( v['_type'].match(/^promoter$/i) ) cl = 'promoter' ;
else if ( v['_type'].match(/^gene$/i) ) cl = 'gene' ;
else if ( v['_type'].match(/^CDS$/i) ) cl = 'cds' ;
- else if ( v['_type'].match(/^note$/i) ) cl = 'note' ;
+ else if ( v['_type'].match(/^note$/i) ) cl = 'note' ;*/
- var col = styles[cl].col ;
- var offset = styles[cl].offset ;
+// if ( undefined === cd.feature_types[cl] ) cd.feature_types[cl] = clone ( cd.feature_types['misc'] ) ;
+ var col = cd.feature_types[cl].col ;
+ var offset = cd.feature_types[cl].annotation_row_offset ;
var name = '' ;
if ( v['gene'] !== undefined ) name = v['gene'] ;

0 comments on commit 264c050

Please sign in to comment.
Something went wrong with that request. Please try again.