text: user9: There's a variety of formats for storing genomic features (e.g. Genbank, GFF, GTF, Bedfile) but all of the ones that I'm familiar with use either a custom format (Genbank) or a CSV with defined column conventions and space for additional data (GFF, GTF, Bedfile).
  Is there a feature format that is JSON based and adheres to a defined schema?
  
  user3828: BioJS has capacity to read and write GFF as streams, it might have something of interest such as this: https://github.com/biojs-io/biojs-io-gff
  
  user1713: I've written a Python library called PyReference which converts a GTF / GFF (RefSeq and Ensembl) into a gzipped JSON file.
  You can just use this if you like but there's also a Python wrapper around the JSON, which allows you to write genomics code more naturally.
  Python isn't known for being fast but the library function for reading a JSON file is highly optimised - the following takes less than 4 seconds on my laptop:
  import numpy as np
  import pyreference
  
  reference = pyreference.Reference()
  
  my_gene_ids = ["MSN", "GATA2", "ZEB1"]
  for gene in reference[my_gene_ids]:
      average_length = np.mean([t.length for t in gene.transcripts])
      print("%s average length = %.2f" % (gene, average_length))
      print(gene.iv)
      for transcript in gene.transcripts:
          if transcript.is_coding:
              threep_utr = transcript.get_3putr_sequence()
              print("%s end of 3putr: %s" % (transcript.get_id(), threep_utr[-20:]))
  
  
  user776: JVCF is a JSON schema for describing genetic variants. BioJSON is a JSON schema for multiple sequence alignments. The output of mygene.info's gene annotation web service is JSON-formatted. 
  You might build one of your own schemas from any or all of these, as inspiration for structure and content. 
  Consider that most genomics formats are historically tabular, because they are not hierarchical, because they originated prior to the advent of JavaScript as a common programming language (and subsequent use of JSON to serialize data), and because a lot of stream-oriented UNIX tools read in data and process it in ways that are natural to tabular structure.
  Some tabular results can be hierarchical, but use inefficiencies in field values to apply hierarchy. JSON is inefficient for storing tabular data, but it is absolutely wonderful for hierarchical data. This difference is perhaps worth considering.
  One could think of storing a gene as a master object containing various haplotypes, exons, introns, features, associated variants, associated TF binding sites, gene ontologies, etc. Ordering or prioritization of such items would be possible with the use of sorted lists within a gene object. The format is as extensible as it is a matter of adding a property, list, or object to the schema. 
  To gain adoption or "buy-in", build tools which publish it to users, and tools that consume what users get in order to do things, along with conversion and validation utilities.
  
original_text: 9: <p>There's a variety of formats for storing genomic features (e.g. Genbank, GFF, GTF, Bedfile) but all of the ones that I'm familiar with use either a custom format (Genbank) or a CSV with defined column conventions and space for additional data (GFF, GTF, Bedfile).</p>
  
  <p>Is there a feature format that is JSON based and adheres to a defined schema?</p>
   3828: <p>BioJS has capacity to read and write GFF as streams, it might have something of interest such as this: <a href="https://github.com/biojs-io/biojs-io-gff" rel="nofollow noreferrer">https://github.com/biojs-io/biojs-io-gff</a></p>
   1713: <p>I've written a Python library called <a href="https://github.com/SACGF/pyreference" rel="nofollow noreferrer">PyReference</a> which converts a GTF / GFF (RefSeq and Ensembl) into a gzipped JSON file.</p>
  <p>You can just use this if you like but there's also a Python wrapper around the JSON, which allows you to write genomics code more naturally.</p>
  <p>Python isn't known for being fast but the library function for reading a JSON file is highly optimised - the following takes less than 4 seconds on my laptop:</p>
  <pre><code>import numpy as np
  import pyreference
  
  reference = pyreference.Reference()
  
  my_gene_ids = [&quot;MSN&quot;, &quot;GATA2&quot;, &quot;ZEB1&quot;]
  for gene in reference[my_gene_ids]:
      average_length = np.mean([t.length for t in gene.transcripts])
      print(&quot;%s average length = %.2f&quot; % (gene, average_length))
      print(gene.iv)
      for transcript in gene.transcripts:
          if transcript.is_coding:
              threep_utr = transcript.get_3putr_sequence()
              print(&quot;%s end of 3putr: %s&quot; % (transcript.get_id(), threep_utr[-20:]))
  </code></pre>
   776: <p><a href="https://github.com/ekg/jvcf" rel="nofollow noreferrer">JVCF</a> is a JSON schema for describing genetic variants. <a href="https://jalview.github.io/biojson/" rel="nofollow noreferrer">BioJSON</a> is a JSON schema for multiple sequence alignments. The output of <a href="https://mygene.info/" rel="nofollow noreferrer">mygene.info</a>'s gene annotation web service is JSON-formatted. </p>
  
  <p>You might build one of your own schemas from any or all of these, as inspiration for structure and content. </p>
  
  <p>Consider that most genomics formats are historically tabular, because they are not hierarchical, because they originated prior to the advent of JavaScript as a common programming language (and subsequent use of JSON to serialize data), and because a lot of stream-oriented UNIX tools read in data and process it in ways that are natural to tabular structure.</p>
  
  <p>Some tabular results can be hierarchical, but use inefficiencies in field values to apply hierarchy. JSON is inefficient for storing tabular data, but it is absolutely wonderful for hierarchical data. This difference is perhaps worth considering.</p>
  
  <p>One could think of storing a gene as a master object containing various haplotypes, exons, introns, features, associated variants, associated TF binding sites, gene ontologies, etc. Ordering or prioritization of such items would be possible with the use of sorted lists within a gene object. The format is as extensible as it is a matter of adding a property, list, or object to the schema. </p>
  
  <p>To gain adoption or "buy-in", build tools which publish it to users, and tools that consume what users get in order to do things, along with conversion and validation utilities.</p>
  