Commits

Peter Hansen  committed a0d440f

bugfixes

  • Participants
  • Parent commits f0d3d21

Comments (0)

Files changed (2)

File delFiles.php

 		$f = fopen('temp/' . $classArray[1] ."/relations.txt", 'w');
 		foreach($relationsArray as $rel) {
 			if(substr($rel, -1) !== ';'){
-				$rel = substr($rel,0, -1);
+				if(substr($rel, -1) == '~') {
+				} else {
+					$rel = substr($rel,0, -1);
+				}
 			}
 		fwrite($f, $rel);
 		}
 				var figPos = $('.' + jq(relArray[0])).offset();
 				var len = relArray.length;
 				for (var i= 1; i < len; i++) {
-					var pos1 = $('#' + jq(relArray[i])).offset();
-					DrawLine(pos1.left, pos1.top + 12, figPos.left, figPos.top, colorArray[c]);
+					var filei = $('#' + jq(relArray[i]));
+					var pos1 = filei.offset();
+					DrawLine(pos1.left + filei.width(), pos1.top + filei.height()/2, figPos.left, figPos.top, colorArray[c]);
 				}
 				";
 		}

File rcircos_action.php

 $RFileHandle = fopen($cmd_file, "w") or die("Could not open tempfile");
 fwrite($RFileHandle, $R_script);
 fclose($RFileHandle);
-$cmd = "/usr/bin/R --vanilla < " .  $cmd_file ;
+$cmd = "/usr/bin/R --vanilla < " .  $cmd_file . ' 2>&1';
 $changeDir = shell_exec("cd ".$outDir);
 $output = shell_exec($cmd);
+$errorCheck = explode("Error!", $output);
+if(count($errorCheck) > 1) {
+	echo "<script>window.alert('Some of your data was unable to be plotted. Check what data is missing in your plot and make sure that the files with that data are formatted correctly and do not go outside chromosome bounds');</script>";
+}
 if($fileType == "pdf") {
 	echo "<a href='". $circosPlot ."'>Download Plot</a>";
 } else {