]> git.donarmstrong.com Git - biopieces.git/commitdiff
removed stale file crap from biostat
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 10 Oct 2012 12:28:52 +0000 (12:28 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Wed, 10 Oct 2012 12:28:52 +0000 (12:28 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1959 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/biostat
bp_bin/classify_taxonomy

index 6a7d0406bc0fd1c7d5ceb3138e15068e1633b0d2..d409d28bde803fff27b7c4e5b4fde5e0b11237ad 100755 (executable)
@@ -76,11 +76,6 @@ while ( 1 )
 
             push @table, $info;
         }
-        else
-        {
-            print STDERR "Removing stale file: $file\n";
-            unlink $file;
-        }
     }
 
     if ( $options->{ 'sort' } =~ /^(USER|TMP_DIR|START_TIME|RUN_TIME|COMMAND)$/ ) {
index 1614e5d020d1e6e732c2f99a5e5861dd9f7a6102..8c211ded4e29ff10b38411dac3563152fdd3d8e3 100755 (executable)
 require 'pp'
 require 'maasha/biopieces'
 
+# Class containing methods to construct a taxonomic tree for the classification of
+# organisms. Currently only works with GreenGenes type of entries.
 class TaxTree
+  # Method to initialize a new TaxTree object.
   def initialize
     @tree = TaxNode.new("root", "Root", 0, 0, 0.0)
   end
@@ -55,6 +58,7 @@ class TaxTree
     end
   end
 
+  # Method to merge two TaxTrees.
   def merge(tree)
     node = @tree
 
@@ -76,6 +80,7 @@ class TaxTree
     end
   end
 
+  # Method to flatten a TaxTree turning this into a list by recursive depth first traversal.
   def flatten(node = @tree, list = [])
     list << TaxNode.new(node.level, node.name, node.count, node.size, node.score)
 
@@ -86,6 +91,8 @@ class TaxTree
     list
   end
 
+  # Method to recursively trim a TaxTree show that it only contains a unbranched tree,
+  # which gives the lowest common ancestor.
   def lowest_common_ancestor(node = @tree)
     node.children = {} if node.children.size > 1
 
@@ -94,6 +101,7 @@ class TaxTree
     end
   end
 
+  # Method for iterating over a TaxTree.
   def each
     self.flatten.each do |node|
       yield node
@@ -104,6 +112,7 @@ class TaxTree
 
   private
 
+  # Method containing a helper hash to expand the phylogenetic level name.
   def expand_level(level)
     hash = {
       'd' => "domain",
@@ -121,6 +130,7 @@ class TaxTree
     hash[level]
   end
 
+  # Nested class for TaxTree nodes.
   class TaxNode
     attr_accessor :level, :name, :count, :size, :score, :children
 
@@ -133,6 +143,7 @@ class TaxTree
       @children = {}
     end
 
+    # Method to convert a TaxNode to a Biopiece record.
     def to_bp
       record = {}
       record[:REC_TYPE] = "Classification"
@@ -148,7 +159,7 @@ end
 
 casts = []
 casts << {:long=>'LCA',  :short=>'l', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
-casts << {:long=>'size', :short=>'s', :type=>'flag', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
+casts << {:long=>'size', :short=>'s', :type=>'uint', :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}
 
 options = Biopieces.options_parse(ARGV, casts)