Skip to content

Commit 255737a

Browse files
committed
Export min / max intron length parameters
1 parent 3a51491 commit 255737a

5 files changed

Lines changed: 58 additions & 22 deletions

File tree

galaxy/lukasa.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<tool id="lukasa" name="Lukasa" version="@TOOL_VERSION@+galaxy0" python_template_version="3.5">
22
<description>Align protein evidence against genomic contigs using metaeuk and spaln</description>
33
<macros>
4-
<token name="@TOOL_VERSION@">0.11.0</token>
4+
<token name="@TOOL_VERSION@">0.12.0</token>
55
<!-- note that this DOI is for lukasa 0.0.6 - update as needed -->
66
<token name="@DOI@">10.5281/zenodo.4084862</token>
77
</macros>

lukasa.py

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,33 @@
99
import tempfile
1010
from os.path import abspath
1111

12-
template = """contigs_fasta:
13-
class: File
14-
format: edam:format_1929
15-
path: {}
16-
proteins_fasta:
17-
class: File
18-
format: edam:format_1929
19-
path: {}
20-
{}
2112

22-
$namespaces:
23-
edam: http://edamontology.org/
24-
$schemas:
25-
- http://edamontology.org/EDAM_1.18.owl
26-
"""
13+
def build_template(
14+
contig_path: str,
15+
protein_path: str,
16+
species_table: str = "",
17+
max_intron: str = "",
18+
min_intron: str = "",
19+
):
20+
template = f"""
21+
contigs_fasta:
22+
class: File
23+
format: edam:format_1929
24+
path: {contig_path}
25+
proteins_fasta:
26+
class: File
27+
format: edam:format_1929
28+
path: {protein_path}
29+
{max_intron}
30+
{min_intron}
31+
{species_table}
32+
33+
$namespaces:
34+
edam: http://edamontology.org/
35+
$schemas:
36+
- http://edamontology.org/EDAM_1.18.owl
37+
"""
38+
return template
2739

2840

2941
def is_fasta(input_filename):
@@ -45,6 +57,8 @@ def is_fasta(input_filename):
4557
)
4658
parser.add_argument("--output_filename", default="spaln_out.gff3")
4759
parser.add_argument("--workflow_dir", default=cwl_workflow_dir)
60+
parser.add_argument("--max_intron", type=int, help="Maximum intron length")
61+
parser.add_argument("--min_intron", type=int, help="Minimum intron length")
4862
parser.add_argument("contigs_filename", help="File with genomic contigs")
4963
parser.add_argument("proteins_filename", help="File with proteins to map")
5064
parser.add_argument("--species_table", help="spaln species table to use")
@@ -53,15 +67,21 @@ def is_fasta(input_filename):
5367
sys.exit("Error: Input files must be in FASTA format")
5468

5569
cwl_input_file = tempfile.NamedTemporaryFile(delete=False, mode="w")
70+
71+
species_table = max_intron = min_intron = ""
5672
if args.species_table is not None:
57-
species_table_string = "species_table: {}".format(args.species_table)
58-
else:
59-
species_table_string = ""
73+
species_table = "species_table: {}".format(args.species_table)
74+
if args.max_intron is not None:
75+
max_intron = f"max_intron: {args.max_intron}\n"
76+
if args.min_intron is not None:
77+
min_intron = f"min_intron: {args.min_intron}\n"
6078
cwl_input_file.write(
61-
template.format(
79+
build_template(
6280
abspath(args.contigs_filename),
6381
abspath(args.proteins_filename),
64-
species_table_string,
82+
species_table=species_table,
83+
max_intron=max_intron,
84+
min_intron=min_intron,
6585
)
6686
)
6787
cwl_input_file.close()

protein_evidence_mapping.cwl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ inputs:
1414
species_table:
1515
label: "Spaln species table to use (optional)"
1616
type: string?
17+
max_intron:
18+
label: "Maximum intron length"
19+
type: int?
20+
doc: "Maximum intron length, passed to metaeuk"
21+
min_intron:
22+
label: "Minimum intron length"
23+
type: int?
24+
doc: "Minimum intron length, passed to metaeuk and spaln"
1725
outputs:
1826
spaln_out:
1927
type: File
@@ -30,6 +38,8 @@ steps:
3038
in:
3139
contigs: contigs_fasta
3240
query: proteins_fasta
41+
max_intron: max_intron
42+
min_intron: min_intron
3343
out:
3444
- output_fasta
3545
samtools_index_contigs:
@@ -80,6 +90,7 @@ steps:
8090
genome_fasta: extract_region_pairs/contig_fasta
8191
query_fasta: extract_region_pairs/protein_fasta
8292
species: species_table
93+
min_intron: min_intron
8394
output_format:
8495
default: 0
8596
out:

tools/metaeuk_easy_predict.cwl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ inputs:
1919
prefix: --metaeuk-eval
2020
position: 1
2121
max_intron:
22-
type: float?
22+
type: int?
2323
inputBinding:
2424
prefix: --max-intron
2525
position: 1
@@ -29,7 +29,7 @@ inputs:
2929
prefix: --metaeuk-tcov
3030
position: 1
3131
min_intron:
32-
type: float?
32+
type: int?
3333
inputBinding:
3434
prefix: --min-intron
3535
position: 1

tools/spaln.cwl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ inputs:
1010
format: edam:format_1929
1111
inputBinding:
1212
position: 10
13+
min_intron:
14+
type: int?
15+
inputBinding:
16+
prefix: -yL
17+
position: 1
1318
output_format:
1419
type: int?
1520
inputBinding:

0 commit comments

Comments
 (0)