Skip to content

Commit

Permalink
Merge branch 'hotfix/2.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranmraine committed Mar 29, 2019
2 parents 8b4e263 + a9fbc46 commit b088a14
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changes

## 2.3.2

* Actually fixes the highlight bug #18
* Relaxes input file to accept BED with more than just required fields (#19)

## 2.3.1

* Fixes `--highlight` option.
Expand Down
17 changes: 10 additions & 7 deletions js/jbrowse_rasterize.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const bedHelp = `
...
Comment/URL separator lines can be space or tab separated elements.
BED formatted lines must be tab separated and only have 3 elements.
BED formatted lines must be tab separated.
`

/**
Expand Down Expand Up @@ -159,9 +159,6 @@ function urlCleaning(options, url, subdir) {
if(options.navOff) { // optionally turn of the navigation tools
address += '&nav=0';
}
if(options.highlight) {
address += '&highlight='+loc.urlElement;
}
// cleanup any multiples of &&
address = address.replace(/[&]+/g,'&');
const tracks = address.match(/tracks=[^&]+/)[0].split(/%2C/g);
Expand Down Expand Up @@ -205,18 +202,22 @@ function loadLocs(options) {
}

const elements = rawLoc.split(/\t/);
if(elements.length !== 3) continue;
if(elements.length < 3) {
console.warn('Skipping: line, neither comment or BED format: ' + rawLoc);
continue;
}
let start = parseInt(elements[1]);
const end = parseInt(elements[2]);
if(start >= end) {
console.warn('Skipping: bed location malformed: ' + rawLoc);
console.warn('Skipping: line, bed location malformed: ' + rawLoc);
continue;
}
start += 1;
locations.push({
urlElement: elements[0] + colon + start + '..' + end,
realElement: elements[0] + ':' + start + '..' + end,
fileElement: elements[0] + '_' + start + '-' + end
fileElement: elements[0] + '_' + start + '-' + end,
highlight: options.highlight
});
}
return locations;
Expand Down Expand Up @@ -297,6 +298,8 @@ function main() {
}

let fullAddress = address+'&loc='+loc.urlElement;
// add highlight
if(loc.highlight) fullAddress = fullAddress+'&highlight='+loc.urlElement;
process.stdout.write('Processing: '+fullAddress);
const started = Date.now();
const finalPath = path.join(outloc, loc.fileElement+'.'+program.imgType);
Expand Down
2 changes: 1 addition & 1 deletion js/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = '2.3.1';
module.exports = '2.3.2';
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cancerit/cgpjbrowsetoolkit",
"version": "2.3.1",
"version": "2.3.2",
"description": "CLI tools for working with JBrowse",
"directories": {
"doc": "docs",
Expand Down

0 comments on commit b088a14

Please sign in to comment.