Skip to content

Commit

Permalink
all files for v0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bhofmei committed Nov 10, 2016
1 parent de68ae3 commit e8aa9b0
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 7 deletions.
15 changes: 15 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

div.nuc-dens-sublabel {
z-index: 10;
overflow: hidden;
cursor: default;
padding: 0px 1px 0px 1px;
border-left: 1px solid #999;
border-right: 1px solid #999;
border-top: 1px solid #999;
/*color: #111;*/
font-weight: bold;
}
div.nuc-dens-sublabel.last {
border-bottom: 1px solid #999;
}
62 changes: 62 additions & 0 deletions js/NucleotideDensityPlugin.profile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
function copyOnly(mid) {
return mid in {
// There are no modules right now that are copy-only. If you have some, though, just add
// them here like this:
// 'app/module': 1
};
}

var profile = {
action: 'release',
cssOptimize: 'comments',
mini: true,

basePath: '../../../src',
packages: [
{name: 'NucleotideDensityPlugin', location: '../plugins/NucleotideDensityPlugin/js' }
],

layerOptimize: 'closure',
stripConsole: 'normal',
selectorEngine: 'acme',

layers: {
'NucleotideDensityPlugin/main': {
include: [
'NucleotideDensityPlugin',
],
exclude: [ 'JBrowse' ]
}
},

staticHasFeatures: {
'dojo-trace-api':0,
'dojo-log-api':0,
'dojo-publish-privates':0,
'dojo-sync-loader':0,
'dojo-xhr-factory':0,
'dojo-test-sniff':0
},

resourceTags: {
// Files that contain test code.
test: function (filename, mid) {
return false;
},

// Files that should be copied as-is without being modified by the build system.
copyOnly: function (filename, mid) {
return copyOnly(mid);
},

// Files that are AMD modules.
amd: function (filename, mid) {
return !copyOnly(mid) && /.js$/.test(filename);
},

// Files that should not be copied when the “mini” compiler flag is set to true.
miniExclude: function (filename, mid) {
return ! ( /^NucleotideDensityPlugin/.test(mid) );
}
}
};
5 changes: 4 additions & 1 deletion js/Store/SeqFeature/NucContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ function(
this.refSeq = this.store.refSeq;
this.windowSize = args.windowSize;
this.windowDelta = args.windowDelta;
this.bothStrands = args.bothStrands;
this.nuc = args.nuc;
this.nucLength = args.nuc.length;
this.nucAr = StoreUtil.getPossibilities(this.nuc);
this.nucAr = StoreUtil.getPossibilities(this.nuc, this.bothStrands);
this._deferred.features.resolve({success: true});
},

Expand Down Expand Up @@ -82,6 +83,8 @@ function(
}
var pos = query.start;
var score = nc / rn;
if(thisB.bothStrands)
score /= 2;

// add to stats
thisB.stats.count++;
Expand Down
17 changes: 11 additions & 6 deletions js/Store/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ function(
JSON,
nucleotidetable
){
/*
Utility class dealing with degenerate nucleotide sequences
*/
var Util;
var ntable = JSON.parse(nucleotidetable);

Expand Down Expand Up @@ -51,15 +54,17 @@ function(
return out;
},

getPossibilities: function(inStr){
getPossibilities: function(inStr, bothStrands){
// first get forward possibilities
var nucAr = Util._transformNuc(inStr);
// get reverse
/*var revAr = array.map(nucAr, function(x){
return Util._reverseComplement(x);
});
// combine
nucAr.push.apply(nucAr, revAr);*/
if(bothStrands){
var revAr = array.map(nucAr, function(x){
return Util._reverseComplement(x);
});
// combine
nucAr.push.apply(nucAr, revAr);
}
return nucAr;
}
}
Expand Down
36 changes: 36 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
define([
'dojo/_base/declare',
'JBrowse/Plugin',
'NucleotideDensityPlugin/Store/Util'
],
function(
declare,
JBrowsePlugin,
storeUtil
) {
return declare( JBrowsePlugin,
{
constructor: function( args ) {
var browser = args.browser;

// do anything you need to initialize your plugin here
console.log( "NucleotideDensityPlugin plugin starting" );
// register new track type

browser.registerTrackType({
label: 'NucDensity',
type: 'NucleotideDensityPlugin/View/Track/NucDensityMulti'
});
/*var p = new ndstore({context:['CG'], windowDelta: 100, windowSize: 500, browser: browser, refSeq: 'stuff'});
console.log(p);*/
/*var m = 'chg';
var t = storeUtil._transformNuc(m);
//console.log(m,t);
m='whh';
var t = storeUtil._transformNuc(m);
//console.log(m,t);
//console.log('jls', storeUtil._reverseComplement('jls'));
console.log('chh',storeUtil.getPossibilities('chh'));*/
}
});
});
6 changes: 6 additions & 0 deletions release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Release notes

v0.2 - Nov 10, 2016
- allows specifiying unlimited number of nucleotide contexts
- multiple options to specify color of contexts default to random (not truly random but equidistant colors)
- ability to compute density using forward strand or both strands

0 comments on commit e8aa9b0

Please sign in to comment.