#!/usr/bin/perl

$rgb = "0,153,0";

$refGenome = "hg38";
$idColumns = 5;

$path = `pwd`; $path =~ s/\s//g;
$path =~ s/\/data\/wade\///;

%sKey = ("TET2.Abcam.1_50.1_100.CaCl2_30-rep1" => "x1", "TET2.Abcam.1_50.1_100.CaCl2_30-rep2" => "x2", "TET2.Abcam.2ug.1_100.CaCl2_30-rep1" => "x3", "TET2.Abcam.2ug.1_100.CaCl2_30-rep2" => "x4");

$ls = `ls -1 TET2*.bigBed`;
foreach $bbfile (split/\n/, $ls) {
  @ar = split/\./, $bbfile;
  @arX = splice(@ar, 0, $idColumns);
  $id = join(".", @arX);
  $outId = "$sKey{$id}"."-$ar[1]";
  print "track type=bigBed name=\"$outId peaks\" db=$refGenome visibility=dense color=$rgb bigDataUrl=https://snpinfo.niehs.nih.gov/ucscview/$path/$bbfile\n";
}

