Home - this site is powered by TWiki(R)
Blog > JasonStajichHistory
TWiki webs: Main | TWiki | Sandbox   Log In or Register

Changes | Index | Search | Go

Testing molecular clock in PAML.

Basically this code for doing an en-masse comparison. This is as per MBL MolEvo Course slides

# $type would be either 'clock' or 'noclock' depending on which file you are reading.
# so you'd want this type of loop to run over all the result files from PAML
# in my case I've numbered all the gene clusters and that number is stored in $num
# designed to parse PAML mlc files from codeml
while(<IN>) {

  if( /lnL\([^\)]+\):\s+(\-?\d+\.\d+)/ ) {
     $dat[$num]->{$type} = $1 * -1; # this is just a lnL it is not -lnL
  } elsif( /^ns\s+=\s+(\d+)/ ) {
     $dat[$num]->{'ns'} = $1;
  }
}

# to then compare the clock vs no-clock
my $i = 0;
print join("\t", qw(CLUSTER NOCLOCK CLOCK LRT SIGNIF)),"\n";
for my $d ( @dat ) {    
    if( defined $d ) {
        # H1,H0 = - log (likelihood)
         
        # LRT = 2*(lnL1 - lnL2);
        my $lrt = 2 * ($d->{'clock'} - $d->{'noclock'} );
        if( ! defined $d->{clock} || ! defined $d->{'noclock'} ) {
            warn("no dat for $i\n");
        }
        my $p = Statistics::Distributions::chisqrprob ($d->{'ns'} - 2,$lrt);
        printf "%s\t%9.3f\t%9.3f\t%-7.2f\t%-5.2g%s\n",$i,$d->{'noclock'},
        $d->{'clock'}, $lrt, $p, $p < $signif_high ? '**' : $p < $signif_mod ? '*' : '';
    }
    $i++;
}

-- JasonStajich - 08 Jun 2005

[GMOD] Progress. The links to the presentations from their May meeting are here

There is a new Architecture discussion group to hash out the ways to make the tools interoperate better. Hopefully these efforts will establish some standards and leadership for project coordination.

-- JasonStajich - 08 Jun 2005

Almost finished setting up my new data site for fungal genomes. http://fungal.genome.duke.edu

This site has a BLAST interface which uses my Bio::SearchIO parser and Writer (BioPerl) to re-write the report with links in to GenericGenomeBrowser.

There is also gene retrieval CGI direct from Bio::DB::GFF which I think is pretty cool.

-- JasonStajich - 03 Jun 2005

Edit | Attach | Print version | History: r20 < r19 < r18 < r17 < r16 | Backlinks | Raw View | Raw edit | More topic actions

This site is powered by the TWiki collaboration platformCopyright © 2008-2013 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
TWiki Appliance - Powered by TurnKey Linux