#!/usr/bin/perl

$refGenome = "hg38";
$idColumns = 2;  # number of period-separated text chunks from bigwig file name to use as identifier
$string = "bigWig";     # files to collect (like 'bw' or 'bigWig')
#$vertRange = $ARGV[3];  # set visible ymax and turn off auto-scale

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

$ls = `ls -1 *.$string`;
foreach $bwfile (split/\n/, $ls) {
  @ar = split/\./, $bwfile;
  @arX = splice(@ar, 0, $idColumns);
  $id = join(" ", @arX);
  print "track type=bigWig name=\"$id pctMeth\" db=$refGenome visibility=full alwaysZero=on autoScale=off viewLimits=0:100 maxHeightPixels=40 color=0,0,153 bigDataUrl=https://snpinfo.niehs.nih.gov/ucscview/$path/$bwfile\n";
}

