Skip to content

Commit

Permalink
fixed bug in plot_matrix_heatmap.sh -c X ; now only rows with values …
Browse files Browse the repository at this point in the history
…< X are retained, as expected
  • Loading branch information
eead-csic-compbio committed Oct 27, 2016
1 parent a9754c0 commit efb960d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,4 @@
17102016: updated manual with FAQ about ANI calculation on soft-core clusters (thanks Raffael Inglin)
18102016: added FAQ explaining the meaning of branch numbers in compare_clusters.pl -T trees
18102016: added extra check to pfam_enrich.pl
27102016: fixed bug in plot_matrix_heatmap.sh -c X ; now only rows with values < X are retained, as expected (thanks Valerie!)
8 changes: 4 additions & 4 deletions lib/phyTools.pm
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,15 @@ sub read_FASTA_sequence
if(!open(FASTA,"gzip -dc $infile |"))
{
die "# read_FASTA_sequence: cannot read GZIP compressed $infile $!\n"
."# please check gzip in installed\n";
."# please check gzip is installed\n";
}
}
elsif($infile =~ /\.bz2$/ || $magic eq "BZ") # BZIP2 compressed input
{
if(!open(FASTA,"bzip2 -dc $infile |"))
{
die "# read_FASTA_sequence: cannot read BZIP2 compressed $infile $!\n"
."# please check bzip2 in installed\n";
."# please check bzip2 is installed\n";
}
}
else{ open(FASTA,"<$infile") || die "# read_FASTA_sequence: cannot read $infile $!\n"; }
Expand Down Expand Up @@ -428,15 +428,15 @@ sub read_FASTA_file_array
if(!open(FASTA,"gzip -dc $infile |"))
{
die "# read_FASTA_sequence_array: cannot read GZIP compressed $infile $!\n"
."# please check gzip in installed\n";
."# please check gzip is installed\n";
}
}
elsif($infile =~ /\.bz2$/ || $magic eq "BZ") # BZIP2 compressed input
{
if(!open(FASTA,"bzip2 -dc $infile |"))
{
die "# read_FASTA_sequence_array: cannot read BZIP2 compressed $infile $!\n"
."# please check bzip2 in installed\n";
."# please check bzip2 is installed\n";
}
}
else{ open(FASTA,"<$infile") || die "# read_FASTA_sequence_array: cannot read $infile $!\n"; }
Expand Down
10 changes: 6 additions & 4 deletions plot_matrix_heatmap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,13 @@ if [ $sim_cutoff_int -ne 100 ]
then
heatmap_outfile="${tab_file%.*}_sim_cutoff_${sim_cutoff}_heatmap.$outformat"
echo "# Plotting file $heatmap_outfile"
nj_tree="${tab_file%.*}_sim_cutoff_${sim_cutoff}_BioNJ.ph"
else
heatmap_outfile="${tab_file%.*}_heatmap.$outformat"
echo "# Plotting file $heatmap_outfile"
nj_tree="${tab_file%.*}_BioNJ.ph"
fi

nj_tree="${tab_file%.*}_BioNJ.ph"

# 2) call R using a heredoc and write the resulting script to file
R --no-save -q <<RCMD > ${progname%.*}_script_run_at_${start_time}.R
library("gplots")
Expand All @@ -272,8 +272,10 @@ rownames(mat_dat) <- rnames
if($sim_cutoff < 100)
{
rows <- (apply( mat_dat , 1 , function(x) any( x < $sim_cutoff) ) )
mat_dat <- mat_dat[rows, rows]
tmp_mat = mat_dat
diag(tmp_mat) = NA
rows <- (!apply( tmp_mat , 1 , function(x) any( x > $sim_cutoff , na.rm=T) ) )
mat_dat <- mat_dat[rows, rows]
}
if($reorder_clusters > 0){
Expand Down

0 comments on commit efb960d

Please sign in to comment.