Beispiel #1
0
    $history_box .= "</LI>\n";
    $history_box .= "</UL></DIV>";
    $gDisableEditing = TRUE;
}
$report =& evidence_get_report($history_box && $max_edit_id ? 0 + $max_edit_id : "latest", $variant_id);
$row0 =& $report[0];
$variant_name_long = evidence_get_variant_name($row0, " ", false);
$variant_name_short = evidence_get_variant_name($row0, " ", true);
$gOut["title"] = "{$variant_name_short} - GET-Evidence";
$gOut["content"] = "<h1>{$variant_name_short}</h1>\n<!-- {$variant_id} -->\n";
if ($variant_name_long != $variant_name_short) {
    $gOut["content"] .= "<p>({$variant_name_long})</p>\n";
}
$gOut["content"] .= seealso_related($row0["variant_gene"], $row0["variant_aa_pos"], $variant_id);
$gOut["content"] .= $history_box;
$renderer = new evidence_row_renderer();
foreach ($report as $row) {
    if ($row["article_pmid"] > 0 || $row["genome_id"] > 0) {
        break;
    }
    $renderer->render_row($row);
}
$gOut["content"] .= $renderer->html();
$gOut["content"] .= evidence_render_oddsratio_summary_table($report);
$rsid_seen = array();
$allele_frequency = array();
$firstrow = true;
$sections = array("Publications" => new evidence_row_renderer(), "Genomes" => new evidence_row_renderer());
foreach ($report as $row) {
    $section = FALSE;
    if ($row["article_pmid"] > 0) {
Beispiel #2
0
function evidence_render_oddsratio_summary_table($report)
{
    $disease =& evidence_get_all_oddsratios($report);
    if (!sizeof($disease)) {
        return "";
    }
    global $gDisableEditing;
    $gDE_was = $gDisableEditing;
    $gDisableEditing = true;
    $renderer = new evidence_row_renderer();
    foreach ($disease as $id => &$row) {
        $row["summary_short"] = json_encode($row["figs"]);
        $renderer->render_row($row);
    }
    $gDisableEditing = $gDE_was;
    return $renderer->html();
}
Beispiel #3
0
        if (aa_sane($_POST["variant_aa_change"])) {
            if (ereg("^([^0-9]+)([0-9]+)([^0-9]+)\$", aa_long_form($_POST["variant_aa_change"]), $regs)) {
                $aa_from = $regs[1];
                $aa_pos = $regs[2];
                $aa_to = $regs[3];
            }
            $gene = strtoupper($_POST["variant_gene"]);
            $variant_id = evidence_get_variant_id($gene, $aa_pos, $aa_from, $aa_to, true);
            $edit_id = evidence_get_latest_edit($variant_id, 0, 0, 0, true);
            $response["latest_edit_v{$variant_id}a0g0"] = $edit_id;
            $response["latest_edit_id"] = $edit_id;
            $response["variant_id"] = $variant_id;
            $response["please_reload"] = true;
            $response["variant_key"] = "{$gene} " . aa_short_form("{$aa_from}{$aa_pos}{$aa_to}");
        } else {
            die("Invalid variant specified");
        }
    }
    if ($article_pmid || $genome_id || $disease_id) {
        $latest_edit_id = evidence_get_latest_edit($variant_id, $article_pmid, $genome_id, $disease_id, true);
        $response["latest_edit_v{$variant_id}a{$article_pmid}g{$genome_id}"] = $latest_edit_id;
        $response["latest_edit_id"] = $latest_edit_id;
        $renderer = new evidence_row_renderer();
        $renderer->render_row(theDb()->getRow("SELECT * FROM edits WHERE edit_id=?", array($latest_edit_id)));
        $response["html"] = $renderer->html();
        ereg("id=\"([^\"]+)", $response["html"], $regs);
        $response["e_id"] = $regs[1];
    }
    header("Content-type: application/json");
    print json_encode($response);
}