|
@@ -466,11 +466,11 @@ function tripal_feature_load_gff3($gff_file, $organism_id,$analysis_id,$add_only
|
|
|
if(array_key_exists('Alias',$tags)){
|
|
|
tripal_feature_load_gff3_alias($feature,$tags['Alias']);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(array_key_exists('Dbxref',$tags)){
|
|
|
tripal_feature_load_gff3_dbxref($feature,$tags['Dbxref']);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if(array_key_exists('Ontology_term',$tags)){
|
|
|
tripal_feature_load_gff3_ontology($feature,$tags['Ontology_term']);
|
|
|
}
|
|
@@ -478,6 +478,31 @@ function tripal_feature_load_gff3($gff_file, $organism_id,$analysis_id,$add_only
|
|
|
if(array_key_exists('Parent',$tags)){
|
|
|
tripal_feature_load_gff3_parents($feature,$cvterm,$tags['Parent'],$gff_features,$organism_id,$fmin);
|
|
|
}
|
|
|
+
|
|
|
+ if(array_key_exists('Target',$tags)){
|
|
|
+ $target = explode(" ",$tags['Target'][0]);
|
|
|
+ $target_feature = $target[0];
|
|
|
+ $target_start = $target[1];
|
|
|
+ $target_end = $target[2];
|
|
|
+ $target_dir = $target[3];
|
|
|
+
|
|
|
+ tripal_feature_load_gff3_featureloc($feature,$organism,
|
|
|
+ $target_feature,$target_start,$target_end,$strand,$phase,$attr_fmin_partial,
|
|
|
+ $attr_fmax_partial,$attr_residue_info,$attr_locgroup);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(array_key_exists('Gap',$tags)){
|
|
|
+ tripal_feature_load_gff3_property($feature,'Gap',$tags['Gap'][0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(array_key_exists('Note',$tags)){
|
|
|
+ tripal_feature_load_gff3_property($feature,'Note',$tags['Note'][0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(array_key_exists('Derives_from',$tags)){
|
|
|
+ tripal_feature_load_gff3_derives_from($feature,$tags['Derives_from'][0],$gff_features,$organism);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
$source_ref = array('GFF_source:'.$source);
|
|
|
tripal_feature_load_gff3_dbxref($feature,$source_ref);
|
|
@@ -546,7 +571,56 @@ function tripal_feature_load_gff3($gff_file, $organism_id,$analysis_id,$add_only
|
|
|
tripal_db_set_active($previous_db);
|
|
|
return '';
|
|
|
}
|
|
|
+
|
|
|
+ *
|
|
|
+ *
|
|
|
+ * @ingroup gff3_loader
|
|
|
+ */
|
|
|
+function tripal_feature_load_gff3_derives_from($feature,$subject,$gff_features,$organism){
|
|
|
+
|
|
|
+
|
|
|
+ $match = array(
|
|
|
+ 'organism_id' => $organism->organism_id,
|
|
|
+ 'uniquename' => $subject,
|
|
|
+ 'type_id' => array(
|
|
|
+ 'name' => $gff_features[$subject]['type'],
|
|
|
+ 'cv_id' => array(
|
|
|
+ 'name' => 'sequence'
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ $sfeature = tripal_core_chado_select('feature',array('*'),$match);
|
|
|
+ if(count($sfeature)==0){
|
|
|
+ print "ERROR: could not add 'Derives_from' relationship for $feature->uniquename and $subject. Subject feature, '$subject', cannot be found\n";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ $values = array(
|
|
|
+ 'object_id' => $feature->feature_id,
|
|
|
+ 'subject_id' => $sfeature[0]->feature_id,
|
|
|
+ 'type_id' => array(
|
|
|
+ 'cv_id' => array(
|
|
|
+ 'name' => 'relationship'
|
|
|
+ ),
|
|
|
+ 'name' => 'derives_from',
|
|
|
+ ),
|
|
|
+ 'rank' => 0
|
|
|
+ );
|
|
|
+ $rel = tripal_core_chado_select('feature_relationship',array('*'),$values);
|
|
|
+ if(count($rel) > 0){
|
|
|
+ print " Relationship already exists: $feature->uniquename derives_from $subject\n";
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
+ $ret = tripal_core_chado_insert('feature_relationship',$values);
|
|
|
+ if(!$ret){
|
|
|
+ print "ERROR: could not add 'Derives_from' relationship for $feature->uniquename and $subject\n";
|
|
|
+ } else {
|
|
|
+ print " Added relationship: $feature->uniquename derives_from $subject\n";
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
*
|
|
|
*
|
|
@@ -933,16 +1007,21 @@ function tripal_feature_load_gff3_feature($organism,$analysis_id,$cvterm,$unique
|
|
|
print " Added analysisfeature record\n";
|
|
|
}
|
|
|
} else {
|
|
|
-
|
|
|
+
|
|
|
$new_vals = array();
|
|
|
if(strcmp($score,'.')!=0){
|
|
|
$new_vals['significance'] = $score;
|
|
|
- }
|
|
|
- if(!$add_only and !tripal_core_chado_update('analysisfeature',$af_values,$new_vals)){
|
|
|
- print "ERROR: could not update analysisfeature record: $analysis_id, $feature->feature_id\n";
|
|
|
} else {
|
|
|
- print " Updated analysisfeature record\n";
|
|
|
- }
|
|
|
+ $new_vals['significance'] = '__NULL__';
|
|
|
+ }
|
|
|
+ if(!$add_only){
|
|
|
+ $ret = tripal_core_chado_update('analysisfeature',$af_values,$new_vals);
|
|
|
+ if(!$ret){
|
|
|
+ print "ERROR: could not update analysisfeature record: $analysis_id, $feature->feature_id\n";
|
|
|
+ } else {
|
|
|
+ print " Updated analysisfeature record\n";
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return $feature;
|