
Tutorial 3
Trouble-ship with nhpb

1) Getting a datafile understandable by nhpb.
the first four state of the datafile corrupt.nex have been changed to non amino acid or DNA alphabet characters.
Then try to run nhpb:

../../nhpb -d corrupt.nex -y catbpfree1 -m catbp -p ../../

The program stop: "PhyloParameters::RegisterWithData : error in zip data making"
Then try with -v option 
../../nhpb -d corrupt.nex -y catbpfree1 -m catbp -p ../../ -v

The program stop again and output the list of illegal characters:
"WARNING in Tonexus::getAlphabet, there are non nucleotidic or non amino acid letters"
"guess alphabet is Amino Acid but found illegal letters:"
"ZZZ?"
Then try again with the -w option:

../../nhpb -d corrupt.nex -y catbpfree1 -m catbp -p ../../ -v -w

That correct automatically (... so take care) bad character.
corrupt.nex is copied in corrupt.nexBK
corrupt.nex is modified
modification are shown in corrupt.nex.logfile:
"*********************** checkPROTEIN_Character ***********************"
"illegal character Z     : Daphnia       site: 0"
"illegal character Z     : Daphnia       site: 1"
"illegal character Z     : Daphnia       site: 2"
"illegal character ?     : Daphnia       site: 3"



2) the previous modification if done using the program toNexus
../../toNexus -h

The program allow to traduced FASTA, PHYLIP and Nexus files into a Nexus file correct
for nhpb (we apologize for the numerous problems encountered when parsing datafile !).
So if one of your dataset does not work, you can try:

../../toNexus -f corrupt.nex -F Nexus -o hopeItWorks.nex


3) Recovering corrupted .chain
The .chain file gather all the samples. When running stops while nhpb is writing a new sample,
the .chain file is corrupted and cannot be read anymore.

The program
../../recoverChain -h
helps in recovering first correct samples.
You may first check the samples:
../../recoverChain -f catbpfree1 -c

the result is:
>expected size 13
>sample 1 / 13
>sample 2 / 13
>sample 3 / 13
>sample 4 / 13
>sample 5 / 13
>sample 6 / 13
>sample 7 / 13
>sample 8 

and then stop ! sample 8 is corrupted.
Make a new archive:
../../recoverChain -f catbpfree1 -r 7 -o catbpfree1BK

and check it has work
../../monitor -f catbpfree1BK
