GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GenBankWriter does not use information in the original header · Issue #942 · biojava/biojava

GenBankWriter does not use information in the original header #942

New issue
Copy link
New issue
Copy link
Open
Open
GenBankWriter does not use information in the original header#942
Copy link

Description

@jamesmorris
jamesmorris
opened on Jul 12, 2021
Issue body actions

Hello,

I have recently been working on adding an accession ID to a few hundred GenBank files using biojava.

I have been using the following approach:

  1. First reading the GenBank format files into a DNASequence object using GenbankReaderHelper.readGenbankDNASequence(inputStream)
  2. Then adding the new accession ID with the setAccession(new AccessionID("new_accession")) method on the DNASequence object
  3. Finally I use GenbankWriterHelper.writeNucleotideSequence(outputStream, sequences, GenbankWriterHelper.CIRCULAR_DNA) to create an updated GenBank file which includes the new accession

This works for inserting the new accession ID however information is lost in the locus line. As rather than using information from the original file a new locus line is created using default settings.

For example if I update a GenBank file that contains the following original locus line:
LOCUS test_locus_name 9291 BP DS-DNA CIRCULAR SYN 13-JUL-1994

The GenBank file that gets written by the writeNucleotideSequence() method will look like this:
LOCUS new_accession 9291 bp DNA circular 12-Jul-2021

We therefore loose the following:

  • The locus name
  • The double stranded prefix on DNA molecule type
  • The division
  • The original date

I would argue that there should be another way to write a GenBank file from a DNASequence that could use an original header so no information is lost through the processes of reading and writing the same file.

I would be interested to know what you think about this?

Many thanks,
James

Activity

  1. richarda23 commented on Jul 20, 2021

    @richarda23
    richarda23
    on Jul 20, 2021
    Contributor
    More actions

    Hi,
    Looking at Genbank spec and example sample record, there is only 1 field to hold the locus name: https://www.ncbi.nlm.nih.gov/Sitemap/samplerecord.html
    which currently takes the accessionId when writing. So there doesn't seem a way to store the original and new one at the same time? Or are you just expecting the 'ACCESSION' row to change?

    This is the spec from the above link, so I guess what is correct behaviour is a little undefined.

    However, the 10 characters in the locus name are no longer sufficient to represent the amount of information originally intended to be contained in the locus name. The only rule now applied in assigning a locus name is that it must be unique. For example, for GenBank records that have 6-character accessions (e.g., U12345), the locus name is usually the first letter of the genus and species names, followed by the accession number. For 8-character character accessions (e.g., AF123456), the locus name is just the accession number.

    Looking at the GenbankParser, it ignores fields 4 and 5 of the input document LOCUS row and instead generates them from other information gleaned from the sequence - so it does lose the original MoleculeType and Division information?

    There is only 1 field that modification date can be stored. You could argue that you've modified the Genbank record, so the modificationDate should reflect that?

    I suppose a solution might be

    1. to provide an overloaded GenbankWriter method that takes some configuration parameter object to the GenbankWriter with options like 'keepOriginalModificationDate', 'keepOriginalLocus' etc?

    2. Enhance the parse to preserve the original MoleculeType and Division?

  2. josemduarte commented on Oct 19, 2022

    @josemduarte
    josemduarte
    on Oct 19, 2022
    Contributor
    More actions

    Do I understand it right that #1042 fully fixes this issue?

  3. jamesmorris commented on Oct 19, 2022

    @jamesmorris
    jamesmorris
    on Oct 19, 2022
    ContributorAuthor
    More actions

    It fixes the issue with of being able to maintain the locus line details yes

    I need to open another ticket around the other features of a GenBank file header that are not correctly reproduced when using the GenbankWriter that I have discovered while doing this work

  4. josemduarte
    added a commit that references this issue on Oct 26, 2022

    Merge pull request #1042 from jamesmorris/master

    3cece28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.