Skip to content

Commit

Permalink
Release of version 0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mpschr committed Dec 15, 2014
1 parent 897eb39 commit 4c9d3c7
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 29 deletions.
41 changes: 32 additions & 9 deletions build/muts-needle-plot.js

Large diffs are not rendered by default.

Binary file modified build/muts-needle-plot.min.gz.js
Binary file not shown.
2 changes: 1 addition & 1 deletion build/muts-needle-plot.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions how-to-publish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Make sure you have npm installed.

git pull

2. Check and increment the version in the `package.json` file. E.g. version "0.5.1"
2. Check and increment the version in the `package.json` file. E.g. version "0.5.2"

3. Check if examples are working fine

Expand All @@ -23,14 +23,14 @@ Make sure you have npm installed.

5. Commit all changes, push to repository

git commit -a -m "Release of version 0.5.1"
git tag -a v0.5.1 -m 'version 0.5.1'
git commit -a -m "Release of version 0.5.2"
git tag -a v0.5.2 -m 'version 0.5.2'
git push
git push origin --tags

6. Go to GitHub and schedule a new Release
Title: Mutations Needle Plot
Changelog:
v0.5.1
v0.5.2
* Selection (new)
* Legend (new)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "muts-needle-plot",
"description": "Draws a Needle-Plot for mutation data (stacked).",
"version": "0.5.1",
"version": "0.5.2",
"homepage": "https://github.com/bbglab/muts-needle-plot",
"author": {
"name": "Michael P Schroeder",
Expand Down
3 changes: 2 additions & 1 deletion snippets/EXAMPLE.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ plotConfig = {
};

// Instantiate a plot
p = new mutneedles(plotConfig);
instance = new mutneedles(plotConfig);

2 changes: 1 addition & 1 deletion snippets/EXAMPLE_AGGREGATION.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ d3.json("./data/muts.json", function(error, data){
};

// Instantiate a plot
p = new mutneedles(plotConfig);
instance =new mutneedles(plotConfig);


});
Expand Down
2 changes: 1 addition & 1 deletion snippets/KRAS.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ var colorMap = {

var config = {maxCoord: 350, mutationData: muts, regionData: regions, target: target, legends: legends, colorMap: colorMap }

var plot1 = new mutneedles(config);
instance = new mutneedles(config);

2 changes: 1 addition & 1 deletion snippets/LOGO.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ var colorMap = {

var config = {maxCoord: 220, minCoord: 130, mutationData: muts, regionData: regions, target: target, legends: legends, colorMap: colorMap }

var plot1 = new mutneedles(config);
instance = new mutneedles(config);

39 changes: 31 additions & 8 deletions src/js/MutsNeedlePlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,24 @@ MutsNeedlePlot.prototype.drawLegend = function(svg) {

// LEGEND
self = this;
mutsScale = self.colorScale.domain(Object.keys(self.totalCategCounts));

// prepare legend categories (correct order)
mutCategories = [];
categoryColors = [];
allcategs = Object.keys(self.totalCategCounts); // random order
orderedDeclaration = self.colorScale.domain(); // wanted order
for (idx in orderedDeclaration) {
c = orderedDeclaration[idx];
if (allcategs.indexOf(c) > -1) {
mutCategories.push(c);
categoryColors.push(self.colorScale(c))
}
}

// create scale with correct order of categories
mutsScale = self.colorScale.domain(mutCategories).range(categoryColors);


var domain = self.x.domain();
xplacement = (domain[1] - domain[0]) * 0.75 + (domain[1] - domain[0]);
verticalLegend = d3.svg
Expand Down Expand Up @@ -385,16 +402,22 @@ MutsNeedlePlot.prototype.drawNeedles = function(svg, mutationData, regionData) {

formatCoord = function(coord) {
if (coord.indexOf("-") > -1) {
coords = coord.split("-");
// place neede at middle of affected region
coord = Math.floor((parseInt(coords[0]) + parseInt(coords[1])) / 2);
coords = coord.split("-");

// place neede at middle of affected region
coord = Math.floor((parseInt(coords[0]) + parseInt(coords[1])) / 2);

// check for splice sites: "?-9" or "9-?"
if (isNaN(coord)) {
if (coords[0] == "?") { coord = parseInt(coords[1]) }
else if (coords [1] == "?") { coord = parseInt(coords[0]) }
}
} else {
coord = parseInt(coord);
}
return coord;
};

getColor = this.colorScale;
tip = this.tip;

// stack needles at same pos
Expand All @@ -420,7 +443,7 @@ MutsNeedlePlot.prototype.drawNeedles = function(svg, mutationData, regionData) {
numericCoord = formatCoord(d.coord);
numericValue = Number(d.value);
stickHeight = stackNeedle(numericCoord, numericValue, needlePoint);
category = d.category || "";
category = d.category || "other";

if (stickHeight + numericValue > highest) {
// set Y-Axis always to highest available
Expand All @@ -440,10 +463,10 @@ MutsNeedlePlot.prototype.drawNeedles = function(svg, mutationData, regionData) {
coord: numericCoord,
value: numericValue,
stickHeight: stickHeight,
color: getColor(category)
color: self.colorScale(category)
}
} else {
console.debug("discarding " + d.coord + " " + d.category)
console.debug("discarding " + d.coord + " " + d.category + "("+ numericCoord +")");
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/js/d3-svg-legend.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ d3.svg.legend = function() {

drag = d3.behavior.drag()
.on("drag", function(d,i) {
console.log(this);
d.x += d3.event.dx;
d.y += d3.event.dy;
d3.select(this).attr("transform", function(d,i){
Expand Down Expand Up @@ -229,4 +228,4 @@ d3.svg.legend = function() {

return legend;

}
}

0 comments on commit 4c9d3c7

Please sign in to comment.