A couple of GBS scripts by Greg Baute

barcodes.txt file containing each sample name and its corresponding barcode sequence.
R1.fastq the barcoded first read
R2.fastq the unbarcoded second read

GBS_fastq_RE-multiplexer_v1.pl is made to allow you to use paired end reads in Tassel. It does the following:
	prints all the reads to the same file. 
	only keeps reads with a barcode found in your design. 
	adds the barcode from read1 to the beginning of the corresponding read2
	uses the quality scores of the barcode of read1 and adds them to the quality of read2

Usage:
perl GBS_fastq_RE-multiplexer_v1.pl barcodes.txt reads/R1.fastq reads/R2.fastq BothReadsBarcoded

GBS_fastq_Demultiplexer_v6.pl demultiplexes GBS libraries. Specifically it does the following:
	Makes a fastq file for each sample, puts both R1 and R2 in it
	Makes a nobar file for all the reads that do not have barcodes
	Removes barcodes, and corresponding qual scores
	Trims off adapter contamination
	Complains that it cannot remove the files if they do not exist. It will make the files but it tries to delete them if they are already there. 

perl GBS_fastq_Demultiplexer_v6.pl barcodes.txt reads/R1.fastq reads/R2.fastq reads/tmp

qseq2fastq.pl is not really a gbs script. it converts qseq files to fast if both reads meet the illumina quality filter.

Usage:
perl qseq2fastq.pl reads/qseqR1 reads/qseqR2 reads/fastout 

