[Bio] / FigKernelScripts / import_external_sequences_step1.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/import_external_sequences_step1.pl

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

revision 1.4, Fri Mar 11 16:03:19 2005 UTC revision 1.5, Tue Apr 19 03:01:45 2005 UTC
# Line 1  Line 1 
1  # -*- perl -*-  # -*- perl -*-
2    #
3    # You must build the FIG/Data/NR directory to reflect the set of external
4    # sources you wish integrated into the SEED
5    #
6    
7  use FIG;  use FIG;
8    
 $usage = "usage: import_external_sequences_step1 SequencesDirectory";  
   
 (  
  ($seq_dir = shift @ARGV) && opendir(NEW,$seq_dir)  
 )  
     || die $usage;  
   
 opendir(OLD,$_ = "$FIG_Config::data/NR") || die "What happened to $_?";  
   
 @old = grep { $_ !~ /^\./ } readdir(OLD);  
 closedir(OLD);  
   
 @new = grep { $_ !~ /^\./ } readdir(NEW);  
 closedir(NEW);  
 %new = map { $_ => 1 } @new;  
   
 @replaced = grep { $new{$_} } @old;  
   
9  $scr = "$FIG_Config::temp/NR.update.$$";  $scr = "$FIG_Config::temp/NR.update.$$";
10  mkdir($scr,0777) || die "could not make $scr";  mkdir($scr,0777) || die "could not make $scr";
11    
12  (undef,undef,undef,$day,$mon,$yr) = localtime;  &FIG::run("cat $FIG_Config::data/NR/*/assigned_functions > ext_func.table");
13  $time = join("_",(1900+$yr,$mon+1,$day));  &FIG::run("cat $FIG_Config::data/NR/*/org.table  > ext_org.table");
   
 $archive = "$FIG_Config::data/Archive/NR/$time";  
 &FIG::verify_dir($archive);  
 foreach $subdir (@replaced)  
 {  
     &FIG::run("cp -rp $FIG_Config::data/NR/$subdir $archive");  
 }  
   
 foreach $subdir (@new)  
 {  
     &FIG::run("cp -rp $seq_dir/$subdir $FIG_Config::data/NR/$subdir");  
 }  
   
 &FIG::run("cp $FIG_Config::global/nr $scr/old.nr");  
 &FIG::run("cp $FIG_Config::global/peg.synonyms $scr/old.peg.synonyms");  
   
14  &FIG::run("build_nr_sources > $scr/nr.sources");  &FIG::run("build_nr_sources > $scr/nr.sources");
15  &FIG::run("build_nr $scr/nr.sources $scr/nr $scr/peg.synonyms");  &FIG::run("build_nr $scr/nr.sources $scr/nr $scr/peg.synonyms");
16  &FIG::run("compute_changed_ids_for_nrs $FIG_Config::global/nr $FIG_Config::global/peg.synonyms $scr/nr $scr/added.ids $scr/deleted.ids");  &FIG::run("compute_changed_ids_for_nrs $FIG_Config::global/nr $FIG_Config::global/peg.synonyms $scr/nr $scr/added.ids $scr/deleted.ids $scr/replaced.ids");
 mkdir("$scr/NewSims",0777);  
17  &FIG::run("pull_fasta_entries $scr/nr < $scr/added.ids > $scr/fasta.added.entries");  &FIG::run("pull_fasta_entries $scr/nr < $scr/added.ids > $scr/fasta.added.entries");
18  print STDERR "Now run  &FIG::run("process_sim_deletions_and_replacements $FIG_Config::data/Sims $scr/Sims $scr/replaced.ids $scr/deleted.ids");
19    mkdir("$scr/NewSims",0777) || die "could not make $scr/NewSims";
20    
21    print STDERR "Now build similarities from
22    
23              $scr/peg.synonyms
24              $scr/fasta.added.entries
25              $scr/nr
26    
27    and then put the new similarities into
28    
29                     import_external_sequences_step2 $scr/nr $scr/fasta.added.entries $scr/NewSims            $scr/NewSims
30    
31                                        and  and run
32    
33                     import_external_sequences_step3 $scr                     import_external_sequences_step3 $scr
34    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3