Juicebox icon indicating copy to clipboard operation
Juicebox copied to clipboard

Error when loading tracks

Open nchernia opened this issue 6 years ago • 0 comments

When loading tracks it's okay to have a null genome but we throw an error. This happens e.g. if people are using custom genomes and then trying to load tracks. E.g. we call BigWigDataSource src = new BigWigDataSource(new BBFileReader(locator.getPath()), genome);

Second argument is optional and can be null. So below needs to change:

private Genome loadGenome() { String genomePath; Genome genome = GenomeManager.getInstance().getCurrentGenome(); if (genome == null) { if (hic.getDataset() != null) { if (Private.assessGenomeID(hic.getDataset().getGenomeId())) { genomePath = Private.getGenome(); } else if (hic.getDataset().getGenomeId().equals("dMel")) { genomePath = "http://igvdata.broadinstitute.org/genomes/dmel_r5.22.genome"; } else { genomePath = "http://igvdata.broadinstitute.org/genomes/" + hic.getDataset().getGenomeId() + ".genome"; } } else { genomePath = "http://igvdata.broadinstitute.org/genomes/hg19.genome"; }

        try {
            **genome = GenomeManager.getInstance().loadGenome(genomePath, null);**
        } catch (IOException e) {
            System.err.println("Error loading genome: " + genomePath + " " + e.getLocalizedMessage());
        }

    }

nchernia avatar Feb 16 '19 13:02 nchernia