qw(croak);
use File::Spec;
use JSON::PP;
use FASTX::Reader;
use File::Basename;
use Exporter qw(import);
our $VERSION = '1.7.0';
our @EXPORT = qw(getStats getN50 jsonStats);
# Configuration
our $DE
DIGITS = 2;
our $MIN_CUSTOM_N = 0;
our $MAX_CUSTOM_N = 100;
sub getStats {
my ($file, $wantJSON, $customN) = @_;
# Input validation
croak "Missing input file parameter" unless defi
);
$stats->{Nx} = $nx if defined $customN;
# Generate JSON if requested
if ($wantJSON) {
$stats->{json} = JSON::PP->new->pretty->encode($stats);
}
return $stats;
}
su