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

Set nucmer opts to match nucmers defaults, but add --maxmatch #57

Merged
merged 1 commit into from
Apr 21, 2016
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
9 changes: 5 additions & 4 deletions ariba/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def __init__(self,
min_scaff_depth=10,
min_scaff_length=50,
nucmer_min_id=90,
nucmer_min_len=50,
nucmer_breaklen=50,
nucmer_min_len=20,
nucmer_breaklen=200,
spades_other_options=None,
sspace_k=20,
sspace_sd=0.4,
Expand Down Expand Up @@ -214,7 +214,7 @@ def _gap_fill_with_gapfiller(self):


@staticmethod
def _fix_contig_orientation(contigs_fa, ref_fa, outfile, min_id=90, min_length=50, breaklen=50):
def _fix_contig_orientation(contigs_fa, ref_fa, outfile, min_id=90, min_length=20, breaklen=200):
'''Changes orientation of each contig to match the reference, when possible.
Returns a set of names of contigs that had hits in both orientations to the reference'''
if not os.path.exists(contigs_fa):
Expand All @@ -228,6 +228,7 @@ def _fix_contig_orientation(contigs_fa, ref_fa, outfile, min_id=90, min_length=5
min_id=min_id,
min_length=min_length,
breaklen=breaklen,
maxmatch=True,
).run()

to_revcomp = set()
Expand Down Expand Up @@ -289,7 +290,7 @@ def run(self):
self.log_fh = None
return

contigs_both_strands = self._fix_contig_orientation(self.gapfilled_length_filtered, self.ref_fasta, self.final_assembly_fa)
contigs_both_strands = self._fix_contig_orientation(self.gapfilled_length_filtered, self.ref_fasta, self.final_assembly_fa, min_id=self.nucmer_min_id, min_length=self.nucmer_min_len, breaklen=self.nucmer_breaklen)
self.has_contigs_on_both_strands = len(contigs_both_strands) > 0
pyfastaq.tasks.file_to_dict(self.final_assembly_fa, self.sequences)

Expand Down
5 changes: 3 additions & 2 deletions ariba/assembly_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def __init__(self,
outprefix,
refdata,
nucmer_min_id=90,
nucmer_min_len=50,
nucmer_breaklen=50,
nucmer_min_len=20,
nucmer_breaklen=200,
assembled_threshold=0.95,
unique_threshold=0.03,
):
Expand Down Expand Up @@ -45,6 +45,7 @@ def _run_nucmer(self):
min_id=self.nucmer_min_id,
min_length=self.nucmer_min_len,
breaklen=self.nucmer_breaklen,
maxmatch=True,
show_snps=True
).run()

Expand Down
4 changes: 2 additions & 2 deletions ariba/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def __init__(self,
max_insert=1000,
min_scaff_depth=10,
nucmer_min_id=90,
nucmer_min_len=50,
nucmer_breaklen=50,
nucmer_min_len=20,
nucmer_breaklen=200,
reads_insert=500,
sspace_k=20,
sspace_sd=0.4,
Expand Down
4 changes: 2 additions & 2 deletions ariba/clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def __init__(self,
max_insert=1000,
min_scaff_depth=10,
nucmer_min_id=90,
nucmer_min_len=50,
nucmer_breaklen=50,
nucmer_min_len=20,
nucmer_breaklen=200,
assembled_threshold=0.95,
unique_threshold=0.03,
bowtie2_preset='very-sensitive-local',
Expand Down
4 changes: 2 additions & 2 deletions ariba/tasks/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def run():

nucmer_group = parser.add_argument_group('nucmer options')
nucmer_group.add_argument('--nucmer_min_id', type=int, help='Minimum alignment identity (delta-filter -i) [%(default)s]', default=90, metavar='INT')
nucmer_group.add_argument('--nucmer_min_len', type=int, help='Minimum alignment length (delta-filter -i) [%(default)s]', default=50, metavar='INT')
nucmer_group.add_argument('--nucmer_breaklen', type=int, help='Value to use for -breaklen when running nucmer [%(default)s]', default=50, metavar='INT')
nucmer_group.add_argument('--nucmer_min_len', type=int, help='Minimum alignment length (delta-filter -i) [%(default)s]', default=20, metavar='INT')
nucmer_group.add_argument('--nucmer_breaklen', type=int, help='Value to use for -breaklen when running nucmer [%(default)s]', default=200, metavar='INT')

assembly_group = parser.add_argument_group('Assembly options')
assembly_group.add_argument('--assembly_cov', type=int, help='Target read coverage when sampling reads for assembly [%(default)s]', default=100, metavar='INT')
Expand Down