Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal for a package htsjdk.tribble.gtf #1662

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lindenb
Copy link
Contributor

@lindenb lindenb commented Mar 16, 2023

Hi all,

here is a proposal for a new package htsjdk.tribble.gtf

Description

htsjdk contains a gff3 codec but is still missing a GTF codec. I wrote a few classes parsing the a GTF. Some parts were copied from the gff3 package.

# constants
src/main/java/htsjdk/tribble/gtf/GtfConstants.java

# an interface describing a GTF record
# it comes with default methods to get the gene_id, gene_name, transcript_id, etc...
src/main/java/htsjdk/tribble/gtf/GtfFeature.java

# an implementation of GtfFeature
src/main/java/htsjdk/tribble/gtf/GtfFeatureImpl.java

# the GTF parser
src/main/java/htsjdk/tribble/gtf/GtfCodec.java 

some tests have been added:

# test the properties of GtfFeature
src/test/java/htsjdk/tribble/gtf/GtfFeatureTest.java

# test the Codec
src/test/java/htsjdk/tribble/gtf/GtfCodecTest.java

and some files for the tests were added too:

./src/test/resources/htsjdk/tribble/gtf/gencode.v43.annotation.gtf
./src/test/resources/htsjdk/tribble/gtf/gencode.vM32.annotation.gtf.gz.tbi
./src/test/resources/htsjdk/tribble/gtf/gencode.vM32.annotation.gtf.gz

Comparaison with the gff3 package:

  • some parts were copied from the gff3 package
  • for now I want to keep this simple for a first PR, so there is no implementation of the 'tree' building ( chromosme > gene > transcript > exon > etc... )
  • I didn't implemented the writer, I didn't fully implemented the UTF-8 escaping...

Things to think about before submitting:

  • Make sure your changes compile and new tests pass locally.
  • Add new tests or update existing ones:
    • A bug fix should include a test that previously would have failed and passes now.
    • New features should come with new tests that exercise and validate the new functionality.
  • Extended the README / documentation, if necessary
  • Check your code style.
  • Write a clear commit title and message
    • The commit message should describe what changed and is targeted at htsjdk developers
    • Breaking changes should be mentioned in the commit message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant