#!/usr/bin/perl

@A_cell = ("adipose", "blood");

foreach $cell (@A_cell) {

if ($cell eq "adipose") { $pre = "0,0"; }
else                    { $pre = "0,0"; }

$val = 0;
	$txt = qq {track $cell
type bigWig
container multiWig
shortLabel $cell
longLabel $cell
visibility full
aggregate stacked
autoScale on
showSubtrackColorOnUi on
maxHeightPixels 100:48:8
priority 1
};
	print $txt;

	my @A_files;
	@A_files = </mnt/www/webroot/hg19/others/fiona/$cell/*bigwig>;
	foreach $file (@A_files) {
		$file =~ s/\/home\/tkwan\/webroot\///;

		($sample) = $file =~ /fiona\/.*\/(.*)\.bigwig/;
			
		if ($cell eq "adipose") { $color = "0,0,$val"; }
		else                    { $color = "$val,0,0"; }

		$txt = qq {
track $cell.$sample
bigDataUrl http://pastinenlab.genome.mcgill.ca/hg19/others/fiona/$cell/$sample.bigwig
shortLabel $cell.$sample
longLabel $cell.$sample
parent $cell
type bigWig
autoScale on
color $color
};
		print "$txt\n";
		$val++;
	}
}

