AAProp Project

Introduction

Amino Acids. They are very important things, evidently. However, they tend to have a lot of information associated with them. This project, aaprop, is designed to provide a RESTful API for accessing information about amino acids. All 20 of them.

Using this, one can have a easy-to-use interface that can provide the following information:

  • The name of the amino acid
  • The three-letter code of the amino acid
  • The one-letter code of the amino acid
  • The molecular weight of the amino acid
  • The side chain type of the amino acid (polar, non-polar, acidic, basic)
  • The DNA codons that code for that amino acid.

Quick Start

The AAProp API is available at https://aaprop.shuttleapp.rs. You can access the API by sending a GET request to /amino_acid/{amino_acid} where {amino_acid} is the name, three-letter code, or one-letter code of the amino acid you want to get information about.

Using the API

curl https://aaprop.shuttleapp.rs/amino_acid/Alanine
{
  "amino_acid": {
    "name": "Alanine",
    "short_name": "Ala",
    "abbreviation": "A",
    "side_chain": "Nonpolar",
    "molecular_weight": 89.09,
    "codons": [
      "GCT",
      "GCC",
      "GCA",
      "GCG"
    ]
  }
}

API Routes

This section provides a reference for the API routes of the AAProp API.

Routes

Get Amino Acid Information

This route returns information about an amino acid.

  • URL: /amino_acid/{amino_acid}
  • Method: GET
  • URL Parameters:
    • amino_acid: The name, three-letter code, or one-letter code of the amino acid.
  • Example:
curl https://aaprop.shuttleapp.rs/amino_acid/Alanine
{
  "amino_acid": {
    "name": "Alanine",
    "short_name": "Ala",
    "abbreviation": "A",
    "side_chain": "Nonpolar",
    "molecular_weight": 89.09,
    "codons": [
      "GCT",
      "GCC",
      "GCA",
      "GCG"
    ]
  }
}

Get Amino Acid Side Chain Information

This route returns information about the side chain of an amino acid.

  • URL: /amino_acid/{amino_acid}/side_chain
  • Method: GET
  • URL Parameters:
    • amino_acid: The name, three-letter code, or one-letter code of the amino acid.
  • Example:
curl https://aaprop.shuttleapp.rs/amino_acid/Alanine/side_chain
{
  "amino_acid": {
    "name": "Alanine",
    "side_chain": "Nonpolar",
  }
}

Get Amino Acid Molecular Weight

This route returns the molecular weight of an amino acid.

  • URL: /amino_acid/{amino_acid}/molecular_weight
  • Method: GET
  • URL Parameters:
    • amino_acid: The name, three-letter code, or one-letter code of the amino acid.
  • Example:
curl https://aaprop.shuttleapp.rs/amino_acid/Alanine/molecular_weight
{
  "amino_acid": {
    "name": "Alanine",
    "short_name": "Ala",
    "abbreviation": "A",
    "molecular_weight": 89.09,
  }
}

Get Amino Acid Codons

This route returns the codons that code for an amino acid.

  • URL: /amino_acid/{amino_acid}/codon
  • Method: GET
  • URL Parameters:
    • amino_acid: The name, three-letter code, or one-letter code of the amino acid.
  • Example:
curl https://aaprop.shuttleapp.rs/amino_acid/Alanine/codon
{
  "amino_acid": {
    "name": "Alanine",
    "short_name": "Ala",
    "abbreviation": "A",
    "codons": [
      "GCT",
      "GCC",
      "GCA",
      "GCG"
    ]
  }
}

Get Amino Acid Abbreviation

This route returns the abbreviation of an amino acid.

  • URL: /amino_acid/{amino_acid}/abbreviation
  • Method: GET
  • URL Parameters:
    • amino_acid: The name, three-letter code, or one-letter code of the amino acid.
  • Example:
curl https://aaprop.shuttleapp.rs/amino_acid/Alanine/abbreviation
{
  "amino_acid": {
    "name": "Alanine",
    "short_name": "Ala",
    "abbreviation": "A",
  }
}

Get Amino Acid Short Name

This route returns the short name of an amino acid.

  • URL: /amino_acid/{amino_acid}/short_name
  • Method: GET
  • URL Parameters:
    • amino_acid: The name, three-letter code, or one-letter code of the amino acid.
  • Example:
curl https://aaprop.shuttleapp.rs/amino_acid/Alanine/short_name
{
  "amino_acid": {
    "name": "Alanine",
    "short_name": "Ala",
    "abbreviation": "A",
  }
}

