# HG changeset patch # User saskia-hiltemann # Date 1436964741 14400 # Node ID d582e2cd3e13a383b31b70cfcc48d11fd198fdef # Parent 3c160414da2e13a51c43b9f74a32c8453729da10 Uploaded diff -r 3c160414da2e -r d582e2cd3e13 createHTML.sh --- a/createHTML.sh Thu Feb 26 14:05:23 2015 +0100 +++ b/createHTML.sh Wed Jul 15 08:52:21 2015 -0400 @@ -22,7 +22,7 @@ iReport: ${title}


- Click here to view report

+ Click image to view report

\"loading

Click here to download a copy of this iReport

@@ -137,6 +137,12 @@ text=${text//==space==/ } text=${text//==colon==/:} text=${text//==comma==/,} + + text=${text//==braceopen==/(} + text=${text//==braceclose==/)} + text=${text//==cbraceopen==/{} + text=${text//==cbraceclose==/}} + text=${text//==slash==/\/} text=${text//==lt==/<} text=${text//==gt==/>} @@ -152,8 +158,8 @@ text=${text//\&r/\\n} text=${text//\&n/\\n} text=${text//\&c/:} - - + + ## convert markdown in textfield to html echo -e "$text" > mytext.md @@ -221,6 +227,10 @@ text=${text//==backtick==/`} text=${text//==dollar==/$} text=${text//==bar==/|} + text=${text//==braceopen==/(} + text=${text//==braceclose==/)} + text=${text//==cbraceopen==/{} + text=${text//==cbraceclose==/}} contentline="${contentline}\n${text}\n" fi @@ -281,6 +291,7 @@ zoomlevel=${myarr[4]} zoomenable=${myarr[5]} align=${myarr[6]} + typestring="" #####echo "zoomenable:${zoomenable}, align:${align}" if [[ $ftype == *JPEG* ]] then @@ -294,6 +305,11 @@ then suffix=".png" fi + if [[ $ftype == *TIFF* ]] + then + suffix=".tiff" + typestring="type=\"image/tiff\"" + fi image=`basename ${myarr[2]}` image=${image%.dat} @@ -369,6 +385,7 @@ suffix=${myarr[8]} urlitems=${myarr[9]} minw=${myarr[10]} + minh=${myarr[11]} suffix=${suffix/emptycol/} suffix=${suffix/==quote==/&} prefix=${prefix/emptycol/} @@ -407,6 +424,7 @@ else minw=${myarr[6]} + minh=${myarr[7]} cp ${tsvfile} ${tsvfile}2 fi @@ -414,11 +432,11 @@ if [ $fancy == "Y" ] then perl ${repositorypath}/tsv2html.pl < ${tsvfile}2 > ${galaxypath}/htmltable_${fname}.html - contentline="${contentline}\n" + contentline="${contentline}\n" iframecount=$[$iframecount+1] else perl ${repositorypath}/tsv2html_simple.pl < ${tsvfile}2 > ${galaxypath}/htmltable_${fname}.html - contentline="${contentline}\n" + contentline="${contentline}\n" iframecount=$[$iframecount+1] fi @@ -462,7 +480,19 @@ htmlname="${fname}.html" cp ${htmlfile} "${galaxypath}/${htmlname}" - contentline="${contentline}\n\n" + apiid=${myarr[5]} + isireport=${myarr[6]} + localhost=${myarr[7]} + proxy=${myarr[8]} + localhost=${localhost//==colon==/:} + localhost=${localhost//==fslash==/\/} + if [[ ${isireport} == "Y" ]] + then + #cp ${localhost}/datasets/${apiid}/* "${galaxypath}/tst" + htmlname="/${proxy}/datasets/${apiid}/display/" + fi + + contentline="${contentline}\n\n" fi @@ -471,8 +501,7 @@ url=${myarr[2]} url=${url//==colon==/:} url=${url//==fslash==//} - height=${myarr[4]} - + height=${myarr[4]} contentline="${contentline}\n\n" fi @@ -483,9 +512,17 @@ then url=${myarr[2]} linktext=${myarr[4]} - url=${url/==colon==/:} - url=${url/==quote==/&} + + echo -n "$url" > tmpfileb64 + url=`base64 -d tmpfileb64` + echo -n "$linktext" > tmpfileb64 + linktext=`base64 -d tmpfileb64` + + if [[ -z $linktext ]] + then + linktext=$url + fi contentline="${contentline}${linktext}" fi @@ -495,12 +532,28 @@ ## if [ ${myarr[1]} == "genomebrowser" ] then + # parse inputs apiid=${myarr[4]} servername=${myarr[5]} buildver=${myarr[2]} + + region=${myarr[6]} + + + echo -n "$region" > tmpfileb64 + region=`base64 -d tmpfileb64` + + + initialchrom=${region%:*} + initialrange=${region#*:} + + initialstart=${initialrange%-*} + initialend=${initialrange#*-} + + #TODO ftype="vcf" @@ -521,19 +574,23 @@ then ftype=${gbfileinfo[3]} - if [ $ftype == "vcf" ] + + gbfilename=${gbfileinfo[1]} + gbfilelabel=${gbfileinfo[2]} + gbfilelabel=${gbfilelabel//==space==/ } + gbfilelabel=${gbfilelabel//==bopen==/(} + gbfilelabel=${gbfilelabel//==bclose==/)} + fname=`basename ${gbfilename}` + fname=${fname%.dat} + + if [[ $ftype == "vcftabix" ]] then - gbfilename=${gbfileinfo[1]} - gbfilelabel=${gbfileinfo[2]} - gbfilelabel=${gbfilelabel//==space==/ } - fname=`basename ${gbfilename}` - fname=${fname%.dat} newgbfilename="${fname}.vcf" cp ${gbfilename} "${galaxypath}/${newgbfilename}" bgzip "${galaxypath}/${newgbfilename}" - tabix -p vcf "${galaxypath}/${newgbfilename}.gz" + tabix -f -p vcf "${galaxypath}/${newgbfilename}.gz" userTracks="${userTracks}, {name: '${gbfilelabel}', @@ -543,13 +600,25 @@ " fi - if [ $ftype == "bam" ] + if [[ $ftype == "vcfmemstore" ]] then - gbfilename=${gbfileinfo[1]} - gbfilelabel=${gbfileinfo[2]} - gbfilelabel=${gbfilelabel//==space==/ } - fname=`basename ${gbfilename}` - fname=${fname%.dat} + newgbfilename="${fname}.vcf" + + + cp ${gbfilename} "${galaxypath}/${newgbfilename}" + #bgzip "${galaxypath}/${newgbfilename}" + #tabix -p vcf "${galaxypath}/${newgbfilename}.gz" + + userTracks="${userTracks}, + {name: '${gbfilelabel}', + uri: '${servername}/datasets/${apiid}/display/${newgbfilename}', + tier_type: 'memstore', + payload: 'vcf'} + " + fi + + if [[ $ftype == "bam" ]] + then newgbfilename="${fname}.bam" # link to bam instead of copying @@ -562,6 +631,55 @@ " 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" + + cp ${gbfilename} "${galaxypath}/${newgbfilename}" + bgzip "${galaxypath}/${newgbfilename}" + tabix -f -p bed "${galaxypath}/${newgbfilename}.gz" + + userTracks="${userTracks}, + {name: '${gbfilelabel}', + uri: '${servername}/datasets/${apiid}/display/${newgbfilename}.gz', + tier_type: 'tabix', + payload: 'bed'} + " + + fi + + if [[ $ftype == "bedmemstore" ]] + then + newgbfilename="${fname}.bed" + + cp ${gbfilename} "${galaxypath}/${newgbfilename}" + #bgzip "${galaxypath}/${newgbfilename}" + #tabix -p bed "${galaxypath}/${newgbfilename}.gz" + + userTracks="${userTracks}, + {name: '${gbfilelabel}', + uri: '${servername}/datasets/${apiid}/display/${newgbfilename}', + tier_type: 'memstore', + payload: 'bed'} + " + + fi fi done @@ -632,11 +750,11 @@ -
+
" fi @@ -679,6 +797,10 @@ linkfilename=`basename ${linkfile}` linktext=${myarr[6]} + localhost=${myarr[7]} + proxy=${myarr[8]} + localhost=${localhost//==colon==/:} + localhost=${localhost//==fslash==/\/} #check for some basic filetypes ftype=`file $linkfile` @@ -706,7 +828,7 @@ if [[ ${isireport} == "Y" ]] then - linkfilename="/datasets/${apiid}/display/" + linkfilename="/${proxy}/datasets/${apiid}/display/" else cp ${linkfile} "${galaxypath}/${linkfilename}" fi @@ -779,16 +901,31 @@ # create correct number of tabs count=0 + tabtitles=${tabtitles/,/} tabtitles=${tabtitles//,/ } - tabtitles=${tabtitles//==colon==/:} + echo $tabtitles + + tabcount=0 + for tabt in $tabtitles + do + echo -n $tabt > tmpfileb64 + thistabtitle=`base64 -d tmpfileb64` + newtabtitles+=" $thistabtitle" + tabcount=$[tabcount+1] + done + + echo $newtabtitles + tabslist="