Bring Drag & Drop to Dash with Dashboard Engine. 💫 Learn how at our next webinar!

Dash-Bio load local files into igv-component

Hi!

i want to load local files like .fa, .gtf, .bed, .bedgraph into the igv component. For example like this:

html.Div([
            dash_bio.Igv(
                id='reference-igv',
                reference=thaliana,
            )
        ])

thaliana = {
        "id": "tair",
        "name": "A. thaliana (TAIR 10)",
        "sourceType": "file",
        "fastaURL": "samples/TAIR10_chr_all.fas",
        "tracks": [
            {
                "name": "Genes",
                "type": "annotation",
                "format": "gtf",
                "sourceType": "file",
                "url": "samples/Araport11_protein_coding.201606.gtf.gz",
            }
        ]
    }

bedgraph = {
        'id': 'tair10',
        'name': "Annotation",
        'type': "annotation",
        'format': "bed",
        'sourceType': "file",
        'url': "./samples/Araport11_protein_coding.201606.bed",
        'displayMode': "EXPANDED"
    }

The bedgraph is another example. It would be set to the reference, instead of thaliana. But it will not load the local files. If i change the id: “tair” to id:“tair10” it will load from the list of pre-defined reference genomes. The following changes i also tried to run.

  • str(pathlib.Path(file).parent/ ‘samples/TAIR10_chr_all.fas’)
  • pathlib.Path(absolute_path_string).as_uri()
  • os.path.realpath(‘TAIR10_chr_all.fas’)

How can i load local files into the igv-component?