Skip to content

Commit

Permalink
Offsetdefault (#1)
Browse files Browse the repository at this point in the history
* Added fix for failing offset computation

* Increased version number
  • Loading branch information
eggzilla authored and RickGelhausen committed Oct 3, 2018
1 parent abd9731 commit 000f416
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 2 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-*-change-log-*-
1.0.7 Florian Eggenhofer <egg@informatik.uni-freiburg.de> 3. October 2018
* Fix for failing offset computation
1.0.6 Rick Gelhausen <gelhausr@informatik.uni-freiburg.de> 1. Oktober 2018
* Added parameter for precomputed bam file
* Added detailed error output and logs for more functions
Expand Down
24 changes: 15 additions & 9 deletions reparation.pl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
use File::stat;
use File::Basename;

$main::VERSION = "1.0.6";
$main::VERSION = "1.0.7";
my $startRun = time(); # track processing time


Expand Down Expand Up @@ -490,18 +490,24 @@ sub generate_p_site {
system($command_meta) == 0
or die ("Error running metagene: $! \n");

my $log_psite = $work_dir."/logs/psite$min$hour$mday$mon$year.log";
my $log_psite = $work_dir."/logs/psite$min$hour$mday$mon$year.log";
#Build command
my $psitefile = $run_name."_rois.txt";
my $command_psite = "psite -q ".$run_name."_rois.txt ".$run_name." --min_length ".$min_l." --max_length ".$max_l." --require_upstream --count_files ".$bam_file." 2> $log_psite";
my $command_psite = "psite ".$run_name."_rois.txt ".$run_name." --min_length ".$min_l." --max_length ".$max_l." --require_upstream --count_files ".$bam_file." 2> $log_psite";
print "$command_psite\n";
system($command_psite) == 0
or die ("Error running psite: $! \n");

my $psite_off_output = $work_dir."/".$experiment."p_site_offsets.txt";
system("cp ".$run_name."_p_offsets.txt $psite_off_output");
system("cp ".$run_name."_p_offsets.png ".$plastid_image);

my $offsetdefaults = "length\tp_offset\n22\t19\n23\t20\n24\t21\n25\t22\n26\t23\n27\t24\n28\t13\n29\t13\n30\t13\n31\t13\n32\t13\n33\t13\n34\t13\n35\t13\n36\t13\n37\t13\n38\t21\n39\t22\n40\t23\ndefault\t13\n";
my $offsetfile = $run_name. "_p_offsets.txt";
unless(system($command_psite) == 0){
open( my $fh, '>', $offsetfile) or die "Could not open file $offsetfile $!";
print $fh $offsetdefaults;
close $fh;
system("touch " . $run_name . "_p_offsets.png;");
}
#or die ("Error running psite: $! \n");
print "touch " . $run_name. "_p_offsets.txt; touch " . $run_name . "_p_offsets.png;";
system("cp " . $run_name . "_p_offsets.txt $psite_off_output") or print ("Error copying psite_off_output: " . $run_name . "_p_offsets.txt $psite_off_output $!");
system("cp " . $run_name . "_p_offsets.png $plastid_image") or print ("Error copying p_offset.png: " . $run_name . "_p_offsets.png $plastid_image $!");
return $psite_off_output;
}

Expand Down

0 comments on commit 000f416

Please sign in to comment.