فهرست منبع

Fixed some bugs and imporoved the publication ontology

spficklin 12 سال پیش
والد
کامیت
12ce2b4c63
4فایلهای تغییر یافته به همراه66 افزوده شده و 23 حذف شده
  1. 32 19
      tripal_pub/includes/pub_form.inc
  2. 2 2
      tripal_pub/includes/pub_sync.inc
  3. 27 1
      tripal_pub/tpub.obo
  4. 5 1
      tripal_pub/tripal_pub.module

+ 32 - 19
tripal_pub/includes/pub_form.inc

@@ -87,7 +87,10 @@ function chado_pub_form($node, $form_state) {
     // both as a property and as the uniquename for the publiation table
     // it is present by default in the initial fields of the form so
     // we don't want it again in the drop-down list
-    if ($prop->name != 'Citation') {
+    // also remove other terms associated with the DBXref
+    if ($prop->name != "Citation" and
+        $prop->name != "Publication Accession" and
+        $prop->name != "Publication Database") {
       $properties_select[$prop->cvterm_id] = $prop->name;
     }
     $properties_list[$prop->cvterm_id] = $prop;
@@ -182,12 +185,19 @@ function chado_pub_node_form_add_new_empty_props(&$form, $properties_select) {
   $form['properties']['new']["new_id"] = array(
     '#type'          => 'select',
     '#options'       => $properties_select,
+    '#ahah' => array(
+      'path'    => "tripal_pub/properties/description",
+      'wrapper' => 'tripal-pub-new_value-desc',
+      'event'   => 'change',
+      'method'  => 'replace',          
+    ),   
   );
   $form['properties']['new']["new_value"] = array(
     '#type'          => 'textarea',
     '#default_value' => '',
     '#cols'          => 5,
-    '#rows'          => $rows
+    '#rows'          => $rows,
+    '#description'   => '<div id="tripal-pub-new_value-desc"></div>'
   );
   $form['properties']['new']["add"] = array(
     '#type'         => 'image_button',      
@@ -243,11 +253,7 @@ function chado_pub_node_form_add_new_props(&$form, $form_state, $num_new, &$d_pr
         if (preg_match('/Abstract/', $cvterm[0]->name)) {
           $rows = 10;
         }
-        
-        // adjust the term description if needed
-        $description = $cvterm[0]->definition;
         if ($cvterm[0]->name == 'Author List') {
-          $description .= ' For PubMed style citations list each author with the last name first, followed by initials. Each author should be separated by a comma.';
           $rows = 2;
         }
         
@@ -304,11 +310,7 @@ function chado_pub_node_form_add_new_props(&$form, $form_state, $num_new, &$d_pr
     if (preg_match('/Abstract/', $cvterm[0]->name)) {
       $rows = 10;
     }
-    
-    // adjust the term description if needed
-    $description = $cvterm[0]->definition;
     if ($cvterm[0]->name == 'Author List') {
-      $description .= ' For PubMed style citations list each author with the last name first, followed by initials. Each author should be separated by a comma.';
       $rows = 2;
     }
     
@@ -395,12 +397,7 @@ function chado_pub_node_form_add_pubprop_table_props(&$form, $form_state, $pub_i
     if (preg_match('/Abstract/', $prop->name)) {
       $rows = 10;
     }
-  
-    // adjust the term description if needed
-    $description = $prop->definition;
     if ($prop->name == 'Author List') {
-      $description .= ' For PubMed style citations list each author with the last name first, followed by 
-        initials. Each author should be separated by a comma.';
       $rows = 2;
     }
   
@@ -483,11 +480,7 @@ function chado_pub_node_form_add_pub_table_props(&$form, $form_state, $propertie
       if (preg_match('/Abstract/', $prop->name)) {
         $rows = 10;
       }
-      
-      // adjust the term description if needed
-      $description = $prop->definition;
       if ($prop->name == 'Author List') {
-        $description .= ' For PubMed style citations list each author with the last name first, followed by initials. Each author should be separated by a comma.';
         $rows = 2;
       }
       
@@ -649,4 +642,24 @@ function tripal_pub_property_delete() {
       'settings' => $settings,
     )  
   );
+}
+/*
+ * 
+ */
+function tripal_pub_property_get_description() {
+  $new_id = $_POST['new_id'];
+  
+  $values = array('cvterm_id' => $new_id);
+  $cvterm = tripal_core_chado_select('cvterm', array('definition'), $values);
+  
+  $description = '&nbsp;';
+  if ($cvterm[0]->definition) {
+    $description = $cvterm[0]->definition;
+  }
+  drupal_json(
+    array(
+      'status' => TRUE,
+      'data'   => '<div id="tripal-pub-new_value-desc">' . $description . '</div>',
+    )    
+  );
 }

+ 2 - 2
tripal_pub/includes/pub_sync.inc

@@ -81,12 +81,12 @@ function tripal_pub_sync_pub($pub) {
       print "Added " . $pub->pub_id . "\n";      
     }
     else {
-      print "ERROR: Unable to create " . $pub->name . "\n";
+      print "ERROR: Unable to create publication node: " . $pub->title . "\n";
       return FALSE;
     }
   }
   else {
-    print "ERROR: Unable to create " . $pub->name . "\n" . print_r($errors, TRUE) . "\n";
+    print "ERROR: Unable to create publication node: " . $pub->title . "\n" . print_r($errors, TRUE) . "\n";
     return FALSE;
   }
   return $node; 

+ 27 - 1
tripal_pub/tpub.obo

@@ -6,6 +6,7 @@ subsetdef: MeSH_Publication_Type "MeSH Publication Types"
 id: TPUB:0000001
 name: Publication Dbxref
 relationship: part_of TPUB:0000037 ! Publication Details
+def: A unique identifer for the publication in a remote database.  The format is a database abbreviation and a unique accession separated by a colon.  (e.g. PMID:23493063)
 
 [Term]
 id: TPUB:0000002
@@ -15,6 +16,7 @@ name: Publication
 id: TPUB:0000003
 name: Citation
 relationship: part_of TPUB:0000037 ! Publication Details
+def: Biblographic reference for the publication.   
 
 [Term]
 id: TPUB:0000004
@@ -53,11 +55,13 @@ relationship: part_of TPUB:0000001 ! Publication Dbxref
 id: TPUB:0000010
 name: Received Date
 is_a: TPUB:0000046 ! Publication Date
+def: The date when the manuscript was first received by the editor for consideration for print. This should be in the format: YYYY Mon Day, where YYYY is a 4 digit year, Mon is a 3-letter English abbreviation for the month followed by the day.  The month and day are optional.
 
 [Term]
 id: TPUB:0000011
 name: Conference Name
 relationship: part_of TPUB:0000037 ! Publication Details
+def: The name of a conference from which presented works are published.
 
 [Term]
 id: TPUB:0000012
@@ -88,11 +92,13 @@ relationship: part_of TPUB:0000002 ! Publication
 id: TPUB:0000035
 name: Epub Date
 is_a: TPUB:0000046 ! Publication Date
+def:  The date when a manuscript for the publication was first published online.  This may not be the same date it was formally printed. This should be in the format: YYYY Mon Day, where YYYY is a 4 digit year, Mon is a 3-letter English abbreviation for the month followed by the day. The month and day are optional.
 
 [Term]
 id: TPUB:0000036
 name: Accepted Date
 is_a: TPUB:0000046 ! Publication Date
+def:  The date when a manuscript for the publication was first accepted for publication by the editor. This should be in the format: YYYY Mon Day, where YYYY is a 4 digit year, Mon is a 3-letter English abbreviation for the month followed by the day. The month and day are optional.
 
 [Term]
 id: TPUB:0000037
@@ -103,11 +109,13 @@ relationship: part_of TPUB:0000002 ! Publication
 id: TPUB:0000038
 name: Journal ISO Abbreviation
 relationship: part_of TPUB:0000037 ! Publication Details
+def: The journal title ISO Abbreviation.
 
 [Term]
 id: TPUB:0000039
 name: Title
 relationship: part_of TPUB:0000037 ! Publication Details
+def:  The title of the published work.
 
 [Term]
 id: TPUB:0000040
@@ -123,32 +131,38 @@ is_a: TPUB:0000015 ! Publication Type
 id: TPUB:0000042
 name: Volume
 relationship: part_of TPUB:0000037 ! Publication Details
+def:  The volume of the journal where the publication was printed. 
 
 [Term]
 id: TPUB:0000043
 name: Issue
 relationship: part_of TPUB:0000037 ! Publication Details
+def:  The issue of the journal where the publication was printed. 
 
 [Term]
 id: TPUB:0000044
 name: Pages
 relationship: part_of TPUB:0000037 ! Publication Details
+def:  The pages in the published work where the cited information is found.
 
 [Term]
 id: TPUB:0000045
 name: Start Page
 relationship: part_of TPUB:0000037 ! Publication Details
+def:  The first page in the published work where the cited information is found.
 
 [Term]
 id: TPUB:0000046
 name: Publication Date
 relationship: part_of TPUB:0000037 ! Publication Details
+def:  The date the work was published.  This should be in the format: YYYY Mon Day, where YYYY is a 4 digit year, Mon is a 3-letter English abbreviation for the month followed by the day. The month and day are optional.
 
 [Term]
 id: TPUB:0000047
 name: Authors
 relationship: part_of TPUB:0000037 ! Publication Details
 is_obsolete: true
+def:  This term is deprecated.  Please use the 'Authors List' term.
 
 [Term]
 id: TPUB:0000048
@@ -166,46 +180,54 @@ is_a: TPUB:0000080 ! Elocation
 id: TPUB:0000050
 name: Abstract
 relationship: part_of TPUB:0000037 ! Publication Details
+def:  The fully printed abstract for the publication.
 
 [Term]
 id: TPUB:0000051
 name: Comments
 relationship: part_of TPUB:0000037 ! Publication Details
+def:  Comments regarding the content in the publication.
 
 [Term]
 id: TPUB:0000052
 name: URL
 relationship: part_of TPUB:0000037 ! Publication Details
+def: A univeral resource locator (URL) reference where the publication can be found.  For publications found online, this would be the web address for the publication. 
 
 [Term]
 id: TPUB:0000053
 name: File Attachment
 relationship: part_of TPUB:0000037 ! Publication Details
+def: The names of a file associated with the publication (e.g. supplemental data). 
 
 [Term]
 id: TPUB:0000059
 name: Year
 relationship: part_of TPUB:0000046 ! Publication Date
+def: The year the work was published. This should be a 4 digit year.
 
 [Term]
 id: TPUB:0000064
 name: Language
 relationship: part_of TPUB:0000037 ! Publication Details
+def:  The full name of the languge of the publication (e.g. English).
 
 [Term]
 id: TPUB:0000065
 name: Keywords
 relationship: part_of TPUB:0000037 ! Publication Details
+def:  Contains controlled terms that describe the content of the article. Multiple keywords should be separated with a comma.  For keyworks with that exist in a formal ontology or vocabulary, the format can be the database abbreviation, followed by the term accession separated by a comma (e.g. GO:591743).
 
 [Term]
 id: TPUB:0000066
 name: Original Title
 relationship: part_of TPUB:0000037 ! Publication Details
-
+ 
 [Term]
 id: TPUB:0000067
 name: Alias
 relationship: part_of TPUB:0000037 ! Publication Details
+def: A synonym or alternative name for this publication. 
 
 [Term]
 id: TPUB:0000068
@@ -216,6 +238,7 @@ relationship: part_of TPUB:0000037 ! Publication Details
 id: TPUB:0000069
 name: pISSN
 is_a: TPUB:0000048 ! ISSN
+def: International Standard Serial Number (ISSN) is an eight-character value that uniquely identifies a periodicals in print or other media. There are two sub categories of ISSN: print, p-ISSN and electronic e-ISSN.
 
 [Term]
 id: TPUB:0000070
@@ -227,6 +250,7 @@ is_a: TPUB:0000015 ! Publication Type
 id: TPUB:0000072
 name: eISSN
 is_a: TPUB:0000048 ! ISSN
+def: International Standard Serial Number (ISSN) is an eight-character value that uniquely identifies a periodicals in print or other media. There are two sub categories of ISSN: print, p-ISSN and electronic e-ISSN.
 
 [Term]
 id: TPUB:0000073
@@ -1292,6 +1316,8 @@ is_a: TPUB:0000015 ! Publication Type
 id: TPUB:0000240
 name: Author List
 relationship: part_of TPUB:0000037 ! Publication Details
+synonym: "Authors" EXACT []
+def:  The list of authors of the publication. For PubMed style citations list each author with the last name first, followed by initials. Each author should be separated by a comma.
 
 [Term]
 id: TPUB:0000241

+ 5 - 1
tripal_pub/tripal_pub.module

@@ -123,7 +123,11 @@ function tripal_pub_menu() {
     'access arguments' => array('edit chado_pub content'),
     'type ' => MENU_CALLBACK,
   );
-  
+  $items['tripal_pub/properties/description'] = array(    
+    'page callback' => 'tripal_pub_property_get_description',
+    'access arguments' => array('edit chado_pub content'),
+    'type ' => MENU_CALLBACK,
+  );
   $items['tripal_pub/properties/minus/%/%'] = array(    
     'page callback' => 'tripal_pub_property_delete',
     'page arguments' => array(3, 4),