-------------
|  AUTHORS  |
-------------
- Chin Lung Lu <cllu@cs.nthu.edu.tw>
- Kun-Tze Chen <holystu@gmail.com>
- Shih-Yuan Huang <happyday5296@hotmail.com>
- Hsien-Tai Chiu <hchiu@mail.ncku.edu.tw>

Last updated: Aug. 17, 2016
*change log:
	delta-filter -1 -> delta-filter -r -q  # -1 is somehow buggy

Below, we describe how to run the program CAR in stand-alone mode.

------------------
|  REQUIREMENTS  |
------------------

CAR requires an installed PHP distribution, version 5 or later.
We have tested CAR on linux (Fedora), windows 7, and mac OSX.

CAR also requires a coordinate file generated by scripts nucmer or
promer, where nucmer and promer are two programs in the MUMmer package.
MUMmer can be obtained from the following website:

http://mummer.sourceforge.net/

-----------
|  USAGE  |
-----------

CAR requires MUMmer coord files as the only input. To run the program 
CAR, type the following command in a command line window:

	php car.php <coords file>

where <coords file> is a file containing coordinate data. This file 
should be generated by nucmer or promer.

After using nucmer or promer, we recommend the use of the delta-filter 
program, which is also available in the MUMmer package.

For example, let "reference.fna" and "contigs.fna" be one genome in 
FASTA format and a set of contigs in Multi-FASTA format, respectively. 
The following command can generate a coordinate file:

	<nucmer/promer> reference.fna contigs.fna -p example
	delta-filter -r -q example.delta > example.filter
	show-coords -l -d example.filter > example.coords

Then you can use 'example.coords' to run CAR:

	php car.php example.coords

Note that if MUMmer package is installed, you can just use the 
following command to run CAR:

	php car.php <-nuc/-pro> -r reference.fna -q contigs.fna

------------
|  OUTPUT  |
------------

CAR generates scaffolds by listing arbitrarily numbered scaffolds
followed the names of the contigs sorted by their position in the
scaffold order:

>scaffold_1
<contig_name_a> <orientation_a>
<contig_name_b> <orientation_b>
<contig_name_c> <orientation_c>
     ...

>scaffold_2
<contig_name_d> <orientation_d>
<contig_name_e> <orientation_e>
<contig_name_f> <orientation_f>
     ...

The contig orientation is represented by the numbers 0 or 1, where 0
means that the contig should be used in the scaffold in its original
orientation and 1 means that the contig should be reverse complemented.

Multi-FASTA output:

By using option "-m", CAR can generate a Multi-FASTA version of the output 
scaffolds. For example:

	php car.php -m <coords file>


Example of utilization:

	<nucmer/promer> reference.fna contigs.fna -p example
	delta-filter -r -q example.delta > example.filter
	show-coords -l -d example.filter > example.coords
	php car.php -m example.coords

Or, just use the following command if MUMmer package is installed:

	php car.php <-nuc/-pro> -m -r reference.fna -q contigs.fna

-------------
|  EXAMPLE  |
-------------

Some examples can be found in the folder "examples": "nucmer.coords",
"promer.coords" and "NC_009525-NC_002945.coords". The first two files
are examples that are useful for understanding the coord files
generated by nucmer and promer, respectively.

The third file is the result of running CAR on real data. The reference
file comes from the organism "Mycobacterium bovis AF2122_97" and the
contig set comes from the "Mycobacterium tuberculosis H37Ra". Both
files can be acessed at NCBI:

reference: ftp://ftp.ncbi.nih.gov/genomes/Bacteria/Mycobacterium_bovis_AF2122_97_uid57695
contigs:   ftp://ftp.ncbi.nih.gov/genomes/Bacteria_DRAFT/Mycobacterium_tuberculosis_H37Ra_uid54595

In this example, we used 'nucmer' and 'delta-filter' to find 219
conserved blocks and generate the coordinate file. CAR was able to
find 211 correct adjacencies from those 219 blocks.
