package PGF::GapResolution::ReadName; =head1 NAME PGF::GapResolution::ReadName =head1 SYNOPSIS use PGF::GapResolution::ReadName; my $obj = PGF::GapResolution::ReadName->new($readName); my $isPhrapRead = $obj->isPhrapRead(); my $libraryName = $obj->getLibrary(); =head1 DESCRIPTION =head1 AUTHOR(s) Stephan Trong =head1 HISTORY =over =item * Stephan Trong 03/02/2009 Creation =back =cut #============================================================================# use strict; use Carp; use Carp qw(cluck); use FindBin qw($RealBin); use lib "$FindBin::RealBin/../lib"; #============================================================================# sub new { my $class = shift; my $readName = shift || ''; if ( !length $readName ) { confess "ERROR: must specify read name."; } my $self = { readName=>$readName }; bless $self, $class; return $self; } #============================================================================# sub isPhrapRead { my $self = shift; # Look for phrap like read nameing ( e.g., abc123.x1 ) # if ( $self->{readName} =~ /^\w+\.[a-z]\d+/ ) { return 1; } else { return 0; } } #============================================================================# sub getLibrary { my $self = shift; my $library = ''; if ( $self->{readName} =~ /^(\D+)\d+\.[a-z]\d+/ ) { $library = $1; } return $library; } #============================================================================# 1;