Get Amino Acid Codons Count

This route returns the number of codons that code for an amino acid.

  • URL: /amino_acid/{amino_acid}/codon_count
  • Method: GET
  • URL Parameters:
    • amino_acid: The name, three-letter code, or one-letter code of the amino acid.
  • Example:
curl https://aaprop.shuttleapp.rs/amino_acid/Alanine/codon_count
{
  "amino_acid": {
    "name": "Alanine",
    "short_name": "Ala",
    "abbreviation": "A",
    "codon_count": 4,
  }
}

Check for the health of the API

This route returns the health status of the API.

  • URL: /health
  • Method: GET
  • Example:
curl https://aaprop.shuttleapp.rs/health
{}

Deployment Guide

You can deploy the AAProp API in two distinct ways:

  1. Self-Hosted Deployment using the binaries provided in the releases section.
  2. Docker-based Deployment using the Docker image provided in the Docker Hub or the GitHub Container Registry.

Self-Hosted Deployment

Prerequisites

  1. One of the following architectures:
    • x86_64
    • aarch64
    • i686
  2. A Linux-based operating system, preferably:
    • Ubuntu 20.04 LTS or later
    • Fedora 34 or later
    • CentOS 8 or later
    • Debian 11 or later
  3. At least of 128 MB of RAM.
  4. The AAProp binary for your architecture.
  5. A reverse proxy like nginx or Caddy to handle incoming requests, if you want to expose the API to the internet.

Installation

  1. Download the AAProp binary for your architecture from the releases section.

        wget "https://github.com/AliSajid/aaprop/releases/download/v2.0.0/aaprop-{`arch`}-unknown-linux-gnu"
        wget "https://github.com/AliSajid/aaprop/releases/download/v2.0.0/aaprop-{`arch`}-unknown-linux-gnu.asc"
        wget "https://github.com/AliSajid/aaprop/releases/download/v2.0.0/SHA256SUMS.txt"
        wget "https://github.com/AliSajid/aaprop/releases/download/v2.0.0/SHA256SUMS.txt.asc"
    
  2. Verify the integrity of the binary using the provided SHA256 checksum.

        sha256sum -c SHA256SUMS.txt 2>&1 | grep OK
    
  3. Verify the binary's authenticity by checking the gpg signature.

        gpg --verify SHA256SUMS.txt.asc
        gpg --verify aaprop-$(arch)-unknown-linux-gnu.asc
    
  4. Place the binary in a directory of your choice in the PATH.

        sudo mv aaprop-$(arch)-unknown-linux-gnu /usr/local/bin/aaprop
    
  5. Start the AAProp API.

        aaprop
    

Docker Deployment

Prerequisites

  1. Docker installed on your system.
  2. A reverse proxy like nginx or Caddy to handle incoming requests, if you want to expose the API to the internet.
  3. The Docker image for the AAProp API.

Installation

  1. Pull the Docker image from the Docker Hub or the GitHub Container Registry.

        docker pull imamiland/aaprop:latest
    
  2. Run the Docker container.

        docker run -d -p 8080:8080 imamiland/aaprop:latest
    
  3. Verify that the container is running.

        docker ps
    
  4. Access the API at http://localhost:8080.

  5. If you want to expose the API to the internet, configure your reverse proxy to forward requests to the container's port.

        server {
            listen 80;
            server_name example.com;
    
            location / {
                proxy_pass http://localhost:8080;
            }
        }
    
        sudo systemctl restart nginx
    

Command Line Reference

This section provides a reference for the command-line interface (CLI) of the AAProp API.

Usage

aaprop [FLAGS] [OPTIONS]

Flags

  • -h, --help: Prints help information.
  • -V, --version: Prints version information.

Options

  • -b, --bind LISTEN_ADDRESS: The IP address to bind the server to. Default: 127.0.0.1.
  • -p, --port LISTEN_PORT: The port number to listen on. Default: 8080.
  • -l, --log LOG_LEVEL: The log level. Default: info. Possible values: trace, debug, info, warn, error.

Examples

Start the AAProp API on the default address and port

This command starts the AAProp API on localhost:8080. You can access the API at http://localhost:8080.

aaprop

Start the AAProp API on a custom address and port

You can customize one, both, or none of the address and port options.

Custom Address, Custom Port

aaprop --bind 0.0.0.0 --port 8081

Custom Address. Default Port

aaprop --bind 0.0.0.0

Default Address, Custom Port

aaprop --port 8081

Start the AAProp API with a custom log level

