CroBiAd / DAWN

Diversity Among Wheat geNomes (DAWN)
http://crobiad.agwine.adelaide.edu.au/dawn/
0 stars 1 forks source link

VCFTabix using csiUrlTemplate doesn't colour variants #18

Closed nathanhaigh closed 5 years ago

nathanhaigh commented 5 years ago

Previously, a track configured with:

storeClass              = JBrowse/Store/SeqFeature/VCFTabix
urlTemplate             = ../{refseq}/Alsen.bam.vcf.gz
style.color             = function(feature) {
   var alt = feature.get('alternative_alleles');
   alt = alt.values;
   alt = [alt];
   switch(alt[0]) {
    case 'A':
        return '#00BF00';
        break;
    case 'C':
        return '#4747FF';
        break;
    case 'G':
        return '#D5BB04';
        break;
    case 'T':
        return '#FF0000';
        break;
    default:
        return 'black';
   }
 }

Would use ../{refseq}/Alsen.bam.vcf.gz.tbi and colour variants according to the function defined in style.color. However, after switching to full-pseudomolecules and thus CSI indexing of VCF files. My configuration has changed to:

storeClass              = JBrowse/Store/SeqFeature/VCFTabix
urlTemplate             = ../{refseq}/Alsen.bam.vcf.gz
csiUrlTemplate          = ../{refseq}/Alsen.bam.vcf.gz.csi
style.color             = function(feature) {
   var alt = feature.get('alternative_alleles');
   alt = alt.values;
   alt = [alt];
   switch(alt[0]) {
    case 'A':
        return '#00BF00';
        break;
    case 'C':
        return '#4747FF';
        break;
    case 'G':
        return '#D5BB04';
        break;
    case 'T':
        return '#FF0000';
        break;
    default:
        return 'black';
   }
 }

However, the colouring of variants no longer works.

nathanhaigh commented 5 years ago

Hmm, seems the colouring is lost in the old parts-based version of DAWN too. Perhaps this is a change in the latest version of JBrowse?

nathanhaigh commented 5 years ago

A recent change to npm @gmod/vcf mean it was no longer required to cast alt from a string to an array using alt = [alt];. Removing this line from conf files fixed the variant colouring issue.