예제 #1
0
Michael Brehler <*****@*****.**>,
Georg Zeplin <*****@*****.**>,

=head1 COPYRIGHT

University of LE<uuml>beck, Germany, 2011

=cut

ENDOFDOCUMENTATION
*/
require_once 'db_functions.php';
require_once 'analysis/func_analysis.php';
$fptr = fopen('analysis/QTL.txt', 'w');
echo "a";
$targetdb = connectToQTL();
echo "a";
$comparaDB = connectToCompara();
echo "a";
$table = get_all_QTL($targetdb);
echo "a";
$str = "start_bps\t\tstop_bps\t\tChr\t\tspecies\t\tsyntenyID\r\n";
foreach ($table as $row) {
    if ($row[0] != NULL && $row[1] != NULL && $row[2] != NULL && $row[3] != NULL) {
        $tmp = getSyntenyRegionIDs($comparaDB, $row);
        $str .= $row[0] . "\t\t" . $row[1] . "\t\t" . $row[2] . "\t\t" . $row[3] . "\t\t" . $tmp . "\n";
    }
}
fwrite($fptr, $str);
fclose($fptr);
예제 #2
0
$experiment1 = $compara_array[$projects[1]];
$experiment2 = $compara_array[$projects[0]];
//load informations (database and so on...)
$species_names = array($experiment1['species'], $experiment2['species']);
$database1 = $experiment1['db_name'];
$database2 = $experiment2['db_name'];
$dbs = array($database1, $database2);
// species
$species1 = $experiment1['species'];
$species2 = $experiment2['species'];
$ens_species1 = $experiment1['ensembl_species'];
$ens_species2 = $experiment2['ensembl_species'];
$genelist = file("analysis/mus.txt", FILE_IGNORE_NEW_LINES);
$fptr = fopen("analysis/mus_out.txt", 'w');
fwrite($fptr, $genelist[0] . "\t syn_reg_ids\r\n");
# $keys = explode("\t", $genelist[0]);
#Locus	group	chr	start	stop	Trait	Status	Syngroup	chr	start	end	Trait	homotype
$size = count($genelist);
for ($i = 1; $i < $size; $i++) {
    // skip header
    $entry = explode("\t", $genelist[$i]);
    $chr = $entry[2];
    //echo $chr;
    $start = cM2bp($chr, $entry[3], $species1);
    $end = cM2bp($chr, $entry[4], $species1);
    $str = getSyntenyRegionIDs($compara, array($start, $end, $chr, $ens_species1));
    fwrite($fptr, $genelist[$i] . "\t" . $str . "\r\n");
}
fclose($fptr);
echo "done";
include 'html/footer.html';