Skip to content

Commit

Permalink
added default length settings as per code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mikerobeson committed Nov 19, 2024
1 parent dac2412 commit 4a4030a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 8 additions & 6 deletions rescript/extract_seq_segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def extract_seq_segments(input_sequences: DNAFASTAFormat,
reference_segment_sequences: DNAFASTAFormat,
perc_identity: float = 0.7,
target_coverage: float = 0.9,
min_seq_len: int = None,
max_seq_len: int = None,
min_seq_len: int = 32,
max_seq_len: int = 50000,
threads: int = 1
) -> (DNAFASTAFormat, DNAFASTAFormat):
# Note: the `--db` is actually comprised of the short amplicon
Expand Down Expand Up @@ -44,13 +44,15 @@ def extract_seq_segments(input_sequences: DNAFASTAFormat,
'--id', str(perc_identity),
'--target_cov', str(target_coverage),
'--strand', 'plus',
'--minseqlength', str(min_seq_len),
'--maxseqlength', str(max_seq_len),
'--threads', str(threads),
'--qmask', 'none',
'--qsegout', extr_f.name,
'--notmatched', no_match_f.name]
if min_seq_len:
cmd += ['--minseqlength', '%i' % min_seq_len]
if max_seq_len:
cmd += ['--maxseqlength', '%i' % max_seq_len]
# if min_seq_len:
# cmd += ['--minseqlength', '%i' % min_seq_len]
# if max_seq_len:
# cmd += ['--maxseqlength', '%i' % max_seq_len]
run_command(cmd)
return (extr_seq_segs, no_matches)
6 changes: 2 additions & 4 deletions rescript/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,12 +1154,10 @@
'from \'input-sequences\'.',
'min_seq_len': 'Minimum length of reference sequence segment '
'allowed for searching. Any sequence less than '
'this will be discarded. If not set, default '
'program settings will be used.',
'this will be discarded.',
'max_seq_len': 'Maximum length of reference sequence segment '
'allowed for searching. Any sequence greater '
'than this will be discarded. If not set, '
'default program settings will be used.'},
'than this will be discarded.'},
output_descriptions={
'extracted_sequence_segments': 'Extracted sequence segments '
'from \'input-sequences\' '
Expand Down

0 comments on commit 4a4030a

Please sign in to comment.