You can set the log level to trace, debug, info, warn, or error.

aaprop --log debug

Open API Specification

openapi: 3.0.0
info:
  title: AAProp API
  description: API reference for AAProp API
  version: 1.0.0
servers:
  - url: https://aaprop.shuttleapp.rs
paths:
  /amino_acid/{amino_acid}:
    get:
      summary: Get Amino Acid Information
      parameters:
        - name: amino_acid
          in: path
          required: true
          description: The name, three-letter code, or one-letter code of the amino acid.
          schema:
            type: string
      responses:
        '200':
          description: Amino acid information retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AminoAcidResponse'
  /amino_acid/{amino_acid}/side_chain:
    get:
      summary: Get Amino Acid Side Chain Information
      parameters:
        - name: amino_acid
          in: path
          required: true
          description: The name, three-letter code, or one-letter code of the amino acid.
          schema:
            type: string
      responses:
        '200':
          description: Side chain information retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AminoAcidSideChainResponse'
  /amino_acid/{amino_acid}/molecular_weight:
    get:
      summary: Get Amino Acid Molecular Weight
      parameters:
        - name: amino_acid
          in: path
          required: true
          description: The name, three-letter code, or one-letter code of the amino acid.
          schema:
            type: string
      responses:
        '200':
          description: Molecular weight retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AminoAcidMolecularWeightResponse'
  /amino_acid/{amino_acid}/codon:
    get:
      summary: Get Amino Acid Codons
      parameters:
        - name: amino_acid
          in: path
          required: true
          description: The name, three-letter code, or one-letter code of the amino acid.
          schema:
            type: string
      responses:
        '200':
          description: Codons retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AminoAcidCodonsResponse'
  /amino_acid/{amino_acid}/abbreviation:
    get:
      summary: Get Amino Acid Abbreviation
      parameters:
        - name: amino_acid
          in: path
          required: true
          description: The name, three-letter code, or one-letter code of the amino acid.
          schema:
            type: string
      responses:
        '200':
          description: Abbreviation retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AminoAcidAbbreviationResponse'
  /amino_acid/{amino_acid}/short_name:
    get:
      summary: Get Amino Acid Short Name
      parameters:
        - name: amino_acid
          in: path
          required: true
          description: The name, three-letter code, or one-letter code of the amino acid.
          schema:
            type: string
      responses:
        '200':
          description: Short name retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AminoAcidShortNameResponse'
  /amino_acid/{amino_acid}/codon_count:
    get:
      summary: Get Amino Acid Codons Count
      parameters:
        - name: amino_acid
          in: path
          required: true
          description: The name, three-letter code, or one-letter code of the amino acid.
          schema:
            type: string
      responses:
        '200':
          description: Codon count retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AminoAcidCodonCountResponse'
  /health:
    get:
      summary: Check the health of the API
      responses:
        '200':
          description: API is healthy
          content:
            application/json:
              schema:
                type: object
                properties: {}

components:
  schemas:
    AminoAcid:
      type: object
      properties:
        name:
          type: string
        short_name:
          type: string
        abbreviation:
          type: string
        side_chain:
          type: string
        molecular_weight:
          type: number
        codons:
          type: array
          items:
            type: string
    AminoAcidResponse:
      type: object
      properties:
        amino_acid:
          $ref: '#/components/schemas/AminoAcid'
    AminoAcidSideChainResponse:
      type: object
      properties:
        amino_acid:
          type: object
          properties:
            name:
              type: string
            side_chain:
              type: string
    AminoAcidMolecularWeightResponse:
      type: object
      properties:
        amino_acid:
          type: object
          properties:
            name:
              type: string
            short_name:
              type: string
            abbreviation:
              type: string
            molecular_weight:
              type: number
    AminoAcidCodonsResponse:
      type: object
      properties:
        amino_acid:
          $ref: '#/components/schemas/AminoAcid'
    AminoAcidAbbreviationResponse:
      type: object
      properties:
        amino_acid:
          type: object
          properties:
            name:
              type: string
            short_name:
              type: string
            abbreviation:
              type: string
    AminoAcidShortNameResponse:
      type: object
      properties:
        amino_acid:
          type: object
          properties:
            name:
              type: string
            short_name:
              type: string
            abbreviation:
              type: string
    AminoAcidCodonCountResponse:
      type: object
      properties:
        amino_acid:
          type: object
          properties:
            name:
              type: string
            short_name:
              type: string
            abbreviation:
              type: string
            codon_count:
              type: integer