From aaefa640b076dcd30652edf1285e3eeac559234b Mon Sep 17 00:00:00 2001
From: James Nairn <jwrn3@cam.ac.uk>
Date: Wed, 18 Nov 2020 12:42:23 +0000
Subject: [PATCH] Imported changes from vitor_testing1

Too difficult to merge the branch so I've pulled in various files by hand.
---
 FBbt-GO_routine/FBbt-GO_routine.sh            |   4 +-
 canto_deploy.yaml                             | 820 +++++++++++++++++-
 .../list-to-extension_config.R                |  26 +-
 starting-pack.sh                              |  38 +-
 4 files changed, 854 insertions(+), 34 deletions(-)
 mode change 100755 => 100644 FBbt-GO_routine/FBbt-GO_routine.sh
 mode change 100755 => 100644 starting-pack.sh

diff --git a/FBbt-GO_routine/FBbt-GO_routine.sh b/FBbt-GO_routine/FBbt-GO_routine.sh
old mode 100755
new mode 100644
index bb5cb55..6d5438e
--- a/FBbt-GO_routine/FBbt-GO_routine.sh
+++ b/FBbt-GO_routine/FBbt-GO_routine.sh
@@ -4,8 +4,8 @@
 #You must have ROBOT installed - see http://robot.obolibrary.org/
 
 ## Copy the two ontologies to merge from ./import_export/ to ./FBbt-GO_routine/ 
-cp ./import_export/go-basic.obo ./FBbt-GO_routine/
-cp ./import_export/fly_anatomy.obo ./FBbt-GO_routine/
+cp ./import_export/go-basic.obo ./FBbt-GO_routine
+cp ./import_export/fly_anatomy.obo ./FBbt-GO_routine
 
 cd ./FBbt-GO_routine
 ## Extract everything that is a subclass of 'GO: cellular component'
diff --git a/canto_deploy.yaml b/canto_deploy.yaml
index 41e2291..c604bf6 100644
--- a/canto_deploy.yaml
+++ b/canto_deploy.yaml
@@ -9,6 +9,11 @@ instance_organism:
 
 flybase_mode: 1
 
+annotation_figure_field: 0
+
+# disable deletion buttons on allele creation table on genotype management page
+show_quick_deletion_buttons: 0
+
 Model::TrackModel:
   connect_info:
 # filepath plus track.sqlite3
@@ -41,7 +46,8 @@ implementation_classes:
 alleles_have_expression: 0
 strains_mode: 0
 split_genotypes_by_organism: 0
-show_genotype_management_genes_list: 0
+##this enables/disables the allele creation table on the genotype management page (0 - disabled; 1 - enabled)
+show_genotype_management_genes_list: 1
 diploid_mode: 1
 
 ## allow internal notes on single alleles and config:
@@ -68,8 +74,8 @@ allele_type_list:
     show_description: true
     description_required: false
     allele_name_required: false
-    allow_expression_change: true
-    expression_required: true
+    allow_expression_change: false
+    expression_required: false
     hide_type_name: true
     placeholder: Please provide a description
   - name: accessory
@@ -77,8 +83,8 @@ allele_type_list:
     show_description: true
     description_required: false
     allele_name_required: false
-    allow_expression_change: true
-    expression_required: true
+    allow_expression_change: false
+    expression_required: false
     do_not_annotate: 1
     placeholder: Please provide a description
   - name: aberration
@@ -88,6 +94,7 @@ allele_type_list:
     allele_name_required: false
     allow_expression_change: false
     expression_required: false
+    do_not_annotate: 1
 
 
 # the name of the organisation running this Canto - shown in various places in the user interface
@@ -109,6 +116,8 @@ available_annotation_type_list:
       - exact
     feature_type: 'genotype'
     can_have_conditions: 0
+    #allow_annotation_transfer - use true/false
+    allow_annotation_transfer: true
     broad_term_suggestions: >
       lethal, sterile, visible, cell number defective, locomotor behavior defective
     specific_term_examples: >
@@ -123,7 +132,7 @@ available_annotation_type_list:
     detailed_help_path: /docs/fypo_annotation
   - name: anatomy
     category: ontology
-    namespace: fly_anatomy.ontology
+    namespace: FlyBase_anatomy_CV
     hide_extension_relations: [qual,dv_qual]
     very_short_display_name: 'anatomy'
     short_display_name: 'anatomy'
@@ -132,6 +141,8 @@ available_annotation_type_list:
       - exact
     feature_type: 'genotype'
     can_have_conditions: 0
+    #allow_annotation_transfer - use true/false
+    allow_annotation_transfer: true
     broad_term_suggestions: >
       embryo, wing, eye, ovary, wing disc, neuromuscular junction
     specific_term_examples: >
@@ -149,6 +160,8 @@ available_annotation_type_list:
     namespace: phenotypic_class
     term_suggestions_annotation_type: phenotypic_class
     interaction_term_required: 1
+    #allow_annotation_transfer - use true/false
+    allow_annotation_transfer: true
     hide_extension_relations: [qual,dv_qual]
     display_name: 'phenotype class interaction'
     very_short_display_name: 'phen-class interaction'
@@ -165,9 +178,11 @@ available_annotation_type_list:
     detailed_help_path: /docs/genetic_interaction_annotation
   - name: anatomy_interaction
     category: interaction
-    namespace: fly_anatomy.ontology
+    namespace: FlyBase_anatomy_CV
     term_suggestions_annotation_type: anatomy
     interaction_term_required: 1
