In directory test_data/, there are the following files:
MAL01.fa is the first reference
MAL02.fa is the second reference

ref_test.txt contains paths to the references (you might need to change these
to appropriate path names on your system)

test_reads_mates1.txt and test_reads_mates2.txt are paired-end reads 
(total of 100,001 pairs) with
5' mates in the file test_reads_mates1.txt and 
3' mates in the file test_reads_mates2.txt 

pos_test_reads.txt contains the original positions of the reads in the files test_reads_mates* inside the given references. Format: 
read_id (starts with 0), reference_name, strand, leftmost position for mate1, leftmost position for mate2.

Genomic positions in BRAT-bw are given staring with 0, 1, 2...

HOW TO RUN TESTS:

Note: all tests here run about 10sec

1. Go to brat_bw-2* directory.
2. Run make, this will build build_bw, brat_bw, acgt-count, 
trim, remove-dupl and convert_to_sam.
3. First, build two indexes with the following commands from brat-2* directory

./build_bw -P test_data/Genome_indexes -r test_data/ref_test.txt -G 1 > log_index1_build
./build_bw -P test_data/Genome_indexes -r test_data/ref_test.txt -G 2 > log_index2_build

If building is done correctly, the last line in the log_index*_build files 
will be: precalculated_seeds are done

IMPORTANT: both commands must be used (the first comand builds with G 1 and the second with G 2 and this will build two distinct indexes).


4. To map paired-end reads, run the following command from brat-2* directory:
IMPORTANT: use option -pe for paired-end mapping

./brat_bw -pe  -P  test_data/Genome_indexes -1 test_data/test_reads_mates1.txt -2 test_data/test_reads_mates2.txt -o test_data/out_pairs.txt > test_data/stat_pairs.txt 

The output will be in directory test_data, the name of output file is 
out_pairs.txt. There might be output in two additional files:
out_pairs.txt.mates1 and out_pairs.txt.mates2 with mates that were
mapped uniquely, but whose mates were either unmapped or mapped ambiguously.
The file in test_data directory with the name stat_pairs.txt contains
mapping statistics.

5. To map single-end reads, run either of the following commands:

./brat_bw -P test_data/Genome_indexes -s test_data/test_reads_mates1.txt -o test_data/out_singles_mates1.txt > test_data/out_stat_mates1.txt

./brat_bw -P test_data/Genome_indexes -A -s test_data/test_reads_mates2.txt -o test_data/out_singles_mates2.txt > test_data/out_stat_mates2.txt

Note, that with mates2, we must provide option -A.

The output of mapped reads will be in the directory test_data in the files
out_singles_mates1.txt or out_singles_mates2.txt with the mapping statistics
in the files out_stat_mates1.txt or out_stat_mates2.txt 

Below we show what results brat-bw produces with these files.

File stat_pairs.txt contains the following:

Mapped uniquely pairs (pair count): 88450
Broken pair: one mate is uniquely mapped, the other is unmapped (single-read count): 0
Broken pair: one mate is uniquely mapped, the other is ambiguos (single-read count): 7590
Broken pair: mates mapped to different chromosomes (pair count): 0
Broken pair: mates have wrong orientation (pair count): 0
Broken pair: mates have wrong inster size (pair count): 0
Unmapped pair: both mates are unmapped (pair count): 0
Ambiguous pair: both mates are ambiguous (pair count): 3961
map_reads is done

File out_stat_mates1.txt contains:

Mapped uniquely: 92280
Unmapped: 0
Ambiguous: 7721
map_reads is done

File out_stat_mates2.txt contains:

Mapped uniquely: 92210
Unmapped: 0
Ambiguous: 7791

