Ejemplo n.º 1
0
function groups2bps($qtl_db, $groups, $species)
{
    $bp = array();
    $i = 0;
    foreach ($groups as $group) {
        $bp[$i]['start'] = cM2bp($group['Chr'], $group['start'], $species);
        $bp[$i]['end'] = cM2bp($group['Chr'], $group['end'], $species);
        $i++;
    }
    return $bp;
}
Ejemplo n.º 2
0
         echo "<!-- QTL known to overlap with gene location -->\n";
         echo "</td>\n";
         */
         echo "<td nowrap>";
     }
     if ($prevTrait == $row1["trait_id"]) {
         echo "<br />";
     }
     $col = "black";
     if ($row1["qtl_Chromosome"] == $row1["chromosome"]) {
         $col = "red";
     }
     echo "<font color='{$col}'>";
     echo $row1["qtl_Chromosome"] . ":" . $row1["qtl_cMorgan_Peak"] . " " . (empty($row1["qtl_covariates"]) ? "none" : $row1["qtl_covariates"]) . ":" . $row1["qtl_lod"];
     if (!empty($row1["qtl_Chromosome"]) and isset($row1["qtl_cMorgan_Peak"]) and "" != $row1["qtl_cMorgan_Peak"]) {
         $bp = cM2bp($row1["qtl_Chromosome"], $row1["qtl_cMorgan_Peak"]);
         //echo("!!!bp=$bp!!!");
         $overlapping_qtl = withinthefollowingqtls($row1["qtl_Chromosome"], $bp, $public_qtls, FALSE);
         if (!empty($overlapping_qtl) and 0 < count($overlapping_qtl)) {
             echo " (<font color='green'><b>";
             echo join(",", $overlapping_qtl);
             echo "</b></font>)";
         }
         //print_r($overlapping_qtl);
     }
     echo "</font>";
     $prevTrait = $row1["trait_id"];
 }
 if (!empty($prevTrait)) {
     echo "</td></tr>\n";
 }
Ejemplo n.º 3
0
$tmp_species = array_combine($names, array_fill(0, 3, ""));
fwrite($fptr, "Locus\tstart\tstop\t" . implode("\t", $names) . "\r\n");
# synreg
#Locus	group	chr	start	stop	Trait	Status	Syngroup	chr	start	end	Trait	homotype syn_ids
$size = count($genelist);
for ($i = 1; $i < $size; $i++) {
    // skip header
    $entry = explode("\t", $genelist[$i]);
    $syn_list = explode(",", $entry[13]);
    foreach ($names as $name) {
        $tmp_species[$name] = "";
    }
    //array_fill_keys($names, "");
    //get all intersecting disease species
    for ($j = 0; $j < $size_d - 1; $j++) {
        // skip header
        $intersect = array_intersect($syn_list, $synIDs_d[$j]);
        if (!empty($intersect)) {
            // synteny => add species to list
            $tmp_species[$species_d[$j]] = "x";
        }
    }
    $chr = $entry[2];
    $start = cM2bp($chr, $entry[3], $species1);
    $end = cM2bp($chr, $entry[4], $species1);
    $str = $entry[0] . "\t" . $start . "\t" . $end . "\t" . implode("\t", $tmp_species);
    fwrite($fptr, $str . "\r\n");
}
fclose($fptr);
echo "done synteny to disease regions";
include 'html/footer.html';