/tools/filters/CreateInterval.pl

https://bitbucket.org/cistrome/cistrome-harvard/ · Perl · 19 lines · 8 code · 7 blank · 4 comment · 2 complexity · e7aec02da073f3895673723f89b3eefe MD5 · raw file

  1. #! /usr/bin/perl -w
  2. # Accepts chrom, start, end, name, and strand
  3. # If strand is void sets it to plus
  4. # CreateInterval.pl $chrom $start $end $name $strand $output
  5. my $strand = "+";
  6. die "Not enough arguments\n" unless @ARGV == 6;
  7. open OUT, ">$ARGV[5]" or die "Cannot open $ARGV[5]:$!\n";
  8. $strand = "-" if $ARGV[4] eq "minus";
  9. $ARGV[3] =~ s/\s+/_/g;
  10. $ARGV[3] =~ s/\t+/_/g;
  11. print OUT "$ARGV[0]\t$ARGV[1]\t$ARGV[2]\t$ARGV[3]\t0\t$strand\n";
  12. close OUT;