Skip to content

Commit

Permalink
gff option for filter subcmd
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangrengang committed Jul 25, 2024
1 parent 94eb57b commit 38dc125
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Binary file not shown.
6 changes: 3 additions & 3 deletions soi/dot_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def main(args):
ploidy=args.plot_ploidy, ploidy_data = ploidy_data, ortholog_graph=ortholog_graph, **args.__dict__
)
def is_mcscan_style(labels):
matches = [re.compile(r'[A-Za-z]{2}\d+').match(lab) for lab in labels]
matches = [re.compile(r'[A-Za-z]{2}\d{1,5}[A-Za-z]*$').match(lab) for lab in labels]
return all(matches)
def _remove_prefix(labels):
if is_mcscan_style(labels):
Expand Down Expand Up @@ -701,10 +701,10 @@ def parse_collinearity(collinearity, gff, chrs1, chrs2, kaks, homology,
xblocks += [points]
# print(xblocks)
if len(xblocks) == 0:
logger.warn('No genes are retained or can be found in `Gff`. Check your files')
logger.warn('No genes are retained or can be found in `Gff`. Check your files.')
ksx = set(ksx)
if len(ksx) == 1:
logger.warn('All Ks have the same value: {}'.format(ksx))
logger.warn('All Ks have the same value: {}. Ks color map will be disabled'.format(ksx))
if matrix is not None:
fout = open(matrix, 'w')
d_matrix = to_matrix(d_blocks)
Expand Down
3 changes: 3 additions & 0 deletions soi/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def args_filter(parser):
parser.add_argument('-n', '-min_n', type=int, default=0,
dest='min_n', metavar='INT',
help="Minimum gene number in a block [default=%(default)s]")
parser.add_argument('-g', '-gff', type=str,
dest='gff', metavar='FILE',
help="Gff file. [required for `-d`]")
parser.add_argument('-d', '-min_dist', type=int, default=None,
dest='min_dist', metavar='INT',
help="Minimum distance to remove a tandem repeated block [default=%(default)s]")
Expand Down

0 comments on commit 38dc125

Please sign in to comment.