Exemplo n.º 1
0
            } else {
                $divimeta .= ".0 Last Proportion";
            }
        }
        foreach ($uniquewords as $word) {
            $count = @$quickhash[$chunk]["{$word}"];
            $count = $count ? $count : 0;
            $line .= "{$DELIM}{$count}";
        }
        $merge .= "{$line}\n";
    }
    $merge .= $metadata . "\n" . $divimeta;
    $file = "merge_transpose_{$mergename}.tsv";
} else {
    $merge .= "Key{$DELIM}";
    $merge .= implode("{$DELIM}", $chunknames) . "\n";
    foreach ($uniquewords as $word) {
        $line = "{$word}";
        foreach ($chunknames as $chunk) {
            // @ hides any thrown error message
            $count = @$quickhash[$chunk]["{$word}"];
            $count = $count ? $count : 0;
            $line .= "{$DELIM}{$count}";
        }
        $merge .= "{$line}\n";
    }
    $merge .= $metadata;
    $file = "merge_{$mergename}.tsv";
}
downloadString($merge, $file, "tsv", true);
Exemplo n.º 2
0
    $rowlabels = $stdout[1];
    // if the output is not pdf, open the file and dump contents to
    // json object
    if ($output != 'pdf') {
        $out = openfile($file);
        $json['type'] = $output;
        $json['output'] = $out;
        $json['rowlabels'] = $rowlabels;
    } else {
        $out = openfile($file, "b");
        //$name = $_FILES['file']['name'];
        require "download.php";
        // download script
        //downloadString( $out, "$name.pdf", "pdf", false );
        //The file name is the same as the dendrogram title
        downloadString($out, "{$title}.pdf", "pdf", false);
        // and exit so nothing else is sent back to the browser
        exit;
    }
} else {
    if ($_POST['type'] == 'xml') {
        $json['type'] = 'phyloxml';
        $json['output'] = openfile("{$infile}");
    }
}
// set the content type so the browser doesn't try to open the file
// in Word or Acrobat or something
// this way, the "XMLHttpRequest" object contains:
// r.responseXML.firstChild.textContent with the encoded json string,
// don't know if this works in IE
// then echo to string to the page