[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.814, Mon May 3 19:42:21 2010 UTC revision 1.815, Mon Jul 12 20:04:39 2010 UTC
# Line 36  Line 36 
36  use Fcntl qw/:flock/;  # import LOCK_* constants  use Fcntl qw/:flock/;  # import LOCK_* constants
37    
38  use POSIX;  use POSIX;
39    use Errno;
40  use IPC::Open2;  use IPC::Open2;
41  use MIME::Base64;  use MIME::Base64;
42  use File::Basename;  use File::Basename;
# Line 3606  Line 3607 
3607      if ($dir =~ /^(.*)\/[^\/]+$/ and $1 ne '') {      if ($dir =~ /^(.*)\/[^\/]+$/ and $1 ne '') {
3608          &verify_dir($1);          &verify_dir($1);
3609      }      }
3610      mkdir($dir,0777) || confess "Could not make directory $dir: $!";      if (!mkdir($dir,0777) && $! != Errno::EEXIST)
3611        {
3612            confess "Could not make directory $dir: $!";
3613        }
3614  }  }
3615    
3616  =head3 run  =head3 run
# Line 19606  Line 19610 
19610      return sort keys(%in);      return sort keys(%in);
19611  }  }
19612    
19613    sub pegs_to_usable_subsystems
19614    {
19615        my($fig, $peg_list) = @_;
19616    
19617        my $dbh = $fig->db_handle->{_dbh};
19618        my $peg_str = join(", ", map { $dbh->quote($_) } @$peg_list);
19619    
19620        my $res = $dbh->selectall_arrayref(qq(SELECT DISTINCT si.protein, si.subsystem
19621                                   FROM subsystem_index si
19622                                       JOIN subsystem_metadata m ON si.subsystem = m.subsystem
19623                                       LEFT JOIN deleted_fids df ON si.protein = df.fid
19624                                   WHERE si.protein IN ($peg_str) AND
19625                                         df.fid IS NULL AND
19626                                         m.class_1 <> '' AND
19627                                         m.class_1 NOT LIKE 'experimental%' COLLATE latin1_swedish_ci AND
19628                                         m.class_1 NOT LIKE '%delete%' COLLATE latin1_swedish_ci));
19629    
19630        my $out = {};
19631        map { push @{$out->{$_->[0]}}, $_->[1] } @$res;
19632        return $out;
19633    }
19634    
19635  sub write_subsystem_spreadsheet {  sub write_subsystem_spreadsheet {
19636      my($self,$ssa,$roles,$genomes,$pegs_in_cells) = @_;      my($self,$ssa,$roles,$genomes,$pegs_in_cells) = @_;
19637      my(@genomes,$genome,$role,@pegs,$pair,$gs);      my(@genomes,$genome,$role,@pegs,$pair,$gs);

Legend:
Removed from v.1.814  
changed lines
  Added in v.1.815

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3