From e6d23812675b230dcf821e6a7a09d08ae4c5f746 Mon Sep 17 00:00:00 2001 From: Remi Planel <rplanel@pasteur.fr> Date: Wed, 26 Feb 2020 11:33:58 +0100 Subject: [PATCH] Change command option name --- crisprbact/cli.py | 59 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/crisprbact/cli.py b/crisprbact/cli.py index 3b30605..8f7552f 100644 --- a/crisprbact/cli.py +++ b/crisprbact/cli.py @@ -52,19 +52,28 @@ def predict(config): @predict.command() -@click.option("-t", "--target", type=str, required=True) -@click.option("-g", "--genome", type=click.File("rU"), help="Genome") @click.option( - "-gf", - "--genome-format", + "-t", "--target", type=str, required=True, help="Sequence file to target", +) +@click.option( + "-s", + "--off-target-sequence", + type=click.File("rU"), + help="Sequence in which you want to find off-targets", +) +@click.option( + "-w", + "--off-target-sequence-format", type=click.Choice(["fasta", "gb", "genbank"]), default=GENOME_FORMAT, show_default=True, - help="Genome Format", + help="Sequence in which you want to find off-targets format", ) @click.argument("output-file", type=click.File("w"), default="-") @pass_config -def from_str(config, target, genome, genome_format, output_file): +def from_str( + config, target, off_target_sequence, off_target_sequence_format, output_file +): """ Outputs candidate guide RNAs for the S. pyogenes dCas9 with predicted on-target activity from a target gene. @@ -74,8 +83,8 @@ def from_str(config, target, genome, genome_format, output_file): """ if config.verbose: print_parameters(target) - if genome: - genome_fh = SeqIO.parse(genome, genome_format) + if off_target_sequence: + genome_fh = SeqIO.parse(off_target_sequence, off_target_sequence_format) else: genome_fh = None guide_rnas = on_target_predict(target, genome_fh) @@ -86,31 +95,47 @@ def from_str(config, target, genome, genome_format, output_file): @predict.command() @click.option( - "-t", "--target", type=click.File("rU"), required=True, help="Sequence file", + "-t", + "--target", + type=click.File("rU"), + required=True, + help="Sequence file to target", ) @click.option( "-f", "--seq-format", type=click.Choice(["fasta", "gb", "genbank"]), - help="Sequence file format", + help="Sequence file to target format", default="fasta", show_default=True, ) # @click.option( # "-s", "--seed-size", type=click.IntRange(8, 15, clamp=True), # ) -@click.option("-g", "--genome", type=click.File("rU"), help="Genome") @click.option( - "-gf", - "--genome-format", + "-s", + "--off-target-sequence", + type=click.File("rU"), + help="Sequence in which you want to find off-targets", +) +@click.option( + "-w", + "--off-target-sequence-format", type=click.Choice(["fasta", "gb", "genbank"]), default=GENOME_FORMAT, show_default=True, - help="Genome Format", + help="Sequence in which you want to find off-targets format", ) @click.argument("output-file", type=click.File("w"), default="-") @pass_config -def from_seq(config, target, seq_format, genome, genome_format, output_file): +def from_seq( + config, + target, + seq_format, + off_target_sequence, + off_target_sequence_format, + output_file, +): """ Outputs candidate guide RNAs for the S. pyogenes dCas9 with predicted on-target activity from a target gene. @@ -125,8 +150,8 @@ def from_seq(config, target, seq_format, genome, genome_format, output_file): for record in SeqIO.parse(target, seq_format): if config.verbose: click.secho(" - search guide RNAs for %s " % record.id, fg=fg) - if genome: - genome_fh = SeqIO.parse(genome, genome_format) + if off_target_sequence: + genome_fh = SeqIO.parse(off_target_sequence, off_target_sequence_format) else: genome_fh = None guide_rnas = on_target_predict(str(record.seq), genome_fh) -- GitLab