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

Fixstart expose mincluster opt #77

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions circlator/start_fixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self,
input_assembly_fa,
outprefix,
min_percent_identity=70,
promer_mincluster=None,
genes_fa=None,
ignore=None,
verbose=False,
Expand All @@ -33,6 +34,7 @@ def __init__(self,
pyfastaq.tasks.file_to_dict(input_assembly_fa, self.input_assembly)

self.min_percent_identity = min_percent_identity
self.promer_mincluster = promer_mincluster
self.outprefix = os.path.abspath(outprefix)
self.verbose = verbose

Expand Down Expand Up @@ -108,7 +110,7 @@ def _write_fasta_plus_circularized_ends(cls, contigs, outfile, end_length, ignor


@classmethod
def _find_circular_using_promer(cls, outprefix, ref_genes_fa, contigs_dict, min_percent_id, end_length, log_fh, ignore=None):
def _find_circular_using_promer(cls, outprefix, ref_genes_fa, contigs_dict, min_percent_id, end_length, log_fh, ignore=None, promer_mincluster=None):
if ignore is None:
ignore = set()
promer_out = outprefix + '.promer'
Expand All @@ -126,6 +128,7 @@ def _find_circular_using_promer(cls, outprefix, ref_genes_fa, contigs_dict, min_
promer=True,
verbose=False,
maxmatch=True,
mincluster=promer_mincluster,
)
prunner.run()

Expand Down Expand Up @@ -303,7 +306,8 @@ def run(self):
self.min_percent_identity,
end_extend,
log_fh,
ignore=self.ignore
ignore=self.ignore,
promer_mincluster=self.promer_mincluster,
)

if self.verbose:
Expand Down
2 changes: 2 additions & 0 deletions circlator/tasks/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def run():

fixstart_group = parser.add_argument_group('fixstart options')
fixstart_group.add_argument('--genes_fa', help='FASTA file of genes to search for to use as start point. If this option is not used, a built-in set of dnaA genes is used', metavar='FILENAME')
fixstart_group.add_argument('--fixstart_mincluster', type=int, help='The -c|mincluster option of promer. If this option is used, it overrides promer\'s default value', metavar='INT')
fixstart_group.add_argument('--fixstart_min_id', type=float, help='Minimum percent identity of promer match between contigs and gene(s) to use as start point [%(default)s]', default=70, metavar='FLOAT')

options = parser.parse_args()
Expand Down Expand Up @@ -249,6 +250,7 @@ def run():
clean_fasta,
fixstart_prefix,
min_percent_identity=options.fixstart_min_id,
promer_mincluster=options.fixstart_mincluster,
genes_fa=options.genes_fa,
ignore=not_fix_start_file,
verbose=options.verbose
Expand Down
2 changes: 2 additions & 0 deletions circlator/tasks/fixstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def run():
usage = 'circlator fixstart [options] <assembly.fasta> <outprefix>')
parser.add_argument('--genes_fa', help='FASTA file of genes to search for to use as start point. If this option is not used, a built-in set of dnaA genes is used', metavar='FILENAME')
parser.add_argument('--ignore', help='Absolute path to file of IDs of contigs to not change', metavar='FILENAME')
parser.add_argument('--mincluster', type=int, help='The -c|mincluster option of promer. If this option is used, it overrides promer\'s default value', metavar='INT')
parser.add_argument('--min_id', type=float, help='Minimum percent identity of promer match between contigs and gene(s) to use as start point [%(default)s]', default=70, metavar='FLOAT')
parser.add_argument('--verbose', action='store_true', help='Be verbose')
parser.add_argument('assembly_fa', help='Name of input FASTA file', metavar='assembly.fasta')
Expand All @@ -17,6 +18,7 @@ def run():
options.assembly_fa,
options.outprefix,
min_percent_identity=options.min_id,
promer_mincluster=options.mincluster,
genes_fa=options.genes_fa,
ignore=options.ignore,
verbose=options.verbose,
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='circlator',
version='1.3.1',
version='1.4.0',
description='circlator: a tool to circularise genome assemblies',
packages = find_packages(),
package_data={'circlator': ['data/*']},
Expand All @@ -21,7 +21,7 @@
'openpyxl',
'pyfastaq >= 3.12.1',
'pysam >= 0.8.1',
'pymummer>=0.7.1',
'pymummer>=0.9.0',
],
license='GPLv3',
classifiers=[
Expand Down