+    #allow_annotation_transfer - use true/false
+    allow_annotation_transfer: true
     hide_extension_relations: [qual,dv_qual]
     display_name: 'phenotype anatomy interaction'
     very_short_display_name: 'anatomy interaction'
@@ -184,8 +199,13 @@ available_annotation_type_list:
     detailed_help_path: /docs/genetic_interaction_annotation
   - name: complementation
     can_have_conditions: 0
-    single_allele_only: 1
-    interaction_same_locus: 1
+    #single_allele_only -  use true/false
+    single_allele_only: true
+    #interaction_same_locus -  use true/false
+    interaction_same_locus: false
+    #allow_annotation_transfer - use true/false
+    allow_annotation_transfer: true
+    show_quick_deletion_buttons: 0
     category: interaction
     display_name: 'complementation'
     feature_type: 'metagenotype'
@@ -196,8 +216,11 @@ available_annotation_type_list:
       - Fails to complement
   - name: rescue
     can_have_conditions: 0
-    single_locus_only: 1
-    interaction_same_locus: 1
+    allow_annotation_transfer: 1
+    #single_locus_only: true
+    single_locus_only: true
+    #interaction_same_locus -  use true/false
+    interaction_same_locus: true
     category: interaction
     display_name: 'rescue'
     feature_type: 'metagenotype'
@@ -342,3 +365,778 @@ namespace_term_evidence_codes:
       evidence_codes:       
        - suppressible
        - non-suppressible
