fetchObject()) { print $line->landmark_uname . "\t"; print $source . "\t"; print $line->type . "\t"; print $line->fmin . "\t"; print $line->fmax . "\t"; print "." . "\t"; if ($line->strand) { print $line->strand . "\t"; } else { print '.' . "\t"; } if ($line->phase) { print $line->phase . "\t"; } else { print '.' . "\t"; } print "ID=" . $line->uniquename . ";Name=" . $line->name . ";"; $props = chado_query($props_sql, array(':feature_id' => $line->feature_id)); $prop_name = ''; while ($prop = $props->fetchobject()) { // If this is the first time we've encountered this property then // add the name=value key pair. if ($prop_name != $prop->name) { if ($prop_name) { // End the previous property print ";"; } // TODO: urlencode the properties print $prop->name . "=" . $prop->value; $prop_name = $prop->name; } // If we've seen this property before then just add the value. else { print "," . $prop->value; } } // End the last property if ($prop_name) { print ";"; } // Add in any DBXref records $args = array( ':feature_id' => $line->feature_id, ':dbxref_id' => $line->dbxref_id, ); $dbxrefs = chado_query($dbxref_sql, $args); $xrefs = ''; while ($dbxref = $dbxrefs->fetchObject()) { $xrefs .= $dbxref->name . ":" . $dbxref->accession . ","; } if ($xrefs) { print "Dbxref=" . substr($xrefs, 0, -1) . ";"; } // Add in any CVTerm records $args = array( ':feature_id' => $line->feature_id, ); $cvterms = chado_query($cvterm_sql, $args); $xrefs = ''; while ($cvterm = $cvterms->fetchObject()) { $xrefs .= $cvterm->db_name . ":" . $cvterm->accession . ","; } if ($xrefs) { print "Ontology_term=" . substr($xrefs, 0, -1) . ";"; } print "\n"; } }