From 0bcb8742ed6f14d40f41ca540072fe25d6e4bbcd Mon Sep 17 00:00:00 2001 From: Peter van Heusden Date: Tue, 13 Oct 2020 11:37:45 +0200 Subject: [PATCH] Make species_table param optional --- conda/meta.yaml | 2 +- lukasa.py | 10 +++++++--- protein_evidence_mapping.cwl | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index f653204..6adec57 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -36,5 +36,5 @@ about: summary: "Fast and accurate mapping of proteins against eukaryotic genomes" description: | Lukasa combines MetaEUK and spaln to rapidly identify matches between proteins and genomic contigs and - accurately map the proteins to the identified regions. The output is GFF3, suitable for use in + accurately align the proteins to the identified regions. The output is GFF3 format, suitable for use in eukaryotic genome annotation. diff --git a/lukasa.py b/lukasa.py index 581d15e..a3abd53 100644 --- a/lukasa.py +++ b/lukasa.py @@ -16,7 +16,7 @@ class: File format: edam:format_1929 path: {} -species_table: {} +{} $namespaces: edam: http://edamontology.org/ @@ -46,15 +46,19 @@ def is_fasta(input_filename): parser.add_argument("--workflow_dir", default=cwl_workflow_dir) parser.add_argument("contigs_filename", help="File with genomic contigs") parser.add_argument("proteins_filename", help="File with proteins to map") - parser.add_argument("species_table", help="spaln species table to use") + parser.add_argument("--species_table", help="spaln species table to use") args = parser.parse_args() if not is_fasta(args.contigs_filename) or not is_fasta(args.proteins_filename): sys.exit("Error: Input files must be in FASTA format") cwl_input_file = tempfile.NamedTemporaryFile(delete=False, mode="w") + if args.species_table is not None: + species_table_string = 'species_table: {}'.format(args.species_table) + else: + species_table_string = '' cwl_input_file.write( template.format( - abspath(args.contigs_filename), abspath(args.proteins_filename), args.species_table + abspath(args.contigs_filename), abspath(args.proteins_filename), species_table_string ) ) cwl_input_file.close() diff --git a/protein_evidence_mapping.cwl b/protein_evidence_mapping.cwl index 8693ddf..7966d5e 100644 --- a/protein_evidence_mapping.cwl +++ b/protein_evidence_mapping.cwl @@ -10,7 +10,7 @@ inputs: type: File format: edam:format_1929 species_table: - type: string + type: string? outputs: spaln_out: type: File