package Bio::MLST::FilterAlleles;
# ABSTRACT: Filter Alleles
$Bio::MLST::FilterAlleles::VERSION = '2.1.1706216';

use strict;
use warnings;

use Exporter qw(import);
our @EXPORT_OK = qw(only_keep_alleles is_metadata);

# A list of column headings in a profile file which
# can be assumed not to be allele names.  If this list
# gets much longer we should have a rethink about
# getting a whitelist of alleles either based on the
# contents of the alleles directory or from the
# config file downloaded from the internet.
my @allele_blacklist = (

sub is_metadata
  my ($column_heading) = @_;
     return grep( /^$column_heading$/, @allele_blacklist );
     return 0;

sub only_keep_alleles
  my ($alleles) = @_;
  my @alleles_to_keep = ();
  for my $allele (@$alleles) {
    push( @alleles_to_keep, $allele ) unless is_metadata($allele);
  return \@alleles_to_keep;




=encoding UTF-8

=head1 NAME

Bio::MLST::FilterAlleles - Filter Alleles

=head1 VERSION

version 2.1.1706216

=head1 SYNOPSIS - Filter header row  from profile to remove non-alleles

=head1 AUTHOR

Andrew J. Page <>


This software is Copyright (c) 2012 by Wellcome Trust Sanger Institute.

This is free software, licensed under:

  The GNU General Public License, Version 3, June 2007