Anonymous avatar Anonymous committed acb2593

bug fixes and updated workflow

Comments (0)

Files changed (3)

 	exit;
 }
 $outDir="temp/" . $username ."/";
+	$illegal = array('/', '\\', ' ', '(', ')', "|", '~', "'", '"', "?", "#", "$", "%", "&", ",", "!", "@", "^", "*", ";", "[", "]", "{", "}", "<",">","+" );
 if($_FILES["file1"]["tmp_name"]=='') {
 	$file1 = '';
 } else {
-	$file1 = $outDir . $_FILES["file1"]["name"];
+	$name = $_FILES["file1"]["name"];
+	foreach($illegal as $illchar) {
+		$name = str_replace($illchar, 'R', $name);
+	}
+	$file1 = $outDir . $name;
 	move_uploaded_file($_FILES["file1"]["tmp_name"], $file1);
 }
 if($_FILES["file2"]["tmp_name"]=='') {
 	$file2 ='';
 } else {
-	$file2 = $outDir . $_FILES["file2"]["name"];
+	$name = $_FILES["file2"]["name"];
+	foreach($illegal as $illchar) {
+		$name = str_replace($illchar, 'R', $name);
+	}
+	$file2 = $outDir . $name;
 	move_uploaded_file($_FILES["file2"]["tmp_name"], $file2);
 }
 if($_FILES["file3"]["tmp_name"]=='') {
 	$file3 ='';
 } else {
-	$file3 = $outDir . $_FILES["file3"]["name"];
+	$name = $_FILES["file3"]["name"];
+	foreach($illegal as $illchar) {
+		$name = str_replace($illchar, 'R', $name);
+	}
+	$file3 = $outDir . $name;
 	move_uploaded_file($_FILES["file3"]["tmp_name"], $file3);
 }
 if($_FILES["file4"]["tmp_name"]=='') {
 	$file4='';
 } else {
-	$file4 = $outDir . $_FILES["file4"]["name"];
+	$name = $_FILES["file4"]["name"];
+	foreach($illegal as $illchar) {
+		$name = str_replace($illchar, 'R', $name);
+	}
+	$file4 = $outDir . $name;
 	move_uploaded_file($_FILES["file4"]["tmp_name"], $file4);
 }
 if($_FILES["file5"]["tmp_name"]=='') {
 	$file5='';
 } else {
-	$file5 = $outDir . $_FILES["file5"]["name"];
+	$name = $_FILES["file5"]["name"];
+	foreach($illegal as $illchar) {
+		$name = str_replace($illchar, 'R', $name);
+	}
+	$file5 = $outDir . $name;
 	move_uploaded_file($_FILES["file5"]["tmp_name"], $file5);
 }
 if($_FILES["file6"]["tmp_name"]==''){
 	$file6 = '';
 } else {
-	$file6 =$outDir . $_FILES["file6"]["name"];
+	$name = $_FILES["file6"]["name"];
+	foreach($illegal as $illchar) {
+		$name = str_replace($illchar, 'R', $name);
+	}
+	$file6 =$outDir . $name;
 	move_uploaded_file($_FILES["file6"]["tmp_name"], $file6);
 }
 if($_FILES["file7"]["tmp_name"] =='') {
 	$file7 = '';
 } else {
-	$file7 = $outDir . $_FILES["file7"]["name"];
+	$name = $_FILES["file7"]["name"];
+	foreach($illegal as $illchar) {
+		$name = str_replace($illchar, 'R', $name);
+	}
+	$file7 = $outDir . $name;
 	move_uploaded_file($_FILES["file7"]["tmp_name"], $file7);
 }
 $c = 0;
 		echo "</tr>";
 		$q=FALSE;
 		if('txt' == substr($allfile1, -3)) {
-			$q=TRUE;
-		}
-		$delimiter = $q ? "\t" : ",";
 		$fh = fopen($allfile1, 'r');
-		$data = fgetcsv($fh, $delimiter);
+		$data = fgetcsv($fh, "\t");
 		$data2 = explode("\t", $data[0]);
 		if($data2[3] == 'Gene') {
 			$geneFiles[$c] = $allfile1;
 		} elseif (substr($data2[3], 0, 11) == 'Chromosome.') {
 			$linkFiles[$c] = $allfile1;
 		}
