#!/usr/bin/perl
use strict;
use warnings;

#copy bbi files to trackHub with makefile
my $build = 'mm10';
my $type = 'atac';

while (<>) { #redirect in track.ra file
   chomp;
   if (/bigDataUrl/) {
      my $bbi = "bbi";
      if (/bbi.private/) { $bbi = "bbi.private"; }
      if (/(\w+)\.(bw|bb)\s*$/) {
         my $file = "$1.$2";
         #command for makefile, so can verify
         print "\tcp /gbdb/$build/$bbi/$file $type/$file\n";
      }else { print STDERR "Failed to parse $_, $!\n"; }
   } #else go to next line
}

exit;
