Skip to content
Snippets Groups Projects
Commit 7de04d1b authored by Sebastien Moretti's avatar Sebastien Moretti
Browse files

Fix Select/Download tool

parent 55243b1b
Branches
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ print INP "$input_file\n";
close(INP);
# run command
system("SSA2DBC=$my_ssa2dbc; export SSA2DBC; /home/local/bin/FROMFPS < $input_file.input 2>/dev/null");
system("SSA2DBC=$my_ssa2dbc; export SSA2DBC; FROMFPS < $input_file.input 2>/dev/null");
open(SEQ, "<$input_file.seq");
my %sequence;
......@@ -77,3 +77,4 @@ foreach my $seqname (keys %sequence){
print join("\n", @pseq);
print "\n";
}
......@@ -50,26 +50,26 @@ $liftoverUnmapped = "wwwtmp/epdnew_".$origAssembly."To".$destAssembly."_".genera
$chain = "/home/local/db/liftOver/".$origAssembly."/".$origAssembly."To".$destAssembly.".over.chain.gz";
# liftOver oldFile map.chain newFile unMapped
shell_exec("export LD_LIBRARY_PATH=/lib64:/usr/lib64:/usr/lib64/mysql; /home/local/bin/liftOver $bedFile $chain $liftoverBed $liftoverUnmapped;");
#echo "/home/local/bin/liftOver $bedFile $chain $liftoverBed $liftoverUnmapped;";
#fwrite($fp, "/home/local/bin/liftOver $bedFile $chain $liftoverBed $liftoverUnmapped;");
shell_exec("export LD_LIBRARY_PATH=/lib64:/usr/lib64:/usr/lib64/mysql; liftOver $bedFile $chain $liftoverBed $liftoverUnmapped;");
#echo "liftOver $bedFile $chain $liftoverBed $liftoverUnmapped;";
#fwrite($fp, "liftOver $bedFile $chain $liftoverBed $liftoverUnmapped;");
#fclose($fp);
shell_exec("/home/local/bin/bed2sga -s $ucscDestAssembly -f TSS $liftoverBed -e 4 > $liftoverSga;");
#echo "/home/local/perl/bed2sga -s $ucscDestAssembly -f TSS $liftoverBed > $liftoverSga;\n";
shell_exec("/home/local/perl/sga2fps -s $ucscDestAssembly $liftoverSga > $liftoverFps;");
shell_exec("bed2sga -s $ucscDestAssembly -f TSS $liftoverBed -e 4 > $liftoverSga;");
#echo "bed2sga -s $ucscDestAssembly -f TSS $liftoverBed > $liftoverSga;\n";
shell_exec("sga2fps.pl -s $ucscDestAssembly $liftoverSga > $liftoverFps;");
if (filesize("$liftoverSga") > 0){
$sgafileurl = "<a target='_blank' onclick=\"ga('send', 'event', 'Outbound Link', 'liftOverSga');\" href='/".$liftoverSga."'>SGA file</a>";
$sgafileurl = "<a target='_blank' onclick=\"ga('send', 'event', 'Outbound Link', 'liftOverSga');\" href='/epd/".$liftoverSga."'>SGA file</a>";
}else{
$sgafileurl = "No SGA file";
}
if (filesize("$liftoverFps") > 0){
$fpsfileurl = "<a target='_blank' onclick=\"ga('send', 'event', 'Outbound Link', 'liftOverFps');\" href='/".$liftoverFps."'>FPS file</a>";
$fpsfileurl = "<a target='_blank' onclick=\"ga('send', 'event', 'Outbound Link', 'liftOverFps');\" href='/epd/".$liftoverFps."'>FPS file</a>";
}else{
$fpsfileurl = "No FPS file";
}
if (filesize("$liftoverBed") > 0){
$bedfileurl = "<a target='_blank' onclick=\"ga('send', 'event', 'Outbound Link', 'liftOverBed');\" href='/".$liftoverBed."'>BED file</a>";
$bedfileurl = "<a target='_blank' onclick=\"ga('send', 'event', 'Outbound Link', 'liftOverBed');\" href='/epd/".$liftoverBed."'>BED file</a>";
}else{
$bedfileurl = "No BED file";
}
......@@ -93,7 +93,7 @@ while(!feof($handle)){
fclose($handle);
$pNegCount = ($pNCount - 1)/2;
$unmappedfileurl = "<a target='_blank' href='/".$liftoverUnmapped."'>$pNegCount not mapped</a>";
$unmappedfileurl = "<a target='_blank' href='/epd/".$liftoverUnmapped."'>$pNegCount not mapped</a>";
# Print out the page:
include("header.php");
......@@ -115,11 +115,8 @@ if (filesize("$liftoverSga") > 0){
echo "<table width=100% border=0 cellpadding=5 cellspacing=0>\n
<tr><td valign=top width=50%>\n";
echo "<table align=left width=100% border=1 cellpadding=5 cellspacing=0 bordercolor=#FFFFFF>
<tr>
<td align=center width='400px' bgcolor='#336699' style='font-size: 14px; color: #ffffff; height:25px'><b>Sequence Extraction Tool (FASTA format)</b>
</td></tr>
<tr>
<td style='height:25px' width=100% bgcolor='#DDE6E5'>
<tr><td align=center width='400px' bgcolor='#336699' style='font-size: 14px; color: #ffffff; height:25px'><b>Sequence Extraction Tool (FASTA format)</b></td></tr>
<tr><td style='height:25px' width=100% bgcolor='#DDE6E5'>
<form action='EPDnew_seqextract.php' method=post name='myform' target='_blank'>\n
From: <input type='text' name='from' value='-499' id='from' size='10' maxlength='10'>
To: <input type='text' name='to' value='100' id='to' size='10' maxlength='10'>
......@@ -138,15 +135,15 @@ if (filesize("$liftoverSga") > 0){
<tr style='height:25px;' bgcolor='#DDE6E5'>
<td>
<center><font color=black>Motif Enrichment</font></center>
</td><td><a style='text-decoration: none' href='/ssa/oprof.php?fps_link=hourly/$liftoverFps' title='Oprof' target='_blank' onclick=\"ga('send', 'event', 'sendSequence', 'oprof');\"> <BUTTON TYPE='button'>OProf</BUTTON></a> &nbsp; <a target='_blank' href='/documents/oprof/oprofQuickGuide.php'><img src='/icons/Help-icon.png' alt='OProf Help' height='18' width='18'></a></td></tr>
</td><td><a style='text-decoration: none' href='/ssa/oprof.php?fps_link=hourly/$liftoverFps' title='Oprof' target='_blank' onclick=\"ga('send', 'event', 'sendSequence', 'oprof');\"> <BUTTON TYPE='button'>OProf</BUTTON></a> &nbsp; <a target='_blank' href='/epd/documents/oprof/oprofQuickGuide.php'><img src='/img_epd/Help-icon.png' alt='OProf Help' height='18' width='18'></a></td></tr>
<tr style='height:25px;' bgcolor='#DDE6E5'>
<td>
<center><font color=black>Motif Discovery</font></center>
</td><td><a style='text-decoration: none' href='/ssa/findm.php?fps_link=hourly/$liftoverFps' title='FindM' target='_blank' onclick=\"ga('send', 'event', 'sendSequence', 'findm');\"> <BUTTON TYPE='button'>FindM</BUTTON></a> &nbsp; <a target='_blank' href='/documents/findm/findmQuickGuide.php'><img src='/icons/Help-icon.png' alt='FindM Help' height='18' width='18'></a></td></tr>
</td><td><a style='text-decoration: none' href='/ssa/findm.php?fps_link=hourly/$liftoverFps' title='FindM' target='_blank' onclick=\"ga('send', 'event', 'sendSequence', 'findm');\"> <BUTTON TYPE='button'>FindM</BUTTON></a> &nbsp; <a target='_blank' href='/epd/documents/findm/findmQuickGuide.php'><img src='/img_epd/Help-icon.png' alt='FindM Help' height='18' width='18'></a></td></tr>
<tr style='height:25px;' bgcolor='#DDE6E5'>
<td>
<center><font color=black>Chromatin analysis</font></center>
</td><td><a style='text-decoration: none' href='/chipseq/chip_cor.php?sga_link=hourly/$liftoverSga&species=$ucscDestAssembly' title='Chip-Cor' target='_blank' onclick=\"ga('send', 'event', 'sendSequence', 'chipcor');\"> <BUTTON TYPE='button'>ChIP-Cor</BUTTON></a> &nbsp; <a target='_blank' href='/documents/chip-cor/chipcorQuickGuide.php'><img src='/icons/Help-icon.png' alt='ChIP-Cor Help' height='18' width='18'></a></td></tr>
</td><td><a style='text-decoration: none' href='/chipseq/chip_cor.php?sga_link=hourly/$liftoverSga&species=$ucscDestAssembly' title='Chip-Cor' target='_blank' onclick=\"ga('send', 'event', 'sendSequence', 'chipcor');\"> <BUTTON TYPE='button'>ChIP-Cor</BUTTON></a> &nbsp; <a target='_blank' href='/epd/documents/chip-cor/chipcorQuickGuide.php'><img src='/img_epd/Help-icon.png' alt='ChIP-Cor Help' height='18' width='18'></a></td></tr>
</table>";
......
......@@ -289,7 +289,6 @@ if (!$db_con){
if ($stmt = $db_con->prepare("$query")) {
$stmt->execute();
$stmt->bind_result($pid, $pchr, $ppos, $pstrand, $ref);
$sgafile = $databases[$db]."_".generateRandomString().".sga";
......@@ -305,9 +304,10 @@ if ($stmt = $db_con->prepare("$query")) {
}
# echo "This query got $pnumber promoters. <br>\n";
$stmt->close();
$outfile = "wwwtmp/".$sgafile;
$outfile = "wwwtmp/$sgafile";
file_put_contents($outfile, $content);
$outlogfile = "wwwtmp/".$logfile;
$outlogfile = "wwwtmp/$logfile";
file_put_contents($outlogfile, $logcontent);
# Select only best promoters:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment