Exemple #1
0
 static function createDBSNPTable($con, $tableName)
 {
     try {
         $tableLists = DatabaseManager::getCurrentTables($con, self::$dbName);
         $v = in_array($tableName, $tableLists);
         if (!$v) {
             $rs = false;
         } else {
             $rs = true;
         }
         if (!$rs) {
             $columnName = array("chrom", "pos");
             $columnParams = array("varchar(30)", "int");
             $index = "index(chrom,pos)";
             $a = TableCreator::createReferenceTable($con, $tableName, $columnName, $columnParams, $index);
             if (!$a) {
                 throw new Exception("Error create dbSNP table");
             }
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
 }
Exemple #2
0
 static function createRefSeqGeneTable($con, $tableName)
 {
     try {
         $tableLists = DatabaseManager::getCurrentTables($con, self::$dbName);
         $v = in_array($tableName, $tableLists);
         if (!$v) {
             $rs = false;
         } else {
             $rs = true;
         }
         if (!$rs) {
             $columnName = array("bin", "name", "chrom", "strand", "txStart", "txEnd", "cdsStart", "cdsEnd", "exonCount", "exonStarts", "exonEnds", "score", "name2", "cdsStartStat", "cdsEndStat", "exonFrames");
             $columnParams = array("int", "varchar(255)", "varchar(255)", "varchar(1)", "int", "int", "int", "int", "int", "longblob", "longblob", "int", "varchar(255)", "varchar(8)", "varchar(8)", "longblob");
             $index = "index(chrom,txStart,txEnd)";
             $a = TableCreator::createReferenceTable($con, $tableName, $columnName, $columnParams, $index);
             if (!$a) {
                 throw new Exception("Error create RefSeqGene table");
             }
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
 }
Exemple #3
0
 static function createSpliceJunctionTable($con, $tableName)
 {
     try {
         $tableLists = DatabaseManager::getCurrentTables($con, self::$dbName);
         $v = in_array($tableName, $tableLists);
         if (!$v) {
             $rs = false;
         } else {
             $rs = true;
         }
         if (!$rs) {
             //existTable($tableName)
             $columnName = array("chrom", "ref", "type", "begin", "end", "score", "strand", "frame", "info");
             $columnParams = array("varchar(30)", "varchar(30)", "varchar(10)", "int", "int", "float(8,6)", "varchar(1)", "varchar(1)", "varchar(100)");
             $index = "index(chrom,type)";
             $v = TableCreator::createReferenceTable($con, $tableName, $columnName, $columnParams, $index);
             if (!$v) {
                 throw new Exception("Error create Splice Junction table");
             }
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
 }
Exemple #4
0
 static function createRepeatRegionsTable($con, $tableName)
 {
     try {
         $tableLists = DatabaseManager::getCurrentTables($con, self::$dbName);
         $v = in_array($tableName, $tableLists);
         if (!$v) {
             $rs = false;
         } else {
             $rs = true;
         }
         if (!$rs) {
             //existTable($tableName)
             $columnName = array("chrom", "begin", "end", "type");
             $columnParams = array("varchar(30)", "int", "int", "varchar(40)");
             $index = "index(chrom,begin,end)";
             $v = TableCreator::createReferenceTable($con, $tableName, $columnName, $columnParams, $index);
             if (!$v) {
                 throw new Exception("Error create repeat regions table");
             }
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
 }