#!/usr/bin/perl -w
# cure_refseqs.pl
# A script to update refseqs (i.e. "cure" IHPs) using consensus sequences obtained by
# alignments with sub-genome reads (e.g. 'A' genome reads vs. full 95k set derived from
# A, C and AACC Brassica genomes)
#
# Martin.Trick@bbsrc.ac.uk, 9/4/2010
use FileHandle;
STDOUT->autoflush(1);
# Hashes for original refseqs and consensus seqs (and quality strings - for future use)
my %ref = ();
my %cns = ();
my %qual = ();
# CNS Phred quality threshold required for change to refseq
my $threshold = 40;
# NB. maq cns2fq has default thresholds *for reads* of mapping quality >40 and depth >= 3
# Depth becomes encoded in the case of characters in sequence string
# Script requires the refseq fasta file, the fastq file of the consensus and writes an updated
# refseq fasta file. The accompanying wrapper script "cure_cycle.pl" controls these filenames
# Check arguments
unless (@ARGV == 3) {
print "Usage: cure_refsqs.pl