package PGF::GapResolution::ParseSffInfo; =head1 NAME PGF::GapResolution::ParseSffInfo =head1 SYNOPSIS use PGF::GapResolution::ParseInfo; my $obj = PGF::GapResolution::ParseInfo($sffInfoFile); my $library = $obj->getLibrary($sffFileName); my $sffFile = $obj->getSff($library); my $sffType = $obj->getSffType($sffFile); # returns 'P' for paired, 'U' for unpaired. my @sffFiles = $obj->getSffFiles(); =head1 DESCRIPTION This module parses the sffinfo.txt file generated by parseNewblerMetrics.pl as part of the Gap Resolution sub system and contains access methods to the data. The format of the $sffInfoFile mentioned above are as follows, separated by a tab: 1. 2. 3. ) { chomp $entry; next if !length $entry; my @entries = split /\t/, $entry; if ( @entries < 3 ) { confess "ERROR: $file does not contain a vaild entry.\n"; } my $library = $entries[0]; my $sff = $entries[1]; my $sffType = $entries[2]; $libraryMapping{$library} = $sff; $sffMapping{$sff} = $library; $sffTypeMapping{$sff} = $sffType; } close FH; $self->{_libraryMapping} = \%libraryMapping; $self->{_sffMapping} = \%sffMapping; $self->{_sffTypeMapping} = \%sffTypeMapping; } #============================================================================# sub getLibrary { my $self = shift; my $sffFile = shift; my $library = exists $self->{_sffMapping}{$sffFile} ? $self->{_sffMapping}{$sffFile} : ''; return $library; } #============================================================================# sub getSff { my $self = shift; my $library = shift; my $sff = exists $self->{_libraryMapping}{$library} ? $self->{_libraryMapping}{$library} : ''; return $sff; } #============================================================================# sub getSffType { my $self = shift; my $sff = shift; my $sffType = exists $self->{_sffTypeMapping}{$sff} ? $self->{_sffTypeMapping}{$sff} : ''; return $sffType; } #============================================================================# sub getSffFiles { my $self = shift; return keys %{$self->{_sffMapping}}; } #============================================================================# 1;