Giter Club home page Giter Club logo

Comments (8)

sjackman avatar sjackman commented on September 24, 2024

👍 I'll merge a pull request if there are no dissenters.

They could also be used as a hacky solution to add user defined annotations into a file in the same way that javadoc / doxygen use source code comments.

I'd like to avoid this use of comments. I'd suggest that header H records with optional fields should be used for this purpose.

from gfa-spec.

noporpoise avatar noporpoise commented on September 24, 2024

My understanding is that header lines can only appear at the top of a file. Is this true? Spec is unclear.

My use case was that the user might want to bundle in some association between a set of Segments/Links after they have been declared. Example:

# SNP r313131 seg100,link101,seg102/seg200,link201,seg202

This comment is skipped by general GFA tools, but the gives the user the opportunity to extend/abuse the file format without proposing an alteration to the format for their small use case.

from gfa-spec.

sjackman avatar sjackman commented on September 24, 2024

I propose a JSON J record to contain completely arbitrary data.

Column Type Description
1 Character J
2 String JSON

from gfa-spec.

pb-jchin avatar pb-jchin commented on September 24, 2024

I do like to point out JSON is actually quite complicated format (although better than XML for its simplicity). What we need is a restrict set of JSON? A simple example, do we allow \n in the JSON string? If we do, the parser needs to know that.

from gfa-spec.

sjackman avatar sjackman commented on September 24, 2024

Yes, I agree, Jason. In particular, the characters \t and \n must not appear in the JSON. Defining the subset that we allow would be helpful.

from gfa-spec.

noporpoise avatar noporpoise commented on September 24, 2024

Yes @pb-jchin, parsers need to be aware of new lines within JSON objects. I've written similar code 1 that reads until the end of a JSON object (for loading JSON headers) -- it's about 40 lines of code in C.

Using JSON does mean that lines starting with S might not be segment lines. This may upset some people who rely on awk. It wouldn't be hard to write a GFA tool that stripped JSON annotations though.

I don't think we need to restrict to a subset of JSON. Other people may prefer that we do not allow any new line characters in strings or in JSON objects. I can understand the motivation.

from gfa-spec.

sjackman avatar sjackman commented on September 24, 2024

Let's move this discussion regarding the JSON format to #15.

from gfa-spec.

sjackman avatar sjackman commented on September 24, 2024

@noporpoise Would you open a pull request proposing that lines starting with # are comments?

from gfa-spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.