Difference between revisions of "RAxML"

From wiki
Jump to: navigation, search
Line 19: Line 19:
 
<ins>Explanation</a>:
 
<ins>Explanation</a>:
 
* ASC refers to ascertainment bias (known in the original Paul Lewis paper as acquisition bias) accoutn sfor the fact that all the sites are variable, as opposed to other types of alignments which include all the constant or common characters).
 
* ASC refers to ascertainment bias (known in the original Paul Lewis paper as acquisition bias) accoutn sfor the fact that all the sites are variable, as opposed to other types of alignments which include all the constant or common characters).
 +
 +
= Program code =
 +
 +
Because the ascertainment bias section of the manual is not terribly comprehensive, here is the relevant part of the source for the different types of ascertainment bias:
 +
 +
correction = evaluateCatAsc(ex1_asc, ex2_asc, x1_start_asc, x2_start_asc, tr->partitionData[model].tipVector,
 +
                  tip, ascWidth, diagptable, ascWidth, &accumulator, weightVector, tr->partitionData[model].dataType,
 +
                  tipNodeNumber, &goldmanAccumulator);
 +
}
 +
break;
 +
  case GAMMA:
 +
correction = evaluateGammaAsc(ex1_asc, ex2_asc, x1_start_asc, x2_start_asc, tr->partitionData[model].tipVector,
 +
                  tip, ascWidth, diagptable, ascWidth, &accumulator, weightVector, tr->partitionData[model].dataType,
 +
                  tipNodeNumber, &goldmanAccumulator);
 +
break;
 +
  default:
 +
assert(0);
 +
  }
 +
 +
 +
switch(tr->ascertainmentCorrectionType)
 +
  {
 +
  case LEWIS_CORRECTION:
 +
partitionLikelihood = partitionLikelihood - (double)w * LOG(1.0 - correction);
 +
break;
 +
  case STAMATAKIS_CORRECTION:
 +
partitionLikelihood += accumulator;
 +
break;
 +
  case FELSENSTEIN_CORRECTION:
 +
partitionLikelihood += tr->partitionData[model].invariableWeight * LOG(correction);
 +
break;
 +
  case GOLDMAN_CORRECTION_1:
 +
partitionLikelihood += ((correction * (double)w * LOG(correction)) / (1.0 - correction));
 +
break;
 +
  case GOLDMAN_CORRECTION_2:
 +
//printf("Goldman acc: %f\n", goldmanAccumulator);
 +
partitionLikelihood += (((double)w / (1.0 - correction)) * goldmanAccumulator);
 +
break;
 +
  case GOLDMAN_CORRECTION_3:
 +
partitionLikelihood += ((tr->partitionData[model].invariableWeight / correction) * goldmanAccumulator);
 +
break;
 +
  default:
 +
assert(0);
 +
  }

Revision as of 18:38, 4 August 2016

Introduction

Alexis Stamatakis' phylogenetic tree builder.

RAxML, like many phylogeny programs is adamant about orthology, and expects to see a high confidence alignment. In practice, this means poor performance with long alignments, and better peformance with gene-level alignments,

Part of this is due to the pitfall of long branch attraction, an phenomenon whereby very dissimilar sequences are grouped together in a phylogeny.

Example usage

Standard usage

raxml -m GTRGAMMA -s <alignment_of_sequences> -n <extension_label_suffixed_to_outputfiles> -t <sequence_alignment_tree>

When using SNPs as input, the following command-line will work:

raxmlHPC -m ASC_GTRGAMMA --asc-corr=lewis -s <snps_as_fasta_file> -p 12345 -n <extension_label_suffixed_to_outputfiles>

Explanation</a>:

  • ASC refers to ascertainment bias (known in the original Paul Lewis paper as acquisition bias) accoutn sfor the fact that all the sites are variable, as opposed to other types of alignments which include all the constant or common characters).

Program code

Because the ascertainment bias section of the manual is not terribly comprehensive, here is the relevant part of the source for the different types of ascertainment bias:

correction = evaluateCatAsc(ex1_asc, ex2_asc, x1_start_asc, x2_start_asc, tr->partitionData[model].tipVector,
                  tip, ascWidth, diagptable, ascWidth, &accumulator, weightVector, tr->partitionData[model].dataType,
                  tipNodeNumber, &goldmanAccumulator);
}
break;
  case GAMMA:
correction = evaluateGammaAsc(ex1_asc, ex2_asc, x1_start_asc, x2_start_asc, tr->partitionData[model].tipVector,
                  tip, ascWidth, diagptable, ascWidth, &accumulator, weightVector, tr->partitionData[model].dataType,
                  tipNodeNumber, &goldmanAccumulator);
break;
  default:
assert(0);
  }


switch(tr->ascertainmentCorrectionType)
  {
  case LEWIS_CORRECTION:
partitionLikelihood = partitionLikelihood - (double)w * LOG(1.0 - correction);
break;
  case STAMATAKIS_CORRECTION:
partitionLikelihood += accumulator;
break;
  case FELSENSTEIN_CORRECTION:
partitionLikelihood += tr->partitionData[model].invariableWeight * LOG(correction);
break;
  case GOLDMAN_CORRECTION_1:
partitionLikelihood += ((correction * (double)w * LOG(correction)) / (1.0 - correction));
break;
  case GOLDMAN_CORRECTION_2:
//printf("Goldman acc: %f\n", goldmanAccumulator);
partitionLikelihood += (((double)w / (1.0 - correction)) * goldmanAccumulator);
break;
  case GOLDMAN_CORRECTION_3:
partitionLikelihood += ((tr->partitionData[model].invariableWeight / correction) * goldmanAccumulator);
break;
  default:
assert(0);
  }