@gmod/jbrowse
Version:
JBrowse - client-side genome browser
30 lines (29 loc) • 1.45 kB
Plain Text
[ tracks . volvox_vcf_test ]
storeClass = JBrowse/Store/SeqFeature/VCFTabix
urlTemplate = ../../raw/volvox/volvox.test.vcf.gz
category = VCF
type = JBrowse/View/Track/CanvasVariants
key = VCF - additional test data
[ tracks . volvox-sorted-vcf ]
hooks.modify = function( track, feature, div ) { div.style.backgroundColor = track.config.variantIsHeterozygous(feature) ? 'red' : 'blue'; }
key = VCF - volvox-sorted variants
# multiline callbacks can be defined in tracks.conf format files
variantIsHeterozygous = function( feature ) {
/* javascript comments inside callback should use this format, not double slash format */
var genotypes = feature.get('genotypes');
for( var sampleName in genotypes ) {
try {
var gtString = genotypes[sampleName].GT.values[0];
if( ! /^1([\|\/]1)*$/.test( gtString) && ! /^0([\|\/]0)*$/.test( gtString ) )
return true;
} catch(e) {}
}
return false;
/* note: the body of the function including the closing brackets should be spaced away from the left-most column
there should also not be empty lines */
}
storeClass = JBrowse/Store/SeqFeature/VCFTabix
urlTemplate = ../../raw/volvox/volvox.filtered.vcf.gz
type = JBrowse/View/Track/HTMLVariants
metadata.category = VCF
metadata.Description = Variants called from volvox-sorted.bam using samtools and bcftools. Heterozygous variants are shown in red, homozygous variants in blue.