+
+class_info:
+  track:
+    cv:
+      class_display_name: controlled vocabulary
+      editable: 1
+      display_field: name
+      field_info_list:
+        - name: name
+          editable: 1
+        - name: definition
+          editable: 1
+        - name: "term count"
+          source:
+            sql: 'select count(*) from cvterm where cvterm.cv_id = me.cv_id'
+        - name: "load date"
+          source:
+            sql: "select value from cvprop p join cvterm pt on p.type_id = pt.cvterm_id where p.cv_id = me.cv_id and pt.name = 'cv_date'"
+    cvprop:
+      class_display_name: controlled vocabulary properties
+      display_field: value
+      field_info_list:
+        - name: type
+          source: type_id
+          referenced_class: Cvterm
+        - name: value
+          editable: 1
+    cvterm:
+      class_display_name: controlled vocabulary term
+      editable: 1
+      display_field: name
+      field_info_list:
+        - name: name
+          editable: 1
+        - name: definition
+          editable: 1
+        - name: cv_id
+          editable: 1
+    db:
+      editable: 1
+      display_field: name
+      field_info_list:
+        - name: name
+          editable: 1
+        - name: description
+          editable: 1
+        - name: url
+          editable: 1
+        - name: "accessions stored"
+          source:
+            sql: 'select count(*) from dbxref where dbxref.db_id = me.db_id'
+    dbxref:
+      editable: 1
+      display_field: accession
+      field_info_list:
+        - name: db_id
+          editable: 1
+        - name: accession
+          editable: 1
+        - name: description
+          editable: 1
+        - name: cvterm_id
+          editable: 1
+    organism:
+      editable: 1
+      display_field: full_name
+      order_by:
+        - scientific_name
+      field_info_list:
+        - name: scientific_name
+          editable: 1
+    organism_report:
+      extends: organism
+      '+field_info_list':
+        - name: Number of genes
+          source:
+            sql: 'select count(*) from gene where gene.organism = me.organism_id'
+    person:
+      object_title_format: 'Details for @@DISPLAY_FIELD@@'
+      editable: 1
+      display_field: name
+      order_by: name
+      search_fields:
+        - email_address
+        - name
+        - orcid
+      field_info_list:
+        - name: name
+          source: name
+          editable: 1
+        - name: orcid
+          editable: 1
+        - name: known_as
+          editable: 1
+        - name: email_address
+          editable: 1
+        - name: role
+          default_value: "'user'"
+          values_constraint: 'where me.cv_id = (SELECT cv_id FROM cv where cv.name = "Canto user types")'
+          editable: 1
+          admin_only: 1
+        - name: Sessions
+          source:
+            sql: "select count(curs) from curs_curator cc1 where cc1.curator = person_id and curs_curator_id = (select max(curs_curator_id) from curs_curator cc2 where cc2.curs = cc1.curs)"
+        - name: Approved sessions
+          source:
+            sql: "select count(curs) from curs_curator cc1 where cc1.curator = person_id and curs_curator_id = (select max(curs_curator_id) from curs_curator cc2 where cc2.curs = cc1.curs) and cc1.curs in (select curs_id from curs where curs_id in (select curs from cursprop p join cvterm t on p.type = t.cvterm_id where t.name = 'annotation_status' and p.value = 'APPROVED'))"
+        - name: password
+          editable: 1
+          admin_only: 1
+    lab:
+      editable: 1
+      display_field: name
+      order_by: name
+      field_info_list:
+        - name: name
+          editable: 1
+        - name: lab_head
+          editable: 1
+        - name: people
+          is_collection: 1
+          editable: 1
+    pub:
+      object_title_format: 'Details for publication: @@$object->uniquename()@@'
+      class_display_name: publication
+      display_field: 'Publication ID'
+      search_fields:
+        - uniquename
+      editable: 1
+      # hack to order by pubmed id, or by doi number
+      order_by: "cast((case me.uniquename like 'PMID:%' WHEN 1 THEN substr(me.uniquename, 6) ELSE me.uniquename END) as integer)"
+      field_info_list:
+        - name: 'Publication ID'
+          source: uniquename
+        - name: title
+        - name: authors
+        - name: abstract
+          extra_field_class: non-important-attribute-field
+          hide_context:
+            - list
+            - inline_list
+        - name: citation
+          hide_context:
+            - list
+            - inline_list
+        - name: publication_date
+          hide_context:
+            - list
+            - inline_list
+        - name: affiliation
+          hide_context:
+            - list
+            - inline_list
+        - name: corresponding_author
+          editable: 1
+        - name: current_curator
+          referenced_class: Person
+          source:
+            sql: "select curator from curs_curator where curs_curator_id = (select max(curs_curator_id) from curs_curator cc, curs c where cc.curs = c.curs_id and c.pub = me.pub_id)"
+        - name: session_first_sent
+          source:
+            sql: "select (case when (value is null) THEN 'no' ELSE value END) from curs, cursprop p, cvterm t where me.pub_id = curs.pub and curs.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'link_sent_to_curator_date' order by value"
+          default: no
+          editable: 0
+        - name: session_last_sent
+          source:
+            sql: "select (case when (value is null) THEN 'no' ELSE value END) from curs, cursprop p, cvterm t where me.pub_id = curs.pub and curs.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'link_sent_to_curator_date' order by value DESC"
+          default: no
+          editable: 0
+        - name: session_sent_count
+          source:
+            sql: "cast((select count(value) from curs, cursprop p, cvterm t where me.pub_id = curs.pub and curs.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'link_sent_to_curator_date') as int)"
+        # - name: type
+        #   source: type_id
+        #   values_constraint: 'where me.cv_id = (SELECT cv_id FROM cv where cv.name = "Canto publication type")'
+        #   referenced_class: Cvterm
+        #   editable: 1
+        - name: session_status
+          source:
+            sql: "select value from curs, cursprop p, cvterm t where me.pub_id = curs.pub and curs.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'annotation_status'"
+          editable: 0
+        - name: approver_name
+          source:
+            sql: "select value from curs, cursprop p, cvterm t where me.pub_id = curs.pub and curs.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'approver_name'"
+          editable: 0
+        - name: load_type
+          source: load_type_id
+          values_constraint: 'where me.cv_id = (SELECT cv_id FROM cv where cv.name = "Canto publication load types")'
+          referenced_class: Cvterm
+          editable: 1
+          hide_context:
+            - list
+            - inline_list
+        - name: triage_status
+          source: triage_status_id
+          values_constraint: 'where me.cv_id = (SELECT cv_id FROM cv where cv.name = "Canto publication triage status")'
+          referenced_class: Cvterm
+          editable: 1
+          hide_context:
+            - inline_list
+        - name: curation_priority
+          source: curation_priority_id
+          values_constraint: 'where me.cv_id = (SELECT cv_id FROM cv where cv.name = "Canto curation priorities")'
+          referenced_class: Cvterm
+          editable: 1
+    pub_curation_status:
+      class_display_name: publication curation status
+      display_field: status_id
+      editable: 1
+      field_info_list:
+        - name: publication
+          source: pub_id
+          editable: 1
+        - name: annotation_type
+          editable: 1
+        - name: status
+          source: status_id
+          values_constraint: 'where me.cv_id = (SELECT cv_id FROM cv where cv.name = "Canto publication curation status")'
+          referenced_class: Cvterm
+          editable: 1
+    pubprop:
+      class_display_name: publication properties
+      display_field: value
+      editable: 1
+      field_info_list:
+        - name: publication
+          source: pub_id
+          editable: 1
+        - name: type_id
+          values_constraint: 'where me.cv_id = (SELECT cv_id FROM cv where cv.name = "Canto publication experiment types")'
+          referenced_class: Cvterm
+          editable: 1
+        - name: value
+          editable: 1
+    curs:
+      class_display_name: curation session
+      display_field: curs_key
+      editable: 0
+      field_info_list:
+        - name: curs_key
+          editable: 0
+        - name: publication
+          editable: 0
+          source: pub
+        - name: creation_date
+          editable: 0
+        - name: current_curator
+          referenced_class: Person
+          source:
+            sql: "select curator from curs_curator where curs_curator_id = (select max(curs_curator_id) from curs_curator where curs = me.curs_id)"
+        - name: accepted
+          source:
+            sql: "select (case when (accepted_date is null) THEN 'no' ELSE accepted_date END) from curs_curator where curs_curator_id = (select max(curs_curator_id) from curs_curator where curs = me.curs_id)"
+        - name: last_assigned
+          source:
+            sql: "select creation_date from curs_curator where curs_curator_id = (select max(curs_curator_id) from curs_curator where curs = me.curs_id)"
+        - name: last_sent_date
+          source:
+            sql: "select value from cursprop p, cvterm t where me.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'link_sent_to_curator_date' order by value DESC"
+        - name: session_sent_count
+          source:
+            sql: "cast((select count(value) from cursprop p, cvterm t where me.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'link_sent_to_curator_date') as int)"
+        - name: status
+          source:
+            sql: "select value from cursprop p, cvterm t where me.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'annotation_status'"
+        - name: approver_name
+          source:
+            sql: "select value from cursprop p, cvterm t where me.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'approver_name'"
+        - name: genes_added
+          source:
+            sql: "cast((select value from cursprop p, cvterm t where me.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'session_genes_count') as int)"
+        - name: term_suggestions
+          source:
+            sql: "cast((select value from cursprop p, cvterm t where me.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'session_term_suggestions_count') as int)"
+# if the hook dies the creation fails
+      pre_create_hook: 'Canto::Track::create_curs_db_hook'
+    cursprop:
+      class_display_name: Session properties
+      editable: 1
+      field_info_list:
+        - name: type
+          values_constraint: 'where me.cv_id = (SELECT cv_id FROM cv where cv.name = "Canto cursprop types")'
+          referenced_class: Cvterm
+          editable: 1
+        - name: value
+          editable: 1
+        - name: curs
+          editable: 1
+    curs_curator:
+      class_display_name: Session curator
+      editable: 1
+      field_info_list:
+        - name: curs
+          editable: 1
+        - name: curator
+          editable: 1
+    gene:
+      editable: 1
+      display_field: primary_identifier
+      search_fields:
+        - primary_identifier
+        - primary_name
+        - product
+      field_info_list:
+        - name: primary_identifier
+          editable: 1
+        - name: primary_name
+          editable: 1
+        - name: product
+          editable: 1
+        - name: genesynonyms
+          editable: 1
+          is_collection: 1
+        - name: organism
+          editable: 1
+    genesynonym:
+      editable: 1
+      display_field: identifier
+      field_info_list:
+        - name: identifier
+          editable: 1
+        - name: gene
+          editable: 1
+    named_genes:
+      extends: gene
+      constraint: "primary_name is not null"
+
+    all_publications:
+      extends: pub
+    curated_publications:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'NEEDS_APPROVAL' or p.value = 'APPROVAL_IN_PROGRESS' or p.value ='APPROVED')))"
+    high_priority_publications:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'HIGH_PRIORITY')"
+    high_priority_publications_with_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'HIGH_PRIORITY')"
+    high_priority_publications_with_approved_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'APPROVED')) and triage_status_id in (select cvterm_id from cvterm where name = 'HIGH_PRIORITY')"
+    high_priority_publications_with_multiple_sessions:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'HIGH_PRIORITY') and exists (select * from curs c1, curs c2 where c1.pub = me.pub_id and c2.pub = me.pub_id and c1.curs_id <> c2.curs_id)"
+    high_priority_publications_without_sessions:
+      extends: pub
+      constraint: "pub_id not in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'HIGH_PRIORITY')"
+    high_priority_publications_with_new_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'SESSION_CREATED')) and triage_status_id in (select cvterm_id from cvterm where name = 'HIGH_PRIORITY')"
+    high_priority_publications_with_active_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'SESSION_ACCEPTED' or p.value = 'CURATION_IN_PROGRESS' or p.value = 'CURATION_PAUSED'))) and triage_status_id in (select cvterm_id from cvterm where name = 'HIGH_PRIORITY')"
+    disease_publications:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'DISEASE')"
+    disease_publications_with_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'DISEASE')"
+    disease_publications_with_approved_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'APPROVED')) and triage_status_id in (select cvterm_id from cvterm where name = 'DISEASE')"
+    disease_publications_with_multiple_sessions:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'DISEASE') and exists (select * from curs c1, curs c2 where c1.pub = me.pub_id and c2.pub = me.pub_id and c1.curs_id <> c2.curs_id)"
+    disease_publications_without_sessions:
+      extends: pub
+      constraint: "pub_id not in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'DISEASE')"
+    disease_publications_with_new_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'SESSION_CREATED')) and triage_status_id in (select cvterm_id from cvterm where name = 'DISEASE')"
+    disease_publications_with_active_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'SESSION_ACCEPTED' or p.value = 'CURATION_IN_PROGRESS' or p.value = 'CURATION_PAUSED'))) and triage_status_id in (select cvterm_id from cvterm where name = 'DISEASE')"
+    pheno_publications:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'PHENO')"
+    pheno_publications_with_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO')"
+    pheno_publications_with_approved_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'APPROVED')) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO')"
+    pheno_publications_with_multiple_sessions:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'PHENO') and exists (select * from curs c1, curs c2 where c1.pub = me.pub_id and c2.pub = me.pub_id and c1.curs_id <> c2.curs_id)"
+    pheno_publications_without_sessions:
+      extends: pub
+      constraint: "pub_id not in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO')"
+    pheno_publications_with_new_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'SESSION_CREATED')) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO')"
+    pheno_publications_with_active_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'SESSION_ACCEPTED' or p.value = 'CURATION_IN_PROGRESS' or p.value = 'CURATION_PAUSED'))) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO')"
+    pheno_anat_publications:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_ANAT')"
+    pheno_anat_publications_with_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_ANAT')"
+    pheno_anat_publications_with_approved_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'APPROVED')) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_ANAT')"
+    pheno_anat_publications_with_multiple_sessions:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_ANAT') and exists (select * from curs c1, curs c2 where c1.pub = me.pub_id and c2.pub = me.pub_id and c1.curs_id <> c2.curs_id)"
+    pheno_anat_publications_without_sessions:
+      extends: pub
+      constraint: "pub_id not in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_ANAT')"
+    pheno_anat_publications_with_new_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'SESSION_CREATED')) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_ANAT')"
+    pheno_anat_publications_with_active_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'SESSION_ACCEPTED' or p.value = 'CURATION_IN_PROGRESS' or p.value = 'CURATION_PAUSED'))) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_ANAT')"
+    pheno_chem_publications:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_CHEM')"
+    pheno_chem_publications_with_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_CHEM')"
+    pheno_chem_publications_with_approved_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'APPROVED')) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_CHEM')"
+    pheno_chem_publications_with_multiple_sessions:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_CHEM') and exists (select * from curs c1, curs c2 where c1.pub = me.pub_id and c2.pub = me.pub_id and c1.curs_id <> c2.curs_id)"
+    pheno_chem_publications_without_sessions:
+      extends: pub
+      constraint: "pub_id not in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_CHEM')"
+    pheno_chem_publications_with_new_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'SESSION_CREATED')) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_CHEM')"
+    pheno_chem_publications_with_active_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'SESSION_ACCEPTED' or p.value = 'CURATION_IN_PROGRESS' or p.value = 'CURATION_PAUSED'))) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_CHEM')"
+    pheno_dataset_publications:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_DATASET')"
+    pheno_dataset_publications_with_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_DATASET')"
+    pheno_dataset_publications_with_approved_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'APPROVED')) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_DATASET')"
+    pheno_dataset_publications_with_multiple_sessions:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_DATASET') and exists (select * from curs c1, curs c2 where c1.pub = me.pub_id and c2.pub = me.pub_id and c1.curs_id <> c2.curs_id)"
+    pheno_dataset_publications_without_sessions:
+      extends: pub
+      constraint: "pub_id not in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_DATASET')"
+    pheno_dataset_publications_with_new_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'SESSION_CREATED')) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_DATASET')"
+    pheno_dataset_publications_with_active_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'SESSION_ACCEPTED' or p.value = 'CURATION_IN_PROGRESS' or p.value = 'CURATION_PAUSED'))) and triage_status_id in (select cvterm_id from cvterm where name = 'PHENO_DATASET')"
+    low_priority_publications:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'LOW_PRIORITY')"
+    low_priority_publications_with_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'LOW_PRIORITY')"
+    low_priority_publications_with_approved_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'APPROVED')) and triage_status_id in (select cvterm_id from cvterm where name = 'LOW_PRIORITY')"
+    low_priority_publications_with_multiple_sessions:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'LOW_PRIORITY') and exists (select * from curs c1, curs c2 where c1.pub = me.pub_id and c2.pub = me.pub_id and c1.curs_id <> c2.curs_id)"
+    low_priority_publications_without_sessions:
+      extends: pub
+      constraint: "pub_id not in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'LOW_PRIORITY')"
+    low_priority_publications_with_new_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'SESSION_CREATED')) and triage_status_id in (select cvterm_id from cvterm where name = 'LOW_PRIORITY')"
+    low_priority_publications_with_active_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'SESSION_ACCEPTED' or p.value = 'CURATION_IN_PROGRESS' or p.value = 'CURATION_PAUSED'))) and triage_status_id in (select cvterm_id from cvterm where name = 'LOW_PRIORITY')"
+    training_publications:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'TRAINING')"
+    training_publications_with_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'TRAINING')"
+    training_publications_with_approved_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'APPROVED')) and triage_status_id in (select cvterm_id from cvterm where name = 'TRAINING')"
+    training_publications_with_multiple_sessions:
+      extends: pub
+      constraint: "triage_status_id in (select cvterm_id from cvterm where name = 'TRAINING') and exists (select * from curs c1, curs c2 where c1.pub = me.pub_id and c2.pub = me.pub_id and c1.curs_id <> c2.curs_id)"
+    training_publications_without_sessions:
+      extends: pub
+      constraint: "pub_id not in (select pub from curs) and triage_status_id in (select cvterm_id from cvterm where name = 'TRAINING')"
+    training_publications_with_new_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'SESSION_CREATED')) and triage_status_id in (select cvterm_id from cvterm where name = 'TRAINING')"
+    training_publications_with_active_sessions:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'SESSION_ACCEPTED' or p.value = 'CURATION_IN_PROGRESS' or p.value = 'CURATION_PAUSED'))) and triage_status_id in (select cvterm_id from cvterm where name = 'TRAINING')"
+
+    publications_with_session_needing_approval:
+      extends: pub
+      '+field_info_list':
+        - name: last_status_change
+          source:
+            sql: "select value from curs, cursprop p, cvterm t where me.pub_id = curs.pub and curs.curs_id = p.curs and t.cvterm_id = p.type and t.name = 'annotation_status_datestamp'"
+          editable: 0
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'NEEDS_APPROVAL' or p.value = 'APPROVAL_IN_PROGRESS')))"
+    publications_with_approved_session:
+      extends: pub
+      constraint: "pub_id in (select pub from curs where curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'APPROVED'))"
+    sessions_needing_approval:
+      extends: curs
+      constraint: "me.curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'NEEDS_APPROVAL' or p.value = 'APPROVAL_IN_PROGRESS'))"
+    sessions_without_a_curator:
+      extends: curs
+      constraint: "me.curs_id not in (select curs from curs_curator)"
+    exported_sessions:
+      extends: curs
+      constraint: "me.curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'EXPORTED')"
+    sessions_with_term_requests:
+      extends: curs
+      constraint: "me.curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'CURATION_IN_PROGRESS' or p.value = 'CURATION_PAUSED' or p.value = 'NEEDS_APPROVAL' or p.value = 'APPROVAL_IN_PROGRESS')) and me.curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'session_term_suggestions_count' and value > 0)"
+    reactivated_sessions:
+      extends: curs
+      constraint: "me.curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and (p.value = 'CURATION_IN_PROGRESS')) and me.curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'session_reactivated_timestamp')"
+    approved_sessions:
+      extends: curs
+      constraint: "me.curs_id in (select curs from cursprop p, cvterm t where t.cvterm_id = p.type and t.name = 'annotation_status' and p.value = 'APPROVED')"
+    all_sessions:
+      extends: curs
+
+  chado:
+    chadoprop:
+      class_display_name: chado properties
+      editable: 0
+      display_field: value
+      field_info_list:
+        - name: type
+          source: type_id
+          referenced_class: Cvterm
+        - name: value
+          editable: 0
+    cv:
+      class_display_name: controlled vocabulary
+      editable: 1
+      display_field: name
+      field_info_list:
+        - name: name
+          editable: 1
+        - name: definition
+          editable: 1
+        - name: "terms in this CV"
+          source:
+            sql: 'select count(*) from cvterm where cvterm.cv_id = me.cv_id'
+        - name: "terms used"
+          source:
+            sql: 'select count(*) from cvterm c where c.cv_id = me.cv_id and c.cvterm_id in (select cvterm_id from feature_cvterm)'
+        - name: "annotation count"
+          source:
+            sql: 'select count(*) from feature_cvterm fc, cvterm c where fc.cvterm_id = c.cvterm_id and c.cv_id = me.cv_id'
+    cvterm:
+      class_display_name: controlled vocabulary term
+      editable: 1
+      display_field: name
+      field_info_list:
+        - name: name
+          editable: 1
+        - name: definition
+          editable: 1
+        - name: cv
+          source: cv_id
+          editable: 1
+        - name: dbxref_id
+          editable: 1
+        - name: "features annotated with this term"
+          source:
+            sql: 'select count(*) from feature_cvterm fc where fc.cvterm_id = me.cvterm_id'
+    organism:
+      editable: 1
+      display_field: full_name
+      order_by:
+        - genus
+        - species
+      field_info_list:
+        - name: genus
+          editable: 1
+        - name: species
+          editable: 1
+    pub:
+      object_title_format: 'Details for publication ID: @@$object->uniquename()@@'
+      class_display_name: publication
+      display_field: title
+      editable: 1
+      field_info_list:
+        - name: title
+          editable: 1
+        - name: uniquename
+          editable: 1
+        - name: type
+          source: type_id
+          values_constraint: 'where me.cv_id = (SELECT cv_id FROM cv where cv.name = "genedb_literature")'
+          referenced_class: Cvterm
+          editable: 1
+    feature:
+      editable: 1
+      display_field: uniquename
+      search_fields:
+        - uniquename
+        - name
+      field_info_list:
+        - name: uniquename
+          editable: 1
+        - name: name
+          editable: 1
+        - name: type
+          source: type_id
+          values_constraint: 'where me.cv_id = (SELECT cv_id FROM cv where cv.name = "sequence")'
+          referenced_class: Cvterm
+          editable: 1
+        - name: featureprops
+          is_collection: 1
+          editable: 1
+    featureprop:
+      editable: 1
+      display_field: value
+      field_info_list:
+        - name: type
+          source: type_id
+          referenced_class: Cvterm
+        - name: value
+          editable: 1
+    db:
+      editable: 1
+      display_field: name
+      field_info_list:
+        - name: name
+          editable: 1
+        - name: description
+          editable: 1
+        - name: url
+          editable: 1
+        - name: "accessions stored"
+          source:
+            sql: 'select count(*) from dbxref where dbxref.db_id = me.db_id'
+    dbxref:
+      editable: 1
+      display_field: accession
+      field_info_list:
+        - name: db_id
+          editable: 1
+        - name: accession
+          editable: 1
+        - name: description
+          editable: 1
+    genes:
+      extends: feature
+      constraint: "type_id = (select cvterm_id from cvterm, cv where cvterm.name = 'gene' and cvterm.cv_id = cv.cv_id and cv.name = 'sequence')"
+    pombe_genes:
+      class_display_name: S. pombe genes
+      extends: feature
+      constraint: "type_id = (select cvterm_id from cvterm, cv where cvterm.name = 'gene' and cvterm.cv_id = cv.cv_id and cv.name = 'sequence') and organism_id = (select organism_id from organism where genus = 'Schizosaccharomyces' and species = 'pombe')"
+    protein_and_domain_terms:
+      class_display_name: PomBase family or domain terms
+      extends: cvterm
+      constraint: "cv_id = (select cv_id from cv where cv.name = 'PomBase family or domain')"
+    types_and_counts:
+      class_display_name: SO DNA feature types and counts
+      constraint: "(select count(*) from feature where type_id = me.cvterm_id) > 0"
+      display_field: name
+      extends: cvterm
+      field_info_list:
+        - name: name
+          editable: 1
+        - name: cv
+          source: cv_id
+          editable: 1
+        - name: "features of this type"
+          as: count
+          source:
+            sql: 'select count(*) from feature where type_id = me.cvterm_id'
+
+reports:
+  track:
+    - report: all_publications
+      children:
+        - report: high_priority_publications
+          children:
+            - report: high_priority_publications_with_sessions
+              children:
+               - report: high_priority_publications_with_new_sessions
+               - report: high_priority_publications_with_active_sessions
+               - report: high_priority_publications_with_approved_sessions
+               - report: high_priority_publications_with_multiple_sessions
+            - report: high_priority_publications_without_sessions
+        - report: disease_publications
+          children:
+            - report: disease_publications_with_sessions
+              children:
+               - report: disease_publications_with_new_sessions
+               - report: disease_publications_with_active_sessions
+               - report: disease_publications_with_approved_sessions
+               - report: disease_publications_with_multiple_sessions
+            - report: disease_publications_without_sessions
+        - report: pheno_publications
+          children:
+            - report: pheno_publications_with_sessions
+              children:
+               - report: pheno_publications_with_new_sessions
+               - report: pheno_publications_with_active_sessions
+               - report: pheno_publications_with_approved_sessions
+               - report: pheno_publications_with_multiple_sessions
+            - report: pheno_publications_without_sessions
+        - report: pheno_anat_publications
+          children:
+            - report: pheno_anat_publications_with_sessions
+              children:
+               - report: pheno_anat_publications_with_new_sessions
+               - report: pheno_anat_publications_with_active_sessions
+               - report: pheno_anat_publications_with_approved_sessions
+               - report: pheno_anat_publications_with_multiple_sessions
+            - report: pheno_anat_publications_without_sessions
+        - report: pheno_chem_publications
+          children:
+            - report: pheno_chem_publications_with_sessions
+              children:
+               - report: pheno_chem_publications_with_new_sessions
+               - report: pheno_chem_publications_with_active_sessions
+               - report: pheno_chem_publications_with_approved_sessions
+               - report: pheno_chem_publications_with_multiple_sessions
+            - report: pheno_chem_publications_without_sessions
+        - report: pheno_dataset_publications
+          children:
+            - report: pheno_dataset_publications_with_sessions
+              children:
+               - report: pheno_dataset_publications_with_new_sessions
+               - report: pheno_dataset_publications_with_active_sessions
+               - report: pheno_dataset_publications_with_approved_sessions
+               - report: pheno_dataset_publications_with_multiple_sessions
+            - report: pheno_dataset_publications_without_sessions
+        - report: low_priority_publications
+          children:
+            - report: low_priority_publications_with_sessions
+              children:
+               - report: low_priority_publications_with_new_sessions
+               - report: low_priority_publications_with_active_sessions
+               - report: low_priority_publications_with_approved_sessions
+               - report: low_priority_publications_with_multiple_sessions
+            - report: low_priority_publications_without_sessions
+        - report: training_publications
+          children:
+            - report: training_publications_with_sessions
+              children:
+               - report: training_publications_with_new_sessions
+               - report: training_publications_with_active_sessions
+               - report: training_publications_with_approved_sessions
+               - report: training_publications_with_multiple_sessions
+            - report: training_publications_without_sessions
+    - report: all_sessions
+      children:
+        - report: approved_sessions
+        - report: exported_sessions
+        - report: sessions_needing_approval
+        - report: reactivated_sessions
+        - report: sessions_without_a_curator
+
+
+curs_config:
+  # Possible reasons for a paper to have no phenotype annotation in the case
+  # where genes are mentioned.
+  no_annotation_reasons:
+    - No phenotypic data
+    - Only pheno_chem data
+    - Other
diff --git a/extension_config-Rscript/list-to-extension_config.R b/extension_config-Rscript/list-to-extension_config.R
index b8e7800..a4beb28 100644
--- a/extension_config-Rscript/list-to-extension_config.R
+++ b/extension_config-Rscript/list-to-extension_config.R
@@ -7,6 +7,7 @@
     # GO CC - GO:0005575.
 # extension_config.tsv only uses IDs and, therefore, qualifier namespaces must be converted into their topterm IDs, whcih requires screening the FBcv obo file.
 
