Skip to content

Commit

Permalink
add ALT description to VCF feature description string
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed Mar 8, 2013
1 parent aeb21fa commit 7b7e903
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/JBrowse/Store/SeqFeature/VCFTabix.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@ return declare( [SeqFeatureStore,DeferredStatsMixin,DeferredFeaturesMixin,Global
headData.info = i;
}

// index the alt fields by field ID
if( headData.alt ) {
var i = {};
array.forEach( headData.alt, function( irec ) {
i[irec.id]= irec;
});
headData.alt = i;
}

return headData;
},

Expand Down Expand Up @@ -292,13 +301,15 @@ return declare( [SeqFeatureStore,DeferredStatsMixin,DeferredFeaturesMixin,Global

var ref = fields[3];
var alt = fields[4];

var ids = (fields[2]||'').split(';');
var SO_type = this._so_type( ref, alt );
var featureData = {
start: line.start,
end: line.start+ref.length,
seq_id: line.ref,
description: SO_type+": "+ref+" -> "+alt,
description: SO_type+": "+ref+" -> "+ alt
+ (this.header.alt[alt] ? ' ('+this.header.alt[alt].description+')' : ''),
name: ids[0],
type: SO_type,
reference_allele: ref,
Expand Down

0 comments on commit 7b7e903

Please sign in to comment.