Skip to content

Commit

Permalink
Merge pull request #5 from r-mllr/rall_without_illumina_reads
Browse files Browse the repository at this point in the history
Rearranged RALL plot creation due to errors when no Illumina Reads are given
  • Loading branch information
schellt authored Jan 29, 2021
2 parents 2128d03 + 5939e17 commit 89fb9af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backmap.pl
Original file line number Diff line number Diff line change
Expand Up @@ -784,9 +784,11 @@ sub round_format_pref{

open(RALL,'>',"$rscript") or die "ERROR\tCould not open file $rscript\n";

print RALL "xmax <- 0\n";
for(my $i = 0; $i < scalar(@techs); $i++){
if(exists($cov_files{$techs[$i]})){
print RALL "$techs[$i]=read.table(\"$cov_files{$techs[$i]}\")\n";
print RALL "xmax <- max(xmax, $techs[$i]\[,1])\n";
}
}
my $pdf = $rscript;
Expand All @@ -795,12 +797,13 @@ sub round_format_pref{
my @legend = ();
my @lty = ();
my @col = ();
print RALL "plot(NULL,log=\"x\",type=\"l\",xlab=\"Coverage\",ylab=\"Count\",main=\"$assembly\",ylim=c(0,$global_ymax[0]), xlim=c(1,xmax))\n";
for(my $i = 0; $i < scalar(@techs); $i++){
if(exists $cov_files{$techs[$i]}){
push(@legend,"\"$techs[$i] N(0)=$n0_all{$techs[$i]}\"");
push(@lty,"1");
if($i == 0 and exists($cov_files{$techs[$i]})){
print RALL "plot($techs[$i]\[,1],$techs[$i]\[,2],log=\"x\",type=\"l\",xlab=\"Coverage\",ylab=\"Count\",main=\"$assembly\",ylim=c(0,$global_ymax[0]))\n";
print RALL "lines($techs[$i]\[,1],$techs[$i]\[,2],type=\"l\",col=\"black\")\n";
push(@col,"\"black\"");
}
if($i == 1 and exists($cov_files{$techs[$i]})){
Expand Down

0 comments on commit 89fb9af

Please sign in to comment.