#!/usr/bin/perl

#$ls = `ls -1 Novel*.bam`;
$ls = `ls -1 IRGM*.bam`;
foreach $bamfile (split/\n/, $ls) {
  unless (-e "$bamfile.bai") { system "samtools index $bamfile"; }
  @ar = split/\./, $bamfile; $id = "$ar[0] $ar[1]";
  print "track type=bam name=\"$id\" db=hg19 bamColorMode=strand pairEndsByName=yes visibility=full bigDataUrl=http://snpinfo.niehs.nih.gov/ucscview/fessler/GTEx/devSara/$bamfile\n";
}