+rm(list=ls())
 #set work directory as canto-space
 setwd("./")
 getwd()
@@ -101,25 +102,31 @@ colnames(Df1)<-c("domain ID", "subset relation", "extension relation", "range ID
 #read file with list of allowed qualifiers (on "allowed_qualifiers.tsv")
 quallist<-read.table("./extension_config-Rscript/allowed_qualifiers.tsv", sep="\t", header=TRUE, stringsAsFactors=FALSE)
 
-count<-1
 #for each type of allowed qualifier, replace the namespace with corresponding top term with that namespace
+count<-1
+phenpos<-c()
 for(m in 1:nrow(quallist)){
   phen<-unlist(strsplit(quallist[m,3],","))
+  phenqual1<-c()
   for(l in 1:length(phen)){
-    phen[l]<-Df[which(Df[,3]==phen[l]&Df[,5]==phen[l]&is.na(Df[,6])==TRUE),1]
+    phenpos<-which(Df[,3]==phen[l]&Df[,5]==phen[l]&is.na(Df[,6])==TRUE)
+    phenqual<-c()
+    for(l1 in 1:length(phenpos)){
+      phenqual[l1]<-Df[phenpos[l1],1]
+    }
+    phenqual1[l]<-paste(phenqual,collapse = "|")
   }
-  
   if(quallist[m,2]=='phenotype'){
     #if the annotations are for 'phenotypic class' (FBcv:0000347) then:
     # a) the single term 'progressive' shoud be allowed
     if(quallist[m,1]==Df[which(Df[,2]=="phenotypic class"),1]){
       Df1[count,1]<-quallist[m,1]
-      phen<-append(phen, Df[which(Df[,2]=="progressive"), 1])
-      Df1[count,4]<-paste(phen,collapse = '|')
+      phenqual1<-append(phenqual1, Df[which(Df[,2]=="progressive"), 1])
+      Df1[count,4]<-paste(phenqual1,collapse = '|')
       count<-count+1
     # b) and 'the 'fertility/sterility terms must not allow developmental stage terms
     ##once the ontology file is updated so that all viability/mortality/life-span terms are under a common parent term, this next bit should be updated
-      viable<-c("viable","increased mortality","long lived")
+      viable<-c("viable","increased mortality during development","short lived","long lived")
       for (n in 1:length(viable)){ 
       viable[n]<-Df[which(Df[,2]==viable[n]),1]
       }
@@ -138,7 +145,7 @@ for(m in 1:nrow(quallist)){
     }
   else{
     Df1[count,1]<-quallist[m,1]
-    Df1[count,4]<-paste(phen, collapse = '|')
+    Df1[count,4]<-paste(phenqual1, collapse = '|')
     count<-count+1
     Df1[count,1]<-quallist[m,1]
     Df1[count,4]<-"FBdv:00007008"
@@ -150,7 +157,7 @@ for(m in 1:nrow(quallist)){
   }
   if(quallist[m,2]=='genetic interaction'){
     Df1[count,1]<-quallist[m,1]
-    Df1[count,4]<-paste(phen, collapse = '|')
+    Df1[count,4]<-paste(phenqual1, collapse = '|')
     Df1[count,3]<-"int_qual"
     Df1[count,5]<-"Interaction qualifier - ONLY USE FOR INTERACTIONS"
     count<-count+1
@@ -173,4 +180,5 @@ if (is.na(Df1[j,8])==TRUE){Df1[j,8]<-as.character("user")}
   else{}
 }
 
-write.table(Df1, file = "./canto/extension_config.tsv", sep='\t', quote= FALSE, row.names = FALSE)
\ No newline at end of file
+write.table(Df1, file = "./canto/extension_config.tsv", sep='\t', quote= FALSE, row.names = FALSE)
+#for each type of allowed qualifier, replace the namespace with corresponding top term with that namespace
diff --git a/starting-pack.sh b/starting-pack.sh
old mode 100755
new mode 100644
index 85c9eda..6d7e076
--- a/starting-pack.sh
+++ b/starting-pack.sh
@@ -1,4 +1,5 @@
-#!/bin/sh
+#!/bin/bash
+#This must be run in sudo mode, by typing 'sudo -i' and then typing your sudo password
 
 #before start, add the content of the folder 'starting-pack' to ./canto-space/
 #run this @ /canto-space/
@@ -17,7 +18,7 @@ cp canto-docker-initd /sbin/
 chmod a+x /sbin/canto-docker-initd
 cp canto-docker-initd ./canto/etc/
 chmod a+x ./canto/etc/canto-docker-initd
-#rm canto-docker-initd
+rm canto-docker-initd
 
 ##create a 'canto' file @ /etc/init.d
 ##and make it executable
@@ -27,27 +28,40 @@ chmod a+x /etc/init.d/canto
 
 #enable memcached - for caching of the servers 
 ##comment for vitor: not sure it needs more stuff - ask Kim??
-sudo apt-get install memcached
-
-
-#start canto
-/etc/init.d/canto start
+apt-get install memcached
 
 
 #this loop creates cv terms for all the range of values for the 'priority curation score' within the internal canto database: 0-36
 for i in {0..36}; do 
-    ./canto/script/canto_docker ./script/canto_add.pl --cvterm "Canto curation priorities" "${i}" "FB:cantoscore${i}"
+score="./canto/script/canto_docker ./script/canto_add.pl --cvterm \"Canto curation priorities\" "$i" FB:cantoscore"$i;
+$score
 done
 
 
+this section will create CV terms for triage statuses, so that the publication list can be sub-divifed into more specific lists. This list is the current in use for phenotype curation (e.g. disease, pheno, training, etc).
+./canto/script/canto_docker ./script/canto_add.pl --cvterm "Canto publication triage status" "DISEASE"
+./canto/script/canto_docker ./script/canto_add.pl --cvterm "Canto publication triage status" "PHENO"
+./canto/script/canto_docker ./script/canto_add.pl --cvterm "Canto publication triage status" "PHENO_ANAT"
+./canto/script/canto_docker ./script/canto_add.pl --cvterm "Canto publication triage status" "PHENO_CHEM"
+./canto/script/canto_docker ./script/canto_add.pl --cvterm "Canto publication triage status" "PHENO_DATASET"
+./canto/script/canto_docker ./script/canto_add.pl --cvterm "Canto publication triage status" "LOW_PRIORITY"
+./canto/script/canto_docker ./script/canto_add.pl --cvterm "Canto publication triage status" "TRAINING"
+./canto/script/canto_docker ./script/canto_add.pl --cvterm "Canto publication triage status" "HIGH_PRIORITY"
+
+
 #configure the taxon (Drosophila melanogaster)
-./canto/script/canto_docker ./script/canto_add.pl --organism "Drosophila melanogaster" 7227 "[fruit fly]"
+./canto/script/canto_docker ./script/canto_add.pl --organism "Drosophila melanogaster" 7227 [fruit fly]
 
-# Create a user
-./canto/script/canto_docker ./script/canto_add.pl --person "Firstname Lastname" spqr1@cam.ac.uk <password> 0000-0002-8728-0281 admin
+
+#add the 'mock' user "FlyBase Curator" (email address ignore@flybase.org), which will be used for publication data import
+./canto/script/canto_docker ./script/canto_add.pl --person "FlyBase Curator" ignore@flybase.org pass  admin
+
+
+#start canto
+/etc/init.d/canto start
 
 
 #run the weekly routine script which executes all configuration steps
-# sh weekly_routine.sh
+bash weekly_routine.sh
 
 
-- 
GitLab