#!/usr/bin/perl

@A_cat = ("Eos", "CD4");
@A_strand = ("forward", "reverse");

foreach $cat (@A_cat) {
	foreach $str (@A_strand) {

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

		my @A_files;
		@A_files = </mnt/www/webroot/hg19/rna_seq/v_2/EMC_Asthma/hg19/wiggle_tracks/*$cat*$str.bigwig>;
		foreach $file (@A_files) {
			$file =~ s/\/mnt\/www\/webroot\///;

			($sample) = $file =~ /wiggle_tracks\/(.*)\.bigwig/;

if ($str eq "forward")    { $color = "0,0,$val"; }
elsif ($str eq "reverse") { $color = "$val,0,0"; }
#$color = "0,0,$val";			

			$txt = qq {
track $sample
bigDataUrl http://emc.genome.mcgill.ca/hg19/rna_seq/v_2/EMC_Asthma/hg19/wiggle_tracks/$sample.bigwig
shortLabel $sample
longLabel $sample
parent $cat.$str
type bigWig
autoScale on
color $color
};
		print "$txt\n";
		$val+=2;
	}
}
}
