diff createHTML.sh @ 4:363cd315d0e9 draft

Uploaded
author saskia-hiltemann
date Mon, 16 Nov 2015 09:46:51 -0500
parents 945e72d0e723
children
line wrap: on
line diff
--- a/createHTML.sh	Wed Jul 15 09:21:59 2015 -0400
+++ b/createHTML.sh	Mon Nov 16 09:46:51 2015 -0500
@@ -3,6 +3,7 @@
 ##
 ## Create Cover Page
 ##
+#<a href=\"$zipireport\">  Click here to download a copy of this iReport </a> <br/><br/>
 function makeIntroPage  ( ){
 	echo "Creating Intro Page"
 	title="$1"
@@ -24,7 +25,6 @@
 		<br/>
 		<a href=\"$link\">  Click image to view report	</a> <br/><br/>
 		<a href=\"$link\"> <img src="$coverimage" width=\"50%\" alt=\"loading image..\"/> </a><br/><br/>		
-		<a href=\"$zipireport\">  Click here to download a copy of this iReport </a> <br/><br/>
 		</center>
 	</body>
 </html>" > $htmlout
@@ -110,8 +110,8 @@
 	tracklist=$3	# genome browser tracks info
 	contentline=""  # HTML code for tab
 	imgcount=0		# keep track of the number of images on the current tab
-	iframecount=0
-	
+	iframename=`head -n 1 < /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1`
+	#iframename="test"
 	for item in $itemslist
 	do
 		## Parse items lists
@@ -337,8 +337,8 @@
 				fi
 				
 				if [[ ${zoomlevel} -eq 0 || ${zoomenable} == "N" ]]
-				then
-					contentline="${contentline}<span id=\"img${imgcount}\"> <img src=\"${image}\" ${alignstring} ${widthstring} alt=\"loading image..\"/></span>"
+				then                                    
+					contentline="${contentline}<span id=\"img${imgcount}\"> <img src=\"${image}\" ${alignstring} ${widthstring} alt=\"loading image..\"/></span>"                                    
 				else				
 					contentline="${contentline}<span class=\"zoomme\" id=\"img${imgcount}\"> <img src=\"${image}\" ${alignstring} ${widthstring} alt=\"loading image..\"/></span>"
 				fi
@@ -358,7 +358,9 @@
 				fname=${fname%.*}
 				fancy=${myarr[4]}
 				makelinks=${myarr[5]}
-				iframeid="iframe"$iframecount
+				#iframeid="iframe$giframecount"
+				iframeid="iframe-$iframename"
+				
 				#echo "\nmakelinks: $makelinks fancy: $fancy <br>"
 				
 				#TODO client side database for large files. For now only display first section of file and add download link
@@ -428,16 +430,17 @@
 					cp ${tsvfile} ${tsvfile}2
 				fi
 				
-				iframecount=$[$iframecount+1]
+				#iframecount=$[$iframecount+1]
+				
 				if [ $fancy == "Y" ]
 				then
 					perl ${repositorypath}/tsv2html.pl < ${tsvfile}2 > ${galaxypath}/htmltable_${fname}.html
-					contentline="${contentline}\n<iframe class=\"invisibleframe fancyiframe\" id=\"$iframeid\" src=\"htmltable_${fname}.html\" width=\"100%\" style=\"height: 760px; min-height: ${minh}px !important; overflow-y: hidden; overflow-x: scroll\" ></iframe>"
-					iframecount=$[$iframecount+1]
+					contentline="${contentline}\n<iframe class=\"invisibleframe fancyiframe\" id=\"$iframeid\" src=\"htmltable_${fname}.html\" width=\"100%\" style=\"height: 350px; min-height: ${minh}px !important; overflow-y: hidden; overflow-x: scroll\" onClick=resizeIframe(\"$iframeid\")></iframe>"
+					
 				else
 					perl ${repositorypath}/tsv2html_simple.pl < ${tsvfile}2 > ${galaxypath}/htmltable_${fname}.html
-					contentline="${contentline}\n<iframe class=\"unfancyiframe invisibleframe\" id=\"$iframeid\" src=\"htmltable_${fname}.html\" scrolling=\"no\" style=\"min-width: ${minw}px; min-height: ${minh}px !important; max-width: 100%; vertical-align: top;\" onload=\"resizeIframe(this)\"></iframe>"
-					iframecount=$[$iframecount+1]
+					contentline="${contentline}\n<iframe class=\"unfancyiframe invisibleframe\" id=\"$iframeid\" src=\"htmltable_${fname}.html\" scrolling=\"no\" style=\"min-width: ${minw}px; min-height: ${minh}px !important; max-width: 100%; vertical-align: top;\" onClick=resizeIframe(\"$iframeid\") ></iframe>"
+					
 				fi
 				
 				if [[ $numlines -gt ${maxlines} ]]
@@ -632,6 +635,21 @@
 						
 						fi
 						
+						if [[ $ftype == "bigbed" ]]
+						then
+							newgbfilename="${fname}.bigbed"
+							
+							cp ${gbfilename} "${galaxypath}/${newgbfilename}"
+							#bgzip "${galaxypath}/${newgbfilename}"
+							#tabix -f -p bed "${galaxypath}/${newgbfilename}.gz"
+							
+							userTracks="${userTracks},
+								{name:                 '${gbfilelabel}',
+								bwgURI:                  '${servername}/datasets/${apiid}/display/${newgbfilename}'}
+							"
+						
+						fi
+						
 						if [[ $ftype == "bedtabix" ]]
 						then
 							newgbfilename="${fname}.bed"
@@ -869,16 +887,19 @@
 	done
 	
 	echo "${contentline}"
+	
+	
 }
 
 ##
 ## Create HTML content for iReport
 ##
 createMainPage (){
+        #export IFRAMECNT=1
 	page=$1
 	tabtitles=$2	# comma-separated list of tab titles
 	tabitems=$3		# colon-sparated list of tabs specifications
-	iframecount=1	# keep track of number of iFrames so that they can be referenced by ID
+	#giframecount=1	# keep track of number of iFrames so that they can be referenced by ID
 	minwidth=$4		# width of page
 	gbtracks=$5		# genome browser track information