Skip to content

Commit

Permalink
Make species_table param optional
Browse files Browse the repository at this point in the history
  • Loading branch information
pvanheus committed Oct 13, 2020
1 parent 5525d73 commit 0bcb874
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
10 changes: 7 additions & 3 deletions lukasa.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class: File
format: edam:format_1929
path: {}
species_table: {}
{}
$namespaces:
edam: http://edamontology.org/
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion protein_evidence_mapping.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
type: File
format: edam:format_1929
species_table:
type: string
type: string?
outputs:
spaln_out:
type: File
Expand Down

0 comments on commit 0bcb874

Please sign in to comment.