<commit_before>Feature: Producing a annotation view of a scaffold
  In order to submit genome annotations
  A user can use the "table" command
  to generate the genbank annotation table format

  @disable-bundler
  Scenario: Generating a table file from a single annotation
    Given I successfully run `genomer init project`
      And I cd to "project"
      And I write to "assembly/scaffold.yml" with:
        """
        ---
          - sequence:
              source: contig1
        """
      And I write to "assembly/sequence.fna" with:
        """
        >contig1
        AAAAATTTTTGGGGGCCCCC
        """
      And I write to "assembly/annotations.gff" with:
        """
        ##gff-version 3
        contig1	.	gene	1	3	.	+	1	.
        """
      And I append to "Gemfile" with:
        """
        gem 'genomer-plugin-view', :path => '../../../'
        """
     When I run `genomer view table --identifier=genome`
     Then the exit status should be 0
      And the output should contain:
        """
        >Feature	genome	annotation_table
        1	3	gene

        """

  @disable-bundler
  Scenario: Generating a table file from two annotations
    Given I successfully run `genomer init project`
      And I cd to "project"
      And I write to "assembly/scaffold.yml" with:
        """
        ---
          - sequence:
              source: contig1
        """
      And I write to "assembly/sequence.fna" with:
        """
        >contig1
        AAAAATTTTTGGGGGCCCCC
        """
      And I write to "assembly/annotations.gff" with:
        """
        ##gff-version 3
        contig1	.	gene	1	3	.	+	1	
        contig1	.	gene	4	6	.	+	1	
        """
      And I append to "Gemfile" with:
        """
        gem 'genomer-plugin-view', :path => '../../../'
        """
     When I run `genomer view table --identifier=genome`
     Then the exit status should be 0
      And the output should contain:
        """
        >Feature	genome	annotation_table
        1	3	gene
        4	6	gene

        """

<commit_msg>Add features for updating the annotation id attributes<commit_after>Feature: Producing a annotation view of a scaffold
  In order to submit genome annotations
  A user can use the "table" command
  to generate the genbank annotation table format

  @disable-bundler
  Scenario: Generating a table file from a single annotation
    Given I successfully run `genomer init project`
      And I cd to "project"
      And I write to "assembly/scaffold.yml" with:
        """
        ---
          - sequence:
              source: contig1
        """
      And I write to "assembly/sequence.fna" with:
        """
        >contig1
        AAAAATTTTTGGGGGCCCCC
        """
      And I write to "assembly/annotations.gff" with:
        """
        ##gff-version 3
        contig1	.	gene	1	3	.	+	1	.
        """
      And I append to "Gemfile" with:
        """
        gem 'genomer-plugin-view', :path => '../../../'
        """
     When I run `genomer view table --identifier=genome`
     Then the exit status should be 0
      And the output should contain:
        """
        >Feature	genome	annotation_table
        1	3	gene

        """

  @disable-bundler
  Scenario: Generating a table file from two annotations
    Given I successfully run `genomer init project`
      And I cd to "project"
      And I write to "assembly/scaffold.yml" with:
        """
        ---
          - sequence:
              source: contig1
        """
      And I write to "assembly/sequence.fna" with:
        """
        >contig1
        AAAAATTTTTGGGGGCCCCC
        """
      And I write to "assembly/annotations.gff" with:
        """
        ##gff-version 3
        contig1	.	gene	1	3	.	+	1	
        contig1	.	gene	4	6	.	+	1	
        """
      And I append to "Gemfile" with:
        """
        gem 'genomer-plugin-view', :path => '../../../'
        """
     When I run `genomer view table --identifier=genome`
     Then the exit status should be 0
      And the output should contain:
        """
        >Feature	genome	annotation_table
        1	3	gene
        4	6	gene

        """


  @disable-bundler
  Scenario: Generating a table file from an annotation with attributes
  Given I successfully run `genomer init project`
    And I cd to "project"
    And I write to "assembly/scaffold.yml" with:
      """
      ---
        - sequence:
            source: contig1
      """
    And I write to "assembly/sequence.fna" with:
      """
      >contig1
      AAAAATTTTTGGGGGCCCCC
      """
    And I write to "assembly/annotations.gff" with:
      """
      ##gff-version 3
      contig1	.	gene	1	3	.	-	1	ID=gene1
      """
    And I append to "Gemfile" with:
      """
      gem 'genomer-plugin-view', :path => '../../../'
      """
   When I run `genomer view table --identifier=genome`
   Then the exit status should be 0
    And the output should contain:
      """
      >Feature	genome	annotation_table
      3	1	gene
      			locus_tag	gene1

      """

  @disable-bundler
  Scenario: Reseting locus tag numbering at the scaffold origin
    Given I successfully run `genomer init project`
      And I cd to "project"
      And I write to "assembly/scaffold.yml" with:
        """
        ---
          - sequence:
              source: contig1
        """
      And I write to "assembly/sequence.fna" with:
        """
        >contig1
        AAAAATTTTTGGGGGCCCCC
        """
      And I write to "assembly/annotations.gff" with:
        """
        ##gff-version 3
        contig1	.	gene	1	3	.	+	1	ID=gene1
        contig1	.	gene	4	6	.	+	1	ID=gene2
        """
      And I append to "Gemfile" with:
        """
        gem 'genomer-plugin-view', :path => '../../../'
        """
     When I run `genomer view table --identifier=genome --number-from-origin`
     Then the exit status should be 0
      And the output should contain:
        """
        >Feature	genome	annotation_table
        1	3	gene
        			locus_tag	000001
        4	6	gene
        			locus_tag	000002

        """

  @disable-bundler
  Scenario: Reseting locus tag at the scaffold origin with unordered annotations
    Given I successfully run `genomer init project`
      And I cd to "project"
      And I write to "assembly/scaffold.yml" with:
        """
        ---
          - sequence:
              source: contig1
        """
      And I write to "assembly/sequence.fna" with:
        """
        >contig1
        AAAAATTTTTGGGGGCCCCC
        """
      And I write to "assembly/annotations.gff" with:
        """
        ##gff-version 3
        contig1	.	gene	10	12	.	+	1	ID=gene4
        contig1	.	gene	4	6	.	+	1	ID=gene2
        contig1	.	gene	1	3	.	+	1	ID=gene1
        contig1	.	gene	7	9	.	+	1	ID=gene3
        """
      And I append to "Gemfile" with:
        """
        gem 'genomer-plugin-view', :path => '../../../'
        """
     When I run `genomer view table --identifier=genome --number-from-origin`
     Then the exit status should be 0
      And the output should contain:
        """
        >Feature	genome	annotation_table
        1	3	gene
        			locus_tag	000001
        4	6	gene
        			locus_tag	000002
        7	9	gene
        			locus_tag	000003
        10	12	gene
        			locus_tag	000004

        """

{'fraction_non_alphanumeric': 0.0972011581414587, 'fraction_numerical': 0.021232593409623603, 'mean_word_length': 1.6018651362984218, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3269574', 'n_tokens_mistral': 2374, 'n_tokens_neox': 2199, 'n_words': 737}