Giter Club home page Giter Club logo

fasta_validator's Introduction

Edwards Lab

fasta_validator

This is simple C code to validate a fasta file. It only checks a few things, and by default only sets its response via the return code, so you will need to check that!

The simple rules that we adhere to are:

  1. Each header line starts with a >. The header preceedes the sequence.
  2. Every other line is considered a sequence line
  3. Sequence lines may not contain whitespace, numbers, or non-sequence characters. In other words, they must only contain the characters [A-Z], [a-z] and . or * as the last character.
  4. Sequence lines can end with a new line or return depending on whether you have edited this file on a mac, pc, or linux machine.
  5. Sequence lines can be empty.
  6. The sequence identifier is the string of characters in the header line following the > and upto the first whitespace. Everything after the first whitespace is descriptive, and can be as long as you like
  7. Each sequence identifier must be unique within the fasta file.

We will exit with the following return codes:

  • 0 this is a valid fasta file
  • 1 the first line does not start with a > (rule 1 violated).
  • 2 there are duplicate sequence identifiers in the file (rule 7 violated)
  • 4 there are characters in a sequence line other than [A-Za-z]

Other exit codes (e.g. 255, 254, etc) indicate internal errors in the program.

Prerequisites

The only prerequisite is ANSI C.

Installation

To clone the code from GitHub use:

git clone https://github.com/linsalrob/fasta_validator.git
cd fasta_validator

To build the code, use:

make

This will compile the source into an executable in the current working directory.

To install this code as root (sudo) you can use:

make install

and this will copy the executable to /usr/local/bin.

to install it as a user, just copy the compiled binary fasta_validate to somewhere on your path.

Testing

To test the code, please use

make test

or

bash test.sh

This tests the code against both valid and invalid fasta files provided in the test/ directory.

Citation

Please cite this as

Edwards, R.A. 2019. fasta_validate: a fast and efficient fasta validator written in pure C. DOI: 10.5281/zenodo.2532044 DOI

License

This software is released using the MIT License

fasta_validator's People

Contributors

gallvp avatar linsalrob avatar

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.