#!/usr/bin/perl use strict; use warnings; use Bio::PopGen::IO; use Bio::PopGen::Statistics; use Data::Dumper; open my $input, "file1.csv" or die $!; open my $out_file, ">", "testGENO" or die "Can't open output file: $!\n"; my $io = new Bio::PopGen::IO( -format => 'csv', -file => "file1.csv" ); my @markers; my @samples; while ( my $ind = $io->next_individual ) { print $ind,"\n"; # my %hash = %$ind; print Dumper($ind); if ( $ind =~ /^SAMPLE/ ) { push @markers, $ind; } else { push @samples, [$ind]; } } #### my $segsites = Bio::PopGen::Statistics->segregating_sites_count( \@samples );