Error on 'Save Track Data' in HTMLVariants #800

Closed
deepakunni3 opened this Issue Aug 17, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@deepakunni3
Contributor

deepakunni3 commented Aug 17, 2016

I have a VCF file loaded as a HTMLVariants track and if I try to export GFF3 via 'Save Track Data', I get the following stack trace on the browser console:

LRUCache.js:167 TypeError: Cannot read property 'hasOwnProperty' of null TypeError: Cannot read property 'hasOwnProperty' of null
    at _gff3_format_attributes (http://localhost/jbrowse/src/JBrowse/View/Export/GFF3.js:196:32)
    at formatFeature (http://localhost/jbrowse/src/JBrowse/View/Export/GFF3.js:133:26)
    at writeFeature (http://localhost/jbrowse/src/JBrowse/View/Export/GFF3.js:145:24)
    at http://localhost/jbrowse/src/dojo/_base/lang.js:373:45
    at http://localhost/jbrowse/src/JBrowse/Store/SeqFeature/VCFTabix.js:125:21
    at .<anonymous> (http://localhost/jbrowse/src/JBrowse/Store/TabixIndexedFile.js:121:29)
    at .<anonymous> (http://localhost/jbrowse/src/JBrowse/Store/LRUCache.js:165:47)
    at Object.forEach (http://localhost/jbrowse/src/dojo/_base/array.js:247:15)
    at .<anonymous> (http://localhost/jbrowse/src/JBrowse/Store/LRUCache.js:163:27)
    at http://localhost/jbrowse/src/dojo/_base/lang.js:327:19 TypeError: Cannot read property 'hasOwnProperty' of null(…)

After inspecting the stack-trace, it looks like JBrowse/View/Export/GFF3.js is expecting a VCF entry to have genotype information by default, which is not always the case.

The issue was encountered on JBrowse 1.12.2-apollo and reproduced on JBrowse-1.12.1 as well.

VCF used: ftp://ftp.ensembl.org/pub/release-85/variation/vcf/homo_sapiens/Homo_sapiens_clinically_associated.vcf.gz

@nathandunn nathandunn referenced this issue in GMOD/Apollo Aug 18, 2016

Open

Annotate Variants #524

@cmdcolin

This comment has been minimized.

Show comment
Hide comment
@cmdcolin

cmdcolin Mar 22, 2017

Contributor

This can be fixed with a simple patch to the source

diff --git a/src/JBrowse/View/Export/GFF3.js b/src/JBrowse/View/Export/GFF3.js
index 4a25caf..f712641 100644
--- a/src/JBrowse/View/Export/GFF3.js
+++ b/src/JBrowse/View/Export/GFF3.js
@@ -193,6 +193,9 @@ return declare( ExportBase,
         var attrOrder = [];
         for( var tag in attrs ) {
             var val = attrs[tag];
+            if(!val) {
+                continue;
+            }
             var valstring = val.hasOwnProperty( 'toString' )

I personally think a more fully fledged gvf or vcf exporter would be nice but adding this patch would at least allow those exports to complete.

Contributor

cmdcolin commented Mar 22, 2017

This can be fixed with a simple patch to the source

diff --git a/src/JBrowse/View/Export/GFF3.js b/src/JBrowse/View/Export/GFF3.js
index 4a25caf..f712641 100644
--- a/src/JBrowse/View/Export/GFF3.js
+++ b/src/JBrowse/View/Export/GFF3.js
@@ -193,6 +193,9 @@ return declare( ExportBase,
         var attrOrder = [];
         for( var tag in attrs ) {
             var val = attrs[tag];
+            if(!val) {
+                continue;
+            }
             var valstring = val.hasOwnProperty( 'toString' )

I personally think a more fully fledged gvf or vcf exporter would be nice but adding this patch would at least allow those exports to complete.

@cmdcolin cmdcolin closed this in 670382a Mar 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment