Custom Reader Example

In this example a custom javascript class is supplied to read features from a url. The class implements the required method async readFeatures(chr, start, end)


    class CytobandReader {
      async readFeatures(chr, start, end) {
        const response = await fetch(`https://lk85l6ycte.execute-api.us-east-1.amazonaws.com/dev/testservice/bands?chr=${chr}&start=${start}&end=${end}`,
                                    {headers: {'Content-Type': 'application/json'}});
        return response.json();
      }
    }
    ...
    const config = {
      genome: "hg38",
      locus: "chr1",
      tracks: [
        {
          name: "Cytobands",
          type: "annotation",
          displayMode: "collapsed",
          reader: new CytobandReader({})
         }
      ]
    }