|
@@ -101,6 +101,16 @@ class GFF3Importer extends TripalImporter {
|
|
you may specify the name of the attribute to use for the name."),
|
|
you may specify the name of the attribute to use for the name."),
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+
|
|
|
|
+ $form['advanced']['create_proteins'] = array(
|
|
|
|
+ '#type' => 'checkbox',
|
|
|
|
+ '#title' => t('Create proteins'),
|
|
|
|
+ '#required' => FALSE,
|
|
|
|
+ '#description' => t('Check the box if you would like to create the proteins described in the GFF file.'),
|
|
|
|
+ '#default_value' => FALSE
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+
|
|
$form['advanced']['protein_names'] = array(
|
|
$form['advanced']['protein_names'] = array(
|
|
'#type' => 'fieldset',
|
|
'#type' => 'fieldset',
|
|
'#title' => t('Protein Names'),
|
|
'#title' => t('Protein Names'),
|
|
@@ -135,7 +145,6 @@ class GFF3Importer extends TripalImporter {
|
|
expression would be "$1-P$2".')
|
|
expression would be "$1-P$2".')
|
|
);
|
|
);
|
|
|
|
|
|
-
|
|
|
|
$form['advanced']['use_transaction']= array(
|
|
$form['advanced']['use_transaction']= array(
|
|
'#type' => 'checkbox',
|
|
'#type' => 'checkbox',
|
|
'#title' => t('Use a transaction'),
|
|
'#title' => t('Use a transaction'),
|
|
@@ -316,11 +325,14 @@ class GFF3Importer extends TripalImporter {
|
|
$re_mrna = $arguments['re_mrna'];
|
|
$re_mrna = $arguments['re_mrna'];
|
|
$re_protein = $arguments['re_protein'];
|
|
$re_protein = $arguments['re_protein'];
|
|
|
|
|
|
|
|
+ $create_protein = $arguments['create_proteins'];
|
|
|
|
+
|
|
|
|
+
|
|
$this->loadGFF3($file_path, $organism_id, $analysis_id,
|
|
$this->loadGFF3($file_path, $organism_id, $analysis_id,
|
|
$add_only, $update, $refresh, $remove, $use_transaction,
|
|
$add_only, $update, $refresh, $remove, $use_transaction,
|
|
$target_organism_id, $target_type, $create_target,
|
|
$target_organism_id, $target_type, $create_target,
|
|
$start_line, $landmark_type, $alt_id_attr, $create_organism,
|
|
$start_line, $landmark_type, $alt_id_attr, $create_organism,
|
|
- $re_mrna, $re_protein);
|
|
|
|
|
|
+ $re_mrna, $re_protein, $create_protein);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -394,6 +406,8 @@ class GFF3Importer extends TripalImporter {
|
|
* regular expression to extract portions from mRNA id
|
|
* regular expression to extract portions from mRNA id
|
|
* @param $re_protein A
|
|
* @param $re_protein A
|
|
* replacement string to generate the protein id
|
|
* replacement string to generate the protein id
|
|
|
|
+ * @PARAM $create_protein
|
|
|
|
+ * BOOL: Will the loader create the described proteins?
|
|
*
|
|
*
|
|
* @ingroup gff3_loader
|
|
* @ingroup gff3_loader
|
|
*/
|
|
*/
|
|
@@ -401,7 +415,7 @@ class GFF3Importer extends TripalImporter {
|
|
$add_only = 0, $update = 1, $refresh = 0, $remove = 0, $use_transaction = 1,
|
|
$add_only = 0, $update = 1, $refresh = 0, $remove = 0, $use_transaction = 1,
|
|
$target_organism_id = NULL, $target_type = NULL, $create_target = 0,
|
|
$target_organism_id = NULL, $target_type = NULL, $create_target = 0,
|
|
$start_line = 1, $landmark_type = '', $alt_id_attr = '', $create_organism = FALSE,
|
|
$start_line = 1, $landmark_type = '', $alt_id_attr = '', $create_organism = FALSE,
|
|
- $re_mrna = '', $re_protein = '') {
|
|
|
|
|
|
+ $re_mrna = '', $re_protein = '', $create_protein = FALSE) {
|
|
|
|
|
|
$ret = array();
|
|
$ret = array();
|
|
$date = getdate();
|
|
$date = getdate();
|
|
@@ -948,17 +962,19 @@ class GFF3Importer extends TripalImporter {
|
|
$pfmin += $min_phase[0]->phase;
|
|
$pfmin += $min_phase[0]->phase;
|
|
}
|
|
}
|
|
|
|
|
|
- // Add the new protein record.
|
|
|
|
- $feature = $this->loadFeature($organism, $analysis_id,
|
|
|
|
|
|
+ if ($create_protein){
|
|
|
|
+ // Add the new protein record.
|
|
|
|
+ $feature = $this->loadFeature($organism, $analysis_id,
|
|
$protein_cvterm, $uname, $name, '', 'f', 'f', 1, 0);
|
|
$protein_cvterm, $uname, $name, '', 'f', 'f', 1, 0);
|
|
- // Add the derives_from relationship.
|
|
|
|
- $cvterm = chado_get_cvterm(array('cvterm_id' => $result->cvterm_id));
|
|
|
|
- $this->loadDerivesFrom($feature, $cvterm,
|
|
|
|
|
|
+ // Add the derives_from relationship.
|
|
|
|
+ $cvterm = chado_get_cvterm(array('cvterm_id' => $result->cvterm_id));
|
|
|
|
+ $this->loadDerivesFrom($feature, $cvterm,
|
|
$result->uniquename, $organism, $pfmin, $pfmax);
|
|
$result->uniquename, $organism, $pfmin, $pfmax);
|
|
- // Add the featureloc record. Set the start of the protein to
|
|
|
|
- // be the start of the coding sequence minus the phase.
|
|
|
|
- $this->loadFeatureLoc($feature, $organism, $result->landmark,
|
|
|
|
|
|
+ // Add the featureloc record. Set the start of the protein to
|
|
|
|
+ // be the start of the coding sequence minus the phase.
|
|
|
|
+ $this->loadFeatureLoc($feature, $organism, $result->landmark,
|
|
$pfmin, $pfmax, $result->strand, '', 'f', 'f', '', 0);
|
|
$pfmin, $pfmax, $result->strand, '', 'f', 'f', '', 0);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|