Answers.Body: <p>Short answer: no, there isn't a "standard" method, and there won't be.</p>
  
  <p>Long answer: like TAB-delimited and XML, JSON alone is not a specific format. You have to define a schema to give meanings to data. However, unlike TAB-delimited "format" and XML, there is not an official way to define JSON schema. There have been various attempts but all of them are complicated and none of them are widely adopted. As you can't write down a JSON schema for GFA in the first place, there won't be a "standard" way to convert GFA to JSON. The best you can do is to roll out your own in-house solution, unfortunately.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-22T08:15:56.787Z
Answers.Text: Thanks. "There have been various attempts but all of them are complicated and none of them are widely adopted." Just to clarify though, why couldn't the community adopt a JSON scheme for GFA? If you encode all information of a GFA into one JSON format, it would be easy for others to modify this if they wish, right?
Answers.UserDisplayName: EB2127
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-22T12:33:50.577Z
Answers.Text: You are now asking a different question: why not use JSON to encode graphs? This question was answered in the thread you quoted.
Answers.UserDisplayName: user172818
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-24T15:09:36.900Z
Answers.Text: " in memory, a JSON object is also fatter, which can be a concern for huge graphs." This reason?
Answers.UserDisplayName: EB2127
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-21T16:55:38.860Z
Answers.LastActivityDate: 2018-05-21T16:55:38.860Z
Answers.UserDisplayName: user172818
Body: <p>I'm confused why the <a href="https://github.com/GFA-spec/GFA-spec" rel="nofollow noreferrer">GFA format</a> doesn't have a standard JSON parser. It appears to be related to a decision made several years ago, <a href="https://github.com/GFA-spec/GFA-spec/issues/15" rel="nofollow noreferrer">here</a>.</p>
  
  <p>The objection appears to be "JSON isn't necessary, as it's just a simple linked list. Users could write their own". However, I would think this is a useful feature. </p>
  
  <p>There are applications I could think of whereby a JSON would be necessary, or at least very convenient. </p>
  
  <p>(1) Is there a standard way to convert GFA into JSON? Or do users write their own scripts? </p>
  
  <p>(2) Is there a conceptual reason why GFA doesn't convert into JSON? </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-20T12:45:57.203Z
Comments.Text: I thought the explanation Heng gave was pretty comprehensive: it’s overkill, and you can use JSON in tags. Of course you shouldn’t write your own parser, there are enough existing ones.
Comments.UserDisplayName: Konrad Rudolph
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-22T08:12:03.020Z
Comments.Text: @KonradRudolph "there are enough existing ones." Do you have recommendations? Heng Li mentions his own in that thread, but there are others?
Comments.UserDisplayName: EB2127
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-22T09:56:20.717Z
Comments.Text: My recommendation is to use the standard library in whatever language you’re using. If that language doesn’t have a JSON parser in the standard library, use the most widely used implementation.
Comments.UserDisplayName: Konrad Rudolph
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-24T15:06:55.607Z
Comments.Text: @KonradRudolph "use the most widely used implementation" What is this?
Comments.UserDisplayName: EB2127
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-24T15:08:35.250Z
Comments.Text: That’s the point: it depends on the programming language. A simple search of “JSON” + name of the programming language should have it as the first or second hit.
Comments.UserDisplayName: Konrad Rudolph
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-05-26T12:25:53.707Z
Comments.Text: @KonradRudolph Oh, I understand what you meant by the comment above now. I was thinking you meant a specific JSON parser for GFAs.
Comments.UserDisplayName: EB2127
Tags: <assembly>
Title: Why isn't there a standard method to convert GFA to JSON?
ThreadText: # Why isn't there a standard method to convert GFA to JSON?
  
  (Asked by: username_0 on 2018-05-18)
  
  I'm confused why the [GFA format](https://github.com/GFA-spec/GFA-spec) doesn't have a standard JSON parser. It appears to be related to a decision made several years ago, [here](https://github.com/GFA-spec/GFA-spec/issues/15).
  
  The objection appears to be "JSON isn't necessary, as it's just a simple linked list. Users could write their own". However, I would think this is a useful feature.
  
  There are applications I could think of whereby a JSON would be necessary, or at least very convenient.
  
  (1) Is there a standard way to convert GFA into JSON? Or do users write their own scripts?
  
  (2) Is there a conceptual reason why GFA doesn't convert into JSON?
  
  **Tags:** assembly
  
  > **Comments:**
  > **username_1**: I thought the explanation Heng gave was pretty comprehensive: it’s overkill, and you can use JSON in tags. Of course you shouldn’t write your own parser, there are enough existing ones.  
  > **username_0**: @username_1 "there are enough existing ones." Do you have recommendations? Heng Li mentions his own in that thread, but there are others?  
  > **username_1**: My recommendation is to use the standard library in whatever language you’re using. If that language doesn’t have a JSON parser in the standard library, use the most widely used implementation.  
  > **username_0**: @username_1 "use the most widely used implementation" What is this?  
  > **username_1**: That’s the point: it depends on the programming language. A simple search of “JSON” + name of the programming language should have it as the first or second hit.  
  > **username_0**: @username_1 Oh, I understand what you meant by the comment above now. I was thinking you meant a specific JSON parser for GFAs.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-05-21. Score: 4 | Accepted answer
  
  Short answer: no, there isn't a "standard" method, and there won't be.
  
  Long answer: like TAB-delimited and XML, JSON alone is not a specific format. You have to define a schema to give meanings to data. However, unlike TAB-delimited "format" and XML, there is not an official way to define JSON schema. There have been various attempts but all of them are complicated and none of them are widely adopted. As you can't write down a JSON schema for GFA in the first place, there won't be a "standard" way to convert GFA to JSON. The best you can do is to roll out your own in-house solution, unfortunately.
  
  > **Comments:**
  > **username_0**: Thanks. "There have been various attempts but all of them are complicated and none of them are widely adopted." Just to clarify though, why couldn't the community adopt a JSON scheme for GFA? If you encode all information of a GFA into one JSON format, it would be easy for others to modify this if they wish, right?  
  > **username_2**: You are now asking a different question: why not use JSON to encode graphs? This question was answered in the thread you quoted.  
  > **username_0**: " in memory, a JSON object is also fatter, which can be a concern for huge graphs." This reason?  
  
  ---
  
  