feature (samNormalise.pl): add command-line options and help

parent 638ea3fc
#!/usr/bin/env perl
use warnings;
use strict;
## samNormalise.pl -- extracts random sequences from those mapped
## at each base location, attempting to maintain a minimum coverage
## threshold where possible.
use Pod::Usage; ## uses pod documentation in usage code
use Getopt::Long qw(:config auto_help pass_through);
my $pos = -1;
my $seqName = "";
......@@ -16,9 +17,47 @@ my $targetCoverage = 100;
my %posReads = ();
my %windowReads = ();
my $covNeeded = -1;
my $output = "sam"; # can be "sam" or "fastq"
our $VERSION = "0.1";
=head1 NAME
samNormalise.pl -- randomly filter mapped reads down to a specific coverage
=head1 SYNOPSIS
samtools view reads.bam | ./samNormalise.pl [options]
=head2 Options
=over 2
=item B<-help>
Only display this help message
=item B<-coverage>
Change target coverage (default: 100)
=item B<-format> (sam|fastq)
Change output format (default: sam)
=back
=head1 DESCRIPTION
Extracts random sequences from those mapped at each base location,
attempting to maintain a minimum coverage threshold where possible.
=cut
GetOptions("format=s" => \$output, "coverage=i" => \$targetCoverage)
or pod2usage(1);
sub printSeq {
my ($id, $seq, $qual) = @_;
if($id){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment