Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #270 from jaredbischof/develop

These changes require a version release.
  • Loading branch information...
commit 63ee59298a255a88b03c22f39787b55c801ba2c1 2 parents 3971ff7 + 1492c89
@teharrison teharrison authored
View
4 src/MGRAST/cgi/upload.cgi
@@ -297,13 +297,13 @@ if (scalar(@rest) && $rest[0] eq 'user_inbox') {
if($seqfile3 eq "") {
$command = "echo \"$fix_files_str $Conf::pairend_join -j -m 8 -p 10 -t $udir/.tmp -o $udir/$joinfile $udir/$seqfile1 $udir/$seqfile2 2>&1 | tee -a $udir/$seqfile1.error_log > $udir/$seqfile2.error_log; rm $lock_file1 $lock_file2 $lock_file3;\" | /usr/local/bin/qsub -q fast -j oe -N $jobid -l walltime=60:00:00 -m n -o $udir/.tmp";
} else {
- $command = "echo \"$fix_files_str $Conf::pairend_join -j -r -i $seqfile3 -m 8 -p 10 -t $udir/.tmp -o $udir/$joinfile $udir/$seqfile1 $udir/$seqfile2 2>&1 | tee -a $udir/$seqfile1.error_log > $udir/$seqfile2.error_log; rm $lock_file1 $lock_file2 $lock_file3;\" | /usr/local/bin/qsub -q fast -j oe -N $jobid -l walltime=60:00:00 -m n -o $udir/.tmp";
+ $command = "echo \"$fix_files_str $Conf::pairend_join -j -r -i $udir/$seqfile3 -m 8 -p 10 -t $udir/.tmp -o $udir/$joinfile $udir/$seqfile1 $udir/$seqfile2 2>&1 | tee -a $udir/$seqfile1.error_log > $udir/$seqfile2.error_log; rm $lock_file1 $lock_file2 $lock_file3;\" | /usr/local/bin/qsub -q fast -j oe -N $jobid -l walltime=60:00:00 -m n -o $udir/.tmp";
}
} else {
if($seqfile3 eq "") {
$command = "echo \"$fix_files_str $Conf::pairend_join -m 8 -p 10 -t $udir/.tmp -o $udir/$joinfile $udir/$seqfile1 $udir/$seqfile2 2>&1 | tee -a $udir/$seqfile1.error_log > $udir/$seqfile2.error_log; rm $lock_file1 $lock_file2 $lock_file3;\" | /usr/local/bin/qsub -q fast -j oe -N $jobid -l walltime=60:00:00 -m n -o $udir/.tmp";
} else {
- $command = "echo \"$fix_files_str $Conf::pairend_join -r -i $seqfile3 -m 8 -p 10 -t $udir/.tmp -o $udir/$joinfile $udir/$seqfile1 $udir/$seqfile2 2>&1 | tee -a $udir/$seqfile1.error_log > $udir/$seqfile2.error_log; rm $lock_file1 $lock_file2 $lock_file3;\" | /usr/local/bin/qsub -q fast -j oe -N $jobid -l walltime=60:00:00 -m n -o $udir/.tmp";
+ $command = "echo \"$fix_files_str $Conf::pairend_join -r -i $udir/$seqfile3 -m 8 -p 10 -t $udir/.tmp -o $udir/$joinfile $udir/$seqfile1 $udir/$seqfile2 2>&1 | tee -a $udir/$seqfile1.error_log > $udir/$seqfile2.error_log; rm $lock_file1 $lock_file2 $lock_file3;\" | /usr/local/bin/qsub -q fast -j oe -N $jobid -l walltime=60:00:00 -m n -o $udir/.tmp";
}
}
$jnum = `$command`;
View
12 src/MGRAST/html/js/pca.js
@@ -177,7 +177,17 @@ function min_max(items, c1, c2){
c1_max = (c1_max && c1_max > items[i][c1]) ? c1_max : items[i][c1];
c2_min = (c2_min && c2_min < items[i][c2]) ? c2_min : items[i][c2];
c2_max = (c2_max && c2_max > items[i][c2]) ? c2_max : items[i][c2];
- }
+ }
+ // If min == max for either axis, we want to artificially create a gap between
+ // them so that the axis has some span, otherwise the plot is messed up.
+ if(c1_min == c1_max) {
+ c1_min = c1_min - 0.5;
+ c1_max = c1_max + 0.5;
+ }
+ if(c2_min == c2_max) {
+ c2_min = c2_min - 0.5;
+ c2_max = c2_max + 0.5;
+ }
var c1_diff = Math.abs(c1_min - c1_max);
var c2_diff = Math.abs(c2_min - c2_max);
return [(c1_min-(c1_diff*0.1)),(c1_max+(c1_diff*0.1)), Math.abs((c1_max+(c1_diff*0.1))-(c1_min-(c1_diff*0.1))),(c2_min-(c2_diff*0.1)),(c2_max+(c2_diff*0.1)), Math.abs((c2_max+(c2_diff*0.1))-(c2_min-(c2_diff*0.1)))];
View
20 src/MGRAST/lib/WebPage/Analysis.pm
@@ -1914,17 +1914,9 @@ sub single_visual {
} else {
$mgs .= "metagenome ".$mgnames->[0];
}
- my $sorcs = "";
- my @sources = $cgi->param('source');
- foreach my $source (@sources) {
- $settings_preserve .= "<input type='hidden' name='source' value='".$source."'>";
- }
- if (scalar(@sources) > 1) {
- my $last = pop(@sources);
- $sorcs = join(", ", @sources)." and $last";
- } else {
- $sorcs = $sources[0];
- }
+ my $source = $cgi->param('source');
+ $settings_preserve .= "<input type='hidden' name='source' value='".$source."'>";
+
my $cutoffs = "a maximum e-value of 1e-" . ($cgi->param('evalue') || '0') . ", ";
$cutoffs .= "a minimum identity of " . ($cgi->param('identity') || '0') . " %, ";
$cutoffs .= "and a minimum alignment length of " . ($cgi->param('alength') || '1') . ' measured in aa for protein and bp for RNA databases';
@@ -1946,7 +1938,7 @@ sub single_visual {
$settings_preserve .= "<input type='hidden' name='alength' value='" . ($cgi->param('alength') || '1') . "'>";
my $fid = $cgi->param('fid') || int(rand(1000000));
- my $settings = "<i>This data was calculated for $mgs. The data was compared to $sorcs using $cutoffs.$pset</i><br/>";
+ my $settings = "<i>This data was calculated for $mgs. The data was compared to $source using $cutoffs.$pset</i><br/>";
## determine if any metagenomes missing from results
my $missing_txt = "";
@@ -2014,7 +2006,7 @@ sub single_visual {
{ name => 'align len std dev', visible => 0, sortable => 1, tooltip => 'standard deviation of<br>the alignment length of the hits' },
{ name => 'md5s', visible => 0 },
{ name => '# hits', visible => 1, sortable => 1, filter => 1, operators => ['less','more'], tooltip => 'number of unique hits in protein or rna database' },
- { name => "<input type='button' onclick='buffer_data(\"table\", \"".$t->id."\", \"18\", \"16\", \"0\", \"-\", \"9\");' value='to workbench'>", input_type => 'checkbox', tooltip => 'check to select features<br>to add to workbench' } ];
+ { name => "<input type='button' onclick='buffer_data(\"table\", \"".$t->id."\", \"18\", \"16\", \"0\", \"".$source."\", \"9\");' value='to workbench'>", input_type => 'checkbox', tooltip => 'check to select features<br>to add to workbench' } ];
#### do the pivoting
unless (defined $cgi->param('group_by')) {
@@ -2297,7 +2289,7 @@ sub single_visual {
}
}
}
- return clear_progress_image()."<h3 style='margin-top: 0px;'>".$header_names->{$level}." Distribution (".$cgi->param('single_bar_sel').") <input type='button' value='download' title='click to download tabular data' onclick='myWindow=window.open(\"\",\"\",\"width=600,height=500\");myWindow.document.write(\"<pre>$download_data_string</pre>\");myWindow.focus();'> <input type='button' value='to workbench' onclick='buffer_data(\"barchart\", \"$level$fid\", \"$sorcs phylogenetic\", \"".$cgi->param('single_bar_sel')."\", \"0\", \"".join(";",$cgi->param('source'))."\");'></h3></a>".$dom_v->output."<br><input type='hidden' id='$level$fid\_md5s' value='".join(";", keys(%$md5s))."'><input type='hidden' id='$level$fid\_mgids' value='".join(";", @comp_mgs)."'><div id='".(int($level)+1)."_$fid'></div>";
+ return clear_progress_image()."<h3 style='margin-top: 0px;'>".$header_names->{$level}." Distribution (".$cgi->param('single_bar_sel').") <input type='button' value='download' title='click to download tabular data' onclick='myWindow=window.open(\"\",\"\",\"width=600,height=500\");myWindow.document.write(\"<pre>$download_data_string</pre>\");myWindow.focus();'> <input type='button' value='to workbench' onclick='buffer_data(\"barchart\", \"$level$fid\", \"$source phylogenetic\", \"".$cgi->param('single_bar_sel')."\", \"0\", \"".join(";",$cgi->param('source'))."\");'></h3></a>".$dom_v->output."<br><input type='hidden' id='$level$fid\_md5s' value='".join(";", keys(%$md5s))."'><input type='hidden' id='$level$fid\_mgids' value='".join(";", @comp_mgs)."'><div id='".(int($level)+1)."_$fid'></div>";
}
}
View
53 src/MGRAST/lib/WebPage/MetagenomeOverview.pm
@@ -383,7 +383,18 @@ sub output {
if ($source_chart) {
$html .= "<li><a href='#source_ref'>Source Distribution</a></li>";
}
- $html .= "<li><a href='#len_ref'>Sequence Length Histogram</a></li>";
+
+ # sequence length histogram
+ my @len_raw_hist = sort {$a->[0] <=> $b->[0]} @{ $mgdb->get_histogram_nums($job->job_id, 'len', 'raw') };
+ my @len_qc_hist = sort {$a->[0] <=> $b->[0]} @{ $mgdb->get_histogram_nums($job->job_id, 'len', 'qc') };
+ my $len_min = (@len_raw_hist && @len_qc_hist) ? min($len_raw_hist[0][0], $len_qc_hist[0][0]) : (@len_raw_hist ? $len_raw_hist[0][0] : (@len_qc_hist ? $len_qc_hist[0][0] : 0));
+ my $len_max = (@len_raw_hist && @len_qc_hist) ? max($len_raw_hist[-1][0], $len_qc_hist[-1][0]) : (@len_raw_hist ? $len_raw_hist[-1][0] : (@len_qc_hist ? $len_qc_hist[-1][0] : 0));
+ my $len_raw_bins = @len_raw_hist ? &get_bin_set(\@len_raw_hist, $len_min, $len_max, $self->data('bin_size')) : [];
+ my $len_qc_bins = @len_qc_hist ? &get_bin_set(\@len_qc_hist, $len_min, $len_max, $self->data('bin_size')) : [];
+
+ unless($len_max == $len_min) {
+ $html .= "<li><a href='#len_ref'>Sequence Length Histogram</a></li>";
+ }
$html .= "<li><a href='#gc_ref'>Sequence GC Distribution</a></li>";
$html .= "</ul></ul></div></td></tr></table><br>";
@@ -666,15 +677,8 @@ $drisee_boilerplate
<div id='alpha_div'></div>
</div>~;
- # sequence length histogram
- my @len_raw_hist = sort {$a->[0] <=> $b->[0]} @{ $mgdb->get_histogram_nums($job->job_id, 'len', 'raw') };
- my @len_qc_hist = sort {$a->[0] <=> $b->[0]} @{ $mgdb->get_histogram_nums($job->job_id, 'len', 'qc') };
- my $len_min = (@len_raw_hist && @len_qc_hist) ? min($len_raw_hist[0][0], $len_qc_hist[0][0]) : (@len_raw_hist ? $len_raw_hist[0][0] : (@len_qc_hist ? $len_qc_hist[0][0] : 0));
- my $len_max = (@len_raw_hist && @len_qc_hist) ? max($len_raw_hist[-1][0], $len_qc_hist[-1][0]) : (@len_raw_hist ? $len_raw_hist[-1][0] : (@len_qc_hist ? $len_qc_hist[-1][0] : 0));
- my $len_raw_bins = @len_raw_hist ? &get_bin_set(\@len_raw_hist, $len_min, $len_max, $self->data('bin_size')) : [];
- my $len_qc_bins = @len_qc_hist ? &get_bin_set(\@len_qc_hist, $len_min, $len_max, $self->data('bin_size')) : [];
-
- $html .= qq~<a name='len_ref'></a>
+ unless($len_max == $len_min) {
+ $html .= qq~<a name='len_ref'></a>
<h3>Sequence Length Histogram
<a style='cursor:pointer;clear:both;font-size:small;padding-left:10px;' onclick='
if (this.innerHTML=="show") {
@@ -687,10 +691,10 @@ $drisee_boilerplate
<div id='len_show'>
<p>The histograms below show the distribution of sequence lengths in basepairs for this metagenome. Each position represents the number of sequences within a length bp range.</p><p>The data used in these graphs are based on raw upload and post QC sequences.</p>~;
- if (@$len_raw_bins > 1) {
- my $len_raw_data = join("~", map { $_->[0] .";;" . $_->[1] } @$len_raw_bins);
- my $len_raw_link = $self->chart_export_link($len_raw_bins, 'upload_len_hist');
- $html .= qq~<p>$len_raw_link</p>
+ if (@$len_raw_bins > 1) {
+ my $len_raw_data = join("~", map { $_->[0] .";;" . $_->[1] } @$len_raw_bins);
+ my $len_raw_link = $self->chart_export_link($len_raw_bins, 'upload_len_hist');
+ $html .= qq~<p>$len_raw_link</p>
<div id='static2'>
The image is currently dynamic. To be able to right-click/save the image, please click the static button
<input type='button' value='static' onclick='
@@ -710,13 +714,13 @@ The image is currently dynamic. To be able to right-click/save the image, please
<div><div id='length_hist_raw'></div></div>
<input type='hidden' id='len_data_raw' value='$len_raw_data'>
<img src='./Html/clear.gif' onload='draw_histogram_plot("len_data_raw", "length_hist_raw", "bps", "Number of Reads Uploaded");'>~;
- } else {
- $html .= "<p><em>Raw sequence length histogram " . (@$len_raw_bins ? "has insufficient data" : "not yet computed") . ".</em></p>";
- }
- if (@$len_qc_bins > 1) {
- my $len_qc_data = join("~", map { $_->[0] .";;" . $_->[1] } @$len_qc_bins);
- my $len_qc_link = $self->chart_export_link($len_qc_bins, 'postqc_len_hist');
- $html .= qq~<p>$len_qc_link</p>
+ } else {
+ $html .= "<p><em>Raw sequence length histogram " . (@$len_raw_bins ? "has insufficient data" : "not yet computed") . ".</em></p>";
+ }
+ if (@$len_qc_bins > 1) {
+ my $len_qc_data = join("~", map { $_->[0] .";;" . $_->[1] } @$len_qc_bins);
+ my $len_qc_link = $self->chart_export_link($len_qc_bins, 'postqc_len_hist');
+ $html .= qq~<p>$len_qc_link</p>
<div id='static3'>
The image is currently dynamic. To be able to right-click/save the image, please click the static button
<input type='button' value='static' onclick='
@@ -736,10 +740,11 @@ The image is currently dynamic. To be able to right-click/save the image, please
<div><div id='length_hist_qc'></div></div>
<input type='hidden' id='len_data_qc' value='$len_qc_data'>
<img src='./Html/clear.gif' onload='draw_histogram_plot("len_data_qc", "length_hist_qc", "bps", "Number of Reads Post QC");'>~;
- } else {
- $html .= "<p><em>QC sequence length histogram " . (@$len_qc_bins ? "has insufficient data" : "not yet computed") . ".</em></p>";
+ } else {
+ $html .= "<p><em>QC sequence length histogram " . (@$len_qc_bins ? "has insufficient data" : "not yet computed") . ".</em></p>";
+ }
+ $html .= "</div>";
}
- $html .= "</div>";
# sequence gc distribution
my @gc_raw_hist = sort {$a->[0] <=> $b->[0]} @{ $mgdb->get_histogram_nums($job->job_id, 'gc', 'raw') };
Please sign in to comment.
Something went wrong with that request. Please try again.