What is MIME type "chemical/seq-na-genbank"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

The MIME type chemical/seq-na-genbank represents nucleotide sequence records formatted in the GenBank style.
It marks text files that carry genetic sequence data along with detailed annotations. These records help scientists share and analyze gene information.
Files using this MIME type include those with extensions GP, GB, GBK, and GENBANK.
For more details, see the GenBank repository.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: chemical/seq-na-genbank    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="chemical/seq-na-genbank">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'chemical/seq-na-genbank');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

Which applications can open files served as chemical/seq-na-genbank?

Files using this MIME type are typically opened by bioinformatics software such as SnapGene, Geneious, or the NCBI toolkit. Since the underlying format is text-based, you can also view the raw data using standard text editors like Notepad++ or VS Code, though they will not render the biological visualization.

How do I configure Apache to correctly serve GenBank files?

To ensure your Apache server sends the correct headers for GenBank data, add the following line to your .htaccess file or main configuration: AddType chemical/seq-na-genbank .gb .gbk .gp .genbank. This ensures browsers and client software interpret the file as genetic sequence data rather than generic text.

How do I set up Nginx to handle the chemical/seq-na-genbank MIME type?

In your Nginx configuration (usually nginx.conf or inside a server block), update the types directive. Add the line: chemical/seq-na-genbank gb gbk gp genbank;. Reload Nginx to apply the changes.

Why does my browser download .gb files instead of displaying them?

Most modern web browsers (Chrome, Firefox, Edge) do not have built-in rendering engines for chemical MIME types. Because the browser does not know how to visually display the nucleotide sequence and annotations, it defaults to downloading the file so you can open it with a local desktop application.

Is chemical/seq-na-genbank a binary or text-based format?

The GenBank format is strictly text-based. While it contains complex biological data, the file itself is human-readable ASCII text. If you change the extension to .txt, you can read the annotations and sequence data, but using the correct MIME type is preferred for automated processing.

What happens if I serve these files as text/plain?

Serving these files as text/plain allows users to view the raw code in their browser immediately. However, this strips the semantic meaning of the file. specialized bioinformatics tools and scripts may fail to trigger automatically if they are expecting the specific chemical/seq-na-genbank header.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.