Skip to content

Commit 21f6dba

Browse files
author
zhangrengang
committed
default aligner: mafft
1 parent f79c33a commit 21f6dba

File tree

4 files changed

+7
-21
lines changed

4 files changed

+7
-21
lines changed

evolution_example

soi/OrthoFinder.py

-1
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,6 @@ def bootstrap_species_tree(OFdir, outdir, bootstrap=1000, iqtree_options='-mset
19291929
new_treefile = '{}.treefile'.format(prefix)
19301930
new_treefile_rooted = '{}.rooted.tre'.format(prefix)
19311931
print('re-root with {}'.format([root]), file=sys.stderr)
1932-
# result.re_root(new_treefile, root, new_treefile_rooted)
19331932
cmd = 'nw_reroot {} {} > {}'.format(
19341933
new_treefile, root, new_treefile_rooted)
19351934
os.system(cmd)

soi/evaluator.py

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from .colors import Colors
2-
from .mcscan import Collinearity, Gff, XCollinearity
3-
from lazy_property import LazyWritableProperty as lazyproperty
41
import sys
52
import numpy as np
63
import collections
@@ -9,6 +6,9 @@
96
from matplotlib.gridspec import GridSpec
107
mpl.use("Agg")
118
mpl.rcParams['pdf.fonttype'] = 42
9+
from lazy_property import LazyWritableProperty as lazyproperty
10+
from .colors import Colors
11+
from .mcscan import Collinearity, Gff, XCollinearity
1212

1313

1414
def eval(collinearities, orthologs, gff, ref=None, pre=None):
@@ -86,26 +86,18 @@ def plot_eval(d_rcs, outfig, legend_fontsize=9):
8686
bm = sum(rcs.refcounts[:, 1]) # gene number of all blocks
8787
kargs = dict(color=colors[i], alpha=1, label=_sp)
8888
ax0.plot(-2, -2, linestyle='-', marker='o', **kargs)
89-
# ax0.barh(0, 0, height=0, left=0, align='center', label=_sp)
9089

9190
ax1.plot(range(1, nb+1), np.cumsum(ns),
9291
drawstyle="steps-post", **kargs)
9392
ax2.plot(range(1, nb+1), ns, drawstyle="steps-post", **kargs)
94-
# ax2.scatter(i50, sn50, label=_sp)
9593
ax3.scatter(len(rcs.ns), bm, **kargs)
96-
# ax4.hist(rcs.extended_frs, bins=40, histtype='step', **kargs)
9794
hist_plot(rcs.extended_frs, ax4, bins=40, **kargs)
98-
# ax4.scatter(rcs.frs, rcs.ns, alpha=0.6, label=_sp)
99-
# ax5.scatter(fn50, sn50, alpha=0.8, label=_sp)
10095
ax5.scatter(fm, sm, **kargs)
10196

102-
# ax5.hist(rcs.extended_ns, bins=30, histtype='step', label=_sp)
103-
# ax5.scatter(np.mean(rcs.extended_frs), np.mean(rcs.extended_ns), label=_sp)
10497
ax6.scatter(fm, om, **kargs)
105-
# ax7.hist(rcs.extended_ois, bins=40, histtype='step', **kargs)
10698
hist_plot(rcs.extended_ois, ax7, bins=40, **kargs)
10799
ax8.plot(rcs.refcounts[:, 0], rcs.refcounts[:, 1], **kargs)
108-
# print(sn50, sm)
100+
109101
line = [sp1, sp2, nb, bm, int(min(ns)), int(max(ns)), int(np.median(ns)),
110102
round(np.mean(ns), 1), sm, round(fm, 2), round(om, 2)]
111103
print('\t'.join(map(str, line)))

soi/mcscan.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def __init__(self, info):
4242
try:
4343
self.species, self.raw_gene = id.split('|', 1)
4444
except ValueError:
45-
# logger.warn('Species id not found in `{}`, ignoring'.format(id))
4645
self.species, self.raw_gene = None, id
4746

4847
def __str__(self):
@@ -132,14 +131,10 @@ def parse_ks(self):
132131
GC, ML_Score, AICc, Akaike_Weight, Model) = self.info
133132
self.sequence = Sequence
134133
self.method = Method
135-
# try: self.ka = float(Ka)
136-
# except ValueError: self.ka =None
137134
try:
138135
self.ks = float(Ks)
139136
except ValueError:
140137
self.ks = 0 # too few substitution, NA
141-
# try: self.kaks = float(Ka_Ks)
142-
# except ValueError: self.kaks = None
143138

144139
def parse_pair(self):
145140
if not hasattr(self, 'pair'):
@@ -2300,7 +2295,7 @@ def d_gff(self):
23002295
return Gff(self.gff).get_genes()
23012296

23022297
def get_trees(self): # gene trees
2303-
'''完全符合倍性比的基因树'''
2298+
'''Gene trees that perfectly matches the ploidy ratio.'''
23042299
from creat_ctl import sort_version
23052300
if not os.path.exists(self.tmpdir):
23062301
os.mkdir(self.tmpdir)
@@ -2916,7 +2911,7 @@ class ToAstral(ColinearGroups):
29162911
def __init__(self, input=None, pep=None, spsd=None, cds=None, tmpdir='tmp', root=None, both=True, suffix=None,
29172912
ncpu=50, max_taxa_missing=0.5, max_mean_copies=10, max_copies=5, singlecopy=False, onlyaln=False,
29182913
source=None, orthtype='orthologues', fast=True, concat=False, clean=False, overwrite=False,
2919-
aligner='muscle', trimal_opts='-automated1', iqtree_opts=''):
2914+
aligner='mafft', trimal_opts='-automated1', iqtree_opts=''):
29202915
self.input = input
29212916
self.pep = pep
29222917
self.cds = cds

0 commit comments

Comments
 (0)