+		} else {
+			$fh = fopen($allfile1, 'r');
+			$data = fgetcsv($fh, ",");
+			if($data[3] == 'Gene') {
+				$geneFiles[$c] = $allfile1;
+			} elseif ($data[3] == 'GeneName') {
+				$heatmapFiles[$c] = $allfile1;
+			} elseif ($data[3] == 'Data') {
+				$histogramFiles[$c] = $allfile1;
+			} elseif ($data[3] == 'num.mark') {
+				$lineScatFiles[$c] = $allfile1;
+			} elseif (empty($data[3]) && $data[0] == 'Chromosome') {
+				$tileFiles[$c] = $allfile1;
+			} elseif (substr($data[3], 0, 11) == 'Chromosome.') {
+				$linkFiles[$c] = $allfile1;
+			}
+		}
 		$c++;
 	} else if (substr($allfile1, strlen($username)+6, -6) == 'zzzzzzz' | substr($allfile1, strlen($username)+6, -6) == 'zzzzzz' | $allfile1 == 'hist') {
 		if (empty($images[$c]) == false) {
  * plot name to prevent errors
  */
 function fixName() {
-	var illegal = new Array('/', '\\', '(', ')', '.', '~', "'", '"', "?", "#", "$", "%", "&", ",", "!", "@", "^", "*", ";", "[", "]", "{", "}", "<",">","+" );
+	var illegal = new Array('|','/', '\\', '(', ')', '.', '~', "'", '"', "?", "#", "$", "%", "&", ",", "!", "@", "^", "*", ";", "[", "]", "{", "}", "<",">","+" );
 	var name = $('#plotName').val();
   	var error = false;
 	for(var i = 0; i<26; i++) {
 	context.beginPath();
 	context.lineWidth = 5;
 	context.moveTo(x1, y1);
-	context.quadraticCurveTo(250 , y2 , x2, y2);
+	context.quadraticCurveTo(200 , y2 , x2, y2);
     context.strokeStyle = color;
 	context.stroke(); 
 	}
 <div align="center">
 <h1> Circos Plot Generator</h1> <a href="http://cran.r-project.org/web/packages/RCircos/index.html" target="_blank">A web interface for the RCircos r package</a><br>
 Questions? Comments? Contact peter.hansen.nih@gmail.com
+<br><a href="rcircos_workflow.html" target="_blank">Instructions</a>
 </div>
 <div id="user_div" name="user_div" align=center></div>
 <form id ="idForm" name="idForm" method="post" style="display: block">

rcircos_workflow.html

 <p><br>
 <p><strong>Step 1: Create Your Data</strong><br>Refer to the <a href="rcircos_help.html" target="_blank">formatting</a> page to see references to base your files off of and ensure that files match exactly the format presented <br> in the examples or the program might be unable to recognize how to use it. </p>
 <p><strong>Step 2: Upload Your Data</strong><br>Once you are confident that the data is formatted correctly load the <a href="rcircos.php" target="_blank">main page</a> and click the start new session button. If will <br> generate a filemanager that will handle all the files you upload and create and display the ID you will use to acces this account. <br>
-You now have the choice of either saving the ID as an encrypted cookie in your browser or keeping it stored somewhere else. <br> When you return to the site the ID will automatically be loaded for you, if there is no cookie it will require you to enter the one <br> you recieved when creating the session. Now select the files you want to upload and simply click the upload data button.</p>
-<p><strong>Step 3: Select the Data You Want to Use</strong><br>If your data was formatted correctly it will automattically sort the files out and only give them as options for track types that <br> match their formatting. Under each track type there are links to formatting advice and to download sample data. Once <br> you have selected the data you want and made the specifications necessary simply press start and it will begin making the plot.</p>
+You now have the choice of either saving the ID as an encrypted cookie in your browser or keeping it stored somewhere else. <br> When you return to the site the ID will automatically be loaded for you, if there is no cookie it will require you to enter the one <br> you recieved when creating the session. Now select the files you want to upload and simply click the upload data button.
+<br></p><h5>WARNING: Several non numeric or alphabetic characters interfear with scripts running on this page. To make the process as smooth as <br>
+possible these characters will be removed from the file name and replaced with a capital R. If the replacement filename already exists the<br> old file will be overwritten</h5>
+<p><strong>Step 3: Select the Data You Want to Use</strong><br>If your data was formatted correctly it will automattically sort the files out and only give them as options for track types that <br> match their formatting. Under each track type there are links to formatting advice and to download <strong>(All downloads require a  <br>right click and selecting 'save link as')</strong> sample data. Once you have selected the data you want and made the specifications <br> necessary simply press start and it will begin making the plot.</p>
 </td></tr></table>
 </body>
 </html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.