{
  "$schema": "https://jbrowse.org/jb2/schema/v5/config.json",
  "assemblies": [
    {
      "name": "hg38",
      "aliases": ["GRCh38"],
      "sequence": {
        "type": "ReferenceSequenceTrack",
        "trackId": "hg38-ReferenceSequenceTrack",
        "adapter": {
          "type": "TwoBitAdapter",
          "uri": "https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.2bit",
          "chromSizes": "https://jbrowse.org/demos/gene_density/hg38.chrom.sizes"
        }
      }
    }
  ],
  "tracks": [
    {
      "type": "QuantitativeTrack",
      "trackId": "alu_per_kb",
      "name": "Alu copies per kb",
      "assemblyNames": ["hg38"],
      "adapter": {
        "type": "BigWigAdapter",
        "bigWigLocation": {
          "uri": "https://jbrowse.org/demos/gene_density/Alu.bed.density.bw"
        }
      },
      "displayDefaults": { "extent": "none" }
    },
    {
      "type": "FeatureTrack",
      "trackId": "alu_age",
      "name": "Alu copies",
      "assemblyNames": ["hg38"],
      "adapter": {
        "type": "BedTabixAdapter",
        "bedGzLocation": {
          "uri": "https://jbrowse.org/demos/gene_density/Alu.bed.gz"
        },
        "index": {
          "location": {
            "uri": "https://jbrowse.org/demos/gene_density/Alu.bed.gz.tbi"
          }
        }
      },
      "displays": [
        {
          "type": "LinearMarkDisplay",
          "displayId": "alu_age-LinearMarkDisplay",
          "marks": [
            {
              "mark": "bar",
              "transform": [
                {
                  "type": "formula",
                  "expr": "jexl:substring(feature.name, 0, 4)",
                  "as": "lineage"
                }
              ],
              "encoding": {
                "y": "milliDiv",
                "color": {
                  "field": "lineage",
                  "scale": "categorical",
                  "domain": ["AluJ", "AluS", "AluY", "FLAM", "FRAM"],
                  "range": [
                    "#4575b4",
                    "#fdae61",
                    "#d73027",
                    "#8c8c8c",
                    "#8c8c8c"
                  ],
                  "title": "Alu lineage"
                }
              },
              "maxBpPerPx": 100
            },
            {
              "mark": "bar",
              "transform": [
                { "type": "bin", "step": "auto" },
                {
                  "type": "aggregate",
                  "groupby": ["start", "end"],
                  "ops": [{ "op": "count" }]
                }
              ],
              "encoding": { "color": { "value": "#c0c0c0" } },
              "minBpPerPx": 100
            },
            {
              "mark": "bar",
              "transform": [
                {
                  "type": "filter",
                  "expr": "jexl:startsWith(feature.name, 'AluY')"
                },
                { "type": "bin", "step": "auto" },
                {
                  "type": "aggregate",
                  "groupby": ["start", "end"],
                  "ops": [{ "op": "count" }]
                }
              ],
              "encoding": { "color": { "value": "#d73027" } },
              "minBpPerPx": 100
            }
          ]
        }
      ]
    },
    {
      "type": "FeatureTrack",
      "trackId": "alu_young_share",
      "name": "AluY share per Mb, against the genome",
      "assemblyNames": ["hg38"],
      "adapter": {
        "type": "BedTabixAdapter",
        "uri": "Alu.young_share.bed.gz"
      },
      "displays": [
        {
          "type": "LinearMarkDisplay",
          "displayId": "alu_young_share-LinearMarkDisplay",
          "scales": {
            "y": {
              "domainMin": -1.5,
              "domainMax": 1.5,
              "title": "AluY share, log2"
            }
          },
          "marks": [
            {
              "mark": "bar",
              "encoding": {
                "y": "youngLog2",
                "color": {
                  "field": "youngLog2",
                  "scale": "threshold",
                  "domain": [0],
                  "range": ["#4575b4", "#d73027"],
                  "labels": ["below the genome-wide share", "above it"],
                  "title": "AluY share"
                }
              }
            }
          ]
        }
      ]
    },
    {
      "type": "FeatureTrack",
      "trackId": "alu_strand_share",
      "name": "Plus-strand share per Mb, against a half",
      "assemblyNames": ["hg38"],
      "adapter": {
        "type": "BedTabixAdapter",
        "uri": "Alu.young_share.bed.gz"
      },
      "displays": [
        {
          "type": "LinearMarkDisplay",
          "displayId": "alu_strand_share-LinearMarkDisplay",
          "scales": {
            "y": {
              "domainMin": -1.5,
              "domainMax": 1.5,
              "title": "Plus-strand share, log2"
            }
          },
          "marks": [
            {
              "mark": "bar",
              "encoding": {
                "y": "strandLog2",
                "color": {
                  "field": "strandLog2",
                  "scale": "threshold",
                  "domain": [0],
                  "range": ["#4575b4", "#d73027"],
                  "labels": ["below a half", "above it"],
                  "title": "Plus-strand share"
                }
              }
            }
          ]
        }
      ]
    }
  ]
}
