Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topic/phylo orthologs1 #6

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3648b46
Added several species
tomfy May 15, 2012
a2c36e6
Now has function tests for pre- in- post- order traversals.
tomfy May 16, 2012
507b011
remove some print statements
tomfy Jun 6, 2012
5f8e00c
add tests for pre- in- post-order traversals
tomfy Jun 6, 2012
dcaf99a
fix vertical gap calculation
tomfy Jun 6, 2012
01f0af4
pre- in- post-order traversals now functional.
tomfy Jun 6, 2012
44330ac
Handles (somewhat pathological) 1-leaf case without div by 0 now.
tomfy Jun 7, 2012
de3cfec
handle gene species not in species tree better.
tomfy Jun 13, 2012
abfe7cc
add sub non-speciestree_leafnode_names, other improved handling of ge…
tomfy Jun 13, 2012
89bb0d6
eliminate parent_hilited argument to recursive_draw.
tomfy Jun 18, 2012
3513d8a
Combined phylo.t, phylo_test.t
tomfy Jun 20, 2012
d3bff11
add species bithash tests
tomfy Jun 26, 2012
84989d0
get_standard_species now uses to_standard_format if get_standard_name…
tomfy Jun 26, 2012
87c8232
changed 1 comment
tomfy Jun 26, 2012
44de7da
Deleting phylo_test.t (its tests are in phylo.t)
tomfy Jun 26, 2012
416fa10
In find_mindl_node decided on path for urec in more sensible way.
tomfy Jul 2, 2012
6bce192
copy method now also copies attibute 'species_bit_pattern'
tomfy Jul 10, 2012
725551e
find_mindl_node now works with a copy of the gene tree,
tomfy Jul 10, 2012
bb830ab
Now skipping tokens containing only whitespace, in parse.
tomfy Jul 10, 2012
bb72fae
delete a print statement
tomfy Jul 12, 2012
fa9782e
delete a print statement.
tomfy Jul 12, 2012
b50f653
1) In reset_root_to_point_on_branch, point to reset root to is specified
tomfy Jul 12, 2012
15fd336
Handles the case of <2 leave left after pruning those
tomfy Jul 13, 2012
46c1987
Initial commit. Class to analyze alignments for orthology.
tomfy Jul 13, 2012
7ad1d8c
Initial commit. Class to get overlap from alignment,
tomfy Jul 13, 2012
4db4d30
dir deleted
tomfy Jul 16, 2012
fd733c8
Module for translating seqence ids to species.
tomfy Jul 17, 2012
ceea2b4
For running MrBayes. Initial commit in cxgn-corelibs
tomfy Jul 17, 2012
95d01dd
Tests to go with Orthologger module.
tomfy Jul 17, 2012
d9833d0
Remove extraneous printing in test.
tomfy Jul 17, 2012
7183d51
improve pod for RF_distance
tomfy Jul 17, 2012
ba8bdf0
Orthologger -> CXGN::Phylo::Orthologger
tomfy Jul 19, 2012
372e162
package name Orthologger -> CXGN::Phylo::Orthologger
tomfy Jul 19, 2012
1adbf70
Now uses trees id_taxon_map to get species from seq id.
tomfy Jul 19, 2012
f4424dd
package name Orthologger -> CXGN::Phylo::Orthologger
tomfy Jul 19, 2012
bb714d9
added IdTaxonMap.
tomfy Jul 19, 2012
5454279
use Math::BigInt for species bit patterns; add collapsing after each …
tomfy Jul 20, 2012
2e72829
add a comment
tomfy Jul 20, 2012
cdb9e6b
ortholog_result_string now calls Tree::leaf_ortholog_table
tomfy Aug 2, 2012
bcd5675
Calls leaf_ortholog_table (sub name changed in Tree)
tomfy Aug 2, 2012
d5efa40
sub leaf_ortholog_table added.
tomfy Aug 2, 2012
ef1c456
test
tomfy Dec 5, 2012
39f0173
deleted.
tomfy Dec 5, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions lib/CXGN/Phylo/IdTaxonMap.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package CXGN::Phylo::IdTaxonMap;

use strict;
use List::Util qw ( min max sum );

my %default_map =
(
'^AT' => 'arabidopsis',
'^Bradi' => 'brachypodium',
'^(?:X_)?\d{5}[.]m\d{6}' => 'castorbean', # can have X_ prefix or not
'^GSVIV' => 'grape',
'^(?:GRMZM|AC\d{6})' => 'maize',
'^IMGA[|_](?:Medtr|AC|CU)' => 'medicago',
'^evm' => 'papaya',
'^POPTR' => 'poplar',
'^LOC_Os' => 'rice',
'^jgi_Selmo' => 'selaginella',
'^Sb' => 'sorghum',
'^Glyma' => 'soybean',
'^Solyc' => 'tomato'
);


sub new {
my $class = shift;
my $arg = shift; # hash ref, keys are regular expressions, values are corresponding taxon names.
my $args= {};
my $self = bless $args, $class;

my %map = ();
foreach (keys %default_map) {
$map{$_} = $default_map{$_};
}

foreach (keys %$arg) {
$map{$_} = $arg->{$_};
}

$self->{map} = \%map;
return $self;
}

sub get_map{
my $self = shift;
return $self->{map};
}


sub add_idregex_taxonname{
my $self = shift;
my $idregex = shift;
my $taxonname = shift;
$self->{map}->{$idregex} = $taxonname;
}


sub id_to_taxonname{
my $self = shift;
my $id = shift;

my $map = $self->get_map();
foreach (keys %$map) {
# print "id regex: $_\n";
return $map->{$_} if($id =~ /$_/);
}
warn "No taxon name found for id: $id\n";
return;
}

1;
3 changes: 1 addition & 2 deletions lib/CXGN/Phylo/Layout.pm
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,7 @@ sub _layout_vertical {
my $total_leaves = $self->get_tree()->get_leaf_count();
my $image_height = $self->get_image_height();
if ($total_leaves < 1) { return; }
my $vertical_gap = ($image_height - $self->get_top_margin() - $self->get_bottom_margin()) / ($total_leaves);

my $vertical_gap = ($total_leaves > 1)?($image_height - $self->get_top_margin() - $self->get_bottom_margin()) / ($total_leaves-1): 0;
# the leaf nodes should be easy.
# traverse the tree, find all the leaves, and set the vertical
# coordinate in the leaves to an increasing value with step $vertical_gap.
Expand Down
Loading