Skip to content

Commit

Permalink
Parse NON_REF symbolic allele
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 15, 2018
1 parent bffbc6d commit 3ab8b7a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/JBrowse/Store/SeqFeature/VCFTabix/Parser.js
Expand Up @@ -231,7 +231,8 @@ return declare( null, {
"CNV": { description: "Copy number variable region (may be both deletion and duplication)", so_term: 'copy_number_variation' },
"DUP:TANDEM": { description: "Tandem duplication", so_term: 'copy_number_gain' },
"DEL:ME": { description: "Deletion of mobile element relative to the reference" },
"INS:ME": { description: "Insertion of a mobile element relative to the reference" }
"INS:ME": { description: "Insertion of a mobile element relative to the reference" },
"NON_REF": { description: "Represents any possible alternative allele at this location", so_term: "biological_region" }
},

/**
Expand Down Expand Up @@ -361,7 +362,6 @@ return declare( null, {
return this._find_SO_term_from_alt_definitions( alt );
}, this ),
function( t ) { return t; } );

if( types[0] )
return types.join(',');

Expand All @@ -377,7 +377,7 @@ return declare( null, {
if( ! alt )
return 'no alternative alleles';

alt = alt.replace(/^|$/g,'');
alt = alt.replace(/^<|>$/g,'');

var def = this.getVCFMetaData( 'alt', alt );
return def && def.description ? alt+' - '+def.description : SO_term+" "+ref+" -> "+ alt;
Expand All @@ -392,8 +392,11 @@ return declare( null, {

// look for a definition with an SO type for this
var def = (this.header.alt||{})[alt] || this._vcfReservedAltTypes[alt];
if( def && def.so_term )
if( def && def.so_term ) {
return def.so_term;
} else if( def && (this._vcfReservedAltTypes[alt]||{}).so_term ) {
return this._vcfReservedAltTypes[alt].so_term;
}

// try to look for a definition for a parent term if we can
alt = alt.split(':');
Expand Down
Binary file added tests/data/raw.g.vcf.gz
Binary file not shown.
Binary file added tests/data/raw.g.vcf.gz.tbi
Binary file not shown.
Binary file added tests/data/raw.g.vcf.idx
Binary file not shown.

0 comments on commit 3ab8b7a

Please sign in to comment.