diff --git a/CHANGES.md b/CHANGES.md index 61fe2ec..95ff226 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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. diff --git a/js/jbrowse_rasterize.js b/js/jbrowse_rasterize.js index 40289e4..6ef22f9 100755 --- a/js/jbrowse_rasterize.js +++ b/js/jbrowse_rasterize.js @@ -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. ` /** @@ -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); @@ -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; @@ -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); diff --git a/js/version.js b/js/version.js index 695f2e5..1ee9e0d 100644 --- a/js/version.js +++ b/js/version.js @@ -1 +1 @@ -module.exports = '2.3.1'; +module.exports = '2.3.2'; diff --git a/package-lock.json b/package-lock.json index 0c09129..1b93be6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@cancerit/cgpjbrowsetoolkit", - "version": "2.3.1", + "version": "2.3.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 975810a..42b57aa 100644 --- a/package.json +++ b/package.json @@ -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",