#!/usr/bin/perl

@A_cell = ("Adipose.IUCPQ", "Blood.IUCPQ", "Blood.CARTaGENE");

foreach $cell (@A_cell) {

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

	my @A_files;
	@A_files = </mnt/www/webroot/hg19/others/grundberg/*log10.bw>;
	foreach $file (@A_files) {
		$file =~ s/\/mnt\/webroot\///;

next if ($file !~ /$cell/);

		($sample) = $file =~ /grundberg\/(.*)\.log10\.bw/;

$color = "0,0,$val";			

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

