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

my %coordinates           = (); # if coordinates and color are the same ... then avoid the dot (but change the transparency to stronger ?)
my $file = $ARGV[0] or die "Need to get a CSV file AND a SIZE on the command line\n";
open(my $data, '<', $file) or die "Could not open '$file' $!\n";
while (my $line = <$data>) {
  chomp $line;
  my @linefields = split "\t" , $line;
  # check if double key or not
  my $key = "";
  for my $i (1 .. $#linefields) {
    $key .= ($linefields[$i])."_";
  }
  # dont print duplicates
  if (!(defined $coordinates{$key})) {
    for my $i (0 .. $#linefields){
      print "".($linefields[$i])."\t";
    }
    print "\n";
    $coordinates{$key} = 1;
  }
}
