Skip to content

Commit

Permalink
Fixup nocall features
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Nov 24, 2018
1 parent 1e11586 commit 194de61
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions src/JBrowse/Model/VCFFeature.js
Expand Up @@ -11,8 +11,8 @@ function (Util) {
this._id = args.id;
this.data = this.dataFromVariant(this.variant);
},
get(field) {

get(field) {
return this._get(field) || this._get(field.toLowerCase())
},

Expand Down Expand Up @@ -62,18 +62,23 @@ function (Util) {
Object.keys(variant.SAMPLES).forEach(sample => {
this.data.genotypes[sample] = {}
Object.keys(variant.SAMPLES[sample]).forEach(field => {
this.data.genotypes[sample][field] = {
meta: {
id: [field],
},
values: variant.SAMPLES[sample][field]
if(variant.SAMPLES[sample][field]) {
this.data.genotypes[sample][field] = {
meta: {
id: [field],
},
values: variant.SAMPLES[sample][field]
}
const metadata = this.parser.getMetadata('FORMAT', field);
if (metadata) {
const { Description, Number, Type } = metadata
this.data.genotypes[sample][field].meta.Description = [Description]
this.data.genotypes[sample][field].meta.Number = Number
this.data.genotypes[sample][field].meta.Type = Type
}
}
const metadata = this.parser.getMetadata('FORMAT', field);
if (metadata) {
const { Description, Number, Type } = metadata
this.data.genotypes[sample][field].meta.Description = [Description]
this.data.genotypes[sample][field].meta.Number = Number
this.data.genotypes[sample][field].meta.Type = Type
else {
this.data.genotypes[sample][field] = {values: null}
}
})
})
Expand Down Expand Up @@ -253,7 +258,7 @@ function (Util) {

_getSOAndDescByExamination: function (ref, alt) {
if (ref.length == 1 && alt.length == 1) {
// use SNV because SO definition of SNP says abundance must be at
// use SNV because SO definition of SNP says abundance must be at
// least 1% in population, and can't be sure we meet that
return [
'SNV',
Expand Down

0 comments on commit 194de61

Please sign in to comment.