Skip to content

Commit

Permalink
Fixed bug associated with HSP Tiling in grab_SSU_reads
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpton committed Oct 31, 2011
1 parent 93b2bc1 commit df23c16
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
38 changes: 29 additions & 9 deletions OTU.pm
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,34 @@ sub grab_SSU_reads{
#print join( "\t", "." , ".", $result->query_name, $hit->name, $hsp->start('query'), $hsp->end('query'), $qstart, $qstop, "\n");
}
my $avg_score = $score / $nhsps;
$self->{"bhits"}->{$result->query_name} = {
'set' => $set,
'qstart' => $qstart,
'qstop' => $qstop,
'score' => $avg_score,
'qstrand' => $qstrand,
'hstrand' => $hstrand,
};
if( defined( $self->{"bhits"}->{$result->query_name} ) ){
print Dumper ($self->{"bhits"}->{$result->query_name} );
print "set is $set\n";
print " comparing results for " . $result->query_name . "\n";
my $old_score = $self->{"bhits"}->{$result->query_name}->{"score"};
print " score: $score\n";
print " old: $old_score\n";
if ($avg_score > $old_score ){
$self->{"bhits"}->{$result->query_name} = {
'set' => $set,
'qstart' => $qstart,
'qstop' => $qstop,
'score' => $avg_score,
'qstrand' => $qstrand,
'hstrand' => $hstrand,
};
}
}
else{
$self->{"bhits"}->{$result->query_name} = {
'set' => $set,
'qstart' => $qstart,
'qstop' => $qstop,
'score' => $avg_score,
'qstrand' => $qstrand,
'hstrand' => $hstrand,
};
}
next RESULT;
}
else{
Expand Down Expand Up @@ -1025,7 +1045,7 @@ sub run_mothur{
#Having problems getting bin.seqs to work inside mothur, so we'll dot it ourselves later
my $command = "#set.dir(output=$outdir); read.dist(phylip=$inmat, cutoff=$cutoff); cluster(method=$method, cutoff=$cutoff);";
print "executing mother using $command\n";
print "Note: Please check your version of MOTHUR. We have found a possible bug in MOTHUR v.1.16.1 that may affect the number of OTUs reported at your desired cutoff. We are working with the Schloss lab to resolve this. We advise substantially increasing your desired cutoff or rolling back to a prior version of MOTHUR to avoid the bug in the interim.\n";
print "NOTE: Because of the way hierarchical clustering works in MOTHUR, we advise substantially increasing your desired cutoff for this analysis and selecting the results that correspond to your desired cutoff from the output data. See the MOTHUR manual for more details or contact the author of this sofware. This is not a warning or error message.\n";
my $results = capture( "mothur \"$command\"" );
if( $EXITVAL != 0 ){
warn("Error running mothur for $inmat!\n");
Expand Down
1 change: 1 addition & 0 deletions align2profile_qc_Col.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <iostream>
#include <cstdlib>
#include <sstream>
#include <fstream>
using namespace std;
Expand Down
8 changes: 6 additions & 2 deletions otu_handler.pl
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,12 @@
$project->set_domains( \@domains );
$project->set_tree_method( $tree_method );
$project->build_db( $masterdir, $first_build );
$project->set_blastdb( "BAC", "stap_16S_BAC.fa" );
$project->set_blastdb( "ARC", "stap_16S_ARC.fa" );
if( $bac ){
$project->set_blastdb( "BAC", "stap_16S_BAC.fa" );
}
if( $arc ){
$project->set_blastdb( "ARC", "stap_16S_ARC.fa" );
}
$project->format_blast_db();
if( $first_build || $build_model ){
foreach my $set( @domains ){
Expand Down
1 change: 1 addition & 0 deletions tree_to_matrix.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <boost/config.hpp>
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <string>
#include "PhyloTree.h"
Expand Down

0 comments on commit df23c16

Please sign in to comment.