Skip to content

Commit

Permalink
Do not allow both --no_cdhit and --cdhit_clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
martinghunt committed May 10, 2016
1 parent bb67c13 commit bedabc9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ariba/tasks/prepareref.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import argparse
from ariba import ref_preparer, external_progs, versions

Expand All @@ -14,8 +15,8 @@ def run():
input_group.add_argument('--metadata', help='tsv file of metadata about the reference sequences', metavar='FILENAME')

cdhit_group = parser.add_argument_group('cd-hit options')
cdhit_group.add_argument('--no_cdhit', action='store_true', help='Do not run cd-hit. Each input sequence is put into its own "cluster"')
cdhit_group.add_argument('--cdhit_clusters', help='File specifying how the sequences should be clustered. Will be used instead of running cdhit. Format is one cluster per line. Sequence names separated by whitespace. First name in line is the cluster representative', metavar='FILENAME')
cdhit_group.add_argument('--no_cdhit', action='store_true', help='Do not run cd-hit. Each input sequence is put into its own "cluster". Incompatible with --cdhit_clusters.')
cdhit_group.add_argument('--cdhit_clusters', help='File specifying how the sequences should be clustered. Will be used instead of running cdhit. Format is one cluster per line. Sequence names separated by whitespace. First name in line is the cluster representative. Incompatible with --no_cdhit', metavar='FILENAME')
cdhit_group.add_argument('--cdhit_min_id', type=float, help='Sequence identity threshold (cd-hit option -c) [%(default)s]', default=0.9, metavar='FLOAT')
cdhit_group.add_argument('--cdhit_min_length', type=float, help='length difference cutoff (cd-hit option -s) [%(default)s]', default=0.9, metavar='FLOAT')

Expand All @@ -29,6 +30,9 @@ def run():
parser.add_argument('outdir', help='Output directory (must not already exist)')
options = parser.parse_args()

if options.no_cdhit and options.cdhit_clusters is not None:
sys.exit('Cannot use both --no_cdhit and --cdhit_clusters. Neither or exactly one of those options must be used')

extern_progs, version_report_lines = versions.get_all_versions()
if options.verbose:
print(*version_report_lines, sep='\n')
Expand Down

0 comments on commit bedabc9

Please sign in to comment.