diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextalign_align_nucleotides_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextalign_align_nucleotides_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..1efc632c003dd818c386da8e82fd79db133acef3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextalign_align_nucleotides_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "f4c05ec6e22cbf0f310593f7d2bda22c2a218f805399dfe85741184bdf6403f3", + "elapsed_seconds": 5.505701541900635, + "usage": { + "prompt_tokens": 1130, + "completion_tokens": 1101, + "total_tokens": 2231, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1130 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "edf44ccb-87fe-45ab-b3f8-17d6359e10cd" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextclade_analyze_sequence_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextclade_analyze_sequence_test.json new file mode 100644 index 0000000000000000000000000000000000000000..b4c3f8a8bef292efa74b3ec3814e7a17d09e24a8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextclade_analyze_sequence_test.json @@ -0,0 +1,204 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "nextclade", + "version": "3.23.0", + "build": "h9ee0642_0", + "executable": "nextclade", + "subcommand": "run", + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "analyze_sequence", + "description": "Run sequence analysis: alignment, mutation calling, clade assignment, quality checks and phylogenetic placement" + }, + "arguments": [ + { + "name": "reference_fasta", + "flag": "-r", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to reference FASTA file" + }, + { + "name": "query_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Path to query FASTA file" + }, + { + "name": "output_fasta", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to output FASTA file" + }, + { + "name": "output_json", + "flag": "-J", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to output JSON file" + } + ], + "inputs": [ + { + "name": "reference_fasta", + "artifact_type": "fasta", + "binding": "reference_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + }, + { + "name": "query_fasta", + "artifact_type": "fasta", + "binding": "query_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_fasta", + "artifact_type": "fasta", + "binding": "output_fasta", + "assertions": [ + { + "name": "created", + "status": "declared" + } + ] + }, + { + "name": "output_json", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "created", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_fasta_valid", + "artifact_type": "fasta", + "binding": "output_fasta", + "assertions": [ + { + "name": "valid_fasta", + "status": "declared" + } + ] + }, + { + "name": "output_json_valid", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "valid_json", + "status": "declared" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "Usage: nextclade [OPTIONS] ", + "excerpt": "Usage: nextclade [OPTIONS] ", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev2", + "field": "tool.subcommand", + "source_type": "help_text", + "locator": "Commands: run", + "excerpt": "run Run sequence analysis: alignment, mutation calling, clade assignment, quality checks and phylogenetic placement", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev3", + "field": "arguments.reference_fasta.flag", + "source_type": "help_text", + "locator": "nextclade run --help", + "excerpt": "-r", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev4", + "field": "arguments.query_fasta.position", + "source_type": "help_text", + "locator": "nextclade run --help", + "excerpt": "positional", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev5", + "field": "arguments.output_fasta.flag", + "source_type": "help_text", + "locator": "nextclade run --help", + "excerpt": "-o", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev6", + "field": "arguments.output_json.flag", + "source_type": "help_text", + "locator": "nextclade run --help", + "excerpt": "-J", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "nextclade", + "run", + "-r", + "{reference_fasta}", + "-o", + "{output_fasta}", + "-J", + "{output_json}", + "{query_fasta}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextclade_analyze_sequence_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextclade_analyze_sequence_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..0856061157dc2b6abc7fd4c686b967b0424c296a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextclade_analyze_sequence_test.json.raw.txt @@ -0,0 +1,204 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "nextclade", + "version": "3.23.0", + "build": "h9ee0642_0", + "executable": "nextclade", + "subcommand": "run", + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "analyze_sequence", + "description": "Run sequence analysis: alignment, mutation calling, clade assignment, quality checks and phylogenetic placement" + }, + "arguments": [ + { + "name": "reference_fasta", + "flag": "-r", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to reference FASTA file" + }, + { + "name": "query_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Path to query FASTA file" + }, + { + "name": "output_fasta", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to output FASTA file" + }, + { + "name": "output_json", + "flag": "-J", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to output JSON file" + } + ], + "inputs": [ + { + "name": "reference_fasta", + "artifact_type": "fasta", + "binding": "reference_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + }, + { + "name": "query_fasta", + "artifact_type": "fasta", + "binding": "query_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_fasta", + "artifact_type": "fasta", + "binding": "output_fasta", + "assertions": [ + { + "name": "created", + "status": "declared" + } + ] + }, + { + "name": "output_json", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "created", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_fasta_valid", + "artifact_type": "fasta", + "binding": "output_fasta", + "assertions": [ + { + "name": "valid_fasta", + "status": "declared" + } + ] + }, + { + "name": "output_json_valid", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "valid_json", + "status": "declared" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "Usage: nextclade [OPTIONS] ", + "excerpt": "Usage: nextclade [OPTIONS] ", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev2", + "field": "tool.subcommand", + "source_type": "help_text", + "locator": "Commands: run", + "excerpt": "run Run sequence analysis: alignment, mutation calling, clade assignment, quality checks and phylogenetic placement", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev3", + "field": "arguments.reference_fasta.flag", + "source_type": "help_text", + "locator": "nextclade run --help", + "excerpt": "-r", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev4", + "field": "arguments.query_fasta.position", + "source_type": "help_text", + "locator": "nextclade run --help", + "excerpt": "positional", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev5", + "field": "arguments.output_fasta.flag", + "source_type": "help_text", + "locator": "nextclade run --help", + "excerpt": "-o", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev6", + "field": "arguments.output_json.flag", + "source_type": "help_text", + "locator": "nextclade run --help", + "excerpt": "-J", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "nextclade", + "run", + "-r", + "{reference_fasta}", + "-o", + "{output_fasta}", + "-J", + "{output_json}", + "{query_fasta}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextclade_analyze_sequence_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextclade_analyze_sequence_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..79c5b507c14a99e8ca3266a34935e74169710022 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/nextclade_analyze_sequence_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "10f1b4f516d5b90f5b5572129e1a00197407ba1d4332bff69f376f72e5f27797", + "elapsed_seconds": 6.745133638381958, + "usage": { + "prompt_tokens": 1557, + "completion_tokens": 1347, + "total_tokens": 2904, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1557 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "94799388-ef23-41c7-86cb-17358e48b69e" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ngmlr_align_long_reads_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ngmlr_align_long_reads_test.json new file mode 100644 index 0000000000000000000000000000000000000000..41862ca9f2c73ae550a686371d05845eeb4cbaa4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ngmlr_align_long_reads_test.json @@ -0,0 +1,208 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ngmlr", + "version": "0.2.7", + "build": "h077b44d_10", + "executable": "ngmlr", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "align_long_reads", + "description": "Align long reads to a reference genome using ngmlr." + }, + "arguments": [ + { + "name": "reference_fasta", + "flag": "-r", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the reference genome (FASTA/Q, can be gzipped)." + }, + { + "name": "reads_fastq", + "flag": "-q", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the read file (FASTA/Q)." + }, + { + "name": "output_sam", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output SAM file path." + }, + { + "name": "threads", + "flag": "-t", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Number of threads (fixed to 1)." + }, + { + "name": "skip_write", + "flag": "--skip-write", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Don't write reference index to disk." + }, + { + "name": "no_progress", + "flag": "--no-progress", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Don't print progress info while mapping." + } + ], + "inputs": [ + { + "name": "reference_fasta", + "artifact_type": "file", + "binding": "reference_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Reference FASTA file must exist." + } + ] + }, + { + "name": "reads_fastq", + "artifact_type": "file", + "binding": "reads_fastq", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Reads file must exist." + } + ] + } + ], + "outputs": [ + { + "name": "output_sam", + "artifact_type": "file", + "binding": "output_sam", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output SAM file will be created." + } + ] + } + ], + "validators": [ + { + "name": "output_sam_valid", + "artifact_type": "file", + "binding": "output_sam", + "assertions": [ + { + "name": "sam_format", + "status": "inferred", + "description": "Output file is expected to be in SAM format." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.version", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "ngmlr 0.2.7 (build: Jun 21 2024 14:45:51, start: 2026-04-30.09:13:48)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.reference_fasta", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "-r , --reference (required) Path to the reference genome (FASTA/Q, can be gzipped)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.reads_fastq", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "-q , --query Path to the read file (FASTA/Q) [/dev/stdin]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.output_sam", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "-o , --output Adds RG:Z: to all alignments in SAM/BAM [none]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.threads", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "-t , --threads Number of threads [1]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.skip_write", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "--skip-write Don't write reference index to disk [false]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.no_progress", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "--no-progress Don't print progress info while mapping [false]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "ngmlr", + "-r", + "{reference_fasta}", + "-q", + "{reads_fastq}", + "-o", + "{output_sam}", + "-t", + "1", + "--skip-write", + "--no-progress" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ngmlr_align_long_reads_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ngmlr_align_long_reads_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..7e00d1663a3f67c827c3b7adec4282a752c474f5 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ngmlr_align_long_reads_test.json.raw.txt @@ -0,0 +1,208 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ngmlr", + "version": "0.2.7", + "build": "h077b44d_10", + "executable": "ngmlr", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "align_long_reads", + "description": "Align long reads to a reference genome using ngmlr." + }, + "arguments": [ + { + "name": "reference_fasta", + "flag": "-r", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the reference genome (FASTA/Q, can be gzipped)." + }, + { + "name": "reads_fastq", + "flag": "-q", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the read file (FASTA/Q)." + }, + { + "name": "output_sam", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output SAM file path." + }, + { + "name": "threads", + "flag": "-t", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Number of threads (fixed to 1)." + }, + { + "name": "skip_write", + "flag": "--skip-write", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Don't write reference index to disk." + }, + { + "name": "no_progress", + "flag": "--no-progress", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Don't print progress info while mapping." + } + ], + "inputs": [ + { + "name": "reference_fasta", + "artifact_type": "file", + "binding": "reference_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Reference FASTA file must exist." + } + ] + }, + { + "name": "reads_fastq", + "artifact_type": "file", + "binding": "reads_fastq", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Reads file must exist." + } + ] + } + ], + "outputs": [ + { + "name": "output_sam", + "artifact_type": "file", + "binding": "output_sam", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output SAM file will be created." + } + ] + } + ], + "validators": [ + { + "name": "output_sam_valid", + "artifact_type": "file", + "binding": "output_sam", + "assertions": [ + { + "name": "sam_format", + "status": "inferred", + "description": "Output file is expected to be in SAM format." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.version", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "ngmlr 0.2.7 (build: Jun 21 2024 14:45:51, start: 2026-04-30.09:13:48)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.reference_fasta", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "-r , --reference (required) Path to the reference genome (FASTA/Q, can be gzipped)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.reads_fastq", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "-q , --query Path to the read file (FASTA/Q) [/dev/stdin]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.output_sam", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "-o , --output Adds RG:Z: to all alignments in SAM/BAM [none]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.threads", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "-t , --threads Number of threads [1]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.skip_write", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "--skip-write Don't write reference index to disk [false]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.no_progress", + "source_type": "help_text", + "locator": "ngmlr --help", + "excerpt": "--no-progress Don't print progress info while mapping [false]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "ngmlr", + "-r", + "{reference_fasta}", + "-q", + "{reads_fastq}", + "-o", + "{output_sam}", + "-t", + "1", + "--skip-write", + "--no-progress" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ngmlr_align_long_reads_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ngmlr_align_long_reads_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..c14eff9f676c512dfabb930b1e643e4635a8211d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ngmlr_align_long_reads_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "3fa795d1ac0c428733abcfee80085074e305470d99600040f08012232014e0c9", + "elapsed_seconds": 7.894618034362793, + "usage": { + "prompt_tokens": 1704, + "completion_tokens": 1675, + "total_tokens": 3379, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1704 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "85e333f6-4bf5-47be-9db5-07cce81b8530" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ont-fast5-api_summarize_single_read_fast5_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ont-fast5-api_summarize_single_read_fast5_test.json new file mode 100644 index 0000000000000000000000000000000000000000..94d209818e0dee99f10a44412b2dd5ca86c855b9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ont-fast5-api_summarize_single_read_fast5_test.json @@ -0,0 +1,170 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ont-fast5-api", + "version": "0.4.1", + "build": "py36_0", + "executable": "python", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "summarize_single_read_fast5", + "description": "Extract channel metadata, tracking metadata, and raw signal from a single-read FAST5 file and write a JSON summary." + }, + "arguments": [ + { + "name": "input_fast5", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to the input single-read FAST5 file." + }, + { + "name": "output_json", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to the output JSON file." + } + ], + "inputs": [ + { + "name": "input_fast5", + "artifact_type": "fast5", + "binding": "input_fast5", + "assertions": [ + { + "name": "single_read", + "status": "inferred", + "description": "Input is expected to be a single-read FAST5 file." + } + ] + } + ], + "outputs": [ + { + "name": "output_json", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "json_schema", + "status": "inferred", + "description": "Output JSON contains channel, read_count, raw, and tracking fields." + } + ] + } + ], + "validators": [ + { + "name": "input_fast5_exists", + "artifact_type": "fast5", + "binding": "input_fast5", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Input file must exist." + } + ] + }, + { + "name": "output_json_writable", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "writable", + "status": "inferred", + "description": "Output path must be writable." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ont-fast5-api-0.4.1-py36_0.tar.bz2", + "excerpt": "ont-fast5-api 0.4.1 py36_0", + "digest": "sha256:3ec0c7071c0a5d2a093c0f9cc83cbdc7" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ont-fast5-api-0.4.1-py36_0.tar.bz2", + "excerpt": "version: 0.4.1", + "digest": "sha256:3ec0c7071c0a5d2a093c0f9cc83cbdc7" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ont-fast5-api-0.4.1-py36_0.tar.bz2", + "excerpt": "build: py36_0", + "digest": "sha256:3ec0c7071c0a5d2a093c0f9cc83cbdc7" + }, + { + "id": "ev4", + "field": "tool.executable", + "source_type": "inferred", + "locator": "https://github.com/nanoporetech/ont_fast5_api", + "excerpt": "ont_fast5_api is a pure python project", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "summarize_single_read_fast5", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.input_fast5", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: argv1", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.output_json", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: argv2", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev8", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Use ont_fast5_api.Fast5File to read channel metadata, tracking metadata, and raw signal from one deterministic FAST5.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "python", + "-c", + "import json,sys; from ont_fast5_api.fast5_file import Fast5File; h=Fast5File(sys.argv[1]); r=h.get_raw_data(); d={'channel':h.get_channel_info()['channel_number'],'read_count':len(h.status.read_info),'raw':[int(x) for x in r.tolist()],'tracking':h.get_tracking_id()}; h.close(); open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')", + "{input_fast5}", + "{output_json}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ont-fast5-api_summarize_single_read_fast5_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ont-fast5-api_summarize_single_read_fast5_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..11686bcc58b0032cdffbf249dbc1e71784933fd6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ont-fast5-api_summarize_single_read_fast5_test.json.raw.txt @@ -0,0 +1,170 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ont-fast5-api", + "version": "0.4.1", + "build": "py36_0", + "executable": "python", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "summarize_single_read_fast5", + "description": "Extract channel metadata, tracking metadata, and raw signal from a single-read FAST5 file and write a JSON summary." + }, + "arguments": [ + { + "name": "input_fast5", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to the input single-read FAST5 file." + }, + { + "name": "output_json", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to the output JSON file." + } + ], + "inputs": [ + { + "name": "input_fast5", + "artifact_type": "fast5", + "binding": "input_fast5", + "assertions": [ + { + "name": "single_read", + "status": "inferred", + "description": "Input is expected to be a single-read FAST5 file." + } + ] + } + ], + "outputs": [ + { + "name": "output_json", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "json_schema", + "status": "inferred", + "description": "Output JSON contains channel, read_count, raw, and tracking fields." + } + ] + } + ], + "validators": [ + { + "name": "input_fast5_exists", + "artifact_type": "fast5", + "binding": "input_fast5", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Input file must exist." + } + ] + }, + { + "name": "output_json_writable", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "writable", + "status": "inferred", + "description": "Output path must be writable." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ont-fast5-api-0.4.1-py36_0.tar.bz2", + "excerpt": "ont-fast5-api 0.4.1 py36_0", + "digest": "sha256:3ec0c7071c0a5d2a093c0f9cc83cbdc7" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ont-fast5-api-0.4.1-py36_0.tar.bz2", + "excerpt": "version: 0.4.1", + "digest": "sha256:3ec0c7071c0a5d2a093c0f9cc83cbdc7" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ont-fast5-api-0.4.1-py36_0.tar.bz2", + "excerpt": "build: py36_0", + "digest": "sha256:3ec0c7071c0a5d2a093c0f9cc83cbdc7" + }, + { + "id": "ev4", + "field": "tool.executable", + "source_type": "inferred", + "locator": "https://github.com/nanoporetech/ont_fast5_api", + "excerpt": "ont_fast5_api is a pure python project", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "summarize_single_read_fast5", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.input_fast5", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: argv1", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.output_json", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: argv2", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev8", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Use ont_fast5_api.Fast5File to read channel metadata, tracking metadata, and raw signal from one deterministic FAST5.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "python", + "-c", + "import json,sys; from ont_fast5_api.fast5_file import Fast5File; h=Fast5File(sys.argv[1]); r=h.get_raw_data(); d={'channel':h.get_channel_info()['channel_number'],'read_count':len(h.status.read_info),'raw':[int(x) for x in r.tolist()],'tracking':h.get_tracking_id()}; h.close(); open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')", + "{input_fast5}", + "{output_json}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ont-fast5-api_summarize_single_read_fast5_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ont-fast5-api_summarize_single_read_fast5_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..a2d262a0915e46291c1bd1f32449c943d7257016 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ont-fast5-api_summarize_single_read_fast5_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "fdf4ef309f6111ee26c45649213b656d1c2124bbf5abfe344c1e931b2e6ed268", + "elapsed_seconds": 12.714971780776978, + "usage": { + "prompt_tokens": 9854, + "completion_tokens": 1597, + "total_tokens": 11451, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9854 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "b01c9f69-f14c-412a-96fe-189d228261ce" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/orthofinder_infer_orthogroups_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/orthofinder_infer_orthogroups_test.json new file mode 100644 index 0000000000000000000000000000000000000000..6892341488ff496a24e385b8d32ffb0833483f52 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/orthofinder_infer_orthogroups_test.json @@ -0,0 +1,134 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "orthofinder", + "version": "2.2.7", + "build": "0", + "executable": "orthofinder", + "subcommand": null, + "environment": "conda run -n bioenv_py_sc" + }, + "endpoint": { + "name": "infer_orthogroups", + "description": "Run DIAMOND all-vs-all and stop after orthogroup inference; copy date-named results to stable output paths." + }, + "arguments": [ + { + "name": "input_dir", + "flag": "-f", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Directory containing FASTA proteomes" + }, + { + "name": "orthogroups_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Stable output path for Orthogroups.csv" + }, + { + "name": "statistics_csv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Stable output path for Statistics_Overall.csv" + } + ], + "inputs": [ + { + "name": "input_dir", + "artifact_type": "directory", + "binding": "input_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input directory must exist" + } + ] + } + ], + "outputs": [ + { + "name": "orthogroups_tsv", + "artifact_type": "file", + "binding": "orthogroups_tsv", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output file must exist" + } + ] + }, + { + "name": "statistics_csv", + "artifact_type": "file", + "binding": "statistics_csv", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output file must exist" + } + ] + } + ], + "validators": [ + { + "name": "orthogroups_tsv_nonempty", + "artifact_type": "file", + "binding": "orthogroups_tsv", + "assertions": [ + { + "name": "nonempty", + "status": "declared", + "description": "Orthogroups file must be non-empty" + } + ] + }, + { + "name": "statistics_csv_nonempty", + "artifact_type": "file", + "binding": "statistics_csv", + "assertions": [ + { + "name": "nonempty", + "status": "declared", + "description": "Statistics file must be non-empty" + } + ] + } + ], + "evidence": [ + { + "id": "help_text", + "field": "arguments", + "source_type": "help_text", + "locator": "orthofinder --help", + "excerpt": "-f ... -og Stop after inferring orthogroups", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "bash", + "-lc", + "orthofinder -f '{input_dir}' -t 1 -a 1 -S diamond -og && result_dir=$(find '{input_dir}' -maxdepth 1 -type d -name 'Results_*' | sort | tail -1) && cp \"$result_dir/Orthogroups.csv\" '{orthogroups_tsv}' && cp \"$result_dir/Statistics_Overall.csv\" '{statistics_csv}'" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/orthofinder_infer_orthogroups_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/orthofinder_infer_orthogroups_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..996aca1e979773cbf8fb96367e0f728114707af8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/orthofinder_infer_orthogroups_test.json.raw.txt @@ -0,0 +1,134 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "orthofinder", + "version": "2.2.7", + "build": "0", + "executable": "orthofinder", + "subcommand": null, + "environment": "conda run -n bioenv_py_sc" + }, + "endpoint": { + "name": "infer_orthogroups", + "description": "Run DIAMOND all-vs-all and stop after orthogroup inference; copy date-named results to stable output paths." + }, + "arguments": [ + { + "name": "input_dir", + "flag": "-f", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Directory containing FASTA proteomes" + }, + { + "name": "orthogroups_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Stable output path for Orthogroups.csv" + }, + { + "name": "statistics_csv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Stable output path for Statistics_Overall.csv" + } + ], + "inputs": [ + { + "name": "input_dir", + "artifact_type": "directory", + "binding": "input_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input directory must exist" + } + ] + } + ], + "outputs": [ + { + "name": "orthogroups_tsv", + "artifact_type": "file", + "binding": "orthogroups_tsv", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output file must exist" + } + ] + }, + { + "name": "statistics_csv", + "artifact_type": "file", + "binding": "statistics_csv", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output file must exist" + } + ] + } + ], + "validators": [ + { + "name": "orthogroups_tsv_nonempty", + "artifact_type": "file", + "binding": "orthogroups_tsv", + "assertions": [ + { + "name": "nonempty", + "status": "declared", + "description": "Orthogroups file must be non-empty" + } + ] + }, + { + "name": "statistics_csv_nonempty", + "artifact_type": "file", + "binding": "statistics_csv", + "assertions": [ + { + "name": "nonempty", + "status": "declared", + "description": "Statistics file must be non-empty" + } + ] + } + ], + "evidence": [ + { + "id": "help_text", + "field": "arguments", + "source_type": "help_text", + "locator": "orthofinder --help", + "excerpt": "-f ... -og Stop after inferring orthogroups", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "bash", + "-lc", + "orthofinder -f '{input_dir}' -t 1 -a 1 -S diamond -og && result_dir=$(find '{input_dir}' -maxdepth 1 -type d -name 'Results_*' | sort | tail -1) && cp \"$result_dir/Orthogroups.csv\" '{orthogroups_tsv}' && cp \"$result_dir/Statistics_Overall.csv\" '{statistics_csv}'" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/orthofinder_infer_orthogroups_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/orthofinder_infer_orthogroups_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..3bf5bae61e306c2dece2635b6cea4d4126c87a5d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/orthofinder_infer_orthogroups_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "82be95a4e94db3bc3212e935f3d71a4d848ae1289a480c42e566541ba74399ed", + "elapsed_seconds": 5.197443723678589, + "usage": { + "prompt_tokens": 1629, + "completion_tokens": 951, + "total_tokens": 2580, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1629 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "ab187c59-f484-4c2d-a173-d58af43d1e0f" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/paml_pairwise_dn_ds_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/paml_pairwise_dn_ds_test.json new file mode 100644 index 0000000000000000000000000000000000000000..e79d258bbb9b6102ae28fb3b6494407da0948319 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/paml_pairwise_dn_ds_test.json @@ -0,0 +1,227 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "paml", + "version": "4.10.10", + "build": "h87e0c26_2", + "executable": "yn00", + "subcommand": null, + "environment": { + "dependencies": [ + "libgcc >=14" + ], + "execution_environment": "Compiled" + } + }, + "endpoint": { + "name": "pairwise_dn_ds", + "description": "Estimate pairwise non-synonymous and synonymous substitution rates using the yn00 program from PAML." + }, + "arguments": [ + { + "name": "input_sequences", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Path to the input sequence file (codon alignment)." + }, + { + "name": "control_file", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to the control file (yn00.ctl)." + }, + { + "name": "output_results", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to the output results file (outfile)." + }, + { + "name": "output_dn", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Path to the output dN matrix file (copied from 2YN.dN)." + } + ], + "inputs": [ + { + "name": "input_sequences", + "artifact_type": "file", + "binding": "input_sequences", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-001" + ] + }, + { + "name": "readable", + "status": "declared", + "evidence": [ + "ev-001" + ] + } + ] + }, + { + "name": "control_file", + "artifact_type": "file", + "binding": "control_file", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-002" + ] + }, + { + "name": "readable", + "status": "declared", + "evidence": [ + "ev-002" + ] + } + ] + } + ], + "outputs": [ + { + "name": "output_results", + "artifact_type": "file", + "binding": "output_results", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-003" + ] + }, + { + "name": "non_empty", + "status": "declared", + "evidence": [ + "ev-003" + ] + } + ] + }, + { + "name": "output_dn", + "artifact_type": "file", + "binding": "output_dn", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-004" + ] + }, + { + "name": "non_empty", + "status": "declared", + "evidence": [ + "ev-004" + ] + } + ] + } + ], + "validators": [ + { + "name": "output_results_exists", + "artifact_type": "file", + "binding": "output_results", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-003" + ] + } + ] + }, + { + "name": "output_dn_exists", + "artifact_type": "file", + "binding": "output_dn", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-004" + ] + } + ] + } + ], + "evidence": [ + { + "id": "ev-001", + "field": "input_sequences", + "source_type": "target_interface", + "locator": "parameters[0].native_binding", + "excerpt": "ctl seqfile", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-002", + "field": "control_file", + "source_type": "target_interface", + "locator": "parameters[1].native_binding", + "excerpt": "ctl path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-003", + "field": "output_results", + "source_type": "target_interface", + "locator": "parameters[2].native_binding", + "excerpt": "ctl outfile", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-004", + "field": "output_dn", + "source_type": "target_interface", + "locator": "parameters[3].native_binding", + "excerpt": "copied 2YN.dN", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "bash", + "-lc", + { + "format": "cp '{input_sequences}' '{control_file}.seq' && cd \"$(dirname '{control_file}')\" && printf 'seqfile = yn00.ctl.seq\\noutfile = results.txt\\nverbose = 0\\nicode = 0\\nweighting = 0\\ncommonf3x4 = 0\\n' > yn00.ctl && yn00 yn00.ctl >/dev/null" + } + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/paml_pairwise_dn_ds_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/paml_pairwise_dn_ds_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..fd919778b63821925bb1ea4b5a88d90afc71280c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/paml_pairwise_dn_ds_test.json.raw.txt @@ -0,0 +1,205 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "paml", + "version": "4.10.10", + "build": "h87e0c26_2", + "executable": "yn00", + "subcommand": null, + "environment": { + "dependencies": ["libgcc >=14"], + "execution_environment": "Compiled" + } + }, + "endpoint": { + "name": "pairwise_dn_ds", + "description": "Estimate pairwise non-synonymous and synonymous substitution rates using the yn00 program from PAML." + }, + "arguments": [ + { + "name": "input_sequences", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Path to the input sequence file (codon alignment)." + }, + { + "name": "control_file", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to the control file (yn00.ctl)." + }, + { + "name": "output_results", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to the output results file (outfile)." + }, + { + "name": "output_dn", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Path to the output dN matrix file (copied from 2YN.dN)." + } + ], + "inputs": [ + { + "name": "input_sequences", + "artifact_type": "file", + "binding": "input_sequences", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-001"] + }, + { + "name": "readable", + "status": "declared", + "evidence": ["ev-001"] + } + ] + }, + { + "name": "control_file", + "artifact_type": "file", + "binding": "control_file", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-002"] + }, + { + "name": "readable", + "status": "declared", + "evidence": ["ev-002"] + } + ] + } + ], + "outputs": [ + { + "name": "output_results", + "artifact_type": "file", + "binding": "output_results", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-003"] + }, + { + "name": "non_empty", + "status": "declared", + "evidence": ["ev-003"] + } + ] + }, + { + "name": "output_dn", + "artifact_type": "file", + "binding": "output_dn", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-004"] + }, + { + "name": "non_empty", + "status": "declared", + "evidence": ["ev-004"] + } + ] + } + ], + "validators": [ + { + "name": "output_results_exists", + "artifact_type": "file", + "binding": "output_results", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-003"] + } + ] + }, + { + "name": "output_dn_exists", + "artifact_type": "file", + "binding": "output_dn", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-004"] + } + ] + } + ], + "evidence": [ + { + "id": "ev-001", + "field": "input_sequences", + "source_type": "target_interface", + "locator": "parameters[0].native_binding", + "excerpt": "ctl seqfile", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-002", + "field": "control_file", + "source_type": "target_interface", + "locator": "parameters[1].native_binding", + "excerpt": "ctl path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-003", + "field": "output_results", + "source_type": "target_interface", + "locator": "parameters[2].native_binding", + "excerpt": "ctl outfile", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-004", + "field": "output_dn", + "source_type": "target_interface", + "locator": "parameters[3].native_binding", + "excerpt": "copied 2YN.dN", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "bash", + "-lc", + { + "format": "cp '{input_sequences}' '{control_file}.seq' && cd \"$(dirname '{control_file}')\" && printf 'seqfile = yn00.ctl.seq\\noutfile = results.txt\\nverbose = 0\\nicode = 0\\nweighting = 0\\ncommonf3x4 = 0\\n' > yn00.ctl && yn00 yn00.ctl >/dev/null" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/paml_pairwise_dn_ds_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/paml_pairwise_dn_ds_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..1b93682205f58d4a217bb4748cbefa4c579b0e27 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/paml_pairwise_dn_ds_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "79f30ea7258ecd8610dd8f1d190dc45346aa92716e6b01a89c591037643c3250", + "elapsed_seconds": 7.044546127319336, + "usage": { + "prompt_tokens": 10250, + "completion_tokens": 1464, + "total_tokens": 11714, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10250 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "52d1b2e7-bc29-4a46-9322-3382c759e0f6" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/parasail-python_global_align_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/parasail-python_global_align_test.json new file mode 100644 index 0000000000000000000000000000000000000000..1895bae957bf96a7e1bf8a32cfca90792bb3c520 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/parasail-python_global_align_test.json @@ -0,0 +1,245 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "parasail-python", + "version": "1.3.4", + "build": "py313h5565187_6", + "executable": "python3.13", + "subcommand": null, + "environment": { + "conda_channels": [ + "bioconda", + "conda-forge" + ], + "dependencies": [ + "libgcc >=14", + "libstdcxx >=14", + "libzlib >=1.3.1,<2.0a0", + "numpy", + "python >=3.13,<3.14.0a0", + "python_abi 3.13.* *_cp313" + ] + } + }, + "endpoint": { + "name": "global_align", + "description": "Perform global pairwise sequence alignment using parasail NW trace striped 16 with gap open 10 and gap extension 1, outputting score, end positions, and CIGAR as JSON." + }, + "arguments": [ + { + "name": "sequence_a", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to FASTA file containing the first sequence." + }, + { + "name": "sequence_b", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to FASTA file containing the second sequence." + }, + { + "name": "output_json", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Path to output JSON file." + } + ], + "inputs": [ + { + "name": "sequence_a", + "artifact_type": "fasta", + "binding": "sequence_a", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev_sequence_a_exists" + ] + }, + { + "name": "readable", + "status": "declared", + "evidence": [ + "ev_sequence_a_readable" + ] + }, + { + "name": "fasta_format", + "status": "declared", + "evidence": [ + "ev_sequence_a_fasta" + ] + } + ] + }, + { + "name": "sequence_b", + "artifact_type": "fasta", + "binding": "sequence_b", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev_sequence_b_exists" + ] + }, + { + "name": "readable", + "status": "declared", + "evidence": [ + "ev_sequence_b_readable" + ] + }, + { + "name": "fasta_format", + "status": "declared", + "evidence": [ + "ev_sequence_b_fasta" + ] + } + ] + } + ], + "outputs": [ + { + "name": "output_json", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "writable", + "status": "declared", + "evidence": [ + "ev_output_writable" + ] + }, + { + "name": "json_format", + "status": "declared", + "evidence": [ + "ev_output_json" + ] + } + ] + } + ], + "validators": [ + { + "name": "output_json_valid", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "valid_json", + "status": "declared", + "evidence": [ + "ev_output_json_valid" + ] + } + ] + } + ], + "evidence": [ + { + "id": "ev_sequence_a_exists", + "field": "inputs[sequence_a].assertions[exists]", + "source_type": "declared", + "locator": "method-neutral target interface", + "excerpt": "sequence_a required path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_sequence_a_readable", + "field": "inputs[sequence_a].assertions[readable]", + "source_type": "declared", + "locator": "method-neutral target interface", + "excerpt": "sequence_a required path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_sequence_a_fasta", + "field": "inputs[sequence_a].assertions[fasta_format]", + "source_type": "inferred", + "locator": "execution_plan steps[0] command: rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>'))", + "excerpt": "reads FASTA by skipping header lines", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_sequence_b_exists", + "field": "inputs[sequence_b].assertions[exists]", + "source_type": "declared", + "locator": "method-neutral target interface", + "excerpt": "sequence_b required path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_sequence_b_readable", + "field": "inputs[sequence_b].assertions[readable]", + "source_type": "declared", + "locator": "method-neutral target interface", + "excerpt": "sequence_b required path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_sequence_b_fasta", + "field": "inputs[sequence_b].assertions[fasta_format]", + "source_type": "inferred", + "locator": "execution_plan steps[0] command: rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>'))", + "excerpt": "reads FASTA by skipping header lines", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_output_writable", + "field": "outputs[output_json].assertions[writable]", + "source_type": "declared", + "locator": "method-neutral target interface", + "excerpt": "output_json required path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_output_json", + "field": "outputs[output_json].assertions[json_format]", + "source_type": "inferred", + "locator": "execution_plan steps[0] command: open(sys.argv[3],'w').write(json.dumps(d,sort_keys=True)+'\\n')", + "excerpt": "writes JSON with json.dumps", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_output_json_valid", + "field": "validators[output_json_valid].assertions[valid_json]", + "source_type": "inferred", + "locator": "execution_plan steps[0] command: json.dumps(d,sort_keys=True)", + "excerpt": "uses json.dumps to produce valid JSON", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "python3.13", + "-c", + "import json,parasail,sys; rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>')); r=parasail.nw_trace_striped_16(rd(sys.argv[1]),rd(sys.argv[2]),10,1,parasail.dnafull); d={'score':r.score,'end_query':r.end_query,'end_ref':r.end_ref,'cigar':r.cigar.decode.decode()}; open(sys.argv[3],'w').write(json.dumps(d,sort_keys=True)+'\\n')", + "{sequence_a}", + "{sequence_b}", + "{output_json}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/parasail-python_global_align_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/parasail-python_global_align_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..e7bee3442c9a307d1e582ce8490602e7b4995635 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/parasail-python_global_align_test.json.raw.txt @@ -0,0 +1,217 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "parasail-python", + "version": "1.3.4", + "build": "py313h5565187_6", + "executable": "python3.13", + "subcommand": null, + "environment": { + "conda_channels": ["bioconda", "conda-forge"], + "dependencies": ["libgcc >=14", "libstdcxx >=14", "libzlib >=1.3.1,<2.0a0", "numpy", "python >=3.13,<3.14.0a0", "python_abi 3.13.* *_cp313"] + } + }, + "endpoint": { + "name": "global_align", + "description": "Perform global pairwise sequence alignment using parasail NW trace striped 16 with gap open 10 and gap extension 1, outputting score, end positions, and CIGAR as JSON." + }, + "arguments": [ + { + "name": "sequence_a", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to FASTA file containing the first sequence." + }, + { + "name": "sequence_b", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to FASTA file containing the second sequence." + }, + { + "name": "output_json", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Path to output JSON file." + } + ], + "inputs": [ + { + "name": "sequence_a", + "artifact_type": "fasta", + "binding": "sequence_a", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev_sequence_a_exists"] + }, + { + "name": "readable", + "status": "declared", + "evidence": ["ev_sequence_a_readable"] + }, + { + "name": "fasta_format", + "status": "declared", + "evidence": ["ev_sequence_a_fasta"] + } + ] + }, + { + "name": "sequence_b", + "artifact_type": "fasta", + "binding": "sequence_b", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev_sequence_b_exists"] + }, + { + "name": "readable", + "status": "declared", + "evidence": ["ev_sequence_b_readable"] + }, + { + "name": "fasta_format", + "status": "declared", + "evidence": ["ev_sequence_b_fasta"] + } + ] + } + ], + "outputs": [ + { + "name": "output_json", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "writable", + "status": "declared", + "evidence": ["ev_output_writable"] + }, + { + "name": "json_format", + "status": "declared", + "evidence": ["ev_output_json"] + } + ] + } + ], + "validators": [ + { + "name": "output_json_valid", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "valid_json", + "status": "declared", + "evidence": ["ev_output_json_valid"] + } + ] + } + ], + "evidence": [ + { + "id": "ev_sequence_a_exists", + "field": "inputs[sequence_a].assertions[exists]", + "source_type": "declared", + "locator": "method-neutral target interface", + "excerpt": "sequence_a required path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_sequence_a_readable", + "field": "inputs[sequence_a].assertions[readable]", + "source_type": "declared", + "locator": "method-neutral target interface", + "excerpt": "sequence_a required path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_sequence_a_fasta", + "field": "inputs[sequence_a].assertions[fasta_format]", + "source_type": "inferred", + "locator": "execution_plan steps[0] command: rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>'))", + "excerpt": "reads FASTA by skipping header lines", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_sequence_b_exists", + "field": "inputs[sequence_b].assertions[exists]", + "source_type": "declared", + "locator": "method-neutral target interface", + "excerpt": "sequence_b required path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_sequence_b_readable", + "field": "inputs[sequence_b].assertions[readable]", + "source_type": "declared", + "locator": "method-neutral target interface", + "excerpt": "sequence_b required path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_sequence_b_fasta", + "field": "inputs[sequence_b].assertions[fasta_format]", + "source_type": "inferred", + "locator": "execution_plan steps[0] command: rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>'))", + "excerpt": "reads FASTA by skipping header lines", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_output_writable", + "field": "outputs[output_json].assertions[writable]", + "source_type": "declared", + "locator": "method-neutral target interface", + "excerpt": "output_json required path", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_output_json", + "field": "outputs[output_json].assertions[json_format]", + "source_type": "inferred", + "locator": "execution_plan steps[0] command: open(sys.argv[3],'w').write(json.dumps(d,sort_keys=True)+'\\n')", + "excerpt": "writes JSON with json.dumps", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_output_json_valid", + "field": "validators[output_json_valid].assertions[valid_json]", + "source_type": "inferred", + "locator": "execution_plan steps[0] command: json.dumps(d,sort_keys=True)", + "excerpt": "uses json.dumps to produce valid JSON", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "python3.13", + "-c", + "import json,parasail,sys; rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>')); r=parasail.nw_trace_striped_16(rd(sys.argv[1]),rd(sys.argv[2]),10,1,parasail.dnafull); d={'score':r.score,'end_query':r.end_query,'end_ref':r.end_ref,'cigar':r.cigar.decode.decode()}; open(sys.argv[3],'w').write(json.dumps(d,sort_keys=True)+'\\n')", + "{sequence_a}", + "{sequence_b}", + "{output_json}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/parasail-python_global_align_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/parasail-python_global_align_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..06f705c189a4340dbcf1a370545161e45c4c2aee --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/parasail-python_global_align_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "54c5783c75c8460a2e53891ef76b203a489d0be3a9b540464f7502d537ce3250", + "elapsed_seconds": 11.194429159164429, + "usage": { + "prompt_tokens": 11863, + "completion_tokens": 2049, + "total_tokens": 13912, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11863 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "759d1f3f-e86a-4a4c-a5c5-899e97419d9b" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/picard_sort_sam_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/picard_sort_sam_test.json new file mode 100644 index 0000000000000000000000000000000000000000..89db005434cf8ff7300c44425ff5e9385ac4ef71 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/picard_sort_sam_test.json @@ -0,0 +1,205 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "picard", + "version": "2.18.7", + "build": "py36_0", + "executable": "picard", + "subcommand": "SortSam", + "environment": "conda run -n bioenv_r_bioc" + }, + "endpoint": { + "name": "sort_sam", + "description": "Sort coordinate order, create an index, then render SAM records for the semantic oracle." + }, + "arguments": [ + { + "name": "input_bam", + "flag": "INPUT=", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input BAM file to be sorted." + }, + { + "name": "output_bam", + "flag": "OUTPUT=", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output sorted BAM file." + }, + { + "name": "output_sam", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Captured stdout from ViewSam, representing SAM records.", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_bam", + "artifact_type": "BAM", + "binding": "input_bam", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "valid_bam", + "status": "unknown" + } + ] + } + ], + "outputs": [ + { + "name": "output_bam", + "artifact_type": "BAM", + "binding": "output_bam", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "sorted_coordinate", + "status": "declared" + }, + { + "name": "indexed", + "status": "declared" + } + ] + }, + { + "name": "output_sam", + "artifact_type": "SAM", + "binding": "output_sam", + "capture": "stdout", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "valid_sam", + "status": "unknown" + } + ] + } + ], + "validators": [ + { + "name": "bam_exists", + "artifact": "output_bam", + "assertion": "exists", + "status": "declared" + }, + { + "name": "sam_exists", + "artifact": "output_sam", + "assertion": "exists", + "status": "declared" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "picard --help", + "excerpt": "USAGE: PicardCommandLine [-h]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.subcommand", + "source_type": "help_text", + "locator": "picard --help", + "excerpt": "SortSam", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "sort_sam", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.input_bam.flag", + "source_type": "target_interface", + "locator": "native_binding", + "excerpt": "INPUT=", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.output_bam.flag", + "source_type": "target_interface", + "locator": "native_binding", + "excerpt": "OUTPUT=", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.output_sam.binding", + "source_type": "target_interface", + "locator": "native_binding", + "excerpt": "ViewSam stdout", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "execution_plan", + "excerpt": "Sort coordinate order, create an index, then render SAM records for the semantic oracle.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "picard", + "SortSam", + { + "format": "INPUT={input_bam}" + }, + { + "format": "OUTPUT={output_bam}" + }, + "SORT_ORDER=coordinate", + "CREATE_INDEX=true", + "VALIDATION_STRINGENCY=SILENT" + ] + }, + { + "command": [ + "picard", + "ViewSam", + { + "format": "I={output_bam}" + }, + "ALIGNMENT_STATUS=All", + "PF_STATUS=All" + ], + "capture_stdout_to": "output_sam" + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/picard_sort_sam_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/picard_sort_sam_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..734e59aca5b7f729c68ba160c5a369cec005b219 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/picard_sort_sam_test.json.raw.txt @@ -0,0 +1,205 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "picard", + "version": "2.18.7", + "build": "py36_0", + "executable": "picard", + "subcommand": "SortSam", + "environment": "conda run -n bioenv_r_bioc" + }, + "endpoint": { + "name": "sort_sam", + "description": "Sort coordinate order, create an index, then render SAM records for the semantic oracle." + }, + "arguments": [ + { + "name": "input_bam", + "flag": "INPUT=", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input BAM file to be sorted." + }, + { + "name": "output_bam", + "flag": "OUTPUT=", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output sorted BAM file." + }, + { + "name": "output_sam", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Captured stdout from ViewSam, representing SAM records.", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_bam", + "artifact_type": "BAM", + "binding": "input_bam", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "valid_bam", + "status": "unknown" + } + ] + } + ], + "outputs": [ + { + "name": "output_bam", + "artifact_type": "BAM", + "binding": "output_bam", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "sorted_coordinate", + "status": "declared" + }, + { + "name": "indexed", + "status": "declared" + } + ] + }, + { + "name": "output_sam", + "artifact_type": "SAM", + "binding": "output_sam", + "capture": "stdout", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "valid_sam", + "status": "unknown" + } + ] + } + ], + "validators": [ + { + "name": "bam_exists", + "artifact": "output_bam", + "assertion": "exists", + "status": "declared" + }, + { + "name": "sam_exists", + "artifact": "output_sam", + "assertion": "exists", + "status": "declared" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "picard --help", + "excerpt": "USAGE: PicardCommandLine [-h]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.subcommand", + "source_type": "help_text", + "locator": "picard --help", + "excerpt": "SortSam", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "sort_sam", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.input_bam.flag", + "source_type": "target_interface", + "locator": "native_binding", + "excerpt": "INPUT=", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.output_bam.flag", + "source_type": "target_interface", + "locator": "native_binding", + "excerpt": "OUTPUT=", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.output_sam.binding", + "source_type": "target_interface", + "locator": "native_binding", + "excerpt": "ViewSam stdout", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "execution_plan", + "excerpt": "Sort coordinate order, create an index, then render SAM records for the semantic oracle.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "picard", + "SortSam", + { + "format": "INPUT={input_bam}" + }, + { + "format": "OUTPUT={output_bam}" + }, + "SORT_ORDER=coordinate", + "CREATE_INDEX=true", + "VALIDATION_STRINGENCY=SILENT" + ] + }, + { + "command": [ + "picard", + "ViewSam", + { + "format": "I={output_bam}" + }, + "ALIGNMENT_STATUS=All", + "PF_STATUS=All" + ], + "capture_stdout_to": "output_sam" + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/picard_sort_sam_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/picard_sort_sam_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..94086172a1569b87af868988389d1c9e31c615c1 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/picard_sort_sam_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "3d8cabe2afe03f67d93e71aaa5e19bccc557e3c0f91866f27516dbb9e561fd0a", + "elapsed_seconds": 6.974554061889648, + "usage": { + "prompt_tokens": 4366, + "completion_tokens": 1487, + "total_tokens": 5853, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 4366 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "82a7d558-931f-4d88-b7c7-6cf01857d4fe" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/portcullis_prepare_splice_inputs_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/portcullis_prepare_splice_inputs_test.json new file mode 100644 index 0000000000000000000000000000000000000000..2f193a4d9442098a9b65b401b9942630fdfea416 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/portcullis_prepare_splice_inputs_test.json @@ -0,0 +1,158 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "portcullis", + "version": "1.2.4", + "build": "py311h6947f6e_5", + "executable": "portcullis", + "subcommand": "prep", + "environment": { + "PATH_PREPEND": "/225040511/miniconda3/envs/bioenv/bin" + } + }, + "endpoint": { + "name": "prepare_splice_inputs", + "description": "Prepares input data so that it is suitable for junction analysis" + }, + "arguments": [ + { + "name": "reference_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Reference genome FASTA file" + }, + { + "name": "input_bam", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Input BAM file" + }, + { + "name": "output_dir", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output directory" + } + ], + "inputs": [ + { + "name": "reference_fasta", + "artifact_type": "fasta", + "binding": "reference_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-001" + ] + } + ] + }, + { + "name": "input_bam", + "artifact_type": "bam", + "binding": "input_bam", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-002" + ] + } + ] + } + ], + "outputs": [ + { + "name": "output_dir", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "created", + "status": "declared", + "evidence": [ + "ev-003" + ] + } + ] + } + ], + "validators": [ + { + "name": "output_dir_created", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-003" + ] + } + ] + } + ], + "evidence": [ + { + "id": "ev-001", + "field": "reference_fasta", + "source_type": "target_interface", + "locator": "parameters[0]", + "excerpt": "reference_fasta: path, required, native_binding: genome positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-002", + "field": "input_bam", + "source_type": "target_interface", + "locator": "parameters[1]", + "excerpt": "input_bam: path, required, native_binding: bam positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-003", + "field": "output_dir", + "source_type": "target_interface", + "locator": "parameters[2]", + "excerpt": "output_dir: path, required, native_binding: -o", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "portcullis", + "prep", + "-o", + "{output_dir}", + "--force", + "--copy", + "-t", + "1", + "{reference_fasta}", + "{input_bam}" + ], + "env": { + "PATH_PREPEND": "/225040511/miniconda3/envs/bioenv/bin" + } + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/portcullis_prepare_splice_inputs_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/portcullis_prepare_splice_inputs_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2408260eac129f75f9fc98b20d23ce9863142aca --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/portcullis_prepare_splice_inputs_test.json.raw.txt @@ -0,0 +1,150 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "portcullis", + "version": "1.2.4", + "build": "py311h6947f6e_5", + "executable": "portcullis", + "subcommand": "prep", + "environment": { + "PATH_PREPEND": "/225040511/miniconda3/envs/bioenv/bin" + } + }, + "endpoint": { + "name": "prepare_splice_inputs", + "description": "Prepares input data so that it is suitable for junction analysis" + }, + "arguments": [ + { + "name": "reference_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Reference genome FASTA file" + }, + { + "name": "input_bam", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Input BAM file" + }, + { + "name": "output_dir", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output directory" + } + ], + "inputs": [ + { + "name": "reference_fasta", + "artifact_type": "fasta", + "binding": "reference_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-001"] + } + ] + }, + { + "name": "input_bam", + "artifact_type": "bam", + "binding": "input_bam", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-002"] + } + ] + } + ], + "outputs": [ + { + "name": "output_dir", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "created", + "status": "declared", + "evidence": ["ev-003"] + } + ] + } + ], + "validators": [ + { + "name": "output_dir_created", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-003"] + } + ] + } + ], + "evidence": [ + { + "id": "ev-001", + "field": "reference_fasta", + "source_type": "target_interface", + "locator": "parameters[0]", + "excerpt": "reference_fasta: path, required, native_binding: genome positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-002", + "field": "input_bam", + "source_type": "target_interface", + "locator": "parameters[1]", + "excerpt": "input_bam: path, required, native_binding: bam positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-003", + "field": "output_dir", + "source_type": "target_interface", + "locator": "parameters[2]", + "excerpt": "output_dir: path, required, native_binding: -o", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "portcullis", + "prep", + "-o", + "{output_dir}", + "--force", + "--copy", + "-t", + "1", + "{reference_fasta}", + "{input_bam}" + ], + "env": { + "PATH_PREPEND": "/225040511/miniconda3/envs/bioenv/bin" + } + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/portcullis_prepare_splice_inputs_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/portcullis_prepare_splice_inputs_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..6d18818570d8d3397b4be904de6f79c9aabba1b2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/portcullis_prepare_splice_inputs_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "0dfbc9bd46d8949912dcb7fc93596bab2a26bb2a312b7d8199fef20252e14bf5", + "elapsed_seconds": 5.290838003158569, + "usage": { + "prompt_tokens": 9026, + "completion_tokens": 1029, + "total_tokens": 10055, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9026 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "f9580e51-7192-4310-9ace-ab32a1ec9355" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prank_align_proteins_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prank_align_proteins_test.json new file mode 100644 index 0000000000000000000000000000000000000000..ca364268d17c09070c35d6b51e76471c7fad6a52 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prank_align_proteins_test.json @@ -0,0 +1,179 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "prank", + "version": "251117", + "build": "hd63eeec_0", + "executable": "prank", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "align_proteins", + "description": "Align protein sequences using PRANK, with FASTA output, one iteration, and quiet mode." + }, + "arguments": [ + { + "name": "input_fasta", + "flag": "-d=", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input sequence file in FASTA format." + }, + { + "name": "output_prefix", + "flag": "-o=", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output file prefix." + }, + { + "name": "output_format", + "flag": "-f=fasta", + "kind": "option", + "value_type": "string", + "required": false, + "position": null, + "repeat": false, + "description": "Output format fixed to FASTA." + }, + { + "name": "once", + "flag": "-once", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Run only once (same as -iterate=1)." + }, + { + "name": "quiet", + "flag": "-quiet", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Suppress non-essential output." + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "file", + "binding": "input_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + }, + { + "name": "fasta_format", + "status": "declared", + "description": "Input file must be in FASTA format." + } + ] + } + ], + "outputs": [ + { + "name": "output_alignment", + "artifact_type": "file", + "binding": "output_prefix", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output alignment file must be created." + }, + { + "name": "fasta_format", + "status": "declared", + "description": "Output alignment file must be in FASTA format." + } + ] + } + ], + "validators": [ + { + "name": "output_file_created", + "artifact_type": "file", + "binding": "output_prefix", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output file must exist after execution." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "arguments", + "source_type": "help_text", + "locator": "prank --help", + "excerpt": "-d=sequence_file (in FASTA format)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments", + "source_type": "help_text", + "locator": "prank --help", + "excerpt": "-o=output_file [default: 'output']", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "help_text", + "locator": "prank --help", + "excerpt": "-f=output_format ['fasta' (default), 'phylipi', 'phylips', 'paml', 'nexus']", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments", + "source_type": "help_text", + "locator": "prank --help", + "excerpt": "-once [run only once; same as -iterate=1]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments", + "source_type": "help_text", + "locator": "prank --help", + "excerpt": "-quiet", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "prank", + { + "format": "-d={input_fasta}" + }, + { + "format": "-o={output_prefix}" + }, + "-f=fasta", + "-once", + "-quiet" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prank_align_proteins_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prank_align_proteins_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..7693a65f29628470710cb025fcf465116df5b0b0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prank_align_proteins_test.json.raw.txt @@ -0,0 +1,179 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "prank", + "version": "251117", + "build": "hd63eeec_0", + "executable": "prank", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "align_proteins", + "description": "Align protein sequences using PRANK, with FASTA output, one iteration, and quiet mode." + }, + "arguments": [ + { + "name": "input_fasta", + "flag": "-d=", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input sequence file in FASTA format." + }, + { + "name": "output_prefix", + "flag": "-o=", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output file prefix." + }, + { + "name": "output_format", + "flag": "-f=fasta", + "kind": "option", + "value_type": "string", + "required": false, + "position": null, + "repeat": false, + "description": "Output format fixed to FASTA." + }, + { + "name": "once", + "flag": "-once", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Run only once (same as -iterate=1)." + }, + { + "name": "quiet", + "flag": "-quiet", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Suppress non-essential output." + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "file", + "binding": "input_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + }, + { + "name": "fasta_format", + "status": "declared", + "description": "Input file must be in FASTA format." + } + ] + } + ], + "outputs": [ + { + "name": "output_alignment", + "artifact_type": "file", + "binding": "output_prefix", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output alignment file must be created." + }, + { + "name": "fasta_format", + "status": "declared", + "description": "Output alignment file must be in FASTA format." + } + ] + } + ], + "validators": [ + { + "name": "output_file_created", + "artifact_type": "file", + "binding": "output_prefix", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output file must exist after execution." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "arguments", + "source_type": "help_text", + "locator": "prank --help", + "excerpt": "-d=sequence_file (in FASTA format)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments", + "source_type": "help_text", + "locator": "prank --help", + "excerpt": "-o=output_file [default: 'output']", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "help_text", + "locator": "prank --help", + "excerpt": "-f=output_format ['fasta' (default), 'phylipi', 'phylips', 'paml', 'nexus']", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments", + "source_type": "help_text", + "locator": "prank --help", + "excerpt": "-once [run only once; same as -iterate=1]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments", + "source_type": "help_text", + "locator": "prank --help", + "excerpt": "-quiet", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "prank", + { + "format": "-d={input_fasta}" + }, + { + "format": "-o={output_prefix}" + }, + "-f=fasta", + "-once", + "-quiet" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prank_align_proteins_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prank_align_proteins_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..fa210afea8e3d6958c6d49e90922ee72b8c48888 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prank_align_proteins_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "e40753483857cbbf015c374349b40fd478fdc95f686b10f8826b45b375d565ed", + "elapsed_seconds": 7.035786867141724, + "usage": { + "prompt_tokens": 1263, + "completion_tokens": 1285, + "total_tokens": 2548, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1263 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "d04ba5b5-e00b-42ff-af9c-00787a088d18" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prophyle_index_and_classify_reads_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prophyle_index_and_classify_reads_test.json new file mode 100644 index 0000000000000000000000000000000000000000..98bc3de96b4fe89793e0d95db4f08f2110c54a8b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prophyle_index_and_classify_reads_test.json @@ -0,0 +1,235 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "prophyle", + "version": "0.3.3.2", + "build": "py312hdcc493e_4", + "executable": "prophyle", + "subcommand": "index/classify", + "environment": "conda" + }, + "endpoint": { + "name": "index_and_classify_reads", + "description": "Generate both the index and classification calls; keep k=15, one worker, and Kraken output fixed for deterministic comparison." + }, + "arguments": [ + { + "name": "library_dir", + "flag": "-g", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the library directory containing reference genomes." + }, + { + "name": "tree_file", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to the input tree file (Newick format)." + }, + { + "name": "reads_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to the input reads file in FASTA format." + }, + { + "name": "index_dir", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Path to the output directory for the index." + }, + { + "name": "output_kraken", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 4, + "repeat": false, + "description": "Path to the output Kraken classification file (captured from stdout)." + } + ], + "inputs": [ + { + "name": "library_dir", + "artifact_type": "directory", + "binding": "library_dir", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Input directory must exist." + } + ] + }, + { + "name": "tree_file", + "artifact_type": "file", + "binding": "tree_file", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Input tree file must exist." + } + ] + }, + { + "name": "reads_fasta", + "artifact_type": "file", + "binding": "reads_fasta", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Input reads file must exist." + } + ] + } + ], + "outputs": [ + { + "name": "index_dir", + "artifact_type": "directory", + "binding": "index_dir", + "assertions": [ + { + "name": "created", + "status": "inferred", + "description": "Index directory is created by the index step." + } + ] + }, + { + "name": "output_kraken", + "artifact_type": "file", + "binding": "output_kraken", + "assertions": [ + { + "name": "created", + "status": "inferred", + "description": "Output Kraken file is created by capturing stdout from classify step." + } + ] + } + ], + "validators": [ + { + "name": "output_kraken_nonempty", + "artifact_type": "file", + "binding": "output_kraken", + "assertions": [ + { + "name": "nonempty", + "status": "inferred", + "description": "Output Kraken file should not be empty." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge prophyle --info", + "excerpt": "prophyle 0.3.3.2 py312hdcc493e_4", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments[0].flag", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: -g", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments[1].kind", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: index positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments[2].kind", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: classify positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments[3].kind", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: index positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments[4].binding", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: stdout", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "execution_plan: steps: ...", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "prophyle", + "index", + "-A", + "-g", + "{library_dir}", + "-j", + "1", + "-k", + "15", + "{tree_file}", + "{index_dir}" + ] + }, + { + "command": [ + "prophyle", + "classify", + "-k", + "15", + "-f", + "kraken", + "{index_dir}", + "{reads_fasta}" + ], + "capture_stdout_to": "output_kraken" + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prophyle_index_and_classify_reads_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prophyle_index_and_classify_reads_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..61b78072ebd168452137e966909bbf64d7a9b1f0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prophyle_index_and_classify_reads_test.json.raw.txt @@ -0,0 +1,235 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "prophyle", + "version": "0.3.3.2", + "build": "py312hdcc493e_4", + "executable": "prophyle", + "subcommand": "index/classify", + "environment": "conda" + }, + "endpoint": { + "name": "index_and_classify_reads", + "description": "Generate both the index and classification calls; keep k=15, one worker, and Kraken output fixed for deterministic comparison." + }, + "arguments": [ + { + "name": "library_dir", + "flag": "-g", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the library directory containing reference genomes." + }, + { + "name": "tree_file", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to the input tree file (Newick format)." + }, + { + "name": "reads_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to the input reads file in FASTA format." + }, + { + "name": "index_dir", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Path to the output directory for the index." + }, + { + "name": "output_kraken", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 4, + "repeat": false, + "description": "Path to the output Kraken classification file (captured from stdout)." + } + ], + "inputs": [ + { + "name": "library_dir", + "artifact_type": "directory", + "binding": "library_dir", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Input directory must exist." + } + ] + }, + { + "name": "tree_file", + "artifact_type": "file", + "binding": "tree_file", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Input tree file must exist." + } + ] + }, + { + "name": "reads_fasta", + "artifact_type": "file", + "binding": "reads_fasta", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Input reads file must exist." + } + ] + } + ], + "outputs": [ + { + "name": "index_dir", + "artifact_type": "directory", + "binding": "index_dir", + "assertions": [ + { + "name": "created", + "status": "inferred", + "description": "Index directory is created by the index step." + } + ] + }, + { + "name": "output_kraken", + "artifact_type": "file", + "binding": "output_kraken", + "assertions": [ + { + "name": "created", + "status": "inferred", + "description": "Output Kraken file is created by capturing stdout from classify step." + } + ] + } + ], + "validators": [ + { + "name": "output_kraken_nonempty", + "artifact_type": "file", + "binding": "output_kraken", + "assertions": [ + { + "name": "nonempty", + "status": "inferred", + "description": "Output Kraken file should not be empty." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge prophyle --info", + "excerpt": "prophyle 0.3.3.2 py312hdcc493e_4", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments[0].flag", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: -g", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments[1].kind", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: index positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments[2].kind", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: classify positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments[3].kind", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: index positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments[4].binding", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: stdout", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "execution_plan: steps: ...", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "prophyle", + "index", + "-A", + "-g", + "{library_dir}", + "-j", + "1", + "-k", + "15", + "{tree_file}", + "{index_dir}" + ] + }, + { + "command": [ + "prophyle", + "classify", + "-k", + "15", + "-f", + "kraken", + "{index_dir}", + "{reads_fasta}" + ], + "capture_stdout_to": "output_kraken" + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prophyle_index_and_classify_reads_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prophyle_index_and_classify_reads_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..8960b2fae9d0bb1b6b4670804d22a2078aca1d99 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/prophyle_index_and_classify_reads_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "05244b70bf4243c31ccd4e3cad2e40ddaae83f28cea0f1fee803107ad3b123de", + "elapsed_seconds": 8.363278865814209, + "usage": { + "prompt_tokens": 7545, + "completion_tokens": 1734, + "total_tokens": 9279, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7545 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "881d449d-431a-4c30-a1fd-f57904263d7d" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyfastx_fasta_statistics_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyfastx_fasta_statistics_test.json new file mode 100644 index 0000000000000000000000000000000000000000..f5192524cec208fc0543a8869311c77ac3f36965 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyfastx_fasta_statistics_test.json @@ -0,0 +1,139 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "pyfastx", + "version": "2.3.1", + "build": "py310hfe4f656_0", + "executable": "pyfastx", + "subcommand": "stat", + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "fasta_statistics", + "description": "Show detailed statistics information of fasta file" + }, + "arguments": [ + { + "name": "input_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input FASTA file" + }, + { + "name": "output_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output TSV file (captured from stdout)", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "FASTA", + "binding": "input_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": "ev_input_exists" + }, + { + "name": "valid_fasta", + "status": "inferred", + "evidence": "ev_input_valid" + } + ] + } + ], + "outputs": [ + { + "name": "output_tsv", + "artifact_type": "TSV", + "binding": "output_tsv", + "capture": "stdout", + "assertions": [ + { + "name": "non_empty", + "status": "inferred", + "evidence": "ev_output_nonempty" + }, + { + "name": "valid_tsv", + "status": "inferred", + "evidence": "ev_output_valid" + } + ] + } + ], + "validators": [ + { + "name": "input_fasta_exists", + "type": "file_exists", + "target": "input_fasta", + "status": "declared", + "evidence": "ev_input_exists" + }, + { + "name": "output_tsv_non_empty", + "type": "non_empty", + "target": "output_tsv", + "status": "inferred", + "evidence": "ev_output_nonempty" + } + ], + "evidence": [ + { + "id": "ev_input_exists", + "field": "input_fasta", + "source_type": "help_text", + "locator": "pyfastx --help", + "excerpt": "stat show detailed statistics information of fasta/q file", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_input_valid", + "field": "input_fasta", + "source_type": "help_text", + "locator": "pyfastx --help", + "excerpt": "stat show detailed statistics information of fasta/q file", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_output_nonempty", + "field": "output_tsv", + "source_type": "help_text", + "locator": "pyfastx --help", + "excerpt": "stat show detailed statistics information of fasta/q file", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_output_valid", + "field": "output_tsv", + "source_type": "help_text", + "locator": "pyfastx --help", + "excerpt": "stat show detailed statistics information of fasta/q file", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "pyfastx", + "stat", + "{input_fasta}" + ], + "capture_stdout_to": "output_tsv" + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyfastx_fasta_statistics_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyfastx_fasta_statistics_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..609c085db0b8a3d53bc51e58a024ff285104f21d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyfastx_fasta_statistics_test.json.raw.txt @@ -0,0 +1,139 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "pyfastx", + "version": "2.3.1", + "build": "py310hfe4f656_0", + "executable": "pyfastx", + "subcommand": "stat", + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "fasta_statistics", + "description": "Show detailed statistics information of fasta file" + }, + "arguments": [ + { + "name": "input_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input FASTA file" + }, + { + "name": "output_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output TSV file (captured from stdout)", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "FASTA", + "binding": "input_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": "ev_input_exists" + }, + { + "name": "valid_fasta", + "status": "inferred", + "evidence": "ev_input_valid" + } + ] + } + ], + "outputs": [ + { + "name": "output_tsv", + "artifact_type": "TSV", + "binding": "output_tsv", + "capture": "stdout", + "assertions": [ + { + "name": "non_empty", + "status": "inferred", + "evidence": "ev_output_nonempty" + }, + { + "name": "valid_tsv", + "status": "inferred", + "evidence": "ev_output_valid" + } + ] + } + ], + "validators": [ + { + "name": "input_fasta_exists", + "type": "file_exists", + "target": "input_fasta", + "status": "declared", + "evidence": "ev_input_exists" + }, + { + "name": "output_tsv_non_empty", + "type": "non_empty", + "target": "output_tsv", + "status": "inferred", + "evidence": "ev_output_nonempty" + } + ], + "evidence": [ + { + "id": "ev_input_exists", + "field": "input_fasta", + "source_type": "help_text", + "locator": "pyfastx --help", + "excerpt": "stat show detailed statistics information of fasta/q file", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_input_valid", + "field": "input_fasta", + "source_type": "help_text", + "locator": "pyfastx --help", + "excerpt": "stat show detailed statistics information of fasta/q file", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_output_nonempty", + "field": "output_tsv", + "source_type": "help_text", + "locator": "pyfastx --help", + "excerpt": "stat show detailed statistics information of fasta/q file", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_output_valid", + "field": "output_tsv", + "source_type": "help_text", + "locator": "pyfastx --help", + "excerpt": "stat show detailed statistics information of fasta/q file", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "pyfastx", + "stat", + "{input_fasta}" + ], + "capture_stdout_to": "output_tsv" + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyfastx_fasta_statistics_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyfastx_fasta_statistics_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..6702fbc39d9dce0bb5b45557d0b567864a73dfec --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyfastx_fasta_statistics_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "a02795fc00209054d5b8ed655cc328d48706cf3b5adef5d702ed96ffce74df9e", + "elapsed_seconds": 5.287519454956055, + "usage": { + "prompt_tokens": 902, + "completion_tokens": 1040, + "total_tokens": 1942, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 902 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "c75e917a-1999-4166-901a-1cc25bc68430" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyranges_merge_genomic_ranges_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyranges_merge_genomic_ranges_test.json new file mode 100644 index 0000000000000000000000000000000000000000..e71e84e4d63f70bf7268f34ead33855520c3bb1e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyranges_merge_genomic_ranges_test.json @@ -0,0 +1,141 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "pyranges", + "version": "0.0.52", + "build": "py36h516909a_0", + "executable": "python", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "merge_genomic_ranges", + "description": "Read BED into PyRanges, merge overlaps, and write the canonical three-column table." + }, + "arguments": [ + { + "name": "input_bed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input BED file path." + }, + { + "name": "output_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output TSV file path." + } + ], + "inputs": [ + { + "name": "input_bed", + "artifact_type": "bed", + "binding": "input_bed", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": "ev-1" + }, + { + "name": "readable", + "status": "declared", + "evidence": "ev-1" + } + ] + } + ], + "outputs": [ + { + "name": "output_tsv", + "artifact_type": "tsv", + "binding": "output_tsv", + "assertions": [ + { + "name": "created", + "status": "declared", + "evidence": "ev-2" + }, + { + "name": "non_empty", + "status": "inferred", + "evidence": "ev-3" + } + ] + } + ], + "validators": [ + { + "name": "output_tsv_columns", + "artifact_type": "tsv", + "binding": "output_tsv", + "assertions": [ + { + "name": "has_columns", + "value": [ + "Chromosome", + "Start", + "End" + ], + "status": "inferred", + "evidence": "ev-4" + } + ] + } + ], + "evidence": [ + { + "id": "ev-1", + "field": "input_bed", + "source_type": "method_interface", + "locator": "execution_plan.steps[0].command", + "excerpt": "x=pr.read_bed(sys.argv[1])", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-2", + "field": "output_tsv", + "source_type": "method_interface", + "locator": "execution_plan.steps[0].command", + "excerpt": "x.merge().df.to_csv(sys.argv[2],sep='\\t',index=False)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-3", + "field": "output_tsv", + "source_type": "method_interface", + "locator": "execution_plan.steps[0].command", + "excerpt": "x.merge().df.to_csv(sys.argv[2],sep='\\t',index=False)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-4", + "field": "output_tsv", + "source_type": "method_interface", + "locator": "execution_plan.steps[0].command", + "excerpt": "x.merge().df.to_csv(sys.argv[2],sep='\\t',index=False)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "python", + "-c", + "import sys; import pyranges as pr; x=pr.read_bed(sys.argv[1]); x.merge().df.to_csv(sys.argv[2],sep='\\t',index=False)", + "{input_bed}", + "{output_tsv}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyranges_merge_genomic_ranges_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyranges_merge_genomic_ranges_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..f224bacffadef463b99c97ebb71ff6ccbcd7cf91 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyranges_merge_genomic_ranges_test.json.raw.txt @@ -0,0 +1,137 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "pyranges", + "version": "0.0.52", + "build": "py36h516909a_0", + "executable": "python", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "merge_genomic_ranges", + "description": "Read BED into PyRanges, merge overlaps, and write the canonical three-column table." + }, + "arguments": [ + { + "name": "input_bed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input BED file path." + }, + { + "name": "output_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output TSV file path." + } + ], + "inputs": [ + { + "name": "input_bed", + "artifact_type": "bed", + "binding": "input_bed", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": "ev-1" + }, + { + "name": "readable", + "status": "declared", + "evidence": "ev-1" + } + ] + } + ], + "outputs": [ + { + "name": "output_tsv", + "artifact_type": "tsv", + "binding": "output_tsv", + "assertions": [ + { + "name": "created", + "status": "declared", + "evidence": "ev-2" + }, + { + "name": "non_empty", + "status": "inferred", + "evidence": "ev-3" + } + ] + } + ], + "validators": [ + { + "name": "output_tsv_columns", + "artifact_type": "tsv", + "binding": "output_tsv", + "assertions": [ + { + "name": "has_columns", + "value": ["Chromosome", "Start", "End"], + "status": "inferred", + "evidence": "ev-4" + } + ] + } + ], + "evidence": [ + { + "id": "ev-1", + "field": "input_bed", + "source_type": "method_interface", + "locator": "execution_plan.steps[0].command", + "excerpt": "x=pr.read_bed(sys.argv[1])", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-2", + "field": "output_tsv", + "source_type": "method_interface", + "locator": "execution_plan.steps[0].command", + "excerpt": "x.merge().df.to_csv(sys.argv[2],sep='\\t',index=False)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-3", + "field": "output_tsv", + "source_type": "method_interface", + "locator": "execution_plan.steps[0].command", + "excerpt": "x.merge().df.to_csv(sys.argv[2],sep='\\t',index=False)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-4", + "field": "output_tsv", + "source_type": "method_interface", + "locator": "execution_plan.steps[0].command", + "excerpt": "x.merge().df.to_csv(sys.argv[2],sep='\\t',index=False)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "python", + "-c", + "import sys; import pyranges as pr; x=pr.read_bed(sys.argv[1]); x.merge().df.to_csv(sys.argv[2],sep='\\t',index=False)", + "{input_bed}", + "{output_tsv}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyranges_merge_genomic_ranges_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyranges_merge_genomic_ranges_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..7fe8c394712f263ef647785aa7d101e407335804 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyranges_merge_genomic_ranges_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "57e5d639f36307a1dde10cb892b9863c87ee25629f95742e7af899ad800f0e9d", + "elapsed_seconds": 8.996732473373413, + "usage": { + "prompt_tokens": 9543, + "completion_tokens": 1082, + "total_tokens": 10625, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9543 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "87361ff5-3f31-42f0-8343-9bbc56ad0bc6" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyrodigal_predict_genes_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyrodigal_predict_genes_test.json new file mode 100644 index 0000000000000000000000000000000000000000..49f9c775602fafe782f927c65248199411133e83 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyrodigal_predict_genes_test.json @@ -0,0 +1,222 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "pyrodigal", + "version": "3.7.1", + "build": "py313h8c92656_1", + "executable": "pyrodigal", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "predict_genes", + "description": "Predict genes in a FASTA input file and output GFF, protein, and nucleotide gene sequences." + }, + "arguments": [ + { + "name": "input_file", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Specify FASTA input file." + }, + { + "name": "output_gff", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Specify output file for GFF annotations." + }, + { + "name": "output_proteins", + "flag": "-a", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Write protein translations to the selected file." + }, + { + "name": "output_genes", + "flag": "-d", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Write nucleotide sequences of genes to the selected file." + } + ], + "inputs": [ + { + "name": "input_file", + "artifact_type": "FASTA", + "binding": "input_file", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + }, + { + "name": "readable", + "status": "declared", + "description": "Input file must be readable." + } + ] + } + ], + "outputs": [ + { + "name": "output_gff", + "artifact_type": "GFF", + "binding": "output_gff", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output GFF file must be created." + }, + { + "name": "nonempty", + "status": "declared", + "description": "Output GFF file must be non-empty." + } + ] + }, + { + "name": "output_proteins", + "artifact_type": "FASTA", + "binding": "output_proteins", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output protein file must be created." + }, + { + "name": "nonempty", + "status": "declared", + "description": "Output protein file must be non-empty." + } + ] + }, + { + "name": "output_genes", + "artifact_type": "FASTA", + "binding": "output_genes", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output nucleotide gene file must be created." + }, + { + "name": "nonempty", + "status": "declared", + "description": "Output nucleotide gene file must be non-empty." + } + ] + } + ], + "validators": [ + { + "name": "gff_valid", + "artifact_type": "GFF", + "binding": "output_gff", + "assertions": [ + { + "name": "valid_gff", + "status": "declared", + "description": "Output GFF file must be valid GFF format." + } + ] + }, + { + "name": "fasta_valid", + "artifact_type": "FASTA", + "binding": "output_proteins", + "assertions": [ + { + "name": "valid_fasta", + "status": "declared", + "description": "Output protein file must be valid FASTA format." + } + ] + }, + { + "name": "fasta_valid", + "artifact_type": "FASTA", + "binding": "output_genes", + "assertions": [ + { + "name": "valid_fasta", + "status": "declared", + "description": "Output nucleotide gene file must be valid FASTA format." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "arguments", + "source_type": "help_text", + "locator": "pyrodigal --help", + "excerpt": "-a trans_file Write protein translations to the selected file. (default: None)", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev2", + "field": "arguments", + "source_type": "help_text", + "locator": "pyrodigal --help", + "excerpt": "-d nuc_file Write nucleotide sequences of genes to the selected file. (default: None)", + "digest": "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "help_text", + "locator": "pyrodigal --help", + "excerpt": "-i input_file Specify FASTA input file. (default: None)", + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + }, + { + "id": "ev4", + "field": "arguments", + "source_type": "help_text", + "locator": "pyrodigal --help", + "excerpt": "-o output_file Specify output file. (default: None)", + "digest": "sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "pyrodigal", + "-p", + "meta", + "-i", + "{input_file}", + "-o", + "{output_gff}", + "-a", + "{output_proteins}", + "-d", + "{output_genes}", + "-j", + "1" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyrodigal_predict_genes_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyrodigal_predict_genes_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..956e156a29b743b2629fe68871737b2f6230e2eb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyrodigal_predict_genes_test.json.raw.txt @@ -0,0 +1,222 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "pyrodigal", + "version": "3.7.1", + "build": "py313h8c92656_1", + "executable": "pyrodigal", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "predict_genes", + "description": "Predict genes in a FASTA input file and output GFF, protein, and nucleotide gene sequences." + }, + "arguments": [ + { + "name": "input_file", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Specify FASTA input file." + }, + { + "name": "output_gff", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Specify output file for GFF annotations." + }, + { + "name": "output_proteins", + "flag": "-a", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Write protein translations to the selected file." + }, + { + "name": "output_genes", + "flag": "-d", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Write nucleotide sequences of genes to the selected file." + } + ], + "inputs": [ + { + "name": "input_file", + "artifact_type": "FASTA", + "binding": "input_file", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + }, + { + "name": "readable", + "status": "declared", + "description": "Input file must be readable." + } + ] + } + ], + "outputs": [ + { + "name": "output_gff", + "artifact_type": "GFF", + "binding": "output_gff", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output GFF file must be created." + }, + { + "name": "nonempty", + "status": "declared", + "description": "Output GFF file must be non-empty." + } + ] + }, + { + "name": "output_proteins", + "artifact_type": "FASTA", + "binding": "output_proteins", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output protein file must be created." + }, + { + "name": "nonempty", + "status": "declared", + "description": "Output protein file must be non-empty." + } + ] + }, + { + "name": "output_genes", + "artifact_type": "FASTA", + "binding": "output_genes", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output nucleotide gene file must be created." + }, + { + "name": "nonempty", + "status": "declared", + "description": "Output nucleotide gene file must be non-empty." + } + ] + } + ], + "validators": [ + { + "name": "gff_valid", + "artifact_type": "GFF", + "binding": "output_gff", + "assertions": [ + { + "name": "valid_gff", + "status": "declared", + "description": "Output GFF file must be valid GFF format." + } + ] + }, + { + "name": "fasta_valid", + "artifact_type": "FASTA", + "binding": "output_proteins", + "assertions": [ + { + "name": "valid_fasta", + "status": "declared", + "description": "Output protein file must be valid FASTA format." + } + ] + }, + { + "name": "fasta_valid", + "artifact_type": "FASTA", + "binding": "output_genes", + "assertions": [ + { + "name": "valid_fasta", + "status": "declared", + "description": "Output nucleotide gene file must be valid FASTA format." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "arguments", + "source_type": "help_text", + "locator": "pyrodigal --help", + "excerpt": "-a trans_file Write protein translations to the selected file. (default: None)", + "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + }, + { + "id": "ev2", + "field": "arguments", + "source_type": "help_text", + "locator": "pyrodigal --help", + "excerpt": "-d nuc_file Write nucleotide sequences of genes to the selected file. (default: None)", + "digest": "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "help_text", + "locator": "pyrodigal --help", + "excerpt": "-i input_file Specify FASTA input file. (default: None)", + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + }, + { + "id": "ev4", + "field": "arguments", + "source_type": "help_text", + "locator": "pyrodigal --help", + "excerpt": "-o output_file Specify output file. (default: None)", + "digest": "sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "pyrodigal", + "-p", + "meta", + "-i", + "{input_file}", + "-o", + "{output_gff}", + "-a", + "{output_proteins}", + "-d", + "{output_genes}", + "-j", + "1" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyrodigal_predict_genes_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyrodigal_predict_genes_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..3adcef5caa9b8e1b3c22b28466ec326dbde5480f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pyrodigal_predict_genes_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "97e44fe4d1cca9f537035913ba61aae586e473c8b77e7d80436e1f422b314b38", + "elapsed_seconds": 6.893498420715332, + "usage": { + "prompt_tokens": 1477, + "completion_tokens": 1537, + "total_tokens": 3014, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1477 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "ee33df1c-2112-4433-adba-68e9805853d9" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pysam_summarize_bam_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pysam_summarize_bam_test.json new file mode 100644 index 0000000000000000000000000000000000000000..b89e3dd94a93f4dfde852e127b6d748e5d97bf44 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pysam_summarize_bam_test.json @@ -0,0 +1,133 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "pysam", + "version": "0.24.0", + "build": "py310h4a09ff2_1", + "executable": "python3.10", + "subcommand": null, + "environment": "Python" + }, + "endpoint": { + "name": "summarize_bam", + "description": "Summarize BAM records using pysam; outputs JSON with references, mapped, unmapped, and total record count." + }, + "arguments": [ + { + "name": "input_bam", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input BAM file path." + }, + { + "name": "output_json", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output JSON file path." + } + ], + "inputs": [ + { + "name": "input_bam", + "artifact_type": "bam", + "binding": "input_bam", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input BAM file must exist." + }, + { + "name": "bai_sidecar", + "status": "inferred", + "description": "BAI sidecar is implicitly required for indexed access." + } + ] + } + ], + "outputs": [ + { + "name": "output_json", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output JSON file is created." + } + ] + } + ], + "validators": [ + { + "name": "json_valid", + "artifact": "output_json", + "status": "declared", + "description": "Output must be valid JSON." + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge pysam --info", + "excerpt": "pysam 0.24.0 py310h4a09ff2_1", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "help_text", + "locator": "Help text", + "excerpt": "execution_environment: Python", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "Method-neutral target interface", + "excerpt": "endpoint: summarize_bam", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments", + "source_type": "target_interface", + "locator": "Method-neutral target interface", + "excerpt": "parameters: input_bam, output_json", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "Method-neutral target interface", + "excerpt": "execution_plan: steps with python3.10 -c ...", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "python3.10", + "-c", + "import json,pysam,sys; b=pysam.AlignmentFile(sys.argv[1],'rb'); d={'references':list(b.references),'mapped':b.mapped,'unmapped':b.unmapped,'records':sum(1 for _ in b.fetch(until_eof=True))}; open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')", + "{input_bam}", + "{output_json}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pysam_summarize_bam_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pysam_summarize_bam_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..0fc8f02ea4ed5c615ed3d4bdf1eb8d24a39fcdd6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pysam_summarize_bam_test.json.raw.txt @@ -0,0 +1,133 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "pysam", + "version": "0.24.0", + "build": "py310h4a09ff2_1", + "executable": "python3.10", + "subcommand": null, + "environment": "Python" + }, + "endpoint": { + "name": "summarize_bam", + "description": "Summarize BAM records using pysam; outputs JSON with references, mapped, unmapped, and total record count." + }, + "arguments": [ + { + "name": "input_bam", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input BAM file path." + }, + { + "name": "output_json", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output JSON file path." + } + ], + "inputs": [ + { + "name": "input_bam", + "artifact_type": "bam", + "binding": "input_bam", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input BAM file must exist." + }, + { + "name": "bai_sidecar", + "status": "inferred", + "description": "BAI sidecar is implicitly required for indexed access." + } + ] + } + ], + "outputs": [ + { + "name": "output_json", + "artifact_type": "json", + "binding": "output_json", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output JSON file is created." + } + ] + } + ], + "validators": [ + { + "name": "json_valid", + "artifact": "output_json", + "status": "declared", + "description": "Output must be valid JSON." + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge pysam --info", + "excerpt": "pysam 0.24.0 py310h4a09ff2_1", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "help_text", + "locator": "Help text", + "excerpt": "execution_environment: Python", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "Method-neutral target interface", + "excerpt": "endpoint: summarize_bam", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments", + "source_type": "target_interface", + "locator": "Method-neutral target interface", + "excerpt": "parameters: input_bam, output_json", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "Method-neutral target interface", + "excerpt": "execution_plan: steps with python3.10 -c ...", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "python3.10", + "-c", + "import json,pysam,sys; b=pysam.AlignmentFile(sys.argv[1],'rb'); d={'references':list(b.references),'mapped':b.mapped,'unmapped':b.unmapped,'records':sum(1 for _ in b.fetch(until_eof=True))}; open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')", + "{input_bam}", + "{output_json}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pysam_summarize_bam_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pysam_summarize_bam_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..5f72881c018f3bd85b9425bc0f952da911f027f3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/pysam_summarize_bam_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "f0e10bb990ba7ef00f052ae7dfc67b26270fe64964099f70407cff6594bd241e", + "elapsed_seconds": 6.158743858337402, + "usage": { + "prompt_tokens": 8060, + "completion_tokens": 1119, + "total_tokens": 9179, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 8060 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "72cedfdc-f6bd-48bf-a118-85a62eb169f0" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/python-edlib_global_align_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/python-edlib_global_align_test.json new file mode 100644 index 0000000000000000000000000000000000000000..8a7c84e7faa1bd1ca2fc401305de215b258b178c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/python-edlib_global_align_test.json @@ -0,0 +1,172 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "python-edlib", + "version": "1.3.9.post1", + "build": "py310h1153794_3", + "executable": "python3.10", + "subcommand": null, + "environment": "Python" + }, + "endpoint": { + "name": "global_align", + "description": "Perform global alignment (NW mode) using edlib and output the result as JSON." + }, + "arguments": [ + { + "name": "sequence_a", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to the first sequence file (FASTA or plain text)." + }, + { + "name": "sequence_b", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to the second sequence file (FASTA or plain text)." + }, + { + "name": "output_json", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Path to the output JSON file." + } + ], + "inputs": [ + { + "name": "sequence_a", + "artifact_type": "file", + "binding": "sequence_a", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [] + }, + { + "name": "readable", + "status": "declared", + "evidence": [] + } + ] + }, + { + "name": "sequence_b", + "artifact_type": "file", + "binding": "sequence_b", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [] + }, + { + "name": "readable", + "status": "declared", + "evidence": [] + } + ] + } + ], + "outputs": [ + { + "name": "output_json", + "artifact_type": "file", + "binding": "output_json", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [] + }, + { + "name": "json", + "status": "declared", + "evidence": [] + } + ] + } + ], + "validators": [ + { + "name": "output_json_valid", + "artifact_type": "file", + "binding": "output_json", + "assertions": [ + { + "name": "json", + "status": "declared", + "evidence": [] + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "endpoint.description", + "source_type": "doc", + "locator": "https://martinsos.github.io/edlib", + "excerpt": "global (NW) - This is the standard method, when we say \"edit distance\" this is the method that is assumed.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.sequence_a.description", + "source_type": "doc", + "locator": "https://martinsos.github.io/edlib", + "excerpt": "Given two sequences (and their lengths), it will find edit distance, alignment path or its end and start locations.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.sequence_b.description", + "source_type": "doc", + "locator": "https://martinsos.github.io/edlib", + "excerpt": "Given two sequences (and their lengths), it will find edit distance, alignment path or its end and start locations.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.output_json.description", + "source_type": "doc", + "locator": "https://martinsos.github.io/edlib", + "excerpt": "EdlibAlignResult result = edlibAlign(...); printf(\"%d\", result.editDistance);", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "outputs.output_json.assertions", + "source_type": "doc", + "locator": "https://martinsos.github.io/edlib", + "excerpt": "EdlibAlignResult result = edlibAlign(...); printf(\"%d\", result.editDistance);", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "python3.10", + "-c", + "import json,edlib,sys; rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>')); r=edlib.align(rd(sys.argv[1]),rd(sys.argv[2]),mode='NW',task='path'); open(sys.argv[3],'w').write(json.dumps(r,sort_keys=True)+'\\n')", + "{sequence_a}", + "{sequence_b}", + "{output_json}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/python-edlib_global_align_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/python-edlib_global_align_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..736b882a32f509e3efdfd8371f4e5fd92e9f9a7c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/python-edlib_global_align_test.json.raw.txt @@ -0,0 +1,172 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "python-edlib", + "version": "1.3.9.post1", + "build": "py310h1153794_3", + "executable": "python3.10", + "subcommand": null, + "environment": "Python" + }, + "endpoint": { + "name": "global_align", + "description": "Perform global alignment (NW mode) using edlib and output the result as JSON." + }, + "arguments": [ + { + "name": "sequence_a", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to the first sequence file (FASTA or plain text)." + }, + { + "name": "sequence_b", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to the second sequence file (FASTA or plain text)." + }, + { + "name": "output_json", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Path to the output JSON file." + } + ], + "inputs": [ + { + "name": "sequence_a", + "artifact_type": "file", + "binding": "sequence_a", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [] + }, + { + "name": "readable", + "status": "declared", + "evidence": [] + } + ] + }, + { + "name": "sequence_b", + "artifact_type": "file", + "binding": "sequence_b", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [] + }, + { + "name": "readable", + "status": "declared", + "evidence": [] + } + ] + } + ], + "outputs": [ + { + "name": "output_json", + "artifact_type": "file", + "binding": "output_json", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [] + }, + { + "name": "json", + "status": "declared", + "evidence": [] + } + ] + } + ], + "validators": [ + { + "name": "output_json_valid", + "artifact_type": "file", + "binding": "output_json", + "assertions": [ + { + "name": "json", + "status": "declared", + "evidence": [] + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "endpoint.description", + "source_type": "doc", + "locator": "https://martinsos.github.io/edlib", + "excerpt": "global (NW) - This is the standard method, when we say \"edit distance\" this is the method that is assumed.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.sequence_a.description", + "source_type": "doc", + "locator": "https://martinsos.github.io/edlib", + "excerpt": "Given two sequences (and their lengths), it will find edit distance, alignment path or its end and start locations.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.sequence_b.description", + "source_type": "doc", + "locator": "https://martinsos.github.io/edlib", + "excerpt": "Given two sequences (and their lengths), it will find edit distance, alignment path or its end and start locations.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.output_json.description", + "source_type": "doc", + "locator": "https://martinsos.github.io/edlib", + "excerpt": "EdlibAlignResult result = edlibAlign(...); printf(\"%d\", result.editDistance);", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "outputs.output_json.assertions", + "source_type": "doc", + "locator": "https://martinsos.github.io/edlib", + "excerpt": "EdlibAlignResult result = edlibAlign(...); printf(\"%d\", result.editDistance);", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "python3.10", + "-c", + "import json,edlib,sys; rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>')); r=edlib.align(rd(sys.argv[1]),rd(sys.argv[2]),mode='NW',task='path'); open(sys.argv[3],'w').write(json.dumps(r,sort_keys=True)+'\\n')", + "{sequence_a}", + "{sequence_b}", + "{output_json}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/python-edlib_global_align_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/python-edlib_global_align_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..c29ac3c3984d71fe9acd0824f8762c6238a3316f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/python-edlib_global_align_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "691a420c6e9ef00791e64e39f75397882e24134155fe192cd2e3264f413200ac", + "elapsed_seconds": 8.461546182632446, + "usage": { + "prompt_tokens": 17862, + "completion_tokens": 1363, + "total_tokens": 19225, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 17862 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "a358140c-d315-4aad-9fab-317ea8a95345" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/raxml_infer_protein_tree_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/raxml_infer_protein_tree_test.json new file mode 100644 index 0000000000000000000000000000000000000000..2ee17a1212cb349a1b4e3d872fa9dbbe477f87f0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/raxml_infer_protein_tree_test.json @@ -0,0 +1,162 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "raxml", + "version": "8.2.13", + "build": "h7b50bb2_3", + "executable": "raxmlHPC", + "subcommand": null, + "environment": { + "dependencies": [ + "libgcc >=13" + ], + "execution_environment": "Compiled" + } + }, + "endpoint": { + "name": "infer_protein_tree", + "description": "Infer a protein maximum likelihood tree using RAxML with PROTGAMMALG model, parsimony seed 1, and one search." + }, + "arguments": [ + { + "name": "alignment_file", + "flag": "-s", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input alignment file in PHYLIP format." + }, + { + "name": "output_dir", + "flag": "-w", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output directory for RAxML result files." + } + ], + "inputs": [ + { + "name": "alignment_file", + "artifact_type": "file", + "binding": "alignment_file", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-001" + ] + }, + { + "name": "readable", + "status": "declared", + "evidence": [ + "ev-001" + ] + }, + { + "name": "format", + "value": "phylip", + "status": "inferred", + "evidence": [ + "ev-002" + ] + } + ] + } + ], + "outputs": [ + { + "name": "output_dir", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-003" + ] + }, + { + "name": "writable", + "status": "declared", + "evidence": [ + "ev-003" + ] + } + ] + } + ], + "validators": [ + { + "name": "output_dir_created", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-003" + ] + } + ] + } + ], + "evidence": [ + { + "id": "ev-001", + "field": "inputs[0].assertions[0]", + "source_type": "target_interface", + "locator": "parameters[0]", + "excerpt": "alignment_file required", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-002", + "field": "inputs[0].assertions[2]", + "source_type": "help_text", + "locator": "http://sco.h-its.org/exelixis/web/software/raxml/index.html", + "excerpt": "RAxML accepts PHYLIP alignment files", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-003", + "field": "outputs[0].assertions[0]", + "source_type": "target_interface", + "locator": "execution_plan.steps[0].make_directories", + "excerpt": "make_directories: [output_dir]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "make_directories": [ + "output_dir" + ], + "command": [ + "raxmlHPC", + "-s", + "{alignment_file}", + "-n", + "fixture", + "-m", + "PROTGAMMALG", + "-p", + "1", + "-N", + "1", + "-w", + "{output_dir}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/raxml_infer_protein_tree_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/raxml_infer_protein_tree_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..b7d68b9434bc5b3caf55c5693d92758e670f6001 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/raxml_infer_protein_tree_test.json.raw.txt @@ -0,0 +1,148 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "raxml", + "version": "8.2.13", + "build": "h7b50bb2_3", + "executable": "raxmlHPC", + "subcommand": null, + "environment": { + "dependencies": ["libgcc >=13"], + "execution_environment": "Compiled" + } + }, + "endpoint": { + "name": "infer_protein_tree", + "description": "Infer a protein maximum likelihood tree using RAxML with PROTGAMMALG model, parsimony seed 1, and one search." + }, + "arguments": [ + { + "name": "alignment_file", + "flag": "-s", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input alignment file in PHYLIP format." + }, + { + "name": "output_dir", + "flag": "-w", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output directory for RAxML result files." + } + ], + "inputs": [ + { + "name": "alignment_file", + "artifact_type": "file", + "binding": "alignment_file", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-001"] + }, + { + "name": "readable", + "status": "declared", + "evidence": ["ev-001"] + }, + { + "name": "format", + "value": "phylip", + "status": "inferred", + "evidence": ["ev-002"] + } + ] + } + ], + "outputs": [ + { + "name": "output_dir", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-003"] + }, + { + "name": "writable", + "status": "declared", + "evidence": ["ev-003"] + } + ] + } + ], + "validators": [ + { + "name": "output_dir_created", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-003"] + } + ] + } + ], + "evidence": [ + { + "id": "ev-001", + "field": "inputs[0].assertions[0]", + "source_type": "target_interface", + "locator": "parameters[0]", + "excerpt": "alignment_file required", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-002", + "field": "inputs[0].assertions[2]", + "source_type": "help_text", + "locator": "http://sco.h-its.org/exelixis/web/software/raxml/index.html", + "excerpt": "RAxML accepts PHYLIP alignment files", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-003", + "field": "outputs[0].assertions[0]", + "source_type": "target_interface", + "locator": "execution_plan.steps[0].make_directories", + "excerpt": "make_directories: [output_dir]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "make_directories": [ + "output_dir" + ], + "command": [ + "raxmlHPC", + "-s", + "{alignment_file}", + "-n", + "fixture", + "-m", + "PROTGAMMALG", + "-p", + "1", + "-N", + "1", + "-w", + "{output_dir}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/raxml_infer_protein_tree_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/raxml_infer_protein_tree_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..96998e5856386983ec8bd93ea56391c701fa822a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/raxml_infer_protein_tree_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "130a02166551f581f98bbae5b4c3f4408870b8a90d1c859101437c2bbebeb887", + "elapsed_seconds": 6.23202657699585, + "usage": { + "prompt_tokens": 9102, + "completion_tokens": 1029, + "total_tokens": 10131, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9102 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "b8dafdf2-dd18-473a-8120-b1698e15a092" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rgi_remove_duplicate_prevalence_sequences_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rgi_remove_duplicate_prevalence_sequences_test.json new file mode 100644 index 0000000000000000000000000000000000000000..3e60421071b96e9374a4703021810bc09235c1c3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rgi_remove_duplicate_prevalence_sequences_test.json @@ -0,0 +1,192 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "rgi", + "version": "5.1.0", + "build": "py36hed695b0_0", + "executable": "rgi", + "subcommand": "remove_duplicates", + "environment": "conda" + }, + "endpoint": { + "name": "remove_duplicate_prevalence_sequences", + "description": "Apply RGI's native CARD-length filter and sequence deduplication to three pinned prevalence records." + }, + "arguments": [ + { + "name": "prevalence_fasta", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input prevalence FASTA file" + }, + { + "name": "card_annotation", + "flag": "--card_annotation", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "CARD annotation file" + }, + { + "name": "output_fasta", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output FASTA file" + } + ], + "inputs": [ + { + "name": "prevalence_fasta", + "artifact_type": "fasta", + "binding": "prevalence_fasta", + "assertions": [] + }, + { + "name": "card_annotation", + "artifact_type": "annotation", + "binding": "card_annotation", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_fasta", + "artifact_type": "fasta", + "binding": "output_fasta", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge rgi --info", + "excerpt": "rgi 5.1.0 py36hed695b0_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge rgi --info", + "excerpt": "version: 5.1.0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge rgi --info", + "excerpt": "build: py36hed695b0_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "tool.executable", + "source_type": "target_interface", + "locator": "candidate native executable", + "excerpt": "rgi", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "target subcommand", + "excerpt": "remove_duplicates", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "target endpoint", + "excerpt": "remove_duplicate_prevalence_sequences", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments[0].name", + "source_type": "target_interface", + "locator": "parameters[0].name", + "excerpt": "prevalence_fasta", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev8", + "field": "arguments[0].flag", + "source_type": "target_interface", + "locator": "parameters[0].native_binding", + "excerpt": "-i", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev9", + "field": "arguments[1].name", + "source_type": "target_interface", + "locator": "parameters[1].name", + "excerpt": "card_annotation", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev10", + "field": "arguments[1].flag", + "source_type": "target_interface", + "locator": "parameters[1].native_binding", + "excerpt": "--card_annotation", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev11", + "field": "arguments[2].name", + "source_type": "target_interface", + "locator": "parameters[2].name", + "excerpt": "output_fasta", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev12", + "field": "arguments[2].flag", + "source_type": "target_interface", + "locator": "parameters[2].native_binding", + "excerpt": "-o", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev13", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "execution_plan", + "excerpt": "{\"steps\":[{\"command\":[\"rgi\",\"remove_duplicates\",\"-i\",\"{prevalence_fasta}\",\"--card_annotation\",\"{card_annotation}\",\"-o\",\"{output_fasta}\"]}]}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "rgi", + "remove_duplicates", + "-i", + "{prevalence_fasta}", + "--card_annotation", + "{card_annotation}", + "-o", + "{output_fasta}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rgi_remove_duplicate_prevalence_sequences_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rgi_remove_duplicate_prevalence_sequences_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..84e7ffa47f35b407dfd73910b0ea0e0e4b61766b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rgi_remove_duplicate_prevalence_sequences_test.json.raw.txt @@ -0,0 +1,192 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "rgi", + "version": "5.1.0", + "build": "py36hed695b0_0", + "executable": "rgi", + "subcommand": "remove_duplicates", + "environment": "conda" + }, + "endpoint": { + "name": "remove_duplicate_prevalence_sequences", + "description": "Apply RGI's native CARD-length filter and sequence deduplication to three pinned prevalence records." + }, + "arguments": [ + { + "name": "prevalence_fasta", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input prevalence FASTA file" + }, + { + "name": "card_annotation", + "flag": "--card_annotation", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "CARD annotation file" + }, + { + "name": "output_fasta", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output FASTA file" + } + ], + "inputs": [ + { + "name": "prevalence_fasta", + "artifact_type": "fasta", + "binding": "prevalence_fasta", + "assertions": [] + }, + { + "name": "card_annotation", + "artifact_type": "annotation", + "binding": "card_annotation", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_fasta", + "artifact_type": "fasta", + "binding": "output_fasta", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge rgi --info", + "excerpt": "rgi 5.1.0 py36hed695b0_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge rgi --info", + "excerpt": "version: 5.1.0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge rgi --info", + "excerpt": "build: py36hed695b0_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "tool.executable", + "source_type": "target_interface", + "locator": "candidate native executable", + "excerpt": "rgi", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "target subcommand", + "excerpt": "remove_duplicates", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "target endpoint", + "excerpt": "remove_duplicate_prevalence_sequences", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments[0].name", + "source_type": "target_interface", + "locator": "parameters[0].name", + "excerpt": "prevalence_fasta", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev8", + "field": "arguments[0].flag", + "source_type": "target_interface", + "locator": "parameters[0].native_binding", + "excerpt": "-i", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev9", + "field": "arguments[1].name", + "source_type": "target_interface", + "locator": "parameters[1].name", + "excerpt": "card_annotation", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev10", + "field": "arguments[1].flag", + "source_type": "target_interface", + "locator": "parameters[1].native_binding", + "excerpt": "--card_annotation", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev11", + "field": "arguments[2].name", + "source_type": "target_interface", + "locator": "parameters[2].name", + "excerpt": "output_fasta", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev12", + "field": "arguments[2].flag", + "source_type": "target_interface", + "locator": "parameters[2].native_binding", + "excerpt": "-o", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev13", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "execution_plan", + "excerpt": "{\"steps\":[{\"command\":[\"rgi\",\"remove_duplicates\",\"-i\",\"{prevalence_fasta}\",\"--card_annotation\",\"{card_annotation}\",\"-o\",\"{output_fasta}\"]}]}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "rgi", + "remove_duplicates", + "-i", + "{prevalence_fasta}", + "--card_annotation", + "{card_annotation}", + "-o", + "{output_fasta}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rgi_remove_duplicate_prevalence_sequences_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rgi_remove_duplicate_prevalence_sequences_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..f42471b35370576492cba75475dac3b83e804bb4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rgi_remove_duplicate_prevalence_sequences_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "e66e49411d57e498dbd04af2653f00040b90b74e4f46dfdbe79f8a15034ddad5", + "elapsed_seconds": 8.34305453300476, + "usage": { + "prompt_tokens": 8111, + "completion_tokens": 1775, + "total_tokens": 9886, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 8111 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "09927aaa-9134-46ee-a04e-5249bf48477d" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rnastructure_fold_rna_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rnastructure_fold_rna_test.json new file mode 100644 index 0000000000000000000000000000000000000000..fa8b304dc77771c44250e31e4e14240cf7fadf43 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rnastructure_fold_rna_test.json @@ -0,0 +1,220 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "rnastructure", + "version": "6.6", + "build": "hde5307d_0", + "executable": "Fold", + "subcommand": null, + "environment": { + "DATAPATH": "/225040511/miniconda3/envs/experiment1_test_pinned/rnastructure-6.6-hde5307d_0/share/rnastructure/data_tables" + } + }, + "endpoint": { + "name": "fold_rna", + "description": "Predict the minimum free energy (MFE) secondary structure of an RNA sequence and output in dot-bracket notation." + }, + "arguments": [ + { + "name": "input_rna", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to input RNA sequence file." + }, + { + "name": "output_dbn", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to output dot-bracket file." + }, + { + "name": "bracket", + "flag": "--bracket", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Output in dot-bracket notation." + }, + { + "name": "mfe", + "flag": "--MFE", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Predict only the minimum free energy structure." + }, + { + "name": "quiet", + "flag": "--quiet", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Suppress non-essential output." + } + ], + "inputs": [ + { + "name": "input_rna", + "artifact_type": "file", + "binding": "input_rna", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + }, + { + "name": "readable", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "outputs": [ + { + "name": "output_dbn", + "artifact_type": "file", + "binding": "output_dbn", + "assertions": [ + { + "name": "created", + "status": "inferred", + "evidence": [] + }, + { + "name": "dot_bracket", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "validators": [ + { + "name": "output_file_exists", + "artifact_type": "file", + "binding": "output_dbn", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_info", + "locator": "conda search rnastructure --info", + "excerpt": "rnastructure 6.6 hde5307d_0", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_info", + "locator": "conda search rnastructure --info", + "excerpt": "version : 6.6", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_info", + "locator": "conda search rnastructure --info", + "excerpt": "build : hde5307d_0", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev4", + "field": "tool.environment.DATAPATH", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].environment.DATAPATH", + "excerpt": "\"DATAPATH\": \"/225040511/miniconda3/envs/experiment1_test_pinned/rnastructure-6.6-hde5307d_0/share/rnastructure/data_tables\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev5", + "field": "arguments.input_rna", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command[1]", + "excerpt": "\"{input_rna}\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev6", + "field": "arguments.output_dbn", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command[2]", + "excerpt": "\"{output_dbn}\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev7", + "field": "arguments.bracket", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command[3]", + "excerpt": "\"--bracket\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev8", + "field": "arguments.mfe", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command[4]", + "excerpt": "\"--MFE\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev9", + "field": "arguments.quiet", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command[5]", + "excerpt": "\"--quiet\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev10", + "field": "endpoint.description", + "source_type": "doc_url", + "locator": "https://rna.urmc.rochester.edu/RNAstructure.html", + "excerpt": "RNAstructure is a complete package for RNA and DNA secondary structure prediction and analysis.", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + } + ], + "execution_plan": { + "steps": [ + { + "environment": { + "DATAPATH": "/225040511/miniconda3/envs/experiment1_test_pinned/rnastructure-6.6-hde5307d_0/share/rnastructure/data_tables" + }, + "command": [ + "Fold", + "{input_rna}", + "{output_dbn}", + "--bracket", + "--MFE", + "--quiet" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rnastructure_fold_rna_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rnastructure_fold_rna_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..527710716be5b3b20cacac02d9b0e0840b202ade --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rnastructure_fold_rna_test.json.raw.txt @@ -0,0 +1,220 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "rnastructure", + "version": "6.6", + "build": "hde5307d_0", + "executable": "Fold", + "subcommand": null, + "environment": { + "DATAPATH": "/225040511/miniconda3/envs/experiment1_test_pinned/rnastructure-6.6-hde5307d_0/share/rnastructure/data_tables" + } + }, + "endpoint": { + "name": "fold_rna", + "description": "Predict the minimum free energy (MFE) secondary structure of an RNA sequence and output in dot-bracket notation." + }, + "arguments": [ + { + "name": "input_rna", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to input RNA sequence file." + }, + { + "name": "output_dbn", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to output dot-bracket file." + }, + { + "name": "bracket", + "flag": "--bracket", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Output in dot-bracket notation." + }, + { + "name": "mfe", + "flag": "--MFE", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Predict only the minimum free energy structure." + }, + { + "name": "quiet", + "flag": "--quiet", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Suppress non-essential output." + } + ], + "inputs": [ + { + "name": "input_rna", + "artifact_type": "file", + "binding": "input_rna", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + }, + { + "name": "readable", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "outputs": [ + { + "name": "output_dbn", + "artifact_type": "file", + "binding": "output_dbn", + "assertions": [ + { + "name": "created", + "status": "inferred", + "evidence": [] + }, + { + "name": "dot_bracket", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "validators": [ + { + "name": "output_file_exists", + "artifact_type": "file", + "binding": "output_dbn", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_info", + "locator": "conda search rnastructure --info", + "excerpt": "rnastructure 6.6 hde5307d_0", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_info", + "locator": "conda search rnastructure --info", + "excerpt": "version : 6.6", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_info", + "locator": "conda search rnastructure --info", + "excerpt": "build : hde5307d_0", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev4", + "field": "tool.environment.DATAPATH", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].environment.DATAPATH", + "excerpt": "\"DATAPATH\": \"/225040511/miniconda3/envs/experiment1_test_pinned/rnastructure-6.6-hde5307d_0/share/rnastructure/data_tables\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev5", + "field": "arguments.input_rna", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command[1]", + "excerpt": "\"{input_rna}\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev6", + "field": "arguments.output_dbn", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command[2]", + "excerpt": "\"{output_dbn}\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev7", + "field": "arguments.bracket", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command[3]", + "excerpt": "\"--bracket\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev8", + "field": "arguments.mfe", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command[4]", + "excerpt": "\"--MFE\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev9", + "field": "arguments.quiet", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command[5]", + "excerpt": "\"--quiet\"", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + }, + { + "id": "ev10", + "field": "endpoint.description", + "source_type": "doc_url", + "locator": "https://rna.urmc.rochester.edu/RNAstructure.html", + "excerpt": "RNAstructure is a complete package for RNA and DNA secondary structure prediction and analysis.", + "digest": "sha256:ff0c8822fd98776a9c0dc456bdcf463b" + } + ], + "execution_plan": { + "steps": [ + { + "environment": { + "DATAPATH": "/225040511/miniconda3/envs/experiment1_test_pinned/rnastructure-6.6-hde5307d_0/share/rnastructure/data_tables" + }, + "command": [ + "Fold", + "{input_rna}", + "{output_dbn}", + "--bracket", + "--MFE", + "--quiet" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rnastructure_fold_rna_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rnastructure_fold_rna_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..048be361da455fa836bc52b9ec0baf02b146465b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rnastructure_fold_rna_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "92403a305e1456749716b320c63ff6008623d29e152f5d28aa58d2a92cc2cf26", + "elapsed_seconds": 10.200565576553345, + "usage": { + "prompt_tokens": 6161, + "completion_tokens": 1864, + "total_tokens": 8025, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6161 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "2cc7b26c-b1f9-43a0-8906-31c9b1b2de63" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rust-bio-tools_fastq_sequence_stats_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rust-bio-tools_fastq_sequence_stats_test.json new file mode 100644 index 0000000000000000000000000000000000000000..5d02f18d8085d654ecea7fc7c6f98d1db09f58f3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rust-bio-tools_fastq_sequence_stats_test.json @@ -0,0 +1,158 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "rust-bio-tools", + "version": "0.42.2", + "build": "h5c46d4b_3", + "executable": "rbt", + "subcommand": "sequence-stats", + "environment": { + "conda_channels": [ + "bioconda", + "conda-forge" + ], + "dependencies": [ + "gsl >=2.7,<2.8.0a0", + "libcblas >=3.9.0,<4.0a0", + "libgcc >=13", + "libstdcxx >=13", + "openssl >=3.5.3,<4.0a0", + "starcode" + ] + } + }, + "endpoint": { + "name": "fastq_sequence_stats", + "description": "Compute sequence statistics from a FASTQ file and output as YAML." + }, + "arguments": [ + { + "name": "input_fastq", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input FASTQ file (provided via stdin).", + "pass_to_cli": false + }, + { + "name": "output_yaml", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Output YAML file (captured from stdout).", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_fastq", + "artifact_type": "fastq", + "binding": "input_fastq", + "assertions": [ + { + "name": "format", + "value": "FASTQ", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_yaml", + "artifact_type": "yaml", + "binding": "output_yaml", + "capture": "stdout", + "assertions": [ + { + "name": "format", + "value": "YAML", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "fastq_valid", + "artifact": "input_fastq", + "type": "file_exists", + "status": "inferred" + }, + { + "name": "yaml_valid", + "artifact": "output_yaml", + "type": "file_exists", + "status": "inferred" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge rust-bio-tools --info", + "excerpt": "rust-bio-tools 0.42.2 h5c46d4b_3", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "doc_url", + "locator": "https://github.com/rust-bio/rust-bio-tools", + "excerpt": "Rust-Bio-Tools provides a command rbt", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Target subcommand: sequence-stats", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.input_fastq", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "input_fastq native_binding: stdin", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.output_yaml", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "output_yaml native_binding: stdout", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "rbt sequence-stats -q < '{input_fastq}' > '{output_yaml}'", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "bash", + "-lc", + { + "format": "rbt sequence-stats -q < '{input_fastq}' > '{output_yaml}'" + } + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rust-bio-tools_fastq_sequence_stats_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rust-bio-tools_fastq_sequence_stats_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..bcda85333739d1b1a6068254f7b5c6f24552a605 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rust-bio-tools_fastq_sequence_stats_test.json.raw.txt @@ -0,0 +1,155 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "rust-bio-tools", + "version": "0.42.2", + "build": "h5c46d4b_3", + "executable": "rbt", + "subcommand": "sequence-stats", + "environment": { + "conda_channels": ["bioconda", "conda-forge"], + "dependencies": [ + "gsl >=2.7,<2.8.0a0", + "libcblas >=3.9.0,<4.0a0", + "libgcc >=13", + "libstdcxx >=13", + "openssl >=3.5.3,<4.0a0", + "starcode" + ] + } + }, + "endpoint": { + "name": "fastq_sequence_stats", + "description": "Compute sequence statistics from a FASTQ file and output as YAML." + }, + "arguments": [ + { + "name": "input_fastq", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input FASTQ file (provided via stdin).", + "pass_to_cli": false + }, + { + "name": "output_yaml", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Output YAML file (captured from stdout).", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_fastq", + "artifact_type": "fastq", + "binding": "input_fastq", + "assertions": [ + { + "name": "format", + "value": "FASTQ", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_yaml", + "artifact_type": "yaml", + "binding": "output_yaml", + "capture": "stdout", + "assertions": [ + { + "name": "format", + "value": "YAML", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "fastq_valid", + "artifact": "input_fastq", + "type": "file_exists", + "status": "inferred" + }, + { + "name": "yaml_valid", + "artifact": "output_yaml", + "type": "file_exists", + "status": "inferred" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge rust-bio-tools --info", + "excerpt": "rust-bio-tools 0.42.2 h5c46d4b_3", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "doc_url", + "locator": "https://github.com/rust-bio/rust-bio-tools", + "excerpt": "Rust-Bio-Tools provides a command rbt", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Target subcommand: sequence-stats", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.input_fastq", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "input_fastq native_binding: stdin", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.output_yaml", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "output_yaml native_binding: stdout", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "rbt sequence-stats -q < '{input_fastq}' > '{output_yaml}'", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "bash", + "-lc", + { + "format": "rbt sequence-stats -q < '{input_fastq}' > '{output_yaml}'" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rust-bio-tools_fastq_sequence_stats_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rust-bio-tools_fastq_sequence_stats_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..df148c9e3881729f859be773e017028a7f622282 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/rust-bio-tools_fastq_sequence_stats_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "28bd3a1e6f3c548f2693f01a7a0970b27a070fb9bfc98d7a32772fb3f62a96d2", + "elapsed_seconds": 6.637282133102417, + "usage": { + "prompt_tokens": 9627, + "completion_tokens": 1295, + "total_tokens": 10922, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9627 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "af14a450-9656-446a-a989-c8ca426408db" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samblaster_mark_duplicates_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samblaster_mark_duplicates_test.json new file mode 100644 index 0000000000000000000000000000000000000000..0603ed4397beed67a72c8fd0f6b2b2ee220b1c77 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samblaster_mark_duplicates_test.json @@ -0,0 +1,139 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "samblaster", + "version": "0.1.26", + "build": "h9948957_7", + "executable": "samblaster", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "mark_duplicates", + "description": "Mark duplicates in SAM input and output all alignments with duplicates flagged." + }, + "arguments": [ + { + "name": "input_sam", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input SAM file (or stdin if not provided)." + }, + { + "name": "output_sam", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output SAM file for all input alignments." + }, + { + "name": "ignore_unmated", + "flag": "--ignoreUnmated", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Suppress abort on unmated alignments." + } + ], + "inputs": [ + { + "name": "input_sam", + "artifact_type": "sam", + "binding": "input_sam", + "assertions": [ + { + "name": "has_header", + "status": "declared", + "description": "Input SAM must contain sequence header." + }, + { + "name": "grouped_by_qname", + "status": "declared", + "description": "Input SAM must be grouped by read ids (QNAME)." + } + ] + } + ], + "outputs": [ + { + "name": "output_sam", + "artifact_type": "sam", + "binding": "output_sam", + "assertions": [ + { + "name": "duplicates_marked", + "status": "declared", + "description": "Duplicates marked with FLAG 0x400." + }, + { + "name": "order_preserved", + "status": "declared", + "description": "Output alignments in same order as input." + } + ] + } + ], + "validators": [ + { + "name": "input_sam_has_header", + "artifact": "input_sam", + "assertion": "has_header", + "status": "declared", + "description": "Input SAM must contain sequence header." + }, + { + "name": "input_sam_grouped_by_qname", + "artifact": "input_sam", + "assertion": "grouped_by_qname", + "status": "declared", + "description": "Input SAM must be grouped by read ids (QNAME)." + }, + { + "name": "output_sam_duplicates_marked", + "artifact": "output_sam", + "assertion": "duplicates_marked", + "status": "declared", + "description": "Duplicates marked with FLAG 0x400." + }, + { + "name": "output_sam_order_preserved", + "artifact": "output_sam", + "assertion": "order_preserved", + "status": "declared", + "description": "Output alignments in same order as input." + } + ], + "evidence": [ + { + "id": "ev_help_text", + "field": "tool.help", + "source_type": "cli_help", + "locator": "samblaster --help", + "excerpt": "Input sam file must contain sequence header and be grouped by read ids (QNAME). ... Output will be all alignments in the same order as input, with duplicates marked with FLAG 0x400.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "samblaster", + "-i", + "{input_sam}", + "-o", + "{output_sam}", + "--ignoreUnmated" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samblaster_mark_duplicates_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samblaster_mark_duplicates_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..42f9204139bc0ff2474cdf7e537db2a4b1b3e4fa --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samblaster_mark_duplicates_test.json.raw.txt @@ -0,0 +1,139 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "samblaster", + "version": "0.1.26", + "build": "h9948957_7", + "executable": "samblaster", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "mark_duplicates", + "description": "Mark duplicates in SAM input and output all alignments with duplicates flagged." + }, + "arguments": [ + { + "name": "input_sam", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input SAM file (or stdin if not provided)." + }, + { + "name": "output_sam", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output SAM file for all input alignments." + }, + { + "name": "ignore_unmated", + "flag": "--ignoreUnmated", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Suppress abort on unmated alignments." + } + ], + "inputs": [ + { + "name": "input_sam", + "artifact_type": "sam", + "binding": "input_sam", + "assertions": [ + { + "name": "has_header", + "status": "declared", + "description": "Input SAM must contain sequence header." + }, + { + "name": "grouped_by_qname", + "status": "declared", + "description": "Input SAM must be grouped by read ids (QNAME)." + } + ] + } + ], + "outputs": [ + { + "name": "output_sam", + "artifact_type": "sam", + "binding": "output_sam", + "assertions": [ + { + "name": "duplicates_marked", + "status": "declared", + "description": "Duplicates marked with FLAG 0x400." + }, + { + "name": "order_preserved", + "status": "declared", + "description": "Output alignments in same order as input." + } + ] + } + ], + "validators": [ + { + "name": "input_sam_has_header", + "artifact": "input_sam", + "assertion": "has_header", + "status": "declared", + "description": "Input SAM must contain sequence header." + }, + { + "name": "input_sam_grouped_by_qname", + "artifact": "input_sam", + "assertion": "grouped_by_qname", + "status": "declared", + "description": "Input SAM must be grouped by read ids (QNAME)." + }, + { + "name": "output_sam_duplicates_marked", + "artifact": "output_sam", + "assertion": "duplicates_marked", + "status": "declared", + "description": "Duplicates marked with FLAG 0x400." + }, + { + "name": "output_sam_order_preserved", + "artifact": "output_sam", + "assertion": "order_preserved", + "status": "declared", + "description": "Output alignments in same order as input." + } + ], + "evidence": [ + { + "id": "ev_help_text", + "field": "tool.help", + "source_type": "cli_help", + "locator": "samblaster --help", + "excerpt": "Input sam file must contain sequence header and be grouped by read ids (QNAME). ... Output will be all alignments in the same order as input, with duplicates marked with FLAG 0x400.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "samblaster", + "-i", + "{input_sam}", + "-o", + "{output_sam}", + "--ignoreUnmated" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samblaster_mark_duplicates_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samblaster_mark_duplicates_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..85ecb55eb8b1a7e77857056c8a6f69bf35d1851a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samblaster_mark_duplicates_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "d94d5bab13d545699c5418bd99f6394369130d2bb3bd1c91bd8f07dee197416f", + "elapsed_seconds": 8.120543479919434, + "usage": { + "prompt_tokens": 1714, + "completion_tokens": 1019, + "total_tokens": 2733, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1714 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "8c1e2f3a-a2d0-48e4-a521-8f06898ad32f" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samsift_filter_alignments_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samsift_filter_alignments_test.json new file mode 100644 index 0000000000000000000000000000000000000000..087ae6d1971bda2248164cacf4c3edaa7d33e78f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samsift_filter_alignments_test.json @@ -0,0 +1,104 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "samsift", + "version": "0.2.5", + "build": "py37_2", + "executable": "samsift", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "filter_alignments", + "description": "Filter SAM/BAM alignments using a fixed expression MAPQ >= 60." + }, + "arguments": [ + { + "name": "input_sam", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input SAM/BAM file." + }, + { + "name": "output_sam", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output SAM/BAM file." + } + ], + "inputs": [ + { + "name": "input_sam", + "artifact_type": "sam_or_bam", + "binding": "input_sam", + "assertions": [ + { + "field": "exists", + "status": "inferred", + "description": "Input file must exist." + } + ] + } + ], + "outputs": [ + { + "name": "output_sam", + "artifact_type": "sam_or_bam", + "binding": "output_sam", + "assertions": [ + { + "field": "created", + "status": "inferred", + "description": "Output file is created." + } + ] + } + ], + "validators": [ + { + "name": "output_sam_valid", + "artifact_type": "sam_or_bam", + "binding": "output_sam", + "assertions": [ + { + "field": "valid_sam", + "status": "inferred", + "description": "Output is a valid SAM/BAM file." + } + ] + } + ], + "evidence": [ + { + "id": "evidence_1", + "field": "arguments", + "source_type": "help_text", + "locator": "https://github.com/karel-brinda/samsift", + "excerpt": "Usage: samsift.py [-i FILE] [-o FILE] [-f [PY_EXPR ...]] ...", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "samsift", + "-i", + "{input_sam}", + "-o", + "{output_sam}", + "-f", + "MAPQ >= 60" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samsift_filter_alignments_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samsift_filter_alignments_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..d169aa6fcac0a51991b213f6d5e04714f2cf3078 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samsift_filter_alignments_test.json.raw.txt @@ -0,0 +1,104 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "samsift", + "version": "0.2.5", + "build": "py37_2", + "executable": "samsift", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "filter_alignments", + "description": "Filter SAM/BAM alignments using a fixed expression MAPQ >= 60." + }, + "arguments": [ + { + "name": "input_sam", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input SAM/BAM file." + }, + { + "name": "output_sam", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output SAM/BAM file." + } + ], + "inputs": [ + { + "name": "input_sam", + "artifact_type": "sam_or_bam", + "binding": "input_sam", + "assertions": [ + { + "field": "exists", + "status": "inferred", + "description": "Input file must exist." + } + ] + } + ], + "outputs": [ + { + "name": "output_sam", + "artifact_type": "sam_or_bam", + "binding": "output_sam", + "assertions": [ + { + "field": "created", + "status": "inferred", + "description": "Output file is created." + } + ] + } + ], + "validators": [ + { + "name": "output_sam_valid", + "artifact_type": "sam_or_bam", + "binding": "output_sam", + "assertions": [ + { + "field": "valid_sam", + "status": "inferred", + "description": "Output is a valid SAM/BAM file." + } + ] + } + ], + "evidence": [ + { + "id": "evidence_1", + "field": "arguments", + "source_type": "help_text", + "locator": "https://github.com/karel-brinda/samsift", + "excerpt": "Usage: samsift.py [-i FILE] [-o FILE] [-f [PY_EXPR ...]] ...", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "samsift", + "-i", + "{input_sam}", + "-o", + "{output_sam}", + "-f", + "MAPQ >= 60" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samsift_filter_alignments_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samsift_filter_alignments_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..3cee02de18175d3c6435f5a22d8eb39e2314762b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/samsift_filter_alignments_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "6e9b95d4a5af2a59da5f22aa90d5432cb6c18f8438b26301953b481c580d98f2", + "elapsed_seconds": 3.6174254417419434, + "usage": { + "prompt_tokens": 11585, + "completion_tokens": 673, + "total_tokens": 12258, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11585 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "cb736926-32f2-4065-b4a9-e1ab3f29b0f3" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/segemehl_index_and_align_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/segemehl_index_and_align_test.json new file mode 100644 index 0000000000000000000000000000000000000000..4da425b83d4b90d7d7f2592ab92eac6305342d71 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/segemehl_index_and_align_test.json @@ -0,0 +1,197 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "segemehl", + "version": "0.3.4", + "build": "h3e6c209_13", + "executable": "segemehl.x", + "subcommand": null, + "environment": { + "dependencies": [ + "htslib >=1.22.1,<1.24.0a0", + "libgcc >=13", + "libstdcxx >=13", + "libzlib >=1.3.1,<2.0a0", + "ncurses >=6.5,<7.0a0" + ], + "execution_environment": "Compiled", + "execution_environment_reason": "inferred from native/compiled dependencies" + } + }, + "endpoint": { + "name": "index_and_align", + "description": "Build the suffix-array index, then align one exact query with one thread and a fixed accuracy threshold." + }, + "arguments": [ + { + "name": "reference_fasta", + "flag": "-d", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Reference database FASTA file(s)." + }, + { + "name": "query_fasta", + "flag": "-q", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Query sequences FASTA/FASTQ file." + }, + { + "name": "index_file", + "flag": "-x/-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Index file path used for both generation (-x) and alignment (-i)." + }, + { + "name": "output_sam", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output SAM file path." + } + ], + "inputs": [ + { + "name": "reference_fasta", + "artifact_type": "FASTA", + "binding": "reference_fasta", + "assertions": [ + { + "name": "format", + "value": "FASTA", + "status": "declared" + } + ] + }, + { + "name": "query_fasta", + "artifact_type": "FASTQ", + "binding": "query_fasta", + "assertions": [ + { + "name": "format", + "value": "FASTQ", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "index_file", + "artifact_type": "segemehl_index", + "binding": "index_file", + "assertions": [ + { + "name": "format", + "value": "segemehl_index", + "status": "declared" + } + ] + }, + { + "name": "output_sam", + "artifact_type": "SAM", + "binding": "output_sam", + "assertions": [ + { + "name": "format", + "value": "SAM", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "index_file_exists", + "artifact": "index_file", + "assertion": "file exists", + "status": "declared" + }, + { + "name": "output_sam_exists", + "artifact": "output_sam", + "assertion": "file exists", + "status": "declared" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "reference_fasta", + "source_type": "documentation", + "locator": "http://www.bioinf.uni-leipzig.de/Software/segemehl/", + "excerpt": "The reference or database sequence(s) are provided using the [-d, --database ] option.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "query_fasta", + "source_type": "documentation", + "locator": "http://www.bioinf.uni-leipzig.de/Software/segemehl/", + "excerpt": "Reads or queries are provided using the [-q, --query ] option.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "index_file", + "source_type": "documentation", + "locator": "http://www.bioinf.uni-leipzig.de/Software/segemehl/", + "excerpt": "To build the index structure, e.g., for some fasta file chr1.fa, you call segemehl with option -x. ... To align your reads ... type ./segemehl.x -i chr1.idx -d chr1.fa -q myreads.fa > mymap.sam", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "output_sam", + "source_type": "documentation", + "locator": "http://www.bioinf.uni-leipzig.de/Software/segemehl/", + "excerpt": "Alternatively, the output can be redirected to a file via [-o, --output ].", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "segemehl.x", + "-x", + "{index_file}", + "-d", + "{reference_fasta}" + ] + }, + { + "command": [ + "segemehl.x", + "-i", + "{index_file}", + "-d", + "{reference_fasta}", + "-q", + "{query_fasta}", + "-o", + "{output_sam}", + "-t", + "1", + "-A", + "80" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/segemehl_index_and_align_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/segemehl_index_and_align_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2be8b354baf1bdecea32fcf87d25ee3186c09767 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/segemehl_index_and_align_test.json.raw.txt @@ -0,0 +1,197 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "segemehl", + "version": "0.3.4", + "build": "h3e6c209_13", + "executable": "segemehl.x", + "subcommand": null, + "environment": { + "dependencies": [ + "htslib >=1.22.1,<1.24.0a0", + "libgcc >=13", + "libstdcxx >=13", + "libzlib >=1.3.1,<2.0a0", + "ncurses >=6.5,<7.0a0" + ], + "execution_environment": "Compiled", + "execution_environment_reason": "inferred from native/compiled dependencies" + } + }, + "endpoint": { + "name": "index_and_align", + "description": "Build the suffix-array index, then align one exact query with one thread and a fixed accuracy threshold." + }, + "arguments": [ + { + "name": "reference_fasta", + "flag": "-d", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Reference database FASTA file(s)." + }, + { + "name": "query_fasta", + "flag": "-q", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Query sequences FASTA/FASTQ file." + }, + { + "name": "index_file", + "flag": "-x/-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Index file path used for both generation (-x) and alignment (-i)." + }, + { + "name": "output_sam", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output SAM file path." + } + ], + "inputs": [ + { + "name": "reference_fasta", + "artifact_type": "FASTA", + "binding": "reference_fasta", + "assertions": [ + { + "name": "format", + "value": "FASTA", + "status": "declared" + } + ] + }, + { + "name": "query_fasta", + "artifact_type": "FASTQ", + "binding": "query_fasta", + "assertions": [ + { + "name": "format", + "value": "FASTQ", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "index_file", + "artifact_type": "segemehl_index", + "binding": "index_file", + "assertions": [ + { + "name": "format", + "value": "segemehl_index", + "status": "declared" + } + ] + }, + { + "name": "output_sam", + "artifact_type": "SAM", + "binding": "output_sam", + "assertions": [ + { + "name": "format", + "value": "SAM", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "index_file_exists", + "artifact": "index_file", + "assertion": "file exists", + "status": "declared" + }, + { + "name": "output_sam_exists", + "artifact": "output_sam", + "assertion": "file exists", + "status": "declared" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "reference_fasta", + "source_type": "documentation", + "locator": "http://www.bioinf.uni-leipzig.de/Software/segemehl/", + "excerpt": "The reference or database sequence(s) are provided using the [-d, --database ] option.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "query_fasta", + "source_type": "documentation", + "locator": "http://www.bioinf.uni-leipzig.de/Software/segemehl/", + "excerpt": "Reads or queries are provided using the [-q, --query ] option.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "index_file", + "source_type": "documentation", + "locator": "http://www.bioinf.uni-leipzig.de/Software/segemehl/", + "excerpt": "To build the index structure, e.g., for some fasta file chr1.fa, you call segemehl with option -x. ... To align your reads ... type ./segemehl.x -i chr1.idx -d chr1.fa -q myreads.fa > mymap.sam", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "output_sam", + "source_type": "documentation", + "locator": "http://www.bioinf.uni-leipzig.de/Software/segemehl/", + "excerpt": "Alternatively, the output can be redirected to a file via [-o, --output ].", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "segemehl.x", + "-x", + "{index_file}", + "-d", + "{reference_fasta}" + ] + }, + { + "command": [ + "segemehl.x", + "-i", + "{index_file}", + "-d", + "{reference_fasta}", + "-q", + "{query_fasta}", + "-o", + "{output_sam}", + "-t", + "1", + "-A", + "80" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/segemehl_index_and_align_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/segemehl_index_and_align_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..1ec4b9233ff6f95c86bd18038d298dec378526a2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/segemehl_index_and_align_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "05a860f418f7f1d21c089ec598413c8a36314cc991d2cbc16f116f189e4bc2d0", + "elapsed_seconds": 8.101938009262085, + "usage": { + "prompt_tokens": 11752, + "completion_tokens": 1517, + "total_tokens": 13269, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11752 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "3469c090-d6c5-4f77-9b15-f148613241c1" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sentieon_index_reference_with_bwa_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sentieon_index_reference_with_bwa_test.json new file mode 100644 index 0000000000000000000000000000000000000000..369d335eccc388dfccbd72fb62bc1fcb23a1a699 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sentieon_index_reference_with_bwa_test.json @@ -0,0 +1,218 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "sentieon", + "version": "202503.03", + "build": "h2aa3d8a_0", + "executable": "sentieon", + "subcommand": "bwa index", + "environment": { + "execution_environment": "Python", + "execution_environment_reason": "inferred from python dependency" + } + }, + "endpoint": { + "name": "index_reference_with_bwa", + "description": "Build all BWA index components for a pinned reference FASTA through the Sentieon command dispatcher." + }, + "arguments": [ + { + "name": "input_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Reference FASTA file to be indexed." + }, + { + "name": "work_dir", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Staging directory for intermediate files." + }, + { + "name": "output_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Path to the index manifest TSV file." + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "file", + "binding": "input_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "fasta_format", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_tsv", + "artifact_type": "file", + "binding": "output_tsv", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "tsv_format", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "bwa_index_files_exist", + "artifact_type": "file_set", + "binding": "work_dir", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "bwa_index_components", + "status": "inferred" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search_info", + "locator": "conda search -c bioconda -c conda-forge sentieon --info", + "excerpt": "sentieon 202503.03 h2aa3d8a_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "target_interface", + "locator": "execution_plan.steps[1].command[0]", + "excerpt": "sentieon", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "execution_plan.steps[1].command[1:3]", + "excerpt": "bwa index", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "endpoint", + "excerpt": "index_reference_with_bwa", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments[0].name", + "source_type": "target_interface", + "locator": "parameters[0].name", + "excerpt": "input_fasta", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments[0].native_binding", + "source_type": "target_interface", + "locator": "parameters[0].native_binding", + "excerpt": "reference FASTA", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments[1].name", + "source_type": "target_interface", + "locator": "parameters[1].name", + "excerpt": "work_dir", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev8", + "field": "arguments[1].native_binding", + "source_type": "target_interface", + "locator": "parameters[1].native_binding", + "excerpt": "staging directory", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev9", + "field": "arguments[2].name", + "source_type": "target_interface", + "locator": "parameters[2].name", + "excerpt": "output_tsv", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev10", + "field": "arguments[2].native_binding", + "source_type": "target_interface", + "locator": "parameters[2].native_binding", + "excerpt": "index manifest", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev11", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "execution_plan", + "excerpt": "steps: stage_reference, sentieon bwa index, manifest_bwa_index", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "stage_reference", + "{input_fasta}", + "{work_dir}/reference.fa" + ] + }, + { + "command": [ + "sentieon", + "bwa", + "index", + "reference.fa" + ], + "cwd": "{work_dir}" + }, + { + "command": [ + "manifest_bwa_index", + "{work_dir}", + "{output_tsv}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sentieon_index_reference_with_bwa_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sentieon_index_reference_with_bwa_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2bda590d77bd712e12da73cc40457a3b6bb02ae5 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sentieon_index_reference_with_bwa_test.json.raw.txt @@ -0,0 +1,218 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "sentieon", + "version": "202503.03", + "build": "h2aa3d8a_0", + "executable": "sentieon", + "subcommand": "bwa index", + "environment": { + "execution_environment": "Python", + "execution_environment_reason": "inferred from python dependency" + } + }, + "endpoint": { + "name": "index_reference_with_bwa", + "description": "Build all BWA index components for a pinned reference FASTA through the Sentieon command dispatcher." + }, + "arguments": [ + { + "name": "input_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Reference FASTA file to be indexed." + }, + { + "name": "work_dir", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Staging directory for intermediate files." + }, + { + "name": "output_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Path to the index manifest TSV file." + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "file", + "binding": "input_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "fasta_format", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_tsv", + "artifact_type": "file", + "binding": "output_tsv", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "tsv_format", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "bwa_index_files_exist", + "artifact_type": "file_set", + "binding": "work_dir", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "bwa_index_components", + "status": "inferred" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search_info", + "locator": "conda search -c bioconda -c conda-forge sentieon --info", + "excerpt": "sentieon 202503.03 h2aa3d8a_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "target_interface", + "locator": "execution_plan.steps[1].command[0]", + "excerpt": "sentieon", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "execution_plan.steps[1].command[1:3]", + "excerpt": "bwa index", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "endpoint", + "excerpt": "index_reference_with_bwa", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments[0].name", + "source_type": "target_interface", + "locator": "parameters[0].name", + "excerpt": "input_fasta", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments[0].native_binding", + "source_type": "target_interface", + "locator": "parameters[0].native_binding", + "excerpt": "reference FASTA", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments[1].name", + "source_type": "target_interface", + "locator": "parameters[1].name", + "excerpt": "work_dir", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev8", + "field": "arguments[1].native_binding", + "source_type": "target_interface", + "locator": "parameters[1].native_binding", + "excerpt": "staging directory", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev9", + "field": "arguments[2].name", + "source_type": "target_interface", + "locator": "parameters[2].name", + "excerpt": "output_tsv", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev10", + "field": "arguments[2].native_binding", + "source_type": "target_interface", + "locator": "parameters[2].native_binding", + "excerpt": "index manifest", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev11", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "execution_plan", + "excerpt": "steps: stage_reference, sentieon bwa index, manifest_bwa_index", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "stage_reference", + "{input_fasta}", + "{work_dir}/reference.fa" + ] + }, + { + "command": [ + "sentieon", + "bwa", + "index", + "reference.fa" + ], + "cwd": "{work_dir}" + }, + { + "command": [ + "manifest_bwa_index", + "{work_dir}", + "{output_tsv}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sentieon_index_reference_with_bwa_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sentieon_index_reference_with_bwa_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..1698f06fd80fc245bbe0a5f4bae31ae2c4202ec3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sentieon_index_reference_with_bwa_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "2c648ff381a3d56c9cc80b2722e206d7e1eb52b0e23ffa6657929a3fcba83e01", + "elapsed_seconds": 8.578993082046509, + "usage": { + "prompt_tokens": 5797, + "completion_tokens": 1771, + "total_tokens": 7568, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 5797 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "b0da18ac-13d7-4b6f-8198-abd038ac55bb" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/seqcluster_collapse_small_rna_reads_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/seqcluster_collapse_small_rna_reads_test.json new file mode 100644 index 0000000000000000000000000000000000000000..8ebb2fc983f98a5ba7e62b184aef026f2c9216df --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/seqcluster_collapse_small_rna_reads_test.json @@ -0,0 +1,132 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "seqcluster", + "version": "1.2.4", + "build": "py27_0", + "executable": "seqcluster", + "subcommand": "collapse", + "environment": "conda" + }, + "endpoint": { + "name": "collapse_small_rna_reads", + "description": "Collapse identical small-RNA FASTQ sequences and encode observed abundance in each output read identifier." + }, + "arguments": [ + { + "name": "input_fastq", + "flag": "--fastq", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input FASTQ file containing small RNA reads." + }, + { + "name": "output_dir", + "flag": "--out", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output directory for collapsed reads." + } + ], + "inputs": [ + { + "name": "input_fastq", + "artifact_type": "FASTQ", + "binding": "input_fastq", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_dir", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "created", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_dir_not_empty", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "non_empty", + "status": "inferred" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "Tool: seqcluster", + "excerpt": "Tool: seqcluster", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.subcommand", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command", + "excerpt": "seqcluster collapse --fastq {input_fastq} --min 1 --min_size 10 --out {output_dir}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments[input_fastq].flag", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command", + "excerpt": "--fastq", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments[output_dir].flag", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command", + "excerpt": "--out", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "seqcluster", + "collapse", + "--fastq", + "{input_fastq}", + "--min", + "1", + "--min_size", + "10", + "--out", + "{output_dir}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/seqcluster_collapse_small_rna_reads_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/seqcluster_collapse_small_rna_reads_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..ad5599e62018bd2657643275fd1c131248a88e46 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/seqcluster_collapse_small_rna_reads_test.json.raw.txt @@ -0,0 +1,132 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "seqcluster", + "version": "1.2.4", + "build": "py27_0", + "executable": "seqcluster", + "subcommand": "collapse", + "environment": "conda" + }, + "endpoint": { + "name": "collapse_small_rna_reads", + "description": "Collapse identical small-RNA FASTQ sequences and encode observed abundance in each output read identifier." + }, + "arguments": [ + { + "name": "input_fastq", + "flag": "--fastq", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input FASTQ file containing small RNA reads." + }, + { + "name": "output_dir", + "flag": "--out", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output directory for collapsed reads." + } + ], + "inputs": [ + { + "name": "input_fastq", + "artifact_type": "FASTQ", + "binding": "input_fastq", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_dir", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "created", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_dir_not_empty", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "non_empty", + "status": "inferred" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "Tool: seqcluster", + "excerpt": "Tool: seqcluster", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.subcommand", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command", + "excerpt": "seqcluster collapse --fastq {input_fastq} --min 1 --min_size 10 --out {output_dir}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments[input_fastq].flag", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command", + "excerpt": "--fastq", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments[output_dir].flag", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command", + "excerpt": "--out", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "seqcluster", + "collapse", + "--fastq", + "{input_fastq}", + "--min", + "1", + "--min_size", + "10", + "--out", + "{output_dir}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/seqcluster_collapse_small_rna_reads_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/seqcluster_collapse_small_rna_reads_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..1aadf7259f02d673160aa5075659461bfee9a9c6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/seqcluster_collapse_small_rna_reads_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "dccb227fde8d302805ac58a0d4b0118914ccf5cfe46ac9a4e0af69d72e28c85f", + "elapsed_seconds": 4.5989484786987305, + "usage": { + "prompt_tokens": 6097, + "completion_tokens": 943, + "total_tokens": 7040, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6097 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "81f3ba46-f6ba-40a9-a8b4-6ee92fa06521" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/slow5tools_signal_stats_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/slow5tools_signal_stats_test.json new file mode 100644 index 0000000000000000000000000000000000000000..576f3ff6949bdb0975011035fe1c297448a72fad --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/slow5tools_signal_stats_test.json @@ -0,0 +1,102 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "slow5tools", + "version": "1.4.0", + "build": "hee927d3_0", + "executable": "slow5tools", + "subcommand": "stats", + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "signal_stats", + "description": "Prints statistics of a SLOW5/BLOW5 file to stdout." + }, + "arguments": [ + { + "name": "input_slow5", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input SLOW5/BLOW5 file." + }, + { + "name": "output_stats", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Captured stdout from the stats command.", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_slow5", + "artifact_type": "slow5", + "binding": "input_slow5", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_stats", + "artifact_type": "text", + "binding": "output_stats", + "capture": "stdout", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "slow5tools --help", + "excerpt": "Usage: slow5tools [OPTIONS] [COMMAND] [ARG]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.subcommand", + "source_type": "help_text", + "locator": "slow5tools --help", + "excerpt": "stats prints statistics of a SLOW5/BLOW5 file to the stdout", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "endpoint.description", + "source_type": "help_text", + "locator": "slow5tools --help", + "excerpt": "stats prints statistics of a SLOW5/BLOW5 file to the stdout", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.input_slow5", + "source_type": "help_text", + "locator": "slow5tools stats --help", + "excerpt": "Usage: slow5tools stats [OPTIONS] ", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "slow5tools", + "stats", + "{input_slow5}" + ], + "capture_stdout_to": "output_stats" + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/slow5tools_signal_stats_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/slow5tools_signal_stats_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..1dc0ff583e058878cd3cc523c3f7079fb60d0611 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/slow5tools_signal_stats_test.json.raw.txt @@ -0,0 +1,102 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "slow5tools", + "version": "1.4.0", + "build": "hee927d3_0", + "executable": "slow5tools", + "subcommand": "stats", + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "signal_stats", + "description": "Prints statistics of a SLOW5/BLOW5 file to stdout." + }, + "arguments": [ + { + "name": "input_slow5", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input SLOW5/BLOW5 file." + }, + { + "name": "output_stats", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Captured stdout from the stats command.", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_slow5", + "artifact_type": "slow5", + "binding": "input_slow5", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_stats", + "artifact_type": "text", + "binding": "output_stats", + "capture": "stdout", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "slow5tools --help", + "excerpt": "Usage: slow5tools [OPTIONS] [COMMAND] [ARG]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.subcommand", + "source_type": "help_text", + "locator": "slow5tools --help", + "excerpt": "stats prints statistics of a SLOW5/BLOW5 file to the stdout", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "endpoint.description", + "source_type": "help_text", + "locator": "slow5tools --help", + "excerpt": "stats prints statistics of a SLOW5/BLOW5 file to the stdout", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.input_slow5", + "source_type": "help_text", + "locator": "slow5tools stats --help", + "excerpt": "Usage: slow5tools stats [OPTIONS] ", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "slow5tools", + "stats", + "{input_slow5}" + ], + "capture_stdout_to": "output_stats" + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/slow5tools_signal_stats_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/slow5tools_signal_stats_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..d0a7889473cbe326d86be8c529382836150f7eee --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/slow5tools_signal_stats_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "e1e9739c4f7adb6f258808fadbeed56da5365dc4646c08b2857b2a0bd98b634b", + "elapsed_seconds": 4.398051977157593, + "usage": { + "prompt_tokens": 1046, + "completion_tokens": 830, + "total_tokens": 1876, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1046 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "8ceb707e-823d-4b3e-816b-131c03e52310" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sourmash_compute_signature_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sourmash_compute_signature_test.json new file mode 100644 index 0000000000000000000000000000000000000000..f699cb1c2070cc740c7d72a0b2f315c4abf81df6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sourmash_compute_signature_test.json @@ -0,0 +1,171 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "sourmash", + "version": "3.3.0", + "build": "py37h8f50634_1", + "executable": "sourmash", + "subcommand": "compute", + "environment": "Python" + }, + "endpoint": { + "name": "compute_signature", + "description": "Compute a sourmash signature from a FASTA file with fixed k=5 and scaled=1." + }, + "arguments": [ + { + "name": "input_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input FASTA file to compute signature from." + }, + { + "name": "output_signature", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output signature file path." + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "file", + "binding": "input_fasta", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Input file must exist." + }, + { + "name": "fasta_format", + "status": "inferred", + "description": "Input file must be in FASTA format." + } + ] + } + ], + "outputs": [ + { + "name": "output_signature", + "artifact_type": "file", + "binding": "output_signature", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Output signature file must be created." + }, + { + "name": "sourmash_signature_format", + "status": "inferred", + "description": "Output file must be a valid sourmash signature." + } + ] + } + ], + "validators": [ + { + "name": "output_signature_valid", + "artifact": "output_signature", + "assertions": [ + { + "name": "valid_sourmash_signature", + "status": "inferred", + "description": "Output file must be a valid sourmash signature." + } + ] + } + ], + "evidence": [ + { + "id": "evidence-1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge sourmash --info", + "excerpt": "sourmash 3.3.0 py37h8f50634_1", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-2", + "field": "tool.version", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge sourmash --info", + "excerpt": "sourmash 3.3.0 py37h8f50634_1", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-3", + "field": "tool.build", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge sourmash --info", + "excerpt": "sourmash 3.3.0 py37h8f50634_1", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-4", + "field": "tool.executable", + "source_type": "help_text", + "locator": "https://sourmash.readthedocs.io/", + "excerpt": "sourmash is a command-line tool", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-5", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "Target subcommand: compute", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-6", + "field": "arguments.input_fasta", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "input_fasta: positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-7", + "field": "arguments.output_signature", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "output_signature: -o", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-8", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "sourmash compute -k 5 --scaled 1 -o {output_signature} {input_fasta}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "sourmash", + "compute", + "-k", + "5", + "--scaled", + "1", + "-o", + "{output_signature}", + "{input_fasta}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sourmash_compute_signature_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sourmash_compute_signature_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..17dc9ff16fa9beab146933cf332d9a29e6c7e966 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sourmash_compute_signature_test.json.raw.txt @@ -0,0 +1,171 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "sourmash", + "version": "3.3.0", + "build": "py37h8f50634_1", + "executable": "sourmash", + "subcommand": "compute", + "environment": "Python" + }, + "endpoint": { + "name": "compute_signature", + "description": "Compute a sourmash signature from a FASTA file with fixed k=5 and scaled=1." + }, + "arguments": [ + { + "name": "input_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input FASTA file to compute signature from." + }, + { + "name": "output_signature", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output signature file path." + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "file", + "binding": "input_fasta", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Input file must exist." + }, + { + "name": "fasta_format", + "status": "inferred", + "description": "Input file must be in FASTA format." + } + ] + } + ], + "outputs": [ + { + "name": "output_signature", + "artifact_type": "file", + "binding": "output_signature", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "description": "Output signature file must be created." + }, + { + "name": "sourmash_signature_format", + "status": "inferred", + "description": "Output file must be a valid sourmash signature." + } + ] + } + ], + "validators": [ + { + "name": "output_signature_valid", + "artifact": "output_signature", + "assertions": [ + { + "name": "valid_sourmash_signature", + "status": "inferred", + "description": "Output file must be a valid sourmash signature." + } + ] + } + ], + "evidence": [ + { + "id": "evidence-1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge sourmash --info", + "excerpt": "sourmash 3.3.0 py37h8f50634_1", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-2", + "field": "tool.version", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge sourmash --info", + "excerpt": "sourmash 3.3.0 py37h8f50634_1", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-3", + "field": "tool.build", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge sourmash --info", + "excerpt": "sourmash 3.3.0 py37h8f50634_1", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-4", + "field": "tool.executable", + "source_type": "help_text", + "locator": "https://sourmash.readthedocs.io/", + "excerpt": "sourmash is a command-line tool", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-5", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "Target subcommand: compute", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-6", + "field": "arguments.input_fasta", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "input_fasta: positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-7", + "field": "arguments.output_signature", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "output_signature: -o", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "evidence-8", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "sourmash compute -k 5 --scaled 1 -o {output_signature} {input_fasta}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "sourmash", + "compute", + "-k", + "5", + "--scaled", + "1", + "-o", + "{output_signature}", + "{input_fasta}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sourmash_compute_signature_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sourmash_compute_signature_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..273b1704a454f8974b36880d265c1ecb0fb89faa --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/sourmash_compute_signature_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "d5da6ff3f18a9cedf8c1b9eebf485ef2a709e27c169c978f9eac5fa367f421f6", + "elapsed_seconds": 10.008676052093506, + "usage": { + "prompt_tokens": 11038, + "completion_tokens": 1459, + "total_tokens": 12497, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11038 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "376a784c-0db8-49f0-8552-227dfb3f5566" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/spades_assemble_paired_reads_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/spades_assemble_paired_reads_test.json new file mode 100644 index 0000000000000000000000000000000000000000..7750c83612fe60a6f0a1dde38c636cb93e8cb4f8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/spades_assemble_paired_reads_test.json @@ -0,0 +1,201 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "spades", + "version": "4.3.0", + "build": "hde4eca7_1", + "executable": "spades.py", + "subcommand": null, + "environment": "Python" + }, + "endpoint": { + "name": "assemble_paired_reads", + "description": "Assemble paired-end reads using SPAdes with fixed parameters (only-assembler, one thread, 1 GB memory, k=21)." + }, + "arguments": [ + { + "name": "reads_r1", + "flag": "-1", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the first read file (forward reads)." + }, + { + "name": "reads_r2", + "flag": "-2", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the second read file (reverse reads)." + }, + { + "name": "output_dir", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Directory for output files." + }, + { + "name": "only_assembler", + "flag": "--only-assembler", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Run only the assembly stage (skip read error correction)." + }, + { + "name": "threads", + "flag": "-t", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Number of threads to use (fixed to 1)." + }, + { + "name": "memory", + "flag": "-m", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Memory limit in GB (fixed to 1)." + }, + { + "name": "kmer", + "flag": "-k", + "kind": "option", + "value_type": "string", + "required": false, + "position": null, + "repeat": false, + "description": "K-mer sizes to use (fixed to 21)." + } + ], + "inputs": [ + { + "name": "reads_r1", + "artifact_type": "fastq", + "binding": "reads_r1", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + } + ] + }, + { + "name": "reads_r2", + "artifact_type": "fastq", + "binding": "reads_r2", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + } + ] + } + ], + "outputs": [ + { + "name": "contigs", + "artifact_type": "fasta", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output directory must contain contigs.fasta." + } + ] + }, + { + "name": "scaffolds", + "artifact_type": "fasta", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output directory must contain scaffolds.fasta." + } + ] + } + ], + "validators": [ + { + "name": "output_dir_not_empty", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "non_empty", + "status": "declared", + "description": "Output directory must not be empty." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "arguments", + "source_type": "url", + "locator": "https://ablab.github.io/spades", + "excerpt": "A single paired-end library (separate files, gzipped): bin/spades.py -1 left.fastq.gz -2 right.fastq.gz -o output_folder", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments", + "source_type": "url", + "locator": "https://github.com/ablab/spades", + "excerpt": "SPAdes requires only Python 3.8+ to be installed.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "provided", + "excerpt": "Assembler-only, one thread, 1 GB, and k=21 are fixed.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "spades.py", + "--only-assembler", + "-1", + "{reads_r1}", + "-2", + "{reads_r2}", + "-o", + "{output_dir}", + "-t", + "1", + "-m", + "1", + "-k", + "21" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/spades_assemble_paired_reads_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/spades_assemble_paired_reads_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..bfe4bef787825a65e1b25baf70a5f2b1ced7416d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/spades_assemble_paired_reads_test.json.raw.txt @@ -0,0 +1,201 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "spades", + "version": "4.3.0", + "build": "hde4eca7_1", + "executable": "spades.py", + "subcommand": null, + "environment": "Python" + }, + "endpoint": { + "name": "assemble_paired_reads", + "description": "Assemble paired-end reads using SPAdes with fixed parameters (only-assembler, one thread, 1 GB memory, k=21)." + }, + "arguments": [ + { + "name": "reads_r1", + "flag": "-1", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the first read file (forward reads)." + }, + { + "name": "reads_r2", + "flag": "-2", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the second read file (reverse reads)." + }, + { + "name": "output_dir", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Directory for output files." + }, + { + "name": "only_assembler", + "flag": "--only-assembler", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Run only the assembly stage (skip read error correction)." + }, + { + "name": "threads", + "flag": "-t", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Number of threads to use (fixed to 1)." + }, + { + "name": "memory", + "flag": "-m", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Memory limit in GB (fixed to 1)." + }, + { + "name": "kmer", + "flag": "-k", + "kind": "option", + "value_type": "string", + "required": false, + "position": null, + "repeat": false, + "description": "K-mer sizes to use (fixed to 21)." + } + ], + "inputs": [ + { + "name": "reads_r1", + "artifact_type": "fastq", + "binding": "reads_r1", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + } + ] + }, + { + "name": "reads_r2", + "artifact_type": "fastq", + "binding": "reads_r2", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + } + ] + } + ], + "outputs": [ + { + "name": "contigs", + "artifact_type": "fasta", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output directory must contain contigs.fasta." + } + ] + }, + { + "name": "scaffolds", + "artifact_type": "fasta", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output directory must contain scaffolds.fasta." + } + ] + } + ], + "validators": [ + { + "name": "output_dir_not_empty", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "non_empty", + "status": "declared", + "description": "Output directory must not be empty." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "arguments", + "source_type": "url", + "locator": "https://ablab.github.io/spades", + "excerpt": "A single paired-end library (separate files, gzipped): bin/spades.py -1 left.fastq.gz -2 right.fastq.gz -o output_folder", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments", + "source_type": "url", + "locator": "https://github.com/ablab/spades", + "excerpt": "SPAdes requires only Python 3.8+ to be installed.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "provided", + "excerpt": "Assembler-only, one thread, 1 GB, and k=21 are fixed.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "spades.py", + "--only-assembler", + "-1", + "{reads_r1}", + "-2", + "{reads_r2}", + "-o", + "{output_dir}", + "-t", + "1", + "-m", + "1", + "-k", + "21" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/spades_assemble_paired_reads_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/spades_assemble_paired_reads_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..1d7f31f6c8751fedacc4e127eade1569ce67d98e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/spades_assemble_paired_reads_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "06b0f64757ecef595db3ab386dbd2029a6dba239ad78c9c5ae4a88c2279d2c76", + "elapsed_seconds": 7.060863256454468, + "usage": { + "prompt_tokens": 10206, + "completion_tokens": 1400, + "total_tokens": 11606, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10206 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "d6226712-f795-4a0a-8c13-46dfc8171960" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/stringtie_assemble_transcripts_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/stringtie_assemble_transcripts_test.json new file mode 100644 index 0000000000000000000000000000000000000000..e02dfd67ec62ed6a9773015060952f81eab5df54 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/stringtie_assemble_transcripts_test.json @@ -0,0 +1,202 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "stringtie", + "version": "3.0.3", + "build": "h29c0135_0", + "executable": "stringtie", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "assemble_transcripts", + "description": "Assemble RNA-Seq alignments into potential transcripts." + }, + "arguments": [ + { + "name": "input_bam", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input BAM file containing RNA-Seq alignments." + }, + { + "name": "output_gtf", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output GTF file for assembled transcripts." + }, + { + "name": "threads", + "flag": "-p", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Number of threads (CPUs) to use." + }, + { + "name": "min_len", + "flag": "-m", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Minimum assembled transcript length." + }, + { + "name": "min_single_exon_cov", + "flag": "-s", + "kind": "option", + "value_type": "number", + "required": false, + "position": null, + "repeat": false, + "description": "Minimum reads per bp coverage for single-exon transcript." + }, + { + "name": "min_bundle_cov", + "flag": "-c", + "kind": "option", + "value_type": "number", + "required": false, + "position": null, + "repeat": false, + "description": "Minimum reads per bp coverage for multi-exon transcript." + } + ], + "inputs": [ + { + "name": "input_bam", + "artifact_type": "bam", + "binding": "input_bam", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_gtf", + "artifact_type": "gtf", + "binding": "output_gtf", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "non_empty", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_gtf_valid", + "artifact_type": "gtf", + "binding": "output_gtf", + "assertions": [ + { + "name": "valid_gtf", + "status": "declared" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.version", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "StringTie v2.1.7 usage:", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.input_bam", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "stringtie ", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.output_gtf", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "-o output path/file name for the assembled transcripts GTF (default: stdout)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.threads", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "-p number of threads (CPUs) to use (default: 1)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.min_len", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "-m minimum assembled transcript length (default: 200)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.min_single_exon_cov", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "-s minimum reads per bp coverage to consider for single-exon transcript (default: 4.75)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.min_bundle_cov", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "-c minimum reads per bp coverage to consider for multi-exon transcript (default: 1)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "stringtie", + "{input_bam}", + "-o", + "{output_gtf}", + "-p", + "1", + "-m", + "30", + "-s", + "1", + "-c", + "1" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/stringtie_assemble_transcripts_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/stringtie_assemble_transcripts_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..02aee51e029beb31e0704c4933908be8bab304e9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/stringtie_assemble_transcripts_test.json.raw.txt @@ -0,0 +1,202 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "stringtie", + "version": "3.0.3", + "build": "h29c0135_0", + "executable": "stringtie", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "assemble_transcripts", + "description": "Assemble RNA-Seq alignments into potential transcripts." + }, + "arguments": [ + { + "name": "input_bam", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input BAM file containing RNA-Seq alignments." + }, + { + "name": "output_gtf", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output GTF file for assembled transcripts." + }, + { + "name": "threads", + "flag": "-p", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Number of threads (CPUs) to use." + }, + { + "name": "min_len", + "flag": "-m", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Minimum assembled transcript length." + }, + { + "name": "min_single_exon_cov", + "flag": "-s", + "kind": "option", + "value_type": "number", + "required": false, + "position": null, + "repeat": false, + "description": "Minimum reads per bp coverage for single-exon transcript." + }, + { + "name": "min_bundle_cov", + "flag": "-c", + "kind": "option", + "value_type": "number", + "required": false, + "position": null, + "repeat": false, + "description": "Minimum reads per bp coverage for multi-exon transcript." + } + ], + "inputs": [ + { + "name": "input_bam", + "artifact_type": "bam", + "binding": "input_bam", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_gtf", + "artifact_type": "gtf", + "binding": "output_gtf", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "non_empty", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_gtf_valid", + "artifact_type": "gtf", + "binding": "output_gtf", + "assertions": [ + { + "name": "valid_gtf", + "status": "declared" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.version", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "StringTie v2.1.7 usage:", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.input_bam", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "stringtie ", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.output_gtf", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "-o output path/file name for the assembled transcripts GTF (default: stdout)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.threads", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "-p number of threads (CPUs) to use (default: 1)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.min_len", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "-m minimum assembled transcript length (default: 200)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.min_single_exon_cov", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "-s minimum reads per bp coverage to consider for single-exon transcript (default: 4.75)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.min_bundle_cov", + "source_type": "help_text", + "locator": "stringtie --help", + "excerpt": "-c minimum reads per bp coverage to consider for multi-exon transcript (default: 1)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "stringtie", + "{input_bam}", + "-o", + "{output_gtf}", + "-p", + "1", + "-m", + "30", + "-s", + "1", + "-c", + "1" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/stringtie_assemble_transcripts_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/stringtie_assemble_transcripts_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..38c69e832dc33dc13779c6ffc7e0c0a29c4ff787 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/stringtie_assemble_transcripts_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "de8650047a17077b5a0590f2c4b464816ef050e440884b948fd16f0ae84c6e65", + "elapsed_seconds": 7.35873007774353, + "usage": { + "prompt_tokens": 1839, + "completion_tokens": 1548, + "total_tokens": 3387, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1839 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "940c2ee4-04b5-4380-8920-30fb4bb2a8db" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/subread_count_features_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/subread_count_features_test.json new file mode 100644 index 0000000000000000000000000000000000000000..b2f58cdb935e53c77bc2592b3c2a146274879cf9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/subread_count_features_test.json @@ -0,0 +1,172 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "subread", + "version": "2.1.1", + "build": "h577a1d6_0", + "executable": "featureCounts", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "count_features", + "description": "Count paired fragments with one thread." + }, + "arguments": [ + { + "name": "annotation_gtf", + "flag": "-a", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the annotation file in GTF format." + }, + { + "name": "input_bam", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input BAM file containing aligned reads." + }, + { + "name": "output_counts", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output file for read counts." + } + ], + "inputs": [ + { + "name": "annotation_gtf", + "artifact_type": "file", + "binding": "annotation_gtf", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + }, + { + "name": "input_bam", + "artifact_type": "file", + "binding": "input_bam", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_counts", + "artifact_type": "file", + "binding": "output_counts", + "assertions": [ + { + "name": "created", + "status": "declared" + }, + { + "name": "non_empty", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_counts_non_empty", + "artifact": "output_counts", + "assertion": "non_empty", + "status": "declared" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "subread 2.1.1 h577a1d6_0", + "excerpt": "subread 2.1.1 h577a1d6_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "web", + "locator": "https://subread.sourceforge.net", + "excerpt": "featureCounts : a software program developed for counting reads to genomic features such as genes, exons, promoters and genomic bins.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.annotation_gtf.flag", + "source_type": "web", + "locator": "https://subread.sourceforge.net/SubreadUsersGuide.pdf", + "excerpt": "-a ", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.output_counts.flag", + "source_type": "web", + "locator": "https://subread.sourceforge.net/SubreadUsersGuide.pdf", + "excerpt": "-o ", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.input_bam.kind", + "source_type": "web", + "locator": "https://subread.sourceforge.net/SubreadUsersGuide.pdf", + "excerpt": "featureCounts -a annotation.gtf -o output.txt input.bam", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "execution_plan", + "excerpt": "featureCounts -T 1 -p --countReadPairs -a {annotation_gtf} -o {output_counts} {input_bam}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "featureCounts", + "-T", + "1", + "-p", + "--countReadPairs", + "-a", + "{annotation_gtf}", + "-o", + "{output_counts}", + "{input_bam}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/subread_count_features_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/subread_count_features_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..d1c215313fcfa44ab810c4ed31d0d3426f04e367 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/subread_count_features_test.json.raw.txt @@ -0,0 +1,172 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "subread", + "version": "2.1.1", + "build": "h577a1d6_0", + "executable": "featureCounts", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "count_features", + "description": "Count paired fragments with one thread." + }, + "arguments": [ + { + "name": "annotation_gtf", + "flag": "-a", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Path to the annotation file in GTF format." + }, + { + "name": "input_bam", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input BAM file containing aligned reads." + }, + { + "name": "output_counts", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output file for read counts." + } + ], + "inputs": [ + { + "name": "annotation_gtf", + "artifact_type": "file", + "binding": "annotation_gtf", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + }, + { + "name": "input_bam", + "artifact_type": "file", + "binding": "input_bam", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_counts", + "artifact_type": "file", + "binding": "output_counts", + "assertions": [ + { + "name": "created", + "status": "declared" + }, + { + "name": "non_empty", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_counts_non_empty", + "artifact": "output_counts", + "assertion": "non_empty", + "status": "declared" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "subread 2.1.1 h577a1d6_0", + "excerpt": "subread 2.1.1 h577a1d6_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "web", + "locator": "https://subread.sourceforge.net", + "excerpt": "featureCounts : a software program developed for counting reads to genomic features such as genes, exons, promoters and genomic bins.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.annotation_gtf.flag", + "source_type": "web", + "locator": "https://subread.sourceforge.net/SubreadUsersGuide.pdf", + "excerpt": "-a ", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.output_counts.flag", + "source_type": "web", + "locator": "https://subread.sourceforge.net/SubreadUsersGuide.pdf", + "excerpt": "-o ", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.input_bam.kind", + "source_type": "web", + "locator": "https://subread.sourceforge.net/SubreadUsersGuide.pdf", + "excerpt": "featureCounts -a annotation.gtf -o output.txt input.bam", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "execution_plan", + "excerpt": "featureCounts -T 1 -p --countReadPairs -a {annotation_gtf} -o {output_counts} {input_bam}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "featureCounts", + "-T", + "1", + "-p", + "--countReadPairs", + "-a", + "{annotation_gtf}", + "-o", + "{output_counts}", + "{input_bam}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/subread_count_features_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/subread_count_features_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..f75c607232c09e2ae20818b0ea9c9ebf1133931f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/subread_count_features_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "8dbf3f63a7056917d961c39302d96ef3c115918e217288fde8757e28b22422cc", + "elapsed_seconds": 8.069710731506348, + "usage": { + "prompt_tokens": 24948, + "completion_tokens": 1317, + "total_tokens": 26265, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 24948 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "29aa23b8-a633-41ed-b5c6-3bb7cd22a9c9" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tabixpp_query_vcf_region_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tabixpp_query_vcf_region_test.json new file mode 100644 index 0000000000000000000000000000000000000000..c3499bca673fc0c8e9b4f46e5c71c8a041339784 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tabixpp_query_vcf_region_test.json @@ -0,0 +1,126 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "tabixpp", + "version": "1.1.2", + "build": "hbefcdb2_4", + "executable": "tabix++", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "query_vcf_region", + "description": "Query the fixed region chrTiny:1-40 and capture record lines." + }, + "arguments": [ + { + "name": "input_vcf", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input VCF file (tabix-indexed)." + }, + { + "name": "region", + "flag": null, + "kind": "positional", + "value_type": "string", + "required": true, + "position": 1, + "repeat": false, + "description": "Region query string, e.g., chrTiny:1-40." + }, + { + "name": "output_records", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output records captured from stdout.", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_vcf", + "artifact_type": "file", + "binding": "input_vcf", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + }, + { + "name": "tabix_indexed", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "outputs": [ + { + "name": "output_records", + "artifact_type": "file", + "binding": "output_records", + "capture": "stdout", + "assertions": [ + { + "name": "non_empty", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "validators": [ + { + "name": "vcf_records", + "artifact_type": "file", + "binding": "output_records", + "assertions": [ + { + "name": "valid_vcf_records", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_info", + "locator": "https://conda.anaconda.org/bioconda/linux-64/tabixpp-1.1.2-hbefcdb2_4.tar.bz2", + "excerpt": "Candidate native executable: tabix++", + "digest": "sha256:ea888f422da5ac75fee9030b552c908c" + }, + { + "id": "ev2", + "field": "endpoint.execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Query the fixed region chrTiny:1-40 and capture record lines.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "tabix++", + "{input_vcf}", + "chrTiny:1-40" + ], + "capture_stdout_to": "output_records" + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tabixpp_query_vcf_region_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tabixpp_query_vcf_region_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..8e3fd5336fa72a9f3f73bc75045b1cfb5d91a073 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tabixpp_query_vcf_region_test.json.raw.txt @@ -0,0 +1,126 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "tabixpp", + "version": "1.1.2", + "build": "hbefcdb2_4", + "executable": "tabix++", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "query_vcf_region", + "description": "Query the fixed region chrTiny:1-40 and capture record lines." + }, + "arguments": [ + { + "name": "input_vcf", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input VCF file (tabix-indexed)." + }, + { + "name": "region", + "flag": null, + "kind": "positional", + "value_type": "string", + "required": true, + "position": 1, + "repeat": false, + "description": "Region query string, e.g., chrTiny:1-40." + }, + { + "name": "output_records", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output records captured from stdout.", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_vcf", + "artifact_type": "file", + "binding": "input_vcf", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + }, + { + "name": "tabix_indexed", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "outputs": [ + { + "name": "output_records", + "artifact_type": "file", + "binding": "output_records", + "capture": "stdout", + "assertions": [ + { + "name": "non_empty", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "validators": [ + { + "name": "vcf_records", + "artifact_type": "file", + "binding": "output_records", + "assertions": [ + { + "name": "valid_vcf_records", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_info", + "locator": "https://conda.anaconda.org/bioconda/linux-64/tabixpp-1.1.2-hbefcdb2_4.tar.bz2", + "excerpt": "Candidate native executable: tabix++", + "digest": "sha256:ea888f422da5ac75fee9030b552c908c" + }, + { + "id": "ev2", + "field": "endpoint.execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Query the fixed region chrTiny:1-40 and capture record lines.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "tabix++", + "{input_vcf}", + "chrTiny:1-40" + ], + "capture_stdout_to": "output_records" + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tabixpp_query_vcf_region_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tabixpp_query_vcf_region_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..ba5902a2cda9000efe581cb94f8e4209235c014b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tabixpp_query_vcf_region_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "b121e5f93fbe106db1878f2a248c25f469561b6f1bad9c9ff1d6bcc5fab55603", + "elapsed_seconds": 4.996931314468384, + "usage": { + "prompt_tokens": 8017, + "completion_tokens": 876, + "total_tokens": 8893, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 8017 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "4ad1ecf9-74a2-466b-9c58-61a6f37a5049" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/taxonkit_create_taxdump_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/taxonkit_create_taxdump_test.json new file mode 100644 index 0000000000000000000000000000000000000000..c705bf5ce26e11d3a997932509f690a220b7e335 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/taxonkit_create_taxdump_test.json @@ -0,0 +1,145 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "taxonkit", + "version": "0.20.0", + "build": "h9ee0642_1", + "executable": "taxonkit", + "subcommand": "create-taxdump", + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "create_taxdump", + "description": "Create NCBI-style taxdump files for custom taxonomy, e.g., GTDB and ICTV" + }, + "arguments": [ + { + "name": "taxonomy_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input taxonomy TSV file" + }, + { + "name": "output_dir", + "flag": "-O", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output directory for taxdump files" + }, + { + "name": "accession_field", + "flag": "-A", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Field index of accession in TSV (default 4)" + }, + { + "name": "force", + "flag": "--force", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Force overwrite existing output directory" + } + ], + "inputs": [ + { + "name": "taxonomy_tsv", + "artifact_type": "TSV", + "binding": "taxonomy_tsv", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-1" + ] + }, + { + "name": "readable", + "status": "declared", + "evidence": [ + "ev-1" + ] + } + ] + } + ], + "outputs": [ + { + "name": "output_dir", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "created", + "status": "declared", + "evidence": [ + "ev-1" + ] + }, + { + "name": "contains_taxdump_files", + "status": "declared", + "evidence": [ + "ev-1" + ] + } + ] + } + ], + "validators": [ + { + "name": "output_dir_exists", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-1" + ] + } + ] + } + ], + "evidence": [ + { + "id": "ev-1", + "field": "execution_plan", + "source_type": "help_text", + "locator": "taxonkit --help", + "excerpt": "create-taxdump Create NCBI-style taxdump files for custom taxonomy, e.g., GTDB and ICTV", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "taxonkit", + "create-taxdump", + "-A", + "4", + "-O", + "{output_dir}", + "--force", + "{taxonomy_tsv}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/taxonkit_create_taxdump_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/taxonkit_create_taxdump_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..683c00038809b75bfb434091c70454699076ad58 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/taxonkit_create_taxdump_test.json.raw.txt @@ -0,0 +1,135 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "taxonkit", + "version": "0.20.0", + "build": "h9ee0642_1", + "executable": "taxonkit", + "subcommand": "create-taxdump", + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "create_taxdump", + "description": "Create NCBI-style taxdump files for custom taxonomy, e.g., GTDB and ICTV" + }, + "arguments": [ + { + "name": "taxonomy_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input taxonomy TSV file" + }, + { + "name": "output_dir", + "flag": "-O", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output directory for taxdump files" + }, + { + "name": "accession_field", + "flag": "-A", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Field index of accession in TSV (default 4)" + }, + { + "name": "force", + "flag": "--force", + "kind": "switch", + "value_type": "boolean", + "required": false, + "position": null, + "repeat": false, + "description": "Force overwrite existing output directory" + } + ], + "inputs": [ + { + "name": "taxonomy_tsv", + "artifact_type": "TSV", + "binding": "taxonomy_tsv", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-1"] + }, + { + "name": "readable", + "status": "declared", + "evidence": ["ev-1"] + } + ] + } + ], + "outputs": [ + { + "name": "output_dir", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "created", + "status": "declared", + "evidence": ["ev-1"] + }, + { + "name": "contains_taxdump_files", + "status": "declared", + "evidence": ["ev-1"] + } + ] + } + ], + "validators": [ + { + "name": "output_dir_exists", + "artifact_type": "directory", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-1"] + } + ] + } + ], + "evidence": [ + { + "id": "ev-1", + "field": "execution_plan", + "source_type": "help_text", + "locator": "taxonkit --help", + "excerpt": "create-taxdump Create NCBI-style taxdump files for custom taxonomy, e.g., GTDB and ICTV", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "taxonkit", + "create-taxdump", + "-A", + "4", + "-O", + "{output_dir}", + "--force", + "{taxonomy_tsv}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/taxonkit_create_taxdump_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/taxonkit_create_taxdump_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..f5c2354e1e35f02ab3304c8d2e407a3c07b90049 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/taxonkit_create_taxdump_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "8ba44c50210f5deda281fcff5303e5e41c4a9d107cb3a42fac65aa11d2b4a82f", + "elapsed_seconds": 4.462989091873169, + "usage": { + "prompt_tokens": 1371, + "completion_tokens": 868, + "total_tokens": 2239, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1371 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "5af9207b-08e9-4d4e-aa97-546c4a3f46cd" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tidyp_tidy_html_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tidyp_tidy_html_test.json new file mode 100644 index 0000000000000000000000000000000000000000..4446e3161048468a0e7a55e42aeea4ddc0bc095e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tidyp_tidy_html_test.json @@ -0,0 +1,94 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "tidyp", + "version": "1.04", + "build": "h7b50bb2_9", + "executable": "tidyp", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "tidy_html", + "description": "Tidy an HTML file with quiet UTF-8 output." + }, + "arguments": [ + { + "name": "input_html", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input HTML file to tidy." + }, + { + "name": "output_html", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output HTML file path." + } + ], + "inputs": [ + { + "name": "input_html", + "artifact_type": "html", + "binding": "input_html", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_html", + "artifact_type": "html", + "binding": "output_html", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "tidyp --help", + "excerpt": "tidyp for Linux (v1.04)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments[input_html].flag", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command", + "excerpt": "tidyp -quiet -utf8 -o {output_html} {input_html}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments[output_html].flag", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command", + "excerpt": "-o {output_html}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "tidyp", + "-quiet", + "-utf8", + "-o", + "{output_html}", + "{input_html}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tidyp_tidy_html_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tidyp_tidy_html_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..b29368c181e6900de83cc35d90cf6361fcdaca5a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tidyp_tidy_html_test.json.raw.txt @@ -0,0 +1,94 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "tidyp", + "version": "1.04", + "build": "h7b50bb2_9", + "executable": "tidyp", + "subcommand": null, + "environment": "conda run -n bioenv_cli" + }, + "endpoint": { + "name": "tidy_html", + "description": "Tidy an HTML file with quiet UTF-8 output." + }, + "arguments": [ + { + "name": "input_html", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input HTML file to tidy." + }, + { + "name": "output_html", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output HTML file path." + } + ], + "inputs": [ + { + "name": "input_html", + "artifact_type": "html", + "binding": "input_html", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_html", + "artifact_type": "html", + "binding": "output_html", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "tidyp --help", + "excerpt": "tidyp for Linux (v1.04)", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments[input_html].flag", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command", + "excerpt": "tidyp -quiet -utf8 -o {output_html} {input_html}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments[output_html].flag", + "source_type": "execution_plan", + "locator": "execution_plan.steps[0].command", + "excerpt": "-o {output_html}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "tidyp", + "-quiet", + "-utf8", + "-o", + "{output_html}", + "{input_html}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tidyp_tidy_html_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tidyp_tidy_html_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..602f3516f38174c9bce7463d75eae120e87173ec --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tidyp_tidy_html_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "b9445119e4d450bf62c8c05b6b97225ffa1b5e814468d5171f8bc44f166bbc48", + "elapsed_seconds": 5.986493825912476, + "usage": { + "prompt_tokens": 971, + "completion_tokens": 694, + "total_tokens": 1665, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 971 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "34142326-f2e3-4685-b2a3-93ebfdbf7315" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tmalign_align_structures_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tmalign_align_structures_test.json new file mode 100644 index 0000000000000000000000000000000000000000..3ccec80f92502792471b95480dc5c033b4231c33 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tmalign_align_structures_test.json @@ -0,0 +1,163 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "tmalign", + "version": "20240303", + "build": "hd63eeec_0", + "executable": "TMalign", + "subcommand": null, + "environment": { + "dependencies": [ + "libgcc >=14", + "libstdcxx >=14" + ], + "execution_environment": "Compiled" + } + }, + "endpoint": { + "name": "align_structures", + "description": "Align two protein structures using TM-align and output machine-readable alignment table." + }, + "arguments": [ + { + "name": "structure_a", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to first structure file (PDB or mmCIF)." + }, + { + "name": "structure_b", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to second structure file (PDB or mmCIF)." + }, + { + "name": "output_table", + "flag": null, + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Captured stdout containing machine-readable alignment table.", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "structure_a", + "artifact_type": "path", + "binding": "structure_a", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-1" + ] + }, + { + "name": "readable", + "status": "declared", + "evidence": [ + "ev-1" + ] + } + ] + }, + { + "name": "structure_b", + "artifact_type": "path", + "binding": "structure_b", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": [ + "ev-1" + ] + }, + { + "name": "readable", + "status": "declared", + "evidence": [ + "ev-1" + ] + } + ] + } + ], + "outputs": [ + { + "name": "output_table", + "artifact_type": "path", + "binding": "output_table", + "capture": "stdout", + "assertions": [ + { + "name": "non_empty", + "status": "declared", + "evidence": [ + "ev-2" + ] + } + ] + } + ], + "validators": [ + { + "name": "output_table_tsv", + "artifact_type": "path", + "binding": "output_table", + "assertions": [ + { + "name": "tsv_format", + "status": "declared", + "evidence": [ + "ev-2" + ] + } + ] + } + ], + "evidence": [ + { + "id": "ev-1", + "field": "inputs", + "source_type": "doc_url", + "locator": "https://aideepmed.com/TM-align", + "excerpt": "Input Structure 1 in PDB format or PDBx/mmCIF format (mandatory): ... Input Structure 2 in PDB format or PDBx/mmCIF format (mandatory): ...", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-2", + "field": "outputs", + "source_type": "doc_url", + "locator": "https://aideepmed.com/TM-align", + "excerpt": "TM-align is an algorithm for sequence independent protein structure comparisons. ... An optimal superposition of the two structures built on the detected alignment, as well as the TM-score value which scales the structural similarity, will be returned.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "TMalign", + "{structure_a}", + "{structure_b}", + "-outfmt", + "2" + ], + "capture_stdout_to": "output_table" + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tmalign_align_structures_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tmalign_align_structures_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..744a3c46afd214936492f0ea4a4b13658c507fd6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tmalign_align_structures_test.json.raw.txt @@ -0,0 +1,148 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "tmalign", + "version": "20240303", + "build": "hd63eeec_0", + "executable": "TMalign", + "subcommand": null, + "environment": { + "dependencies": ["libgcc >=14", "libstdcxx >=14"], + "execution_environment": "Compiled" + } + }, + "endpoint": { + "name": "align_structures", + "description": "Align two protein structures using TM-align and output machine-readable alignment table." + }, + "arguments": [ + { + "name": "structure_a", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Path to first structure file (PDB or mmCIF)." + }, + { + "name": "structure_b", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Path to second structure file (PDB or mmCIF)." + }, + { + "name": "output_table", + "flag": null, + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Captured stdout containing machine-readable alignment table.", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "structure_a", + "artifact_type": "path", + "binding": "structure_a", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-1"] + }, + { + "name": "readable", + "status": "declared", + "evidence": ["ev-1"] + } + ] + }, + { + "name": "structure_b", + "artifact_type": "path", + "binding": "structure_b", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": ["ev-1"] + }, + { + "name": "readable", + "status": "declared", + "evidence": ["ev-1"] + } + ] + } + ], + "outputs": [ + { + "name": "output_table", + "artifact_type": "path", + "binding": "output_table", + "capture": "stdout", + "assertions": [ + { + "name": "non_empty", + "status": "declared", + "evidence": ["ev-2"] + } + ] + } + ], + "validators": [ + { + "name": "output_table_tsv", + "artifact_type": "path", + "binding": "output_table", + "assertions": [ + { + "name": "tsv_format", + "status": "declared", + "evidence": ["ev-2"] + } + ] + } + ], + "evidence": [ + { + "id": "ev-1", + "field": "inputs", + "source_type": "doc_url", + "locator": "https://aideepmed.com/TM-align", + "excerpt": "Input Structure 1 in PDB format or PDBx/mmCIF format (mandatory): ... Input Structure 2 in PDB format or PDBx/mmCIF format (mandatory): ...", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-2", + "field": "outputs", + "source_type": "doc_url", + "locator": "https://aideepmed.com/TM-align", + "excerpt": "TM-align is an algorithm for sequence independent protein structure comparisons. ... An optimal superposition of the two structures built on the detected alignment, as well as the TM-score value which scales the structural similarity, will be returned.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "TMalign", + "{structure_a}", + "{structure_b}", + "-outfmt", + "2" + ], + "capture_stdout_to": "output_table" + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tmalign_align_structures_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tmalign_align_structures_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..36a83517110f78b5c422c69a7e7ee6482b4bf0cc --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/tmalign_align_structures_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "a4536ad46a14941c379be6f42d390f9421f794645ecb52b70ab20cd9b0404304", + "elapsed_seconds": 6.408987522125244, + "usage": { + "prompt_tokens": 10452, + "completion_tokens": 1045, + "total_tokens": 11497, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10452 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "38540820-215c-4a1f-8839-2b422c3b0bd8" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/treetime_ancestral_reconstruction_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/treetime_ancestral_reconstruction_test.json new file mode 100644 index 0000000000000000000000000000000000000000..0178a696bbdfcd42e59d1575a225cb3aa3188c69 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/treetime_ancestral_reconstruction_test.json @@ -0,0 +1,197 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "treetime", + "version": "0.2.4", + "build": "py27_1", + "executable": "ancestral_reconstruction.py", + "subcommand": null, + "environment": "python=2.7" + }, + "endpoint": { + "name": "ancestral_reconstruction", + "description": "Reconstruct ancestral sequences using TreeTime with a fixed JC69 model." + }, + "arguments": [ + { + "name": "alignment_fasta", + "flag": "--aln", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input alignment in FASTA format." + }, + { + "name": "input_tree", + "flag": "--tree", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input phylogenetic tree in Newick format." + }, + { + "name": "output_dir", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Working directory for output files." + }, + { + "name": "gtr", + "flag": "--gtr", + "kind": "option", + "value_type": "string", + "required": false, + "position": null, + "repeat": false, + "description": "Substitution model; fixed to JC69." + }, + { + "name": "verbose", + "flag": "--verbose", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Verbosity level; set to 0." + } + ], + "inputs": [ + { + "name": "alignment_fasta", + "artifact_type": "file", + "binding": "alignment_fasta", + "assertions": [ + { + "name": "format", + "value": "fasta", + "status": "declared" + } + ] + }, + { + "name": "input_tree", + "artifact_type": "file", + "binding": "input_tree", + "assertions": [ + { + "name": "format", + "value": "newick", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "ancestral_sequences", + "artifact_type": "file", + "binding": "ancestral_sequences", + "assertions": [ + { + "name": "format", + "value": "fasta", + "status": "inferred" + } + ] + }, + { + "name": "annotated_tree", + "artifact_type": "file", + "binding": "annotated_tree", + "assertions": [ + { + "name": "format", + "value": "newick", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "output_exists", + "artifact_type": "file", + "binding": "ancestral_sequences", + "assertions": [ + { + "name": "exists", + "value": true, + "status": "inferred" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_search", + "locator": "treetime-0.2.4-py27_1", + "excerpt": "ancestral_reconstruction.py", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.alignment_fasta.flag", + "source_type": "doc", + "locator": "https://github.com/neherlab/treetime", + "excerpt": "treetime ancestral --aln input.fasta --tree input.nwk", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.input_tree.flag", + "source_type": "doc", + "locator": "https://github.com/neherlab/treetime", + "excerpt": "treetime ancestral --aln input.fasta --tree input.nwk", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.gtr.flag", + "source_type": "doc", + "locator": "https://github.com/neherlab/treetime", + "excerpt": "inference of GTR models", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.verbose.flag", + "source_type": "doc", + "locator": "https://github.com/neherlab/treetime", + "excerpt": "The full list if options is available by typing treetime ancestral -h", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "ancestral_reconstruction.py", + "--aln", + "alignment.fa", + "--tree", + "tree.nwk", + "--gtr", + "JC69", + "--verbose", + "0" + ], + "working_directory": "output_dir", + "copy_inputs": { + "alignment_fasta": "alignment.fa", + "input_tree": "tree.nwk" + } + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/treetime_ancestral_reconstruction_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/treetime_ancestral_reconstruction_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..c7b311eeef29c0ae70ca1d968bbde8f8ffde2a7c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/treetime_ancestral_reconstruction_test.json.raw.txt @@ -0,0 +1,197 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "treetime", + "version": "0.2.4", + "build": "py27_1", + "executable": "ancestral_reconstruction.py", + "subcommand": null, + "environment": "python=2.7" + }, + "endpoint": { + "name": "ancestral_reconstruction", + "description": "Reconstruct ancestral sequences using TreeTime with a fixed JC69 model." + }, + "arguments": [ + { + "name": "alignment_fasta", + "flag": "--aln", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input alignment in FASTA format." + }, + { + "name": "input_tree", + "flag": "--tree", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input phylogenetic tree in Newick format." + }, + { + "name": "output_dir", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Working directory for output files." + }, + { + "name": "gtr", + "flag": "--gtr", + "kind": "option", + "value_type": "string", + "required": false, + "position": null, + "repeat": false, + "description": "Substitution model; fixed to JC69." + }, + { + "name": "verbose", + "flag": "--verbose", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Verbosity level; set to 0." + } + ], + "inputs": [ + { + "name": "alignment_fasta", + "artifact_type": "file", + "binding": "alignment_fasta", + "assertions": [ + { + "name": "format", + "value": "fasta", + "status": "declared" + } + ] + }, + { + "name": "input_tree", + "artifact_type": "file", + "binding": "input_tree", + "assertions": [ + { + "name": "format", + "value": "newick", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "ancestral_sequences", + "artifact_type": "file", + "binding": "ancestral_sequences", + "assertions": [ + { + "name": "format", + "value": "fasta", + "status": "inferred" + } + ] + }, + { + "name": "annotated_tree", + "artifact_type": "file", + "binding": "annotated_tree", + "assertions": [ + { + "name": "format", + "value": "newick", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "output_exists", + "artifact_type": "file", + "binding": "ancestral_sequences", + "assertions": [ + { + "name": "exists", + "value": true, + "status": "inferred" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_search", + "locator": "treetime-0.2.4-py27_1", + "excerpt": "ancestral_reconstruction.py", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.alignment_fasta.flag", + "source_type": "doc", + "locator": "https://github.com/neherlab/treetime", + "excerpt": "treetime ancestral --aln input.fasta --tree input.nwk", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.input_tree.flag", + "source_type": "doc", + "locator": "https://github.com/neherlab/treetime", + "excerpt": "treetime ancestral --aln input.fasta --tree input.nwk", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.gtr.flag", + "source_type": "doc", + "locator": "https://github.com/neherlab/treetime", + "excerpt": "inference of GTR models", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.verbose.flag", + "source_type": "doc", + "locator": "https://github.com/neherlab/treetime", + "excerpt": "The full list if options is available by typing treetime ancestral -h", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "ancestral_reconstruction.py", + "--aln", + "alignment.fa", + "--tree", + "tree.nwk", + "--gtr", + "JC69", + "--verbose", + "0" + ], + "working_directory": "output_dir", + "copy_inputs": { + "alignment_fasta": "alignment.fa", + "input_tree": "tree.nwk" + } + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/treetime_ancestral_reconstruction_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/treetime_ancestral_reconstruction_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..0f1dfab871983a4d572ab89faf3463868ee584ec --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/treetime_ancestral_reconstruction_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "0b691af43ce1007f1cb8396ab93c0943f7f822fc6723993f5c5b1531ec483636", + "elapsed_seconds": 7.761739492416382, + "usage": { + "prompt_tokens": 11983, + "completion_tokens": 1419, + "total_tokens": 13402, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11983 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "f8ed8733-aab0-493c-b9d6-702198678134" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trim-galore_trim_adapters_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trim-galore_trim_adapters_test.json new file mode 100644 index 0000000000000000000000000000000000000000..1d0be4d8a62d63ed5628a5d43bcc61ca1f261973 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trim-galore_trim_adapters_test.json @@ -0,0 +1,130 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "trim-galore", + "version": "2.3.0", + "build": "hf1b6044_0", + "executable": "trim_galore", + "subcommand": null, + "environment": { + "execution_environment": "Perl", + "execution_environment_reason": "inferred from package/dependencies (Perl ecosystem)" + } + }, + "endpoint": { + "name": "trim_adapters", + "description": "Trim adapter sequences from a FASTQ file using Trim Galore! with fixed parameters." + }, + "arguments": [ + { + "name": "input_fastq", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input FASTQ file to be trimmed." + }, + { + "name": "output_dir", + "flag": "--output_dir", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Directory where output files will be written." + } + ], + "inputs": [ + { + "name": "input_fastq", + "artifact_type": "fastq", + "binding": "input_fastq", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": "ev-001" + }, + { + "name": "readable", + "status": "declared", + "evidence": "ev-001" + } + ] + } + ], + "outputs": [ + { + "name": "trimmed_fastq", + "artifact_type": "fastq", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": "ev-002" + } + ] + } + ], + "validators": [ + { + "name": "output_fastq_exists", + "artifact_type": "fastq", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": "ev-002" + } + ] + } + ], + "evidence": [ + { + "id": "ev-001", + "field": "input_fastq", + "source_type": "method_interface", + "locator": "target_interface", + "excerpt": "input_fastq is required and bound to positional argument", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-002", + "field": "output_dir", + "source_type": "method_interface", + "locator": "target_interface", + "excerpt": "output_dir is required and bound to --output_dir; output files are derived", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "make_directories": [ + "output_dir" + ], + "command": [ + "trim_galore", + "-a", + "ACGTTGCA", + "-q", + "0", + "--length", + "1", + "--cores", + "1", + "--basename", + "trimmed", + "--output_dir", + "{output_dir}", + "{input_fastq}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trim-galore_trim_adapters_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trim-galore_trim_adapters_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..326d8eae42abcd7375ca1ad19f32ff81ebf340e4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trim-galore_trim_adapters_test.json.raw.txt @@ -0,0 +1,130 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "trim-galore", + "version": "2.3.0", + "build": "hf1b6044_0", + "executable": "trim_galore", + "subcommand": null, + "environment": { + "execution_environment": "Perl", + "execution_environment_reason": "inferred from package/dependencies (Perl ecosystem)" + } + }, + "endpoint": { + "name": "trim_adapters", + "description": "Trim adapter sequences from a FASTQ file using Trim Galore! with fixed parameters." + }, + "arguments": [ + { + "name": "input_fastq", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input FASTQ file to be trimmed." + }, + { + "name": "output_dir", + "flag": "--output_dir", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Directory where output files will be written." + } + ], + "inputs": [ + { + "name": "input_fastq", + "artifact_type": "fastq", + "binding": "input_fastq", + "assertions": [ + { + "name": "exists", + "status": "declared", + "evidence": "ev-001" + }, + { + "name": "readable", + "status": "declared", + "evidence": "ev-001" + } + ] + } + ], + "outputs": [ + { + "name": "trimmed_fastq", + "artifact_type": "fastq", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": "ev-002" + } + ] + } + ], + "validators": [ + { + "name": "output_fastq_exists", + "artifact_type": "fastq", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": "ev-002" + } + ] + } + ], + "evidence": [ + { + "id": "ev-001", + "field": "input_fastq", + "source_type": "method_interface", + "locator": "target_interface", + "excerpt": "input_fastq is required and bound to positional argument", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev-002", + "field": "output_dir", + "source_type": "method_interface", + "locator": "target_interface", + "excerpt": "output_dir is required and bound to --output_dir; output files are derived", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "make_directories": [ + "output_dir" + ], + "command": [ + "trim_galore", + "-a", + "ACGTTGCA", + "-q", + "0", + "--length", + "1", + "--cores", + "1", + "--basename", + "trimmed", + "--output_dir", + "{output_dir}", + "{input_fastq}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trim-galore_trim_adapters_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trim-galore_trim_adapters_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..5be61e866646766e891e7e00a5505a668fbbd2a5 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trim-galore_trim_adapters_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "dfffac9d79b9ce1e99dbb52d8f3efff7f1a5773ef24bc301e1c5dac23459e1fe", + "elapsed_seconds": 5.343968868255615, + "usage": { + "prompt_tokens": 8316, + "completion_tokens": 855, + "total_tokens": 9171, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 8316 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "bc7664d9-16c4-4b8e-86bf-ea18779b28b2" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trimadap_trim_adapter_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trimadap_trim_adapter_test.json new file mode 100644 index 0000000000000000000000000000000000000000..a69644cb88f435c73da16ccda94744248e185920 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trimadap_trim_adapter_test.json @@ -0,0 +1,105 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "trimadap", + "version": "r11", + "build": "h577a1d6_7", + "executable": "trimadap-mt", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "trim_adapter", + "description": "Trim 3' adapter from FASTQ reads using trimadap-mt with fixed parameters." + }, + "arguments": [ + { + "name": "input_fastq", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input FASTQ file to be trimmed." + }, + { + "name": "output_fastq", + "flag": null, + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output FASTQ file (captured from stdout).", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_fastq", + "artifact_type": "fastq", + "binding": "input_fastq", + "assertions": [ + { + "name": "format", + "value": "fastq", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_fastq", + "artifact_type": "fastq", + "binding": "output_fastq", + "capture": "stdout", + "assertions": [ + { + "name": "format", + "value": "fastq", + "status": "inferred" + } + ] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/trimadap-r11-h577a1d6_7.conda", + "excerpt": "trimadap-mt", + "digest": "sha256:7ebb377e53015f41a72b78c4d6c7f8cc" + }, + { + "id": "ev2", + "field": "endpoint.execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "execution_plan with command trimadap-mt -3 ACGTTGCA -l 1 -s 4 -p 1 {input_fastq}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "trimadap-mt", + "-3", + "ACGTTGCA", + "-l", + "1", + "-s", + "4", + "-p", + "1", + "{input_fastq}" + ], + "capture_stdout_to": "output_fastq" + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trimadap_trim_adapter_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trimadap_trim_adapter_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..559bc0a06672d8a77d4f8279bd4dcee951cdd9db --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trimadap_trim_adapter_test.json.raw.txt @@ -0,0 +1,105 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "trimadap", + "version": "r11", + "build": "h577a1d6_7", + "executable": "trimadap-mt", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "trim_adapter", + "description": "Trim 3' adapter from FASTQ reads using trimadap-mt with fixed parameters." + }, + "arguments": [ + { + "name": "input_fastq", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input FASTQ file to be trimmed." + }, + { + "name": "output_fastq", + "flag": null, + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output FASTQ file (captured from stdout).", + "pass_to_cli": false + } + ], + "inputs": [ + { + "name": "input_fastq", + "artifact_type": "fastq", + "binding": "input_fastq", + "assertions": [ + { + "name": "format", + "value": "fastq", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_fastq", + "artifact_type": "fastq", + "binding": "output_fastq", + "capture": "stdout", + "assertions": [ + { + "name": "format", + "value": "fastq", + "status": "inferred" + } + ] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/trimadap-r11-h577a1d6_7.conda", + "excerpt": "trimadap-mt", + "digest": "sha256:7ebb377e53015f41a72b78c4d6c7f8cc" + }, + { + "id": "ev2", + "field": "endpoint.execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "execution_plan with command trimadap-mt -3 ACGTTGCA -l 1 -s 4 -p 1 {input_fastq}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "trimadap-mt", + "-3", + "ACGTTGCA", + "-l", + "1", + "-s", + "4", + "-p", + "1", + "{input_fastq}" + ], + "capture_stdout_to": "output_fastq" + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trimadap_trim_adapter_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trimadap_trim_adapter_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..7885c98c84c25e8eb6a91d3af3c635f3edcc5ec0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trimadap_trim_adapter_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "6c9aa35ecc93a9f528ba68d9e4edfec2a6e3778da4e508517eb07feca959f22b", + "elapsed_seconds": 3.987516403198242, + "usage": { + "prompt_tokens": 4874, + "completion_tokens": 771, + "total_tokens": 5645, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 4874 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "45c93949-973e-44e6-b404-1bef8169c7cc" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trnascan-se_scan_trna_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trnascan-se_scan_trna_test.json new file mode 100644 index 0000000000000000000000000000000000000000..bad886f4066cf9c2eb466725cbe8f9cdcbc49ff6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trnascan-se_scan_trna_test.json @@ -0,0 +1,148 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "trnascan-se", + "version": "2.0.13", + "build": "pl5321hab16a5f_0", + "executable": "tRNAscan-SE", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "scan_trna", + "description": "Scan for tRNA sequences in a FASTA file using tRNAscan-SE with general model and quiet mode." + }, + "arguments": [ + { + "name": "input_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input FASTA file containing sequences to scan." + }, + { + "name": "output_table", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output file for tRNA scan results." + }, + { + "name": "stats_file", + "flag": "-m", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output file for statistics." + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "FASTA", + "binding": "input_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + }, + { + "name": "format", + "status": "declared", + "description": "Input file must be in FASTA format." + } + ] + } + ], + "outputs": [ + { + "name": "output_table", + "artifact_type": "TSV", + "binding": "output_table", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output table file must be created." + } + ] + }, + { + "name": "stats_file", + "artifact_type": "Text", + "binding": "stats_file", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Statistics file must be created." + } + ] + } + ], + "validators": [ + { + "name": "output_table_nonempty", + "artifact": "output_table", + "assertion": "file is non-empty", + "status": "declared" + }, + { + "name": "stats_file_nonempty", + "artifact": "stats_file", + "assertion": "file is non-empty", + "status": "declared" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "execution_plan", + "source_type": "method-neutral target interface", + "locator": "execution_plan.steps[0].command", + "excerpt": "tRNAscan-SE -G -o {output_table} -m {stats_file} -q {input_fasta}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "method-neutral target interface", + "locator": "candidate native executable", + "excerpt": "tRNAscan-SE", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "method-neutral target interface", + "locator": "parameters", + "excerpt": "input_fasta: positional; output_table: -o; stats_file: -m", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "tRNAscan-SE", + "-G", + "-o", + "{output_table}", + "-m", + "{stats_file}", + "-q", + "{input_fasta}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trnascan-se_scan_trna_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trnascan-se_scan_trna_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2d8e0ab711b4197f0d3fedd77747196d56843f3f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trnascan-se_scan_trna_test.json.raw.txt @@ -0,0 +1,148 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "trnascan-se", + "version": "2.0.13", + "build": "pl5321hab16a5f_0", + "executable": "tRNAscan-SE", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "scan_trna", + "description": "Scan for tRNA sequences in a FASTA file using tRNAscan-SE with general model and quiet mode." + }, + "arguments": [ + { + "name": "input_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input FASTA file containing sequences to scan." + }, + { + "name": "output_table", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output file for tRNA scan results." + }, + { + "name": "stats_file", + "flag": "-m", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output file for statistics." + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "FASTA", + "binding": "input_fasta", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + }, + { + "name": "format", + "status": "declared", + "description": "Input file must be in FASTA format." + } + ] + } + ], + "outputs": [ + { + "name": "output_table", + "artifact_type": "TSV", + "binding": "output_table", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output table file must be created." + } + ] + }, + { + "name": "stats_file", + "artifact_type": "Text", + "binding": "stats_file", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Statistics file must be created." + } + ] + } + ], + "validators": [ + { + "name": "output_table_nonempty", + "artifact": "output_table", + "assertion": "file is non-empty", + "status": "declared" + }, + { + "name": "stats_file_nonempty", + "artifact": "stats_file", + "assertion": "file is non-empty", + "status": "declared" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "execution_plan", + "source_type": "method-neutral target interface", + "locator": "execution_plan.steps[0].command", + "excerpt": "tRNAscan-SE -G -o {output_table} -m {stats_file} -q {input_fasta}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "method-neutral target interface", + "locator": "candidate native executable", + "excerpt": "tRNAscan-SE", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "method-neutral target interface", + "locator": "parameters", + "excerpt": "input_fasta: positional; output_table: -o; stats_file: -m", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "tRNAscan-SE", + "-G", + "-o", + "{output_table}", + "-m", + "{stats_file}", + "-q", + "{input_fasta}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trnascan-se_scan_trna_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trnascan-se_scan_trna_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..bae5519af82dca4631097112340d6955c5f80a5c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/trnascan-se_scan_trna_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "45ebb23af5153dc7e90d6bfc1814f16340246d13c836c4cc0b61d37de24ff1eb", + "elapsed_seconds": 5.313577175140381, + "usage": { + "prompt_tokens": 6500, + "completion_tokens": 1041, + "total_tokens": 7541, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6500 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "093ad634-9ad2-4315-9e94-e356778da392" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-bedtobigbed_bed_to_bigbed_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-bedtobigbed_bed_to_bigbed_test.json new file mode 100644 index 0000000000000000000000000000000000000000..feb9ace0cb1184261442f580c2d5723d9e19f452 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-bedtobigbed_bed_to_bigbed_test.json @@ -0,0 +1,116 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-bedtobigbed", + "version": "482", + "build": "hdc0a859_0", + "executable": "bedToBigBed", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "bed_to_bigbed", + "description": "Convert bed file to bigBed. (BigBed version: 4)" + }, + "arguments": [ + { + "name": "input_bed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input BED file" + }, + { + "name": "chrom_sizes", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Chromosome sizes file" + }, + { + "name": "output_bigbed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Output bigBed file" + } + ], + "inputs": [ + { + "name": "input_bed", + "artifact_type": "bed", + "binding": "input_bed", + "assertions": [] + }, + { + "name": "chrom_sizes", + "artifact_type": "chrom_sizes", + "binding": "chrom_sizes", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_bigbed", + "artifact_type": "bigbed", + "binding": "output_bigbed", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_info", + "locator": "conda search --info ucsc-bedtobigbed", + "excerpt": "Candidate native executable: bedToBigBed", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Target endpoint: bed_to_bigbed", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Parameters: input_bed, chrom_sizes, output_bigbed", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "execution_plan: steps: command: bedToBigBed {input_bed} {chrom_sizes} {output_bigbed}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "bedToBigBed", + "{input_bed}", + "{chrom_sizes}", + "{output_bigbed}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-bedtobigbed_bed_to_bigbed_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-bedtobigbed_bed_to_bigbed_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2298765fb2c1b96b839755dd2e069738d130c87e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-bedtobigbed_bed_to_bigbed_test.json.raw.txt @@ -0,0 +1,116 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-bedtobigbed", + "version": "482", + "build": "hdc0a859_0", + "executable": "bedToBigBed", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "bed_to_bigbed", + "description": "Convert bed file to bigBed. (BigBed version: 4)" + }, + "arguments": [ + { + "name": "input_bed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input BED file" + }, + { + "name": "chrom_sizes", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Chromosome sizes file" + }, + { + "name": "output_bigbed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Output bigBed file" + } + ], + "inputs": [ + { + "name": "input_bed", + "artifact_type": "bed", + "binding": "input_bed", + "assertions": [] + }, + { + "name": "chrom_sizes", + "artifact_type": "chrom_sizes", + "binding": "chrom_sizes", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_bigbed", + "artifact_type": "bigbed", + "binding": "output_bigbed", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_info", + "locator": "conda search --info ucsc-bedtobigbed", + "excerpt": "Candidate native executable: bedToBigBed", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Target endpoint: bed_to_bigbed", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Parameters: input_bed, chrom_sizes, output_bigbed", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "execution_plan: steps: command: bedToBigBed {input_bed} {chrom_sizes} {output_bigbed}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "bedToBigBed", + "{input_bed}", + "{chrom_sizes}", + "{output_bigbed}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-bedtobigbed_bed_to_bigbed_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-bedtobigbed_bed_to_bigbed_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..f015a6aeedda7a442429fffbb75dfd819a79bb4f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-bedtobigbed_bed_to_bigbed_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "b48d2b0a81f767b98faf9823f7a34dcb65775ec784a378d81dd24def845f1e2e", + "elapsed_seconds": 5.356189012527466, + "usage": { + "prompt_tokens": 11258, + "completion_tokens": 904, + "total_tokens": 12162, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11258 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "33d8dab8-f0e4-4f87-b56a-3e7e9d374936" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-fatotwobit_fasta_to_twobit_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-fatotwobit_fasta_to_twobit_test.json new file mode 100644 index 0000000000000000000000000000000000000000..d1bef41f497b5ecaa2243309208fa7bb998a38d2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-fatotwobit_fasta_to_twobit_test.json @@ -0,0 +1,127 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-fatotwobit", + "version": "482", + "build": "hdc0a859_0", + "executable": "faToTwoBit", + "subcommand": null, + "environment": "Compiled" + }, + "endpoint": { + "name": "fasta_to_twobit", + "description": "Convert DNA from fasta to 2bit format." + }, + "arguments": [ + { + "name": "input_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input FASTA file." + }, + { + "name": "output_twobit", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output 2bit file." + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "fasta", + "binding": "input_fasta", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_twobit", + "artifact_type": "twobit", + "binding": "output_twobit", + "assertions": [ + { + "name": "byte_for_byte_identical", + "status": "declared", + "description": "The deterministic binary artifact is compared byte-for-byte." + } + ] + } + ], + "validators": [ + { + "name": "byte_for_byte_identical", + "artifact": "output_twobit", + "description": "The deterministic binary artifact is compared byte-for-byte." + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge ucsc-fatotwobit --info", + "excerpt": "ucsc-fatotwobit 482 hdc0a859_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge ucsc-fatotwobit --info", + "excerpt": "faToTwoBit", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "endpoint.description", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge ucsc-fatotwobit --info", + "excerpt": "Convert DNA from fasta to 2bit format.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.input_fasta", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "input_fasta: path, required, positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.output_twobit", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "output_twobit: path, required, positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "outputs.output_twobit.assertions", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "The deterministic binary artifact is compared byte-for-byte.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "faToTwoBit", + "{input_fasta}", + "{output_twobit}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-fatotwobit_fasta_to_twobit_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-fatotwobit_fasta_to_twobit_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..160bb0c3484469dc42ba5ffe8b6ababe927d16d8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-fatotwobit_fasta_to_twobit_test.json.raw.txt @@ -0,0 +1,127 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-fatotwobit", + "version": "482", + "build": "hdc0a859_0", + "executable": "faToTwoBit", + "subcommand": null, + "environment": "Compiled" + }, + "endpoint": { + "name": "fasta_to_twobit", + "description": "Convert DNA from fasta to 2bit format." + }, + "arguments": [ + { + "name": "input_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input FASTA file." + }, + { + "name": "output_twobit", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output 2bit file." + } + ], + "inputs": [ + { + "name": "input_fasta", + "artifact_type": "fasta", + "binding": "input_fasta", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_twobit", + "artifact_type": "twobit", + "binding": "output_twobit", + "assertions": [ + { + "name": "byte_for_byte_identical", + "status": "declared", + "description": "The deterministic binary artifact is compared byte-for-byte." + } + ] + } + ], + "validators": [ + { + "name": "byte_for_byte_identical", + "artifact": "output_twobit", + "description": "The deterministic binary artifact is compared byte-for-byte." + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge ucsc-fatotwobit --info", + "excerpt": "ucsc-fatotwobit 482 hdc0a859_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge ucsc-fatotwobit --info", + "excerpt": "faToTwoBit", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "endpoint.description", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge ucsc-fatotwobit --info", + "excerpt": "Convert DNA from fasta to 2bit format.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "arguments.input_fasta", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "input_fasta: path, required, positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.output_twobit", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "output_twobit: path, required, positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "outputs.output_twobit.assertions", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "The deterministic binary artifact is compared byte-for-byte.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "faToTwoBit", + "{input_fasta}", + "{output_twobit}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-fatotwobit_fasta_to_twobit_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-fatotwobit_fasta_to_twobit_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..799cc726797a6878eeeeea634407064448dc6243 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-fatotwobit_fasta_to_twobit_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "70b6678f9b80698f3716bb64dd6af0ffbb8d085c6318484f6066ea513e320022", + "elapsed_seconds": 8.731956005096436, + "usage": { + "prompt_tokens": 11343, + "completion_tokens": 1107, + "total_tokens": 12450, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11343 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "5e0c0e36-8bce-460c-a259-8ce1dd02bca3" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-gtftogenepred_gtf_to_genepred_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-gtftogenepred_gtf_to_genepred_test.json new file mode 100644 index 0000000000000000000000000000000000000000..a9a1e0518da779cba1df7574208fdbd4431ae2e4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-gtftogenepred_gtf_to_genepred_test.json @@ -0,0 +1,103 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-gtftogenepred", + "version": "482", + "build": "h0b57e2e_0", + "executable": "gtfToGenePred", + "subcommand": null, + "environment": "Compiled" + }, + "endpoint": { + "name": "gtf_to_genepred", + "description": "Convert a GTF file to a genePred." + }, + "arguments": [ + { + "name": "input_gtf", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input GTF file" + }, + { + "name": "output_genepred", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output genePred file" + } + ], + "inputs": [ + { + "name": "input_gtf", + "artifact_type": "GTF", + "binding": "input_gtf", + "assertions": [ + { + "name": "format", + "value": "GTF", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_genepred", + "artifact_type": "genePred", + "binding": "output_genepred", + "assertions": [ + { + "name": "format", + "value": "genePred", + "status": "inferred" + } + ] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_info", + "locator": "conda search -c bioconda -c conda-forge ucsc-gtftogenepred --info", + "excerpt": "ucsc-gtftogenepred 482 h0b57e2e_0", + "digest": "sha256:51a2f06c89873b867715ce59135a989d" + }, + { + "id": "ev2", + "field": "endpoint.description", + "source_type": "doc_url", + "locator": "https://github.com/ucscGenomeBrowser/kent/blob/v482_base/README", + "excerpt": "Convert a GTF file to a genePred.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "input_gtf and output_genepred as positional arguments", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "gtfToGenePred", + "{input_gtf}", + "{output_genepred}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-gtftogenepred_gtf_to_genepred_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-gtftogenepred_gtf_to_genepred_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..6ad76fab59d850d1c9732a79f91a844fe67ff76e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-gtftogenepred_gtf_to_genepred_test.json.raw.txt @@ -0,0 +1,103 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-gtftogenepred", + "version": "482", + "build": "h0b57e2e_0", + "executable": "gtfToGenePred", + "subcommand": null, + "environment": "Compiled" + }, + "endpoint": { + "name": "gtf_to_genepred", + "description": "Convert a GTF file to a genePred." + }, + "arguments": [ + { + "name": "input_gtf", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input GTF file" + }, + { + "name": "output_genepred", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output genePred file" + } + ], + "inputs": [ + { + "name": "input_gtf", + "artifact_type": "GTF", + "binding": "input_gtf", + "assertions": [ + { + "name": "format", + "value": "GTF", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_genepred", + "artifact_type": "genePred", + "binding": "output_genepred", + "assertions": [ + { + "name": "format", + "value": "genePred", + "status": "inferred" + } + ] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "conda_info", + "locator": "conda search -c bioconda -c conda-forge ucsc-gtftogenepred --info", + "excerpt": "ucsc-gtftogenepred 482 h0b57e2e_0", + "digest": "sha256:51a2f06c89873b867715ce59135a989d" + }, + { + "id": "ev2", + "field": "endpoint.description", + "source_type": "doc_url", + "locator": "https://github.com/ucscGenomeBrowser/kent/blob/v482_base/README", + "excerpt": "Convert a GTF file to a genePred.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "input_gtf and output_genepred as positional arguments", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "gtfToGenePred", + "{input_gtf}", + "{output_genepred}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-gtftogenepred_gtf_to_genepred_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-gtftogenepred_gtf_to_genepred_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..0be8297ab441fb288c1462dc9b2b1574f83159f0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-gtftogenepred_gtf_to_genepred_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "b560858585684202e9d34c8d56ea774214bda9caacf8609f6cbb74cf526bd154", + "elapsed_seconds": 4.49467396736145, + "usage": { + "prompt_tokens": 11274, + "completion_tokens": 777, + "total_tokens": 12051, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11274 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "c305c01d-9787-43b4-8817-d52495038e13" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-liftover_lift_bed_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-liftover_lift_bed_test.json new file mode 100644 index 0000000000000000000000000000000000000000..3cf7eb59295a6e9c057ded8d10a1edbbaca50b72 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-liftover_lift_bed_test.json @@ -0,0 +1,166 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-liftover", + "version": "482", + "build": "h0b57e2e_0", + "executable": "liftOver", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "lift_bed", + "description": "Move annotations from one assembly to another using liftOver." + }, + "arguments": [ + { + "name": "input_bed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input BED file to be lifted." + }, + { + "name": "chain_file", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Chain file for the assembly conversion." + }, + { + "name": "output_bed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Output BED file with lifted coordinates." + }, + { + "name": "unmapped_bed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 4, + "repeat": false, + "description": "Output file for unmapped records." + } + ], + "inputs": [ + { + "name": "input_bed", + "artifact_type": "BED", + "binding": "input_bed", + "assertions": [ + { + "name": "format", + "value": "BED", + "status": "inferred" + } + ] + }, + { + "name": "chain_file", + "artifact_type": "chain", + "binding": "chain_file", + "assertions": [ + { + "name": "format", + "value": "chain", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_bed", + "artifact_type": "BED", + "binding": "output_bed", + "assertions": [ + { + "name": "format", + "value": "BED", + "status": "inferred" + } + ] + }, + { + "name": "unmapped_bed", + "artifact_type": "BED", + "binding": "unmapped_bed", + "assertions": [ + { + "name": "format", + "value": "BED", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "output_bed_exists", + "artifact": "output_bed", + "type": "file_exists", + "assertions": [ + { + "name": "exists", + "value": true, + "status": "inferred" + } + ] + }, + { + "name": "unmapped_bed_exists", + "artifact": "unmapped_bed", + "type": "file_exists", + "assertions": [ + { + "name": "exists", + "value": true, + "status": "inferred" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "executable", + "source_type": "conda_info", + "locator": "conda search -c bioconda -c conda-forge ucsc-liftover --info", + "excerpt": "ucsc-liftover 482 h0b57e2e_0 ...", + "digest": "sha256:37fa65c88c2a63fb54b320db20a23908" + }, + { + "id": "ev2", + "field": "arguments", + "source_type": "doc_url", + "locator": "https://github.com/ucscGenomeBrowser/kent/blob/v482_base/README", + "excerpt": "The applications are scattered in other directories.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "liftOver", + "{input_bed}", + "{chain_file}", + "{output_bed}", + "{unmapped_bed}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-liftover_lift_bed_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-liftover_lift_bed_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..ab32ddcdad8458663f994ba7cfed24a145087bf6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-liftover_lift_bed_test.json.raw.txt @@ -0,0 +1,166 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-liftover", + "version": "482", + "build": "h0b57e2e_0", + "executable": "liftOver", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "lift_bed", + "description": "Move annotations from one assembly to another using liftOver." + }, + "arguments": [ + { + "name": "input_bed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input BED file to be lifted." + }, + { + "name": "chain_file", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Chain file for the assembly conversion." + }, + { + "name": "output_bed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 3, + "repeat": false, + "description": "Output BED file with lifted coordinates." + }, + { + "name": "unmapped_bed", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 4, + "repeat": false, + "description": "Output file for unmapped records." + } + ], + "inputs": [ + { + "name": "input_bed", + "artifact_type": "BED", + "binding": "input_bed", + "assertions": [ + { + "name": "format", + "value": "BED", + "status": "inferred" + } + ] + }, + { + "name": "chain_file", + "artifact_type": "chain", + "binding": "chain_file", + "assertions": [ + { + "name": "format", + "value": "chain", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_bed", + "artifact_type": "BED", + "binding": "output_bed", + "assertions": [ + { + "name": "format", + "value": "BED", + "status": "inferred" + } + ] + }, + { + "name": "unmapped_bed", + "artifact_type": "BED", + "binding": "unmapped_bed", + "assertions": [ + { + "name": "format", + "value": "BED", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "output_bed_exists", + "artifact": "output_bed", + "type": "file_exists", + "assertions": [ + { + "name": "exists", + "value": true, + "status": "inferred" + } + ] + }, + { + "name": "unmapped_bed_exists", + "artifact": "unmapped_bed", + "type": "file_exists", + "assertions": [ + { + "name": "exists", + "value": true, + "status": "inferred" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "executable", + "source_type": "conda_info", + "locator": "conda search -c bioconda -c conda-forge ucsc-liftover --info", + "excerpt": "ucsc-liftover 482 h0b57e2e_0 ...", + "digest": "sha256:37fa65c88c2a63fb54b320db20a23908" + }, + { + "id": "ev2", + "field": "arguments", + "source_type": "doc_url", + "locator": "https://github.com/ucscGenomeBrowser/kent/blob/v482_base/README", + "excerpt": "The applications are scattered in other directories.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "liftOver", + "{input_bed}", + "{chain_file}", + "{output_bed}", + "{unmapped_bed}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-liftover_lift_bed_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-liftover_lift_bed_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..a6c124c87b391533743073b959afd0932a5240d8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-liftover_lift_bed_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "89d1dd7fd3386fa636ffef9e5e25c5a275e6814b346e205e6cea21ea6f59a735", + "elapsed_seconds": 5.428968191146851, + "usage": { + "prompt_tokens": 11321, + "completion_tokens": 1081, + "total_tokens": 12402, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11321 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "16957e84-b71b-4bb1-b96c-559412fd746b" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-nibfrag_extract_nib_fragment_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-nibfrag_extract_nib_fragment_test.json new file mode 100644 index 0000000000000000000000000000000000000000..6dc55aa0ef3953471e833608d48d95eb9bc6768a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-nibfrag_extract_nib_fragment_test.json @@ -0,0 +1,137 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-nibfrag", + "version": "482", + "build": "h0b57e2e_0", + "executable": "nibFrag", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "extract_nib_fragment", + "description": "Extract part of a nib file as .fa (all bases/gaps lower case by default)." + }, + "arguments": [ + { + "name": "input_nib", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input .nib file" + }, + { + "name": "output_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 5, + "repeat": false, + "description": "Output .fa file" + } + ], + "inputs": [ + { + "name": "input_nib", + "artifact_type": "nib", + "binding": "input_nib", + "assertions": [ + { + "name": "exists", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_fasta", + "artifact_type": "fasta", + "binding": "output_fasta", + "assertions": [ + { + "name": "created", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_fasta_nonempty", + "artifact": "output_fasta", + "assertion": "file_size > 0", + "status": "declared" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ucsc-nibfrag-482-h0b57e2e_0.tar.bz2", + "excerpt": "name : ucsc-nibfrag\nversion : 482\nbuild : h0b57e2e_0", + "digest": "sha256:6c4470c1f93e4dcb5a0ab1d4ac84621b" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ucsc-nibfrag-482-h0b57e2e_0.tar.bz2", + "excerpt": "Candidate native executable: nibFrag", + "digest": "sha256:6c4470c1f93e4dcb5a0ab1d4ac84621b" + }, + { + "id": "ev3", + "field": "endpoint.description", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ucsc-nibfrag-482-h0b57e2e_0.tar.bz2", + "excerpt": "Extract part of a nib file as .fa (all bases/gaps lower case by default).", + "digest": "sha256:6c4470c1f93e4dcb5a0ab1d4ac84621b" + }, + { + "id": "ev4", + "field": "arguments.input_nib", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "{\"name\":\"input_nib\",\"value_type\":\"path\",\"required\":true,\"native_binding\":\"positional\"}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.output_fasta", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "{\"name\":\"output_fasta\",\"value_type\":\"path\",\"required\":true,\"native_binding\":\"positional\"}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "{\"steps\":[{\"command\":[\"nibFrag\",\"-upper\",\"-name=fragment\",\"{input_nib}\",\"4\",\"20\",\"+\",\"{output_fasta}\"]}]}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "nibFrag", + "-upper", + "-name=fragment", + "{input_nib}", + "4", + "20", + "+", + "{output_fasta}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-nibfrag_extract_nib_fragment_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-nibfrag_extract_nib_fragment_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..d2dcfd35d58fbde613277c20b972ebf732c5081c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-nibfrag_extract_nib_fragment_test.json.raw.txt @@ -0,0 +1,137 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-nibfrag", + "version": "482", + "build": "h0b57e2e_0", + "executable": "nibFrag", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "extract_nib_fragment", + "description": "Extract part of a nib file as .fa (all bases/gaps lower case by default)." + }, + "arguments": [ + { + "name": "input_nib", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input .nib file" + }, + { + "name": "output_fasta", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 5, + "repeat": false, + "description": "Output .fa file" + } + ], + "inputs": [ + { + "name": "input_nib", + "artifact_type": "nib", + "binding": "input_nib", + "assertions": [ + { + "name": "exists", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_fasta", + "artifact_type": "fasta", + "binding": "output_fasta", + "assertions": [ + { + "name": "created", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_fasta_nonempty", + "artifact": "output_fasta", + "assertion": "file_size > 0", + "status": "declared" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ucsc-nibfrag-482-h0b57e2e_0.tar.bz2", + "excerpt": "name : ucsc-nibfrag\nversion : 482\nbuild : h0b57e2e_0", + "digest": "sha256:6c4470c1f93e4dcb5a0ab1d4ac84621b" + }, + { + "id": "ev2", + "field": "tool.executable", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ucsc-nibfrag-482-h0b57e2e_0.tar.bz2", + "excerpt": "Candidate native executable: nibFrag", + "digest": "sha256:6c4470c1f93e4dcb5a0ab1d4ac84621b" + }, + { + "id": "ev3", + "field": "endpoint.description", + "source_type": "conda_search", + "locator": "https://conda.anaconda.org/bioconda/linux-64/ucsc-nibfrag-482-h0b57e2e_0.tar.bz2", + "excerpt": "Extract part of a nib file as .fa (all bases/gaps lower case by default).", + "digest": "sha256:6c4470c1f93e4dcb5a0ab1d4ac84621b" + }, + { + "id": "ev4", + "field": "arguments.input_nib", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "{\"name\":\"input_nib\",\"value_type\":\"path\",\"required\":true,\"native_binding\":\"positional\"}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "arguments.output_fasta", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "{\"name\":\"output_fasta\",\"value_type\":\"path\",\"required\":true,\"native_binding\":\"positional\"}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "execution_plan", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "{\"steps\":[{\"command\":[\"nibFrag\",\"-upper\",\"-name=fragment\",\"{input_nib}\",\"4\",\"20\",\"+\",\"{output_fasta}\"]}]}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "nibFrag", + "-upper", + "-name=fragment", + "{input_nib}", + "4", + "20", + "+", + "{output_fasta}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-nibfrag_extract_nib_fragment_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-nibfrag_extract_nib_fragment_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..efd3139d68121b9df5b5f560c3e80835b45d683d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-nibfrag_extract_nib_fragment_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "24b5eb38d6d9b55ff4ad2ac2aa45cf8cc2dbb3087305215452fb88ac27da4ed2", + "elapsed_seconds": 8.909467697143555, + "usage": { + "prompt_tokens": 10371, + "completion_tokens": 1282, + "total_tokens": 11653, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10371 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "4f89d661-5eb5-48a8-bba4-0569aa09a327" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobitinfo_twobit_info_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobitinfo_twobit_info_test.json new file mode 100644 index 0000000000000000000000000000000000000000..bffe616cc577824df13f387154dd8b5c4caf03af --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobitinfo_twobit_info_test.json @@ -0,0 +1,110 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-twobitinfo", + "version": "482", + "build": "hdc0a859_0", + "executable": "twoBitInfo", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "twobit_info", + "description": "Get information about sequences in a .2bit file." + }, + "arguments": [ + { + "name": "input_twobit", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input .2bit file" + }, + { + "name": "output_file", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output file to write sequence information" + } + ], + "inputs": [ + { + "name": "input_twobit", + "artifact_type": "file", + "binding": "input_twobit", + "assertions": [ + { + "name": "format", + "value": "2bit", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_file", + "artifact_type": "file", + "binding": "output_file", + "assertions": [ + { + "name": "format", + "value": "text", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "output_file_exists", + "artifact": "output_file", + "assertion": "exists", + "status": "inferred" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "endpoint.description", + "source_type": "conda_metadata", + "locator": "https://anaconda.org/bioconda/ucsc-twobitinfo/482", + "excerpt": "Get information about sequences in a .2bit file.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.input_twobit", + "source_type": "execution_plan", + "locator": "provided target interface", + "excerpt": "twoBitInfo {input_twobit} {output_file}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.output_file", + "source_type": "execution_plan", + "locator": "provided target interface", + "excerpt": "twoBitInfo {input_twobit} {output_file}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "twoBitInfo", + "{input_twobit}", + "{output_file}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobitinfo_twobit_info_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobitinfo_twobit_info_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2f05e3ad333ba625c97eb15ecc96474d053c7032 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobitinfo_twobit_info_test.json.raw.txt @@ -0,0 +1,110 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-twobitinfo", + "version": "482", + "build": "hdc0a859_0", + "executable": "twoBitInfo", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "twobit_info", + "description": "Get information about sequences in a .2bit file." + }, + "arguments": [ + { + "name": "input_twobit", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input .2bit file" + }, + { + "name": "output_file", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output file to write sequence information" + } + ], + "inputs": [ + { + "name": "input_twobit", + "artifact_type": "file", + "binding": "input_twobit", + "assertions": [ + { + "name": "format", + "value": "2bit", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "output_file", + "artifact_type": "file", + "binding": "output_file", + "assertions": [ + { + "name": "format", + "value": "text", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "output_file_exists", + "artifact": "output_file", + "assertion": "exists", + "status": "inferred" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "endpoint.description", + "source_type": "conda_metadata", + "locator": "https://anaconda.org/bioconda/ucsc-twobitinfo/482", + "excerpt": "Get information about sequences in a .2bit file.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.input_twobit", + "source_type": "execution_plan", + "locator": "provided target interface", + "excerpt": "twoBitInfo {input_twobit} {output_file}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.output_file", + "source_type": "execution_plan", + "locator": "provided target interface", + "excerpt": "twoBitInfo {input_twobit} {output_file}", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "twoBitInfo", + "{input_twobit}", + "{output_file}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobitinfo_twobit_info_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobitinfo_twobit_info_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..6ac5d07389c950a2afe6f3af7fea4c03c453442b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobitinfo_twobit_info_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "03ea0f8995cb09a7fdeaa1531755a451813be2c02b9bb101f0ae0eb6caccd4ae", + "elapsed_seconds": 4.5741331577301025, + "usage": { + "prompt_tokens": 10993, + "completion_tokens": 794, + "total_tokens": 11787, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10993 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "000e9bc9-1754-4f38-9710-2e7e46c4d319" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobittofa_twobit_to_fasta_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobittofa_twobit_to_fasta_test.json new file mode 100644 index 0000000000000000000000000000000000000000..c71fd48391b33e84b0a3cddfcff51c55bea08c0a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobittofa_twobit_to_fasta_test.json @@ -0,0 +1,116 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-twobittofa", + "version": "482", + "build": "hdc0a859_0", + "executable": "twoBitToFa", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "twobit_to_fasta", + "description": "Convert all or part of .2bit file to fasta." + }, + "arguments": [ + { + "name": "input_twobit", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input .2bit file" + }, + { + "name": "output_file", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Output FASTA file" + } + ], + "inputs": [ + { + "name": "input_twobit", + "artifact_type": "twobit", + "binding": "input_twobit", + "assertions": [ + { + "name": "file_exists", + "status": "inferred", + "evidence": "ev_1" + } + ] + } + ], + "outputs": [ + { + "name": "output_file", + "artifact_type": "fasta", + "binding": "output_file", + "assertions": [ + { + "name": "file_exists", + "status": "inferred", + "evidence": "ev_2" + } + ] + } + ], + "validators": [ + { + "name": "output_fasta_valid", + "artifact_type": "fasta", + "binding": "output_file", + "assertions": [ + { + "name": "valid_fasta", + "status": "inferred", + "evidence": "ev_3" + } + ] + } + ], + "evidence": [ + { + "id": "ev_1", + "field": "inputs[0].assertions[0]", + "source_type": "help_text", + "locator": "https://hgdownload.cse.ucsc.edu/admin/exe", + "excerpt": "Convert all or part of .2bit file to fasta.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_2", + "field": "outputs[0].assertions[0]", + "source_type": "help_text", + "locator": "https://hgdownload.cse.ucsc.edu/admin/exe", + "excerpt": "Convert all or part of .2bit file to fasta.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_3", + "field": "validators[0].assertions[0]", + "source_type": "help_text", + "locator": "https://hgdownload.cse.ucsc.edu/admin/exe", + "excerpt": "Convert all or part of .2bit file to fasta.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "twoBitToFa", + "{input_twobit}", + "{output_file}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobittofa_twobit_to_fasta_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobittofa_twobit_to_fasta_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..7b498707cfff7a597aa9630a89cfdde01935ea02 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobittofa_twobit_to_fasta_test.json.raw.txt @@ -0,0 +1,116 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "ucsc-twobittofa", + "version": "482", + "build": "hdc0a859_0", + "executable": "twoBitToFa", + "subcommand": null, + "environment": "conda" + }, + "endpoint": { + "name": "twobit_to_fasta", + "description": "Convert all or part of .2bit file to fasta." + }, + "arguments": [ + { + "name": "input_twobit", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input .2bit file" + }, + { + "name": "output_file", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Output FASTA file" + } + ], + "inputs": [ + { + "name": "input_twobit", + "artifact_type": "twobit", + "binding": "input_twobit", + "assertions": [ + { + "name": "file_exists", + "status": "inferred", + "evidence": "ev_1" + } + ] + } + ], + "outputs": [ + { + "name": "output_file", + "artifact_type": "fasta", + "binding": "output_file", + "assertions": [ + { + "name": "file_exists", + "status": "inferred", + "evidence": "ev_2" + } + ] + } + ], + "validators": [ + { + "name": "output_fasta_valid", + "artifact_type": "fasta", + "binding": "output_file", + "assertions": [ + { + "name": "valid_fasta", + "status": "inferred", + "evidence": "ev_3" + } + ] + } + ], + "evidence": [ + { + "id": "ev_1", + "field": "inputs[0].assertions[0]", + "source_type": "help_text", + "locator": "https://hgdownload.cse.ucsc.edu/admin/exe", + "excerpt": "Convert all or part of .2bit file to fasta.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_2", + "field": "outputs[0].assertions[0]", + "source_type": "help_text", + "locator": "https://hgdownload.cse.ucsc.edu/admin/exe", + "excerpt": "Convert all or part of .2bit file to fasta.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_3", + "field": "validators[0].assertions[0]", + "source_type": "help_text", + "locator": "https://hgdownload.cse.ucsc.edu/admin/exe", + "excerpt": "Convert all or part of .2bit file to fasta.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "twoBitToFa", + "{input_twobit}", + "{output_file}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobittofa_twobit_to_fasta_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobittofa_twobit_to_fasta_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..d63e1c77810b1c809212a03b2d07a485a0c671e8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/ucsc-twobittofa_twobit_to_fasta_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "5138ab6557dc27ef01e060868d3aee297a2161b956a17a58c691667f61e16b8a", + "elapsed_seconds": 4.667144060134888, + "usage": { + "prompt_tokens": 9482, + "completion_tokens": 865, + "total_tokens": 10347, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9482 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "e4cdc2ae-e729-49b1-9d55-526716778a78" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/umis_csv_to_sparse_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/umis_csv_to_sparse_test.json new file mode 100644 index 0000000000000000000000000000000000000000..7c23c3da46b009c521a49723225b17d93b85f2e3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/umis_csv_to_sparse_test.json @@ -0,0 +1,132 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "umis", + "version": "1.0.9", + "build": "py312h0fa9677_5", + "executable": "umis", + "subcommand": "sparse", + "environment": "conda" + }, + "endpoint": { + "name": "csv_to_sparse", + "description": "Convert a CSV file to a sparse matrix format." + }, + "arguments": [ + { + "name": "input_csv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input CSV file." + }, + { + "name": "output_matrix", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output sparse matrix file." + } + ], + "inputs": [ + { + "name": "input_csv", + "artifact_type": "csv", + "binding": "input_csv", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_matrix", + "artifact_type": "sparse_matrix", + "binding": "output_matrix", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge umis --info", + "excerpt": "umis 1.0.9 py312h0fa9677_5", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge umis --info", + "excerpt": "version : 1.0.9", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge umis --info", + "excerpt": "build : py312h0fa9677_5", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "tool.executable", + "source_type": "help_text", + "locator": "https://github.com/vals/umis", + "excerpt": "umis provides tools for estimating expression in RNA-Seq data", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Target subcommand: sparse", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Target endpoint: csv_to_sparse", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.input_csv", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "name: input_csv, value_type: path, required: true, native_binding: positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev8", + "field": "arguments.output_matrix", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "name: output_matrix, value_type: path, required: true, native_binding: positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "umis", + "sparse", + "{input_csv}", + "{output_matrix}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/umis_csv_to_sparse_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/umis_csv_to_sparse_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..5de0490122439afb9ff39f87fbc6f6aa2b1f9f8f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/umis_csv_to_sparse_test.json.raw.txt @@ -0,0 +1,132 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "umis", + "version": "1.0.9", + "build": "py312h0fa9677_5", + "executable": "umis", + "subcommand": "sparse", + "environment": "conda" + }, + "endpoint": { + "name": "csv_to_sparse", + "description": "Convert a CSV file to a sparse matrix format." + }, + "arguments": [ + { + "name": "input_csv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 1, + "repeat": false, + "description": "Input CSV file." + }, + { + "name": "output_matrix", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 2, + "repeat": false, + "description": "Output sparse matrix file." + } + ], + "inputs": [ + { + "name": "input_csv", + "artifact_type": "csv", + "binding": "input_csv", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_matrix", + "artifact_type": "sparse_matrix", + "binding": "output_matrix", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge umis --info", + "excerpt": "umis 1.0.9 py312h0fa9677_5", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge umis --info", + "excerpt": "version : 1.0.9", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge umis --info", + "excerpt": "build : py312h0fa9677_5", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "tool.executable", + "source_type": "help_text", + "locator": "https://github.com/vals/umis", + "excerpt": "umis provides tools for estimating expression in RNA-Seq data", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Target subcommand: sparse", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "endpoint.name", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Target endpoint: csv_to_sparse", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.input_csv", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "name: input_csv, value_type: path, required: true, native_binding: positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev8", + "field": "arguments.output_matrix", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "name: output_matrix, value_type: path, required: true, native_binding: positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "umis", + "sparse", + "{input_csv}", + "{output_matrix}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/umis_csv_to_sparse_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/umis_csv_to_sparse_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..467194d4cdab64d5581452feae0320f8754215e3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/umis_csv_to_sparse_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "c39fd54c8cfdb3dada4b696b1fb6994bf977ebabe69cf0cebe94cd0fb0f41f07", + "elapsed_seconds": 7.521601438522339, + "usage": { + "prompt_tokens": 9497, + "completion_tokens": 1180, + "total_tokens": 10677, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9497 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "29576afa-0e3c-4544-8528-6088eab03449" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unicycler_assemble_paired_reads_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unicycler_assemble_paired_reads_test.json new file mode 100644 index 0000000000000000000000000000000000000000..435f8ad2b1c3c711db355391d817f463001b8913 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unicycler_assemble_paired_reads_test.json @@ -0,0 +1,236 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "unicycler", + "version": "0.5.1", + "build": "py311hc84137b_5", + "executable": "unicycler", + "subcommand": null, + "environment": { + "PATH_PREPEND": "/225040511/miniconda3/envs/bioenv_cli/bin", + "TERM": "xterm" + } + }, + "endpoint": { + "name": "assemble_paired_reads", + "description": "Assemble 3000 deterministic paired lambda reads into a single linear contig with one thread and a stable k-mer schedule." + }, + "arguments": [ + { + "name": "reads_r1", + "flag": "-1", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "FASTQ file of first short reads in each pair" + }, + { + "name": "reads_r2", + "flag": "-2", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "FASTQ file of second short reads in each pair" + }, + { + "name": "output_dir", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output directory (required)" + }, + { + "name": "threads", + "flag": "-t", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Number of threads used (default: 8)" + }, + { + "name": "linear_seqs", + "flag": "--linear_seqs", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "The expected number of linear (i.e. non-circular) sequences in the underlying sequence (default: 0)" + }, + { + "name": "keep", + "flag": "--keep", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Level of file retention (default: 1)" + }, + { + "name": "verbosity", + "flag": "--verbosity", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Level of stdout and log file information (default: 1)" + }, + { + "name": "kmers", + "flag": "--kmers", + "kind": "option", + "value_type": "string", + "required": false, + "position": null, + "repeat": false, + "description": "K-mer schedule (comma-separated) for assembly" + } + ], + "inputs": [ + { + "name": "reads_r1", + "artifact_type": "fastq", + "binding": "reads_r1", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + }, + { + "name": "reads_r2", + "artifact_type": "fastq", + "binding": "reads_r2", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "assembly_fasta", + "artifact_type": "fasta", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "non_empty", + "status": "declared" + } + ] + }, + { + "name": "assembly_gfa", + "artifact_type": "gfa", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared" + } + ] + }, + { + "name": "log_file", + "artifact_type": "log", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "single_linear_contig", + "artifact_type": "fasta", + "binding": "assembly_fasta", + "assertions": [ + { + "name": "contig_count_equals", + "value": 1, + "status": "declared" + }, + { + "name": "linear", + "status": "declared" + } + ] + } + ], + "evidence": [ + { + "id": "ev_help_text", + "field": "arguments", + "source_type": "help_text", + "locator": "unicycler --help", + "excerpt": "usage: unicycler [-h] [--help_all] [--version] [-1 SHORT1] [-2 SHORT2] [-s UNPAIRED] [-l LONG] -o OUT [--verbosity VERBOSITY] [--min_fasta_length MIN_FASTA_LENGTH] [--keep KEEP] [-t THREADS] [--mode {conservative,normal,bold}] [--linear_seqs LINEAR_SEQS]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_execution_plan", + "field": "execution_plan", + "source_type": "method_neutral_interface", + "locator": "execution_plan", + "excerpt": "unicycler -1 {reads_r1} -2 {reads_r2} -o {output_dir} -t 1 --linear_seqs 1 --keep 0 --verbosity 1 --kmers 27,53,71,87,99", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "unicycler", + "-1", + "{reads_r1}", + "-2", + "{reads_r2}", + "-o", + "{output_dir}", + "-t", + "1", + "--linear_seqs", + "1", + "--keep", + "0", + "--verbosity", + "1", + "--kmers", + "27,53,71,87,99" + ], + "env": { + "PATH_PREPEND": "/225040511/miniconda3/envs/bioenv_cli/bin", + "TERM": "xterm" + } + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unicycler_assemble_paired_reads_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unicycler_assemble_paired_reads_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..c632b18cdebb8cf3e6bf8ebb11d1a18f01449209 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unicycler_assemble_paired_reads_test.json.raw.txt @@ -0,0 +1,236 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "unicycler", + "version": "0.5.1", + "build": "py311hc84137b_5", + "executable": "unicycler", + "subcommand": null, + "environment": { + "PATH_PREPEND": "/225040511/miniconda3/envs/bioenv_cli/bin", + "TERM": "xterm" + } + }, + "endpoint": { + "name": "assemble_paired_reads", + "description": "Assemble 3000 deterministic paired lambda reads into a single linear contig with one thread and a stable k-mer schedule." + }, + "arguments": [ + { + "name": "reads_r1", + "flag": "-1", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "FASTQ file of first short reads in each pair" + }, + { + "name": "reads_r2", + "flag": "-2", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "FASTQ file of second short reads in each pair" + }, + { + "name": "output_dir", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output directory (required)" + }, + { + "name": "threads", + "flag": "-t", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Number of threads used (default: 8)" + }, + { + "name": "linear_seqs", + "flag": "--linear_seqs", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "The expected number of linear (i.e. non-circular) sequences in the underlying sequence (default: 0)" + }, + { + "name": "keep", + "flag": "--keep", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Level of file retention (default: 1)" + }, + { + "name": "verbosity", + "flag": "--verbosity", + "kind": "option", + "value_type": "integer", + "required": false, + "position": null, + "repeat": false, + "description": "Level of stdout and log file information (default: 1)" + }, + { + "name": "kmers", + "flag": "--kmers", + "kind": "option", + "value_type": "string", + "required": false, + "position": null, + "repeat": false, + "description": "K-mer schedule (comma-separated) for assembly" + } + ], + "inputs": [ + { + "name": "reads_r1", + "artifact_type": "fastq", + "binding": "reads_r1", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + }, + { + "name": "reads_r2", + "artifact_type": "fastq", + "binding": "reads_r2", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "assembly_fasta", + "artifact_type": "fasta", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "non_empty", + "status": "declared" + } + ] + }, + { + "name": "assembly_gfa", + "artifact_type": "gfa", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared" + } + ] + }, + { + "name": "log_file", + "artifact_type": "log", + "binding": "output_dir", + "assertions": [ + { + "name": "exists", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "single_linear_contig", + "artifact_type": "fasta", + "binding": "assembly_fasta", + "assertions": [ + { + "name": "contig_count_equals", + "value": 1, + "status": "declared" + }, + { + "name": "linear", + "status": "declared" + } + ] + } + ], + "evidence": [ + { + "id": "ev_help_text", + "field": "arguments", + "source_type": "help_text", + "locator": "unicycler --help", + "excerpt": "usage: unicycler [-h] [--help_all] [--version] [-1 SHORT1] [-2 SHORT2] [-s UNPAIRED] [-l LONG] -o OUT [--verbosity VERBOSITY] [--min_fasta_length MIN_FASTA_LENGTH] [--keep KEEP] [-t THREADS] [--mode {conservative,normal,bold}] [--linear_seqs LINEAR_SEQS]", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev_execution_plan", + "field": "execution_plan", + "source_type": "method_neutral_interface", + "locator": "execution_plan", + "excerpt": "unicycler -1 {reads_r1} -2 {reads_r2} -o {output_dir} -t 1 --linear_seqs 1 --keep 0 --verbosity 1 --kmers 27,53,71,87,99", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "unicycler", + "-1", + "{reads_r1}", + "-2", + "{reads_r2}", + "-o", + "{output_dir}", + "-t", + "1", + "--linear_seqs", + "1", + "--keep", + "0", + "--verbosity", + "1", + "--kmers", + "27,53,71,87,99" + ], + "env": { + "PATH_PREPEND": "/225040511/miniconda3/envs/bioenv_cli/bin", + "TERM": "xterm" + } + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unicycler_assemble_paired_reads_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unicycler_assemble_paired_reads_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..b7f37383275000e8e4a2be7af10e8f08e198f2e8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unicycler_assemble_paired_reads_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "f68675a66e82aa71e4c8403a5dbbbdf9271eb96ad433870c1fd388e34c1a0d67", + "elapsed_seconds": 7.848994016647339, + "usage": { + "prompt_tokens": 2176, + "completion_tokens": 1673, + "total_tokens": 3849, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 2176 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "d32401f2-c5cd-486a-9f2e-a4ee20a67495" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unifrac_unweighted_distance_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unifrac_unweighted_distance_test.json new file mode 100644 index 0000000000000000000000000000000000000000..08fcac271fcdc5d2933615c78aef39564841f42b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unifrac_unweighted_distance_test.json @@ -0,0 +1,165 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "unifrac", + "version": "1.5.1", + "build": "py310h20b60a1_0", + "executable": "ssu", + "subcommand": null, + "environment": { + "OMP_NUM_THREADS": "1", + "UNIFRAC_USE_GPU": "N" + } + }, + "endpoint": { + "name": "unweighted_distance", + "description": "Compute unweighted UniFrac distance matrix from a BIOM table and a Newick tree." + }, + "arguments": [ + { + "name": "input_biom", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input BIOM table." + }, + { + "name": "tree_newick", + "flag": "-t", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input phylogeny in Newick format." + }, + { + "name": "distance_matrix", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output distance matrix." + }, + { + "name": "method", + "flag": "-m", + "kind": "option", + "value_type": "string", + "required": true, + "position": null, + "repeat": false, + "description": "Method to use; must be 'unweighted'." + }, + { + "name": "format", + "flag": "--format", + "kind": "option", + "value_type": "string", + "required": true, + "position": null, + "repeat": false, + "description": "Output format; must be 'ascii'." + } + ], + "inputs": [ + { + "name": "input_biom", + "artifact_type": "BIOM table", + "binding": "input_biom", + "assertions": [ + { + "name": "format", + "value": "BIOM-Format 2.1", + "status": "inferred" + } + ] + }, + { + "name": "tree_newick", + "artifact_type": "Newick tree", + "binding": "tree_newick", + "assertions": [ + { + "name": "format", + "value": "Newick", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "distance_matrix", + "artifact_type": "distance matrix", + "binding": "distance_matrix", + "assertions": [ + { + "name": "format", + "value": "ASCII", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "biom_format", + "artifact": "input_biom", + "assertion": "BIOM-Format 2.1", + "status": "inferred" + }, + { + "name": "newick_format", + "artifact": "tree_newick", + "assertion": "Newick format", + "status": "inferred" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "arguments", + "source_type": "help_text", + "locator": "ssu --help", + "excerpt": "-i The input BIOM table. -t The input phylogeny in newick. -m The method, [unweighted | ...]. -o The output distance matrix. --format|-r [OPTIONAL] Output format: ascii : [DEFAULT] Original ASCII format.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "environment", + "source_type": "help_text", + "locator": "ssu --help", + "excerpt": "CPU parallelism is controlled by OMP_NUM_THREADS. If not defined, all detected core will be used. GPU offload can be disabled with UNIFRAC_USE_GPU=N.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "ssu", + "-i", + "{input_biom}", + "-o", + "{distance_matrix}", + "-m", + "unweighted", + "-t", + "{tree_newick}", + "--format", + "ascii" + ], + "env": { + "OMP_NUM_THREADS": "1", + "UNIFRAC_USE_GPU": "N" + } + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unifrac_unweighted_distance_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unifrac_unweighted_distance_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..5848f27b34b1244b12f5a19ab66c746367ed0579 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unifrac_unweighted_distance_test.json.raw.txt @@ -0,0 +1,165 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "unifrac", + "version": "1.5.1", + "build": "py310h20b60a1_0", + "executable": "ssu", + "subcommand": null, + "environment": { + "OMP_NUM_THREADS": "1", + "UNIFRAC_USE_GPU": "N" + } + }, + "endpoint": { + "name": "unweighted_distance", + "description": "Compute unweighted UniFrac distance matrix from a BIOM table and a Newick tree." + }, + "arguments": [ + { + "name": "input_biom", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input BIOM table." + }, + { + "name": "tree_newick", + "flag": "-t", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input phylogeny in Newick format." + }, + { + "name": "distance_matrix", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output distance matrix." + }, + { + "name": "method", + "flag": "-m", + "kind": "option", + "value_type": "string", + "required": true, + "position": null, + "repeat": false, + "description": "Method to use; must be 'unweighted'." + }, + { + "name": "format", + "flag": "--format", + "kind": "option", + "value_type": "string", + "required": true, + "position": null, + "repeat": false, + "description": "Output format; must be 'ascii'." + } + ], + "inputs": [ + { + "name": "input_biom", + "artifact_type": "BIOM table", + "binding": "input_biom", + "assertions": [ + { + "name": "format", + "value": "BIOM-Format 2.1", + "status": "inferred" + } + ] + }, + { + "name": "tree_newick", + "artifact_type": "Newick tree", + "binding": "tree_newick", + "assertions": [ + { + "name": "format", + "value": "Newick", + "status": "inferred" + } + ] + } + ], + "outputs": [ + { + "name": "distance_matrix", + "artifact_type": "distance matrix", + "binding": "distance_matrix", + "assertions": [ + { + "name": "format", + "value": "ASCII", + "status": "inferred" + } + ] + } + ], + "validators": [ + { + "name": "biom_format", + "artifact": "input_biom", + "assertion": "BIOM-Format 2.1", + "status": "inferred" + }, + { + "name": "newick_format", + "artifact": "tree_newick", + "assertion": "Newick format", + "status": "inferred" + } + ], + "evidence": [ + { + "id": "ev1", + "field": "arguments", + "source_type": "help_text", + "locator": "ssu --help", + "excerpt": "-i The input BIOM table. -t The input phylogeny in newick. -m The method, [unweighted | ...]. -o The output distance matrix. --format|-r [OPTIONAL] Output format: ascii : [DEFAULT] Original ASCII format.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "environment", + "source_type": "help_text", + "locator": "ssu --help", + "excerpt": "CPU parallelism is controlled by OMP_NUM_THREADS. If not defined, all detected core will be used. GPU offload can be disabled with UNIFRAC_USE_GPU=N.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "ssu", + "-i", + "{input_biom}", + "-o", + "{distance_matrix}", + "-m", + "unweighted", + "-t", + "{tree_newick}", + "--format", + "ascii" + ], + "env": { + "OMP_NUM_THREADS": "1", + "UNIFRAC_USE_GPU": "N" + } + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unifrac_unweighted_distance_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unifrac_unweighted_distance_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..4adcba98e428427f5e20e6723c3b2b27e9eb4e67 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/unifrac_unweighted_distance_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "b42f8f190bb99c4cd80d9e9eedf6657d735d913516fbe2dcded4dd91e3c83729", + "elapsed_seconds": 6.601654767990112, + "usage": { + "prompt_tokens": 23012, + "completion_tokens": 1173, + "total_tokens": 24185, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 23012 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "1f018b29-6e4a-43e3-86b7-ea5bb07e1f3a" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/vt_normalize_vcf_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/vt_normalize_vcf_test.json new file mode 100644 index 0000000000000000000000000000000000000000..e1356723996531eb38133f703c973a8160da8f9a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/vt_normalize_vcf_test.json @@ -0,0 +1,169 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "vt", + "version": "2015.11.10", + "build": "h5ef6573_4", + "executable": "vt", + "subcommand": "normalize", + "environment": "conda" + }, + "endpoint": { + "name": "normalize_vcf", + "description": "Normalize variants in a VCF file" + }, + "arguments": [ + { + "name": "input_vcf", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input VCF file" + }, + { + "name": "reference_file", + "flag": "-r", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Reference genome file" + }, + { + "name": "output_vcf", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output VCF file" + } + ], + "inputs": [ + { + "name": "input_vcf", + "artifact_type": "vcf", + "binding": "input_vcf", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + } + ] + }, + { + "name": "reference_file", + "artifact_type": "fasta", + "binding": "reference_file", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "outputs": [ + { + "name": "output_vcf", + "artifact_type": "vcf", + "binding": "output_vcf", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_info", + "locator": "conda search vt --info", + "excerpt": "name: vt", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_info", + "locator": "conda search vt --info", + "excerpt": "version: 2015.11.10", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_info", + "locator": "conda search vt --info", + "excerpt": "build: h5ef6573_4", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "tool.executable", + "source_type": "conda_info", + "locator": "conda search vt --info", + "excerpt": "executable: vt", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "subcommand: normalize", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.input_vcf", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "native_binding: positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.reference_file", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "native_binding: -r", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev8", + "field": "arguments.output_vcf", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "native_binding: -o", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "vt", + "normalize", + "{input_vcf}", + "-r", + "{reference_file}", + "-o", + "{output_vcf}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/vt_normalize_vcf_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/vt_normalize_vcf_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..884631688caed3bb23d2604b5aa5d5bae66c8ebc --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/vt_normalize_vcf_test.json.raw.txt @@ -0,0 +1,169 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "vt", + "version": "2015.11.10", + "build": "h5ef6573_4", + "executable": "vt", + "subcommand": "normalize", + "environment": "conda" + }, + "endpoint": { + "name": "normalize_vcf", + "description": "Normalize variants in a VCF file" + }, + "arguments": [ + { + "name": "input_vcf", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input VCF file" + }, + { + "name": "reference_file", + "flag": "-r", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Reference genome file" + }, + { + "name": "output_vcf", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output VCF file" + } + ], + "inputs": [ + { + "name": "input_vcf", + "artifact_type": "vcf", + "binding": "input_vcf", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + } + ] + }, + { + "name": "reference_file", + "artifact_type": "fasta", + "binding": "reference_file", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "outputs": [ + { + "name": "output_vcf", + "artifact_type": "vcf", + "binding": "output_vcf", + "assertions": [ + { + "name": "exists", + "status": "inferred", + "evidence": [] + } + ] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_info", + "locator": "conda search vt --info", + "excerpt": "name: vt", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_info", + "locator": "conda search vt --info", + "excerpt": "version: 2015.11.10", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_info", + "locator": "conda search vt --info", + "excerpt": "build: h5ef6573_4", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "tool.executable", + "source_type": "conda_info", + "locator": "conda search vt --info", + "excerpt": "executable: vt", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "tool.subcommand", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "subcommand: normalize", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.input_vcf", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "native_binding: positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.reference_file", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "native_binding: -r", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev8", + "field": "arguments.output_vcf", + "source_type": "target_interface", + "locator": "target_interface", + "excerpt": "native_binding: -o", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "vt", + "normalize", + "{input_vcf}", + "-r", + "{reference_file}", + "-o", + "{output_vcf}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/vt_normalize_vcf_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/vt_normalize_vcf_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..2955b129828c12f3ae77b714ccd9ddc454aa1657 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/vt_normalize_vcf_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "65c3ffdbefaeb49181baaa25c315f8659c29a03627ce0a3fe66ac17bacd413a4", + "elapsed_seconds": 6.3962721824646, + "usage": { + "prompt_tokens": 6484, + "completion_tokens": 1281, + "total_tokens": 7765, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6484 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "cc4c9836-e289-4ae8-bfe1-b66c046c652c" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/wasp2_find_allelic_imbalance_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/wasp2_find_allelic_imbalance_test.json new file mode 100644 index 0000000000000000000000000000000000000000..a50449ae17b8f974b819ccfc7567539e054aa85d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/wasp2_find_allelic_imbalance_test.json @@ -0,0 +1,148 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "wasp2", + "version": "1.4.1", + "build": "py311hc94fe14_0", + "executable": "wasp2-analyze", + "subcommand": "find-imbalance", + "environment": "conda" + }, + "endpoint": { + "name": "find_allelic_imbalance", + "description": "Fit the WASP2 allelic-imbalance model to six pinned count records and report likelihood, effect-size, p-value, and FDR columns." + }, + "arguments": [ + { + "name": "count_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input TSV file with allele counts." + }, + { + "name": "output_tsv", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output TSV file for allelic imbalance results." + } + ], + "inputs": [ + { + "name": "count_tsv", + "artifact_type": "tsv", + "binding": "count_tsv", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + }, + { + "name": "format", + "value": "tsv", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_tsv", + "artifact_type": "tsv", + "binding": "output_tsv", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "writable", + "status": "declared" + }, + { + "name": "format", + "value": "tsv", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_tsv_columns", + "artifact": "output_tsv", + "assertions": [ + { + "name": "has_columns", + "value": [ + "likelihood", + "effect_size", + "p_value", + "fdr" + ], + "status": "declared" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "https://github.com/mcvickerlab/WASP2", + "excerpt": "wasp2-analyze find-imbalance counts.tsv -o ai_results.tsv", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.count_tsv", + "source_type": "help_text", + "locator": "https://github.com/mcvickerlab/WASP2", + "excerpt": "wasp2-analyze find-imbalance counts.tsv -o ai_results.tsv", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.output_tsv", + "source_type": "help_text", + "locator": "https://github.com/mcvickerlab/WASP2", + "excerpt": "wasp2-analyze find-imbalance counts.tsv -o ai_results.tsv", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "endpoint.description", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Fit the WASP2 allelic-imbalance model to six pinned count records and report likelihood, effect-size, p-value, and FDR columns.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "wasp2-analyze", + "find-imbalance", + "{count_tsv}", + "--min", + "10", + "-o", + "{output_tsv}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/wasp2_find_allelic_imbalance_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/wasp2_find_allelic_imbalance_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..87182f2d2318f013fa73b4f5f73a0e8a17bf2631 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/wasp2_find_allelic_imbalance_test.json.raw.txt @@ -0,0 +1,143 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "wasp2", + "version": "1.4.1", + "build": "py311hc94fe14_0", + "executable": "wasp2-analyze", + "subcommand": "find-imbalance", + "environment": "conda" + }, + "endpoint": { + "name": "find_allelic_imbalance", + "description": "Fit the WASP2 allelic-imbalance model to six pinned count records and report likelihood, effect-size, p-value, and FDR columns." + }, + "arguments": [ + { + "name": "count_tsv", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input TSV file with allele counts." + }, + { + "name": "output_tsv", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output TSV file for allelic imbalance results." + } + ], + "inputs": [ + { + "name": "count_tsv", + "artifact_type": "tsv", + "binding": "count_tsv", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "readable", + "status": "declared" + }, + { + "name": "format", + "value": "tsv", + "status": "declared" + } + ] + } + ], + "outputs": [ + { + "name": "output_tsv", + "artifact_type": "tsv", + "binding": "output_tsv", + "assertions": [ + { + "name": "exists", + "status": "declared" + }, + { + "name": "writable", + "status": "declared" + }, + { + "name": "format", + "value": "tsv", + "status": "declared" + } + ] + } + ], + "validators": [ + { + "name": "output_tsv_columns", + "artifact": "output_tsv", + "assertions": [ + { + "name": "has_columns", + "value": ["likelihood", "effect_size", "p_value", "fdr"], + "status": "declared" + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "tool.executable", + "source_type": "help_text", + "locator": "https://github.com/mcvickerlab/WASP2", + "excerpt": "wasp2-analyze find-imbalance counts.tsv -o ai_results.tsv", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "arguments.count_tsv", + "source_type": "help_text", + "locator": "https://github.com/mcvickerlab/WASP2", + "excerpt": "wasp2-analyze find-imbalance counts.tsv -o ai_results.tsv", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments.output_tsv", + "source_type": "help_text", + "locator": "https://github.com/mcvickerlab/WASP2", + "excerpt": "wasp2-analyze find-imbalance counts.tsv -o ai_results.tsv", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "endpoint.description", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "Fit the WASP2 allelic-imbalance model to six pinned count records and report likelihood, effect-size, p-value, and FDR columns.", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "wasp2-analyze", + "find-imbalance", + "{count_tsv}", + "--min", + "10", + "-o", + "{output_tsv}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/wasp2_find_allelic_imbalance_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/wasp2_find_allelic_imbalance_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..110250214bbec916a0f06a9f951a4fb4014d78f0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/wasp2_find_allelic_imbalance_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "218f54e432ea19e0809ed988d320526066cc810d1f2f7b8194c514208ec9286c", + "elapsed_seconds": 5.703260183334351, + "usage": { + "prompt_tokens": 6187, + "completion_tokens": 1102, + "total_tokens": 7289, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6187 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "b23ef5cf-4f52-4be7-8454-668cd1c8634d" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/whatshap_phasing_stats_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/whatshap_phasing_stats_test.json new file mode 100644 index 0000000000000000000000000000000000000000..9534c33535df1b22e5b9514f02cf00fe78f2a496 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/whatshap_phasing_stats_test.json @@ -0,0 +1,127 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "whatshap", + "version": "2.8", + "build": "py39h2de1943_0", + "executable": "whatshap", + "subcommand": "stats", + "environment": "conda" + }, + "endpoint": { + "name": "phasing_stats", + "description": "Compute phasing statistics from a VCF file and write to a TSV file." + }, + "arguments": [ + { + "name": "input_vcf", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input VCF file" + }, + { + "name": "output_tsv", + "flag": "--tsv", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output TSV file" + } + ], + "inputs": [ + { + "name": "input_vcf", + "artifact_type": "vcf", + "binding": "input_vcf", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_tsv", + "artifact_type": "tsv", + "binding": "output_tsv", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge whatshap --info", + "excerpt": "name : whatshap", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge whatshap --info", + "excerpt": "version : 2.8", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge whatshap --info", + "excerpt": "build : py39h2de1943_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "tool.executable", + "source_type": "help_text", + "locator": "help text", + "excerpt": "whatshap", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "tool.subcommand", + "source_type": "help_text", + "locator": "help text", + "excerpt": "stats", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.input_vcf", + "source_type": "method_neutral_interface", + "locator": "target interface", + "excerpt": "native_binding: positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.output_tsv", + "source_type": "method_neutral_interface", + "locator": "target interface", + "excerpt": "native_binding: --tsv", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "whatshap", + "stats", + "--tsv", + "{output_tsv}", + "--sample", + "SAMPLE", + "{input_vcf}" + ] + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/whatshap_phasing_stats_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/whatshap_phasing_stats_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..ecd6305d252fadb8ee0c4386ada792f96148ea7f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/whatshap_phasing_stats_test.json.raw.txt @@ -0,0 +1,127 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "whatshap", + "version": "2.8", + "build": "py39h2de1943_0", + "executable": "whatshap", + "subcommand": "stats", + "environment": "conda" + }, + "endpoint": { + "name": "phasing_stats", + "description": "Compute phasing statistics from a VCF file and write to a TSV file." + }, + "arguments": [ + { + "name": "input_vcf", + "flag": null, + "kind": "positional", + "value_type": "path", + "required": true, + "position": 0, + "repeat": false, + "description": "Input VCF file" + }, + { + "name": "output_tsv", + "flag": "--tsv", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output TSV file" + } + ], + "inputs": [ + { + "name": "input_vcf", + "artifact_type": "vcf", + "binding": "input_vcf", + "assertions": [] + } + ], + "outputs": [ + { + "name": "output_tsv", + "artifact_type": "tsv", + "binding": "output_tsv", + "assertions": [] + } + ], + "validators": [], + "evidence": [ + { + "id": "ev1", + "field": "tool.package", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge whatshap --info", + "excerpt": "name : whatshap", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "tool.version", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge whatshap --info", + "excerpt": "version : 2.8", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "tool.build", + "source_type": "conda_search", + "locator": "conda search -c bioconda -c conda-forge whatshap --info", + "excerpt": "build : py39h2de1943_0", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev4", + "field": "tool.executable", + "source_type": "help_text", + "locator": "help text", + "excerpt": "whatshap", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev5", + "field": "tool.subcommand", + "source_type": "help_text", + "locator": "help text", + "excerpt": "stats", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev6", + "field": "arguments.input_vcf", + "source_type": "method_neutral_interface", + "locator": "target interface", + "excerpt": "native_binding: positional", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev7", + "field": "arguments.output_tsv", + "source_type": "method_neutral_interface", + "locator": "target interface", + "excerpt": "native_binding: --tsv", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "whatshap", + "stats", + "--tsv", + "{output_tsv}", + "--sample", + "SAMPLE", + "{input_vcf}" + ] + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/whatshap_phasing_stats_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/whatshap_phasing_stats_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..d0f06abc69bc3a55446d86ea7f15e5281dd78eae --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/whatshap_phasing_stats_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "9ecd0d27baca3e442087339b054c34145f0a546aa09b7df2de19c59c067e15a8", + "elapsed_seconds": 6.877685546875, + "usage": { + "prompt_tokens": 7139, + "completion_tokens": 1068, + "total_tokens": 8207, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7139 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "8cb6a555-6414-4267-99fb-8f3d747a7353" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/zol_extract_genomic_region_test.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/zol_extract_genomic_region_test.json new file mode 100644 index 0000000000000000000000000000000000000000..105404121cf979b3402b89eddc5dfc985abda096 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/zol_extract_genomic_region_test.json @@ -0,0 +1,153 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "zol", + "version": "1.7.0", + "build": "py313h0bdc4b4_0", + "executable": "zol-suite", + "subcommand": "regex", + "environment": { + "ZOL_EXEC_PATH": "/225040511/miniconda3/envs/experiment1_test_pinned/zol-1.7.0-py313h0bdc4b4_0/bin" + } + }, + "endpoint": { + "name": "extract_genomic_region", + "description": "Extract a genomic region from a genome file (FASTA or GenBank) based on scaffold and coordinate inputs, output as GenBank." + }, + "arguments": [ + { + "name": "input_genbank", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input genome file (FASTA or GenBank)." + }, + { + "name": "output_genbank", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output GenBank file for the extracted region." + }, + { + "name": "temp_dir", + "flag": "-t", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Temporary directory for intermediate files." + } + ], + "inputs": [ + { + "name": "input_genbank", + "artifact_type": "genome_file", + "binding": "input_genbank", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + }, + { + "name": "readable", + "status": "declared", + "description": "Input file must be readable." + } + ] + } + ], + "outputs": [ + { + "name": "output_genbank", + "artifact_type": "genbank_file", + "binding": "output_genbank", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output file must be created." + }, + { + "name": "valid_genbank", + "status": "declared", + "description": "Output file must be valid GenBank format." + } + ] + } + ], + "validators": [ + { + "name": "output_exists", + "artifact_type": "genbank_file", + "binding": "output_genbank", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output file must exist after execution." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "executable", + "source_type": "help_text", + "locator": "https://github.com/Kalan-Lab/zol", + "excerpt": "Usage: zol-suite [-h] [--list-programs] [--version] ...", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "subcommand", + "source_type": "help_text", + "locator": "https://github.com/Kalan-Lab/zol", + "excerpt": "regex Extract a genomic region (as GenBank) from a genome file (FASTA or GenBank) based on scaffold and coordinate inputs (experimental).", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: -i, -o, -t", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "zol-suite", + "regex", + "-i", + "{input_genbank}", + "-s", + "chrTiny.1", + "-b", + "5", + "-e", + "30", + "-o", + "{output_genbank}", + "-t", + "{temp_dir}", + "--cleanup" + ], + "env": { + "ZOL_EXEC_PATH": "/225040511/miniconda3/envs/experiment1_test_pinned/zol-1.7.0-py313h0bdc4b4_0/bin" + } + } + ] + } +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/zol_extract_genomic_region_test.json.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/zol_extract_genomic_region_test.json.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..757a612391f86c3c8b626a9e56c9c65adedad640 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/zol_extract_genomic_region_test.json.raw.txt @@ -0,0 +1,153 @@ +{ + "ir_version": "0.1", + "tool": { + "package": "zol", + "version": "1.7.0", + "build": "py313h0bdc4b4_0", + "executable": "zol-suite", + "subcommand": "regex", + "environment": { + "ZOL_EXEC_PATH": "/225040511/miniconda3/envs/experiment1_test_pinned/zol-1.7.0-py313h0bdc4b4_0/bin" + } + }, + "endpoint": { + "name": "extract_genomic_region", + "description": "Extract a genomic region from a genome file (FASTA or GenBank) based on scaffold and coordinate inputs, output as GenBank." + }, + "arguments": [ + { + "name": "input_genbank", + "flag": "-i", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Input genome file (FASTA or GenBank)." + }, + { + "name": "output_genbank", + "flag": "-o", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Output GenBank file for the extracted region." + }, + { + "name": "temp_dir", + "flag": "-t", + "kind": "option", + "value_type": "path", + "required": true, + "position": null, + "repeat": false, + "description": "Temporary directory for intermediate files." + } + ], + "inputs": [ + { + "name": "input_genbank", + "artifact_type": "genome_file", + "binding": "input_genbank", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Input file must exist." + }, + { + "name": "readable", + "status": "declared", + "description": "Input file must be readable." + } + ] + } + ], + "outputs": [ + { + "name": "output_genbank", + "artifact_type": "genbank_file", + "binding": "output_genbank", + "assertions": [ + { + "name": "created", + "status": "declared", + "description": "Output file must be created." + }, + { + "name": "valid_genbank", + "status": "declared", + "description": "Output file must be valid GenBank format." + } + ] + } + ], + "validators": [ + { + "name": "output_exists", + "artifact_type": "genbank_file", + "binding": "output_genbank", + "assertions": [ + { + "name": "exists", + "status": "declared", + "description": "Output file must exist after execution." + } + ] + } + ], + "evidence": [ + { + "id": "ev1", + "field": "executable", + "source_type": "help_text", + "locator": "https://github.com/Kalan-Lab/zol", + "excerpt": "Usage: zol-suite [-h] [--list-programs] [--version] ...", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev2", + "field": "subcommand", + "source_type": "help_text", + "locator": "https://github.com/Kalan-Lab/zol", + "excerpt": "regex Extract a genomic region (as GenBank) from a genome file (FASTA or GenBank) based on scaffold and coordinate inputs (experimental).", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": "ev3", + "field": "arguments", + "source_type": "target_interface", + "locator": "method-neutral target interface", + "excerpt": "native_binding: -i, -o, -t", + "digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "execution_plan": { + "steps": [ + { + "command": [ + "zol-suite", + "regex", + "-i", + "{input_genbank}", + "-s", + "chrTiny.1", + "-b", + "5", + "-e", + "30", + "-o", + "{output_genbank}", + "-t", + "{temp_dir}", + "--cleanup" + ], + "env": { + "ZOL_EXEC_PATH": "/225040511/miniconda3/envs/experiment1_test_pinned/zol-1.7.0-py313h0bdc4b4_0/bin" + } + } + ] + } +} \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/zol_extract_genomic_region_test.json.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/zol_extract_genomic_region_test.json.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..a8b8c87cd9f18cdc3145d5aa6d3211d81b925869 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/contract_ir/zol_extract_genomic_region_test.json.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "contract_ir", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "0eb120f41775950851d8f1509d807dc832f5b5d3ce440fa640ac0f7533101cc7", + "help_sha256": "0bcf38eaea34a68b01e14e7096179a4311e1f5714ad0d9a872991e125daebbbc", + "elapsed_seconds": 5.970691680908203, + "usage": { + "prompt_tokens": 16734, + "completion_tokens": 1162, + "total_tokens": 17896, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 16734 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "de745e58-9e5c-43e7-ab28-c781feff7676" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/abundancebin_bin_by_abundance_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/abundancebin_bin_by_abundance_test.py new file mode 100644 index 0000000000000000000000000000000000000000..aeaf83dca5df0004d01c2a100712cb41eb83db53 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/abundancebin_bin_by_abundance_test.py @@ -0,0 +1,97 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("abundancebin") + + +@mcp.tool() +def bin_by_abundance(input_fasta: str, output_log: str) -> dict: + """ + Classify the official two-genome example into two abundance bins and report + their inferred abundances and genome sizes. + + Args: + input_fasta: Path to the input FASTA file. + output_log: Path to the output log file. + """ + # Resolve paths + input_path = Path(input_fasta) + output_path = Path(output_log) + + # Create output parent directories + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "abundancebin", + "-input", + str(input_path), + "-bin_num", + "2", + "-output", + str(output_path), + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd, + } + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}: {result.stderr}" + ) + + # Parse output log to extract abundance and genome size information + # The log format is tool-specific; we attempt to extract key-value pairs + # and structured data. If parsing fails, return raw content. + metadata = { + "success": True, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_log": str(output_path), + } + + # Attempt to parse the log file for abundance and genome size info + try: + if output_path.exists(): + content = output_path.read_text() + metadata["log_content"] = content + # Simple heuristic: look for lines with "abundance" or "genome size" + # This is a placeholder; adjust based on actual tool output format. + parsed = {} + for line in content.splitlines(): + lower = line.lower() + if "abundance" in lower or "genome size" in lower: + # Try to extract key: value + if ":" in line: + key, _, value = line.partition(":") + parsed[key.strip()] = value.strip() + if parsed: + metadata["parsed"] = parsed + except Exception as e: + metadata["parse_error"] = str(e) + + return metadata + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/abundancebin_bin_by_abundance_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/abundancebin_bin_by_abundance_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..472ad765f53e239ed38deea1cf3a9be714604236 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/abundancebin_bin_by_abundance_test.py.raw.txt @@ -0,0 +1,99 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("abundancebin") + + +@mcp.tool() +def bin_by_abundance(input_fasta: str, output_log: str) -> dict: + """ + Classify the official two-genome example into two abundance bins and report + their inferred abundances and genome sizes. + + Args: + input_fasta: Path to the input FASTA file. + output_log: Path to the output log file. + """ + # Resolve paths + input_path = Path(input_fasta) + output_path = Path(output_log) + + # Create output parent directories + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "abundancebin", + "-input", + str(input_path), + "-bin_num", + "2", + "-output", + str(output_path), + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd, + } + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}: {result.stderr}" + ) + + # Parse output log to extract abundance and genome size information + # The log format is tool-specific; we attempt to extract key-value pairs + # and structured data. If parsing fails, return raw content. + metadata = { + "success": True, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_log": str(output_path), + } + + # Attempt to parse the log file for abundance and genome size info + try: + if output_path.exists(): + content = output_path.read_text() + metadata["log_content"] = content + # Simple heuristic: look for lines with "abundance" or "genome size" + # This is a placeholder; adjust based on actual tool output format. + parsed = {} + for line in content.splitlines(): + lower = line.lower() + if "abundance" in lower or "genome size" in lower: + # Try to extract key: value + if ":" in line: + key, _, value = line.partition(":") + parsed[key.strip()] = value.strip() + if parsed: + metadata["parsed"] = parsed + except Exception as e: + metadata["parse_error"] = str(e) + + return metadata + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/abundancebin_bin_by_abundance_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/abundancebin_bin_by_abundance_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..9be6a54c0e8b4f12449223e899cbed2b54613c69 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/abundancebin_bin_by_abundance_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "6bd5acea9a84769873f3ed8425bba26ac8c59964d20e1395b66a1e3379822558", + "elapsed_seconds": 4.05050802230835, + "usage": { + "prompt_tokens": 607, + "completion_tokens": 634, + "total_tokens": 1241, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 607 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "808e45c6-9182-4fa7-99a3-e281be4ca634" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/adapterremoval_trim_adapters_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/adapterremoval_trim_adapters_test.py new file mode 100644 index 0000000000000000000000000000000000000000..500d950a725eaef427c3314ee5d55098ebcafd55 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/adapterremoval_trim_adapters_test.py @@ -0,0 +1,88 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("adapterremoval") + +@mcp.tool() +def trim_adapters(input_fastq: str, output_fastq: str) -> dict: + """ + Trim adapter sequences from a FASTQ file using adapterremoval3. + + Args: + input_fastq: Path to input FASTQ file + output_fastq: Path to output FASTQ file + + Returns: + Dictionary with execution metadata + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_fastq)) + os.makedirs(output_dir, exist_ok=True) + + # Build command + cmd = [ + "adapterremoval3", + "--in-file1", + input_fastq, + "--out-file1", + output_fastq, + "--adapter1", + "ACGTTGCA", + "--min-length", + "1", + "--threads", + "1" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "adapterremoval3 executable not found", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"adapterremoval3 exited with code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Check if output file was created + if not os.path.exists(output_fastq): + return { + "success": False, + "error": "Output file was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "adapter": "ACGTTGCA", + "min_length": 1, + "threads": 1, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/adapterremoval_trim_adapters_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/adapterremoval_trim_adapters_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..89add6a76b4d7f960d81db1a4228bfbf0c934aa0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/adapterremoval_trim_adapters_test.py.raw.txt @@ -0,0 +1,90 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("adapterremoval") + +@mcp.tool() +def trim_adapters(input_fastq: str, output_fastq: str) -> dict: + """ + Trim adapter sequences from a FASTQ file using adapterremoval3. + + Args: + input_fastq: Path to input FASTQ file + output_fastq: Path to output FASTQ file + + Returns: + Dictionary with execution metadata + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_fastq)) + os.makedirs(output_dir, exist_ok=True) + + # Build command + cmd = [ + "adapterremoval3", + "--in-file1", + input_fastq, + "--out-file1", + output_fastq, + "--adapter1", + "ACGTTGCA", + "--min-length", + "1", + "--threads", + "1" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "adapterremoval3 executable not found", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"adapterremoval3 exited with code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Check if output file was created + if not os.path.exists(output_fastq): + return { + "success": False, + "error": "Output file was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "adapter": "ACGTTGCA", + "min_length": 1, + "threads": 1, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/adapterremoval_trim_adapters_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/adapterremoval_trim_adapters_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..50728722c5d57d5f8de4b76c565435980f41f0e8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/adapterremoval_trim_adapters_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "4120131ff37e4258f18712e889b8f0c03c6ef8f5aecceaa3ce8a97c08197a21f", + "elapsed_seconds": 8.196411848068237, + "usage": { + "prompt_tokens": 7663, + "completion_tokens": 558, + "total_tokens": 8221, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7663 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "134140d6-94a0-4be3-a3c8-dccf7863413a" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/alfred_pairwise_align_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/alfred_pairwise_align_test.py new file mode 100644 index 0000000000000000000000000000000000000000..9e5a59e9653feb541854227d40f1674463cfee48 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/alfred_pairwise_align_test.py @@ -0,0 +1,92 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("alfred") + + +@mcp.tool() +def pairwise_align(sequence_a: str, sequence_b: str, output_alignment: str) -> dict: + """ + Perform pairwise alignment of two sequences using alfred pwalign. + + Args: + sequence_a: Path to the first sequence file (FASTA/FASTQ) + sequence_b: Path to the second sequence file (FASTA/FASTQ) + output_alignment: Path where the alignment output will be written + + Returns: + JSON-serializable metadata about the alignment operation + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_alignment) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command according to the execution plan + cmd = [ + "alfred", + "pwalign", + "-f", + "h", + "-a", + output_alignment, + sequence_a, + sequence_b + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"alfred pwalign failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Check that the output file was created + if not output_path.exists(): + raise RuntimeError( + f"alfred pwalign did not create the expected output file: {output_alignment}" + ) + + # Return structured metadata + return { + "status": "success", + "endpoint": "pairwise_align", + "tool": "alfred", + "version": "0.6.2", + "subcommand": "pwalign", + "inputs": { + "sequence_a": sequence_a, + "sequence_b": sequence_b + }, + "outputs": { + "output_alignment": output_alignment + }, + "alignment_format": "horizontal", + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError( + "alfred executable not found. Please ensure alfred is installed and in PATH." + ) + except subprocess.SubprocessError as e: + raise RuntimeError(f"Failed to execute alfred pwalign: {str(e)}") + except Exception as e: + raise RuntimeError(f"Unexpected error during pairwise alignment: {str(e)}") + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/alfred_pairwise_align_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/alfred_pairwise_align_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..a216c7e63894b9f3a4820984c3013bdaa8ddc368 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/alfred_pairwise_align_test.py.raw.txt @@ -0,0 +1,94 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("alfred") + + +@mcp.tool() +def pairwise_align(sequence_a: str, sequence_b: str, output_alignment: str) -> dict: + """ + Perform pairwise alignment of two sequences using alfred pwalign. + + Args: + sequence_a: Path to the first sequence file (FASTA/FASTQ) + sequence_b: Path to the second sequence file (FASTA/FASTQ) + output_alignment: Path where the alignment output will be written + + Returns: + JSON-serializable metadata about the alignment operation + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_alignment) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command according to the execution plan + cmd = [ + "alfred", + "pwalign", + "-f", + "h", + "-a", + output_alignment, + sequence_a, + sequence_b + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"alfred pwalign failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Check that the output file was created + if not output_path.exists(): + raise RuntimeError( + f"alfred pwalign did not create the expected output file: {output_alignment}" + ) + + # Return structured metadata + return { + "status": "success", + "endpoint": "pairwise_align", + "tool": "alfred", + "version": "0.6.2", + "subcommand": "pwalign", + "inputs": { + "sequence_a": sequence_a, + "sequence_b": sequence_b + }, + "outputs": { + "output_alignment": output_alignment + }, + "alignment_format": "horizontal", + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError( + "alfred executable not found. Please ensure alfred is installed and in PATH." + ) + except subprocess.SubprocessError as e: + raise RuntimeError(f"Failed to execute alfred pwalign: {str(e)}") + except Exception as e: + raise RuntimeError(f"Unexpected error during pairwise alignment: {str(e)}") + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/alfred_pairwise_align_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/alfred_pairwise_align_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..edd6bf06966d5e02284e011cc647b198a53a9aff --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/alfred_pairwise_align_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "6d8d187b48a006c14e218295c5c93f295f3c950c3ffbbab70c6e82e0f57a3131", + "elapsed_seconds": 4.342939853668213, + "usage": { + "prompt_tokens": 9637, + "completion_tokens": 614, + "total_tokens": 10251, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9637 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "959e416f-e447-47f7-9cde-d9d2c16ea7b9" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ariba_prepare_reference_database_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ariba_prepare_reference_database_test.py new file mode 100644 index 0000000000000000000000000000000000000000..11d43b3d8ac2fa8eba86bf3d34b26f8bc1de5da2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ariba_prepare_reference_database_test.py @@ -0,0 +1,80 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("ariba") + +@mcp.tool() +def prepare_reference_database(input_fasta: str, output_dir: str) -> dict: + """ + Validate two coding reference genes and place each into its own stable cluster without external downloads. + + Args: + input_fasta: Path to input FASTA file of reference sequences + output_dir: Path to output directory for prepared reference data + """ + # Create output parent directories + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "ariba", + "prepareref", + "-f", + input_fasta, + "--all_coding", + "yes", + "--no_cdhit", + "--threads", + "1", + "--force", + output_dir + ] + + # Set environment with PATH_PREPEND + env = os.environ.copy() + path_prepend = "/225040511/miniconda3/pkgs/mummer-3.23-pl5321h503566f_21/bin" + if path_prepend: + env["PATH"] = path_prepend + os.pathsep + env.get("PATH", "") + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": str(output_path), + "input_fasta": input_fasta + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ariba_prepare_reference_database_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ariba_prepare_reference_database_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..b8edcdda04892153b5e444f5ea42b935e8649982 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ariba_prepare_reference_database_test.py.raw.txt @@ -0,0 +1,82 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("ariba") + +@mcp.tool() +def prepare_reference_database(input_fasta: str, output_dir: str) -> dict: + """ + Validate two coding reference genes and place each into its own stable cluster without external downloads. + + Args: + input_fasta: Path to input FASTA file of reference sequences + output_dir: Path to output directory for prepared reference data + """ + # Create output parent directories + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "ariba", + "prepareref", + "-f", + input_fasta, + "--all_coding", + "yes", + "--no_cdhit", + "--threads", + "1", + "--force", + output_dir + ] + + # Set environment with PATH_PREPEND + env = os.environ.copy() + path_prepend = "/225040511/miniconda3/pkgs/mummer-3.23-pl5321h503566f_21/bin" + if path_prepend: + env["PATH"] = path_prepend + os.pathsep + env.get("PATH", "") + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": str(output_path), + "input_fasta": input_fasta + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ariba_prepare_reference_database_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ariba_prepare_reference_database_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..debd9b5ee9e1cfab0312923285a440d2d9bef111 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ariba_prepare_reference_database_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "1814c548c059f8fa2e8cf056eec025bd415582a430a7d381f2aa5b421ce199db", + "elapsed_seconds": 3.763641119003296, + "usage": { + "prompt_tokens": 13801, + "completion_tokens": 516, + "total_tokens": 14317, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 13801 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "555d2643-688c-4635-861b-568e09539008" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/atropos_trim_adapters_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/atropos_trim_adapters_test.py new file mode 100644 index 0000000000000000000000000000000000000000..80e0949b6e2313ac9eea3859b05303ac2b6fd8b9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/atropos_trim_adapters_test.py @@ -0,0 +1,98 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("atropos") + +@mcp.tool() +def trim_adapters(input_fastq: str, output_fastq: str) -> dict: + """ + Trim adapters from high-throughput sequencing reads using atropos. + + Args: + input_fastq: Path to input FASTQ file (single-end) + output_fastq: Path to output FASTQ file + + Returns: + JSON-serializable metadata about the operation + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_fastq) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command according to the execution plan + command = [ + "atropos", + "trim", + "-se", + input_fastq, + "-o", + output_fastq, + "-a", + "ACGTTGCA", + "--threads", + "2", + "--minimum-length", + "1" + ] + + # Execute the command + try: + result = subprocess.run( + command, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "atropos executable not found in PATH", + "command": command + } + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": command + } + + # Check for non-zero exit code + if result.returncode != 0: + return { + "success": False, + "error": f"atropos exited with code {result.returncode}", + "stderr": result.stderr, + "stdout": result.stdout, + "command": command + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": "Output file was not created", + "command": command + } + + # Return structured metadata + return { + "success": True, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "adapter": "ACGTTGCA", + "threads": 2, + "minimum_length": 1, + "command": command, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": output_path.stat().st_size + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/atropos_trim_adapters_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/atropos_trim_adapters_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..251348e3518a8823f810980f72e2bc9bd47732f6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/atropos_trim_adapters_test.py.raw.txt @@ -0,0 +1,100 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("atropos") + +@mcp.tool() +def trim_adapters(input_fastq: str, output_fastq: str) -> dict: + """ + Trim adapters from high-throughput sequencing reads using atropos. + + Args: + input_fastq: Path to input FASTQ file (single-end) + output_fastq: Path to output FASTQ file + + Returns: + JSON-serializable metadata about the operation + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_fastq) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command according to the execution plan + command = [ + "atropos", + "trim", + "-se", + input_fastq, + "-o", + output_fastq, + "-a", + "ACGTTGCA", + "--threads", + "2", + "--minimum-length", + "1" + ] + + # Execute the command + try: + result = subprocess.run( + command, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "atropos executable not found in PATH", + "command": command + } + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": command + } + + # Check for non-zero exit code + if result.returncode != 0: + return { + "success": False, + "error": f"atropos exited with code {result.returncode}", + "stderr": result.stderr, + "stdout": result.stdout, + "command": command + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": "Output file was not created", + "command": command + } + + # Return structured metadata + return { + "success": True, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "adapter": "ACGTTGCA", + "threads": 2, + "minimum_length": 1, + "command": command, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": output_path.stat().st_size + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/atropos_trim_adapters_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/atropos_trim_adapters_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..3f5345269133a0ef408973d460566ae938a4d66d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/atropos_trim_adapters_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "c7b349fbfb03947f181a49bed2b8418587d1056488e044d192bc95abdd74bb37", + "elapsed_seconds": 6.072911977767944, + "usage": { + "prompt_tokens": 9529, + "completion_tokens": 610, + "total_tokens": 10139, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9529 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "72e1a5a2-63e3-4e9d-8755-7053d9599f1a" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bamtools_bam_to_sam_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bamtools_bam_to_sam_test.py new file mode 100644 index 0000000000000000000000000000000000000000..c540f5d4276fe237e3146ccdf097313f07df4730 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bamtools_bam_to_sam_test.py @@ -0,0 +1,59 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("bamtools") + +@mcp.tool() +def bam_to_sam(input_bam: str, output_sam: str) -> dict: + """ + Convert a BAM file to SAM format using bamtools convert. + + Args: + input_bam: Path to input BAM file + output_sam: Path to output SAM file + """ + # Create output parent directory if needed + output_path = Path(output_sam) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "bamtools", + "convert", + "-in", + input_bam, + "-format", + "sam", + "-out", + output_sam + ] + + # Execute command without shell + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"bamtools convert failed with exit code {result.returncode}: " + f"{result.stderr}" + ) + + # Return structured metadata + return { + "endpoint": "bam_to_sam", + "input_bam": input_bam, + "output_sam": output_sam, + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_exists": output_path.exists(), + "output_size_bytes": output_path.stat().st_size if output_path.exists() else 0 + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bamtools_bam_to_sam_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bamtools_bam_to_sam_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..29a79a98b47343520f8c08b5cbd492762365621d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bamtools_bam_to_sam_test.py.raw.txt @@ -0,0 +1,61 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("bamtools") + +@mcp.tool() +def bam_to_sam(input_bam: str, output_sam: str) -> dict: + """ + Convert a BAM file to SAM format using bamtools convert. + + Args: + input_bam: Path to input BAM file + output_sam: Path to output SAM file + """ + # Create output parent directory if needed + output_path = Path(output_sam) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "bamtools", + "convert", + "-in", + input_bam, + "-format", + "sam", + "-out", + output_sam + ] + + # Execute command without shell + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"bamtools convert failed with exit code {result.returncode}: " + f"{result.stderr}" + ) + + # Return structured metadata + return { + "endpoint": "bam_to_sam", + "input_bam": input_bam, + "output_sam": output_sam, + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_exists": output_path.exists(), + "output_size_bytes": output_path.stat().st_size if output_path.exists() else 0 + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bamtools_bam_to_sam_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bamtools_bam_to_sam_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..df163ad20b997e9003a2dde29c3ded0a9ff39428 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bamtools_bam_to_sam_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "2db618f0de0b210da769e62bed8eb80b0a9bc0f53c8642fe74be371255e1df43", + "elapsed_seconds": 2.5137531757354736, + "usage": { + "prompt_tokens": 705, + "completion_tokens": 386, + "total_tokens": 1091, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 705 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "9e02c793-b6ad-4bc5-af02-c3959f22d8ad" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/batch_summary.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/batch_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..26e6d487e42d0a650a70b73c68a5f67d6f395925 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/batch_summary.json @@ -0,0 +1,685 @@ +{ + "mode": "direct_prompt", + "backend": { + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "api_key_env": "DEEPSEEK_API_KEY", + "thinking": "disabled", + "temperature": 0.1, + "max_output_tokens": 16384 + }, + "total": 133, + "ok": 133, + "failed": 0, + "rows": [ + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/abundancebin.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/abundancebin_bin_by_abundance_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/adapterremoval.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/adapterremoval_trim_adapters_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/alfred.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/alfred_pairwise_align_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ariba.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ariba_prepare_reference_database_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/atropos.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/atropos_trim_adapters_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/bamtools.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/bamtools_bam_to_sam_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/bcbio-nextgen.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/bcbio-nextgen_build_sample_configuration_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/bedops.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/bedops_intersect_bed_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/bedtools.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/bedtools_intersect_bed_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/biobambam.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/biobambam_sort_bam_to_sam_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/blast-legacy.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/blast-legacy_blastn_search_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/busco.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/busco_assess_bacterial_genome_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/bx-python.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/bx-python_intersect_intervals_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/cd-hit.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/cd-hit_cluster_proteins_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/cdbtools.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/cdbtools_extract_fasta_record_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/cell2cell.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/cell2cell_preprocess_expression_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/checkm-genome.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/checkm-genome_assess_bin_quality_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/circexplorer2.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/circexplorer2_parse_star_junctions_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/clustalo.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/clustalo_align_proteins_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/clustalw.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/clustalw_align_proteins_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/cmappy.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/cmappy_parse_gct_matrix_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/comet-ms.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/comet-ms_search_tandem_mass_spectrum_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/cooltools.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/cooltools_binnify_genome_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/crispritz.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/crispritz_score_off_targets_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/cutadapt.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/cutadapt_trim_front_adapter_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/cyvcf2.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/cyvcf2_read_vcf_records_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ddocent.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ddocent_quality_trim_rad_reads_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/deeptools.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/deeptools_bam_coverage_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/deeptoolsintervals.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/deeptoolsintervals_query_intervals_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/dropkick.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/dropkick_filter_cells_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/emboss.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/emboss_convert_fasta_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/entrez-direct.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/entrez-direct_extract_assembly_metadata_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/epic.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/epic_call_diffuse_peaks_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/f5c.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/f5c_merge_methylation_frequencies_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/famsa.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/famsa_align_proteins_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/fastani.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/fastani_compute_ani_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/fastp.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/fastp_preprocess_reads_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/flye.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/flye_assemble_hifi_reads_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/freebayes.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/freebayes_call_variants_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/genoboo.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/genoboo_launch_local_notebook_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/genometools-genometools.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/genometools-genometools_sort_gff3_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/gffread.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/gffread_extract_transcripts_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/gffutils.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/gffutils_build_feature_database_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/gimmemotifs.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/gimmemotifs_scan_custom_motif_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/goleft.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/goleft_bam_sample_name_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/gseapy.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/gseapy_prerank_gene_sets_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/gtdbtk.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/gtdbtk_identify_and_align_genome_markers_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/hicexplorer.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/hicexplorer_find_restriction_sites_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/hmmer.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/hmmer_build_protein_hmm_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/htseq.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/htseq_count_reads_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/htslib.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/htslib_bgzip_compress_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/humann2.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/humann2_renormalize_gene_families_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/illumina-interop.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/illumina-interop_dump_q_metrics_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/infernal.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/infernal_build_and_align_cm_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/intarna.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/intarna_predict_rna_interaction_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ipython-cluster-helper.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ipython-cluster-helper_normalize_scheduler_resources_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/iqtree.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/iqtree_infer_protein_tree_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/itsxpress.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/itsxpress_trim_fungal_its_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ivar.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ivar_consensus_from_pileup_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/kallisto.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/kallisto_build_transcript_index_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/kmc.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/kmc_count_kmers_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/krona.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/krona_taxonomy_chart_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/last.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/last_align_dna_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/locarna.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/locarna_align_rna_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/macs2.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/macs2_call_narrow_peak_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/mageck.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/mageck_count_sgrna_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/mash.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/mash_sketch_fasta_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/maxquant.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/maxquant_create_parameter_template_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/medaka.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/medaka_vcf_to_tsv_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/metagenome-atlas.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/metagenome-atlas_initialize_project_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/mikado.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/mikado_configure_workflow_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/miniasm.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/miniasm_assemble_overlap_graph_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/minimap2.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/minimap2_align_dna_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/minvar.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/minvar_estimate_minimum_read_length_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/mosdepth.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/mosdepth_coverage_summary_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/mothur.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/mothur_summarize_sequences_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/msisensor-pro.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/msisensor-pro_scan_microsatellites_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/msstitch.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/msstitch_build_sequence_searchspace_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/muscle.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/muscle_align_proteins_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/nanopolish.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/nanopolish_index_and_check_fast5_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ncbi-genome-download.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ncbi-genome-download_select_assembly_dry_run_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/nextalign.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/nextalign_align_nucleotides_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/nextclade.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/nextclade_analyze_sequence_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ngmlr.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ngmlr_align_long_reads_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ont-fast5-api.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ont-fast5-api_summarize_single_read_fast5_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/orthofinder.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/orthofinder_infer_orthogroups_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/paml.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/paml_pairwise_dn_ds_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/parasail-python.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/parasail-python_global_align_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/picard.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/picard_sort_sam_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/portcullis.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/portcullis_prepare_splice_inputs_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/prank.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/prank_align_proteins_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/prophyle.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/prophyle_index_and_classify_reads_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/pyfastx.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/pyfastx_fasta_statistics_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/pyranges.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/pyranges_merge_genomic_ranges_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/pyrodigal.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/pyrodigal_predict_genes_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/pysam.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/pysam_summarize_bam_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/python-edlib.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/python-edlib_global_align_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/raxml.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/raxml_infer_protein_tree_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/rgi.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/rgi_remove_duplicate_prevalence_sequences_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/rnastructure.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/rnastructure_fold_rna_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/rust-bio-tools.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/rust-bio-tools_fastq_sequence_stats_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/samblaster.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/samblaster_mark_duplicates_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/samsift.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/samsift_filter_alignments_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/segemehl.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/segemehl_index_and_align_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/sentieon.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/sentieon_index_reference_with_bwa_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/seqcluster.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/seqcluster_collapse_small_rna_reads_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/slow5tools.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/slow5tools_signal_stats_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/sourmash.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/sourmash_compute_signature_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/spades.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/spades_assemble_paired_reads_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/stringtie.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/stringtie_assemble_transcripts_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/subread.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/subread_count_features_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/tabixpp.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/tabixpp_query_vcf_region_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/taxonkit.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/taxonkit_create_taxdump_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/tidyp.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/tidyp_tidy_html_test.py", + "status": "ok", + "returncode": 0, + "stdout": "{\"output\": \"runs/v4_flash_formal_133_20260826/direct_prompt/tidyp_tidy_html_test.py\", \"model\": \"deepseek-v4-flash\", \"parse_errors\": [], \"usage\": {\"prompt_tokens\": 678, \"completion_tokens\": 512, \"total_tokens\": 1190, \"prompt_tokens_details\": {\"cached_tokens\": 640}, \"prompt_cache_hit_tokens\": 640, \"prompt_cache_miss_tokens\": 38}}\n", + "stderr": "" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/tmalign.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/tmalign_align_structures_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/treetime.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/treetime_ancestral_reconstruction_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/trim-galore.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/trim-galore_trim_adapters_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/trimadap.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/trimadap_trim_adapter_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/trnascan-se.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/trnascan-se_scan_trna_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ucsc-bedtobigbed.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-bedtobigbed_bed_to_bigbed_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ucsc-fatotwobit.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-fatotwobit_fasta_to_twobit_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ucsc-gtftogenepred.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-gtftogenepred_gtf_to_genepred_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ucsc-liftover.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-liftover_lift_bed_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ucsc-nibfrag.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-nibfrag_extract_nib_fragment_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ucsc-twobitinfo.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobitinfo_twobit_info_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/ucsc-twobittofa.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobittofa_twobit_to_fasta_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/umis.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/umis_csv_to_sparse_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/unicycler.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/unicycler_assemble_paired_reads_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/unifrac.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/unifrac_unweighted_distance_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/vt.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/vt_normalize_vcf_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/wasp2.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/wasp2_find_allelic_imbalance_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/whatshap.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/whatshap_phasing_stats_test.py", + "status": "skipped_existing" + }, + { + "item": "runs/v4_flash_formal_133_20260826/generation_items/zol.json", + "output": "runs/v4_flash_formal_133_20260826/direct_prompt/zol_extract_genomic_region_test.py", + "status": "skipped_existing" + } + ] +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bcbio-nextgen_build_sample_configuration_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bcbio-nextgen_build_sample_configuration_test.py new file mode 100644 index 0000000000000000000000000000000000000000..78639deba4c8c3ce438cbca3b63e2b06bae90929 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bcbio-nextgen_build_sample_configuration_test.py @@ -0,0 +1,85 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("bcbio-nextgen") + +@mcp.tool() +def build_sample_configuration( + template_yaml: str, + metadata_csv: str, + input_fastq: str, + output_root: str +) -> dict: + """ + Generate a one-sample RNA-seq configuration from local template, metadata, and FASTQ. + + Args: + template_yaml: Path to the template YAML configuration file + metadata_csv: Path to the metadata CSV file + input_fastq: Path to the input FASTQ file(s) + output_root: Working directory for the output + + Returns: + Dictionary with execution metadata including paths and status + """ + # Create output directory if it doesn't exist + output_dir = Path(output_root) + output_dir.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "bcbio_nextgen.py", + "-w", + "template", + template_yaml, + metadata_csv, + input_fastq + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + cwd=str(output_dir), + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"bcbio_nextgen.py failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Determine the output configuration file path + # bcbio-nextgen template creates a config file in the working directory + # based on the metadata CSV name + config_name = Path(metadata_csv).stem + ".yaml" + config_path = output_dir / "config" / config_name + + return { + "status": "success", + "command": " ".join(cmd), + "working_directory": str(output_dir), + "template_yaml": template_yaml, + "metadata_csv": metadata_csv, + "input_fastq": input_fastq, + "output_config": str(config_path), + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("bcbio_nextgen.py executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing bcbio_nextgen.py: {str(e)}") + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bcbio-nextgen_build_sample_configuration_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bcbio-nextgen_build_sample_configuration_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..f32be9c6126d8236b57f71c0f75d9c568ba90fe4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bcbio-nextgen_build_sample_configuration_test.py.raw.txt @@ -0,0 +1,87 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("bcbio-nextgen") + +@mcp.tool() +def build_sample_configuration( + template_yaml: str, + metadata_csv: str, + input_fastq: str, + output_root: str +) -> dict: + """ + Generate a one-sample RNA-seq configuration from local template, metadata, and FASTQ. + + Args: + template_yaml: Path to the template YAML configuration file + metadata_csv: Path to the metadata CSV file + input_fastq: Path to the input FASTQ file(s) + output_root: Working directory for the output + + Returns: + Dictionary with execution metadata including paths and status + """ + # Create output directory if it doesn't exist + output_dir = Path(output_root) + output_dir.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "bcbio_nextgen.py", + "-w", + "template", + template_yaml, + metadata_csv, + input_fastq + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + cwd=str(output_dir), + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"bcbio_nextgen.py failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Determine the output configuration file path + # bcbio-nextgen template creates a config file in the working directory + # based on the metadata CSV name + config_name = Path(metadata_csv).stem + ".yaml" + config_path = output_dir / "config" / config_name + + return { + "status": "success", + "command": " ".join(cmd), + "working_directory": str(output_dir), + "template_yaml": template_yaml, + "metadata_csv": metadata_csv, + "input_fastq": input_fastq, + "output_config": str(config_path), + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("bcbio_nextgen.py executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing bcbio_nextgen.py: {str(e)}") + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bcbio-nextgen_build_sample_configuration_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bcbio-nextgen_build_sample_configuration_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..a0bc135e4e3f9ae0e559f6c94e70c6d3cc7540f7 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bcbio-nextgen_build_sample_configuration_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e89bc3f2e0a3d4b977627deec39c8af33502acd5cb162b1d518a6c13331d5271", + "elapsed_seconds": 3.639089584350586, + "usage": { + "prompt_tokens": 7887, + "completion_tokens": 575, + "total_tokens": 8462, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7887 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "48c93ed2-eab8-4252-921f-abaf526ab1b2" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedops_intersect_bed_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedops_intersect_bed_test.py new file mode 100644 index 0000000000000000000000000000000000000000..f760e6c150c4d286e52965b07e02c1dd9a343191 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedops_intersect_bed_test.py @@ -0,0 +1,81 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("bedops-intersect") + +@mcp.tool() +def intersect_bed(input_a: str, input_b: str, output_file: str) -> dict: + """ + Intersect two BED files using bedops --intersect. + + Args: + input_a: Path to first BED file (sorted per sort-bed) + input_b: Path to second BED file (sorted per sort-bed) + output_file: Path where the intersection result will be written + + Returns: + JSON-serializable metadata about the operation + """ + # Validate input paths exist + input_a_path = Path(input_a) + input_b_path = Path(input_b) + if not input_a_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_a}") + if not input_b_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_b}") + + # Create output parent directory if needed + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "bedops", + "--intersect", + str(input_a_path), + str(input_b_path) + ] + + # Execute command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("bedops executable not found in PATH. Ensure bedops 2.4.42 is installed.") + except Exception as e: + raise RuntimeError(f"Failed to execute bedops: {str(e)}") + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError(f"bedops --intersect failed with exit code {result.returncode}: {error_msg}") + + # Write stdout to output file + try: + with open(output_path, 'w') as f: + f.write(result.stdout) + except Exception as e: + raise RuntimeError(f"Failed to write output file: {str(e)}") + + # Return structured metadata + return { + "status": "success", + "command": " ".join(cmd), + "input_a": str(input_a_path), + "input_b": str(input_b_path), + "output_file": str(output_path), + "exit_code": result.returncode, + "stdout_bytes": len(result.stdout.encode('utf-8')), + "stderr": result.stderr.strip() if result.stderr else "" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedops_intersect_bed_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedops_intersect_bed_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..5975deb9d09112b1e2a711cc7954b7296c8e552b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedops_intersect_bed_test.py.raw.txt @@ -0,0 +1,83 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("bedops-intersect") + +@mcp.tool() +def intersect_bed(input_a: str, input_b: str, output_file: str) -> dict: + """ + Intersect two BED files using bedops --intersect. + + Args: + input_a: Path to first BED file (sorted per sort-bed) + input_b: Path to second BED file (sorted per sort-bed) + output_file: Path where the intersection result will be written + + Returns: + JSON-serializable metadata about the operation + """ + # Validate input paths exist + input_a_path = Path(input_a) + input_b_path = Path(input_b) + if not input_a_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_a}") + if not input_b_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_b}") + + # Create output parent directory if needed + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "bedops", + "--intersect", + str(input_a_path), + str(input_b_path) + ] + + # Execute command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("bedops executable not found in PATH. Ensure bedops 2.4.42 is installed.") + except Exception as e: + raise RuntimeError(f"Failed to execute bedops: {str(e)}") + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError(f"bedops --intersect failed with exit code {result.returncode}: {error_msg}") + + # Write stdout to output file + try: + with open(output_path, 'w') as f: + f.write(result.stdout) + except Exception as e: + raise RuntimeError(f"Failed to write output file: {str(e)}") + + # Return structured metadata + return { + "status": "success", + "command": " ".join(cmd), + "input_a": str(input_a_path), + "input_b": str(input_b_path), + "output_file": str(output_path), + "exit_code": result.returncode, + "stdout_bytes": len(result.stdout.encode('utf-8')), + "stderr": result.stderr.strip() if result.stderr else "" + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedops_intersect_bed_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedops_intersect_bed_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..8c3858fde60c1690c4a56b32316e68399dcb0bf4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedops_intersect_bed_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "c5a1f2f84f68351c7c870670064a02c23c01016c2344d0f34d666d43ea1ea558", + "elapsed_seconds": 4.5103759765625, + "usage": { + "prompt_tokens": 1156, + "completion_tokens": 621, + "total_tokens": 1777, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1156 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "00e03d5d-602e-4df8-84fa-bac19edd9fc6" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedtools_intersect_bed_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedtools_intersect_bed_test.py new file mode 100644 index 0000000000000000000000000000000000000000..cd067cb6caf4ca1e06c330778ea0d5946d9a9fd9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedtools_intersect_bed_test.py @@ -0,0 +1,80 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("bedtools") + +@mcp.tool() +def intersect_bed(input_a: str, input_b: str, output_file: str) -> dict: + """ + Find overlapping intervals between two BED files using bedtools intersect. + + Args: + input_a: Path to the first BED file (interval file A) + input_b: Path to the second BED file (interval file B) + output_file: Path where the intersection results will be written + + Returns: + Dictionary containing metadata about the operation + """ + # Validate input files exist + if not os.path.isfile(input_a): + raise FileNotFoundError(f"Input file A not found: {input_a}") + if not os.path.isfile(input_b): + raise FileNotFoundError(f"Input file B not found: {input_b}") + + # Create output directory if it doesn't exist + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command - output_file is stdout capture, so not passed to CLI + cmd = [ + "bedtools", + "intersect", + "-a", input_a, + "-b", input_b + ] + + try: + # Execute command, capture stdout + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"bedtools intersect failed with exit code {result.returncode}: " + f"{result.stderr}" + ) + + # Write stdout to output file + with open(output_file, 'w') as f: + f.write(result.stdout) + + # Count lines in output for metadata + line_count = len(result.stdout.splitlines()) if result.stdout else 0 + + return { + "status": "success", + "endpoint": "intersect_bed", + "input_a": input_a, + "input_b": input_b, + "output_file": output_file, + "line_count": line_count, + "exit_code": result.returncode, + "stderr": result.stderr if result.stderr else "" + } + + except subprocess.TimeoutExpired: + raise RuntimeError("bedtools intersect timed out") + except OSError as e: + raise RuntimeError(f"Failed to execute bedtools: {e}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedtools_intersect_bed_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedtools_intersect_bed_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..c728f14cb59d62ed5261d8155d4ce3e9aef038e4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedtools_intersect_bed_test.py.raw.txt @@ -0,0 +1,82 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("bedtools") + +@mcp.tool() +def intersect_bed(input_a: str, input_b: str, output_file: str) -> dict: + """ + Find overlapping intervals between two BED files using bedtools intersect. + + Args: + input_a: Path to the first BED file (interval file A) + input_b: Path to the second BED file (interval file B) + output_file: Path where the intersection results will be written + + Returns: + Dictionary containing metadata about the operation + """ + # Validate input files exist + if not os.path.isfile(input_a): + raise FileNotFoundError(f"Input file A not found: {input_a}") + if not os.path.isfile(input_b): + raise FileNotFoundError(f"Input file B not found: {input_b}") + + # Create output directory if it doesn't exist + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command - output_file is stdout capture, so not passed to CLI + cmd = [ + "bedtools", + "intersect", + "-a", input_a, + "-b", input_b + ] + + try: + # Execute command, capture stdout + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"bedtools intersect failed with exit code {result.returncode}: " + f"{result.stderr}" + ) + + # Write stdout to output file + with open(output_file, 'w') as f: + f.write(result.stdout) + + # Count lines in output for metadata + line_count = len(result.stdout.splitlines()) if result.stdout else 0 + + return { + "status": "success", + "endpoint": "intersect_bed", + "input_a": input_a, + "input_b": input_b, + "output_file": output_file, + "line_count": line_count, + "exit_code": result.returncode, + "stderr": result.stderr if result.stderr else "" + } + + except subprocess.TimeoutExpired: + raise RuntimeError("bedtools intersect timed out") + except OSError as e: + raise RuntimeError(f"Failed to execute bedtools: {e}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedtools_intersect_bed_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedtools_intersect_bed_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..56cbfe1218c30ca328353b35c3e0b7af0789eb3e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bedtools_intersect_bed_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e21d6cfdb591be6f1cc5e147af88b2784f2b3b3c56c14488c5309bb3864df56a", + "elapsed_seconds": 3.9048774242401123, + "usage": { + "prompt_tokens": 1322, + "completion_tokens": 574, + "total_tokens": 1896, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1322 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "a3a4b1f2-3a51-4f28-8e9c-02a3612b6448" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/biobambam_sort_bam_to_sam_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/biobambam_sort_bam_to_sam_test.py new file mode 100644 index 0000000000000000000000000000000000000000..b51bc638753c216dc69c2eed582f312cd4d85327 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/biobambam_sort_bam_to_sam_test.py @@ -0,0 +1,69 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("biobambam") + +@mcp.tool() +def sort_bam_to_sam(input_bam: str, output_sam: str) -> dict: + """ + Coordinate-sort a BAM file and render it as SAM. + + Args: + input_bam: Path to input BAM file + output_sam: Path to output SAM file + """ + # Create output parent directories + output_path = Path(output_sam) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "bamsort", + f"I={input_bam}", + f"O={output_sam}", + "inputformat=bam", + "outputformat=sam", + "SO=coordinate", + "verbose=0" + ] + + try: + # Execute command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"bamsort failed with exit code {result.returncode}: " + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_sam} was not created") + + return { + "status": "success", + "input_bam": input_bam, + "output_sam": output_sam, + "command": " ".join(cmd), + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("bamsort executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing bamsort: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/biobambam_sort_bam_to_sam_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/biobambam_sort_bam_to_sam_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..d9047bc6e9db57fa861f7ec079ec4ce3263fdb76 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/biobambam_sort_bam_to_sam_test.py.raw.txt @@ -0,0 +1,71 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("biobambam") + +@mcp.tool() +def sort_bam_to_sam(input_bam: str, output_sam: str) -> dict: + """ + Coordinate-sort a BAM file and render it as SAM. + + Args: + input_bam: Path to input BAM file + output_sam: Path to output SAM file + """ + # Create output parent directories + output_path = Path(output_sam) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "bamsort", + f"I={input_bam}", + f"O={output_sam}", + "inputformat=bam", + "outputformat=sam", + "SO=coordinate", + "verbose=0" + ] + + try: + # Execute command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"bamsort failed with exit code {result.returncode}: " + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_sam} was not created") + + return { + "status": "success", + "input_bam": input_bam, + "output_sam": output_sam, + "command": " ".join(cmd), + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("bamsort executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing bamsort: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/biobambam_sort_bam_to_sam_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/biobambam_sort_bam_to_sam_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..a335fc391a3860c7dcd14d1d0bca092f4c1ee65a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/biobambam_sort_bam_to_sam_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "0b51511462250732ab83064a6bb2a9606d13b23d6ad71b90938f9c84cf8cf226", + "elapsed_seconds": 2.7342169284820557, + "usage": { + "prompt_tokens": 6238, + "completion_tokens": 460, + "total_tokens": 6698, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6238 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "c4e1f516-3756-4f45-ab06-5f4b4eeb7cd1" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/blast-legacy_blastn_search_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/blast-legacy_blastn_search_test.py new file mode 100644 index 0000000000000000000000000000000000000000..d823b972455b9c8a31397c9b6439801cbb408685 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/blast-legacy_blastn_search_test.py @@ -0,0 +1,116 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("blast-legacy") + + +@mcp.tool() +def blastn_search( + reference_fasta: str, + query_fasta: str, + database_prefix: str, + output_hits: str, +) -> dict: + """ + Build a nucleotide database, then emit legacy BLAST tabular format 8. + + Args: + reference_fasta: Path to the reference FASTA file used to build the database. + query_fasta: Path to the query FASTA file to search. + database_prefix: Prefix for the database files created by formatdb. + output_hits: Path where the BLAST tabular output will be written. + """ + # Validate required inputs exist + ref_path = Path(reference_fasta) + query_path = Path(query_fasta) + if not ref_path.is_file(): + raise FileNotFoundError(f"Reference FASTA file not found: {reference_fasta}") + if not query_path.is_file(): + raise FileNotFoundError(f"Query FASTA file not found: {query_fasta}") + + # Create output parent directory if needed + output_path = Path(output_hits) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: formatdb -i {reference_fasta} -p F -n {database_prefix} + formatdb_cmd = [ + "formatdb", + "-i", + reference_fasta, + "-p", + "F", + "-n", + database_prefix, + ] + try: + formatdb_result = subprocess.run( + formatdb_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"formatdb executable not found: {e}") from e + + if formatdb_result.returncode != 0: + raise RuntimeError( + f"formatdb failed with exit code {formatdb_result.returncode}\n" + f"stdout: {formatdb_result.stdout}\n" + f"stderr: {formatdb_result.stderr}" + ) + + # Step 2: blastall -p blastn -d {database_prefix} -i {query_fasta} -m 8 -F F -o {output_hits} + blastall_cmd = [ + "blastall", + "-p", + "blastn", + "-d", + database_prefix, + "-i", + query_fasta, + "-m", + "8", + "-F", + "F", + "-o", + output_hits, + ] + try: + blastall_result = subprocess.run( + blastall_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"blastall executable not found: {e}") from e + + if blastall_result.returncode != 0: + raise RuntimeError( + f"blastall failed with exit code {blastall_result.returncode}\n" + f"stdout: {blastall_result.stdout}\n" + f"stderr: {blastall_result.stderr}" + ) + + # Verify output file was created + if not output_path.is_file(): + raise RuntimeError(f"Expected output file was not created: {output_hits}") + + # Return structured metadata + return { + "endpoint": "blastn_search", + "status": "success", + "reference_fasta": reference_fasta, + "query_fasta": query_fasta, + "database_prefix": database_prefix, + "output_hits": output_hits, + "formatdb_exit_code": formatdb_result.returncode, + "blastall_exit_code": blastall_result.returncode, + "formatdb_stdout": formatdb_result.stdout, + "formatdb_stderr": formatdb_result.stderr, + "blastall_stdout": blastall_result.stdout, + "blastall_stderr": blastall_result.stderr, + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/blast-legacy_blastn_search_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/blast-legacy_blastn_search_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..f78bcfd94e743af42ad1858474727d164066af61 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/blast-legacy_blastn_search_test.py.raw.txt @@ -0,0 +1,118 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("blast-legacy") + + +@mcp.tool() +def blastn_search( + reference_fasta: str, + query_fasta: str, + database_prefix: str, + output_hits: str, +) -> dict: + """ + Build a nucleotide database, then emit legacy BLAST tabular format 8. + + Args: + reference_fasta: Path to the reference FASTA file used to build the database. + query_fasta: Path to the query FASTA file to search. + database_prefix: Prefix for the database files created by formatdb. + output_hits: Path where the BLAST tabular output will be written. + """ + # Validate required inputs exist + ref_path = Path(reference_fasta) + query_path = Path(query_fasta) + if not ref_path.is_file(): + raise FileNotFoundError(f"Reference FASTA file not found: {reference_fasta}") + if not query_path.is_file(): + raise FileNotFoundError(f"Query FASTA file not found: {query_fasta}") + + # Create output parent directory if needed + output_path = Path(output_hits) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: formatdb -i {reference_fasta} -p F -n {database_prefix} + formatdb_cmd = [ + "formatdb", + "-i", + reference_fasta, + "-p", + "F", + "-n", + database_prefix, + ] + try: + formatdb_result = subprocess.run( + formatdb_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"formatdb executable not found: {e}") from e + + if formatdb_result.returncode != 0: + raise RuntimeError( + f"formatdb failed with exit code {formatdb_result.returncode}\n" + f"stdout: {formatdb_result.stdout}\n" + f"stderr: {formatdb_result.stderr}" + ) + + # Step 2: blastall -p blastn -d {database_prefix} -i {query_fasta} -m 8 -F F -o {output_hits} + blastall_cmd = [ + "blastall", + "-p", + "blastn", + "-d", + database_prefix, + "-i", + query_fasta, + "-m", + "8", + "-F", + "F", + "-o", + output_hits, + ] + try: + blastall_result = subprocess.run( + blastall_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"blastall executable not found: {e}") from e + + if blastall_result.returncode != 0: + raise RuntimeError( + f"blastall failed with exit code {blastall_result.returncode}\n" + f"stdout: {blastall_result.stdout}\n" + f"stderr: {blastall_result.stderr}" + ) + + # Verify output file was created + if not output_path.is_file(): + raise RuntimeError(f"Expected output file was not created: {output_hits}") + + # Return structured metadata + return { + "endpoint": "blastn_search", + "status": "success", + "reference_fasta": reference_fasta, + "query_fasta": query_fasta, + "database_prefix": database_prefix, + "output_hits": output_hits, + "formatdb_exit_code": formatdb_result.returncode, + "blastall_exit_code": blastall_result.returncode, + "formatdb_stdout": formatdb_result.stdout, + "formatdb_stderr": formatdb_result.stderr, + "blastall_stdout": blastall_result.stdout, + "blastall_stderr": blastall_result.stderr, + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/blast-legacy_blastn_search_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/blast-legacy_blastn_search_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..31b836517a46371b67c6babae7a69bbd3d451f4f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/blast-legacy_blastn_search_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "6cd18dea77e3582139d1b2a32a3e43d75fa9d90662fffb0d99c8152ea86354ad", + "elapsed_seconds": 7.275381326675415, + "usage": { + "prompt_tokens": 3363, + "completion_tokens": 889, + "total_tokens": 4252, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 3363 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "eb506631-caad-4217-b8e7-23e9a5f522e1" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/busco_assess_bacterial_genome_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/busco_assess_bacterial_genome_test.py new file mode 100644 index 0000000000000000000000000000000000000000..66dc093961e71165e2a53a74ab0418f2681c66a5 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/busco_assess_bacterial_genome_test.py @@ -0,0 +1,115 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("busco") + +@mcp.tool() +def assess_bacterial_genome( + input_fasta: str, + lineage_dir: str, + run_dir: str, + output_tsv: str +) -> dict: + """ + Assess completeness of a pinned bacterial genome against a local BUSCO lineage with two CPUs in offline mode. + """ + # Create output parent directories + Path(run_dir).mkdir(parents=True, exist_ok=True) + Path(output_tsv).parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run BUSCO + busco_cmd = [ + "busco", + "-i", input_fasta, + "-l", lineage_dir, + "-o", "ecoli_busco", + "-m", "genome", + "-c", "2", + "--offline", + "--out_path", run_dir + ] + + try: + result1 = subprocess.run( + busco_cmd, + capture_output=True, + text=True, + check=False + ) + if result1.returncode != 0: + raise RuntimeError( + f"BUSCO failed with exit code {result1.returncode}\n" + f"stdout: {result1.stdout}\n" + f"stderr: {result1.stderr}" + ) + except FileNotFoundError as e: + raise RuntimeError(f"BUSCO executable not found: {e}") + + # Step 2: Normalize BUSCO summary + summary_file = os.path.join(run_dir, "ecoli_busco", "short_summary.specific.bacteria_odb10.ecoli_busco.txt") + + if not os.path.exists(summary_file): + raise RuntimeError(f"BUSCO summary file not found: {summary_file}") + + # Parse the summary file and write normalized TSV + try: + with open(summary_file, 'r') as f: + content = f.read() + + # Parse BUSCO summary format + lines = content.strip().split('\n') + data = {} + + for line in lines: + line = line.strip() + if line.startswith('#') or not line: + continue + + # Look for key-value patterns like "C:95.2%[S:90.1%,D:5.1%],F:2.3%,M:2.5%,n:124" + if 'C:' in line and 'S:' in line and 'D:' in line and 'F:' in line and 'M:' in line and 'n:' in line: + # Extract percentages + import re + c_match = re.search(r'C:([\d.]+)%', line) + s_match = re.search(r'S:([\d.]+)%', line) + d_match = re.search(r'D:([\d.]+)%', line) + f_match = re.search(r'F:([\d.]+)%', line) + m_match = re.search(r'M:([\d.]+)%', line) + n_match = re.search(r'n:(\d+)', line) + + if all([c_match, s_match, d_match, f_match, m_match, n_match]): + data = { + 'Complete': float(c_match.group(1)), + 'Single_copy': float(s_match.group(1)), + 'Duplicated': float(d_match.group(1)), + 'Fragmented': float(f_match.group(1)), + 'Missing': float(m_match.group(1)), + 'Total_BUSCOs': int(n_match.group(1)) + } + break + + if not data: + raise RuntimeError(f"Could not parse BUSCO summary from {summary_file}") + + # Write TSV + with open(output_tsv, 'w') as f: + f.write("Metric\tValue\n") + for key, value in data.items(): + f.write(f"{key}\t{value}\n") + + except Exception as e: + raise RuntimeError(f"Failed to normalize BUSCO summary: {e}") + + return { + "status": "success", + "input_fasta": input_fasta, + "lineage_dir": lineage_dir, + "run_dir": run_dir, + "output_tsv": output_tsv, + "busco_output_dir": os.path.join(run_dir, "ecoli_busco"), + "summary_file": summary_file, + "metrics": data + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/busco_assess_bacterial_genome_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/busco_assess_bacterial_genome_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..9fa2d3be0d0b5b6168b1bfe30adef4ecd3c2a60b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/busco_assess_bacterial_genome_test.py.raw.txt @@ -0,0 +1,117 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("busco") + +@mcp.tool() +def assess_bacterial_genome( + input_fasta: str, + lineage_dir: str, + run_dir: str, + output_tsv: str +) -> dict: + """ + Assess completeness of a pinned bacterial genome against a local BUSCO lineage with two CPUs in offline mode. + """ + # Create output parent directories + Path(run_dir).mkdir(parents=True, exist_ok=True) + Path(output_tsv).parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run BUSCO + busco_cmd = [ + "busco", + "-i", input_fasta, + "-l", lineage_dir, + "-o", "ecoli_busco", + "-m", "genome", + "-c", "2", + "--offline", + "--out_path", run_dir + ] + + try: + result1 = subprocess.run( + busco_cmd, + capture_output=True, + text=True, + check=False + ) + if result1.returncode != 0: + raise RuntimeError( + f"BUSCO failed with exit code {result1.returncode}\n" + f"stdout: {result1.stdout}\n" + f"stderr: {result1.stderr}" + ) + except FileNotFoundError as e: + raise RuntimeError(f"BUSCO executable not found: {e}") + + # Step 2: Normalize BUSCO summary + summary_file = os.path.join(run_dir, "ecoli_busco", "short_summary.specific.bacteria_odb10.ecoli_busco.txt") + + if not os.path.exists(summary_file): + raise RuntimeError(f"BUSCO summary file not found: {summary_file}") + + # Parse the summary file and write normalized TSV + try: + with open(summary_file, 'r') as f: + content = f.read() + + # Parse BUSCO summary format + lines = content.strip().split('\n') + data = {} + + for line in lines: + line = line.strip() + if line.startswith('#') or not line: + continue + + # Look for key-value patterns like "C:95.2%[S:90.1%,D:5.1%],F:2.3%,M:2.5%,n:124" + if 'C:' in line and 'S:' in line and 'D:' in line and 'F:' in line and 'M:' in line and 'n:' in line: + # Extract percentages + import re + c_match = re.search(r'C:([\d.]+)%', line) + s_match = re.search(r'S:([\d.]+)%', line) + d_match = re.search(r'D:([\d.]+)%', line) + f_match = re.search(r'F:([\d.]+)%', line) + m_match = re.search(r'M:([\d.]+)%', line) + n_match = re.search(r'n:(\d+)', line) + + if all([c_match, s_match, d_match, f_match, m_match, n_match]): + data = { + 'Complete': float(c_match.group(1)), + 'Single_copy': float(s_match.group(1)), + 'Duplicated': float(d_match.group(1)), + 'Fragmented': float(f_match.group(1)), + 'Missing': float(m_match.group(1)), + 'Total_BUSCOs': int(n_match.group(1)) + } + break + + if not data: + raise RuntimeError(f"Could not parse BUSCO summary from {summary_file}") + + # Write TSV + with open(output_tsv, 'w') as f: + f.write("Metric\tValue\n") + for key, value in data.items(): + f.write(f"{key}\t{value}\n") + + except Exception as e: + raise RuntimeError(f"Failed to normalize BUSCO summary: {e}") + + return { + "status": "success", + "input_fasta": input_fasta, + "lineage_dir": lineage_dir, + "run_dir": run_dir, + "output_tsv": output_tsv, + "busco_output_dir": os.path.join(run_dir, "ecoli_busco"), + "summary_file": summary_file, + "metrics": data + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/busco_assess_bacterial_genome_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/busco_assess_bacterial_genome_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..378060f74a00120196177cec69d526a26e169c1a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/busco_assess_bacterial_genome_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "f76e1c8e2f2a01f959ec4a06acdcb1ad6489f0c7ddb43140d0df77f3137417bc", + "elapsed_seconds": 5.7369468212127686, + "usage": { + "prompt_tokens": 10794, + "completion_tokens": 1006, + "total_tokens": 11800, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10794 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "39ffa7ef-5807-4f8c-ade3-5d7026f4cc8f" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bx-python_intersect_intervals_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bx-python_intersect_intervals_test.py new file mode 100644 index 0000000000000000000000000000000000000000..16d9bd4086ed15efb9da4aad4526b089703629de --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bx-python_intersect_intervals_test.py @@ -0,0 +1,89 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("bx-python") + + +@mcp.tool() +def intersect_intervals( + target_bed: str, + query_bed: str, + output_json: str, +) -> dict: + """ + Intersect intervals from a target BED file with a query BED file using bx-python's Intersecter. + + Args: + target_bed: Path to the target BED file (intervals to be indexed). + query_bed: Path to the query BED file (intervals to be tested for overlap). + output_json: Path where the JSON output will be written. + + Returns: + A dictionary with metadata about the operation. + """ + # Create output parent directories + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + code = ( + "import json,sys; " + "from bx.intervals.intersection import Intersecter,Interval; " + "t=Intersecter(); " + "q=[]; " + "[t.add_interval(Interval(int(c[1]),int(c[2]),value=c[3] if len(c)>3 else '.')) " + "for c in (x.rstrip().split('\\t') for x in open(sys.argv[1])) if c[0]=='chrTiny']; " + "[q.append({'start':int(c[1]),'end':int(c[2]),'hits':sorted(x.value for x in t.find(int(c[1]),int(c[2])))}) " + "for c in (x.rstrip().split('\\t') for x in open(sys.argv[2])) if c[0]=='chrTiny']; " + "open(sys.argv[3],'w').write(json.dumps(q,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.13", + "-c", + code, + target_bed, + query_bed, + output_json, + ] + + # Run the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_json} was not created") + + # Read the output to include in metadata + with open(output_path, "r") as f: + output_content = f.read() + + return { + "status": "success", + "output_json": output_json, + "output_content": output_content, + "target_bed": target_bed, + "query_bed": query_bed, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bx-python_intersect_intervals_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bx-python_intersect_intervals_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..25d28c343dac1a45de29c511de8dc8c97f918529 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bx-python_intersect_intervals_test.py.raw.txt @@ -0,0 +1,91 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("bx-python") + + +@mcp.tool() +def intersect_intervals( + target_bed: str, + query_bed: str, + output_json: str, +) -> dict: + """ + Intersect intervals from a target BED file with a query BED file using bx-python's Intersecter. + + Args: + target_bed: Path to the target BED file (intervals to be indexed). + query_bed: Path to the query BED file (intervals to be tested for overlap). + output_json: Path where the JSON output will be written. + + Returns: + A dictionary with metadata about the operation. + """ + # Create output parent directories + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + code = ( + "import json,sys; " + "from bx.intervals.intersection import Intersecter,Interval; " + "t=Intersecter(); " + "q=[]; " + "[t.add_interval(Interval(int(c[1]),int(c[2]),value=c[3] if len(c)>3 else '.')) " + "for c in (x.rstrip().split('\\t') for x in open(sys.argv[1])) if c[0]=='chrTiny']; " + "[q.append({'start':int(c[1]),'end':int(c[2]),'hits':sorted(x.value for x in t.find(int(c[1]),int(c[2])))}) " + "for c in (x.rstrip().split('\\t') for x in open(sys.argv[2])) if c[0]=='chrTiny']; " + "open(sys.argv[3],'w').write(json.dumps(q,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.13", + "-c", + code, + target_bed, + query_bed, + output_json, + ] + + # Run the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_json} was not created") + + # Read the output to include in metadata + with open(output_path, "r") as f: + output_content = f.read() + + return { + "status": "success", + "output_json": output_json, + "output_content": output_content, + "target_bed": target_bed, + "query_bed": query_bed, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bx-python_intersect_intervals_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bx-python_intersect_intervals_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..423cd68cf02ec41dce3549e0264375c1ade1e4c1 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/bx-python_intersect_intervals_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "5e5153d6ee5ac158b35befe0425395ce81b55ec15083f9957f14a722df98e2f1", + "elapsed_seconds": 4.344372272491455, + "usage": { + "prompt_tokens": 9032, + "completion_tokens": 693, + "total_tokens": 9725, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9032 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "16941c52-1431-4867-9670-e663a4abb64c" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cd-hit_cluster_proteins_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cd-hit_cluster_proteins_test.py new file mode 100644 index 0000000000000000000000000000000000000000..5cfa0093e8da248ad3da39dc0d8de84649c3300f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cd-hit_cluster_proteins_test.py @@ -0,0 +1,85 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("cd-hit") + +@mcp.tool() +def cluster_proteins(input_file: str, output_file: str) -> dict: + """ + Cluster protein sequences using CD-HIT with fixed parameters. + + Args: + input_file: Path to input FASTA file + output_file: Path to output file (cluster representatives) + + Returns: + Dictionary containing output file paths and metadata + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Derive cluster file path (CD-HIT appends .clstr to output file) + cluster_file = str(output_path) + ".clstr" + + # Build command with fixed parameters + cmd = [ + "cd-hit", + "-i", input_file, + "-o", output_file, + "-c", "0.9", + "-n", "5", + "-T", "1", + "-M", "100" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("cd-hit executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute cd-hit: {str(e)}") + + # Check for non-zero exit code + if result.returncode != 0: + error_msg = f"cd-hit failed with exit code {result.returncode}\n" + if result.stderr: + error_msg += f"stderr: {result.stderr}\n" + if result.stdout: + error_msg += f"stdout: {result.stdout}\n" + raise RuntimeError(error_msg) + + # Verify output files exist + if not os.path.exists(output_file): + raise RuntimeError(f"Output file {output_file} was not created") + if not os.path.exists(cluster_file): + raise RuntimeError(f"Cluster file {cluster_file} was not created") + + # Return structured metadata + return { + "output_file": output_file, + "cluster_file": cluster_file, + "input_file": input_file, + "parameters": { + "identity_threshold": 0.9, + "word_length": 5, + "threads": 1, + "memory_limit_mb": 100 + }, + "stdout": result.stdout, + "stderr": result.stderr, + "exit_code": result.returncode + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cd-hit_cluster_proteins_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cd-hit_cluster_proteins_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..3f90f7d48945e7d8f9fb0d9fa56017ac488766aa --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cd-hit_cluster_proteins_test.py.raw.txt @@ -0,0 +1,87 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("cd-hit") + +@mcp.tool() +def cluster_proteins(input_file: str, output_file: str) -> dict: + """ + Cluster protein sequences using CD-HIT with fixed parameters. + + Args: + input_file: Path to input FASTA file + output_file: Path to output file (cluster representatives) + + Returns: + Dictionary containing output file paths and metadata + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Derive cluster file path (CD-HIT appends .clstr to output file) + cluster_file = str(output_path) + ".clstr" + + # Build command with fixed parameters + cmd = [ + "cd-hit", + "-i", input_file, + "-o", output_file, + "-c", "0.9", + "-n", "5", + "-T", "1", + "-M", "100" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("cd-hit executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute cd-hit: {str(e)}") + + # Check for non-zero exit code + if result.returncode != 0: + error_msg = f"cd-hit failed with exit code {result.returncode}\n" + if result.stderr: + error_msg += f"stderr: {result.stderr}\n" + if result.stdout: + error_msg += f"stdout: {result.stdout}\n" + raise RuntimeError(error_msg) + + # Verify output files exist + if not os.path.exists(output_file): + raise RuntimeError(f"Output file {output_file} was not created") + if not os.path.exists(cluster_file): + raise RuntimeError(f"Cluster file {cluster_file} was not created") + + # Return structured metadata + return { + "output_file": output_file, + "cluster_file": cluster_file, + "input_file": input_file, + "parameters": { + "identity_threshold": 0.9, + "word_length": 5, + "threads": 1, + "memory_limit_mb": 100 + }, + "stdout": result.stdout, + "stderr": result.stderr, + "exit_code": result.returncode + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cd-hit_cluster_proteins_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cd-hit_cluster_proteins_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..38678fe49db40a2fbb6975c6df26937044a8225b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cd-hit_cluster_proteins_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "1417013a27308442f8f80ccb4deacdeda7e0921a10a7c0513e1eeed33d333b5a", + "elapsed_seconds": 4.380034446716309, + "usage": { + "prompt_tokens": 1778, + "completion_tokens": 603, + "total_tokens": 2381, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1778 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "2f1e15e7-c70e-4d11-890d-5723a54af496" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cdbtools_extract_fasta_record_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cdbtools_extract_fasta_record_test.py new file mode 100644 index 0000000000000000000000000000000000000000..f39a2d5fa536de75ed44754596be186db6794723 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cdbtools_extract_fasta_record_test.py @@ -0,0 +1,96 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("cdbtools") + + +@mcp.tool() +def extract_fasta_record( + input_fasta: str, + index_file: str, + output_fasta: str, +) -> Dict[str, Any]: + """ + Index a FASTA file with cdbfasta, then retrieve the record with key 'chrTiny' + using cdbyank and write the result to the specified output file. + + Args: + input_fasta: Path to the input FASTA file to be indexed. + index_file: Path where the CDB index file will be created. + output_fasta: Path where the retrieved FASTA record will be written. + """ + # Validate input file exists + input_path = Path(input_fasta) + if not input_path.exists(): + raise FileNotFoundError(f"Input FASTA file not found: {input_fasta}") + + # Create parent directories for output files + index_path = Path(index_file) + output_path = Path(output_fasta) + index_path.parent.mkdir(parents=True, exist_ok=True) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Index the FASTA file with cdbfasta + cmd_index = ["cdbfasta", str(input_path), "-o", str(index_path)] + try: + result_index = subprocess.run( + cmd_index, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError( + f"cdbfasta executable not found. Ensure cdbtools is installed and in PATH. Error: {e}" + ) from e + + if result_index.returncode != 0: + raise RuntimeError( + f"cdbfasta failed with exit code {result_index.returncode}.\n" + f"stderr: {result_index.stderr}\n" + f"stdout: {result_index.stdout}" + ) + + # Step 2: Retrieve the record with key 'chrTiny' using cdbyank + cmd_yank = ["cdbyank", "-a", "chrTiny", str(index_path)] + try: + result_yank = subprocess.run( + cmd_yank, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError( + f"cdbyank executable not found. Ensure cdbtools is installed and in PATH. Error: {e}" + ) from e + + if result_yank.returncode != 0: + raise RuntimeError( + f"cdbyank failed with exit code {result_yank.returncode}.\n" + f"stderr: {result_yank.stderr}\n" + f"stdout: {result_yank.stdout}" + ) + + # Write the captured stdout to the output file + try: + output_path.write_text(result_yank.stdout, encoding="utf-8") + except OSError as e: + raise RuntimeError(f"Failed to write output file {output_fasta}: {e}") from e + + # Return structured metadata + return { + "status": "success", + "input_fasta": str(input_path), + "index_file": str(index_path), + "output_fasta": str(output_path), + "cdbfasta_exit_code": result_index.returncode, + "cdbyank_exit_code": result_yank.returncode, + "output_size_bytes": output_path.stat().st_size, + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cdbtools_extract_fasta_record_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cdbtools_extract_fasta_record_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2aebfa28b03f12953eb0cabdd1cfc5c4c4b51b18 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cdbtools_extract_fasta_record_test.py.raw.txt @@ -0,0 +1,98 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("cdbtools") + + +@mcp.tool() +def extract_fasta_record( + input_fasta: str, + index_file: str, + output_fasta: str, +) -> Dict[str, Any]: + """ + Index a FASTA file with cdbfasta, then retrieve the record with key 'chrTiny' + using cdbyank and write the result to the specified output file. + + Args: + input_fasta: Path to the input FASTA file to be indexed. + index_file: Path where the CDB index file will be created. + output_fasta: Path where the retrieved FASTA record will be written. + """ + # Validate input file exists + input_path = Path(input_fasta) + if not input_path.exists(): + raise FileNotFoundError(f"Input FASTA file not found: {input_fasta}") + + # Create parent directories for output files + index_path = Path(index_file) + output_path = Path(output_fasta) + index_path.parent.mkdir(parents=True, exist_ok=True) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Index the FASTA file with cdbfasta + cmd_index = ["cdbfasta", str(input_path), "-o", str(index_path)] + try: + result_index = subprocess.run( + cmd_index, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError( + f"cdbfasta executable not found. Ensure cdbtools is installed and in PATH. Error: {e}" + ) from e + + if result_index.returncode != 0: + raise RuntimeError( + f"cdbfasta failed with exit code {result_index.returncode}.\n" + f"stderr: {result_index.stderr}\n" + f"stdout: {result_index.stdout}" + ) + + # Step 2: Retrieve the record with key 'chrTiny' using cdbyank + cmd_yank = ["cdbyank", "-a", "chrTiny", str(index_path)] + try: + result_yank = subprocess.run( + cmd_yank, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError( + f"cdbyank executable not found. Ensure cdbtools is installed and in PATH. Error: {e}" + ) from e + + if result_yank.returncode != 0: + raise RuntimeError( + f"cdbyank failed with exit code {result_yank.returncode}.\n" + f"stderr: {result_yank.stderr}\n" + f"stdout: {result_yank.stdout}" + ) + + # Write the captured stdout to the output file + try: + output_path.write_text(result_yank.stdout, encoding="utf-8") + except OSError as e: + raise RuntimeError(f"Failed to write output file {output_fasta}: {e}") from e + + # Return structured metadata + return { + "status": "success", + "input_fasta": str(input_path), + "index_file": str(index_path), + "output_fasta": str(output_path), + "cdbfasta_exit_code": result_index.returncode, + "cdbyank_exit_code": result_yank.returncode, + "output_size_bytes": output_path.stat().st_size, + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cdbtools_extract_fasta_record_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cdbtools_extract_fasta_record_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..dd859f7fc8a23d1c99c091a8ab4985b3e7e88083 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cdbtools_extract_fasta_record_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "d9323c562e653f5822dfa5b881c350a6d2369834960c8bfd7ba4c4c600278343", + "elapsed_seconds": 4.437187671661377, + "usage": { + "prompt_tokens": 3386, + "completion_tokens": 794, + "total_tokens": 4180, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 3386 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "b8df9060-559a-4ea5-b31d-f2e86b57aeb6" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cell2cell_preprocess_expression_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cell2cell_preprocess_expression_test.py new file mode 100644 index 0000000000000000000000000000000000000000..bd7390a1c995250676549957ce95ca5d8e79602d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cell2cell_preprocess_expression_test.py @@ -0,0 +1,75 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("cell2cell") + + +@mcp.tool() +def preprocess_expression(expression_csv: str, output_json: str) -> dict: + """ + Preprocess expression data using cell2cell. + + Args: + expression_csv: Path to the input expression CSV file. + output_json: Path to the output JSON file. + """ + expression_csv_path = Path(expression_csv) + output_json_path = Path(output_json) + + # Create output parent directories + output_json_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + code = ( + "import json,pandas as pd,sys; " + "from cell2cell.preprocessing import get_global_percentile_cutoffs,get_thresholded_rnaseq,scale_expression_by_sum; " + "x=pd.read_csv(sys.argv[1],index_col=0); " + "cut=get_global_percentile_cutoffs(x,percentile=0.5); " + "y=get_thresholded_rnaseq(x,cut); " + "z=scale_expression_by_sum(x,axis=0,sum_value=100.0); " + "d={'cutoffs':cut.to_dict() if hasattr(cut,'to_dict') else cut," + "'thresholded':y.to_dict(),'scaled':z.round(6).to_dict()}; " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.9", + "-c", + code, + str(expression_csv_path), + str(output_json_path), + ] + + # Run the command without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Read the output JSON to return structured metadata + try: + with open(output_json_path, "r") as f: + output_data = json.load(f) + except Exception as e: + raise RuntimeError(f"Failed to read output JSON: {e}") + + return { + "status": "success", + "output_json": str(output_json_path), + "cutoffs": output_data.get("cutoffs"), + "thresholded": output_data.get("thresholded"), + "scaled": output_data.get("scaled"), + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cell2cell_preprocess_expression_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cell2cell_preprocess_expression_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..c7eb7228ee2e89dc8b2233dd194369ca0788f426 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cell2cell_preprocess_expression_test.py.raw.txt @@ -0,0 +1,77 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("cell2cell") + + +@mcp.tool() +def preprocess_expression(expression_csv: str, output_json: str) -> dict: + """ + Preprocess expression data using cell2cell. + + Args: + expression_csv: Path to the input expression CSV file. + output_json: Path to the output JSON file. + """ + expression_csv_path = Path(expression_csv) + output_json_path = Path(output_json) + + # Create output parent directories + output_json_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + code = ( + "import json,pandas as pd,sys; " + "from cell2cell.preprocessing import get_global_percentile_cutoffs,get_thresholded_rnaseq,scale_expression_by_sum; " + "x=pd.read_csv(sys.argv[1],index_col=0); " + "cut=get_global_percentile_cutoffs(x,percentile=0.5); " + "y=get_thresholded_rnaseq(x,cut); " + "z=scale_expression_by_sum(x,axis=0,sum_value=100.0); " + "d={'cutoffs':cut.to_dict() if hasattr(cut,'to_dict') else cut," + "'thresholded':y.to_dict(),'scaled':z.round(6).to_dict()}; " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.9", + "-c", + code, + str(expression_csv_path), + str(output_json_path), + ] + + # Run the command without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Read the output JSON to return structured metadata + try: + with open(output_json_path, "r") as f: + output_data = json.load(f) + except Exception as e: + raise RuntimeError(f"Failed to read output JSON: {e}") + + return { + "status": "success", + "output_json": str(output_json_path), + "cutoffs": output_data.get("cutoffs"), + "thresholded": output_data.get("thresholded"), + "scaled": output_data.get("scaled"), + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cell2cell_preprocess_expression_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cell2cell_preprocess_expression_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..dbe46f8f1672f2d8e826fb4ddf5d0f0f2b0c2cf2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cell2cell_preprocess_expression_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "559b04f460aa76d575b87154b06e218770ad6b819a61ea067c106e76f0b29198", + "elapsed_seconds": 3.707366466522217, + "usage": { + "prompt_tokens": 11012, + "completion_tokens": 614, + "total_tokens": 11626, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11012 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "9868526e-7cb4-4c04-9d38-087b8c77b0cc" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/checkm-genome_assess_bin_quality_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/checkm-genome_assess_bin_quality_test.py new file mode 100644 index 0000000000000000000000000000000000000000..39cbf8181995ac7cb45b6ec396e7cd5191d0799b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/checkm-genome_assess_bin_quality_test.py @@ -0,0 +1,106 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("checkm-genome") + + +@mcp.tool() +def assess_bin_quality( + marker_file: str, + bins_dir: str, + analysis_dir: str, + output_tsv: str, +) -> dict: + """ + Analyze a pinned bacterial genome bin with its fixed lineage marker set and report + tab-separated completeness and contamination estimates. + + Args: + marker_file: Path to the marker file (lineage-specific marker set). + bins_dir: Directory containing the genome bins (FASTA files with .fna extension). + analysis_dir: Directory where intermediate analysis results will be stored. + output_tsv: Path to the output TSV file containing completeness and contamination estimates. + + Returns: + A dictionary with metadata about the execution, including the output file path. + """ + # Create output parent directories + for path in [analysis_dir, output_tsv]: + parent = os.path.dirname(os.path.abspath(path)) + os.makedirs(parent, exist_ok=True) + + # Step 1: checkm analyze + analyze_cmd = [ + "checkm", + "analyze", + "-x", + "fna", + "-t", + "2", + marker_file, + bins_dir, + analysis_dir, + ] + try: + analyze_result = subprocess.run( + analyze_cmd, + capture_output=True, + text=True, + check=False, + ) + if analyze_result.returncode != 0: + raise RuntimeError( + f"checkm analyze failed with exit code {analyze_result.returncode}: " + f"{analyze_result.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("checkm executable not found. Ensure checkm-genome is installed and in PATH.") + + # Step 2: checkm qa + qa_cmd = [ + "checkm", + "qa", + "-f", + output_tsv, + "--tab_table", + marker_file, + analysis_dir, + ] + try: + qa_result = subprocess.run( + qa_cmd, + capture_output=True, + text=True, + check=False, + ) + if qa_result.returncode != 0: + raise RuntimeError( + f"checkm qa failed with exit code {qa_result.returncode}: " + f"{qa_result.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("checkm executable not found. Ensure checkm-genome is installed and in PATH.") + + # Verify output file was created + if not os.path.isfile(output_tsv): + raise RuntimeError(f"Expected output file {output_tsv} was not created.") + + return { + "output_tsv": output_tsv, + "analysis_dir": analysis_dir, + "marker_file": marker_file, + "bins_dir": bins_dir, + "analyze_exit_code": analyze_result.returncode, + "qa_exit_code": qa_result.returncode, + "analyze_stdout": analyze_result.stdout, + "analyze_stderr": analyze_result.stderr, + "qa_stdout": qa_result.stdout, + "qa_stderr": qa_result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/checkm-genome_assess_bin_quality_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/checkm-genome_assess_bin_quality_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..9e048b22fc7770fbd74257a6287085574133f055 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/checkm-genome_assess_bin_quality_test.py.raw.txt @@ -0,0 +1,108 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("checkm-genome") + + +@mcp.tool() +def assess_bin_quality( + marker_file: str, + bins_dir: str, + analysis_dir: str, + output_tsv: str, +) -> dict: + """ + Analyze a pinned bacterial genome bin with its fixed lineage marker set and report + tab-separated completeness and contamination estimates. + + Args: + marker_file: Path to the marker file (lineage-specific marker set). + bins_dir: Directory containing the genome bins (FASTA files with .fna extension). + analysis_dir: Directory where intermediate analysis results will be stored. + output_tsv: Path to the output TSV file containing completeness and contamination estimates. + + Returns: + A dictionary with metadata about the execution, including the output file path. + """ + # Create output parent directories + for path in [analysis_dir, output_tsv]: + parent = os.path.dirname(os.path.abspath(path)) + os.makedirs(parent, exist_ok=True) + + # Step 1: checkm analyze + analyze_cmd = [ + "checkm", + "analyze", + "-x", + "fna", + "-t", + "2", + marker_file, + bins_dir, + analysis_dir, + ] + try: + analyze_result = subprocess.run( + analyze_cmd, + capture_output=True, + text=True, + check=False, + ) + if analyze_result.returncode != 0: + raise RuntimeError( + f"checkm analyze failed with exit code {analyze_result.returncode}: " + f"{analyze_result.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("checkm executable not found. Ensure checkm-genome is installed and in PATH.") + + # Step 2: checkm qa + qa_cmd = [ + "checkm", + "qa", + "-f", + output_tsv, + "--tab_table", + marker_file, + analysis_dir, + ] + try: + qa_result = subprocess.run( + qa_cmd, + capture_output=True, + text=True, + check=False, + ) + if qa_result.returncode != 0: + raise RuntimeError( + f"checkm qa failed with exit code {qa_result.returncode}: " + f"{qa_result.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("checkm executable not found. Ensure checkm-genome is installed and in PATH.") + + # Verify output file was created + if not os.path.isfile(output_tsv): + raise RuntimeError(f"Expected output file {output_tsv} was not created.") + + return { + "output_tsv": output_tsv, + "analysis_dir": analysis_dir, + "marker_file": marker_file, + "bins_dir": bins_dir, + "analyze_exit_code": analyze_result.returncode, + "qa_exit_code": qa_result.returncode, + "analyze_stdout": analyze_result.stdout, + "analyze_stderr": analyze_result.stderr, + "qa_stdout": qa_result.stdout, + "qa_stderr": qa_result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/checkm-genome_assess_bin_quality_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/checkm-genome_assess_bin_quality_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..9a87c30ac472696b0d233372b79ca497e9186fc9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/checkm-genome_assess_bin_quality_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "238995252aae4c69cbebc7ec00f48e11d447ffd06842154271ee50cd9e7cc587", + "elapsed_seconds": 5.729413747787476, + "usage": { + "prompt_tokens": 9651, + "completion_tokens": 742, + "total_tokens": 10393, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9651 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "0fb72bc8-f202-416c-a4f6-d44c461eff1e" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/circexplorer2_parse_star_junctions_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/circexplorer2_parse_star_junctions_test.py new file mode 100644 index 0000000000000000000000000000000000000000..a7dc79b8de215d8170701851ef2eba0e9045a4e0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/circexplorer2_parse_star_junctions_test.py @@ -0,0 +1,76 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("circexplorer2") + +@mcp.tool() +def parse_star_junctions(star_junctions: str, output_bed: str) -> dict: + """ + Parse STAR chimeric junctions, retain same-chromosome same-strand back-splices, + and aggregate duplicate read support. + + Args: + star_junctions: Path to STAR chimeric junction file (input) + output_bed: Path to output BED file + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_bed) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "CIRCexplorer2", + "parse", + "-t", + "STAR", + "-b", + output_bed, + star_junctions + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file {output_bed} was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "output_bed": str(output_path), + "output_bed_size": output_path.stat().st_size, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/circexplorer2_parse_star_junctions_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/circexplorer2_parse_star_junctions_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..505bee4c79c7aa743294d468d77da66a22708760 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/circexplorer2_parse_star_junctions_test.py.raw.txt @@ -0,0 +1,78 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("circexplorer2") + +@mcp.tool() +def parse_star_junctions(star_junctions: str, output_bed: str) -> dict: + """ + Parse STAR chimeric junctions, retain same-chromosome same-strand back-splices, + and aggregate duplicate read support. + + Args: + star_junctions: Path to STAR chimeric junction file (input) + output_bed: Path to output BED file + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_bed) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "CIRCexplorer2", + "parse", + "-t", + "STAR", + "-b", + output_bed, + star_junctions + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file {output_bed} was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "output_bed": str(output_path), + "output_bed_size": output_path.stat().st_size, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/circexplorer2_parse_star_junctions_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/circexplorer2_parse_star_junctions_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..425fafa54677be3e7a1792b525310a2ad785df7e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/circexplorer2_parse_star_junctions_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "2a189c9cd084fa6e1b344ab20ad5ca93720b20d8006b1707644f42cb92fd0a63", + "elapsed_seconds": 3.580050468444824, + "usage": { + "prompt_tokens": 7481, + "completion_tokens": 488, + "total_tokens": 7969, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7481 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "fa570c8c-4c99-48c2-9975-e03d441359a8" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalo_align_proteins_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalo_align_proteins_test.py new file mode 100644 index 0000000000000000000000000000000000000000..71c8f7a2ad0b7c720fc2ee42d8ddd4a570aa748c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalo_align_proteins_test.py @@ -0,0 +1,91 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("clustalo") + +@mcp.tool() +def align_proteins(input_file: str, output_file: str) -> dict: + """ + Align protein sequences using Clustal Omega. + + Args: + input_file: Path to input FASTA file with protein sequences + output_file: Path where the alignment will be written (FASTA format) + + Returns: + JSON-serializable metadata about the alignment result + """ + # Validate input file exists + input_path = Path(input_file) + if not input_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_file}") + + # Create output parent directories + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "clustalo", + "-i", + input_file, + "-o", + output_file, + "--outfmt=fasta", + "--threads=1", + "--force" + ] + + # Execute command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("clustalo executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute clustalo: {str(e)}") + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError(f"clustalo failed with exit code {result.returncode}: {error_msg}") + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file was not created: {output_file}") + + # Read output file to get basic stats + try: + with open(output_path, 'r') as f: + content = f.read() + sequences = [line for line in content.split('\n') if line.startswith('>')] + num_sequences = len(sequences) + total_length = sum(len(line) for line in content.split('\n') if not line.startswith('>') and line.strip()) + except Exception as e: + raise RuntimeError(f"Failed to read output file: {str(e)}") + + # Return structured metadata + return { + "status": "success", + "tool": "clustalo", + "version": "1.2.4", + "input_file": str(input_path), + "output_file": str(output_path), + "output_format": "fasta", + "num_sequences": num_sequences, + "total_alignment_length": total_length, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalo_align_proteins_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalo_align_proteins_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..c06a226a85b96cb1fa46a61fa74d89b65843254a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalo_align_proteins_test.py.raw.txt @@ -0,0 +1,93 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("clustalo") + +@mcp.tool() +def align_proteins(input_file: str, output_file: str) -> dict: + """ + Align protein sequences using Clustal Omega. + + Args: + input_file: Path to input FASTA file with protein sequences + output_file: Path where the alignment will be written (FASTA format) + + Returns: + JSON-serializable metadata about the alignment result + """ + # Validate input file exists + input_path = Path(input_file) + if not input_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_file}") + + # Create output parent directories + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "clustalo", + "-i", + input_file, + "-o", + output_file, + "--outfmt=fasta", + "--threads=1", + "--force" + ] + + # Execute command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("clustalo executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute clustalo: {str(e)}") + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError(f"clustalo failed with exit code {result.returncode}: {error_msg}") + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file was not created: {output_file}") + + # Read output file to get basic stats + try: + with open(output_path, 'r') as f: + content = f.read() + sequences = [line for line in content.split('\n') if line.startswith('>')] + num_sequences = len(sequences) + total_length = sum(len(line) for line in content.split('\n') if not line.startswith('>') and line.strip()) + except Exception as e: + raise RuntimeError(f"Failed to read output file: {str(e)}") + + # Return structured metadata + return { + "status": "success", + "tool": "clustalo", + "version": "1.2.4", + "input_file": str(input_path), + "output_file": str(output_path), + "output_format": "fasta", + "num_sequences": num_sequences, + "total_alignment_length": total_length, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalo_align_proteins_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalo_align_proteins_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..6c6ffd3795070e54c8b4fee5c88e4207e3cc02d9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalo_align_proteins_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "b1ecd9e1f22389197eac3b1858187986e0d9258ab8bee383f1c926c1b0715600", + "elapsed_seconds": 4.25630259513855, + "usage": { + "prompt_tokens": 1882, + "completion_tokens": 672, + "total_tokens": 2554, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1882 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "160d419c-8f39-48c4-b44c-f162c7ba7ebe" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalw_align_proteins_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalw_align_proteins_test.py new file mode 100644 index 0000000000000000000000000000000000000000..630fabe6c736b30c6dc538bc420517f00bfe2a2b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalw_align_proteins_test.py @@ -0,0 +1,75 @@ +import json +import os +import subprocess +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("clustalw-align-proteins") + +@mcp.tool() +def align_proteins(input_file: str, output_file: str) -> dict: + """ + Align protein sequences using ClustalW 2.1. + + Args: + input_file: Path to the input file containing protein sequences. + output_file: Path where the FASTA alignment will be written. + + Returns: + JSON-serializable metadata about the alignment run. + """ + # Resolve paths + input_path = Path(input_file) + output_path = Path(output_file) + + # Create output parent directories if they don't exist + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "clustalw", + f"-INFILE={input_path}", + f"-OUTFILE={output_path}", + "-OUTPUT=FASTA", + "-QUIET" + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("clustalw executable not found in PATH") + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"clustalw failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_path} was not created") + + # Return structured metadata + return { + "status": "success", + "tool": "clustalw", + "version": "2.1", + "input_file": str(input_path), + "output_file": str(output_path), + "output_format": "FASTA", + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalw_align_proteins_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalw_align_proteins_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..eb70a049079f3f5f9c5d5bec98ae7a54fb31d07e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalw_align_proteins_test.py.raw.txt @@ -0,0 +1,77 @@ +```python +import json +import os +import subprocess +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("clustalw-align-proteins") + +@mcp.tool() +def align_proteins(input_file: str, output_file: str) -> dict: + """ + Align protein sequences using ClustalW 2.1. + + Args: + input_file: Path to the input file containing protein sequences. + output_file: Path where the FASTA alignment will be written. + + Returns: + JSON-serializable metadata about the alignment run. + """ + # Resolve paths + input_path = Path(input_file) + output_path = Path(output_file) + + # Create output parent directories if they don't exist + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "clustalw", + f"-INFILE={input_path}", + f"-OUTFILE={output_path}", + "-OUTPUT=FASTA", + "-QUIET" + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("clustalw executable not found in PATH") + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"clustalw failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_path} was not created") + + # Return structured metadata + return { + "status": "success", + "tool": "clustalw", + "version": "2.1", + "input_file": str(input_path), + "output_file": str(output_path), + "output_format": "FASTA", + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalw_align_proteins_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalw_align_proteins_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..d726ba3a333a29bae53f07ceb2f6f767cce09eb1 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/clustalw_align_proteins_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "542b62c4710375b2fbb3a4aa36725e0f4eaf2d76e49bab287e673584ca9d29c9", + "elapsed_seconds": 5.050342082977295, + "usage": { + "prompt_tokens": 539, + "completion_tokens": 509, + "total_tokens": 1048, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 539 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "62c28852-6913-4da2-a8e0-fece3fe380a9" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cmappy_parse_gct_matrix_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cmappy_parse_gct_matrix_test.py new file mode 100644 index 0000000000000000000000000000000000000000..31ad6f5bccb1defd6056ef68840e980f1479e462 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cmappy_parse_gct_matrix_test.py @@ -0,0 +1,87 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import sys +import os +import json +from pathlib import Path + +mcp = FastMCP("cmappy") + +@mcp.tool() +def parse_gct_matrix(input_gct: str, output_json: str) -> dict: + """ + Parse a GCT matrix file and emit matrix values as deterministic JSON. + + Args: + input_gct: Path to the input GCT file + output_json: Path where the output JSON will be written + """ + # Create output parent directories + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + python_code = ( + "import json,sys; " + "from cmapPy.pandasGEXpress import parse; " + "g=parse.parse(sys.argv[1]); " + "d={'rows':list(g.data_df.index),'columns':list(g.data_df.columns)," + "'values':g.data_df.values.tolist()}; " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.9", + "-c", + python_code, + input_gct, + output_json + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}: " + f"{result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_json} was not created") + + # Read and validate the output + with open(output_path, 'r') as f: + output_data = json.load(f) + + return { + "status": "success", + "input_gct": input_gct, + "output_json": output_json, + "rows_count": len(output_data.get("rows", [])), + "columns_count": len(output_data.get("columns", [])), + "values_shape": [ + len(output_data.get("values", [])), + len(output_data.get("values", [[]])[0]) if output_data.get("values") else 0 + ] + } + + except subprocess.TimeoutExpired: + raise RuntimeError("Command timed out") + except FileNotFoundError as e: + raise RuntimeError(f"Executable not found: {e}") + except json.JSONDecodeError as e: + raise RuntimeError(f"Output file contains invalid JSON: {e}") + except Exception as e: + raise RuntimeError(f"Error executing parse_gct_matrix: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cmappy_parse_gct_matrix_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cmappy_parse_gct_matrix_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..5a0a0addb4866b300b354e25a9c5076531f3eaf9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cmappy_parse_gct_matrix_test.py.raw.txt @@ -0,0 +1,89 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import sys +import os +import json +from pathlib import Path + +mcp = FastMCP("cmappy") + +@mcp.tool() +def parse_gct_matrix(input_gct: str, output_json: str) -> dict: + """ + Parse a GCT matrix file and emit matrix values as deterministic JSON. + + Args: + input_gct: Path to the input GCT file + output_json: Path where the output JSON will be written + """ + # Create output parent directories + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + python_code = ( + "import json,sys; " + "from cmapPy.pandasGEXpress import parse; " + "g=parse.parse(sys.argv[1]); " + "d={'rows':list(g.data_df.index),'columns':list(g.data_df.columns)," + "'values':g.data_df.values.tolist()}; " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.9", + "-c", + python_code, + input_gct, + output_json + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}: " + f"{result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_json} was not created") + + # Read and validate the output + with open(output_path, 'r') as f: + output_data = json.load(f) + + return { + "status": "success", + "input_gct": input_gct, + "output_json": output_json, + "rows_count": len(output_data.get("rows", [])), + "columns_count": len(output_data.get("columns", [])), + "values_shape": [ + len(output_data.get("values", [])), + len(output_data.get("values", [[]])[0]) if output_data.get("values") else 0 + ] + } + + except subprocess.TimeoutExpired: + raise RuntimeError("Command timed out") + except FileNotFoundError as e: + raise RuntimeError(f"Executable not found: {e}") + except json.JSONDecodeError as e: + raise RuntimeError(f"Output file contains invalid JSON: {e}") + except Exception as e: + raise RuntimeError(f"Error executing parse_gct_matrix: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cmappy_parse_gct_matrix_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cmappy_parse_gct_matrix_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..e6dfa7ede25cf4d9564dc3dd5bc601fc6d618059 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cmappy_parse_gct_matrix_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "80cfe5e1bd5de2320ee5fa664e632ccd480f05ac7d53beb0be8394c4bf31be3e", + "elapsed_seconds": 4.045815944671631, + "usage": { + "prompt_tokens": 7085, + "completion_tokens": 653, + "total_tokens": 7738, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7085 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "5efb12c3-9ef3-4a32-b9b4-e5c256373c20" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/comet-ms_search_tandem_mass_spectrum_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/comet-ms_search_tandem_mass_spectrum_test.py new file mode 100644 index 0000000000000000000000000000000000000000..bb49d3a161d4cb6b9a97f438c0ad6372f6b0474b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/comet-ms_search_tandem_mass_spectrum_test.py @@ -0,0 +1,119 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("comet-ms") + + +@mcp.tool() +def search_tandem_mass_spectrum( + params_file: str, + protein_fasta: str, + spectrum_mgf: str, + output_tsv: str, +) -> dict: + """ + Search one pinned tandem mass spectrum against one pinned protein and return the stable peptide-spectrum match table. + + Args: + params_file: Path to the Comet parameter file. + protein_fasta: Path to the protein FASTA database. + spectrum_mgf: Path to the input MGF spectrum file. + output_tsv: Path where the resulting TSV table will be written. + """ + # Validate input paths exist + for path, name in [ + (params_file, "params_file"), + (protein_fasta, "protein_fasta"), + (spectrum_mgf, "spectrum_mgf"), + ]: + if not os.path.isfile(path): + raise FileNotFoundError(f"{name} path does not exist: {path}") + + # Create output parent directory if needed + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run comet with the given parameters + raw_output = f"{output_tsv}.raw" + comet_cmd = [ + "comet", + f"-P{params_file}", + f"-D{protein_fasta}", + f"-N{raw_output}", + spectrum_mgf, + ] + + try: + result = subprocess.run( + comet_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError("comet executable not found in PATH") + + if result.returncode != 0: + raise RuntimeError( + f"comet failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Comet writes output to {raw_output}.txt + raw_txt = f"{raw_output}.txt" + if not os.path.isfile(raw_txt): + raise RuntimeError(f"Expected comet output file not found: {raw_txt}") + + # Step 2: Strip header line (first line) using tail -n +2 + tail_cmd = ["tail", "-n", "+2", raw_txt] + try: + tail_result = subprocess.run( + tail_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError("tail executable not found in PATH") + + if tail_result.returncode != 0: + raise RuntimeError( + f"tail failed with exit code {tail_result.returncode}\n" + f"stdout: {tail_result.stdout}\n" + f"stderr: {tail_result.stderr}" + ) + + # Write the captured stdout to the output_tsv path + with open(output_tsv, "w") as f: + f.write(tail_result.stdout) + + # Clean up intermediate files + for intermediate in [raw_output, raw_txt]: + try: + os.remove(intermediate) + except OSError: + pass + + # Return structured metadata + return { + "status": "success", + "output_tsv": output_tsv, + "spectrum_mgf": spectrum_mgf, + "protein_fasta": protein_fasta, + "params_file": params_file, + "comet_exit_code": result.returncode, + "tail_exit_code": tail_result.returncode, + "comet_stdout": result.stdout, + "comet_stderr": result.stderr, + "tail_stdout": tail_result.stdout, + "tail_stderr": tail_result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/comet-ms_search_tandem_mass_spectrum_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/comet-ms_search_tandem_mass_spectrum_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..98566704bdec5e80d7ca94b7718f198be78cac3a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/comet-ms_search_tandem_mass_spectrum_test.py.raw.txt @@ -0,0 +1,121 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("comet-ms") + + +@mcp.tool() +def search_tandem_mass_spectrum( + params_file: str, + protein_fasta: str, + spectrum_mgf: str, + output_tsv: str, +) -> dict: + """ + Search one pinned tandem mass spectrum against one pinned protein and return the stable peptide-spectrum match table. + + Args: + params_file: Path to the Comet parameter file. + protein_fasta: Path to the protein FASTA database. + spectrum_mgf: Path to the input MGF spectrum file. + output_tsv: Path where the resulting TSV table will be written. + """ + # Validate input paths exist + for path, name in [ + (params_file, "params_file"), + (protein_fasta, "protein_fasta"), + (spectrum_mgf, "spectrum_mgf"), + ]: + if not os.path.isfile(path): + raise FileNotFoundError(f"{name} path does not exist: {path}") + + # Create output parent directory if needed + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run comet with the given parameters + raw_output = f"{output_tsv}.raw" + comet_cmd = [ + "comet", + f"-P{params_file}", + f"-D{protein_fasta}", + f"-N{raw_output}", + spectrum_mgf, + ] + + try: + result = subprocess.run( + comet_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError("comet executable not found in PATH") + + if result.returncode != 0: + raise RuntimeError( + f"comet failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Comet writes output to {raw_output}.txt + raw_txt = f"{raw_output}.txt" + if not os.path.isfile(raw_txt): + raise RuntimeError(f"Expected comet output file not found: {raw_txt}") + + # Step 2: Strip header line (first line) using tail -n +2 + tail_cmd = ["tail", "-n", "+2", raw_txt] + try: + tail_result = subprocess.run( + tail_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError("tail executable not found in PATH") + + if tail_result.returncode != 0: + raise RuntimeError( + f"tail failed with exit code {tail_result.returncode}\n" + f"stdout: {tail_result.stdout}\n" + f"stderr: {tail_result.stderr}" + ) + + # Write the captured stdout to the output_tsv path + with open(output_tsv, "w") as f: + f.write(tail_result.stdout) + + # Clean up intermediate files + for intermediate in [raw_output, raw_txt]: + try: + os.remove(intermediate) + except OSError: + pass + + # Return structured metadata + return { + "status": "success", + "output_tsv": output_tsv, + "spectrum_mgf": spectrum_mgf, + "protein_fasta": protein_fasta, + "params_file": params_file, + "comet_exit_code": result.returncode, + "tail_exit_code": tail_result.returncode, + "comet_stdout": result.stdout, + "comet_stderr": result.stderr, + "tail_stdout": tail_result.stdout, + "tail_stderr": tail_result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/comet-ms_search_tandem_mass_spectrum_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/comet-ms_search_tandem_mass_spectrum_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..8df5debdf393d6dbd4f581a213f45aa12a3b0613 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/comet-ms_search_tandem_mass_spectrum_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "bb28cc4184d69d8af647e29dc9740e477544cc3d5fc286d75766358ef0610d69", + "elapsed_seconds": 6.525796413421631, + "usage": { + "prompt_tokens": 7679, + "completion_tokens": 890, + "total_tokens": 8569, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7679 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "46ce3609-75f6-4263-9bf7-ee8116629d87" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cooltools_binnify_genome_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cooltools_binnify_genome_test.py new file mode 100644 index 0000000000000000000000000000000000000000..cae13d9d54bafa6a553cd4dcf023dfba37e068d9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cooltools_binnify_genome_test.py @@ -0,0 +1,79 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("cooltools") + + +@mcp.tool() +def binnify_genome(chrom_sizes: str, output_bed: str) -> dict: + """ + Binnify a genome into fixed-size bins (10 bp) for all chromosome names. + + Args: + chrom_sizes: Path to a chromosome sizes file (two-column: name, size). + output_bed: Path where the resulting BED file will be written. + """ + # Create output parent directory if needed + output_dir = os.path.dirname(os.path.abspath(output_bed)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "cooltools", + "genome", + "binnify", + "--all-names", + chrom_sizes, + "10" + ] + + # Run the command, capturing stdout + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stderr": result.stderr, + "stdout": result.stdout, + "command": cmd + } + + # Write captured stdout to the output file + try: + with open(output_bed, "w") as f: + f.write(result.stdout) + except OSError as e: + return { + "success": False, + "error": f"Failed to write output file: {e}", + "command": cmd + } + + return { + "success": True, + "output_bed": output_bed, + "command": cmd, + "exit_code": result.returncode, + "stdout_size": len(result.stdout), + "stderr": result.stderr + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cooltools_binnify_genome_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cooltools_binnify_genome_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..8defebcec2b21c802cf7e66f81a8e647ad4e1f41 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cooltools_binnify_genome_test.py.raw.txt @@ -0,0 +1,81 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("cooltools") + + +@mcp.tool() +def binnify_genome(chrom_sizes: str, output_bed: str) -> dict: + """ + Binnify a genome into fixed-size bins (10 bp) for all chromosome names. + + Args: + chrom_sizes: Path to a chromosome sizes file (two-column: name, size). + output_bed: Path where the resulting BED file will be written. + """ + # Create output parent directory if needed + output_dir = os.path.dirname(os.path.abspath(output_bed)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "cooltools", + "genome", + "binnify", + "--all-names", + chrom_sizes, + "10" + ] + + # Run the command, capturing stdout + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stderr": result.stderr, + "stdout": result.stdout, + "command": cmd + } + + # Write captured stdout to the output file + try: + with open(output_bed, "w") as f: + f.write(result.stdout) + except OSError as e: + return { + "success": False, + "error": f"Failed to write output file: {e}", + "command": cmd + } + + return { + "success": True, + "output_bed": output_bed, + "command": cmd, + "exit_code": result.returncode, + "stdout_size": len(result.stdout), + "stderr": result.stderr + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cooltools_binnify_genome_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cooltools_binnify_genome_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..071cd9a9264e0f0b3fac44a090a6277090552a3d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cooltools_binnify_genome_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "6b226db878ec68d80fcf2b76a061374e0996653b320579bc212c26ade8aa21da", + "elapsed_seconds": 3.0116171836853027, + "usage": { + "prompt_tokens": 7987, + "completion_tokens": 498, + "total_tokens": 8485, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7987 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "0cf121c8-8117-477f-a96f-27de0196d0fb" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/crispritz_score_off_targets_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/crispritz_score_off_targets_test.py new file mode 100644 index 0000000000000000000000000000000000000000..01a0a1881404c3cc86c9ea549f935cd1fa732fb8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/crispritz_score_off_targets_test.py @@ -0,0 +1,99 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import shutil +import tempfile +from pathlib import Path + +mcp = FastMCP("crispritz") + +@mcp.tool() +def score_off_targets( + input_targets: str, + pam_file: str, + guide_file: str, + genome_dir: str, + cfd_table: str, + guide_scores: str +) -> dict: + """ + Compute CFD scores for nine pinned CRISPR off-target candidates and emit both per-target and per-guide tables. + """ + # Create output parent directories + for out_path in [cfd_table, guide_scores]: + parent = os.path.dirname(os.path.abspath(out_path)) + os.makedirs(parent, exist_ok=True) + + # Create a temporary working directory for staging + with tempfile.TemporaryDirectory() as tmpdir: + staged_targets = os.path.join(tmpdir, "staged_targets.txt") + + # Step 1: Copy input targets to staged location + shutil.copy2(input_targets, staged_targets) + + # Step 2: Run crispritz.py scores + cmd = [ + "crispritz.py", + "scores", + staged_targets, + pam_file, + guide_file, + genome_dir + ] + + # Run the command, capturing stdout and stderr + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"crispritz.py scores failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # The tool generates files in the current working directory. + # We need to find the generated files. Based on the tool's behavior, + # it generates files with specific naming patterns. + # The input targets file is named "staged_targets.txt", so the outputs + # should be "staged_targets.targets.CFD.txt" and "staged_targets.scores.txt" + # in the current working directory. + + # Find the generated files + cfd_source = os.path.join(os.getcwd(), "staged_targets.targets.CFD.txt") + scores_source = os.path.join(os.getcwd(), "staged_targets.scores.txt") + + if not os.path.exists(cfd_source): + raise RuntimeError(f"Expected CFD output file not found: {cfd_source}") + if not os.path.exists(scores_source): + raise RuntimeError(f"Expected scores output file not found: {scores_source}") + + # Copy the generated files to the requested output paths + shutil.copy2(cfd_source, cfd_table) + shutil.copy2(scores_source, guide_scores) + + # Clean up the generated files from the working directory + os.remove(cfd_source) + os.remove(scores_source) + + # Return structured metadata + return { + "status": "success", + "outputs": { + "cfd_table": cfd_table, + "guide_scores": guide_scores + }, + "command": [ + "crispritz.py", + "scores", + input_targets, + pam_file, + guide_file, + genome_dir + ] + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/crispritz_score_off_targets_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/crispritz_score_off_targets_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..14d63a821ad2735aee59b824debe92ce26adfa49 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/crispritz_score_off_targets_test.py.raw.txt @@ -0,0 +1,101 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import shutil +import tempfile +from pathlib import Path + +mcp = FastMCP("crispritz") + +@mcp.tool() +def score_off_targets( + input_targets: str, + pam_file: str, + guide_file: str, + genome_dir: str, + cfd_table: str, + guide_scores: str +) -> dict: + """ + Compute CFD scores for nine pinned CRISPR off-target candidates and emit both per-target and per-guide tables. + """ + # Create output parent directories + for out_path in [cfd_table, guide_scores]: + parent = os.path.dirname(os.path.abspath(out_path)) + os.makedirs(parent, exist_ok=True) + + # Create a temporary working directory for staging + with tempfile.TemporaryDirectory() as tmpdir: + staged_targets = os.path.join(tmpdir, "staged_targets.txt") + + # Step 1: Copy input targets to staged location + shutil.copy2(input_targets, staged_targets) + + # Step 2: Run crispritz.py scores + cmd = [ + "crispritz.py", + "scores", + staged_targets, + pam_file, + guide_file, + genome_dir + ] + + # Run the command, capturing stdout and stderr + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"crispritz.py scores failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # The tool generates files in the current working directory. + # We need to find the generated files. Based on the tool's behavior, + # it generates files with specific naming patterns. + # The input targets file is named "staged_targets.txt", so the outputs + # should be "staged_targets.targets.CFD.txt" and "staged_targets.scores.txt" + # in the current working directory. + + # Find the generated files + cfd_source = os.path.join(os.getcwd(), "staged_targets.targets.CFD.txt") + scores_source = os.path.join(os.getcwd(), "staged_targets.scores.txt") + + if not os.path.exists(cfd_source): + raise RuntimeError(f"Expected CFD output file not found: {cfd_source}") + if not os.path.exists(scores_source): + raise RuntimeError(f"Expected scores output file not found: {scores_source}") + + # Copy the generated files to the requested output paths + shutil.copy2(cfd_source, cfd_table) + shutil.copy2(scores_source, guide_scores) + + # Clean up the generated files from the working directory + os.remove(cfd_source) + os.remove(scores_source) + + # Return structured metadata + return { + "status": "success", + "outputs": { + "cfd_table": cfd_table, + "guide_scores": guide_scores + }, + "command": [ + "crispritz.py", + "scores", + input_targets, + pam_file, + guide_file, + genome_dir + ] + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/crispritz_score_off_targets_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/crispritz_score_off_targets_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..82c532ab645a3c09e1a183673aa0504b50966a5a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/crispritz_score_off_targets_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "c2c197a9d57e8854b6091c3bf1fca7cf1f8e731f555e08f0f4a9f8bc04ba7cb2", + "elapsed_seconds": 5.274962425231934, + "usage": { + "prompt_tokens": 11270, + "completion_tokens": 751, + "total_tokens": 12021, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11270 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "8e1924a5-a5ee-4337-88ac-fd98ac3f8fb8" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cutadapt_trim_front_adapter_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cutadapt_trim_front_adapter_test.py new file mode 100644 index 0000000000000000000000000000000000000000..d1431eedc484b5738dc51fa4c960e6055e82f0b9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cutadapt_trim_front_adapter_test.py @@ -0,0 +1,76 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("cutadapt") + + +@mcp.tool() +def trim_front_adapter(input_fastq: str, output_fastq: str) -> dict: + """ + Trim the anchored front adapter ^ACGTTGCA from reads in a FASTQ file using cutadapt. + + Args: + input_fastq: Path to the input FASTQ file. + output_fastq: Path where the trimmed FASTQ output will be written. + + Returns: + A JSON-serializable dictionary with metadata about the operation. + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_fastq)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "cutadapt", + "-g", + "^ACGTTGCA", + "-o", + output_fastq, + input_fastq + ] + + try: + # Run the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + # Raise on non-zero exit + raise subprocess.CalledProcessError( + result.returncode, + cmd, + output=result.stdout, + stderr=result.stderr + ) + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "adapter": "^ACGTTGCA" + } + + except subprocess.CalledProcessError as e: + # Re-raise with more context + raise RuntimeError( + f"cutadapt failed with exit code {e.returncode}: {e.stderr}" + ) from e + except FileNotFoundError as e: + raise RuntimeError( + "cutadapt executable not found. Please ensure it is installed and in PATH." + ) from e + except Exception as e: + raise RuntimeError(f"Unexpected error running cutadapt: {str(e)}") from e \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cutadapt_trim_front_adapter_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cutadapt_trim_front_adapter_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..d8159d15aac52d38f8b3bd9739c9f66ae8448b4e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cutadapt_trim_front_adapter_test.py.raw.txt @@ -0,0 +1,78 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("cutadapt") + + +@mcp.tool() +def trim_front_adapter(input_fastq: str, output_fastq: str) -> dict: + """ + Trim the anchored front adapter ^ACGTTGCA from reads in a FASTQ file using cutadapt. + + Args: + input_fastq: Path to the input FASTQ file. + output_fastq: Path where the trimmed FASTQ output will be written. + + Returns: + A JSON-serializable dictionary with metadata about the operation. + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_fastq)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "cutadapt", + "-g", + "^ACGTTGCA", + "-o", + output_fastq, + input_fastq + ] + + try: + # Run the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + # Raise on non-zero exit + raise subprocess.CalledProcessError( + result.returncode, + cmd, + output=result.stdout, + stderr=result.stderr + ) + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "adapter": "^ACGTTGCA" + } + + except subprocess.CalledProcessError as e: + # Re-raise with more context + raise RuntimeError( + f"cutadapt failed with exit code {e.returncode}: {e.stderr}" + ) from e + except FileNotFoundError as e: + raise RuntimeError( + "cutadapt executable not found. Please ensure it is installed and in PATH." + ) from e + except Exception as e: + raise RuntimeError(f"Unexpected error running cutadapt: {str(e)}") from e +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cutadapt_trim_front_adapter_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cutadapt_trim_front_adapter_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..70d978ca7e9695e81e9f877f656406691f02db3a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cutadapt_trim_front_adapter_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "583e175055c4956e088beb48e1ebeac73450d6743d645baf3e76d4b7b3e24c13", + "elapsed_seconds": 4.0371644496917725, + "usage": { + "prompt_tokens": 6892, + "completion_tokens": 525, + "total_tokens": 7417, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6892 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "c94d07fb-aed3-4344-9fe2-8a559a07de64" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cyvcf2_read_vcf_records_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cyvcf2_read_vcf_records_test.py new file mode 100644 index 0000000000000000000000000000000000000000..36c15a640019ad124de449bfb64d68fe800d6fe8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cyvcf2_read_vcf_records_test.py @@ -0,0 +1,72 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("cyvcf2") + + +@mcp.tool() +def read_vcf_records(input_vcf: str, output_vcf: str) -> Dict[str, Any]: + """ + Read VCF records from an input VCF file, suppressing genotype columns, + and write the result to an output VCF file. + + Args: + input_vcf: Path to the input VCF file. + output_vcf: Path where the output VCF will be written. + + Returns: + A JSON-serializable dictionary containing metadata about the operation. + """ + input_path = Path(input_vcf) + output_path = Path(output_vcf) + + # Create output parent directories if they don't exist + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "cyvcf2", + "--no-inds", + str(input_path), + ] + + try: + # Run the command, capturing stdout + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False, + ) + + if result.returncode != 0: + raise RuntimeError( + f"cyvcf2 failed with exit code {result.returncode}: {result.stderr}" + ) + + # Write stdout to the output file + output_path.write_text(result.stdout) + + return { + "status": "success", + "input_vcf": str(input_path), + "output_vcf": str(output_path), + "records_written": len(result.stdout.splitlines()), + "exit_code": result.returncode, + } + + except FileNotFoundError: + raise RuntimeError("cyvcf2 executable not found. Please ensure it is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error executing cyvcf2: {str(e)}") + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cyvcf2_read_vcf_records_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cyvcf2_read_vcf_records_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..36a2037c1653291766c4f2088be4efc9de6979d8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cyvcf2_read_vcf_records_test.py.raw.txt @@ -0,0 +1,74 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("cyvcf2") + + +@mcp.tool() +def read_vcf_records(input_vcf: str, output_vcf: str) -> Dict[str, Any]: + """ + Read VCF records from an input VCF file, suppressing genotype columns, + and write the result to an output VCF file. + + Args: + input_vcf: Path to the input VCF file. + output_vcf: Path where the output VCF will be written. + + Returns: + A JSON-serializable dictionary containing metadata about the operation. + """ + input_path = Path(input_vcf) + output_path = Path(output_vcf) + + # Create output parent directories if they don't exist + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "cyvcf2", + "--no-inds", + str(input_path), + ] + + try: + # Run the command, capturing stdout + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False, + ) + + if result.returncode != 0: + raise RuntimeError( + f"cyvcf2 failed with exit code {result.returncode}: {result.stderr}" + ) + + # Write stdout to the output file + output_path.write_text(result.stdout) + + return { + "status": "success", + "input_vcf": str(input_path), + "output_vcf": str(output_path), + "records_written": len(result.stdout.splitlines()), + "exit_code": result.returncode, + } + + except FileNotFoundError: + raise RuntimeError("cyvcf2 executable not found. Please ensure it is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error executing cyvcf2: {str(e)}") + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cyvcf2_read_vcf_records_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cyvcf2_read_vcf_records_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..64dbe4f912dd6b1cbfadd8a5bc682e5c847edc33 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/cyvcf2_read_vcf_records_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e0486c8c0beeba00ee5359ca7d38206361920d7bab690f665b9958159aab0764", + "elapsed_seconds": 3.3696351051330566, + "usage": { + "prompt_tokens": 11626, + "completion_tokens": 462, + "total_tokens": 12088, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11626 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "2c99488e-e1ce-4d27-b411-7c1b9543e3c2" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ddocent_quality_trim_rad_reads_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ddocent_quality_trim_rad_reads_test.py new file mode 100644 index 0000000000000000000000000000000000000000..408a9922fdcdf60dbdb45024a43105f1efb937af --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ddocent_quality_trim_rad_reads_test.py @@ -0,0 +1,223 @@ +from mcp.server.fastmcp import FastMCP +import os +import subprocess +import sys +import json +import glob +import shutil +import re +from pathlib import Path + +mcp = FastMCP("ddocent") + + +def stage_ddocent_reads(input_dir: str, work_dir: str) -> dict: + """Stage raw FASTQ files from input_dir into work_dir. + + dDocent expects raw gzipped FASTQ files in the working directory with + naming convention Pop_Sample.F.fq.gz and Pop_Sample.R.fq.gz. + This function copies all .fq.gz files from input_dir to work_dir. + """ + input_path = Path(input_dir) + work_path = Path(work_dir) + work_path.mkdir(parents=True, exist_ok=True) + + # Find all gzipped FASTQ files + fastq_files = list(input_path.glob("*.fq.gz")) + list(input_path.glob("*.fastq.gz")) + if not fastq_files: + raise FileNotFoundError(f"No FASTQ files (*.fq.gz or *.fastq.gz) found in {input_dir}") + + staged_files = [] + for f in fastq_files: + dest = work_path / f.name + shutil.copy2(f, dest) + staged_files.append(str(dest)) + + return {"staged_files": staged_files} + + +def normalize_ddocent_run(runs_file: str, trimmed_forward: str, trimmed_reverse: str, output_tsv: str) -> dict: + """Normalize dDocent run output into a structured TSV summary. + + Reads the dDocent.runs log file and extracts trimming statistics, + then writes a normalized summary to output_tsv. + """ + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Parse the dDocent.runs file for trimming statistics + stats = { + "input_reads": 0, + "surviving_reads": 0, + "trimmed_forward": trimmed_forward, + "trimmed_reverse": trimmed_reverse, + "status": "completed" + } + + if os.path.exists(runs_file): + with open(runs_file, 'r') as f: + content = f.read() + + # Try to extract read counts from common patterns + # Look for Trimmomatic-style output or dDocent summary lines + for line in content.split('\n'): + # Pattern for "Input Read Pairs: N" or similar + m = re.search(r'Input Read Pairs:\s*(\d+)', line) + if m: + stats["input_reads"] = int(m.group(1)) + m = re.search(r'Both Surviving:\s*(\d+)', line) + if m: + stats["surviving_reads"] = int(m.group(1)) + # dDocent specific patterns + m = re.search(r'(\d+)\s+reads\s+input', line, re.IGNORECASE) + if m: + stats["input_reads"] = int(m.group(1)) + m = re.search(r'(\d+)\s+reads\s+surviving', line, re.IGNORECASE) + if m: + stats["surviving_reads"] = int(m.group(1)) + + # Write normalized TSV + with open(output_path, 'w') as f: + f.write("sample\tinput_reads\tsurviving_reads\ttrimmed_forward\ttrimmed_reverse\tstatus\n") + # Determine sample name from trimmed forward filename + sample = Path(trimmed_forward).stem + # Remove .R1.fq or .F.fq suffix + sample = re.sub(r'\.(R1|F)\.fq$', '', sample) + f.write(f"{sample}\t{stats['input_reads']}\t{stats['surviving_reads']}\t" + f"{trimmed_forward}\t{trimmed_reverse}\t{stats['status']}\n") + + return stats + + +@mcp.tool() +def quality_trim_rad_reads( + input_dir: str, + config_file: str, + work_dir: str, + output_tsv: str +) -> dict: + """Quality-trim RAD sequencing reads using dDocent with a configuration file. + + This endpoint: + 1. Stages raw FASTQ files from input_dir into work_dir + 2. Runs dDocent with the provided configuration file (which must have Trimming set to yes) + 3. Normalizes the dDocent run log into a structured TSV summary + + Args: + input_dir: Directory containing raw gzipped FASTQ files (*.fq.gz) + config_file: dDocent configuration file (must have Trimming set to yes) + work_dir: Working directory for the dDocent run + output_tsv: Path to write the normalized summary TSV + + Returns: + JSON-serializable metadata about the trimming run + """ + # Validate inputs + if not os.path.isdir(input_dir): + raise FileNotFoundError(f"Input directory not found: {input_dir}") + if not os.path.isfile(config_file): + raise FileNotFoundError(f"Config file not found: {config_file}") + + # Read and validate config file + with open(config_file, 'r') as f: + config_content = f.read() + + # Verify trimming is enabled in config + if not re.search(r'^Trimming\s+yes\s*$', config_content, re.IGNORECASE | re.MULTILINE): + raise ValueError("Config file must have 'Trimming yes' to perform quality trimming") + + # Step 1: Stage reads + staging_result = stage_ddocent_reads(input_dir, work_dir) + + # Step 2: Run dDocent with config file + work_path = Path(work_dir) + work_path.mkdir(parents=True, exist_ok=True) + + # Copy config file to working directory if not already there + config_path = Path(config_file) + if config_path.parent != work_path: + local_config = work_path / config_path.name + shutil.copy2(config_path, local_config) + config_arg = str(local_config) + else: + config_arg = config_file + + # Run dDocent + cmd = ["dDocent", config_arg] + try: + result = subprocess.run( + cmd, + cwd=work_dir, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("dDocent executable not found in PATH. Please ensure it is installed.") + + if result.returncode != 0: + error_msg = f"dDocent failed with exit code {result.returncode}\n" + error_msg += f"STDOUT: {result.stdout[-2000:]}\n" + error_msg += f"STDERR: {result.stderr[-2000:]}" + raise RuntimeError(error_msg) + + # Step 3: Find trimmed output files + # dDocent produces trimmed files with .R1.fq and .R2.fq suffixes + trimmed_forward = None + trimmed_reverse = None + + # Look for trimmed files in working directory + r1_files = sorted(work_path.glob("*.R1.fq")) + sorted(work_path.glob("*.R1.fq.gz")) + r2_files = sorted(work_path.glob("*.R2.fq")) + sorted(work_path.glob("*.R2.fq.gz")) + + if r1_files and r2_files: + # Use the first pair found + trimmed_forward = str(r1_files[0]) + trimmed_reverse = str(r2_files[0]) + else: + # Also check for .F.fq and .R.fq naming convention + f_files = sorted(work_path.glob("*.F.fq")) + sorted(work_path.glob("*.F.fq.gz")) + r_files = sorted(work_path.glob("*.R.fq")) + sorted(work_path.glob("*.R.fq.gz")) + if f_files and r_files: + trimmed_forward = str(f_files[0]) + trimmed_reverse = str(r_files[0]) + + if not trimmed_forward or not trimmed_reverse: + raise RuntimeError( + "Could not find trimmed output files. Expected *.R1.fq/*.R2.fq or *.F.fq/*.R.fq in working directory. " + f"Files found: {[str(p) for p in work_path.iterdir() if p.is_file()]}" + ) + + # Step 4: Normalize run output + runs_file = str(work_path / "dDocent.runs") + if not os.path.exists(runs_file): + # Try alternative log file names + for alt in ["dDocent_main.LOG", "dDocent.log"]: + alt_path = work_path / alt + if alt_path.exists(): + runs_file = str(alt_path) + break + + normalize_result = normalize_ddocent_run(runs_file, trimmed_forward, trimmed_reverse, output_tsv) + + # Build result metadata + result_metadata = { + "status": "success", + "input_dir": input_dir, + "config_file": config_file, + "work_dir": work_dir, + "output_tsv": output_tsv, + "trimmed_forward": trimmed_forward, + "trimmed_reverse": trimmed_reverse, + "staged_files": staging_result["staged_files"], + "normalization": normalize_result, + "dDocent_stdout": result.stdout, + "dDocent_stderr": result.stderr + } + + return result_metadata + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ddocent_quality_trim_rad_reads_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ddocent_quality_trim_rad_reads_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..3e8a5d6a5a483f00c05bf944313091208e156b7e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ddocent_quality_trim_rad_reads_test.py.raw.txt @@ -0,0 +1,225 @@ +```python +from mcp.server.fastmcp import FastMCP +import os +import subprocess +import sys +import json +import glob +import shutil +import re +from pathlib import Path + +mcp = FastMCP("ddocent") + + +def stage_ddocent_reads(input_dir: str, work_dir: str) -> dict: + """Stage raw FASTQ files from input_dir into work_dir. + + dDocent expects raw gzipped FASTQ files in the working directory with + naming convention Pop_Sample.F.fq.gz and Pop_Sample.R.fq.gz. + This function copies all .fq.gz files from input_dir to work_dir. + """ + input_path = Path(input_dir) + work_path = Path(work_dir) + work_path.mkdir(parents=True, exist_ok=True) + + # Find all gzipped FASTQ files + fastq_files = list(input_path.glob("*.fq.gz")) + list(input_path.glob("*.fastq.gz")) + if not fastq_files: + raise FileNotFoundError(f"No FASTQ files (*.fq.gz or *.fastq.gz) found in {input_dir}") + + staged_files = [] + for f in fastq_files: + dest = work_path / f.name + shutil.copy2(f, dest) + staged_files.append(str(dest)) + + return {"staged_files": staged_files} + + +def normalize_ddocent_run(runs_file: str, trimmed_forward: str, trimmed_reverse: str, output_tsv: str) -> dict: + """Normalize dDocent run output into a structured TSV summary. + + Reads the dDocent.runs log file and extracts trimming statistics, + then writes a normalized summary to output_tsv. + """ + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Parse the dDocent.runs file for trimming statistics + stats = { + "input_reads": 0, + "surviving_reads": 0, + "trimmed_forward": trimmed_forward, + "trimmed_reverse": trimmed_reverse, + "status": "completed" + } + + if os.path.exists(runs_file): + with open(runs_file, 'r') as f: + content = f.read() + + # Try to extract read counts from common patterns + # Look for Trimmomatic-style output or dDocent summary lines + for line in content.split('\n'): + # Pattern for "Input Read Pairs: N" or similar + m = re.search(r'Input Read Pairs:\s*(\d+)', line) + if m: + stats["input_reads"] = int(m.group(1)) + m = re.search(r'Both Surviving:\s*(\d+)', line) + if m: + stats["surviving_reads"] = int(m.group(1)) + # dDocent specific patterns + m = re.search(r'(\d+)\s+reads\s+input', line, re.IGNORECASE) + if m: + stats["input_reads"] = int(m.group(1)) + m = re.search(r'(\d+)\s+reads\s+surviving', line, re.IGNORECASE) + if m: + stats["surviving_reads"] = int(m.group(1)) + + # Write normalized TSV + with open(output_path, 'w') as f: + f.write("sample\tinput_reads\tsurviving_reads\ttrimmed_forward\ttrimmed_reverse\tstatus\n") + # Determine sample name from trimmed forward filename + sample = Path(trimmed_forward).stem + # Remove .R1.fq or .F.fq suffix + sample = re.sub(r'\.(R1|F)\.fq$', '', sample) + f.write(f"{sample}\t{stats['input_reads']}\t{stats['surviving_reads']}\t" + f"{trimmed_forward}\t{trimmed_reverse}\t{stats['status']}\n") + + return stats + + +@mcp.tool() +def quality_trim_rad_reads( + input_dir: str, + config_file: str, + work_dir: str, + output_tsv: str +) -> dict: + """Quality-trim RAD sequencing reads using dDocent with a configuration file. + + This endpoint: + 1. Stages raw FASTQ files from input_dir into work_dir + 2. Runs dDocent with the provided configuration file (which must have Trimming set to yes) + 3. Normalizes the dDocent run log into a structured TSV summary + + Args: + input_dir: Directory containing raw gzipped FASTQ files (*.fq.gz) + config_file: dDocent configuration file (must have Trimming set to yes) + work_dir: Working directory for the dDocent run + output_tsv: Path to write the normalized summary TSV + + Returns: + JSON-serializable metadata about the trimming run + """ + # Validate inputs + if not os.path.isdir(input_dir): + raise FileNotFoundError(f"Input directory not found: {input_dir}") + if not os.path.isfile(config_file): + raise FileNotFoundError(f"Config file not found: {config_file}") + + # Read and validate config file + with open(config_file, 'r') as f: + config_content = f.read() + + # Verify trimming is enabled in config + if not re.search(r'^Trimming\s+yes\s*$', config_content, re.IGNORECASE | re.MULTILINE): + raise ValueError("Config file must have 'Trimming yes' to perform quality trimming") + + # Step 1: Stage reads + staging_result = stage_ddocent_reads(input_dir, work_dir) + + # Step 2: Run dDocent with config file + work_path = Path(work_dir) + work_path.mkdir(parents=True, exist_ok=True) + + # Copy config file to working directory if not already there + config_path = Path(config_file) + if config_path.parent != work_path: + local_config = work_path / config_path.name + shutil.copy2(config_path, local_config) + config_arg = str(local_config) + else: + config_arg = config_file + + # Run dDocent + cmd = ["dDocent", config_arg] + try: + result = subprocess.run( + cmd, + cwd=work_dir, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("dDocent executable not found in PATH. Please ensure it is installed.") + + if result.returncode != 0: + error_msg = f"dDocent failed with exit code {result.returncode}\n" + error_msg += f"STDOUT: {result.stdout[-2000:]}\n" + error_msg += f"STDERR: {result.stderr[-2000:]}" + raise RuntimeError(error_msg) + + # Step 3: Find trimmed output files + # dDocent produces trimmed files with .R1.fq and .R2.fq suffixes + trimmed_forward = None + trimmed_reverse = None + + # Look for trimmed files in working directory + r1_files = sorted(work_path.glob("*.R1.fq")) + sorted(work_path.glob("*.R1.fq.gz")) + r2_files = sorted(work_path.glob("*.R2.fq")) + sorted(work_path.glob("*.R2.fq.gz")) + + if r1_files and r2_files: + # Use the first pair found + trimmed_forward = str(r1_files[0]) + trimmed_reverse = str(r2_files[0]) + else: + # Also check for .F.fq and .R.fq naming convention + f_files = sorted(work_path.glob("*.F.fq")) + sorted(work_path.glob("*.F.fq.gz")) + r_files = sorted(work_path.glob("*.R.fq")) + sorted(work_path.glob("*.R.fq.gz")) + if f_files and r_files: + trimmed_forward = str(f_files[0]) + trimmed_reverse = str(r_files[0]) + + if not trimmed_forward or not trimmed_reverse: + raise RuntimeError( + "Could not find trimmed output files. Expected *.R1.fq/*.R2.fq or *.F.fq/*.R.fq in working directory. " + f"Files found: {[str(p) for p in work_path.iterdir() if p.is_file()]}" + ) + + # Step 4: Normalize run output + runs_file = str(work_path / "dDocent.runs") + if not os.path.exists(runs_file): + # Try alternative log file names + for alt in ["dDocent_main.LOG", "dDocent.log"]: + alt_path = work_path / alt + if alt_path.exists(): + runs_file = str(alt_path) + break + + normalize_result = normalize_ddocent_run(runs_file, trimmed_forward, trimmed_reverse, output_tsv) + + # Build result metadata + result_metadata = { + "status": "success", + "input_dir": input_dir, + "config_file": config_file, + "work_dir": work_dir, + "output_tsv": output_tsv, + "trimmed_forward": trimmed_forward, + "trimmed_reverse": trimmed_reverse, + "staged_files": staging_result["staged_files"], + "normalization": normalize_result, + "dDocent_stdout": result.stdout, + "dDocent_stderr": result.stderr + } + + return result_metadata + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ddocent_quality_trim_rad_reads_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ddocent_quality_trim_rad_reads_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..be0788b7f47433ac53be7bfeb137bbc30aedb5e3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ddocent_quality_trim_rad_reads_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "95b3f9d460ce9bb9e5ced9d4c435783c3dfd61bf0d488ae19d192f674e75f058", + "elapsed_seconds": 13.419355869293213, + "usage": { + "prompt_tokens": 12449, + "completion_tokens": 2187, + "total_tokens": 14636, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 12449 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "63d4b5d5-e9d8-4646-b1be-b8d0ca96ba94" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptools_bam_coverage_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptools_bam_coverage_test.py new file mode 100644 index 0000000000000000000000000000000000000000..0217b0ec9db6f69ddb70fb58fe3bfd92b75ab198 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptools_bam_coverage_test.py @@ -0,0 +1,73 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("deeptools") + + +@mcp.tool() +def bam_coverage(input_bam: str, output_bigwig: str) -> dict: + """ + Generate a bigWig coverage file from a BAM file using bamCoverage. + + Args: + input_bam: Path to the input BAM file. + output_bigwig: Path to the output bigWig file. + + Returns: + A dictionary containing the endpoint name, input/output paths, and exit code. + """ + # Create output parent directories if they don't exist + output_path = Path(output_bigwig) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "bamCoverage", + "-b", input_bam, + "-o", output_bigwig, + "--binSize", "10", + "-p", "1", + "--normalizeUsing", "None" + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + check=False, + capture_output=True, + text=True + ) + except FileNotFoundError as e: + return { + "endpoint": "bam_coverage", + "input_bam": input_bam, + "output_bigwig": output_bigwig, + "exit_code": -1, + "error": f"Executable not found: {e}" + } + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError( + f"bamCoverage failed with exit code {result.returncode}: {error_msg}" + ) + + # Return structured JSON-serializable metadata + return { + "endpoint": "bam_coverage", + "input_bam": input_bam, + "output_bigwig": output_bigwig, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptools_bam_coverage_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptools_bam_coverage_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..568c0f450888151da1a169ff34f1eeaed71510ae --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptools_bam_coverage_test.py.raw.txt @@ -0,0 +1,75 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("deeptools") + + +@mcp.tool() +def bam_coverage(input_bam: str, output_bigwig: str) -> dict: + """ + Generate a bigWig coverage file from a BAM file using bamCoverage. + + Args: + input_bam: Path to the input BAM file. + output_bigwig: Path to the output bigWig file. + + Returns: + A dictionary containing the endpoint name, input/output paths, and exit code. + """ + # Create output parent directories if they don't exist + output_path = Path(output_bigwig) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "bamCoverage", + "-b", input_bam, + "-o", output_bigwig, + "--binSize", "10", + "-p", "1", + "--normalizeUsing", "None" + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + check=False, + capture_output=True, + text=True + ) + except FileNotFoundError as e: + return { + "endpoint": "bam_coverage", + "input_bam": input_bam, + "output_bigwig": output_bigwig, + "exit_code": -1, + "error": f"Executable not found: {e}" + } + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError( + f"bamCoverage failed with exit code {result.returncode}: {error_msg}" + ) + + # Return structured JSON-serializable metadata + return { + "endpoint": "bam_coverage", + "input_bam": input_bam, + "output_bigwig": output_bigwig, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptools_bam_coverage_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptools_bam_coverage_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..5ab6a29f965a48aa59dba088fdc2a6183d512d8f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptools_bam_coverage_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "eb3b4ab259c154c5c42185dd7835ab7706ffc3d1b088cd9bd3828142e4a9f90d", + "elapsed_seconds": 5.898371458053589, + "usage": { + "prompt_tokens": 9319, + "completion_tokens": 508, + "total_tokens": 9827, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9319 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "d219f284-4098-4345-ab7a-a949d9bfc79f" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptoolsintervals_query_intervals_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptoolsintervals_query_intervals_test.py new file mode 100644 index 0000000000000000000000000000000000000000..3de186356f0a155e04319db4c3acff71b2e73187 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptoolsintervals_query_intervals_test.py @@ -0,0 +1,76 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import sys +import os +import json +from pathlib import Path + +mcp = FastMCP("deeptoolsintervals") + +@mcp.tool() +def query_intervals(input_bed: str, output_json: str) -> dict: + """ + Build the pinned interval tree and query chrTiny:0-100. + + Args: + input_bed: Path to the input BED/GTF file + output_json: Path where the JSON output will be written + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "python3.11", + "-c", + "import json,sys; from deeptoolsintervals import parse; g=parse.GTF(sys.argv[1]); rows=g.findOverlaps('chrTiny',0,100); open(sys.argv[2],'w').write(json.dumps(rows,sort_keys=True)+'\\n')", + input_bed, + output_json + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Read the output file to return structured metadata + if output_path.exists(): + with open(output_path, 'r') as f: + output_content = f.read() + try: + output_data = json.loads(output_content) + except json.JSONDecodeError: + output_data = output_content + else: + output_data = None + + return { + "status": "success", + "input_bed": input_bed, + "output_json": output_json, + "output_content": output_data, + "stdout": result.stdout, + "stderr": result.stderr, + "returncode": result.returncode + } + + except FileNotFoundError as e: + raise RuntimeError(f"Executable not found: {e}") + except Exception as e: + raise RuntimeError(f"Error executing command: {e}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptoolsintervals_query_intervals_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptoolsintervals_query_intervals_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..13227d64841c83630ef7cf7ef1d29f3475b120d9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptoolsintervals_query_intervals_test.py.raw.txt @@ -0,0 +1,78 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import sys +import os +import json +from pathlib import Path + +mcp = FastMCP("deeptoolsintervals") + +@mcp.tool() +def query_intervals(input_bed: str, output_json: str) -> dict: + """ + Build the pinned interval tree and query chrTiny:0-100. + + Args: + input_bed: Path to the input BED/GTF file + output_json: Path where the JSON output will be written + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "python3.11", + "-c", + "import json,sys; from deeptoolsintervals import parse; g=parse.GTF(sys.argv[1]); rows=g.findOverlaps('chrTiny',0,100); open(sys.argv[2],'w').write(json.dumps(rows,sort_keys=True)+'\\n')", + input_bed, + output_json + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Read the output file to return structured metadata + if output_path.exists(): + with open(output_path, 'r') as f: + output_content = f.read() + try: + output_data = json.loads(output_content) + except json.JSONDecodeError: + output_data = output_content + else: + output_data = None + + return { + "status": "success", + "input_bed": input_bed, + "output_json": output_json, + "output_content": output_data, + "stdout": result.stdout, + "stderr": result.stderr, + "returncode": result.returncode + } + + except FileNotFoundError as e: + raise RuntimeError(f"Executable not found: {e}") + except Exception as e: + raise RuntimeError(f"Error executing command: {e}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptoolsintervals_query_intervals_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptoolsintervals_query_intervals_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..a31d765fc7b9ed7c2459fcdb10a9ccb9ff4dabe3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/deeptoolsintervals_query_intervals_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "d9e36d94d950cd2e64f7afdc4a01daa68dc3b3f438bd0f6be66d12ee815028cb", + "elapsed_seconds": 3.7637267112731934, + "usage": { + "prompt_tokens": 9652, + "completion_tokens": 565, + "total_tokens": 10217, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9652 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "def64533-c5cf-4b1e-872a-0a9b8e7c5376" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/dropkick_filter_cells_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/dropkick_filter_cells_test.py new file mode 100644 index 0000000000000000000000000000000000000000..604530b31729344b46b0974c2cec085a8f5500ff --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/dropkick_filter_cells_test.py @@ -0,0 +1,85 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("dropkick") + +@mcp.tool() +def filter_cells(counts_tsv: str, output_dir: str) -> dict: + """ + Filter a deterministic 80-cell count matrix and emit the per-cell Dropkick score/label CSV. + + Args: + counts_tsv: Path to the input counts TSV file. + output_dir: Directory where output files will be written. + """ + # Create output directory if it doesn't exist + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "dropkick", + "run", + counts_tsv, + "-o", + output_dir, + "--min-genes", + "2", + "--n-ambient", + "5", + "--n-hvgs", + "30", + "-j", + "1", + "-i", + "500", + "--csv", + "-q" + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"dropkick run failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Determine output files that dropkick generates + # Based on the tool's behavior, it writes a CSV with scores/labels + # The exact filename may vary; we'll look for common patterns + output_files = [] + for f in os.listdir(output_dir): + if f.endswith('.csv'): + output_files.append(os.path.join(output_dir, f)) + + # Also check for h5ad files that might be generated + for f in os.listdir(output_dir): + if f.endswith('.h5ad'): + output_files.append(os.path.join(output_dir, f)) + + return { + "status": "success", + "output_dir": output_dir, + "output_files": output_files, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("dropkick executable not found. Ensure it is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error executing dropkick: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/dropkick_filter_cells_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/dropkick_filter_cells_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..228494d601f5354cea9b153a106526659d5df289 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/dropkick_filter_cells_test.py.raw.txt @@ -0,0 +1,87 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("dropkick") + +@mcp.tool() +def filter_cells(counts_tsv: str, output_dir: str) -> dict: + """ + Filter a deterministic 80-cell count matrix and emit the per-cell Dropkick score/label CSV. + + Args: + counts_tsv: Path to the input counts TSV file. + output_dir: Directory where output files will be written. + """ + # Create output directory if it doesn't exist + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "dropkick", + "run", + counts_tsv, + "-o", + output_dir, + "--min-genes", + "2", + "--n-ambient", + "5", + "--n-hvgs", + "30", + "-j", + "1", + "-i", + "500", + "--csv", + "-q" + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"dropkick run failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Determine output files that dropkick generates + # Based on the tool's behavior, it writes a CSV with scores/labels + # The exact filename may vary; we'll look for common patterns + output_files = [] + for f in os.listdir(output_dir): + if f.endswith('.csv'): + output_files.append(os.path.join(output_dir, f)) + + # Also check for h5ad files that might be generated + for f in os.listdir(output_dir): + if f.endswith('.h5ad'): + output_files.append(os.path.join(output_dir, f)) + + return { + "status": "success", + "output_dir": output_dir, + "output_files": output_files, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("dropkick executable not found. Ensure it is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error executing dropkick: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/dropkick_filter_cells_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/dropkick_filter_cells_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..1d487102ce270d9b3a220a88bf579afa05fdee36 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/dropkick_filter_cells_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "95ca2e35dac59717d1bb546526b5544e5111582c8ce30fb4967a4c7a06ac2b3d", + "elapsed_seconds": 3.8197808265686035, + "usage": { + "prompt_tokens": 2987, + "completion_tokens": 566, + "total_tokens": 3553, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 2987 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "2ae1b823-aa31-4bee-beae-d4c1ca6bbf5d" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/emboss_convert_fasta_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/emboss_convert_fasta_test.py new file mode 100644 index 0000000000000000000000000000000000000000..8d73029083258433491a438881103cc5fd102c2a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/emboss_convert_fasta_test.py @@ -0,0 +1,62 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("emboss") + +@mcp.tool() +def convert_fasta(input_file: str, output_file: str) -> dict: + """ + Convert a FASTA file using the EMBOSS seqret tool. + + Args: + input_file: Path to the input sequence file + output_file: Path where the converted output will be written + """ + # Create output parent directories + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "seqret", + "-sequence", input_file, + "-outseq", output_file, + "-auto" + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"seqret failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_file} was not created") + + return { + "success": True, + "input_file": input_file, + "output_file": output_file, + "output_size": output_path.stat().st_size, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("seqret executable not found. Ensure EMBOSS is installed and in PATH") + except Exception as e: + raise RuntimeError(f"Error executing seqret: {str(e)}") \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/emboss_convert_fasta_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/emboss_convert_fasta_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..97f566c6ced4d4bdff3ef434fbf2dfc7ad87eaab --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/emboss_convert_fasta_test.py.raw.txt @@ -0,0 +1,64 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("emboss") + +@mcp.tool() +def convert_fasta(input_file: str, output_file: str) -> dict: + """ + Convert a FASTA file using the EMBOSS seqret tool. + + Args: + input_file: Path to the input sequence file + output_file: Path where the converted output will be written + """ + # Create output parent directories + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "seqret", + "-sequence", input_file, + "-outseq", output_file, + "-auto" + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"seqret failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_file} was not created") + + return { + "success": True, + "input_file": input_file, + "output_file": output_file, + "output_size": output_path.stat().st_size, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("seqret executable not found. Ensure EMBOSS is installed and in PATH") + except Exception as e: + raise RuntimeError(f"Error executing seqret: {str(e)}") +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/emboss_convert_fasta_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/emboss_convert_fasta_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..dcd5ae2ea66d54eb47453ccb503e08ec49d41f1e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/emboss_convert_fasta_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "badec9a54c2e262e9039f07f195e6cb9acfc4590725e226de5414d72c0401ff9", + "elapsed_seconds": 3.6362640857696533, + "usage": { + "prompt_tokens": 7143, + "completion_tokens": 411, + "total_tokens": 7554, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7143 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "3abe83c9-8bae-4980-95d6-7f3b5f16e2f1" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/entrez-direct_extract_assembly_metadata_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/entrez-direct_extract_assembly_metadata_test.py new file mode 100644 index 0000000000000000000000000000000000000000..569b18fa70daaa6ce622fb8a188847153261d523 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/entrez-direct_extract_assembly_metadata_test.py @@ -0,0 +1,74 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("entrez-direct") + + +@mcp.tool() +def extract_assembly_metadata(input_xml: str, output_tsv: str) -> dict: + """ + Extract accession, organism, and assembly status from each local NCBI-style + DocumentSummary record without a network request. + + Args: + input_xml: Path to the input XML file containing DocumentSummary records. + output_tsv: Path where the tab-separated output will be written. + """ + # Resolve paths + input_path = Path(input_xml) + output_path = Path(output_tsv) + + # Validate input file exists + if not input_path.is_file(): + raise FileNotFoundError(f"Input XML file not found: {input_path}") + + # Create output parent directory if needed + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "xtract", + "-input", + str(input_path), + "-pattern", + "DocumentSummary", + "-element", + "AssemblyAccession", + "Organism", + "AssemblyStatus", + ] + + # Execute command + try: + result = subprocess.run( + cmd, + stdin=subprocess.DEVNULL, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError("xtract executable not found in PATH") + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"xtract failed with exit code {result.returncode}: {result.stderr}" + ) + + # Write stdout to output file + output_path.write_text(result.stdout, encoding="utf-8") + + # Return structured metadata + return { + "status": "success", + "output_file": str(output_path), + "records_processed": len(result.stdout.strip().splitlines()) if result.stdout.strip() else 0, + "bytes_written": len(result.stdout.encode("utf-8")), + "command": cmd, + "exit_code": result.returncode, + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/entrez-direct_extract_assembly_metadata_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/entrez-direct_extract_assembly_metadata_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..cc15875bcdafc768a47b9057842137e1acdeb337 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/entrez-direct_extract_assembly_metadata_test.py.raw.txt @@ -0,0 +1,76 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("entrez-direct") + + +@mcp.tool() +def extract_assembly_metadata(input_xml: str, output_tsv: str) -> dict: + """ + Extract accession, organism, and assembly status from each local NCBI-style + DocumentSummary record without a network request. + + Args: + input_xml: Path to the input XML file containing DocumentSummary records. + output_tsv: Path where the tab-separated output will be written. + """ + # Resolve paths + input_path = Path(input_xml) + output_path = Path(output_tsv) + + # Validate input file exists + if not input_path.is_file(): + raise FileNotFoundError(f"Input XML file not found: {input_path}") + + # Create output parent directory if needed + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "xtract", + "-input", + str(input_path), + "-pattern", + "DocumentSummary", + "-element", + "AssemblyAccession", + "Organism", + "AssemblyStatus", + ] + + # Execute command + try: + result = subprocess.run( + cmd, + stdin=subprocess.DEVNULL, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError("xtract executable not found in PATH") + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"xtract failed with exit code {result.returncode}: {result.stderr}" + ) + + # Write stdout to output file + output_path.write_text(result.stdout, encoding="utf-8") + + # Return structured metadata + return { + "status": "success", + "output_file": str(output_path), + "records_processed": len(result.stdout.strip().splitlines()) if result.stdout.strip() else 0, + "bytes_written": len(result.stdout.encode("utf-8")), + "command": cmd, + "exit_code": result.returncode, + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/entrez-direct_extract_assembly_metadata_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/entrez-direct_extract_assembly_metadata_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..e573e0c0d564b04cb59350fc11e91a80fb2dd83f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/entrez-direct_extract_assembly_metadata_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "aa46302f4bebe764d4f56c601d675fed506fe9cefbe739693a9fbe8a2c556e1f", + "elapsed_seconds": 3.649590253829956, + "usage": { + "prompt_tokens": 10083, + "completion_tokens": 500, + "total_tokens": 10583, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10083 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "7fa3198c-bd84-4e20-aac2-ee782abe5e28" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/epic_call_diffuse_peaks_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/epic_call_diffuse_peaks_test.py new file mode 100644 index 0000000000000000000000000000000000000000..faa6e6822545eb6ad1a598149a0c3bc584449310 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/epic_call_diffuse_peaks_test.py @@ -0,0 +1,103 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("epic") + + +@mcp.tool() +def call_diffuse_peaks( + treatment_bed: str, + control_bed: str, + chrom_sizes: str, + output_tsv: str, + output_bed: str, + log_file: str, +) -> Dict[str, Any]: + """ + Call diffuse peaks using epic. + + Args: + treatment_bed: Path to treatment (ChIP) BED file. + control_bed: Path to control (Input) BED file. + chrom_sizes: Path to chromosome sizes file (two columns: name, size). + output_tsv: Path to write the results TSV file. + output_bed: Path to write the summary BED file. + log_file: Path to write log messages. + + Returns: + JSON-serializable metadata about the invocation. + """ + # Create output parent directories + for out_path in [output_tsv, output_bed, log_file]: + parent = Path(out_path).parent + if parent and not parent.exists(): + parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "epic", + "-t", treatment_bed, + "-c", control_bed, + "-cs", chrom_sizes, + "-cpu", "1", + "-w", "10", + "-g", "1", + "-fs", "10", + "-fdr", "1.0", + "-egf", "1.0", + "-o", output_tsv, + "-b", output_bed, + "-l", log_file, + ] + + try: + result = subprocess.run( + cmd, + check=False, + capture_output=True, + text=True, + shell=False, + ) + except Exception as e: + return { + "status": "error", + "error": str(e), + "command": cmd, + } + + if result.returncode != 0: + return { + "status": "error", + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + # Write captured streams to log file (append to log if it exists) + with open(log_file, "a") as f: + if result.stdout: + f.write(result.stdout) + if result.stderr: + f.write(result.stderr) + + return { + "status": "success", + "returncode": result.returncode, + "command": cmd, + "outputs": { + "output_tsv": output_tsv, + "output_bed": output_bed, + "log_file": log_file, + }, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/epic_call_diffuse_peaks_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/epic_call_diffuse_peaks_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..a1d301f24d62c9dd08b90a7eb2930987dad1a819 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/epic_call_diffuse_peaks_test.py.raw.txt @@ -0,0 +1,105 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("epic") + + +@mcp.tool() +def call_diffuse_peaks( + treatment_bed: str, + control_bed: str, + chrom_sizes: str, + output_tsv: str, + output_bed: str, + log_file: str, +) -> Dict[str, Any]: + """ + Call diffuse peaks using epic. + + Args: + treatment_bed: Path to treatment (ChIP) BED file. + control_bed: Path to control (Input) BED file. + chrom_sizes: Path to chromosome sizes file (two columns: name, size). + output_tsv: Path to write the results TSV file. + output_bed: Path to write the summary BED file. + log_file: Path to write log messages. + + Returns: + JSON-serializable metadata about the invocation. + """ + # Create output parent directories + for out_path in [output_tsv, output_bed, log_file]: + parent = Path(out_path).parent + if parent and not parent.exists(): + parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "epic", + "-t", treatment_bed, + "-c", control_bed, + "-cs", chrom_sizes, + "-cpu", "1", + "-w", "10", + "-g", "1", + "-fs", "10", + "-fdr", "1.0", + "-egf", "1.0", + "-o", output_tsv, + "-b", output_bed, + "-l", log_file, + ] + + try: + result = subprocess.run( + cmd, + check=False, + capture_output=True, + text=True, + shell=False, + ) + except Exception as e: + return { + "status": "error", + "error": str(e), + "command": cmd, + } + + if result.returncode != 0: + return { + "status": "error", + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + # Write captured streams to log file (append to log if it exists) + with open(log_file, "a") as f: + if result.stdout: + f.write(result.stdout) + if result.stderr: + f.write(result.stderr) + + return { + "status": "success", + "returncode": result.returncode, + "command": cmd, + "outputs": { + "output_tsv": output_tsv, + "output_bed": output_bed, + "log_file": log_file, + }, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/epic_call_diffuse_peaks_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/epic_call_diffuse_peaks_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..11430440fb53a9c50d133956dbe8c73e7054b0a2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/epic_call_diffuse_peaks_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "7ad1d330e047817501532426efa63b9f135e295507b28934cd0f5e59bf6dcc8a", + "elapsed_seconds": 3.968782424926758, + "usage": { + "prompt_tokens": 9390, + "completion_tokens": 651, + "total_tokens": 10041, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9390 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "6732bd10-e664-4bef-b8f1-3b4beeff8b60" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/f5c_merge_methylation_frequencies_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/f5c_merge_methylation_frequencies_test.py new file mode 100644 index 0000000000000000000000000000000000000000..e2d8a7974a4014e142b9294989d0c2a9bb57796e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/f5c_merge_methylation_frequencies_test.py @@ -0,0 +1,73 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json + +mcp = FastMCP("f5c") + +@mcp.tool() +def merge_methylation_frequencies(input_a: str, input_b: str, output_tsv: str) -> dict: + """ + Merge called and methylated-site counts at shared CpG coordinates and preserve non-overlapping sites. + """ + # Create output parent directories if they don't exist + output_dir = os.path.dirname(os.path.abspath(output_tsv)) + os.makedirs(output_dir, exist_ok=True) + + # Build command exactly as per execution plan + cmd = [ + "f5c", + "freq-merge", + "-o", + output_tsv, + input_a, + input_b + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Check that output file was created + if not os.path.isfile(output_tsv): + return { + "success": False, + "error": "Output file was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "output_tsv": output_tsv, + "input_a": input_a, + "input_b": input_b, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/f5c_merge_methylation_frequencies_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/f5c_merge_methylation_frequencies_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..7627b469ce97b33db981c06891da45caa4ffe959 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/f5c_merge_methylation_frequencies_test.py.raw.txt @@ -0,0 +1,75 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json + +mcp = FastMCP("f5c") + +@mcp.tool() +def merge_methylation_frequencies(input_a: str, input_b: str, output_tsv: str) -> dict: + """ + Merge called and methylated-site counts at shared CpG coordinates and preserve non-overlapping sites. + """ + # Create output parent directories if they don't exist + output_dir = os.path.dirname(os.path.abspath(output_tsv)) + os.makedirs(output_dir, exist_ok=True) + + # Build command exactly as per execution plan + cmd = [ + "f5c", + "freq-merge", + "-o", + output_tsv, + input_a, + input_b + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Check that output file was created + if not os.path.isfile(output_tsv): + return { + "success": False, + "error": "Output file was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "output_tsv": output_tsv, + "input_a": input_a, + "input_b": input_b, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/f5c_merge_methylation_frequencies_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/f5c_merge_methylation_frequencies_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..311c8e339deb9008e667dec91db47e63947384dd --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/f5c_merge_methylation_frequencies_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "c4ba93e725f7769d6fa733d0f8602ec3c15b4115bb6ee662469a54566378786f", + "elapsed_seconds": 3.1329784393310547, + "usage": { + "prompt_tokens": 690, + "completion_tokens": 470, + "total_tokens": 1160, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 690 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "1ef574ce-77ce-47b1-b5ec-109beab8e041" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/famsa_align_proteins_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/famsa_align_proteins_test.py new file mode 100644 index 0000000000000000000000000000000000000000..26e64130b0d21bb38c5981efdec0214b1380c7f4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/famsa_align_proteins_test.py @@ -0,0 +1,95 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("famsa-mcp") + +@mcp.tool() +def align_proteins(input_file: str, output_file: str) -> dict: + """ + Align protein sequences using FAMSA. + + Args: + input_file: Path to input FASTA file + output_file: Path to output alignment file (FASTA format) + + Returns: + Dictionary with execution metadata + """ + # Create output parent directories if they don't exist + output_path = Path(output_file) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "famsa", + "-t", "1", + input_file, + output_file + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + return { + "success": False, + "error": f"Executable 'famsa' not found. Ensure it is installed and in PATH.", + "command": cmd, + "returncode": None + } + except Exception as e: + return { + "success": False, + "error": f"Execution failed: {str(e)}", + "command": cmd, + "returncode": None + } + + # Check for non-zero exit + if result.returncode != 0: + return { + "success": False, + "error": f"FAMSA exited with code {result.returncode}", + "stderr": result.stderr, + "stdout": result.stdout, + "command": cmd, + "returncode": result.returncode + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file {output_file} was not created", + "stderr": result.stderr, + "stdout": result.stdout, + "command": cmd, + "returncode": result.returncode + } + + # Return structured metadata + return { + "success": True, + "command": cmd, + "returncode": result.returncode, + "input_file": input_file, + "output_file": output_file, + "output_exists": True, + "output_size": output_path.stat().st_size if output_path.exists() else 0, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/famsa_align_proteins_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/famsa_align_proteins_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..b78f1ec910491434967426fcd03f93483edefe14 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/famsa_align_proteins_test.py.raw.txt @@ -0,0 +1,97 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("famsa-mcp") + +@mcp.tool() +def align_proteins(input_file: str, output_file: str) -> dict: + """ + Align protein sequences using FAMSA. + + Args: + input_file: Path to input FASTA file + output_file: Path to output alignment file (FASTA format) + + Returns: + Dictionary with execution metadata + """ + # Create output parent directories if they don't exist + output_path = Path(output_file) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "famsa", + "-t", "1", + input_file, + output_file + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + return { + "success": False, + "error": f"Executable 'famsa' not found. Ensure it is installed and in PATH.", + "command": cmd, + "returncode": None + } + except Exception as e: + return { + "success": False, + "error": f"Execution failed: {str(e)}", + "command": cmd, + "returncode": None + } + + # Check for non-zero exit + if result.returncode != 0: + return { + "success": False, + "error": f"FAMSA exited with code {result.returncode}", + "stderr": result.stderr, + "stdout": result.stdout, + "command": cmd, + "returncode": result.returncode + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file {output_file} was not created", + "stderr": result.stderr, + "stdout": result.stdout, + "command": cmd, + "returncode": result.returncode + } + + # Return structured metadata + return { + "success": True, + "command": cmd, + "returncode": result.returncode, + "input_file": input_file, + "output_file": output_file, + "output_exists": True, + "output_size": output_path.stat().st_size if output_path.exists() else 0, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/famsa_align_proteins_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/famsa_align_proteins_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..797752a1ec39d187fb74d00cf1f09deac648a6be --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/famsa_align_proteins_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "d1592abb513af797c8223090610fd8579e5b21b63dd75db97f1bab5e1ee4567a", + "elapsed_seconds": 3.717963933944702, + "usage": { + "prompt_tokens": 1065, + "completion_tokens": 611, + "total_tokens": 1676, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1065 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "d0029e27-a697-4292-be76-003b4685cdb9" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastani_compute_ani_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastani_compute_ani_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2b2925697d15ed1e1de6ee0e7c2eece9db655666 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastani_compute_ani_test.py @@ -0,0 +1,63 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("fastani") + + +@mcp.tool() +def compute_ani(query_fasta: str, reference_fasta: str, output_table: str) -> dict: + """ + Compute ANI between a query and reference genome using FastANI. + + Args: + query_fasta: Path to the query genome FASTA file. + reference_fasta: Path to the reference genome FASTA file. + output_table: Path where the output table will be written. + + Returns: + A dictionary with metadata about the execution. + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_table) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "fastANI", + "-q", + query_fasta, + "-r", + reference_fasta, + "--fragLen", + "100", + "-t", + "1", + "-o", + output_table, + ] + + # Run the command without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"fastANI failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured JSON-serializable metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_table": output_table, + "query_fasta": query_fasta, + "reference_fasta": reference_fasta, + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastani_compute_ani_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastani_compute_ani_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..f23e4fa65df292aa33b955035a02904527958a41 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastani_compute_ani_test.py.raw.txt @@ -0,0 +1,65 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("fastani") + + +@mcp.tool() +def compute_ani(query_fasta: str, reference_fasta: str, output_table: str) -> dict: + """ + Compute ANI between a query and reference genome using FastANI. + + Args: + query_fasta: Path to the query genome FASTA file. + reference_fasta: Path to the reference genome FASTA file. + output_table: Path where the output table will be written. + + Returns: + A dictionary with metadata about the execution. + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_table) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "fastANI", + "-q", + query_fasta, + "-r", + reference_fasta, + "--fragLen", + "100", + "-t", + "1", + "-o", + output_table, + ] + + # Run the command without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"fastANI failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured JSON-serializable metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_table": output_table, + "query_fasta": query_fasta, + "reference_fasta": reference_fasta, + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastani_compute_ani_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastani_compute_ani_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..f3a59379fb18966b57809b5cd3274b1cc2391116 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastani_compute_ani_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "9af8efa52ebe9eeb2518600820a085e3ad72d7f1e4f03234b0a8dcb0ae3fa175", + "elapsed_seconds": 3.3769357204437256, + "usage": { + "prompt_tokens": 7784, + "completion_tokens": 424, + "total_tokens": 8208, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7784 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "8fb1fc30-7072-4b0b-a476-65443a598d09" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastp_preprocess_reads_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastp_preprocess_reads_test.py new file mode 100644 index 0000000000000000000000000000000000000000..6c6f7866bbebbbf3b4a51fe62695082c7502cbae --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastp_preprocess_reads_test.py @@ -0,0 +1,90 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("fastp") + +@mcp.tool() +def preprocess_reads( + input_fastq: str, + output_fastq: str, + report_json: str, + report_html: str, +) -> dict: + """ + Preprocess a single-end FASTQ file using fastp with minimal filtering. + Adapter trimming and quality filtering are disabled; only length filtering + is effectively disabled by setting length_required to 1. + """ + # Create output parent directories + for path_str in [output_fastq, report_json, report_html]: + path = Path(path_str) + if path.parent and not path.parent.exists(): + path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "fastp", + "-i", input_fastq, + "-o", output_fastq, + "--json", report_json, + "--html", report_html, + "--thread", "1", + "--disable_adapter_trimming", + "--disable_quality_filtering", + "--length_required", "1" + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": f"Executable 'fastp' not found in PATH. Please ensure fastp 1.3.6 is installed.", + "command": cmd + } + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr.strip() else result.stdout.strip() + return { + "success": False, + "error": f"fastp exited with code {result.returncode}: {error_msg}", + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + + # Read the JSON report if it exists + report_data = None + if os.path.exists(report_json): + try: + with open(report_json, "r") as f: + report_data = json.load(f) + except (json.JSONDecodeError, OSError) as e: + report_data = {"error": f"Failed to parse JSON report: {str(e)}"} + + # Return structured metadata + return { + "success": True, + "command": cmd, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "report_json": report_json, + "report_html": report_html, + "report": report_data, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastp_preprocess_reads_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastp_preprocess_reads_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..b87dede824e422edd24509b94750c6abf1b8ee13 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastp_preprocess_reads_test.py.raw.txt @@ -0,0 +1,92 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("fastp") + +@mcp.tool() +def preprocess_reads( + input_fastq: str, + output_fastq: str, + report_json: str, + report_html: str, +) -> dict: + """ + Preprocess a single-end FASTQ file using fastp with minimal filtering. + Adapter trimming and quality filtering are disabled; only length filtering + is effectively disabled by setting length_required to 1. + """ + # Create output parent directories + for path_str in [output_fastq, report_json, report_html]: + path = Path(path_str) + if path.parent and not path.parent.exists(): + path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "fastp", + "-i", input_fastq, + "-o", output_fastq, + "--json", report_json, + "--html", report_html, + "--thread", "1", + "--disable_adapter_trimming", + "--disable_quality_filtering", + "--length_required", "1" + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": f"Executable 'fastp' not found in PATH. Please ensure fastp 1.3.6 is installed.", + "command": cmd + } + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr.strip() else result.stdout.strip() + return { + "success": False, + "error": f"fastp exited with code {result.returncode}: {error_msg}", + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + + # Read the JSON report if it exists + report_data = None + if os.path.exists(report_json): + try: + with open(report_json, "r") as f: + report_data = json.load(f) + except (json.JSONDecodeError, OSError) as e: + report_data = {"error": f"Failed to parse JSON report: {str(e)}"} + + # Return structured metadata + return { + "success": True, + "command": cmd, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "report_json": report_json, + "report_html": report_html, + "report": report_data, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastp_preprocess_reads_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastp_preprocess_reads_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..99b87aadf10f0db62f0d299410aa1de8f23c9f9e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/fastp_preprocess_reads_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "6adf3bb97b71c39fc9bbff9722c79af2a097b011f613153218beef4c5bfbe508", + "elapsed_seconds": 5.5560526847839355, + "usage": { + "prompt_tokens": 3495, + "completion_tokens": 652, + "total_tokens": 4147, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 3495 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "13a8d9da-889c-4bad-b978-4f29dd740fe8" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/flye_assemble_hifi_reads_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/flye_assemble_hifi_reads_test.py new file mode 100644 index 0000000000000000000000000000000000000000..dbc13353a3963de094bdfa5a59078728387df5f2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/flye_assemble_hifi_reads_test.py @@ -0,0 +1,104 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("flye-mcp") + +@mcp.tool() +def assemble_hifi_reads(reads_fasta: str, output_dir: str) -> dict: + """ + Assemble PacBio HiFi reads using Flye. + + Args: + reads_fasta: Path to input reads file (FASTA/FASTQ, optionally gzipped) + output_dir: Directory for assembly output + + Returns: + Dictionary with assembly metadata + """ + # Validate input file exists + reads_path = Path(reads_fasta) + if not reads_path.exists(): + raise FileNotFoundError(f"Input reads file not found: {reads_fasta}") + + # Create output directory if it doesn't exist + out_path = Path(output_dir) + out_path.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "flye", + "--pacbio-hifi", + str(reads_path), + "--out-dir", + str(out_path), + "--genome-size", + "10k", + "--threads", + "1", + "--iterations", + "0", + "--min-overlap", + "1000" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("Flye executable not found in PATH. Please ensure flye is installed.") + except Exception as e: + raise RuntimeError(f"Failed to execute Flye: {str(e)}") + + # Check exit code + if result.returncode != 0: + error_msg = f"Flye failed with exit code {result.returncode}\n" + if result.stderr: + error_msg += f"stderr: {result.stderr}\n" + if result.stdout: + error_msg += f"stdout: {result.stdout}\n" + raise RuntimeError(error_msg) + + # Collect output metadata + assembly_files = [] + if out_path.exists(): + for f in sorted(out_path.iterdir()): + if f.is_file(): + assembly_files.append(str(f)) + + # Check for expected output files + expected_files = [ + "assembly.fasta", + "assembly_graph.gfa", + "assembly_graph.gv", + "assembly_info.txt", + "scaffolds.fasta" # may not exist if scaffolding disabled + ] + + found_files = {} + for expected in expected_files: + fpath = out_path / expected + found_files[expected] = str(fpath) if fpath.exists() else None + + return { + "status": "success", + "output_dir": str(out_path), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "assembly_files": assembly_files, + "expected_outputs": found_files, + "command": cmd + } + +# Keep the server running +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/flye_assemble_hifi_reads_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/flye_assemble_hifi_reads_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..1f9f5a201aa37270e6d7abab710bce6cc9c92ea0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/flye_assemble_hifi_reads_test.py.raw.txt @@ -0,0 +1,106 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("flye-mcp") + +@mcp.tool() +def assemble_hifi_reads(reads_fasta: str, output_dir: str) -> dict: + """ + Assemble PacBio HiFi reads using Flye. + + Args: + reads_fasta: Path to input reads file (FASTA/FASTQ, optionally gzipped) + output_dir: Directory for assembly output + + Returns: + Dictionary with assembly metadata + """ + # Validate input file exists + reads_path = Path(reads_fasta) + if not reads_path.exists(): + raise FileNotFoundError(f"Input reads file not found: {reads_fasta}") + + # Create output directory if it doesn't exist + out_path = Path(output_dir) + out_path.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "flye", + "--pacbio-hifi", + str(reads_path), + "--out-dir", + str(out_path), + "--genome-size", + "10k", + "--threads", + "1", + "--iterations", + "0", + "--min-overlap", + "1000" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("Flye executable not found in PATH. Please ensure flye is installed.") + except Exception as e: + raise RuntimeError(f"Failed to execute Flye: {str(e)}") + + # Check exit code + if result.returncode != 0: + error_msg = f"Flye failed with exit code {result.returncode}\n" + if result.stderr: + error_msg += f"stderr: {result.stderr}\n" + if result.stdout: + error_msg += f"stdout: {result.stdout}\n" + raise RuntimeError(error_msg) + + # Collect output metadata + assembly_files = [] + if out_path.exists(): + for f in sorted(out_path.iterdir()): + if f.is_file(): + assembly_files.append(str(f)) + + # Check for expected output files + expected_files = [ + "assembly.fasta", + "assembly_graph.gfa", + "assembly_graph.gv", + "assembly_info.txt", + "scaffolds.fasta" # may not exist if scaffolding disabled + ] + + found_files = {} + for expected in expected_files: + fpath = out_path / expected + found_files[expected] = str(fpath) if fpath.exists() else None + + return { + "status": "success", + "output_dir": str(out_path), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "assembly_files": assembly_files, + "expected_outputs": found_files, + "command": cmd + } + +# Keep the server running +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/flye_assemble_hifi_reads_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/flye_assemble_hifi_reads_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..8a43fddee598eddf877416d6fee652f7041c2623 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/flye_assemble_hifi_reads_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "fde930df8170f876f0105423a02615e9005caaa80abf312ebbff9dd7d5a65753", + "elapsed_seconds": 4.444652795791626, + "usage": { + "prompt_tokens": 1476, + "completion_tokens": 699, + "total_tokens": 2175, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1476 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "2917266b-7baa-4b28-9794-86d05983c134" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/freebayes_call_variants_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/freebayes_call_variants_test.py new file mode 100644 index 0000000000000000000000000000000000000000..9032008223838e3fba4d44ab80c94d6e5924891b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/freebayes_call_variants_test.py @@ -0,0 +1,89 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("freebayes") + + +@mcp.tool() +def call_variants( + reference_fasta: str, + input_bam: str, + output_vcf: str, +) -> dict[str, Any]: + """ + Call variants from aligned short-read sequencing data using FreeBayes. + + Args: + reference_fasta: Path to the reference FASTA file. + input_bam: Path to the input BAM file. + output_vcf: Path where the VCF output will be written. + """ + # Validate required inputs + if not reference_fasta: + raise ValueError("reference_fasta is required") + if not input_bam: + raise ValueError("input_bam is required") + if not output_vcf: + raise ValueError("output_vcf is required") + + # Create output parent directory if needed + output_path = Path(output_vcf) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "freebayes", + "-f", + reference_fasta, + input_bam, + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "freebayes executable not found. Ensure it is installed and in PATH." + ) + + # Check exit code + if result.returncode != 0: + stderr_msg = result.stderr.strip() if result.stderr else "No stderr output" + raise RuntimeError( + f"freebayes failed with exit code {result.returncode}: {stderr_msg}" + ) + + # Write stdout to output file + try: + with open(output_path, "w", encoding="utf-8") as f: + f.write(result.stdout) + except OSError as e: + raise RuntimeError(f"Failed to write output file {output_path}: {e}") + + # Return structured metadata + return { + "endpoint": "call_variants", + "status": "success", + "output_vcf": str(output_path), + "command": cmd, + "exit_code": result.returncode, + "stdout_size": len(result.stdout), + "stderr_size": len(result.stderr), + "stderr_preview": result.stderr[:500] if result.stderr else "", + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/freebayes_call_variants_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/freebayes_call_variants_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..20c3076d32e55b354965d8424cba3924b9a74b64 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/freebayes_call_variants_test.py.raw.txt @@ -0,0 +1,91 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("freebayes") + + +@mcp.tool() +def call_variants( + reference_fasta: str, + input_bam: str, + output_vcf: str, +) -> dict[str, Any]: + """ + Call variants from aligned short-read sequencing data using FreeBayes. + + Args: + reference_fasta: Path to the reference FASTA file. + input_bam: Path to the input BAM file. + output_vcf: Path where the VCF output will be written. + """ + # Validate required inputs + if not reference_fasta: + raise ValueError("reference_fasta is required") + if not input_bam: + raise ValueError("input_bam is required") + if not output_vcf: + raise ValueError("output_vcf is required") + + # Create output parent directory if needed + output_path = Path(output_vcf) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "freebayes", + "-f", + reference_fasta, + input_bam, + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "freebayes executable not found. Ensure it is installed and in PATH." + ) + + # Check exit code + if result.returncode != 0: + stderr_msg = result.stderr.strip() if result.stderr else "No stderr output" + raise RuntimeError( + f"freebayes failed with exit code {result.returncode}: {stderr_msg}" + ) + + # Write stdout to output file + try: + with open(output_path, "w", encoding="utf-8") as f: + f.write(result.stdout) + except OSError as e: + raise RuntimeError(f"Failed to write output file {output_path}: {e}") + + # Return structured metadata + return { + "endpoint": "call_variants", + "status": "success", + "output_vcf": str(output_path), + "command": cmd, + "exit_code": result.returncode, + "stdout_size": len(result.stdout), + "stderr_size": len(result.stderr), + "stderr_preview": result.stderr[:500] if result.stderr else "", + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/freebayes_call_variants_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/freebayes_call_variants_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..5f8f6a5df2c353bdf7c4ab3f09b1fa4aedb888fa --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/freebayes_call_variants_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "4230021f49a4c080a593d941691dba40d6a989d59bab038d04d8fa2f4f2108dc", + "elapsed_seconds": 3.5405988693237305, + "usage": { + "prompt_tokens": 3179, + "completion_tokens": 591, + "total_tokens": 3770, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 3179 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "a62fd556-fbf1-4c8e-b280-b410e37cf79f" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genoboo_launch_local_notebook_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genoboo_launch_local_notebook_test.py new file mode 100644 index 0000000000000000000000000000000000000000..54f7d54decdf9c6ba959dd5eb712d272af0b44ed --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genoboo_launch_local_notebook_test.py @@ -0,0 +1,134 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import time +import signal +import json +import urllib.request +import urllib.error +from pathlib import Path + +mcp = FastMCP("genoboo") + +@mcp.tool() +def launch_local_notebook( + config_json: str, + db_dir: str, + storage_dir: str, + landing_html: str, + server_log: str, + mongo_log: str +) -> dict: + """ + Launch a fresh local GeneNoteBook service, verify its HTTP landing page, + and leave no background process running. + """ + # Create output parent directories + for path_str in [landing_html, server_log, mongo_log]: + Path(path_str).parent.mkdir(parents=True, exist_ok=True) + Path(db_dir).mkdir(parents=True, exist_ok=True) + Path(storage_dir).mkdir(parents=True, exist_ok=True) + + # Start mongod + mongo_cmd = [ + "mongod", + "--dbpath", db_dir, + "--port", "39224", + "--bind_ip", "127.0.0.1", + "--logpath", mongo_log + ] + mongo_proc = subprocess.Popen( + mongo_cmd, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True + ) + + # Start genoboo server + genoboo_cmd = [ + "genoboo", + "run", + "--config", config_json, + "--mongo-url", "mongodb://127.0.0.1:39224/genenotebook", + "--storage-path", storage_dir, + "--port", "39223" + ] + server_proc = subprocess.Popen( + genoboo_cmd, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True + ) + + try: + # Poll mongod until ready (up to 30 seconds) + mongo_ready = False + for _ in range(60): + if mongo_proc.poll() is not None: + break + try: + with urllib.request.urlopen("http://127.0.0.1:39224", timeout=1) as resp: + if resp.status == 200: + mongo_ready = True + break + except (urllib.error.URLError, OSError): + pass + time.sleep(0.5) + + if not mongo_ready: + raise RuntimeError("MongoDB failed to start within 30 seconds") + + # Poll genoboo server until ready (up to 60 seconds) + server_ready = False + for _ in range(120): + if server_proc.poll() is not None: + break + try: + with urllib.request.urlopen("http://127.0.0.1:39223/", timeout=1) as resp: + if resp.status == 200: + server_ready = True + break + except (urllib.error.URLError, OSError): + pass + time.sleep(0.5) + + if not server_ready: + raise RuntimeError("Genoboo server failed to start within 60 seconds") + + # Capture landing page + with urllib.request.urlopen("http://127.0.0.1:39223/", timeout=5) as resp: + landing_content = resp.read().decode("utf-8") + with open(landing_html, "w", encoding="utf-8") as f: + f.write(landing_content) + + # Capture server logs + server_stdout, _ = server_proc.communicate(timeout=5) + with open(server_log, "w", encoding="utf-8") as f: + f.write(server_stdout or "") + + # Capture mongo logs + mongo_stdout, _ = mongo_proc.communicate(timeout=5) + with open(mongo_log, "a", encoding="utf-8") as f: + f.write(mongo_stdout or "") + + return { + "status": "success", + "landing_html": landing_html, + "server_log": server_log, + "mongo_log": mongo_log, + "landing_page_size": len(landing_content), + "server_pid": server_proc.pid, + "mongo_pid": mongo_proc.pid + } + + finally: + # Clean up processes + for proc in [server_proc, mongo_proc]: + if proc.poll() is None: + proc.terminate() + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + proc.wait() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genoboo_launch_local_notebook_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genoboo_launch_local_notebook_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..0d83ff4c7bc50164a63a0c00cb457bcd154e702e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genoboo_launch_local_notebook_test.py.raw.txt @@ -0,0 +1,136 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import time +import signal +import json +import urllib.request +import urllib.error +from pathlib import Path + +mcp = FastMCP("genoboo") + +@mcp.tool() +def launch_local_notebook( + config_json: str, + db_dir: str, + storage_dir: str, + landing_html: str, + server_log: str, + mongo_log: str +) -> dict: + """ + Launch a fresh local GeneNoteBook service, verify its HTTP landing page, + and leave no background process running. + """ + # Create output parent directories + for path_str in [landing_html, server_log, mongo_log]: + Path(path_str).parent.mkdir(parents=True, exist_ok=True) + Path(db_dir).mkdir(parents=True, exist_ok=True) + Path(storage_dir).mkdir(parents=True, exist_ok=True) + + # Start mongod + mongo_cmd = [ + "mongod", + "--dbpath", db_dir, + "--port", "39224", + "--bind_ip", "127.0.0.1", + "--logpath", mongo_log + ] + mongo_proc = subprocess.Popen( + mongo_cmd, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True + ) + + # Start genoboo server + genoboo_cmd = [ + "genoboo", + "run", + "--config", config_json, + "--mongo-url", "mongodb://127.0.0.1:39224/genenotebook", + "--storage-path", storage_dir, + "--port", "39223" + ] + server_proc = subprocess.Popen( + genoboo_cmd, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True + ) + + try: + # Poll mongod until ready (up to 30 seconds) + mongo_ready = False + for _ in range(60): + if mongo_proc.poll() is not None: + break + try: + with urllib.request.urlopen("http://127.0.0.1:39224", timeout=1) as resp: + if resp.status == 200: + mongo_ready = True + break + except (urllib.error.URLError, OSError): + pass + time.sleep(0.5) + + if not mongo_ready: + raise RuntimeError("MongoDB failed to start within 30 seconds") + + # Poll genoboo server until ready (up to 60 seconds) + server_ready = False + for _ in range(120): + if server_proc.poll() is not None: + break + try: + with urllib.request.urlopen("http://127.0.0.1:39223/", timeout=1) as resp: + if resp.status == 200: + server_ready = True + break + except (urllib.error.URLError, OSError): + pass + time.sleep(0.5) + + if not server_ready: + raise RuntimeError("Genoboo server failed to start within 60 seconds") + + # Capture landing page + with urllib.request.urlopen("http://127.0.0.1:39223/", timeout=5) as resp: + landing_content = resp.read().decode("utf-8") + with open(landing_html, "w", encoding="utf-8") as f: + f.write(landing_content) + + # Capture server logs + server_stdout, _ = server_proc.communicate(timeout=5) + with open(server_log, "w", encoding="utf-8") as f: + f.write(server_stdout or "") + + # Capture mongo logs + mongo_stdout, _ = mongo_proc.communicate(timeout=5) + with open(mongo_log, "a", encoding="utf-8") as f: + f.write(mongo_stdout or "") + + return { + "status": "success", + "landing_html": landing_html, + "server_log": server_log, + "mongo_log": mongo_log, + "landing_page_size": len(landing_content), + "server_pid": server_proc.pid, + "mongo_pid": mongo_proc.pid + } + + finally: + # Clean up processes + for proc in [server_proc, mongo_proc]: + if proc.poll() is None: + proc.terminate() + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + proc.wait() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genoboo_launch_local_notebook_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genoboo_launch_local_notebook_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..81d95d51acab462c562c8d76eee946fd4091ef46 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genoboo_launch_local_notebook_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "012e0a415712aeb93d6af7c4847b5e2bbaecfe7dfa2dc7a7b54db07347c1d71f", + "elapsed_seconds": 11.963592052459717, + "usage": { + "prompt_tokens": 7330, + "completion_tokens": 1064, + "total_tokens": 8394, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7330 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "1e5a5e2a-833b-48c3-b4be-8f12b917ec44" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genometools-genometools_sort_gff3_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genometools-genometools_sort_gff3_test.py new file mode 100644 index 0000000000000000000000000000000000000000..33e5f2f40f11ebf45363f9de11bb60cf1735de61 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genometools-genometools_sort_gff3_test.py @@ -0,0 +1,66 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("genometools-genometools") + +@mcp.tool() +def sort_gff3(input_gff3: str, output_gff3: str) -> dict: + """ + Sort and tidy a GFF3 file using GenomeTools. + + Args: + input_gff3: Path to the input GFF3 file. + output_gff3: Path where the sorted and tidied GFF3 output will be written. + + Returns: + A dictionary with metadata about the operation. + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_gff3) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "gt", + "gff3", + "-sort", + "-tidy", + "-o", + output_gff3, + input_gff3 + ] + + # Run the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = f"gt gff3 failed with exit code {result.returncode}\n" + if result.stderr: + error_msg += f"stderr: {result.stderr}\n" + if result.stdout: + error_msg += f"stdout: {result.stdout}\n" + raise RuntimeError(error_msg) + + # Return structured JSON-serializable metadata + return { + "endpoint": "sort_gff3", + "input_gff3": input_gff3, + "output_gff3": output_gff3, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genometools-genometools_sort_gff3_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genometools-genometools_sort_gff3_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..dbe437179166853be339c245616e70559ea1fa60 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genometools-genometools_sort_gff3_test.py.raw.txt @@ -0,0 +1,68 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("genometools-genometools") + +@mcp.tool() +def sort_gff3(input_gff3: str, output_gff3: str) -> dict: + """ + Sort and tidy a GFF3 file using GenomeTools. + + Args: + input_gff3: Path to the input GFF3 file. + output_gff3: Path where the sorted and tidied GFF3 output will be written. + + Returns: + A dictionary with metadata about the operation. + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_gff3) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "gt", + "gff3", + "-sort", + "-tidy", + "-o", + output_gff3, + input_gff3 + ] + + # Run the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = f"gt gff3 failed with exit code {result.returncode}\n" + if result.stderr: + error_msg += f"stderr: {result.stderr}\n" + if result.stdout: + error_msg += f"stdout: {result.stdout}\n" + raise RuntimeError(error_msg) + + # Return structured JSON-serializable metadata + return { + "endpoint": "sort_gff3", + "input_gff3": input_gff3, + "output_gff3": output_gff3, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genometools-genometools_sort_gff3_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genometools-genometools_sort_gff3_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..ed2334f2bc83146d72b67195ac519690eacf90a9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/genometools-genometools_sort_gff3_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e504dd8ffd603b66407a83a5e221281e6569a4ec2072cd85a4f6532ac937ce29", + "elapsed_seconds": 3.2339818477630615, + "usage": { + "prompt_tokens": 9056, + "completion_tokens": 463, + "total_tokens": 9519, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9056 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "9a026407-7054-47ee-b974-8f27ec720a7f" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffread_extract_transcripts_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffread_extract_transcripts_test.py new file mode 100644 index 0000000000000000000000000000000000000000..76e285ccf886a752605d060f998767b8c52c1699 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffread_extract_transcripts_test.py @@ -0,0 +1,99 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("gffread-extract-transcripts") + +@mcp.tool() +def extract_transcripts( + annotation_file: str, + reference_file: str, + output_fasta: str, +) -> dict: + """ + Extract spliced exon sequences for each transcript from a GFF/GTF/BED + annotation file using the reference genome. + + Args: + annotation_file: Path to the input GFF/GTF/BED annotation file. + reference_file: Path to the multi-fasta file with genomic sequences. + output_fasta: Path where the output FASTA file with spliced exons will be written. + """ + # Validate required inputs + annotation_path = Path(annotation_file) + reference_path = Path(reference_file) + output_path = Path(output_fasta) + + if not annotation_path.exists(): + raise FileNotFoundError(f"Annotation file not found: {annotation_path}") + if not reference_path.exists(): + raise FileNotFoundError(f"Reference file not found: {reference_path}") + + # Create output parent directory if needed + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "gffread", + str(annotation_path), + "-g", + str(reference_path), + "-w", + str(output_path), + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "gffread executable not found. Please ensure it is installed and in PATH." + ) + + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError( + f"gffread failed with exit code {result.returncode}: {error_msg}" + ) + + # Verify output was created + if not output_path.exists(): + raise RuntimeError( + f"gffread completed but output file was not created: {output_path}" + ) + + # Gather metadata about the output + output_size = output_path.stat().st_size + output_lines = 0 + transcript_count = 0 + try: + with open(output_path, "r", encoding="utf-8", errors="replace") as f: + for line in f: + output_lines += 1 + if line.startswith(">"): + transcript_count += 1 + except Exception: + pass + + return { + "status": "success", + "command": cmd, + "exit_code": result.returncode, + "output_file": str(output_path), + "output_size_bytes": output_size, + "output_lines": output_lines, + "transcript_count": transcript_count, + "stdout": result.stdout, + "stderr": result.stderr, + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffread_extract_transcripts_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffread_extract_transcripts_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..6b1168642e83b63e4610fefdd883d620cae5fb51 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffread_extract_transcripts_test.py.raw.txt @@ -0,0 +1,101 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("gffread-extract-transcripts") + +@mcp.tool() +def extract_transcripts( + annotation_file: str, + reference_file: str, + output_fasta: str, +) -> dict: + """ + Extract spliced exon sequences for each transcript from a GFF/GTF/BED + annotation file using the reference genome. + + Args: + annotation_file: Path to the input GFF/GTF/BED annotation file. + reference_file: Path to the multi-fasta file with genomic sequences. + output_fasta: Path where the output FASTA file with spliced exons will be written. + """ + # Validate required inputs + annotation_path = Path(annotation_file) + reference_path = Path(reference_file) + output_path = Path(output_fasta) + + if not annotation_path.exists(): + raise FileNotFoundError(f"Annotation file not found: {annotation_path}") + if not reference_path.exists(): + raise FileNotFoundError(f"Reference file not found: {reference_path}") + + # Create output parent directory if needed + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "gffread", + str(annotation_path), + "-g", + str(reference_path), + "-w", + str(output_path), + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "gffread executable not found. Please ensure it is installed and in PATH." + ) + + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError( + f"gffread failed with exit code {result.returncode}: {error_msg}" + ) + + # Verify output was created + if not output_path.exists(): + raise RuntimeError( + f"gffread completed but output file was not created: {output_path}" + ) + + # Gather metadata about the output + output_size = output_path.stat().st_size + output_lines = 0 + transcript_count = 0 + try: + with open(output_path, "r", encoding="utf-8", errors="replace") as f: + for line in f: + output_lines += 1 + if line.startswith(">"): + transcript_count += 1 + except Exception: + pass + + return { + "status": "success", + "command": cmd, + "exit_code": result.returncode, + "output_file": str(output_path), + "output_size_bytes": output_size, + "output_lines": output_lines, + "transcript_count": transcript_count, + "stdout": result.stdout, + "stderr": result.stderr, + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffread_extract_transcripts_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffread_extract_transcripts_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..980194a4e586a07e257b6344251119fec22acd3e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffread_extract_transcripts_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "753b2aa03f90d146725c06674fceddfe8baea8b7551929ee4b45fbc6f9ff6aa5", + "elapsed_seconds": 4.0222084522247314, + "usage": { + "prompt_tokens": 2631, + "completion_tokens": 670, + "total_tokens": 3301, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 2631 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "2fd760be-d45b-469f-b26d-9a2abb127f39" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffutils_build_feature_database_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffutils_build_feature_database_test.py new file mode 100644 index 0000000000000000000000000000000000000000..7622e6cdfacee2fa739477d309433d93ea5315a6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffutils_build_feature_database_test.py @@ -0,0 +1,97 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("gffutils") + + +@mcp.tool() +def build_feature_database( + input_gff: str, + output_db: str, + output_json: str, +) -> Dict[str, Any]: + """ + Build a SQLite feature database from a GFF file using gffutils, then emit + a deterministic JSON oracle of all features. + + Args: + input_gff: Path to the input GFF/GTF file. + output_db: Path where the SQLite database will be written. + output_json: Path where the JSON feature oracle will be written. + """ + # Create parent directories for all output paths + for path_str in [output_db, output_json]: + path = Path(path_str) + if path.parent and not path.parent.exists(): + path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + python_code = ( + "import gffutils,json,sys; " + "db=gffutils.create_db(sys.argv[1],dbfn=sys.argv[2],force=True," + "keep_order=True,merge_strategy='merge',sort_attribute_values=True); " + "rows=[{'id':x.id,'seqid':x.seqid,'source':x.source,'type':x.featuretype," + "'start':x.start,'end':x.end,'strand':x.strand," + "'attributes':dict(x.attributes)} for x in " + "db.all_features(order_by=('seqid','start'))]; " + "open(sys.argv[3],'w').write(json.dumps(rows,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.6", + "-c", + python_code, + input_gff, + output_db, + output_json, + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"Failed to execute python3.6: {e}") from e + + if result.returncode != 0: + error_msg = ( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + raise RuntimeError(error_msg) + + # Verify that the output files were created + if not os.path.exists(output_db): + raise RuntimeError(f"Expected database file not created: {output_db}") + if not os.path.exists(output_json): + raise RuntimeError(f"Expected JSON file not created: {output_json}") + + # Read the JSON output to include in the response + try: + with open(output_json, "r") as f: + features = json.load(f) + except (json.JSONDecodeError, OSError) as e: + raise RuntimeError(f"Failed to read output JSON: {e}") from e + + return { + "status": "success", + "database_path": output_db, + "json_path": output_json, + "feature_count": len(features), + "features": features, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffutils_build_feature_database_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffutils_build_feature_database_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..aa8af0421a8819e92803397d7f2e29ab58f668cb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffutils_build_feature_database_test.py.raw.txt @@ -0,0 +1,99 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("gffutils") + + +@mcp.tool() +def build_feature_database( + input_gff: str, + output_db: str, + output_json: str, +) -> Dict[str, Any]: + """ + Build a SQLite feature database from a GFF file using gffutils, then emit + a deterministic JSON oracle of all features. + + Args: + input_gff: Path to the input GFF/GTF file. + output_db: Path where the SQLite database will be written. + output_json: Path where the JSON feature oracle will be written. + """ + # Create parent directories for all output paths + for path_str in [output_db, output_json]: + path = Path(path_str) + if path.parent and not path.parent.exists(): + path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + python_code = ( + "import gffutils,json,sys; " + "db=gffutils.create_db(sys.argv[1],dbfn=sys.argv[2],force=True," + "keep_order=True,merge_strategy='merge',sort_attribute_values=True); " + "rows=[{'id':x.id,'seqid':x.seqid,'source':x.source,'type':x.featuretype," + "'start':x.start,'end':x.end,'strand':x.strand," + "'attributes':dict(x.attributes)} for x in " + "db.all_features(order_by=('seqid','start'))]; " + "open(sys.argv[3],'w').write(json.dumps(rows,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.6", + "-c", + python_code, + input_gff, + output_db, + output_json, + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"Failed to execute python3.6: {e}") from e + + if result.returncode != 0: + error_msg = ( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + raise RuntimeError(error_msg) + + # Verify that the output files were created + if not os.path.exists(output_db): + raise RuntimeError(f"Expected database file not created: {output_db}") + if not os.path.exists(output_json): + raise RuntimeError(f"Expected JSON file not created: {output_json}") + + # Read the JSON output to include in the response + try: + with open(output_json, "r") as f: + features = json.load(f) + except (json.JSONDecodeError, OSError) as e: + raise RuntimeError(f"Failed to read output JSON: {e}") from e + + return { + "status": "success", + "database_path": output_db, + "json_path": output_json, + "feature_count": len(features), + "features": features, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffutils_build_feature_database_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffutils_build_feature_database_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..0c551d629b42d6ba1dd5adfa40c4d458b36a6ee9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gffutils_build_feature_database_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "db33be990221aa486e5450aa2e1e02fbc7a364946f0f8a65b55c37562f33f142", + "elapsed_seconds": 7.527043104171753, + "usage": { + "prompt_tokens": 13413, + "completion_tokens": 759, + "total_tokens": 14172, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 13413 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "982bdaee-cb00-4b7b-84d4-ff0d515ff5c2" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gimmemotifs_scan_custom_motif_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gimmemotifs_scan_custom_motif_test.py new file mode 100644 index 0000000000000000000000000000000000000000..790cea98599e4a8ad79ca739af02fc8e71b39b7c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gimmemotifs_scan_custom_motif_test.py @@ -0,0 +1,101 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("gimmemotifs-scan-custom-motif") + + +@mcp.tool() +def scan_custom_motif( + input_fasta: str, + motif_pfm: str, + output_bed: str, +) -> dict: + """ + Scan one custom ACGT PFM at a fixed cutoff, report three hits, and use one thread. + + Args: + input_fasta: Path to the input FASTA file. + motif_pfm: Path to the custom ACGT PFM file. + output_bed: Path where the BED output will be written. + """ + # Resolve paths + input_fasta_path = Path(input_fasta) + motif_pfm_path = Path(motif_pfm) + output_bed_path = Path(output_bed) + + # Create output parent directories + output_bed_path.parent.mkdir(parents=True, exist_ok=True) + + # Set up environment + env = os.environ.copy() + env["HOME"] = ".gimme_home" + env["XDG_CONFIG_HOME"] = ".gimme_home/config" + + # Build command + cmd = [ + "gimme", + "scan", + str(input_fasta_path), + "-p", + str(motif_pfm_path), + "-c", + "0.0", + "-n", + "3", + "-N", + "1", + "-b", + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False, + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable 'gimme' not found: {e}", + "command": cmd, + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + # Write stdout to output file + try: + with open(output_bed_path, "w") as f: + f.write(result.stdout) + except OSError as e: + return { + "success": False, + "error": f"Failed to write output file: {e}", + "command": cmd, + } + + return { + "success": True, + "output_bed": str(output_bed_path), + "command": cmd, + "returncode": result.returncode, + "stdout_length": len(result.stdout), + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gimmemotifs_scan_custom_motif_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gimmemotifs_scan_custom_motif_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..f380ee9dcf72bfe75b50b9329172da14ceca479b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gimmemotifs_scan_custom_motif_test.py.raw.txt @@ -0,0 +1,103 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("gimmemotifs-scan-custom-motif") + + +@mcp.tool() +def scan_custom_motif( + input_fasta: str, + motif_pfm: str, + output_bed: str, +) -> dict: + """ + Scan one custom ACGT PFM at a fixed cutoff, report three hits, and use one thread. + + Args: + input_fasta: Path to the input FASTA file. + motif_pfm: Path to the custom ACGT PFM file. + output_bed: Path where the BED output will be written. + """ + # Resolve paths + input_fasta_path = Path(input_fasta) + motif_pfm_path = Path(motif_pfm) + output_bed_path = Path(output_bed) + + # Create output parent directories + output_bed_path.parent.mkdir(parents=True, exist_ok=True) + + # Set up environment + env = os.environ.copy() + env["HOME"] = ".gimme_home" + env["XDG_CONFIG_HOME"] = ".gimme_home/config" + + # Build command + cmd = [ + "gimme", + "scan", + str(input_fasta_path), + "-p", + str(motif_pfm_path), + "-c", + "0.0", + "-n", + "3", + "-N", + "1", + "-b", + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False, + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable 'gimme' not found: {e}", + "command": cmd, + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + # Write stdout to output file + try: + with open(output_bed_path, "w") as f: + f.write(result.stdout) + except OSError as e: + return { + "success": False, + "error": f"Failed to write output file: {e}", + "command": cmd, + } + + return { + "success": True, + "output_bed": str(output_bed_path), + "command": cmd, + "returncode": result.returncode, + "stdout_length": len(result.stdout), + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gimmemotifs_scan_custom_motif_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gimmemotifs_scan_custom_motif_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..230828cba696603affa3e7c56b10cdf550f8712c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gimmemotifs_scan_custom_motif_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "fbe346eeb8575ca5859c2ee450e892922e23c416273dcd6ed84dfcbe025fce41", + "elapsed_seconds": 3.846667766571045, + "usage": { + "prompt_tokens": 10184, + "completion_tokens": 637, + "total_tokens": 10821, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10184 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "52fd2b47-4e6a-4206-83c0-540fd6096d32" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/goleft_bam_sample_name_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/goleft_bam_sample_name_test.py new file mode 100644 index 0000000000000000000000000000000000000000..9cb3a19180053b85138420b21315583ae9dd5faf --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/goleft_bam_sample_name_test.py @@ -0,0 +1,63 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("goleft-bam_sample_name") + +@mcp.tool() +def bam_sample_name(input_bam: str, output_text: str) -> dict: + """ + Extract the unique SM tag from BAM read-group metadata. + + Args: + input_bam: Path to the input BAM file + output_text: Path where the extracted sample name will be written + """ + # Validate input path + input_path = Path(input_bam) + if not input_path.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + # Create output parent directory if needed + output_path = Path(output_text) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command: goleft samplename {input_bam} + cmd = ["goleft", "samplename", str(input_path)] + + # Execute without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("goleft executable not found in PATH") + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else f"Exit code {result.returncode}" + raise RuntimeError(f"goleft samplename failed: {error_msg}") + + # Write stdout to output file + output_text_content = result.stdout + with open(output_path, "w", encoding="utf-8") as f: + f.write(output_text_content) + + # Return structured metadata + return { + "endpoint": "bam_sample_name", + "input_bam": str(input_path), + "output_text": str(output_path), + "sample_name": output_text_content.strip(), + "exit_code": result.returncode, + "stderr": result.stderr.strip() if result.stderr else "" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/goleft_bam_sample_name_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/goleft_bam_sample_name_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..10671c5e244805644838a0b7bdc215af99e06175 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/goleft_bam_sample_name_test.py.raw.txt @@ -0,0 +1,65 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("goleft-bam_sample_name") + +@mcp.tool() +def bam_sample_name(input_bam: str, output_text: str) -> dict: + """ + Extract the unique SM tag from BAM read-group metadata. + + Args: + input_bam: Path to the input BAM file + output_text: Path where the extracted sample name will be written + """ + # Validate input path + input_path = Path(input_bam) + if not input_path.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + # Create output parent directory if needed + output_path = Path(output_text) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command: goleft samplename {input_bam} + cmd = ["goleft", "samplename", str(input_path)] + + # Execute without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("goleft executable not found in PATH") + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else f"Exit code {result.returncode}" + raise RuntimeError(f"goleft samplename failed: {error_msg}") + + # Write stdout to output file + output_text_content = result.stdout + with open(output_path, "w", encoding="utf-8") as f: + f.write(output_text_content) + + # Return structured metadata + return { + "endpoint": "bam_sample_name", + "input_bam": str(input_path), + "output_text": str(output_path), + "sample_name": output_text_content.strip(), + "exit_code": result.returncode, + "stderr": result.stderr.strip() if result.stderr else "" + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/goleft_bam_sample_name_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/goleft_bam_sample_name_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..3bd9a853dac3b21c12a57189dc06060057e39b6a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/goleft_bam_sample_name_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "975e2a82ce9d2297f3a170922b1957890af71e3b832dfb736e0f87c94f2c2b17", + "elapsed_seconds": 3.6311635971069336, + "usage": { + "prompt_tokens": 599, + "completion_tokens": 480, + "total_tokens": 1079, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 599 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "432e43c7-537a-4cfb-bf28-82d078e152c5" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gseapy_prerank_gene_sets_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gseapy_prerank_gene_sets_test.py new file mode 100644 index 0000000000000000000000000000000000000000..d029bc7726f994c13c1432fa5a5fa84eabe227a5 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gseapy_prerank_gene_sets_test.py @@ -0,0 +1,68 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("gseapy") + +@mcp.tool() +def prerank_gene_sets(ranking_file: str, gene_sets: str, output_dir: str) -> dict: + """ + Run GSEA Prerank analysis with fixed parameters (no plots, 20 permutations, seed 1, one thread). + + Args: + ranking_file: Path to the pre-ranked gene list file (.rnk format) + gene_sets: Path to the gene sets file (.gmt format) + output_dir: Directory where results will be written + + Returns: + Dictionary containing the output directory path and exit status + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "gseapy", + "prerank", + "-r", ranking_file, + "-g", gene_sets, + "-o", output_dir, + "--no-plot", + "-n", "20", + "--min-size", "2", + "--max-size", "20", + "-s", "1", + "-p", "1" + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"gseapy prerank failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + return { + "output_dir": str(output_path.resolve()), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("gseapy executable not found. Please ensure it is installed and in PATH.") + except subprocess.SubprocessError as e: + raise RuntimeError(f"Failed to execute gseapy: {str(e)}") \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gseapy_prerank_gene_sets_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gseapy_prerank_gene_sets_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..754f5891b015c0f509a5972ed295a6451080ed7c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gseapy_prerank_gene_sets_test.py.raw.txt @@ -0,0 +1,70 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("gseapy") + +@mcp.tool() +def prerank_gene_sets(ranking_file: str, gene_sets: str, output_dir: str) -> dict: + """ + Run GSEA Prerank analysis with fixed parameters (no plots, 20 permutations, seed 1, one thread). + + Args: + ranking_file: Path to the pre-ranked gene list file (.rnk format) + gene_sets: Path to the gene sets file (.gmt format) + output_dir: Directory where results will be written + + Returns: + Dictionary containing the output directory path and exit status + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "gseapy", + "prerank", + "-r", ranking_file, + "-g", gene_sets, + "-o", output_dir, + "--no-plot", + "-n", "20", + "--min-size", "2", + "--max-size", "20", + "-s", "1", + "-p", "1" + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"gseapy prerank failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + return { + "output_dir": str(output_path.resolve()), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("gseapy executable not found. Please ensure it is installed and in PATH.") + except subprocess.SubprocessError as e: + raise RuntimeError(f"Failed to execute gseapy: {str(e)}") +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gseapy_prerank_gene_sets_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gseapy_prerank_gene_sets_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..3025f0b54afaa3d2c700062e03cf6b2eb1773a67 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gseapy_prerank_gene_sets_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "ed0ea6978f96dad4dc6e9cb5441f2724d9f87b6afb6a855c54750482885cc7ea", + "elapsed_seconds": 3.2957139015197754, + "usage": { + "prompt_tokens": 13519, + "completion_tokens": 506, + "total_tokens": 14025, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 13519 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "7c33c576-8b57-4faf-9329-798cf699a15f" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gtdbtk_identify_and_align_genome_markers_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gtdbtk_identify_and_align_genome_markers_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2fc062ef274ba260fc077af4e3bc631c44d3c221 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gtdbtk_identify_and_align_genome_markers_test.py @@ -0,0 +1,201 @@ +import os +import subprocess +import sys +import tempfile +import shutil +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("gtdbtk-identify-align") + +def read_database_pointer(pointer_path: str) -> str: + """Read the database pointer file and return the GTDBTK_DATA_PATH value.""" + with open(pointer_path, "r") as f: + content = f.read().strip() + # The file is expected to contain a line like GTDBTK_DATA_PATH=/path/to/db + for line in content.splitlines(): + line = line.strip() + if line.startswith("GTDBTK_DATA_PATH="): + return line.split("=", 1)[1] + raise ValueError(f"Could not find GTDBTK_DATA_PATH in {pointer_path}") + +def normalize_gtdbtk_markers(markers_tsv: str, user_msa: str, output_tsv: str) -> dict: + """ + Normalize the GTDB-Tk marker identification and alignment outputs into a + structured summary TSV. This is a placeholder implementation that copies + the marker file and adds alignment metadata. + """ + # Create output directory + out_dir = os.path.dirname(output_tsv) + if out_dir: + os.makedirs(out_dir, exist_ok=True) + + # Read markers file (identify output) + markers_data = [] + if os.path.exists(markers_tsv): + with open(markers_tsv, "r") as f: + header = f.readline().strip().split("\t") + for line in f: + fields = line.strip().split("\t") + if len(fields) == len(header): + markers_data.append(dict(zip(header, fields))) + + # Read alignment file to get basic stats + alignment_stats = {"sequences": 0, "length": 0} + if os.path.exists(user_msa): + with open(user_msa, "r") as f: + seq_count = 0 + seq_length = 0 + for line in f: + if line.startswith(">"): + seq_count += 1 + else: + seq_length = max(seq_length, len(line.strip())) + alignment_stats["sequences"] = seq_count + alignment_stats["length"] = seq_length + + # Write normalized output + with open(output_tsv, "w") as f: + f.write("genome\tmarkers_found\talignment_sequences\talignment_length\n") + for marker in markers_data: + genome = marker.get("genome", "unknown") + markers_found = marker.get("markers", "0") + f.write(f"{genome}\t{markers_found}\t{alignment_stats['sequences']}\t{alignment_stats['length']}\n") + + return { + "markers_file": markers_tsv, + "alignment_file": user_msa, + "output_file": output_tsv, + "marker_count": len(markers_data), + "alignment_sequences": alignment_stats["sequences"], + "alignment_length": alignment_stats["length"] + } + +@mcp.tool() +def identify_and_align_genome_markers( + genome_dir: str, + database_pointer: str, + identify_dir: str, + align_dir: str, + output_tsv: str +) -> dict: + """ + Identify GTDB bacterial marker genes in a pinned genome and produce a + canonically masked user-only alignment using the verified r89 reference package. + """ + # Step 1: Read database pointer + gtdbtk_data_path = read_database_pointer(database_pointer) + env = os.environ.copy() + env["GTDBTK_DATA_PATH"] = gtdbtk_data_path + + # Create output directories + os.makedirs(identify_dir, exist_ok=True) + os.makedirs(align_dir, exist_ok=True) + + # Step 2: Run gtdbtk identify + identify_cmd = [ + "gtdbtk", + "identify", + "--genome_dir", genome_dir, + "--out_dir", identify_dir, + "--extension", "fna", + "--cpus", "2" + ] + identify_result = subprocess.run( + identify_cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + if identify_result.returncode != 0: + raise RuntimeError( + f"gtdbtk identify failed with exit code {identify_result.returncode}\n" + f"stdout: {identify_result.stdout}\n" + f"stderr: {identify_result.stderr}" + ) + + # Locate the markers TSV produced by identify + markers_tsv = None + for root, dirs, files in os.walk(identify_dir): + for fname in files: + if fname.endswith("_markers_summary.tsv") or fname == "markers_summary.tsv": + markers_tsv = os.path.join(root, fname) + break + if markers_tsv: + break + if not markers_tsv: + # Try common patterns + candidates = [ + os.path.join(identify_dir, "identify", "markers_summary.tsv"), + os.path.join(identify_dir, "markers_summary.tsv"), + os.path.join(identify_dir, "gtdbtk", "identify", "markers_summary.tsv") + ] + for cand in candidates: + if os.path.exists(cand): + markers_tsv = cand + break + if not markers_tsv: + raise RuntimeError(f"Could not find markers summary TSV in {identify_dir}") + + # Step 3: Run gtdbtk align + align_cmd = [ + "gtdbtk", + "align", + "--identify_dir", identify_dir, + "--out_dir", align_dir, + "--skip_gtdb_refs", + "--cpus", "2" + ] + align_result = subprocess.run( + align_cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + if align_result.returncode != 0: + raise RuntimeError( + f"gtdbtk align failed with exit code {align_result.returncode}\n" + f"stdout: {align_result.stdout}\n" + f"stderr: {align_result.stderr}" + ) + + # Locate the user MSA file produced by align + user_msa = None + for root, dirs, files in os.walk(align_dir): + for fname in files: + if fname.endswith(".fna") or fname.endswith(".fasta") or fname.endswith(".msa"): + user_msa = os.path.join(root, fname) + break + if user_msa: + break + if not user_msa: + # Common patterns + candidates = [ + os.path.join(align_dir, "align", "user_msa.fasta"), + os.path.join(align_dir, "user_msa.fasta"), + os.path.join(align_dir, "gtdbtk", "align", "user_msa.fasta") + ] + for cand in candidates: + if os.path.exists(cand): + user_msa = cand + break + if not user_msa: + raise RuntimeError(f"Could not find user MSA file in {align_dir}") + + # Step 4: Normalize markers + normalize_result = normalize_gtdbtk_markers(markers_tsv, user_msa, output_tsv) + + return { + "status": "success", + "identify_dir": identify_dir, + "align_dir": align_dir, + "markers_tsv": markers_tsv, + "user_msa": user_msa, + "output_tsv": output_tsv, + "normalization": normalize_result + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gtdbtk_identify_and_align_genome_markers_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gtdbtk_identify_and_align_genome_markers_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..88ffea1045d7bbf8a1f03969586452bb3dd4c092 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gtdbtk_identify_and_align_genome_markers_test.py.raw.txt @@ -0,0 +1,203 @@ +```python +import os +import subprocess +import sys +import tempfile +import shutil +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("gtdbtk-identify-align") + +def read_database_pointer(pointer_path: str) -> str: + """Read the database pointer file and return the GTDBTK_DATA_PATH value.""" + with open(pointer_path, "r") as f: + content = f.read().strip() + # The file is expected to contain a line like GTDBTK_DATA_PATH=/path/to/db + for line in content.splitlines(): + line = line.strip() + if line.startswith("GTDBTK_DATA_PATH="): + return line.split("=", 1)[1] + raise ValueError(f"Could not find GTDBTK_DATA_PATH in {pointer_path}") + +def normalize_gtdbtk_markers(markers_tsv: str, user_msa: str, output_tsv: str) -> dict: + """ + Normalize the GTDB-Tk marker identification and alignment outputs into a + structured summary TSV. This is a placeholder implementation that copies + the marker file and adds alignment metadata. + """ + # Create output directory + out_dir = os.path.dirname(output_tsv) + if out_dir: + os.makedirs(out_dir, exist_ok=True) + + # Read markers file (identify output) + markers_data = [] + if os.path.exists(markers_tsv): + with open(markers_tsv, "r") as f: + header = f.readline().strip().split("\t") + for line in f: + fields = line.strip().split("\t") + if len(fields) == len(header): + markers_data.append(dict(zip(header, fields))) + + # Read alignment file to get basic stats + alignment_stats = {"sequences": 0, "length": 0} + if os.path.exists(user_msa): + with open(user_msa, "r") as f: + seq_count = 0 + seq_length = 0 + for line in f: + if line.startswith(">"): + seq_count += 1 + else: + seq_length = max(seq_length, len(line.strip())) + alignment_stats["sequences"] = seq_count + alignment_stats["length"] = seq_length + + # Write normalized output + with open(output_tsv, "w") as f: + f.write("genome\tmarkers_found\talignment_sequences\talignment_length\n") + for marker in markers_data: + genome = marker.get("genome", "unknown") + markers_found = marker.get("markers", "0") + f.write(f"{genome}\t{markers_found}\t{alignment_stats['sequences']}\t{alignment_stats['length']}\n") + + return { + "markers_file": markers_tsv, + "alignment_file": user_msa, + "output_file": output_tsv, + "marker_count": len(markers_data), + "alignment_sequences": alignment_stats["sequences"], + "alignment_length": alignment_stats["length"] + } + +@mcp.tool() +def identify_and_align_genome_markers( + genome_dir: str, + database_pointer: str, + identify_dir: str, + align_dir: str, + output_tsv: str +) -> dict: + """ + Identify GTDB bacterial marker genes in a pinned genome and produce a + canonically masked user-only alignment using the verified r89 reference package. + """ + # Step 1: Read database pointer + gtdbtk_data_path = read_database_pointer(database_pointer) + env = os.environ.copy() + env["GTDBTK_DATA_PATH"] = gtdbtk_data_path + + # Create output directories + os.makedirs(identify_dir, exist_ok=True) + os.makedirs(align_dir, exist_ok=True) + + # Step 2: Run gtdbtk identify + identify_cmd = [ + "gtdbtk", + "identify", + "--genome_dir", genome_dir, + "--out_dir", identify_dir, + "--extension", "fna", + "--cpus", "2" + ] + identify_result = subprocess.run( + identify_cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + if identify_result.returncode != 0: + raise RuntimeError( + f"gtdbtk identify failed with exit code {identify_result.returncode}\n" + f"stdout: {identify_result.stdout}\n" + f"stderr: {identify_result.stderr}" + ) + + # Locate the markers TSV produced by identify + markers_tsv = None + for root, dirs, files in os.walk(identify_dir): + for fname in files: + if fname.endswith("_markers_summary.tsv") or fname == "markers_summary.tsv": + markers_tsv = os.path.join(root, fname) + break + if markers_tsv: + break + if not markers_tsv: + # Try common patterns + candidates = [ + os.path.join(identify_dir, "identify", "markers_summary.tsv"), + os.path.join(identify_dir, "markers_summary.tsv"), + os.path.join(identify_dir, "gtdbtk", "identify", "markers_summary.tsv") + ] + for cand in candidates: + if os.path.exists(cand): + markers_tsv = cand + break + if not markers_tsv: + raise RuntimeError(f"Could not find markers summary TSV in {identify_dir}") + + # Step 3: Run gtdbtk align + align_cmd = [ + "gtdbtk", + "align", + "--identify_dir", identify_dir, + "--out_dir", align_dir, + "--skip_gtdb_refs", + "--cpus", "2" + ] + align_result = subprocess.run( + align_cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + if align_result.returncode != 0: + raise RuntimeError( + f"gtdbtk align failed with exit code {align_result.returncode}\n" + f"stdout: {align_result.stdout}\n" + f"stderr: {align_result.stderr}" + ) + + # Locate the user MSA file produced by align + user_msa = None + for root, dirs, files in os.walk(align_dir): + for fname in files: + if fname.endswith(".fna") or fname.endswith(".fasta") or fname.endswith(".msa"): + user_msa = os.path.join(root, fname) + break + if user_msa: + break + if not user_msa: + # Common patterns + candidates = [ + os.path.join(align_dir, "align", "user_msa.fasta"), + os.path.join(align_dir, "user_msa.fasta"), + os.path.join(align_dir, "gtdbtk", "align", "user_msa.fasta") + ] + for cand in candidates: + if os.path.exists(cand): + user_msa = cand + break + if not user_msa: + raise RuntimeError(f"Could not find user MSA file in {align_dir}") + + # Step 4: Normalize markers + normalize_result = normalize_gtdbtk_markers(markers_tsv, user_msa, output_tsv) + + return { + "status": "success", + "identify_dir": identify_dir, + "align_dir": align_dir, + "markers_tsv": markers_tsv, + "user_msa": user_msa, + "output_tsv": output_tsv, + "normalization": normalize_result + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gtdbtk_identify_and_align_genome_markers_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gtdbtk_identify_and_align_genome_markers_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..0503d6e9773ea3572f5ecf7eefc828170dcdd47c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/gtdbtk_identify_and_align_genome_markers_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "0846026c0eb961c4c825bbf192058a0be3869fde8346e21ddf0c6a81bbc9dbac", + "elapsed_seconds": 11.434815406799316, + "usage": { + "prompt_tokens": 918, + "completion_tokens": 1769, + "total_tokens": 2687, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 918 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "b9c7429e-3f53-4a11-94d3-e2350f05f577" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hicexplorer_find_restriction_sites_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hicexplorer_find_restriction_sites_test.py new file mode 100644 index 0000000000000000000000000000000000000000..d10f15f0db47fc66448a227ab0f3f05612f96b22 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hicexplorer_find_restriction_sites_test.py @@ -0,0 +1,78 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("hicexplorer") + +@mcp.tool() +def find_restriction_sites(reference_fasta: str, output_bed: str) -> dict: + """ + Find both-strand ACGT restriction-pattern occurrences and emit sorted BED. + + Args: + reference_fasta: Path to the reference FASTA file. + output_bed: Path where the output BED file will be written. + """ + # Validate required parameters + if not reference_fasta: + raise ValueError("reference_fasta is required") + if not output_bed: + raise ValueError("output_bed is required") + + # Create output parent directories + output_bed_path = Path(output_bed) + output_bed_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "findRestSite", + "-f", + reference_fasta, + "-p", + "ACGT", + "-o", + output_bed, + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"Executable 'findRestSite' not found: {e}") from e + except Exception as e: + raise RuntimeError(f"Failed to execute command: {e}") from e + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr.strip() else "Unknown error" + raise RuntimeError( + f"Command failed with exit code {result.returncode}: {error_msg}" + ) + + # Verify output file was created + if not output_bed_path.exists(): + raise RuntimeError(f"Output file {output_bed} was not created") + + # Return structured metadata + return { + "endpoint": "find_restriction_sites", + "status": "success", + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_bed": str(output_bed_path), + "output_bed_size": output_bed_path.stat().st_size, + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hicexplorer_find_restriction_sites_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hicexplorer_find_restriction_sites_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..9e38c80598b9f56dbebe2f2aed716fa092a7b680 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hicexplorer_find_restriction_sites_test.py.raw.txt @@ -0,0 +1,80 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("hicexplorer") + +@mcp.tool() +def find_restriction_sites(reference_fasta: str, output_bed: str) -> dict: + """ + Find both-strand ACGT restriction-pattern occurrences and emit sorted BED. + + Args: + reference_fasta: Path to the reference FASTA file. + output_bed: Path where the output BED file will be written. + """ + # Validate required parameters + if not reference_fasta: + raise ValueError("reference_fasta is required") + if not output_bed: + raise ValueError("output_bed is required") + + # Create output parent directories + output_bed_path = Path(output_bed) + output_bed_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "findRestSite", + "-f", + reference_fasta, + "-p", + "ACGT", + "-o", + output_bed, + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"Executable 'findRestSite' not found: {e}") from e + except Exception as e: + raise RuntimeError(f"Failed to execute command: {e}") from e + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr.strip() else "Unknown error" + raise RuntimeError( + f"Command failed with exit code {result.returncode}: {error_msg}" + ) + + # Verify output file was created + if not output_bed_path.exists(): + raise RuntimeError(f"Output file {output_bed} was not created") + + # Return structured metadata + return { + "endpoint": "find_restriction_sites", + "status": "success", + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_bed": str(output_bed_path), + "output_bed_size": output_bed_path.stat().st_size, + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hicexplorer_find_restriction_sites_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hicexplorer_find_restriction_sites_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..12fe8bc4ac29e95f8749ef1f02b2c72452511cfb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hicexplorer_find_restriction_sites_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "0fa1b0b0f6c1625fe216778d4ebb066e6d72ee3d23694c1904e9bff31df3a3c2", + "elapsed_seconds": 7.66733717918396, + "usage": { + "prompt_tokens": 10519, + "completion_tokens": 545, + "total_tokens": 11064, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10519 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "a1a66ef4-a49d-46e8-8c23-321e714cb7a8" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hmmer_build_protein_hmm_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hmmer_build_protein_hmm_test.py new file mode 100644 index 0000000000000000000000000000000000000000..1aea50b3b3dc866497a007429955649196a3a152 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hmmer_build_protein_hmm_test.py @@ -0,0 +1,92 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("hmmer") + +@mcp.tool() +def build_protein_hmm(alignment_file: str, output_hmm: str, output_stats: str) -> dict: + """ + Build an amino-acid HMM from aligned FASTA, then report deterministic model statistics. + + Args: + alignment_file: Path to the aligned FASTA file (input) + output_hmm: Path where the built HMM will be written + output_stats: Path where the model statistics (from hmmstat) will be written + """ + # Create output parent directories + for path in [output_hmm, output_stats]: + parent = os.path.dirname(os.path.abspath(path)) + os.makedirs(parent, exist_ok=True) + + # Step 1: Run hmmbuild + hmmbuild_cmd = [ + "hmmbuild", + "--amino", + "--informat", + "afa", + output_hmm, + alignment_file + ] + + try: + result1 = subprocess.run( + hmmbuild_cmd, + capture_output=True, + text=True, + check=False + ) + if result1.returncode != 0: + raise RuntimeError( + f"hmmbuild failed with exit code {result1.returncode}\n" + f"stdout: {result1.stdout}\n" + f"stderr: {result1.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("hmmbuild executable not found. Ensure hmmer is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error running hmmbuild: {str(e)}") + + # Step 2: Run hmmstat and capture stdout to output_stats + hmmstat_cmd = [ + "hmmstat", + output_hmm + ] + + try: + result2 = subprocess.run( + hmmstat_cmd, + capture_output=True, + text=True, + check=False + ) + if result2.returncode != 0: + raise RuntimeError( + f"hmmstat failed with exit code {result2.returncode}\n" + f"stdout: {result2.stdout}\n" + f"stderr: {result2.stderr}" + ) + + # Write hmmstat stdout to output_stats + with open(output_stats, 'w') as f: + f.write(result2.stdout) + except FileNotFoundError: + raise RuntimeError("hmmstat executable not found. Ensure hmmer is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error running hmmstat: {str(e)}") + + # Return structured metadata + return { + "status": "success", + "output_hmm": output_hmm, + "output_stats": output_stats, + "hmmbuild_stdout": result1.stdout, + "hmmbuild_stderr": result1.stderr, + "hmmstat_stdout": result2.stdout, + "hmmstat_stderr": result2.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hmmer_build_protein_hmm_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hmmer_build_protein_hmm_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..3c308ebf6125e57eec8e65856c662c3b94af9f18 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hmmer_build_protein_hmm_test.py.raw.txt @@ -0,0 +1,94 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("hmmer") + +@mcp.tool() +def build_protein_hmm(alignment_file: str, output_hmm: str, output_stats: str) -> dict: + """ + Build an amino-acid HMM from aligned FASTA, then report deterministic model statistics. + + Args: + alignment_file: Path to the aligned FASTA file (input) + output_hmm: Path where the built HMM will be written + output_stats: Path where the model statistics (from hmmstat) will be written + """ + # Create output parent directories + for path in [output_hmm, output_stats]: + parent = os.path.dirname(os.path.abspath(path)) + os.makedirs(parent, exist_ok=True) + + # Step 1: Run hmmbuild + hmmbuild_cmd = [ + "hmmbuild", + "--amino", + "--informat", + "afa", + output_hmm, + alignment_file + ] + + try: + result1 = subprocess.run( + hmmbuild_cmd, + capture_output=True, + text=True, + check=False + ) + if result1.returncode != 0: + raise RuntimeError( + f"hmmbuild failed with exit code {result1.returncode}\n" + f"stdout: {result1.stdout}\n" + f"stderr: {result1.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("hmmbuild executable not found. Ensure hmmer is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error running hmmbuild: {str(e)}") + + # Step 2: Run hmmstat and capture stdout to output_stats + hmmstat_cmd = [ + "hmmstat", + output_hmm + ] + + try: + result2 = subprocess.run( + hmmstat_cmd, + capture_output=True, + text=True, + check=False + ) + if result2.returncode != 0: + raise RuntimeError( + f"hmmstat failed with exit code {result2.returncode}\n" + f"stdout: {result2.stdout}\n" + f"stderr: {result2.stderr}" + ) + + # Write hmmstat stdout to output_stats + with open(output_stats, 'w') as f: + f.write(result2.stdout) + except FileNotFoundError: + raise RuntimeError("hmmstat executable not found. Ensure hmmer is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error running hmmstat: {str(e)}") + + # Return structured metadata + return { + "status": "success", + "output_hmm": output_hmm, + "output_stats": output_stats, + "hmmbuild_stdout": result1.stdout, + "hmmbuild_stderr": result1.stderr, + "hmmstat_stdout": result2.stdout, + "hmmstat_stderr": result2.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hmmer_build_protein_hmm_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hmmer_build_protein_hmm_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..dbe8e895fc97f224b3852ae4cae329682cb35720 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/hmmer_build_protein_hmm_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "a56e39f5df49c8ec592b7bd83846c7b7f683e6754c03a0adf8054a2da3583b0e", + "elapsed_seconds": 4.277589559555054, + "usage": { + "prompt_tokens": 6354, + "completion_tokens": 703, + "total_tokens": 7057, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6354 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "54957ded-1ac7-4c25-bccb-d3606860fb34" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htseq_count_reads_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htseq_count_reads_test.py new file mode 100644 index 0000000000000000000000000000000000000000..e1ab811ca15e022d7784e81c744b71416797db9f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htseq_count_reads_test.py @@ -0,0 +1,89 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("htseq") + + +@mcp.tool() +def count_reads(input_bam: str, features_gtf: str, output_counts: str) -> dict: + """ + Count reads in a BAM file against features in a GTF file using htseq-count. + + Args: + input_bam: Path to the input BAM file. + features_gtf: Path to the GTF file with features. + output_counts: Path where the output counts file will be written. + + Returns: + A dictionary with metadata about the execution. + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_counts) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "htseq-count", + "-f", + "bam", + "-r", + "pos", + "-s", + "no", + "-t", + "exon", + "-i", + "gene_id", + "-c", + output_counts, + input_bam, + features_gtf, + ] + + try: + # Run the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + + if result.returncode != 0: + raise RuntimeError( + f"htseq-count failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError( + f"htseq-count completed but output file {output_counts} was not created" + ) + + return { + "endpoint": "count_reads", + "input_bam": input_bam, + "features_gtf": features_gtf, + "output_counts": output_counts, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_file_exists": True, + "output_file_size": output_path.stat().st_size, + } + + except FileNotFoundError: + raise RuntimeError( + "htseq-count executable not found. Please ensure htseq is installed and in PATH." + ) + except Exception as e: + raise RuntimeError(f"Error executing htseq-count: {str(e)}") + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htseq_count_reads_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htseq_count_reads_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..19ebb7571af243fff1709035596c4415407088c7 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htseq_count_reads_test.py.raw.txt @@ -0,0 +1,91 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("htseq") + + +@mcp.tool() +def count_reads(input_bam: str, features_gtf: str, output_counts: str) -> dict: + """ + Count reads in a BAM file against features in a GTF file using htseq-count. + + Args: + input_bam: Path to the input BAM file. + features_gtf: Path to the GTF file with features. + output_counts: Path where the output counts file will be written. + + Returns: + A dictionary with metadata about the execution. + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_counts) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "htseq-count", + "-f", + "bam", + "-r", + "pos", + "-s", + "no", + "-t", + "exon", + "-i", + "gene_id", + "-c", + output_counts, + input_bam, + features_gtf, + ] + + try: + # Run the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + + if result.returncode != 0: + raise RuntimeError( + f"htseq-count failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError( + f"htseq-count completed but output file {output_counts} was not created" + ) + + return { + "endpoint": "count_reads", + "input_bam": input_bam, + "features_gtf": features_gtf, + "output_counts": output_counts, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_file_exists": True, + "output_file_size": output_path.stat().st_size, + } + + except FileNotFoundError: + raise RuntimeError( + "htseq-count executable not found. Please ensure htseq is installed and in PATH." + ) + except Exception as e: + raise RuntimeError(f"Error executing htseq-count: {str(e)}") + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htseq_count_reads_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htseq_count_reads_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..e11d95275cede045a43b19df896d0030a7d320e6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htseq_count_reads_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "a05f645c1ae0283698f905341516e8ab39658877eaf19316fce7bdfa8b3fed93", + "elapsed_seconds": 3.53901743888855, + "usage": { + "prompt_tokens": 10154, + "completion_tokens": 565, + "total_tokens": 10719, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10154 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "fa8b2e05-ae66-4979-bcb5-d30e47c3789b" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htslib_bgzip_compress_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htslib_bgzip_compress_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ca7d63e1b6e3dedc3ed96db40b6937d6823f05a7 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htslib_bgzip_compress_test.py @@ -0,0 +1,49 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("htslib") + +@mcp.tool() +def bgzip_compress(input_file: str, output_gzip: str) -> dict: + """ + Compress a file using bgzip (BGZF compression). + + Args: + input_file: Path to the input file to compress + output_gzip: Path where the compressed output will be written + """ + # Create parent directory for output if it doesn't exist + output_path = Path(output_gzip) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command: bgzip -c {input_file} + cmd = ["bgzip", "-c", input_file] + + # Execute the command, capturing stdout as binary + result = subprocess.run( + cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + stderr_msg = result.stderr.decode('utf-8', errors='replace') if result.stderr else "" + raise RuntimeError(f"bgzip failed with exit code {result.returncode}: {stderr_msg}") + + # Write captured stdout to output file + with open(output_path, 'wb') as f: + f.write(result.stdout) + + # Return structured metadata + return { + "status": "success", + "input_file": input_file, + "output_gzip": output_gzip, + "output_size_bytes": len(result.stdout), + "exit_code": result.returncode + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htslib_bgzip_compress_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htslib_bgzip_compress_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..dadf2ccc2e1132a3751d089278a9c2413a0f134d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htslib_bgzip_compress_test.py.raw.txt @@ -0,0 +1,51 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("htslib") + +@mcp.tool() +def bgzip_compress(input_file: str, output_gzip: str) -> dict: + """ + Compress a file using bgzip (BGZF compression). + + Args: + input_file: Path to the input file to compress + output_gzip: Path where the compressed output will be written + """ + # Create parent directory for output if it doesn't exist + output_path = Path(output_gzip) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command: bgzip -c {input_file} + cmd = ["bgzip", "-c", input_file] + + # Execute the command, capturing stdout as binary + result = subprocess.run( + cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + stderr_msg = result.stderr.decode('utf-8', errors='replace') if result.stderr else "" + raise RuntimeError(f"bgzip failed with exit code {result.returncode}: {stderr_msg}") + + # Write captured stdout to output file + with open(output_path, 'wb') as f: + f.write(result.stdout) + + # Return structured metadata + return { + "status": "success", + "input_file": input_file, + "output_gzip": output_gzip, + "output_size_bytes": len(result.stdout), + "exit_code": result.returncode + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htslib_bgzip_compress_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htslib_bgzip_compress_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..462ed8147255f78b4a13ed873aa907e5f3f1c9eb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/htslib_bgzip_compress_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "f6784d928b8fbe7fa09d002034ae4d8ce06b600db1f5ca5e2776919cb6e12f6c", + "elapsed_seconds": 3.3356213569641113, + "usage": { + "prompt_tokens": 9116, + "completion_tokens": 377, + "total_tokens": 9493, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9116 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "f0b72663-3f1f-4ccd-845c-2442c378dbfc" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/humann2_renormalize_gene_families_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/humann2_renormalize_gene_families_test.py new file mode 100644 index 0000000000000000000000000000000000000000..be686c9e4dd5c58909dd5d5ad33bf71f2b40556c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/humann2_renormalize_gene_families_test.py @@ -0,0 +1,73 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("humann2") + +@mcp.tool() +def renormalize_gene_families(input_tsv: str, output_tsv: str) -> dict: + """ + Convert a pinned stratified HUMAnN2 gene-family table from raw abundance units to community relative abundance. + + Args: + input_tsv: Path to input gene-family table in TSV format + output_tsv: Path where the renormalized output TSV will be written + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_tsv)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "humann2_renorm_table", + "-i", input_tsv, + "-u", "relab", + "-m", "community", + "-s", "y", + "-p", + "-o", output_tsv + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"humann2_renorm_table failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not os.path.isfile(output_tsv): + raise RuntimeError(f"Output file {output_tsv} was not created") + + # Return structured metadata + return { + "status": "success", + "input_tsv": input_tsv, + "output_tsv": output_tsv, + "command": " ".join(cmd), + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": os.path.getsize(output_tsv) + } + + except FileNotFoundError: + raise RuntimeError( + "humann2_renorm_table executable not found. " + "Ensure humann2 2.8.1 is installed and available in PATH." + ) + except Exception as e: + raise RuntimeError(f"Error executing humann2_renorm_table: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/humann2_renormalize_gene_families_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/humann2_renormalize_gene_families_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..ce7da56737776aba401337c5a5451697542dba38 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/humann2_renormalize_gene_families_test.py.raw.txt @@ -0,0 +1,75 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("humann2") + +@mcp.tool() +def renormalize_gene_families(input_tsv: str, output_tsv: str) -> dict: + """ + Convert a pinned stratified HUMAnN2 gene-family table from raw abundance units to community relative abundance. + + Args: + input_tsv: Path to input gene-family table in TSV format + output_tsv: Path where the renormalized output TSV will be written + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_tsv)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "humann2_renorm_table", + "-i", input_tsv, + "-u", "relab", + "-m", "community", + "-s", "y", + "-p", + "-o", output_tsv + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"humann2_renorm_table failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not os.path.isfile(output_tsv): + raise RuntimeError(f"Output file {output_tsv} was not created") + + # Return structured metadata + return { + "status": "success", + "input_tsv": input_tsv, + "output_tsv": output_tsv, + "command": " ".join(cmd), + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": os.path.getsize(output_tsv) + } + + except FileNotFoundError: + raise RuntimeError( + "humann2_renorm_table executable not found. " + "Ensure humann2 2.8.1 is installed and available in PATH." + ) + except Exception as e: + raise RuntimeError(f"Error executing humann2_renorm_table: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/humann2_renormalize_gene_families_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/humann2_renormalize_gene_families_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..d65df4d547e3e519b3572d54b2a9336783fa6cd2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/humann2_renormalize_gene_families_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "305354f0009bb61da71771a2362c068372edb0ab8f49c5b2d3db2f6268c10910", + "elapsed_seconds": 3.533856153488159, + "usage": { + "prompt_tokens": 7227, + "completion_tokens": 559, + "total_tokens": 7786, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7227 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "5b416427-97a2-432c-be55-da4cda6011ad" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/illumina-interop_dump_q_metrics_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/illumina-interop_dump_q_metrics_test.py new file mode 100644 index 0000000000000000000000000000000000000000..30f70fa9a26fad6ec14b4ee4a6196d3a43e97ba3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/illumina-interop_dump_q_metrics_test.py @@ -0,0 +1,76 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("illumina-interop") + + +@mcp.tool() +def dump_q_metrics(run_folder: str, output_csv: str) -> dict: + """ + Decode Q-score histograms and Q20/Q30 summaries from a deterministic local Illumina run folder. + + Args: + run_folder: Path to the Illumina run folder containing InterOp metric files. + output_csv: Path where the Q-score metrics CSV output will be written. + """ + # Validate required parameters + if not run_folder: + raise ValueError("run_folder is required") + if not output_csv: + raise ValueError("output_csv is required") + + # Create output parent directories + output_path = Path(output_csv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "interop_dumptext", + run_folder, + "--metric=Q" + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + raise RuntimeError(f"interop_dumptext executable not found: {e}") from e + except Exception as e: + raise RuntimeError(f"Failed to execute interop_dumptext: {e}") from e + + # Check for non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else f"Exit code {result.returncode}" + raise RuntimeError(f"interop_dumptext failed: {error_msg}") + + # Write stdout to output_csv + try: + with open(output_path, 'w', encoding='utf-8') as f: + f.write(result.stdout) + except Exception as e: + raise RuntimeError(f"Failed to write output to {output_csv}: {e}") from e + + # Return structured metadata + return { + "endpoint": "dump_q_metrics", + "run_folder": run_folder, + "output_csv": output_csv, + "exit_code": result.returncode, + "stdout_bytes": len(result.stdout.encode('utf-8')), + "stderr_bytes": len(result.stderr.encode('utf-8')), + "output_file_size": output_path.stat().st_size if output_path.exists() else 0, + "status": "success" + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/illumina-interop_dump_q_metrics_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/illumina-interop_dump_q_metrics_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..adfac4de7cc04ea344e15680c7f78e15963e9bf4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/illumina-interop_dump_q_metrics_test.py.raw.txt @@ -0,0 +1,78 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("illumina-interop") + + +@mcp.tool() +def dump_q_metrics(run_folder: str, output_csv: str) -> dict: + """ + Decode Q-score histograms and Q20/Q30 summaries from a deterministic local Illumina run folder. + + Args: + run_folder: Path to the Illumina run folder containing InterOp metric files. + output_csv: Path where the Q-score metrics CSV output will be written. + """ + # Validate required parameters + if not run_folder: + raise ValueError("run_folder is required") + if not output_csv: + raise ValueError("output_csv is required") + + # Create output parent directories + output_path = Path(output_csv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "interop_dumptext", + run_folder, + "--metric=Q" + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + raise RuntimeError(f"interop_dumptext executable not found: {e}") from e + except Exception as e: + raise RuntimeError(f"Failed to execute interop_dumptext: {e}") from e + + # Check for non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else f"Exit code {result.returncode}" + raise RuntimeError(f"interop_dumptext failed: {error_msg}") + + # Write stdout to output_csv + try: + with open(output_path, 'w', encoding='utf-8') as f: + f.write(result.stdout) + except Exception as e: + raise RuntimeError(f"Failed to write output to {output_csv}: {e}") from e + + # Return structured metadata + return { + "endpoint": "dump_q_metrics", + "run_folder": run_folder, + "output_csv": output_csv, + "exit_code": result.returncode, + "stdout_bytes": len(result.stdout.encode('utf-8')), + "stderr_bytes": len(result.stderr.encode('utf-8')), + "output_file_size": output_path.stat().st_size if output_path.exists() else 0, + "status": "success" + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/illumina-interop_dump_q_metrics_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/illumina-interop_dump_q_metrics_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..384835eab176897b4c506f31297c4ea33a4e4d98 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/illumina-interop_dump_q_metrics_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "05787c5f4a8723fc8520d339a460a4e519480e3d0268eb42085a34a9026e5b66", + "elapsed_seconds": 3.7261135578155518, + "usage": { + "prompt_tokens": 8449, + "completion_tokens": 574, + "total_tokens": 9023, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 8449 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "8da21dd2-b76c-42bd-aa2a-12025c7d750e" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/infernal_build_and_align_cm_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/infernal_build_and_align_cm_test.py new file mode 100644 index 0000000000000000000000000000000000000000..b97b40fb959e472510b63e6f3ce736e860ffb881 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/infernal_build_and_align_cm_test.py @@ -0,0 +1,118 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("infernal") + +@mcp.tool() +def build_and_align_cm( + training_alignment: str, + query_fasta: str, + output_cm: str, + output_stockholm: str +) -> str: + """ + Build a covariance model from a training alignment (without secondary structure annotation) + and align a query FASTA against it, producing a Stockholm alignment. + + Args: + training_alignment: Path to the training alignment file (e.g., Stockholm format). + query_fasta: Path to the query FASTA file. + output_cm: Path where the built covariance model will be written. + output_stockholm: Path where the resulting alignment (Stockholm format) will be written. + """ + # Create parent directories for output files + for out_path in [output_cm, output_stockholm]: + parent = Path(out_path).parent + if parent and not parent.exists(): + parent.mkdir(parents=True, exist_ok=True) + + # Step 1: cmbuild --noss -F {output_cm} {training_alignment} + cmbuild_cmd = [ + "cmbuild", + "--noss", + "-F", + output_cm, + training_alignment + ] + try: + cmbuild_result = subprocess.run( + cmbuild_cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return json.dumps({ + "success": False, + "error": f"cmbuild executable not found: {e}", + "step": 1 + }) + if cmbuild_result.returncode != 0: + return json.dumps({ + "success": False, + "error": f"cmbuild failed with exit code {cmbuild_result.returncode}", + "stderr": cmbuild_result.stderr, + "stdout": cmbuild_result.stdout, + "step": 1 + }) + + # Step 2: cmalign -o {output_stockholm} {output_cm} {query_fasta} + cmalign_cmd = [ + "cmalign", + "-o", + output_stockholm, + output_cm, + query_fasta + ] + try: + cmalign_result = subprocess.run( + cmalign_cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return json.dumps({ + "success": False, + "error": f"cmalign executable not found: {e}", + "step": 2 + }) + if cmalign_result.returncode != 0: + return json.dumps({ + "success": False, + "error": f"cmalign failed with exit code {cmalign_result.returncode}", + "stderr": cmalign_result.stderr, + "stdout": cmalign_result.stdout, + "step": 2 + }) + + # Verify output files were created + if not os.path.isfile(output_cm): + return json.dumps({ + "success": False, + "error": f"Expected output CM file not created: {output_cm}", + "step": 1 + }) + if not os.path.isfile(output_stockholm): + return json.dumps({ + "success": False, + "error": f"Expected output Stockholm file not created: {output_stockholm}", + "step": 2 + }) + + return json.dumps({ + "success": True, + "output_cm": output_cm, + "output_stockholm": output_stockholm, + "cmbuild_stdout": cmbuild_result.stdout, + "cmbuild_stderr": cmbuild_result.stderr, + "cmalign_stdout": cmalign_result.stdout, + "cmalign_stderr": cmalign_result.stderr + }) + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/infernal_build_and_align_cm_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/infernal_build_and_align_cm_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..da86bfc9537a77800c5a0b2e284d8b991cfac11b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/infernal_build_and_align_cm_test.py.raw.txt @@ -0,0 +1,120 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("infernal") + +@mcp.tool() +def build_and_align_cm( + training_alignment: str, + query_fasta: str, + output_cm: str, + output_stockholm: str +) -> str: + """ + Build a covariance model from a training alignment (without secondary structure annotation) + and align a query FASTA against it, producing a Stockholm alignment. + + Args: + training_alignment: Path to the training alignment file (e.g., Stockholm format). + query_fasta: Path to the query FASTA file. + output_cm: Path where the built covariance model will be written. + output_stockholm: Path where the resulting alignment (Stockholm format) will be written. + """ + # Create parent directories for output files + for out_path in [output_cm, output_stockholm]: + parent = Path(out_path).parent + if parent and not parent.exists(): + parent.mkdir(parents=True, exist_ok=True) + + # Step 1: cmbuild --noss -F {output_cm} {training_alignment} + cmbuild_cmd = [ + "cmbuild", + "--noss", + "-F", + output_cm, + training_alignment + ] + try: + cmbuild_result = subprocess.run( + cmbuild_cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return json.dumps({ + "success": False, + "error": f"cmbuild executable not found: {e}", + "step": 1 + }) + if cmbuild_result.returncode != 0: + return json.dumps({ + "success": False, + "error": f"cmbuild failed with exit code {cmbuild_result.returncode}", + "stderr": cmbuild_result.stderr, + "stdout": cmbuild_result.stdout, + "step": 1 + }) + + # Step 2: cmalign -o {output_stockholm} {output_cm} {query_fasta} + cmalign_cmd = [ + "cmalign", + "-o", + output_stockholm, + output_cm, + query_fasta + ] + try: + cmalign_result = subprocess.run( + cmalign_cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return json.dumps({ + "success": False, + "error": f"cmalign executable not found: {e}", + "step": 2 + }) + if cmalign_result.returncode != 0: + return json.dumps({ + "success": False, + "error": f"cmalign failed with exit code {cmalign_result.returncode}", + "stderr": cmalign_result.stderr, + "stdout": cmalign_result.stdout, + "step": 2 + }) + + # Verify output files were created + if not os.path.isfile(output_cm): + return json.dumps({ + "success": False, + "error": f"Expected output CM file not created: {output_cm}", + "step": 1 + }) + if not os.path.isfile(output_stockholm): + return json.dumps({ + "success": False, + "error": f"Expected output Stockholm file not created: {output_stockholm}", + "step": 2 + }) + + return json.dumps({ + "success": True, + "output_cm": output_cm, + "output_stockholm": output_stockholm, + "cmbuild_stdout": cmbuild_result.stdout, + "cmbuild_stderr": cmbuild_result.stderr, + "cmalign_stdout": cmalign_result.stdout, + "cmalign_stderr": cmalign_result.stderr + }) + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/infernal_build_and_align_cm_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/infernal_build_and_align_cm_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..ac1e5d472fa2c9c6f226edd30d54f067b513e0a4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/infernal_build_and_align_cm_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "656b3fbe94ed86d9ba8455501062e781ab53762eba93540c5c98a271486d7e1e", + "elapsed_seconds": 6.694017648696899, + "usage": { + "prompt_tokens": 24130, + "completion_tokens": 889, + "total_tokens": 25019, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 24130 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "4ad1c648-492c-4f29-8914-4661fd237a5c" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/intarna_predict_rna_interaction_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/intarna_predict_rna_interaction_test.py new file mode 100644 index 0000000000000000000000000000000000000000..b027c8471272242adbc56d1eb1e8e832979c1032 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/intarna_predict_rna_interaction_test.py @@ -0,0 +1,74 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("intarna") + +@mcp.tool() +def predict_rna_interaction(target_rna: str, query_rna: str, output_csv: str) -> dict: + """ + Predict RNA-RNA interaction using IntaRNA. + + Args: + target_rna: Path to target RNA sequence file (FASTA format) + query_rna: Path to query RNA sequence file (FASTA format) + output_csv: Path where the CSV output will be written + + Returns: + Dictionary with execution metadata and output file path + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_csv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "IntaRNA", + "-t", target_rna, + "-q", query_rna, + "--noSeed", + "--outMode=C", + f"--out={output_csv}" + ] + + try: + # Execute the command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"IntaRNA failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file was not created: {output_csv}") + + # Return structured metadata + return { + "status": "success", + "output_file": str(output_path), + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": output_path.stat().st_size + } + + except FileNotFoundError: + raise RuntimeError("IntaRNA executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing IntaRNA: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/intarna_predict_rna_interaction_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/intarna_predict_rna_interaction_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..0fca1afbe6daf588af3f6cb92a3a469e1c4db6ae --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/intarna_predict_rna_interaction_test.py.raw.txt @@ -0,0 +1,76 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("intarna") + +@mcp.tool() +def predict_rna_interaction(target_rna: str, query_rna: str, output_csv: str) -> dict: + """ + Predict RNA-RNA interaction using IntaRNA. + + Args: + target_rna: Path to target RNA sequence file (FASTA format) + query_rna: Path to query RNA sequence file (FASTA format) + output_csv: Path where the CSV output will be written + + Returns: + Dictionary with execution metadata and output file path + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_csv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "IntaRNA", + "-t", target_rna, + "-q", query_rna, + "--noSeed", + "--outMode=C", + f"--out={output_csv}" + ] + + try: + # Execute the command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"IntaRNA failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file was not created: {output_csv}") + + # Return structured metadata + return { + "status": "success", + "output_file": str(output_path), + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": output_path.stat().st_size + } + + except FileNotFoundError: + raise RuntimeError("IntaRNA executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing IntaRNA: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/intarna_predict_rna_interaction_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/intarna_predict_rna_interaction_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..0672c716866b4abdf659c44e269d565e2dbb51cf --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/intarna_predict_rna_interaction_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "60110ed1a923f4a440dd329fdb718932dc75e10d084a27e56c8bfbb0da8d865e", + "elapsed_seconds": 3.1430649757385254, + "usage": { + "prompt_tokens": 10353, + "completion_tokens": 501, + "total_tokens": 10854, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10353 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "19cb6a01-2ecd-4e7c-95f9-499ab30e107c" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ipython-cluster-helper_normalize_scheduler_resources_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ipython-cluster-helper_normalize_scheduler_resources_test.py new file mode 100644 index 0000000000000000000000000000000000000000..9f8f3d3ba4ddeab3491949d7fc7c2ecc84757705 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ipython-cluster-helper_normalize_scheduler_resources_test.py @@ -0,0 +1,96 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import json +import os +import sys + +mcp = FastMCP("ipython-cluster-helper") + + +@mcp.tool() +def normalize_scheduler_resources(resource_json: str, output_json: str) -> dict: + """ + Normalize scheduler resource specifications (time and memory) using + ipython-cluster-helper's parser and conversion utilities. + + Args: + resource_json: Path to a JSON file containing resource specifications. + Expected structure: {"time": , "memory": , + "memory_unit": } + output_json: Path where the normalized result will be written as JSON. + + Returns: + A dictionary with metadata about the invocation, including the + normalized values. + """ + # Validate input file exists + if not os.path.isfile(resource_json): + raise FileNotFoundError(f"Input resource file not found: {resource_json}") + + # Create output parent directory if needed + output_dir = os.path.dirname(os.path.abspath(output_json)) + os.makedirs(output_dir, exist_ok=True) + + # Read input to validate structure before invoking + try: + with open(resource_json, "r") as f: + resource_data = json.load(f) + except json.JSONDecodeError as e: + raise ValueError(f"Invalid JSON in resource file: {e}") + + # Validate required keys + required_keys = {"time", "memory", "memory_unit"} + missing = required_keys - set(resource_data.keys()) + if missing: + raise ValueError(f"Missing required keys in resource JSON: {missing}") + + # Build the Python one-liner that exercises the package's utilities + code = ( + "import json,sys; " + "from cluster_helper.slurm import SlurmTime,set_timelimit; " + "from cluster_helper.utils import convert_mb; " + "c=json.load(open(sys.argv[1])); " + "d={'parsed':repr(SlurmTime(c['time']))," + "'time_limit':set_timelimit({'time':c['time']})['timelimit']," + "'memory_in_gb':convert_mb(c['memory'],c['memory_unit'])}; " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + cmd = ["python", "-c", code, resource_json, output_json] + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except OSError as e: + raise RuntimeError(f"Failed to execute python: {e}") + + if result.returncode != 0: + stderr_msg = result.stderr.strip() if result.stderr else "No stderr output" + raise RuntimeError( + f"Command failed with exit code {result.returncode}: {stderr_msg}" + ) + + # Read the output file to include normalized values in metadata + try: + with open(output_json, "r") as f: + normalized = json.load(f) + except (OSError, json.JSONDecodeError) as e: + raise RuntimeError(f"Failed to read output file: {e}") + + return { + "endpoint": "normalize_scheduler_resources", + "input_file": resource_json, + "output_file": output_json, + "normalized": normalized, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ipython-cluster-helper_normalize_scheduler_resources_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ipython-cluster-helper_normalize_scheduler_resources_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..6f8ce0912b01e9fec52092bea9ee099680c10702 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ipython-cluster-helper_normalize_scheduler_resources_test.py.raw.txt @@ -0,0 +1,98 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import json +import os +import sys + +mcp = FastMCP("ipython-cluster-helper") + + +@mcp.tool() +def normalize_scheduler_resources(resource_json: str, output_json: str) -> dict: + """ + Normalize scheduler resource specifications (time and memory) using + ipython-cluster-helper's parser and conversion utilities. + + Args: + resource_json: Path to a JSON file containing resource specifications. + Expected structure: {"time": , "memory": , + "memory_unit": } + output_json: Path where the normalized result will be written as JSON. + + Returns: + A dictionary with metadata about the invocation, including the + normalized values. + """ + # Validate input file exists + if not os.path.isfile(resource_json): + raise FileNotFoundError(f"Input resource file not found: {resource_json}") + + # Create output parent directory if needed + output_dir = os.path.dirname(os.path.abspath(output_json)) + os.makedirs(output_dir, exist_ok=True) + + # Read input to validate structure before invoking + try: + with open(resource_json, "r") as f: + resource_data = json.load(f) + except json.JSONDecodeError as e: + raise ValueError(f"Invalid JSON in resource file: {e}") + + # Validate required keys + required_keys = {"time", "memory", "memory_unit"} + missing = required_keys - set(resource_data.keys()) + if missing: + raise ValueError(f"Missing required keys in resource JSON: {missing}") + + # Build the Python one-liner that exercises the package's utilities + code = ( + "import json,sys; " + "from cluster_helper.slurm import SlurmTime,set_timelimit; " + "from cluster_helper.utils import convert_mb; " + "c=json.load(open(sys.argv[1])); " + "d={'parsed':repr(SlurmTime(c['time']))," + "'time_limit':set_timelimit({'time':c['time']})['timelimit']," + "'memory_in_gb':convert_mb(c['memory'],c['memory_unit'])}; " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + cmd = ["python", "-c", code, resource_json, output_json] + + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except OSError as e: + raise RuntimeError(f"Failed to execute python: {e}") + + if result.returncode != 0: + stderr_msg = result.stderr.strip() if result.stderr else "No stderr output" + raise RuntimeError( + f"Command failed with exit code {result.returncode}: {stderr_msg}" + ) + + # Read the output file to include normalized values in metadata + try: + with open(output_json, "r") as f: + normalized = json.load(f) + except (OSError, json.JSONDecodeError) as e: + raise RuntimeError(f"Failed to read output file: {e}") + + return { + "endpoint": "normalize_scheduler_resources", + "input_file": resource_json, + "output_file": output_json, + "normalized": normalized, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ipython-cluster-helper_normalize_scheduler_resources_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ipython-cluster-helper_normalize_scheduler_resources_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..ea02ee5fa9b013449f06cc384117d07fb5360fad --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ipython-cluster-helper_normalize_scheduler_resources_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e7c43cd24280361f6c38fa18700126514f57a2977f2dbfd6a6b2e85d311c5311", + "elapsed_seconds": 5.222705364227295, + "usage": { + "prompt_tokens": 6383, + "completion_tokens": 799, + "total_tokens": 7182, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6383 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "62160a6e-110b-44cd-bb32-918379790be6" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/iqtree_infer_protein_tree_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/iqtree_infer_protein_tree_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2ba54054a03db39e07bc9d45f2ba8fa246bef77b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/iqtree_infer_protein_tree_test.py @@ -0,0 +1,82 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("iqtree") + +@mcp.tool() +def infer_protein_tree(alignment_file: str, output_prefix: str) -> dict: + """ + Infer a protein tree using IQ-TREE with LG model, one thread, and seed 1. + + Args: + alignment_file: Path to the input alignment file (PHYLIP/FASTA/NEXUS/CLUSTAL/MSF format) + output_prefix: Prefix for all output files generated by IQ-TREE + + Returns: + Dictionary containing metadata about the inference run + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(output_prefix) + if output_dir: + os.makedirs(output_dir, exist_ok=True) + + # Build the command + cmd = [ + "iqtree", + "-s", alignment_file, + "-m", "LG", + "-nt", "1", + "-seed", "1", + "-pre", output_prefix + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"IQ-TREE failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Collect output file paths based on the prefix + output_files = [] + prefix = output_prefix + # Common IQ-TREE output files + possible_extensions = [ + ".treefile", ".iqtree", ".log", ".ckp.gz", + ".mldist", ".contree", ".splits.nex", ".trees" + ] + for ext in possible_extensions: + candidate = prefix + ext + if os.path.exists(candidate): + output_files.append(candidate) + + return { + "status": "success", + "command": " ".join(cmd), + "alignment_file": alignment_file, + "output_prefix": output_prefix, + "output_files": output_files, + "stdout": result.stdout, + "stderr": result.stderr, + "returncode": result.returncode + } + + except FileNotFoundError: + raise RuntimeError("IQ-TREE executable not found. Please ensure it is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error executing IQ-TREE: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/iqtree_infer_protein_tree_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/iqtree_infer_protein_tree_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..5b0461b26a7ca6bfae92bbee8a4d3e9282d3d0eb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/iqtree_infer_protein_tree_test.py.raw.txt @@ -0,0 +1,84 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("iqtree") + +@mcp.tool() +def infer_protein_tree(alignment_file: str, output_prefix: str) -> dict: + """ + Infer a protein tree using IQ-TREE with LG model, one thread, and seed 1. + + Args: + alignment_file: Path to the input alignment file (PHYLIP/FASTA/NEXUS/CLUSTAL/MSF format) + output_prefix: Prefix for all output files generated by IQ-TREE + + Returns: + Dictionary containing metadata about the inference run + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(output_prefix) + if output_dir: + os.makedirs(output_dir, exist_ok=True) + + # Build the command + cmd = [ + "iqtree", + "-s", alignment_file, + "-m", "LG", + "-nt", "1", + "-seed", "1", + "-pre", output_prefix + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"IQ-TREE failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Collect output file paths based on the prefix + output_files = [] + prefix = output_prefix + # Common IQ-TREE output files + possible_extensions = [ + ".treefile", ".iqtree", ".log", ".ckp.gz", + ".mldist", ".contree", ".splits.nex", ".trees" + ] + for ext in possible_extensions: + candidate = prefix + ext + if os.path.exists(candidate): + output_files.append(candidate) + + return { + "status": "success", + "command": " ".join(cmd), + "alignment_file": alignment_file, + "output_prefix": output_prefix, + "output_files": output_files, + "stdout": result.stdout, + "stderr": result.stderr, + "returncode": result.returncode + } + + except FileNotFoundError: + raise RuntimeError("IQ-TREE executable not found. Please ensure it is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error executing IQ-TREE: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/iqtree_infer_protein_tree_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/iqtree_infer_protein_tree_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..53ce4e932308c5b544ca2e59dd91d81dad668e59 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/iqtree_infer_protein_tree_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "27de2197cbca3b0614a8a32681e4c11afd33726e181ff375d052a232a7b17fd7", + "elapsed_seconds": 4.551584482192993, + "usage": { + "prompt_tokens": 3898, + "completion_tokens": 587, + "total_tokens": 4485, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 3898 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "42b3929f-36f2-4cc5-a367-86f825f3e40f" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/itsxpress_trim_fungal_its_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/itsxpress_trim_fungal_its_test.py new file mode 100644 index 0000000000000000000000000000000000000000..43c1f09d249104dcc4eac3df06200697b0c533eb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/itsxpress_trim_fungal_its_test.py @@ -0,0 +1,66 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("itsxpress") + +@mcp.tool() +def trim_fungal_its( + input_fastq: str, + trimmed_fastq: str, + log_file: str +) -> dict: + """ + Trim the complete fungal ITS region from one pinned NCBI Saccharomyces cerevisiae rDNA read using one thread. + + Args: + input_fastq: Path to input FASTQ file + trimmed_fastq: Path to output trimmed FASTQ file + log_file: Path to log file + """ + # Create parent directories for output files + for path in [trimmed_fastq, log_file]: + parent = Path(path).parent + if parent and not parent.exists(): + parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "itsxpress", + "--fastq", input_fastq, + "--single_end", + "--outfile", trimmed_fastq, + "--region", "ALL", + "--taxa", "Fungi", + "--cluster_id", "1.0", + "--threads", "1", + "--log", log_file + ] + + # Execute command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"itsxpress failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "endpoint": "trim_fungal_its", + "input_fastq": input_fastq, + "trimmed_fastq": trimmed_fastq, + "log_file": log_file, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/itsxpress_trim_fungal_its_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/itsxpress_trim_fungal_its_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..40061495cf4b5e66bfc39fd10166398456a1a52c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/itsxpress_trim_fungal_its_test.py.raw.txt @@ -0,0 +1,68 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("itsxpress") + +@mcp.tool() +def trim_fungal_its( + input_fastq: str, + trimmed_fastq: str, + log_file: str +) -> dict: + """ + Trim the complete fungal ITS region from one pinned NCBI Saccharomyces cerevisiae rDNA read using one thread. + + Args: + input_fastq: Path to input FASTQ file + trimmed_fastq: Path to output trimmed FASTQ file + log_file: Path to log file + """ + # Create parent directories for output files + for path in [trimmed_fastq, log_file]: + parent = Path(path).parent + if parent and not parent.exists(): + parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "itsxpress", + "--fastq", input_fastq, + "--single_end", + "--outfile", trimmed_fastq, + "--region", "ALL", + "--taxa", "Fungi", + "--cluster_id", "1.0", + "--threads", "1", + "--log", log_file + ] + + # Execute command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"itsxpress failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "endpoint": "trim_fungal_its", + "input_fastq": input_fastq, + "trimmed_fastq": trimmed_fastq, + "log_file": log_file, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/itsxpress_trim_fungal_its_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/itsxpress_trim_fungal_its_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..6765e8a77b36a2a4fc36e38dcb4f90ac17984059 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/itsxpress_trim_fungal_its_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "86f7c2ad019e2064c212b85d0fb68167445695ae87a91aa6f51b3143a0a6f97a", + "elapsed_seconds": 3.309396982192993, + "usage": { + "prompt_tokens": 11620, + "completion_tokens": 465, + "total_tokens": 12085, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11620 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "0e353094-025f-4181-adf0-41ae79f1b67b" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ivar_consensus_from_pileup_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ivar_consensus_from_pileup_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ddde69f321787967fdc030184c2218a82f06e72a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ivar_consensus_from_pileup_test.py @@ -0,0 +1,81 @@ +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("ivar-consensus") + +@mcp.tool() +def consensus_from_pileup(input_pileup: str, output_prefix: str) -> dict: + """ + Generate a consensus sequence from a pileup file using ivar consensus. + + Args: + input_pileup: Path to the input pileup file (read from stdin) + output_prefix: Prefix for output files (e.g., output.fa and output.qual.txt) + + Returns: + Dictionary with output file paths and metadata + """ + # Validate input file exists + input_path = Path(input_pileup) + if not input_path.exists(): + raise FileNotFoundError(f"Input pileup file not found: {input_pileup}") + + # Create output parent directory if needed + output_prefix_path = Path(output_prefix) + output_dir = output_prefix_path.parent + if output_dir and not output_dir.exists(): + output_dir.mkdir(parents=True, exist_ok=True) + + # Build command: ivar consensus -p {output_prefix} -q 0 -t 0 -m 1 < {input_pileup} + cmd = [ + "ivar", + "consensus", + "-p", output_prefix, + "-q", "0", + "-t", "0", + "-m", "1" + ] + + # Run command with input file as stdin + try: + with open(input_pileup, "rb") as f: + result = subprocess.run( + cmd, + stdin=f, + capture_output=True, + text=False, + check=False + ) + except OSError as e: + raise RuntimeError(f"Failed to execute ivar consensus: {e}") + + # Check exit code + if result.returncode != 0: + stderr_text = result.stderr.decode("utf-8", errors="replace") if result.stderr else "" + raise RuntimeError( + f"ivar consensus failed with exit code {result.returncode}: {stderr_text}" + ) + + # Determine output files (ivar consensus produces .fa and .qual.txt) + fasta_path = f"{output_prefix}.fa" + qual_path = f"{output_prefix}.qual.txt" + + # Verify outputs exist + if not os.path.exists(fasta_path): + raise RuntimeError(f"Expected output FASTA file not created: {fasta_path}") + + # Return structured metadata + return { + "status": "success", + "output_fasta": fasta_path, + "output_quality": qual_path if os.path.exists(qual_path) else None, + "command": " ".join(cmd), + "exit_code": result.returncode, + "stderr": result.stderr.decode("utf-8", errors="replace") if result.stderr else "" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ivar_consensus_from_pileup_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ivar_consensus_from_pileup_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2724ca2f8744bdc859eb5d2d1e7596fa88ed3e23 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ivar_consensus_from_pileup_test.py.raw.txt @@ -0,0 +1,83 @@ +```python +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("ivar-consensus") + +@mcp.tool() +def consensus_from_pileup(input_pileup: str, output_prefix: str) -> dict: + """ + Generate a consensus sequence from a pileup file using ivar consensus. + + Args: + input_pileup: Path to the input pileup file (read from stdin) + output_prefix: Prefix for output files (e.g., output.fa and output.qual.txt) + + Returns: + Dictionary with output file paths and metadata + """ + # Validate input file exists + input_path = Path(input_pileup) + if not input_path.exists(): + raise FileNotFoundError(f"Input pileup file not found: {input_pileup}") + + # Create output parent directory if needed + output_prefix_path = Path(output_prefix) + output_dir = output_prefix_path.parent + if output_dir and not output_dir.exists(): + output_dir.mkdir(parents=True, exist_ok=True) + + # Build command: ivar consensus -p {output_prefix} -q 0 -t 0 -m 1 < {input_pileup} + cmd = [ + "ivar", + "consensus", + "-p", output_prefix, + "-q", "0", + "-t", "0", + "-m", "1" + ] + + # Run command with input file as stdin + try: + with open(input_pileup, "rb") as f: + result = subprocess.run( + cmd, + stdin=f, + capture_output=True, + text=False, + check=False + ) + except OSError as e: + raise RuntimeError(f"Failed to execute ivar consensus: {e}") + + # Check exit code + if result.returncode != 0: + stderr_text = result.stderr.decode("utf-8", errors="replace") if result.stderr else "" + raise RuntimeError( + f"ivar consensus failed with exit code {result.returncode}: {stderr_text}" + ) + + # Determine output files (ivar consensus produces .fa and .qual.txt) + fasta_path = f"{output_prefix}.fa" + qual_path = f"{output_prefix}.qual.txt" + + # Verify outputs exist + if not os.path.exists(fasta_path): + raise RuntimeError(f"Expected output FASTA file not created: {fasta_path}") + + # Return structured metadata + return { + "status": "success", + "output_fasta": fasta_path, + "output_quality": qual_path if os.path.exists(qual_path) else None, + "command": " ".join(cmd), + "exit_code": result.returncode, + "stderr": result.stderr.decode("utf-8", errors="replace") if result.stderr else "" + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ivar_consensus_from_pileup_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ivar_consensus_from_pileup_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..207d7fefb8130f509f41d67c4098463bfccabcae --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ivar_consensus_from_pileup_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "666e3d60420b63885951eb58d72bd69f407ada4d7c5e1c98bb7afe401d256ea8", + "elapsed_seconds": 4.316157341003418, + "usage": { + "prompt_tokens": 628, + "completion_tokens": 652, + "total_tokens": 1280, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 628 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "fb609bbe-24f6-4fea-b58e-2a8d319ea386" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kallisto_build_transcript_index_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kallisto_build_transcript_index_test.py new file mode 100644 index 0000000000000000000000000000000000000000..8f3e40387695337ae3eb85e986d3748424db2578 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kallisto_build_transcript_index_test.py @@ -0,0 +1,64 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("kallisto-index") + +@mcp.tool() +def build_transcript_index(transcripts_fasta: str, output_index: str) -> dict: + """ + Build a kallisto transcript index from a FASTA file. + + Args: + transcripts_fasta: Path to the transcript FASTA file + output_index: Path where the kallisto index will be written + """ + # Create output parent directory if needed + output_path = Path(output_index) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "kallisto", + "index", + "-i", + output_index, + transcripts_fasta + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("kallisto executable not found in PATH") + + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError(f"kallisto index failed with exit code {result.returncode}: {error_msg}") + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Expected output file {output_index} was not created") + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "exit_code": result.returncode, + "output_index": str(output_path.resolve()), + "transcripts_fasta": str(Path(transcripts_fasta).resolve()), + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kallisto_build_transcript_index_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kallisto_build_transcript_index_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..77cb80986bc84c2d57d97a27ab434b30c509d62c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kallisto_build_transcript_index_test.py.raw.txt @@ -0,0 +1,66 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("kallisto-index") + +@mcp.tool() +def build_transcript_index(transcripts_fasta: str, output_index: str) -> dict: + """ + Build a kallisto transcript index from a FASTA file. + + Args: + transcripts_fasta: Path to the transcript FASTA file + output_index: Path where the kallisto index will be written + """ + # Create output parent directory if needed + output_path = Path(output_index) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "kallisto", + "index", + "-i", + output_index, + transcripts_fasta + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("kallisto executable not found in PATH") + + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError(f"kallisto index failed with exit code {result.returncode}: {error_msg}") + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Expected output file {output_index} was not created") + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "exit_code": result.returncode, + "output_index": str(output_path.resolve()), + "transcripts_fasta": str(Path(transcripts_fasta).resolve()), + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kallisto_build_transcript_index_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kallisto_build_transcript_index_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..b1a4c06f2ddd30c8916af2cd842dc3317cc66c83 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kallisto_build_transcript_index_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e9a8e7ba9d8dbcea35624efcf612d3df146af859821fa9bd196615f0b31f4ee8", + "elapsed_seconds": 3.879701614379883, + "usage": { + "prompt_tokens": 625, + "completion_tokens": 442, + "total_tokens": 1067, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 625 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "3df0d9ae-4d2e-4c03-a9f7-f38d2922b6c3" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kmc_count_kmers_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kmc_count_kmers_test.py new file mode 100644 index 0000000000000000000000000000000000000000..178d731673f969f2c4672f7f27367076c58e8097 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kmc_count_kmers_test.py @@ -0,0 +1,96 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("kmc") + +@mcp.tool() +def count_kmers( + input_fastq: str, + output_prefix: str, + working_dir: str, + output_tsv: str +) -> dict: + """ + Count canonical 3-mers with minimum count 1, one thread, and 2 GB memory, + then dump text counts. + """ + # Create working directory if it doesn't exist + Path(working_dir).mkdir(parents=True, exist_ok=True) + + # Create parent directory for output_tsv if needed + output_tsv_path = Path(output_tsv) + if output_tsv_path.parent and not output_tsv_path.parent.exists(): + output_tsv_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run kmc + kmc_cmd = [ + "kmc", + "-k3", + "-ci1", + "-t1", + "-m2", + "-hp", + input_fastq, + output_prefix, + working_dir + ] + + try: + kmc_result = subprocess.run( + kmc_cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("kmc executable not found in PATH") + + if kmc_result.returncode != 0: + raise RuntimeError( + f"kmc failed with exit code {kmc_result.returncode}\n" + f"stdout: {kmc_result.stdout}\n" + f"stderr: {kmc_result.stderr}" + ) + + # Step 2: Run kmc_dump + kmc_dump_cmd = [ + "kmc_dump", + output_prefix, + output_tsv + ] + + try: + dump_result = subprocess.run( + kmc_dump_cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("kmc_dump executable not found in PATH") + + if dump_result.returncode != 0: + raise RuntimeError( + f"kmc_dump failed with exit code {dump_result.returncode}\n" + f"stdout: {dump_result.stdout}\n" + f"stderr: {dump_result.stderr}" + ) + + # Return structured metadata + return { + "status": "success", + "endpoint": "count_kmers", + "input_fastq": input_fastq, + "output_prefix": output_prefix, + "working_dir": working_dir, + "output_tsv": output_tsv, + "kmc_command": " ".join(kmc_cmd), + "kmc_dump_command": " ".join(kmc_dump_cmd), + "kmc_stdout": kmc_result.stdout, + "kmc_stderr": kmc_result.stderr, + "kmc_dump_stdout": dump_result.stdout, + "kmc_dump_stderr": dump_result.stderr + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kmc_count_kmers_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kmc_count_kmers_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..ba0a044b1bf89189c025db8e806cfb7063b7092f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kmc_count_kmers_test.py.raw.txt @@ -0,0 +1,98 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("kmc") + +@mcp.tool() +def count_kmers( + input_fastq: str, + output_prefix: str, + working_dir: str, + output_tsv: str +) -> dict: + """ + Count canonical 3-mers with minimum count 1, one thread, and 2 GB memory, + then dump text counts. + """ + # Create working directory if it doesn't exist + Path(working_dir).mkdir(parents=True, exist_ok=True) + + # Create parent directory for output_tsv if needed + output_tsv_path = Path(output_tsv) + if output_tsv_path.parent and not output_tsv_path.parent.exists(): + output_tsv_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run kmc + kmc_cmd = [ + "kmc", + "-k3", + "-ci1", + "-t1", + "-m2", + "-hp", + input_fastq, + output_prefix, + working_dir + ] + + try: + kmc_result = subprocess.run( + kmc_cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("kmc executable not found in PATH") + + if kmc_result.returncode != 0: + raise RuntimeError( + f"kmc failed with exit code {kmc_result.returncode}\n" + f"stdout: {kmc_result.stdout}\n" + f"stderr: {kmc_result.stderr}" + ) + + # Step 2: Run kmc_dump + kmc_dump_cmd = [ + "kmc_dump", + output_prefix, + output_tsv + ] + + try: + dump_result = subprocess.run( + kmc_dump_cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("kmc_dump executable not found in PATH") + + if dump_result.returncode != 0: + raise RuntimeError( + f"kmc_dump failed with exit code {dump_result.returncode}\n" + f"stdout: {dump_result.stdout}\n" + f"stderr: {dump_result.stderr}" + ) + + # Return structured metadata + return { + "status": "success", + "endpoint": "count_kmers", + "input_fastq": input_fastq, + "output_prefix": output_prefix, + "working_dir": working_dir, + "output_tsv": output_tsv, + "kmc_command": " ".join(kmc_cmd), + "kmc_dump_command": " ".join(kmc_dump_cmd), + "kmc_stdout": kmc_result.stdout, + "kmc_stderr": kmc_result.stderr, + "kmc_dump_stdout": dump_result.stdout, + "kmc_dump_stderr": dump_result.stderr + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kmc_count_kmers_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kmc_count_kmers_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..ec5299cc21b0aa1a07e9490bff9feac467a962dd --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/kmc_count_kmers_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "99a740196d0e2bf7f57109d0ca6d51ef7c654d34e538facc8b39aa01e22e47ce", + "elapsed_seconds": 4.054833650588989, + "usage": { + "prompt_tokens": 1245, + "completion_tokens": 711, + "total_tokens": 1956, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1245 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "89ea3c4c-1a0c-4a60-8ae4-ac0889b24ce8" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/krona_taxonomy_chart_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/krona_taxonomy_chart_test.py new file mode 100644 index 0000000000000000000000000000000000000000..d7183d101e2ba28f7e7d93db45889885b7aa682b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/krona_taxonomy_chart_test.py @@ -0,0 +1,60 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("krona") + +@mcp.tool() +def taxonomy_chart(input_table: str, output_html: str) -> dict: + """ + Create a Krona chart from a text file. + + Args: + input_table: Path to the input text file containing taxonomy data + output_html: Path where the output HTML chart will be written + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_html) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "ktImportText", + "-o", + output_html, + input_table + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"ktImportText failed with exit code {result.returncode}: " + f"{result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_html} was not created") + + return { + "status": "success", + "output_html": str(output_path), + "input_table": str(input_table), + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("ktImportText executable not found. Ensure Krona is properly installed.") + except Exception as e: + raise RuntimeError(f"Error executing ktImportText: {str(e)}") \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/krona_taxonomy_chart_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/krona_taxonomy_chart_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2f101882bdb41bc82ad8fb7a6247a5677d59a638 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/krona_taxonomy_chart_test.py.raw.txt @@ -0,0 +1,62 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("krona") + +@mcp.tool() +def taxonomy_chart(input_table: str, output_html: str) -> dict: + """ + Create a Krona chart from a text file. + + Args: + input_table: Path to the input text file containing taxonomy data + output_html: Path where the output HTML chart will be written + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_html) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "ktImportText", + "-o", + output_html, + input_table + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"ktImportText failed with exit code {result.returncode}: " + f"{result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_html} was not created") + + return { + "status": "success", + "output_html": str(output_path), + "input_table": str(input_table), + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("ktImportText executable not found. Ensure Krona is properly installed.") + except Exception as e: + raise RuntimeError(f"Error executing ktImportText: {str(e)}") +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/krona_taxonomy_chart_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/krona_taxonomy_chart_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..89988d245a75bf08b4f9bc16d78ba9beb4ebcfa6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/krona_taxonomy_chart_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "4903b5d644fa7f9688e213715601ec41e1c8ca2722bda3be344bd0b7c06cdc59", + "elapsed_seconds": 2.904395341873169, + "usage": { + "prompt_tokens": 6669, + "completion_tokens": 387, + "total_tokens": 7056, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6669 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "ac5ba8ae-877c-481a-9073-7ed9c82e2a26" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/last_align_dna_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/last_align_dna_test.py new file mode 100644 index 0000000000000000000000000000000000000000..4db298155697effccd96fd255f8874ee4827e69e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/last_align_dna_test.py @@ -0,0 +1,75 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("last-align-dna") + +@mcp.tool() +def align_dna( + reference_fasta: str, + query_fasta: str, + database_prefix: str, + output_maf: str +) -> str: + """ + Build a nucleotide LAST database, then align query sequences and capture MAF. + """ + # Ensure output parent directory exists + output_path = Path(output_maf) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: lastdb {database_prefix} {reference_fasta} + lastdb_cmd = ["lastdb", database_prefix, reference_fasta] + try: + result_db = subprocess.run( + lastdb_cmd, + capture_output=True, + text=True, + check=False + ) + if result_db.returncode != 0: + raise RuntimeError( + f"lastdb failed with exit code {result_db.returncode}: " + f"stderr: {result_db.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("lastdb executable not found in PATH") + + # Step 2: lastal {database_prefix} {query_fasta}, capture stdout to output_maf + lastal_cmd = ["lastal", database_prefix, query_fasta] + try: + result_al = subprocess.run( + lastal_cmd, + capture_output=True, + text=True, + check=False + ) + if result_al.returncode != 0: + raise RuntimeError( + f"lastal failed with exit code {result_al.returncode}: " + f"stderr: {result_al.stderr}" + ) + # Write captured stdout to output_maf + with open(output_maf, "w", encoding="utf-8") as f: + f.write(result_al.stdout) + except FileNotFoundError: + raise RuntimeError("lastal executable not found in PATH") + + # Return structured JSON-serializable metadata + metadata = { + "endpoint": "align_dna", + "status": "success", + "database_prefix": database_prefix, + "reference_fasta": reference_fasta, + "query_fasta": query_fasta, + "output_maf": output_maf, + "lastdb_exit_code": result_db.returncode, + "lastal_exit_code": result_al.returncode, + "maf_bytes_written": len(result_al.stdout.encode("utf-8")) + } + return json.dumps(metadata, indent=2) + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/last_align_dna_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/last_align_dna_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..cb83727bcd9f8e3667a81becd6e39664254a9926 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/last_align_dna_test.py.raw.txt @@ -0,0 +1,77 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("last-align-dna") + +@mcp.tool() +def align_dna( + reference_fasta: str, + query_fasta: str, + database_prefix: str, + output_maf: str +) -> str: + """ + Build a nucleotide LAST database, then align query sequences and capture MAF. + """ + # Ensure output parent directory exists + output_path = Path(output_maf) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: lastdb {database_prefix} {reference_fasta} + lastdb_cmd = ["lastdb", database_prefix, reference_fasta] + try: + result_db = subprocess.run( + lastdb_cmd, + capture_output=True, + text=True, + check=False + ) + if result_db.returncode != 0: + raise RuntimeError( + f"lastdb failed with exit code {result_db.returncode}: " + f"stderr: {result_db.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("lastdb executable not found in PATH") + + # Step 2: lastal {database_prefix} {query_fasta}, capture stdout to output_maf + lastal_cmd = ["lastal", database_prefix, query_fasta] + try: + result_al = subprocess.run( + lastal_cmd, + capture_output=True, + text=True, + check=False + ) + if result_al.returncode != 0: + raise RuntimeError( + f"lastal failed with exit code {result_al.returncode}: " + f"stderr: {result_al.stderr}" + ) + # Write captured stdout to output_maf + with open(output_maf, "w", encoding="utf-8") as f: + f.write(result_al.stdout) + except FileNotFoundError: + raise RuntimeError("lastal executable not found in PATH") + + # Return structured JSON-serializable metadata + metadata = { + "endpoint": "align_dna", + "status": "success", + "database_prefix": database_prefix, + "reference_fasta": reference_fasta, + "query_fasta": query_fasta, + "output_maf": output_maf, + "lastdb_exit_code": result_db.returncode, + "lastal_exit_code": result_al.returncode, + "maf_bytes_written": len(result_al.stdout.encode("utf-8")) + } + return json.dumps(metadata, indent=2) + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/last_align_dna_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/last_align_dna_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..afe694749c1d8d232f1c1fd7fde229d20fbe676a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/last_align_dna_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "77d15027d4f63025a1f9d27d0c8eadc966da77a4d90deaa354eb116dc24b2eb5", + "elapsed_seconds": 4.693171501159668, + "usage": { + "prompt_tokens": 865, + "completion_tokens": 596, + "total_tokens": 1461, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 865 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "7c08b6c2-d558-42d3-96fc-4c792048373e" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/locarna_align_rna_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/locarna_align_rna_test.py new file mode 100644 index 0000000000000000000000000000000000000000..8adcf95cc2ecca3b4d76debebf4f5989e1a638da --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/locarna_align_rna_test.py @@ -0,0 +1,65 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("locarna-mcp") + +@mcp.tool() +def align_rna(input_fasta: str, output_dir: str) -> dict: + """ + Align RNA sequences using mlocarna (locarna 2.0.1). + + Args: + input_fasta: Path to input FASTA file containing RNA sequences + output_dir: Directory where alignment results will be written + + Returns: + Dictionary with execution metadata including output directory path + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "mlocarna", + "--tgtdir", str(output_path), + "--quiet", + str(input_fasta) + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"mlocarna failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "output_dir": str(output_path), + "input_fasta": str(input_fasta), + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("mlocarna executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing mlocarna: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/locarna_align_rna_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/locarna_align_rna_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..1a761cf38d585d88167fa02516c8f0cdd242c5d0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/locarna_align_rna_test.py.raw.txt @@ -0,0 +1,67 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("locarna-mcp") + +@mcp.tool() +def align_rna(input_fasta: str, output_dir: str) -> dict: + """ + Align RNA sequences using mlocarna (locarna 2.0.1). + + Args: + input_fasta: Path to input FASTA file containing RNA sequences + output_dir: Directory where alignment results will be written + + Returns: + Dictionary with execution metadata including output directory path + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "mlocarna", + "--tgtdir", str(output_path), + "--quiet", + str(input_fasta) + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"mlocarna failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "output_dir": str(output_path), + "input_fasta": str(input_fasta), + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("mlocarna executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing mlocarna: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/locarna_align_rna_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/locarna_align_rna_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..3aadea1be63ec5b8a80ca4e566b63b6b8d10dc56 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/locarna_align_rna_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "3c873d591eaeebfecd40433f550b7286cd2bc736546965b8fcc2cf884a00f088", + "elapsed_seconds": 2.78796124458313, + "usage": { + "prompt_tokens": 2405, + "completion_tokens": 423, + "total_tokens": 2828, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 2405 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "1cec1e10-f4f8-4495-a7ad-d3df5ef797df" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/macs2_call_narrow_peak_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/macs2_call_narrow_peak_test.py new file mode 100644 index 0000000000000000000000000000000000000000..8b18ddc2432a22090c03648f60164bf9250e9260 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/macs2_call_narrow_peak_test.py @@ -0,0 +1,83 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("macs2") + + +@mcp.tool() +def call_narrow_peak(treatment_bed: str, output_dir: str) -> dict: + """ + Call one narrow peak with a fixed model-free extension and deterministic single-threaded fixture settings. + + Args: + treatment_bed: Path to the treatment BED file. + output_dir: Directory where output files will be written. + + Returns: + JSON-serializable metadata about the invocation. + """ + # Create output directory if it doesn't exist + os.makedirs(output_dir, exist_ok=True) + + # Build the command as a list to avoid shell=True + command = [ + "bash", + "-lc", + "LD_PRELOAD='/225040511/project/Beyond_Prompt-Based_Planning/Biomanus-V2/Experiment1/repairs/libglibc_finite_compat.so' macs2 callpeak -t '{treatment_bed}' -f BED -g 40 -n fixture --outdir '{output_dir}' --nomodel --extsize 10 --keep-dup all --nolambda -p 0.5 --verbose 0".format( + treatment_bed=treatment_bed, output_dir=output_dir + ), + ] + + try: + # Execute the command + result = subprocess.run( + command, + capture_output=True, + text=True, + check=False, + ) + + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Collect output files that are expected to be generated + expected_files = [ + "fixture_peaks.xls", + "fixture_peaks.narrowPeak", + "fixture_summits.bed", + "fixture_model.r", + ] + + output_files = {} + for fname in expected_files: + fpath = os.path.join(output_dir, fname) + if os.path.exists(fpath): + output_files[fname] = fpath + + return { + "status": "success", + "command": command, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": output_dir, + "output_files": output_files, + } + + except Exception as e: + return { + "status": "error", + "error": str(e), + "command": command, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/macs2_call_narrow_peak_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/macs2_call_narrow_peak_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..8a08354ccbc9c89573db68fea0c72db2ae4244e0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/macs2_call_narrow_peak_test.py.raw.txt @@ -0,0 +1,85 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("macs2") + + +@mcp.tool() +def call_narrow_peak(treatment_bed: str, output_dir: str) -> dict: + """ + Call one narrow peak with a fixed model-free extension and deterministic single-threaded fixture settings. + + Args: + treatment_bed: Path to the treatment BED file. + output_dir: Directory where output files will be written. + + Returns: + JSON-serializable metadata about the invocation. + """ + # Create output directory if it doesn't exist + os.makedirs(output_dir, exist_ok=True) + + # Build the command as a list to avoid shell=True + command = [ + "bash", + "-lc", + "LD_PRELOAD='/225040511/project/Beyond_Prompt-Based_Planning/Biomanus-V2/Experiment1/repairs/libglibc_finite_compat.so' macs2 callpeak -t '{treatment_bed}' -f BED -g 40 -n fixture --outdir '{output_dir}' --nomodel --extsize 10 --keep-dup all --nolambda -p 0.5 --verbose 0".format( + treatment_bed=treatment_bed, output_dir=output_dir + ), + ] + + try: + # Execute the command + result = subprocess.run( + command, + capture_output=True, + text=True, + check=False, + ) + + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Collect output files that are expected to be generated + expected_files = [ + "fixture_peaks.xls", + "fixture_peaks.narrowPeak", + "fixture_summits.bed", + "fixture_model.r", + ] + + output_files = {} + for fname in expected_files: + fpath = os.path.join(output_dir, fname) + if os.path.exists(fpath): + output_files[fname] = fpath + + return { + "status": "success", + "command": command, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": output_dir, + "output_files": output_files, + } + + except Exception as e: + return { + "status": "error", + "error": str(e), + "command": command, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/macs2_call_narrow_peak_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/macs2_call_narrow_peak_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..fb7be9d0c564d6686d6144d1e360ac5b054056bb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/macs2_call_narrow_peak_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "2b82be7ab1b21596062e48bdef1ed0a1d9a4ed8139d717816c40ac9a8c1678fb", + "elapsed_seconds": 5.101291179656982, + "usage": { + "prompt_tokens": 14194, + "completion_tokens": 598, + "total_tokens": 14792, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 14194 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "ef62e787-aebe-41c3-b353-b8b3e6e81587" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mageck_count_sgrna_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mageck_count_sgrna_test.py new file mode 100644 index 0000000000000000000000000000000000000000..fab2f762040bfec67d03161f4b313da219ff3c9f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mageck_count_sgrna_test.py @@ -0,0 +1,103 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("mageck") + +@mcp.tool() +def count_sgrna(library_file: str, input_fastq: str, output_prefix: str) -> dict: + """ + Count sgRNA reads from FASTQ files using MAGeCK count. + + Args: + library_file: Path to the sgRNA library file (CSV/TSV format) + input_fastq: Path to the input FASTQ file + output_prefix: Prefix for output files (will create parent directories) + + Returns: + Dictionary with execution metadata and output file paths + """ + # Create output parent directories + output_path = Path(output_prefix) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "mageck", + "count", + "-l", + library_file, + "--fastq", + input_fastq, + "--sample-label", + "fixture", + "--norm-method", + "none", + "-n", + output_prefix + ] + + # Execute command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "mageck executable not found in PATH", + "command": cmd, + "returncode": -1, + "stdout": "", + "stderr": "mageck executable not found" + } + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"mageck count failed with exit code {result.returncode}\n" + f"Command: {' '.join(cmd)}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Collect output files that MAGeCK typically generates + output_files = [] + # Main count table + count_file = f"{output_prefix}.count.txt" + if os.path.exists(count_file): + output_files.append(count_file) + + # Normalized count table (though normalization is disabled, file may still be created) + norm_file = f"{output_prefix}.norm.txt" + if os.path.exists(norm_file): + output_files.append(norm_file) + + # Summary file + summary_file = f"{output_prefix}.summary.txt" + if os.path.exists(summary_file): + output_files.append(summary_file) + + # Return structured metadata + return { + "success": True, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_prefix": output_prefix, + "output_files": output_files, + "library_file": library_file, + "input_fastq": input_fastq, + "sample_label": "fixture", + "normalization": "none" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mageck_count_sgrna_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mageck_count_sgrna_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2d08db7581f504ba84f0353ba81d83ab29189197 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mageck_count_sgrna_test.py.raw.txt @@ -0,0 +1,105 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("mageck") + +@mcp.tool() +def count_sgrna(library_file: str, input_fastq: str, output_prefix: str) -> dict: + """ + Count sgRNA reads from FASTQ files using MAGeCK count. + + Args: + library_file: Path to the sgRNA library file (CSV/TSV format) + input_fastq: Path to the input FASTQ file + output_prefix: Prefix for output files (will create parent directories) + + Returns: + Dictionary with execution metadata and output file paths + """ + # Create output parent directories + output_path = Path(output_prefix) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "mageck", + "count", + "-l", + library_file, + "--fastq", + input_fastq, + "--sample-label", + "fixture", + "--norm-method", + "none", + "-n", + output_prefix + ] + + # Execute command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "mageck executable not found in PATH", + "command": cmd, + "returncode": -1, + "stdout": "", + "stderr": "mageck executable not found" + } + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"mageck count failed with exit code {result.returncode}\n" + f"Command: {' '.join(cmd)}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Collect output files that MAGeCK typically generates + output_files = [] + # Main count table + count_file = f"{output_prefix}.count.txt" + if os.path.exists(count_file): + output_files.append(count_file) + + # Normalized count table (though normalization is disabled, file may still be created) + norm_file = f"{output_prefix}.norm.txt" + if os.path.exists(norm_file): + output_files.append(norm_file) + + # Summary file + summary_file = f"{output_prefix}.summary.txt" + if os.path.exists(summary_file): + output_files.append(summary_file) + + # Return structured metadata + return { + "success": True, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_prefix": output_prefix, + "output_files": output_files, + "library_file": library_file, + "input_fastq": input_fastq, + "sample_label": "fixture", + "normalization": "none" + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mageck_count_sgrna_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mageck_count_sgrna_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..19254697a3cf17fd2385eb465f19962c93ad335b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mageck_count_sgrna_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "30f09a9c96251b8ddbee484782c394db06b16e4cf74745ab09f091a5bde64c42", + "elapsed_seconds": 4.068566560745239, + "usage": { + "prompt_tokens": 708, + "completion_tokens": 698, + "total_tokens": 1406, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 708 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "64f2d8f0-9ee0-481b-abe2-4487e5de9cf3" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mash_sketch_fasta_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mash_sketch_fasta_test.py new file mode 100644 index 0000000000000000000000000000000000000000..a0b0f8c45cc43ecc5d24f120001b7c204c3fc801 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mash_sketch_fasta_test.py @@ -0,0 +1,82 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("mash-sketch-fasta") + +@mcp.tool() +def sketch_fasta(input_fasta: str, output_prefix: str, output_info: str) -> dict: + """ + Create a Mash sketch from a FASTA file with fixed k=6 and sketch size=10, + then inspect the derived .msh file and return metadata. + """ + # Ensure output parent directories exist + for path in [output_prefix, output_info]: + parent = os.path.dirname(os.path.abspath(path)) + os.makedirs(parent, exist_ok=True) + + # Step 1: mash sketch -k 6 -s 10 -o {output_prefix} {input_fasta} + sketch_cmd = [ + "mash", + "sketch", + "-k", "6", + "-s", "10", + "-o", output_prefix, + input_fasta + ] + sketch_result = subprocess.run( + sketch_cmd, + capture_output=True, + text=True, + check=False + ) + if sketch_result.returncode != 0: + raise RuntimeError( + f"mash sketch failed with exit code {sketch_result.returncode}: " + f"stdout={sketch_result.stdout}, stderr={sketch_result.stderr}" + ) + + # Derived .msh file path + msh_path = output_prefix + ".msh" + if not os.path.exists(msh_path): + raise RuntimeError(f"Expected sketch file {msh_path} was not created") + + # Step 2: mash info -t {msh_path}, capture stdout to output_info + info_cmd = ["mash", "info", "-t", msh_path] + info_result = subprocess.run( + info_cmd, + capture_output=True, + text=True, + check=False + ) + if info_result.returncode != 0: + raise RuntimeError( + f"mash info failed with exit code {info_result.returncode}: " + f"stdout={info_result.stdout}, stderr={info_result.stderr}" + ) + + # Write captured stdout to output_info path + with open(output_info, "w") as f: + f.write(info_result.stdout) + + # Build structured metadata + metadata = { + "endpoint": "sketch_fasta", + "input_fasta": input_fasta, + "output_prefix": output_prefix, + "output_info": output_info, + "sketch_file": msh_path, + "kmer_size": 6, + "sketch_size": 10, + "info_stdout": info_result.stdout, + "info_stderr": info_result.stderr, + "sketch_stdout": sketch_result.stdout, + "sketch_stderr": sketch_result.stderr + } + + return metadata + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mash_sketch_fasta_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mash_sketch_fasta_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..e50f23c7ffb7272e5b73bff88af28db8dd7830cd --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mash_sketch_fasta_test.py.raw.txt @@ -0,0 +1,84 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("mash-sketch-fasta") + +@mcp.tool() +def sketch_fasta(input_fasta: str, output_prefix: str, output_info: str) -> dict: + """ + Create a Mash sketch from a FASTA file with fixed k=6 and sketch size=10, + then inspect the derived .msh file and return metadata. + """ + # Ensure output parent directories exist + for path in [output_prefix, output_info]: + parent = os.path.dirname(os.path.abspath(path)) + os.makedirs(parent, exist_ok=True) + + # Step 1: mash sketch -k 6 -s 10 -o {output_prefix} {input_fasta} + sketch_cmd = [ + "mash", + "sketch", + "-k", "6", + "-s", "10", + "-o", output_prefix, + input_fasta + ] + sketch_result = subprocess.run( + sketch_cmd, + capture_output=True, + text=True, + check=False + ) + if sketch_result.returncode != 0: + raise RuntimeError( + f"mash sketch failed with exit code {sketch_result.returncode}: " + f"stdout={sketch_result.stdout}, stderr={sketch_result.stderr}" + ) + + # Derived .msh file path + msh_path = output_prefix + ".msh" + if not os.path.exists(msh_path): + raise RuntimeError(f"Expected sketch file {msh_path} was not created") + + # Step 2: mash info -t {msh_path}, capture stdout to output_info + info_cmd = ["mash", "info", "-t", msh_path] + info_result = subprocess.run( + info_cmd, + capture_output=True, + text=True, + check=False + ) + if info_result.returncode != 0: + raise RuntimeError( + f"mash info failed with exit code {info_result.returncode}: " + f"stdout={info_result.stdout}, stderr={info_result.stderr}" + ) + + # Write captured stdout to output_info path + with open(output_info, "w") as f: + f.write(info_result.stdout) + + # Build structured metadata + metadata = { + "endpoint": "sketch_fasta", + "input_fasta": input_fasta, + "output_prefix": output_prefix, + "output_info": output_info, + "sketch_file": msh_path, + "kmer_size": 6, + "sketch_size": 10, + "info_stdout": info_result.stdout, + "info_stderr": info_result.stderr, + "sketch_stdout": sketch_result.stdout, + "sketch_stderr": sketch_result.stderr + } + + return metadata + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mash_sketch_fasta_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mash_sketch_fasta_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..b9e2f70220d1f550707a57c0444cad63c338dbef --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mash_sketch_fasta_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e87f3b4bd7ea4a3d3e825c187aa9bddef5660aa620962c625a6eb9f94fda9f60", + "elapsed_seconds": 3.600365400314331, + "usage": { + "prompt_tokens": 712, + "completion_tokens": 653, + "total_tokens": 1365, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 712 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "42fffd5f-af20-4ecc-a37c-68f440415d64" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/maxquant_create_parameter_template_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/maxquant_create_parameter_template_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2e5a4b70cfdd2078cd7d37a71ab74ca5e65b79eb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/maxquant_create_parameter_template_test.py @@ -0,0 +1,77 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("maxquant") + + +@mcp.tool() +def create_parameter_template(request_file: str, output_xml: str) -> dict: + """ + Create a complete default MaxQuant mqpar XML parameter template at the requested output path. + + Args: + request_file: Path to the template request file (validated before template creation). + output_xml: Path where the generated mqpar XML template will be written. + """ + # Step 1: Validate the template request file + validate_cmd = ["validate_maxquant_template_request", request_file] + try: + validate_result = subprocess.run( + validate_cmd, + capture_output=True, + text=True, + check=False, + ) + if validate_result.returncode != 0: + raise RuntimeError( + f"Validation failed with exit code {validate_result.returncode}: " + f"{validate_result.stderr.strip()}" + ) + except FileNotFoundError as e: + raise RuntimeError(f"Validation executable not found: {e}") + + # Step 2: Create the parameter template using maxquant -c + # Ensure output parent directory exists + output_path = Path(output_xml) + output_path.parent.mkdir(parents=True, exist_ok=True) + + cmd = ["maxquant", "-c", str(output_path)] + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"maxquant executable not found: {e}") + + if result.returncode != 0: + raise RuntimeError( + f"maxquant -c failed with exit code {result.returncode}: " + f"{result.stderr.strip()}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError( + f"maxquant -c did not create the expected output file: {output_path}" + ) + + return { + "endpoint": "create_parameter_template", + "request_file": request_file, + "output_xml": str(output_path), + "status": "success", + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/maxquant_create_parameter_template_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/maxquant_create_parameter_template_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..655a7983327773985d4b25d04e68556450744fae --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/maxquant_create_parameter_template_test.py.raw.txt @@ -0,0 +1,79 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("maxquant") + + +@mcp.tool() +def create_parameter_template(request_file: str, output_xml: str) -> dict: + """ + Create a complete default MaxQuant mqpar XML parameter template at the requested output path. + + Args: + request_file: Path to the template request file (validated before template creation). + output_xml: Path where the generated mqpar XML template will be written. + """ + # Step 1: Validate the template request file + validate_cmd = ["validate_maxquant_template_request", request_file] + try: + validate_result = subprocess.run( + validate_cmd, + capture_output=True, + text=True, + check=False, + ) + if validate_result.returncode != 0: + raise RuntimeError( + f"Validation failed with exit code {validate_result.returncode}: " + f"{validate_result.stderr.strip()}" + ) + except FileNotFoundError as e: + raise RuntimeError(f"Validation executable not found: {e}") + + # Step 2: Create the parameter template using maxquant -c + # Ensure output parent directory exists + output_path = Path(output_xml) + output_path.parent.mkdir(parents=True, exist_ok=True) + + cmd = ["maxquant", "-c", str(output_path)] + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"maxquant executable not found: {e}") + + if result.returncode != 0: + raise RuntimeError( + f"maxquant -c failed with exit code {result.returncode}: " + f"{result.stderr.strip()}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError( + f"maxquant -c did not create the expected output file: {output_path}" + ) + + return { + "endpoint": "create_parameter_template", + "request_file": request_file, + "output_xml": str(output_path), + "status": "success", + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/maxquant_create_parameter_template_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/maxquant_create_parameter_template_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..49a36cd3364c748d4c5cb9314141919576d92950 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/maxquant_create_parameter_template_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "7c2d42520f19cc661328febbec4c5b4984fca009a85ecca2bd178d4b230eefad", + "elapsed_seconds": 4.8912577629089355, + "usage": { + "prompt_tokens": 947, + "completion_tokens": 528, + "total_tokens": 1475, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 947 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "03c9ba98-7424-43f0-9fac-7e8801a0da52" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/medaka_vcf_to_tsv_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/medaka_vcf_to_tsv_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ff819b18d067bf09e61f7b85ca9afc304100f0a0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/medaka_vcf_to_tsv_test.py @@ -0,0 +1,79 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import shutil +import json +from pathlib import Path + +mcp = FastMCP("medaka") + +@mcp.tool() +def vcf_to_tsv(input_vcf: str, output_tsv: str) -> dict: + """ + Convert a phased VCF file to TSV format using medaka tools vcf2tsv. + + Args: + input_vcf: Path to the input VCF file + output_tsv: Path to the output TSV file (derived by appending .tsv to input) + """ + # Create output directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_tsv)) + os.makedirs(output_dir, exist_ok=True) + + # Stage the input VCF in the output directory + staged_vcf = os.path.join(output_dir, os.path.basename(input_vcf)) + + # Step 1: Copy input VCF to staged location + cp_result = subprocess.run( + ["cp", input_vcf, staged_vcf], + capture_output=True, + text=True, + check=False + ) + if cp_result.returncode != 0: + raise RuntimeError(f"Failed to copy input VCF: {cp_result.stderr}") + + # Step 2: Run medaka tools vcf2tsv on the staged VCF + # The tool writes output to {staged_vcf}.tsv + result = subprocess.run( + ["medaka", "tools", "vcf2tsv", staged_vcf], + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + # Clean up staged file on error + if os.path.exists(staged_vcf): + os.remove(staged_vcf) + raise RuntimeError(f"medaka tools vcf2tsv failed with exit code {result.returncode}: {result.stderr}") + + # The tool creates {staged_vcf}.tsv, move it to the requested output path + generated_tsv = staged_vcf + ".tsv" + if not os.path.exists(generated_tsv): + # Clean up staged file + if os.path.exists(staged_vcf): + os.remove(staged_vcf) + raise RuntimeError(f"Expected output file {generated_tsv} was not created") + + # Move the generated TSV to the requested output location + shutil.move(generated_tsv, output_tsv) + + # Clean up staged VCF + if os.path.exists(staged_vcf): + os.remove(staged_vcf) + + # Return structured metadata + return { + "endpoint": "vcf_to_tsv", + "input_vcf": input_vcf, + "output_tsv": output_tsv, + "status": "success", + "output_size": os.path.getsize(output_tsv), + "tool": "medaka", + "version": "2.2.2" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/medaka_vcf_to_tsv_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/medaka_vcf_to_tsv_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..722335d6e3fc8b4c5e6723777f18035e8395deb8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/medaka_vcf_to_tsv_test.py.raw.txt @@ -0,0 +1,81 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import shutil +import json +from pathlib import Path + +mcp = FastMCP("medaka") + +@mcp.tool() +def vcf_to_tsv(input_vcf: str, output_tsv: str) -> dict: + """ + Convert a phased VCF file to TSV format using medaka tools vcf2tsv. + + Args: + input_vcf: Path to the input VCF file + output_tsv: Path to the output TSV file (derived by appending .tsv to input) + """ + # Create output directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_tsv)) + os.makedirs(output_dir, exist_ok=True) + + # Stage the input VCF in the output directory + staged_vcf = os.path.join(output_dir, os.path.basename(input_vcf)) + + # Step 1: Copy input VCF to staged location + cp_result = subprocess.run( + ["cp", input_vcf, staged_vcf], + capture_output=True, + text=True, + check=False + ) + if cp_result.returncode != 0: + raise RuntimeError(f"Failed to copy input VCF: {cp_result.stderr}") + + # Step 2: Run medaka tools vcf2tsv on the staged VCF + # The tool writes output to {staged_vcf}.tsv + result = subprocess.run( + ["medaka", "tools", "vcf2tsv", staged_vcf], + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + # Clean up staged file on error + if os.path.exists(staged_vcf): + os.remove(staged_vcf) + raise RuntimeError(f"medaka tools vcf2tsv failed with exit code {result.returncode}: {result.stderr}") + + # The tool creates {staged_vcf}.tsv, move it to the requested output path + generated_tsv = staged_vcf + ".tsv" + if not os.path.exists(generated_tsv): + # Clean up staged file + if os.path.exists(staged_vcf): + os.remove(staged_vcf) + raise RuntimeError(f"Expected output file {generated_tsv} was not created") + + # Move the generated TSV to the requested output location + shutil.move(generated_tsv, output_tsv) + + # Clean up staged VCF + if os.path.exists(staged_vcf): + os.remove(staged_vcf) + + # Return structured metadata + return { + "endpoint": "vcf_to_tsv", + "input_vcf": input_vcf, + "output_tsv": output_tsv, + "status": "success", + "output_size": os.path.getsize(output_tsv), + "tool": "medaka", + "version": "2.2.2" + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/medaka_vcf_to_tsv_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/medaka_vcf_to_tsv_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..e1804f992cfd8f21c7db3bfc7cbc837830f74967 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/medaka_vcf_to_tsv_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "f5baae78a313291a19684773507f0e2c8483c08d4b6ae7285bdbebc723402f59", + "elapsed_seconds": 4.6033995151519775, + "usage": { + "prompt_tokens": 15137, + "completion_tokens": 697, + "total_tokens": 15834, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 15137 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "afe01bf0-9d42-4315-af16-9919232e10e0" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/metagenome-atlas_initialize_project_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/metagenome-atlas_initialize_project_test.py new file mode 100644 index 0000000000000000000000000000000000000000..518ab2dcdecd17098c23d576751e2ee016e32401 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/metagenome-atlas_initialize_project_test.py @@ -0,0 +1,89 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("metagenome-atlas") + +@mcp.tool() +def initialize_project(reads_dir: str, work_dir: str, output_tsv: str) -> dict: + """ + Initialize a metagenome project from one paired FASTQ sample using two threads and the default MEGAHIT workflow configuration. + """ + # Create output parent directories + Path(output_tsv).parent.mkdir(parents=True, exist_ok=True) + Path(work_dir).parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run atlas init + cmd1 = [ + "atlas", + "init", + reads_dir, + "-w", + work_dir, + "-d", + os.path.join(work_dir, "databases"), + "--threads", + "2" + ] + + try: + result1 = subprocess.run(cmd1, capture_output=True, text=True, check=False) + if result1.returncode != 0: + raise RuntimeError(f"atlas init failed with exit code {result1.returncode}: {result1.stderr}") + except FileNotFoundError: + raise RuntimeError("atlas executable not found in PATH") + + # Step 2: Normalize atlas init output + samples_tsv = os.path.join(work_dir, "samples.tsv") + config_yaml = os.path.join(work_dir, "config.yaml") + + # Read the generated files + try: + with open(samples_tsv, 'r') as f: + samples_content = f.read() + with open(config_yaml, 'r') as f: + config_content = f.read() + except FileNotFoundError as e: + raise RuntimeError(f"Expected output file not found: {e}") + + # Write normalized summary to output_tsv + # The normalization here extracts key information from samples.tsv and config.yaml + # and writes a combined summary TSV + summary_lines = [] + summary_lines.append("# Atlas Project Initialization Summary") + summary_lines.append(f"# Work directory: {work_dir}") + summary_lines.append(f"# Reads directory: {reads_dir}") + summary_lines.append("") + summary_lines.append("# Samples:") + summary_lines.append(samples_content) + summary_lines.append("") + summary_lines.append("# Configuration (key settings):") + + # Extract key config settings + config_summary = [] + for line in config_content.splitlines(): + if any(key in line.lower() for key in ['assembler', 'threads', 'kmer', 'min_contig', 'coverage']): + config_summary.append(line) + + summary_lines.extend(config_summary) + + with open(output_tsv, 'w') as f: + f.write('\n'.join(summary_lines)) + + return { + "status": "success", + "work_dir": work_dir, + "reads_dir": reads_dir, + "output_tsv": output_tsv, + "samples_tsv": samples_tsv, + "config_yaml": config_yaml, + "databases_dir": os.path.join(work_dir, "databases"), + "threads": 2, + "message": "Project initialized successfully" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/metagenome-atlas_initialize_project_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/metagenome-atlas_initialize_project_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..ff92d734652bdb8ad74705268a10479af5ab01cd --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/metagenome-atlas_initialize_project_test.py.raw.txt @@ -0,0 +1,91 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("metagenome-atlas") + +@mcp.tool() +def initialize_project(reads_dir: str, work_dir: str, output_tsv: str) -> dict: + """ + Initialize a metagenome project from one paired FASTQ sample using two threads and the default MEGAHIT workflow configuration. + """ + # Create output parent directories + Path(output_tsv).parent.mkdir(parents=True, exist_ok=True) + Path(work_dir).parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run atlas init + cmd1 = [ + "atlas", + "init", + reads_dir, + "-w", + work_dir, + "-d", + os.path.join(work_dir, "databases"), + "--threads", + "2" + ] + + try: + result1 = subprocess.run(cmd1, capture_output=True, text=True, check=False) + if result1.returncode != 0: + raise RuntimeError(f"atlas init failed with exit code {result1.returncode}: {result1.stderr}") + except FileNotFoundError: + raise RuntimeError("atlas executable not found in PATH") + + # Step 2: Normalize atlas init output + samples_tsv = os.path.join(work_dir, "samples.tsv") + config_yaml = os.path.join(work_dir, "config.yaml") + + # Read the generated files + try: + with open(samples_tsv, 'r') as f: + samples_content = f.read() + with open(config_yaml, 'r') as f: + config_content = f.read() + except FileNotFoundError as e: + raise RuntimeError(f"Expected output file not found: {e}") + + # Write normalized summary to output_tsv + # The normalization here extracts key information from samples.tsv and config.yaml + # and writes a combined summary TSV + summary_lines = [] + summary_lines.append("# Atlas Project Initialization Summary") + summary_lines.append(f"# Work directory: {work_dir}") + summary_lines.append(f"# Reads directory: {reads_dir}") + summary_lines.append("") + summary_lines.append("# Samples:") + summary_lines.append(samples_content) + summary_lines.append("") + summary_lines.append("# Configuration (key settings):") + + # Extract key config settings + config_summary = [] + for line in config_content.splitlines(): + if any(key in line.lower() for key in ['assembler', 'threads', 'kmer', 'min_contig', 'coverage']): + config_summary.append(line) + + summary_lines.extend(config_summary) + + with open(output_tsv, 'w') as f: + f.write('\n'.join(summary_lines)) + + return { + "status": "success", + "work_dir": work_dir, + "reads_dir": reads_dir, + "output_tsv": output_tsv, + "samples_tsv": samples_tsv, + "config_yaml": config_yaml, + "databases_dir": os.path.join(work_dir, "databases"), + "threads": 2, + "message": "Project initialized successfully" + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/metagenome-atlas_initialize_project_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/metagenome-atlas_initialize_project_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..22ff3a91cdef02a660ed011c6b337c0499b91ea6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/metagenome-atlas_initialize_project_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "05f97e47a26d5a7fb549d5f3c1a8ff2b2c4da73f59a8c7401fa1a01fec199e45", + "elapsed_seconds": 5.4982686042785645, + "usage": { + "prompt_tokens": 8818, + "completion_tokens": 754, + "total_tokens": 9572, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 8818 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "69d476ca-f775-4f7b-aec0-8fd093534005" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mikado_configure_workflow_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mikado_configure_workflow_test.py new file mode 100644 index 0000000000000000000000000000000000000000..b72de00978eb9510b572d52d1912cb1a20499ae1 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mikado_configure_workflow_test.py @@ -0,0 +1,89 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("mikado") + +@mcp.tool() +def configure_workflow( + reference_fasta: str, + config_json: str, + seed: int +) -> dict: + """ + Generate a deterministic JSON workflow configuration with a fixed seed and explicit local reference genome. + + Args: + reference_fasta: Path to the reference genome FASTA file + config_json: Path where the output configuration JSON will be written + seed: Random seed for deterministic configuration generation + """ + # Create output parent directory if needed + config_path = Path(config_json) + if config_path.parent and not config_path.parent.exists(): + config_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "mikado", + "configure", + "--seed", + str(seed), + "--no-files", + "--reference", + reference_fasta, + config_json + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": f"Executable 'mikado' not found in PATH", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Verify output file was created + if not config_path.exists(): + return { + "success": False, + "error": f"Output file {config_json} was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "output_file": str(config_path.resolve()), + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr, + "parameters": { + "reference_fasta": reference_fasta, + "config_json": config_json, + "seed": seed + } + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mikado_configure_workflow_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mikado_configure_workflow_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..e21cdc7af073805efee2c850758e187590b35127 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mikado_configure_workflow_test.py.raw.txt @@ -0,0 +1,91 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("mikado") + +@mcp.tool() +def configure_workflow( + reference_fasta: str, + config_json: str, + seed: int +) -> dict: + """ + Generate a deterministic JSON workflow configuration with a fixed seed and explicit local reference genome. + + Args: + reference_fasta: Path to the reference genome FASTA file + config_json: Path where the output configuration JSON will be written + seed: Random seed for deterministic configuration generation + """ + # Create output parent directory if needed + config_path = Path(config_json) + if config_path.parent and not config_path.parent.exists(): + config_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "mikado", + "configure", + "--seed", + str(seed), + "--no-files", + "--reference", + reference_fasta, + config_json + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": f"Executable 'mikado' not found in PATH", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Verify output file was created + if not config_path.exists(): + return { + "success": False, + "error": f"Output file {config_json} was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "output_file": str(config_path.resolve()), + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr, + "parameters": { + "reference_fasta": reference_fasta, + "config_json": config_json, + "seed": seed + } + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mikado_configure_workflow_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mikado_configure_workflow_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..373f7f189132d5fb387ea87146853e356cef0989 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mikado_configure_workflow_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "94418691b3184ddd1ea19a164d314bf87b6eeeaa72adbdd01ab22d7bdd675c2f", + "elapsed_seconds": 4.3941380977630615, + "usage": { + "prompt_tokens": 12492, + "completion_tokens": 535, + "total_tokens": 13027, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 12492 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "066c5203-cfeb-4fea-bb77-2ce3cf976b4d" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/miniasm_assemble_overlap_graph_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/miniasm_assemble_overlap_graph_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ef4220d59d6e9f1d8e59cfb6699586f12bc1e43f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/miniasm_assemble_overlap_graph_test.py @@ -0,0 +1,101 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("miniasm-assemble-overlap-graph") + + +@mcp.tool() +def assemble_overlap_graph( + reads_fasta: str, + overlaps_paf: str, + output_gfa: str, +) -> dict[str, Any]: + """ + Assemble an overlap graph from reads and overlaps using miniasm. + + Args: + reads_fasta: Path to the input reads FASTA file. + overlaps_paf: Path to the input overlaps PAF file. + output_gfa: Path where the output GFA file will be written. + + Returns: + A JSON-serializable dictionary with metadata about the execution. + """ + # Validate required inputs exist + reads_path = Path(reads_fasta) + overlaps_path = Path(overlaps_paf) + if not reads_path.is_file(): + raise FileNotFoundError(f"Reads FASTA file not found: {reads_fasta}") + if not overlaps_path.is_file(): + raise FileNotFoundError(f"Overlaps PAF file not found: {overlaps_paf}") + + # Create output parent directory if needed + output_path = Path(output_gfa) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "miniasm", + "-1", + "-2", + "-f", + str(reads_path), + "-m", + "100", + "-s", + "50", + "-o", + "50", + "-c", + "1", + "-e", + "1", + "-I", + "0.1", + str(overlaps_path), + ] + + # Run the command, capturing stdout + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "miniasm executable not found. Ensure it is installed and in PATH." + ) + + if result.returncode != 0: + raise RuntimeError( + f"miniasm failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Write stdout to output file + output_path.write_text(result.stdout) + + # Return structured metadata + return { + "endpoint": "assemble_overlap_graph", + "status": "success", + "output_gfa": str(output_path), + "reads_fasta": str(reads_path), + "overlaps_paf": str(overlaps_path), + "command": cmd, + "exit_code": result.returncode, + "stdout_size_bytes": len(result.stdout.encode("utf-8")), + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/miniasm_assemble_overlap_graph_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/miniasm_assemble_overlap_graph_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..0c2d7c5ac6cb026d70a6beff643811e2210c1af7 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/miniasm_assemble_overlap_graph_test.py.raw.txt @@ -0,0 +1,103 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("miniasm-assemble-overlap-graph") + + +@mcp.tool() +def assemble_overlap_graph( + reads_fasta: str, + overlaps_paf: str, + output_gfa: str, +) -> dict[str, Any]: + """ + Assemble an overlap graph from reads and overlaps using miniasm. + + Args: + reads_fasta: Path to the input reads FASTA file. + overlaps_paf: Path to the input overlaps PAF file. + output_gfa: Path where the output GFA file will be written. + + Returns: + A JSON-serializable dictionary with metadata about the execution. + """ + # Validate required inputs exist + reads_path = Path(reads_fasta) + overlaps_path = Path(overlaps_paf) + if not reads_path.is_file(): + raise FileNotFoundError(f"Reads FASTA file not found: {reads_fasta}") + if not overlaps_path.is_file(): + raise FileNotFoundError(f"Overlaps PAF file not found: {overlaps_paf}") + + # Create output parent directory if needed + output_path = Path(output_gfa) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "miniasm", + "-1", + "-2", + "-f", + str(reads_path), + "-m", + "100", + "-s", + "50", + "-o", + "50", + "-c", + "1", + "-e", + "1", + "-I", + "0.1", + str(overlaps_path), + ] + + # Run the command, capturing stdout + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "miniasm executable not found. Ensure it is installed and in PATH." + ) + + if result.returncode != 0: + raise RuntimeError( + f"miniasm failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Write stdout to output file + output_path.write_text(result.stdout) + + # Return structured metadata + return { + "endpoint": "assemble_overlap_graph", + "status": "success", + "output_gfa": str(output_path), + "reads_fasta": str(reads_path), + "overlaps_paf": str(overlaps_path), + "command": cmd, + "exit_code": result.returncode, + "stdout_size_bytes": len(result.stdout.encode("utf-8")), + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/miniasm_assemble_overlap_graph_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/miniasm_assemble_overlap_graph_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..591a03c2606b842692d4d9993e1d012d4e825124 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/miniasm_assemble_overlap_graph_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "94d2241f7442e2d8fc418455004f0bed3f67462cc36a5a067d127c37c7f235cd", + "elapsed_seconds": 3.9628701210021973, + "usage": { + "prompt_tokens": 929, + "completion_tokens": 645, + "total_tokens": 1574, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 929 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "4aa51ab8-e4e4-485a-9bb3-7f216ca1e5ed" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minimap2_align_dna_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minimap2_align_dna_test.py new file mode 100644 index 0000000000000000000000000000000000000000..b639384a25f9354df9dd2245f49db07d8b519ecb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minimap2_align_dna_test.py @@ -0,0 +1,84 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("minimap2-align-dna") + +@mcp.tool() +def align_dna(reference_file: str, query_file: str, output_sam: str) -> dict: + """ + Align DNA sequences using minimap2 and produce SAM output. + + Args: + reference_file: Path to the reference FASTA file + query_file: Path to the query FASTA file + output_sam: Path where the SAM output will be written + """ + # Create output parent directory if needed + output_dir = os.path.dirname(os.path.abspath(output_sam)) + os.makedirs(output_dir, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "minimap2", + "-a", + "-t", + "1", + reference_file, + query_file + ] + + # Run the command, capturing stdout + try: + result = subprocess.run( + cmd, + capture_output=True, + text=False, # binary mode to preserve exact bytes + check=False # we'll check return code manually + ) + except FileNotFoundError: + return { + "success": False, + "error": "minimap2 executable not found in PATH", + "command": cmd + } + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"minimap2 exited with code {result.returncode}", + "stderr": result.stderr.decode('utf-8', errors='replace'), + "command": cmd + } + + # Write stdout to output file + try: + with open(output_sam, 'wb') as f: + f.write(result.stdout) + except Exception as e: + return { + "success": False, + "error": f"Failed to write output file: {str(e)}", + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "output_sam": output_sam, + "command": cmd, + "return_code": result.returncode, + "stdout_bytes": len(result.stdout), + "stderr": result.stderr.decode('utf-8', errors='replace') if result.stderr else "" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minimap2_align_dna_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minimap2_align_dna_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..0a19d45beba862aa585d88b4097c0d936448be04 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minimap2_align_dna_test.py.raw.txt @@ -0,0 +1,86 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("minimap2-align-dna") + +@mcp.tool() +def align_dna(reference_file: str, query_file: str, output_sam: str) -> dict: + """ + Align DNA sequences using minimap2 and produce SAM output. + + Args: + reference_file: Path to the reference FASTA file + query_file: Path to the query FASTA file + output_sam: Path where the SAM output will be written + """ + # Create output parent directory if needed + output_dir = os.path.dirname(os.path.abspath(output_sam)) + os.makedirs(output_dir, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "minimap2", + "-a", + "-t", + "1", + reference_file, + query_file + ] + + # Run the command, capturing stdout + try: + result = subprocess.run( + cmd, + capture_output=True, + text=False, # binary mode to preserve exact bytes + check=False # we'll check return code manually + ) + except FileNotFoundError: + return { + "success": False, + "error": "minimap2 executable not found in PATH", + "command": cmd + } + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"minimap2 exited with code {result.returncode}", + "stderr": result.stderr.decode('utf-8', errors='replace'), + "command": cmd + } + + # Write stdout to output file + try: + with open(output_sam, 'wb') as f: + f.write(result.stdout) + except Exception as e: + return { + "success": False, + "error": f"Failed to write output file: {str(e)}", + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "output_sam": output_sam, + "command": cmd, + "return_code": result.returncode, + "stdout_bytes": len(result.stdout), + "stderr": result.stderr.decode('utf-8', errors='replace') if result.stderr else "" + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minimap2_align_dna_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minimap2_align_dna_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..d6efcf6850f92b04b83f16135ffaf0a13b15688b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minimap2_align_dna_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e8d13f439576b6a5d61ac0904fcdd10c919fa0658c985c93f87e25e306c896ed", + "elapsed_seconds": 3.7116353511810303, + "usage": { + "prompt_tokens": 1398, + "completion_tokens": 577, + "total_tokens": 1975, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1398 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "237d6fea-0088-40bd-8aea-63825b9151db" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minvar_estimate_minimum_read_length_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minvar_estimate_minimum_read_length_test.py new file mode 100644 index 0000000000000000000000000000000000000000..0cc93dc81cdfef1227d5db77931355e51a75f972 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minvar_estimate_minimum_read_length_test.py @@ -0,0 +1,83 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("minvar") + + +@mcp.tool() +def estimate_minimum_read_length(input_fastq: str, output_json: str) -> dict: + """ + Estimate the minimum read length for MinVar analysis. + + Args: + input_fastq: Path to the input FASTQ file. + output_json: Path where the JSON output will be written. + + Returns: + A dictionary containing the result metadata. + """ + # Create output parent directories + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + code = ( + "import json,sys; " + "from minvar.prepare import compute_min_len; " + "v=compute_min_len(sys.argv[1]); " + "open(sys.argv[2],'w').write(json.dumps({'minimum_length':v},sort_keys=True)+'\\n')" + ) + cmd = [ + "python", + "-c", + code, + input_fastq, + output_json, + ] + + # Execute the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except Exception as e: + return { + "status": "error", + "error": f"Failed to execute command: {str(e)}", + "command": cmd, + } + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + return { + "status": "error", + "error": f"Command failed with exit code {result.returncode}: {error_msg}", + "command": cmd, + } + + # Read the output JSON to include in the response + try: + with open(output_json, "r") as f: + output_data = json.load(f) + except Exception as e: + output_data = {"error": f"Failed to read output file: {str(e)}"} + + return { + "status": "success", + "output_file": str(output_path), + "result": output_data, + "command": cmd, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minvar_estimate_minimum_read_length_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minvar_estimate_minimum_read_length_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..ed2efd5449a2c3112e05d5e469a1ee166026d723 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minvar_estimate_minimum_read_length_test.py.raw.txt @@ -0,0 +1,85 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("minvar") + + +@mcp.tool() +def estimate_minimum_read_length(input_fastq: str, output_json: str) -> dict: + """ + Estimate the minimum read length for MinVar analysis. + + Args: + input_fastq: Path to the input FASTQ file. + output_json: Path where the JSON output will be written. + + Returns: + A dictionary containing the result metadata. + """ + # Create output parent directories + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + code = ( + "import json,sys; " + "from minvar.prepare import compute_min_len; " + "v=compute_min_len(sys.argv[1]); " + "open(sys.argv[2],'w').write(json.dumps({'minimum_length':v},sort_keys=True)+'\\n')" + ) + cmd = [ + "python", + "-c", + code, + input_fastq, + output_json, + ] + + # Execute the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except Exception as e: + return { + "status": "error", + "error": f"Failed to execute command: {str(e)}", + "command": cmd, + } + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + return { + "status": "error", + "error": f"Command failed with exit code {result.returncode}: {error_msg}", + "command": cmd, + } + + # Read the output JSON to include in the response + try: + with open(output_json, "r") as f: + output_data = json.load(f) + except Exception as e: + output_data = {"error": f"Failed to read output file: {str(e)}"} + + return { + "status": "success", + "output_file": str(output_path), + "result": output_data, + "command": cmd, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minvar_estimate_minimum_read_length_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minvar_estimate_minimum_read_length_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..b3d633e81de2de09b07dc14218dc42ab9f7a17d7 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/minvar_estimate_minimum_read_length_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "29bab365933981a3b6efb4d26108c016b413186e1ca903334dd69ba7e5ad24ae", + "elapsed_seconds": 7.364319086074829, + "usage": { + "prompt_tokens": 5913, + "completion_tokens": 532, + "total_tokens": 6445, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 5913 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "fe456b4f-56da-488a-b945-f30bf8b45ec3" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mosdepth_coverage_summary_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mosdepth_coverage_summary_test.py new file mode 100644 index 0000000000000000000000000000000000000000..675a52d1163892f580b3d19956af6593a075215e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mosdepth_coverage_summary_test.py @@ -0,0 +1,90 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("mosdepth-coverage-summary") + +@mcp.tool() +def coverage_summary(input_bam: str, output_prefix: str) -> dict: + """ + Compute coverage summary statistics using mosdepth. + + Args: + input_bam: Path to the input BAM or CRAM file. + output_prefix: Prefix for output files (summary and distribution files will be created). + + Returns: + JSON-serializable metadata about the generated output files. + """ + # Create output parent directories + output_dir = Path(output_prefix).parent + if output_dir and not output_dir.exists(): + output_dir.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "mosdepth", + "-n", # no per-base output + "-t", "1", # one thread + output_prefix, + input_bam + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("mosdepth executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute mosdepth: {str(e)}") + + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError(f"mosdepth failed with exit code {result.returncode}: {error_msg}") + + # Determine output files based on mosdepth naming convention + summary_file = f"{output_prefix}.mosdepth.summary.txt" + dist_file = f"{output_prefix}.mosdepth.dist.txt" + + # Verify output files exist + missing_files = [] + if not os.path.isfile(summary_file): + missing_files.append(summary_file) + if not os.path.isfile(dist_file): + missing_files.append(dist_file) + + if missing_files: + raise RuntimeError(f"Expected output files not created: {', '.join(missing_files)}") + + # Read summary file content for metadata + try: + with open(summary_file, 'r') as f: + summary_content = f.read() + except Exception as e: + summary_content = f"Error reading summary file: {str(e)}" + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "exit_code": result.returncode, + "output_files": { + "summary": summary_file, + "distribution": dist_file + }, + "summary_content": summary_content, + "stderr": result.stderr if result.stderr else "", + "stdout": result.stdout if result.stdout else "" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mosdepth_coverage_summary_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mosdepth_coverage_summary_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..daef4d2f91f62a90025195e05b82dbe5e68a8303 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mosdepth_coverage_summary_test.py.raw.txt @@ -0,0 +1,92 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("mosdepth-coverage-summary") + +@mcp.tool() +def coverage_summary(input_bam: str, output_prefix: str) -> dict: + """ + Compute coverage summary statistics using mosdepth. + + Args: + input_bam: Path to the input BAM or CRAM file. + output_prefix: Prefix for output files (summary and distribution files will be created). + + Returns: + JSON-serializable metadata about the generated output files. + """ + # Create output parent directories + output_dir = Path(output_prefix).parent + if output_dir and not output_dir.exists(): + output_dir.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "mosdepth", + "-n", # no per-base output + "-t", "1", # one thread + output_prefix, + input_bam + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("mosdepth executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute mosdepth: {str(e)}") + + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError(f"mosdepth failed with exit code {result.returncode}: {error_msg}") + + # Determine output files based on mosdepth naming convention + summary_file = f"{output_prefix}.mosdepth.summary.txt" + dist_file = f"{output_prefix}.mosdepth.dist.txt" + + # Verify output files exist + missing_files = [] + if not os.path.isfile(summary_file): + missing_files.append(summary_file) + if not os.path.isfile(dist_file): + missing_files.append(dist_file) + + if missing_files: + raise RuntimeError(f"Expected output files not created: {', '.join(missing_files)}") + + # Read summary file content for metadata + try: + with open(summary_file, 'r') as f: + summary_content = f.read() + except Exception as e: + summary_content = f"Error reading summary file: {str(e)}" + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "exit_code": result.returncode, + "output_files": { + "summary": summary_file, + "distribution": dist_file + }, + "summary_content": summary_content, + "stderr": result.stderr if result.stderr else "", + "stdout": result.stdout if result.stdout else "" + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mosdepth_coverage_summary_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mosdepth_coverage_summary_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..972dbfffac098871d39d2e71fb7c50420b4ee51d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mosdepth_coverage_summary_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "209b79feeaf4b28721c9344bbbb2e4d8438d380b5eb51fce53c96b334fd7194c", + "elapsed_seconds": 4.481462717056274, + "usage": { + "prompt_tokens": 1005, + "completion_tokens": 650, + "total_tokens": 1655, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1005 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "74e8d2f4-8264-4f22-a91c-05d6a4967cf8" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mothur_summarize_sequences_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mothur_summarize_sequences_test.py new file mode 100644 index 0000000000000000000000000000000000000000..33810316fa5e77df44a63ed65305a3a038555b5d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mothur_summarize_sequences_test.py @@ -0,0 +1,117 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("mothur-summarize-sequences") + +@mcp.tool() +def summarize_sequences(input_fasta: str, output_dir: str) -> dict: + """ + Run mothur summary.seqs on a FASTA file and return summary metadata. + + Args: + input_fasta: Path to input FASTA file + output_dir: Directory where output files will be written + + Returns: + Dictionary with output file paths and command execution metadata + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Resolve input path to absolute + input_path = Path(input_fasta).resolve() + if not input_path.exists(): + raise FileNotFoundError(f"Input FASTA file not found: {input_path}") + + # Build mothur command string + # Use forward slashes for paths to avoid escaping issues + input_str = str(input_path).replace("\\", "/") + output_str = str(output_path.resolve()).replace("\\", "/") + + mothur_command = f"#set.dir(output={output_str}); summary.seqs(fasta={input_str}, processors=1)" + + # Execute mothur + try: + result = subprocess.run( + ["mothur", mothur_command], + capture_output=True, + text=True, + check=False, + cwd=str(output_path) # Run in output dir to keep files there + ) + except FileNotFoundError: + raise RuntimeError("mothur executable not found in PATH") + + # Check return code + if result.returncode != 0: + error_msg = f"mothur failed with exit code {result.returncode}\n" + error_msg += f"STDOUT:\n{result.stdout}\n" + error_msg += f"STDERR:\n{result.stderr}" + raise RuntimeError(error_msg) + + # Determine output filename based on input basename + # mothur typically creates .summary file + input_basename = input_path.stem + summary_file = output_path / f"{input_basename}.summary" + + # Also check for other possible output patterns + possible_outputs = [ + output_path / f"{input_basename}.summary", + output_path / f"{input_basename}.summary", + output_path / f"{input_basename}.summary", + ] + + # Find the actual summary file (mothur may add suffixes) + found_summary = None + for candidate in output_path.iterdir(): + if candidate.name.startswith(input_basename) and candidate.suffix == ".summary": + found_summary = candidate + break + + if found_summary is None: + # Try to find any .summary file created recently + summary_files = list(output_path.glob("*.summary")) + if summary_files: + found_summary = max(summary_files, key=lambda p: p.stat().st_mtime) + + # Parse summary content if found + summary_data = {} + if found_summary and found_summary.exists(): + try: + with open(found_summary, "r") as f: + lines = f.readlines() + if lines: + # Parse header and first data row + header = lines[0].strip().split("\t") + if len(lines) > 1: + values = lines[1].strip().split("\t") + summary_data = dict(zip(header, values)) + except Exception as e: + summary_data = {"parse_error": str(e)} + + # Collect all output files created + output_files = [] + for f in output_path.iterdir(): + if f.is_file(): + output_files.append(str(f)) + + return { + "status": "success", + "command": mothur_command, + "exit_code": result.returncode, + "output_dir": str(output_path), + "input_fasta": str(input_path), + "summary_file": str(found_summary) if found_summary else None, + "summary_data": summary_data, + "output_files": output_files, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mothur_summarize_sequences_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mothur_summarize_sequences_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..4b2e87eb1d651f5fab4d975a2448408fc71eaad3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mothur_summarize_sequences_test.py.raw.txt @@ -0,0 +1,119 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("mothur-summarize-sequences") + +@mcp.tool() +def summarize_sequences(input_fasta: str, output_dir: str) -> dict: + """ + Run mothur summary.seqs on a FASTA file and return summary metadata. + + Args: + input_fasta: Path to input FASTA file + output_dir: Directory where output files will be written + + Returns: + Dictionary with output file paths and command execution metadata + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Resolve input path to absolute + input_path = Path(input_fasta).resolve() + if not input_path.exists(): + raise FileNotFoundError(f"Input FASTA file not found: {input_path}") + + # Build mothur command string + # Use forward slashes for paths to avoid escaping issues + input_str = str(input_path).replace("\\", "/") + output_str = str(output_path.resolve()).replace("\\", "/") + + mothur_command = f"#set.dir(output={output_str}); summary.seqs(fasta={input_str}, processors=1)" + + # Execute mothur + try: + result = subprocess.run( + ["mothur", mothur_command], + capture_output=True, + text=True, + check=False, + cwd=str(output_path) # Run in output dir to keep files there + ) + except FileNotFoundError: + raise RuntimeError("mothur executable not found in PATH") + + # Check return code + if result.returncode != 0: + error_msg = f"mothur failed with exit code {result.returncode}\n" + error_msg += f"STDOUT:\n{result.stdout}\n" + error_msg += f"STDERR:\n{result.stderr}" + raise RuntimeError(error_msg) + + # Determine output filename based on input basename + # mothur typically creates .summary file + input_basename = input_path.stem + summary_file = output_path / f"{input_basename}.summary" + + # Also check for other possible output patterns + possible_outputs = [ + output_path / f"{input_basename}.summary", + output_path / f"{input_basename}.summary", + output_path / f"{input_basename}.summary", + ] + + # Find the actual summary file (mothur may add suffixes) + found_summary = None + for candidate in output_path.iterdir(): + if candidate.name.startswith(input_basename) and candidate.suffix == ".summary": + found_summary = candidate + break + + if found_summary is None: + # Try to find any .summary file created recently + summary_files = list(output_path.glob("*.summary")) + if summary_files: + found_summary = max(summary_files, key=lambda p: p.stat().st_mtime) + + # Parse summary content if found + summary_data = {} + if found_summary and found_summary.exists(): + try: + with open(found_summary, "r") as f: + lines = f.readlines() + if lines: + # Parse header and first data row + header = lines[0].strip().split("\t") + if len(lines) > 1: + values = lines[1].strip().split("\t") + summary_data = dict(zip(header, values)) + except Exception as e: + summary_data = {"parse_error": str(e)} + + # Collect all output files created + output_files = [] + for f in output_path.iterdir(): + if f.is_file(): + output_files.append(str(f)) + + return { + "status": "success", + "command": mothur_command, + "exit_code": result.returncode, + "output_dir": str(output_path), + "input_fasta": str(input_path), + "summary_file": str(found_summary) if found_summary else None, + "summary_data": summary_data, + "output_files": output_files, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mothur_summarize_sequences_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mothur_summarize_sequences_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..024d56b92c4ec5a820f7f894e75b6cc4a8dc3760 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/mothur_summarize_sequences_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e9fc545733c7e041b42e379c242b798c23ead0b3d32947c63e5aacaf932f3d0c", + "elapsed_seconds": 6.036216735839844, + "usage": { + "prompt_tokens": 3719, + "completion_tokens": 962, + "total_tokens": 4681, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 3719 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "c6ebf35c-dcc0-40ba-a8fb-e5eeb0cae3ac" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msisensor-pro_scan_microsatellites_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msisensor-pro_scan_microsatellites_test.py new file mode 100644 index 0000000000000000000000000000000000000000..e267e7328e463082181d416522f99684b4c24e17 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msisensor-pro_scan_microsatellites_test.py @@ -0,0 +1,67 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("msisensor-pro") + +@mcp.tool() +def scan_microsatellites(reference_fasta: str, output_table: str) -> dict: + """ + Scan the reference genome to get microsatellites information. + + Args: + reference_fasta: Path to the reference FASTA file + output_table: Path where the output table will be written + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_table) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "msisensor-pro", + "scan", + "-d", reference_fasta, + "-o", output_table, + "-c", "5" + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"msisensor-pro scan failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Check if output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_table} was not created") + + return { + "status": "success", + "command": " ".join(cmd), + "reference_fasta": reference_fasta, + "output_table": output_table, + "output_file_size": output_path.stat().st_size, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("msisensor-pro executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing msisensor-pro scan: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msisensor-pro_scan_microsatellites_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msisensor-pro_scan_microsatellites_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..5a638a969e2f79a70f614971c409fc5162d9708a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msisensor-pro_scan_microsatellites_test.py.raw.txt @@ -0,0 +1,69 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("msisensor-pro") + +@mcp.tool() +def scan_microsatellites(reference_fasta: str, output_table: str) -> dict: + """ + Scan the reference genome to get microsatellites information. + + Args: + reference_fasta: Path to the reference FASTA file + output_table: Path where the output table will be written + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_table) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "msisensor-pro", + "scan", + "-d", reference_fasta, + "-o", output_table, + "-c", "5" + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"msisensor-pro scan failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Check if output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_table} was not created") + + return { + "status": "success", + "command": " ".join(cmd), + "reference_fasta": reference_fasta, + "output_table": output_table, + "output_file_size": output_path.stat().st_size, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("msisensor-pro executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing msisensor-pro scan: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msisensor-pro_scan_microsatellites_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msisensor-pro_scan_microsatellites_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..eb600a0d6680b7d6b2ba4daa61588effb58c0bcc --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msisensor-pro_scan_microsatellites_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "851998b773db650ce3ad4235e4af40be7626cf5419b84d70c0a91be443604a5b", + "elapsed_seconds": 5.845319986343384, + "usage": { + "prompt_tokens": 996, + "completion_tokens": 461, + "total_tokens": 1457, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 996 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "dd016ab3-95e0-4e3d-a540-99106ee0f698" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msstitch_build_sequence_searchspace_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msstitch_build_sequence_searchspace_test.py new file mode 100644 index 0000000000000000000000000000000000000000..18746abd534ae56c0e134c10b8fb91e40d728753 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msstitch_build_sequence_searchspace_test.py @@ -0,0 +1,80 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sqlite3 +import sys +import tempfile +from pathlib import Path + +mcp = FastMCP("msstitch") + +@mcp.tool() +def build_sequence_searchspace(input_fasta: str, lookup_db: str, summary_json: str) -> dict: + """ + Trypsinize protein FASTA into an SQLite lookup and export a stable JSON projection for semantic validation. + + Args: + input_fasta: Path to input FASTA file + lookup_db: Path to output SQLite database file + summary_json: Path to output JSON summary file + """ + # Create output parent directories + for path in [lookup_db, summary_json]: + parent = os.path.dirname(os.path.abspath(path)) + os.makedirs(parent, exist_ok=True) + + # Step 1: Create empty SQLite file and run msslookup seqspace + cmd1 = [ + "bash", "-lc", + f"touch '{lookup_db}' && msslookup seqspace -i '{input_fasta}' --dbfile '{lookup_db}'" + ] + + result1 = subprocess.run( + cmd1, + capture_output=True, + text=True, + check=False + ) + + if result1.returncode != 0: + raise RuntimeError(f"msslookup seqspace failed with exit code {result1.returncode}: {result1.stderr}") + + # Step 2: Extract sequences from SQLite and write JSON summary + python_script = """ +import json, sqlite3, sys +c = sqlite3.connect(sys.argv[1]) +rows = [r[0] for r in c.execute('select seqs from known_searchspace order by seqs')] +open(sys.argv[2], 'w').write(json.dumps({'known_searchspace': rows, 'count': len(rows)}, sort_keys=True) + '\\n') +""" + + cmd2 = [ + "python", "-c", python_script, + lookup_db, + summary_json + ] + + result2 = subprocess.run( + cmd2, + capture_output=True, + text=True, + check=False + ) + + if result2.returncode != 0: + raise RuntimeError(f"JSON summary generation failed with exit code {result2.returncode}: {result2.stderr}") + + # Read the generated summary for metadata + with open(summary_json, 'r') as f: + summary_data = json.load(f) + + return { + "status": "success", + "lookup_db": lookup_db, + "summary_json": summary_json, + "sequence_count": summary_data.get("count", 0), + "known_searchspace": summary_data.get("known_searchspace", []) + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msstitch_build_sequence_searchspace_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msstitch_build_sequence_searchspace_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..42d06ef257d9b1aa899e737e7012f643ac987fc9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msstitch_build_sequence_searchspace_test.py.raw.txt @@ -0,0 +1,82 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sqlite3 +import sys +import tempfile +from pathlib import Path + +mcp = FastMCP("msstitch") + +@mcp.tool() +def build_sequence_searchspace(input_fasta: str, lookup_db: str, summary_json: str) -> dict: + """ + Trypsinize protein FASTA into an SQLite lookup and export a stable JSON projection for semantic validation. + + Args: + input_fasta: Path to input FASTA file + lookup_db: Path to output SQLite database file + summary_json: Path to output JSON summary file + """ + # Create output parent directories + for path in [lookup_db, summary_json]: + parent = os.path.dirname(os.path.abspath(path)) + os.makedirs(parent, exist_ok=True) + + # Step 1: Create empty SQLite file and run msslookup seqspace + cmd1 = [ + "bash", "-lc", + f"touch '{lookup_db}' && msslookup seqspace -i '{input_fasta}' --dbfile '{lookup_db}'" + ] + + result1 = subprocess.run( + cmd1, + capture_output=True, + text=True, + check=False + ) + + if result1.returncode != 0: + raise RuntimeError(f"msslookup seqspace failed with exit code {result1.returncode}: {result1.stderr}") + + # Step 2: Extract sequences from SQLite and write JSON summary + python_script = """ +import json, sqlite3, sys +c = sqlite3.connect(sys.argv[1]) +rows = [r[0] for r in c.execute('select seqs from known_searchspace order by seqs')] +open(sys.argv[2], 'w').write(json.dumps({'known_searchspace': rows, 'count': len(rows)}, sort_keys=True) + '\\n') +""" + + cmd2 = [ + "python", "-c", python_script, + lookup_db, + summary_json + ] + + result2 = subprocess.run( + cmd2, + capture_output=True, + text=True, + check=False + ) + + if result2.returncode != 0: + raise RuntimeError(f"JSON summary generation failed with exit code {result2.returncode}: {result2.stderr}") + + # Read the generated summary for metadata + with open(summary_json, 'r') as f: + summary_data = json.load(f) + + return { + "status": "success", + "lookup_db": lookup_db, + "summary_json": summary_json, + "sequence_count": summary_data.get("count", 0), + "known_searchspace": summary_data.get("known_searchspace", []) + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msstitch_build_sequence_searchspace_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msstitch_build_sequence_searchspace_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..e4d13494007d49028b115a7716af215f2be0fefb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/msstitch_build_sequence_searchspace_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "fc8d4f148cdfa2b25b353f57b8291fe9dc05f832013b8d6139ef546b9d272419", + "elapsed_seconds": 3.9982657432556152, + "usage": { + "prompt_tokens": 16138, + "completion_tokens": 637, + "total_tokens": 16775, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 16138 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "39025893-017b-4814-a195-af0a86eba699" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/muscle_align_proteins_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/muscle_align_proteins_test.py new file mode 100644 index 0000000000000000000000000000000000000000..170c69c333c84cad2b665ed1aee9656465e73663 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/muscle_align_proteins_test.py @@ -0,0 +1,83 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("muscle") + +@mcp.tool() +def align_proteins(input_file: str, output_file: str) -> dict: + """ + Align protein sequences using MUSCLE 5.3. + + Args: + input_file: Path to input FASTA file + output_file: Path to output aligned FASTA file + """ + # Create output parent directories + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "muscle", + "-align", + input_file, + "-output", + output_file, + "-threads", + "1" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "MUSCLE executable not found. Please ensure it is installed and in PATH.", + "command": cmd + } + + # Check exit code + if result.returncode != 0: + return { + "success": False, + "error": f"MUSCLE failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": "Output file was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "output_file": str(output_path), + "input_file": input_file, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr, + "exit_code": result.returncode, + "output_format": "FASTA", + "tool": "muscle", + "version": "5.3" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/muscle_align_proteins_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/muscle_align_proteins_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..fb79652b4612c13f9bffe21b249358b339b18451 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/muscle_align_proteins_test.py.raw.txt @@ -0,0 +1,85 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("muscle") + +@mcp.tool() +def align_proteins(input_file: str, output_file: str) -> dict: + """ + Align protein sequences using MUSCLE 5.3. + + Args: + input_file: Path to input FASTA file + output_file: Path to output aligned FASTA file + """ + # Create output parent directories + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "muscle", + "-align", + input_file, + "-output", + output_file, + "-threads", + "1" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "MUSCLE executable not found. Please ensure it is installed and in PATH.", + "command": cmd + } + + # Check exit code + if result.returncode != 0: + return { + "success": False, + "error": f"MUSCLE failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": "Output file was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "output_file": str(output_path), + "input_file": input_file, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr, + "exit_code": result.returncode, + "output_format": "FASTA", + "tool": "muscle", + "version": "5.3" + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/muscle_align_proteins_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/muscle_align_proteins_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..bca4502624540fb674bb625a8aa73b2739b5a84d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/muscle_align_proteins_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "584592a89ff48017c626a3b2617930138663edee67f8ad68cbaff31a80f72e94", + "elapsed_seconds": 3.205782651901245, + "usage": { + "prompt_tokens": 1276, + "completion_tokens": 502, + "total_tokens": 1778, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1276 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "480503f0-6c38-4412-ac39-dbffe66b92a1" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nanopolish_index_and_check_fast5_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nanopolish_index_and_check_fast5_test.py new file mode 100644 index 0000000000000000000000000000000000000000..9c79d6be5dc1a94f357cfa2c8fc2c267d3618d50 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nanopolish_index_and_check_fast5_test.py @@ -0,0 +1,92 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("nanopolish") + +@mcp.tool() +def index_and_check_fast5( + reads_fastq: str, + input_fast5: str, + output_txt: str +) -> dict: + """ + Index a FASTQ file and verify FAST5 file accessibility. + + Args: + reads_fastq: Path to the input FASTQ file + input_fast5: Path to the FAST5 file (used for verification) + output_txt: Path where the fast5-check output will be written + """ + # Validate input paths + reads_fastq_path = Path(reads_fastq) + input_fast5_path = Path(input_fast5) + output_txt_path = Path(output_txt) + + if not reads_fastq_path.exists(): + raise FileNotFoundError(f"FASTQ file not found: {reads_fastq_path}") + if not input_fast5_path.exists(): + raise FileNotFoundError(f"FAST5 file not found: {input_fast5_path}") + + # Create output directory if it doesn't exist + output_txt_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run nanopolish index + index_cmd = ["nanopolish", "index", str(reads_fastq_path)] + try: + index_result = subprocess.run( + index_cmd, + capture_output=True, + text=True, + check=False + ) + if index_result.returncode != 0: + raise RuntimeError( + f"nanopolish index failed with exit code {index_result.returncode}\n" + f"stdout: {index_result.stdout}\n" + f"stderr: {index_result.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("nanopolish executable not found in PATH") + + # Step 2: Run nanopolish fast5-check + check_cmd = ["nanopolish", "fast5-check", "-r", str(reads_fastq_path)] + try: + check_result = subprocess.run( + check_cmd, + capture_output=True, + text=True, + check=False + ) + if check_result.returncode != 0: + raise RuntimeError( + f"nanopolish fast5-check failed with exit code {check_result.returncode}\n" + f"stdout: {check_result.stdout}\n" + f"stderr: {check_result.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("nanopolish executable not found in PATH") + + # Write stdout to output file + with open(output_txt_path, 'w') as f: + f.write(check_result.stdout) + + # Return structured metadata + return { + "status": "success", + "index_command": " ".join(index_cmd), + "check_command": " ".join(check_cmd), + "index_stdout": index_result.stdout, + "index_stderr": index_result.stderr, + "check_stdout": check_result.stdout, + "check_stderr": check_result.stderr, + "output_file": str(output_txt_path), + "reads_fastq": str(reads_fastq_path), + "input_fast5": str(input_fast5_path) + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nanopolish_index_and_check_fast5_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nanopolish_index_and_check_fast5_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..897c57346b210ccd0e21dab563aa6b0a6e89cf4b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nanopolish_index_and_check_fast5_test.py.raw.txt @@ -0,0 +1,94 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("nanopolish") + +@mcp.tool() +def index_and_check_fast5( + reads_fastq: str, + input_fast5: str, + output_txt: str +) -> dict: + """ + Index a FASTQ file and verify FAST5 file accessibility. + + Args: + reads_fastq: Path to the input FASTQ file + input_fast5: Path to the FAST5 file (used for verification) + output_txt: Path where the fast5-check output will be written + """ + # Validate input paths + reads_fastq_path = Path(reads_fastq) + input_fast5_path = Path(input_fast5) + output_txt_path = Path(output_txt) + + if not reads_fastq_path.exists(): + raise FileNotFoundError(f"FASTQ file not found: {reads_fastq_path}") + if not input_fast5_path.exists(): + raise FileNotFoundError(f"FAST5 file not found: {input_fast5_path}") + + # Create output directory if it doesn't exist + output_txt_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run nanopolish index + index_cmd = ["nanopolish", "index", str(reads_fastq_path)] + try: + index_result = subprocess.run( + index_cmd, + capture_output=True, + text=True, + check=False + ) + if index_result.returncode != 0: + raise RuntimeError( + f"nanopolish index failed with exit code {index_result.returncode}\n" + f"stdout: {index_result.stdout}\n" + f"stderr: {index_result.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("nanopolish executable not found in PATH") + + # Step 2: Run nanopolish fast5-check + check_cmd = ["nanopolish", "fast5-check", "-r", str(reads_fastq_path)] + try: + check_result = subprocess.run( + check_cmd, + capture_output=True, + text=True, + check=False + ) + if check_result.returncode != 0: + raise RuntimeError( + f"nanopolish fast5-check failed with exit code {check_result.returncode}\n" + f"stdout: {check_result.stdout}\n" + f"stderr: {check_result.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("nanopolish executable not found in PATH") + + # Write stdout to output file + with open(output_txt_path, 'w') as f: + f.write(check_result.stdout) + + # Return structured metadata + return { + "status": "success", + "index_command": " ".join(index_cmd), + "check_command": " ".join(check_cmd), + "index_stdout": index_result.stdout, + "index_stderr": index_result.stderr, + "check_stdout": check_result.stdout, + "check_stderr": check_result.stderr, + "output_file": str(output_txt_path), + "reads_fastq": str(reads_fastq_path), + "input_fast5": str(input_fast5_path) + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nanopolish_index_and_check_fast5_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nanopolish_index_and_check_fast5_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..2639907d2d2ff949ab0cf5777997ce0f436d558b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nanopolish_index_and_check_fast5_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "3700b960eb52790edd9383d6e94be992b863ac9c6d4fba842895460e13686b5c", + "elapsed_seconds": 8.359561204910278, + "usage": { + "prompt_tokens": 9100, + "completion_tokens": 768, + "total_tokens": 9868, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9100 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "ac75b10e-d3e0-41ee-bbfe-7410e6169735" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ncbi-genome-download_select_assembly_dry_run_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ncbi-genome-download_select_assembly_dry_run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..12647ea303899f6e3e2cd2a42e1ccc8a1908bbc2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ncbi-genome-download_select_assembly_dry_run_test.py @@ -0,0 +1,66 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import shutil +from pathlib import Path + +mcp = FastMCP("ncbi-genome-download") + +@mcp.tool() +def select_assembly_dry_run( + assembly_summary: str, + cache_dir: str, + output_tsv: str +) -> dict: + """ + Select one fixed RefSeq bacterial assembly by accession in dry-run mode from a pinned assembly-summary snapshot. + """ + # Step 1: Create cache directory + cache_path = Path(cache_dir) / "ncbi-genome-download" + cache_path.mkdir(parents=True, exist_ok=True) + + # Step 2: Copy assembly summary to cache + source = Path(assembly_summary) + dest = cache_path / "refseq_bacteria_assembly_summary.txt" + shutil.copy2(source, dest) + + # Step 3: Run ncbi-genome-download in dry-run mode + env = os.environ.copy() + env["XDG_CACHE_HOME"] = cache_dir + + cmd = [ + "ncbi-genome-download", + "bacteria", + "-s", "refseq", + "-A", "GCF_036600855.1", + "-F", "fasta", + "-n" + ] + + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"ncbi-genome-download failed with exit code {result.returncode}: {result.stderr}" + ) + + # Write stdout to output_tsv + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + output_path.write_text(result.stdout) + + return { + "endpoint": "select_assembly_dry_run", + "status": "success", + "output_tsv": str(output_path), + "stdout": result.stdout, + "stderr": result.stderr, + "returncode": result.returncode + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ncbi-genome-download_select_assembly_dry_run_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ncbi-genome-download_select_assembly_dry_run_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..dc44205531b20858df7ae26666838eda5f64476b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ncbi-genome-download_select_assembly_dry_run_test.py.raw.txt @@ -0,0 +1,68 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import shutil +from pathlib import Path + +mcp = FastMCP("ncbi-genome-download") + +@mcp.tool() +def select_assembly_dry_run( + assembly_summary: str, + cache_dir: str, + output_tsv: str +) -> dict: + """ + Select one fixed RefSeq bacterial assembly by accession in dry-run mode from a pinned assembly-summary snapshot. + """ + # Step 1: Create cache directory + cache_path = Path(cache_dir) / "ncbi-genome-download" + cache_path.mkdir(parents=True, exist_ok=True) + + # Step 2: Copy assembly summary to cache + source = Path(assembly_summary) + dest = cache_path / "refseq_bacteria_assembly_summary.txt" + shutil.copy2(source, dest) + + # Step 3: Run ncbi-genome-download in dry-run mode + env = os.environ.copy() + env["XDG_CACHE_HOME"] = cache_dir + + cmd = [ + "ncbi-genome-download", + "bacteria", + "-s", "refseq", + "-A", "GCF_036600855.1", + "-F", "fasta", + "-n" + ] + + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"ncbi-genome-download failed with exit code {result.returncode}: {result.stderr}" + ) + + # Write stdout to output_tsv + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + output_path.write_text(result.stdout) + + return { + "endpoint": "select_assembly_dry_run", + "status": "success", + "output_tsv": str(output_path), + "stdout": result.stdout, + "stderr": result.stderr, + "returncode": result.returncode + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ncbi-genome-download_select_assembly_dry_run_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ncbi-genome-download_select_assembly_dry_run_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..ccf1ae33392bab0579f09188b1b2b949d47d7f6e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ncbi-genome-download_select_assembly_dry_run_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "3e1105d31628b708965422ffa22a1dd76c0d77349f45d2e46fc8290bbb1897f4", + "elapsed_seconds": 3.1093335151672363, + "usage": { + "prompt_tokens": 8655, + "completion_tokens": 477, + "total_tokens": 9132, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 8655 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "175ca461-1da8-4cc8-a552-207d0b97429c" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextalign_align_nucleotides_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextalign_align_nucleotides_test.py new file mode 100644 index 0000000000000000000000000000000000000000..f2f122eab17f9dba2c5ff201d9494bb6ff56c4f9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextalign_align_nucleotides_test.py @@ -0,0 +1,103 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("nextalign") + + +@mcp.tool() +def align_nucleotides( + reference_fasta: str, + query_fasta: str, + output_fasta: str, +) -> dict[str, Any]: + """ + Align nucleotide sequences using nextalign. + + Args: + reference_fasta: Path to the reference FASTA file. + query_fasta: Path to the query FASTA file. + output_fasta: Path where the output FASTA file will be written. + + Returns: + JSON-serializable metadata about the alignment run. + """ + # Validate required parameters + if not reference_fasta: + raise ValueError("reference_fasta is required") + if not query_fasta: + raise ValueError("query_fasta is required") + if not output_fasta: + raise ValueError("output_fasta is required") + + # Resolve paths + ref_path = Path(reference_fasta).resolve() + query_path = Path(query_fasta).resolve() + out_path = Path(output_fasta).resolve() + + # Check input files exist + if not ref_path.is_file(): + raise FileNotFoundError(f"Reference FASTA not found: {ref_path}") + if not query_path.is_file(): + raise FileNotFoundError(f"Query FASTA not found: {query_path}") + + # Create output parent directory + out_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "nextalign", + "run", + "--input-ref", + str(ref_path), + "--output-fasta", + str(out_path), + "--include-reference", + "--in-order", + str(query_path), + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "nextalign executable not found. Ensure it is installed and in PATH." + ) + + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError( + f"nextalign failed with exit code {result.returncode}: {error_msg}" + ) + + # Verify output file was created + if not out_path.is_file(): + raise RuntimeError(f"Output file was not created: {out_path}") + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "exit_code": result.returncode, + "reference_fasta": str(ref_path), + "query_fasta": str(query_path), + "output_fasta": str(out_path), + "output_size_bytes": out_path.stat().st_size, + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextalign_align_nucleotides_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextalign_align_nucleotides_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..58e04a7ee85646219139d1dc7f5629630bab51ef --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextalign_align_nucleotides_test.py.raw.txt @@ -0,0 +1,105 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("nextalign") + + +@mcp.tool() +def align_nucleotides( + reference_fasta: str, + query_fasta: str, + output_fasta: str, +) -> dict[str, Any]: + """ + Align nucleotide sequences using nextalign. + + Args: + reference_fasta: Path to the reference FASTA file. + query_fasta: Path to the query FASTA file. + output_fasta: Path where the output FASTA file will be written. + + Returns: + JSON-serializable metadata about the alignment run. + """ + # Validate required parameters + if not reference_fasta: + raise ValueError("reference_fasta is required") + if not query_fasta: + raise ValueError("query_fasta is required") + if not output_fasta: + raise ValueError("output_fasta is required") + + # Resolve paths + ref_path = Path(reference_fasta).resolve() + query_path = Path(query_fasta).resolve() + out_path = Path(output_fasta).resolve() + + # Check input files exist + if not ref_path.is_file(): + raise FileNotFoundError(f"Reference FASTA not found: {ref_path}") + if not query_path.is_file(): + raise FileNotFoundError(f"Query FASTA not found: {query_path}") + + # Create output parent directory + out_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "nextalign", + "run", + "--input-ref", + str(ref_path), + "--output-fasta", + str(out_path), + "--include-reference", + "--in-order", + str(query_path), + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "nextalign executable not found. Ensure it is installed and in PATH." + ) + + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError( + f"nextalign failed with exit code {result.returncode}: {error_msg}" + ) + + # Verify output file was created + if not out_path.is_file(): + raise RuntimeError(f"Output file was not created: {out_path}") + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "exit_code": result.returncode, + "reference_fasta": str(ref_path), + "query_fasta": str(query_path), + "output_fasta": str(out_path), + "output_size_bytes": out_path.stat().st_size, + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextalign_align_nucleotides_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextalign_align_nucleotides_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..ace5bf678948af4a8bf9eaca6e9e3f1013763886 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextalign_align_nucleotides_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "f4c05ec6e22cbf0f310593f7d2bda22c2a218f805399dfe85741184bdf6403f3", + "elapsed_seconds": 3.749345302581787, + "usage": { + "prompt_tokens": 837, + "completion_tokens": 659, + "total_tokens": 1496, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 837 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "a94357cf-7830-45f8-b54e-503699050728" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextclade_analyze_sequence_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextclade_analyze_sequence_test.py new file mode 100644 index 0000000000000000000000000000000000000000..d9c7ada202b243a191141a2a29129fd82cbf1d88 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextclade_analyze_sequence_test.py @@ -0,0 +1,108 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("nextclade-analyze") + + +@mcp.tool() +def analyze_sequence( + reference_fasta: str, + query_fasta: str, + output_fasta: str, + output_json: str, +) -> Dict[str, Any]: + """ + Run Nextclade sequence analysis with a local reference and query FASTA. + + Args: + reference_fasta: Path to the reference FASTA file (passed as -r). + query_fasta: Path to the query FASTA file (positional argument). + output_fasta: Path where the aligned output FASTA will be written (-o). + output_json: Path where the JSON results will be written (-J). + """ + # Resolve paths to absolute paths + ref_path = Path(reference_fasta).resolve() + query_path = Path(query_fasta).resolve() + out_fasta_path = Path(output_fasta).resolve() + out_json_path = Path(output_json).resolve() + + # Validate input files exist + if not ref_path.is_file(): + raise FileNotFoundError(f"Reference FASTA not found: {ref_path}") + if not query_path.is_file(): + raise FileNotFoundError(f"Query FASTA not found: {query_path}") + + # Create parent directories for outputs + out_fasta_path.parent.mkdir(parents=True, exist_ok=True) + out_json_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "nextclade", + "run", + "-r", + str(ref_path), + "-o", + str(out_fasta_path), + "-J", + str(out_json_path), + str(query_path), + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "The 'nextclade' executable was not found. Ensure it is installed and on PATH." + ) + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError( + f"nextclade run failed with exit code {result.returncode}: {error_msg}" + ) + + # Verify output files were created + if not out_fasta_path.is_file(): + raise RuntimeError(f"Expected output FASTA was not created: {out_fasta_path}") + if not out_json_path.is_file(): + raise RuntimeError(f"Expected output JSON was not created: {out_json_path}") + + # Read the JSON output for structured metadata + try: + with open(out_json_path, "r", encoding="utf-8") as f: + json_data = json.load(f) + except (json.JSONDecodeError, OSError) as e: + json_data = None + # We still return success metadata even if JSON parsing fails + + # Build structured metadata + metadata: Dict[str, Any] = { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "output_fasta": str(out_fasta_path), + "output_json": str(out_json_path), + "stdout": result.stdout, + "stderr": result.stderr, + "json_summary": json_data, + } + + return metadata + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextclade_analyze_sequence_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextclade_analyze_sequence_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..07a4596b57f49c64fac0f8acd5df1347841ea732 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextclade_analyze_sequence_test.py.raw.txt @@ -0,0 +1,110 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("nextclade-analyze") + + +@mcp.tool() +def analyze_sequence( + reference_fasta: str, + query_fasta: str, + output_fasta: str, + output_json: str, +) -> Dict[str, Any]: + """ + Run Nextclade sequence analysis with a local reference and query FASTA. + + Args: + reference_fasta: Path to the reference FASTA file (passed as -r). + query_fasta: Path to the query FASTA file (positional argument). + output_fasta: Path where the aligned output FASTA will be written (-o). + output_json: Path where the JSON results will be written (-J). + """ + # Resolve paths to absolute paths + ref_path = Path(reference_fasta).resolve() + query_path = Path(query_fasta).resolve() + out_fasta_path = Path(output_fasta).resolve() + out_json_path = Path(output_json).resolve() + + # Validate input files exist + if not ref_path.is_file(): + raise FileNotFoundError(f"Reference FASTA not found: {ref_path}") + if not query_path.is_file(): + raise FileNotFoundError(f"Query FASTA not found: {query_path}") + + # Create parent directories for outputs + out_fasta_path.parent.mkdir(parents=True, exist_ok=True) + out_json_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "nextclade", + "run", + "-r", + str(ref_path), + "-o", + str(out_fasta_path), + "-J", + str(out_json_path), + str(query_path), + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "The 'nextclade' executable was not found. Ensure it is installed and on PATH." + ) + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError( + f"nextclade run failed with exit code {result.returncode}: {error_msg}" + ) + + # Verify output files were created + if not out_fasta_path.is_file(): + raise RuntimeError(f"Expected output FASTA was not created: {out_fasta_path}") + if not out_json_path.is_file(): + raise RuntimeError(f"Expected output JSON was not created: {out_json_path}") + + # Read the JSON output for structured metadata + try: + with open(out_json_path, "r", encoding="utf-8") as f: + json_data = json.load(f) + except (json.JSONDecodeError, OSError) as e: + json_data = None + # We still return success metadata even if JSON parsing fails + + # Build structured metadata + metadata: Dict[str, Any] = { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "output_fasta": str(out_fasta_path), + "output_json": str(out_json_path), + "stdout": result.stdout, + "stderr": result.stderr, + "json_summary": json_data, + } + + return metadata + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextclade_analyze_sequence_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextclade_analyze_sequence_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..a647611d939e7cd0e72d710e3690371c4add30b4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/nextclade_analyze_sequence_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "10f1b4f516d5b90f5b5572129e1a00197407ba1d4332bff69f376f72e5f27797", + "elapsed_seconds": 8.507468938827515, + "usage": { + "prompt_tokens": 1264, + "completion_tokens": 797, + "total_tokens": 2061, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1264 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "958c37ee-7724-46cf-a7c4-093d9477b333" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ngmlr_align_long_reads_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ngmlr_align_long_reads_test.py new file mode 100644 index 0000000000000000000000000000000000000000..1a9d398544535b760f72ef4b449a306578fb5398 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ngmlr_align_long_reads_test.py @@ -0,0 +1,101 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("ngmlr-mcp") + + +@mcp.tool() +def align_long_reads( + reference_fasta: str, + reads_fastq: str, + output_sam: str, +) -> dict: + """ + Align long reads to a reference genome using ngmlr. + + Args: + reference_fasta: Path to the reference genome (FASTA/Q, can be gzipped) + reads_fastq: Path to the read file (FASTA/Q) + output_sam: Path to the output SAM file + + Returns: + JSON-serializable metadata about the alignment run. + """ + # Validate required inputs + ref_path = Path(reference_fasta) + reads_path = Path(reads_fastq) + out_path = Path(output_sam) + + if not ref_path.exists(): + raise FileNotFoundError(f"Reference file not found: {reference_fasta}") + if not reads_path.exists(): + raise FileNotFoundError(f"Reads file not found: {reads_fastq}") + + # Create output parent directories + out_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "ngmlr", + "-r", + str(ref_path), + "-q", + str(reads_path), + "-o", + str(out_path), + "-t", + "1", + "--skip-write", + "--no-progress", + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "ngmlr executable not found. Please ensure it is installed and in PATH." + ) + + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError( + f"ngmlr failed with exit code {result.returncode}: {error_msg}" + ) + + # Check output file was created + if not out_path.exists(): + raise RuntimeError( + f"ngmlr completed but output file was not created: {output_sam}" + ) + + # Return structured metadata + return { + "endpoint": "align_long_reads", + "tool": "ngmlr", + "version": "0.2.7", + "reference": str(ref_path), + "reads": str(reads_path), + "output": str(out_path), + "threads": 1, + "skip_write": True, + "no_progress": True, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": out_path.stat().st_size, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ngmlr_align_long_reads_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ngmlr_align_long_reads_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..1403ee6c8c0837ccde50920d7a8db3f2622a3fb0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ngmlr_align_long_reads_test.py.raw.txt @@ -0,0 +1,103 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("ngmlr-mcp") + + +@mcp.tool() +def align_long_reads( + reference_fasta: str, + reads_fastq: str, + output_sam: str, +) -> dict: + """ + Align long reads to a reference genome using ngmlr. + + Args: + reference_fasta: Path to the reference genome (FASTA/Q, can be gzipped) + reads_fastq: Path to the read file (FASTA/Q) + output_sam: Path to the output SAM file + + Returns: + JSON-serializable metadata about the alignment run. + """ + # Validate required inputs + ref_path = Path(reference_fasta) + reads_path = Path(reads_fastq) + out_path = Path(output_sam) + + if not ref_path.exists(): + raise FileNotFoundError(f"Reference file not found: {reference_fasta}") + if not reads_path.exists(): + raise FileNotFoundError(f"Reads file not found: {reads_fastq}") + + # Create output parent directories + out_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "ngmlr", + "-r", + str(ref_path), + "-q", + str(reads_path), + "-o", + str(out_path), + "-t", + "1", + "--skip-write", + "--no-progress", + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "ngmlr executable not found. Please ensure it is installed and in PATH." + ) + + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError( + f"ngmlr failed with exit code {result.returncode}: {error_msg}" + ) + + # Check output file was created + if not out_path.exists(): + raise RuntimeError( + f"ngmlr completed but output file was not created: {output_sam}" + ) + + # Return structured metadata + return { + "endpoint": "align_long_reads", + "tool": "ngmlr", + "version": "0.2.7", + "reference": str(ref_path), + "reads": str(reads_path), + "output": str(out_path), + "threads": 1, + "skip_write": True, + "no_progress": True, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": out_path.stat().st_size, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ngmlr_align_long_reads_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ngmlr_align_long_reads_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..9613acaeb0b18a2c77953dbde09b0eb7cc7f6ebd --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ngmlr_align_long_reads_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "3fa795d1ac0c428733abcfee80085074e305470d99600040f08012232014e0c9", + "elapsed_seconds": 4.023561716079712, + "usage": { + "prompt_tokens": 1411, + "completion_tokens": 654, + "total_tokens": 2065, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1411 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "fc305e61-0c0b-4bc3-9851-1f7606f64cf9" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ont-fast5-api_summarize_single_read_fast5_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ont-fast5-api_summarize_single_read_fast5_test.py new file mode 100644 index 0000000000000000000000000000000000000000..54e1556ff737686c16471e9e1d4be763d25ffa28 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ont-fast5-api_summarize_single_read_fast5_test.py @@ -0,0 +1,86 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import sys +import os +import json +from pathlib import Path + +mcp = FastMCP("ont-fast5-api") + +@mcp.tool() +def summarize_single_read_fast5(input_fast5: str, output_json: str) -> dict: + """ + Summarize a single-read FAST5 file by extracting channel metadata, tracking metadata, and raw signal. + + Args: + input_fast5: Path to the input single-read FAST5 file + output_json: Path where the JSON summary will be written + """ + # Create output parent directory if needed + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Validate input file exists + if not Path(input_fast5).exists(): + raise FileNotFoundError(f"Input FAST5 file not found: {input_fast5}") + + # Python code to execute + python_code = ( + "import json,sys; " + "from ont_fast5_api.fast5_file import Fast5File; " + "h=Fast5File(sys.argv[1]); " + "r=h.get_raw_data(); " + "d={'channel':h.get_channel_info()['channel_number']," + "'read_count':len(h.status.read_info)," + "'raw':[int(x) for x in r.tolist()]," + "'tracking':h.get_tracking_id()}; " + "h.close(); " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + # Build command + cmd = [ + sys.executable, + "-c", + python_code, + input_fast5, + output_json + ] + + try: + # Execute the command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file was not created: {output_json}") + + # Read and validate the output + with open(output_path, 'r') as f: + summary = json.load(f) + + return { + "status": "success", + "output_file": str(output_path), + "summary": summary + } + + except subprocess.TimeoutExpired: + raise RuntimeError("Command timed out") + except Exception as e: + raise RuntimeError(f"Error executing command: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ont-fast5-api_summarize_single_read_fast5_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ont-fast5-api_summarize_single_read_fast5_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..359d9f519bb57f5bdebcf46e84e8d388a7b3cff4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ont-fast5-api_summarize_single_read_fast5_test.py.raw.txt @@ -0,0 +1,88 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import sys +import os +import json +from pathlib import Path + +mcp = FastMCP("ont-fast5-api") + +@mcp.tool() +def summarize_single_read_fast5(input_fast5: str, output_json: str) -> dict: + """ + Summarize a single-read FAST5 file by extracting channel metadata, tracking metadata, and raw signal. + + Args: + input_fast5: Path to the input single-read FAST5 file + output_json: Path where the JSON summary will be written + """ + # Create output parent directory if needed + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Validate input file exists + if not Path(input_fast5).exists(): + raise FileNotFoundError(f"Input FAST5 file not found: {input_fast5}") + + # Python code to execute + python_code = ( + "import json,sys; " + "from ont_fast5_api.fast5_file import Fast5File; " + "h=Fast5File(sys.argv[1]); " + "r=h.get_raw_data(); " + "d={'channel':h.get_channel_info()['channel_number']," + "'read_count':len(h.status.read_info)," + "'raw':[int(x) for x in r.tolist()]," + "'tracking':h.get_tracking_id()}; " + "h.close(); " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + # Build command + cmd = [ + sys.executable, + "-c", + python_code, + input_fast5, + output_json + ] + + try: + # Execute the command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file was not created: {output_json}") + + # Read and validate the output + with open(output_path, 'r') as f: + summary = json.load(f) + + return { + "status": "success", + "output_file": str(output_path), + "summary": summary + } + + except subprocess.TimeoutExpired: + raise RuntimeError("Command timed out") + except Exception as e: + raise RuntimeError(f"Error executing command: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ont-fast5-api_summarize_single_read_fast5_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ont-fast5-api_summarize_single_read_fast5_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..17aa9bae6e91eae4a0d491f6142c3c226524ddd6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ont-fast5-api_summarize_single_read_fast5_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "fdf4ef309f6111ee26c45649213b656d1c2124bbf5abfe344c1e931b2e6ed268", + "elapsed_seconds": 3.883965492248535, + "usage": { + "prompt_tokens": 9561, + "completion_tokens": 626, + "total_tokens": 10187, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9561 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "034f8d9b-08ef-42cb-a88a-dbb86d425996" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/orthofinder_infer_orthogroups_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/orthofinder_infer_orthogroups_test.py new file mode 100644 index 0000000000000000000000000000000000000000..f01986a67ac6d81431fc9ac5b8b9444229b8083d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/orthofinder_infer_orthogroups_test.py @@ -0,0 +1,102 @@ +import os +import shutil +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("orthofinder") + + +@mcp.tool() +def infer_orthogroups( + input_dir: str, + orthogroups_tsv: str, + statistics_csv: str, +) -> Dict[str, Any]: + """ + Run DIAMOND all-vs-all and stop after orthogroup inference; copy date-named results to stable output paths. + + Args: + input_dir: Directory containing FASTA proteomes. + orthogroups_tsv: Output path for the Orthogroups.csv file (copied from Results_*). + statistics_csv: Output path for the Statistics_Overall.csv file (copied from Results_*). + """ + # Validate input directory exists + input_path = Path(input_dir) + if not input_path.is_dir(): + raise ValueError(f"Input directory does not exist: {input_dir}") + + # Create output parent directories + orthogroups_path = Path(orthogroups_tsv) + statistics_path = Path(statistics_csv) + orthogroups_path.parent.mkdir(parents=True, exist_ok=True) + statistics_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run orthofinder with -og to stop after orthogroup inference + # Use -t 1 -a 1 -S diamond as specified in the execution plan + cmd = [ + "orthofinder", + "-f", + input_dir, + "-t", + "1", + "-a", + "1", + "-S", + "diamond", + "-og", + ] + try: + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + except subprocess.CalledProcessError as e: + # Include stderr in the error message for debugging + raise RuntimeError( + f"OrthoFinder failed with exit code {e.returncode}\n" + f"stdout: {e.stdout}\n" + f"stderr: {e.stderr}" + ) from e + + # Step 2: Find the most recent Results_* directory in input_dir + results_dirs = sorted( + [p for p in input_path.iterdir() if p.is_dir() and p.name.startswith("Results_")] + ) + if not results_dirs: + raise RuntimeError( + f"No Results_* directory found in {input_dir} after OrthoFinder run" + ) + result_dir = results_dirs[-1] # tail -1 after sort + + # Step 3: Copy Orthogroups.csv to orthogroups_tsv + orthogroups_source = result_dir / "Orthogroups.csv" + if not orthogroups_source.is_file(): + raise RuntimeError(f"Expected file not found: {orthogroups_source}") + shutil.copy2(orthogroups_source, orthogroups_path) + + # Step 4: Copy Statistics_Overall.csv to statistics_csv + statistics_source = result_dir / "Statistics_Overall.csv" + if not statistics_source.is_file(): + raise RuntimeError(f"Expected file not found: {statistics_source}") + shutil.copy2(statistics_source, statistics_path) + + # Return structured metadata + return { + "status": "success", + "input_dir": str(input_path.resolve()), + "results_dir": str(result_dir.resolve()), + "orthogroups_tsv": str(orthogroups_path.resolve()), + "statistics_csv": str(statistics_path.resolve()), + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/orthofinder_infer_orthogroups_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/orthofinder_infer_orthogroups_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..a1facce40a2304aec69e90493bfbfd47505dc75d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/orthofinder_infer_orthogroups_test.py.raw.txt @@ -0,0 +1,104 @@ +```python +import os +import shutil +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("orthofinder") + + +@mcp.tool() +def infer_orthogroups( + input_dir: str, + orthogroups_tsv: str, + statistics_csv: str, +) -> Dict[str, Any]: + """ + Run DIAMOND all-vs-all and stop after orthogroup inference; copy date-named results to stable output paths. + + Args: + input_dir: Directory containing FASTA proteomes. + orthogroups_tsv: Output path for the Orthogroups.csv file (copied from Results_*). + statistics_csv: Output path for the Statistics_Overall.csv file (copied from Results_*). + """ + # Validate input directory exists + input_path = Path(input_dir) + if not input_path.is_dir(): + raise ValueError(f"Input directory does not exist: {input_dir}") + + # Create output parent directories + orthogroups_path = Path(orthogroups_tsv) + statistics_path = Path(statistics_csv) + orthogroups_path.parent.mkdir(parents=True, exist_ok=True) + statistics_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run orthofinder with -og to stop after orthogroup inference + # Use -t 1 -a 1 -S diamond as specified in the execution plan + cmd = [ + "orthofinder", + "-f", + input_dir, + "-t", + "1", + "-a", + "1", + "-S", + "diamond", + "-og", + ] + try: + result = subprocess.run( + cmd, + check=True, + capture_output=True, + text=True, + ) + except subprocess.CalledProcessError as e: + # Include stderr in the error message for debugging + raise RuntimeError( + f"OrthoFinder failed with exit code {e.returncode}\n" + f"stdout: {e.stdout}\n" + f"stderr: {e.stderr}" + ) from e + + # Step 2: Find the most recent Results_* directory in input_dir + results_dirs = sorted( + [p for p in input_path.iterdir() if p.is_dir() and p.name.startswith("Results_")] + ) + if not results_dirs: + raise RuntimeError( + f"No Results_* directory found in {input_dir} after OrthoFinder run" + ) + result_dir = results_dirs[-1] # tail -1 after sort + + # Step 3: Copy Orthogroups.csv to orthogroups_tsv + orthogroups_source = result_dir / "Orthogroups.csv" + if not orthogroups_source.is_file(): + raise RuntimeError(f"Expected file not found: {orthogroups_source}") + shutil.copy2(orthogroups_source, orthogroups_path) + + # Step 4: Copy Statistics_Overall.csv to statistics_csv + statistics_source = result_dir / "Statistics_Overall.csv" + if not statistics_source.is_file(): + raise RuntimeError(f"Expected file not found: {statistics_source}") + shutil.copy2(statistics_source, statistics_path) + + # Return structured metadata + return { + "status": "success", + "input_dir": str(input_path.resolve()), + "results_dir": str(result_dir.resolve()), + "orthogroups_tsv": str(orthogroups_path.resolve()), + "statistics_csv": str(statistics_path.resolve()), + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/orthofinder_infer_orthogroups_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/orthofinder_infer_orthogroups_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..c557ebd3c9a82a37336bd6ba0c039f574c5f2d4f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/orthofinder_infer_orthogroups_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "82be95a4e94db3bc3212e935f3d71a4d848ae1289a480c42e566541ba74399ed", + "elapsed_seconds": 4.9433207511901855, + "usage": { + "prompt_tokens": 1336, + "completion_tokens": 829, + "total_tokens": 2165, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1336 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "6cf0b850-4dca-4545-86c5-a7ffcd7c9efa" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/paml_pairwise_dn_ds_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/paml_pairwise_dn_ds_test.py new file mode 100644 index 0000000000000000000000000000000000000000..3aef2069c610a107f88d776df2d995e2113364b6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/paml_pairwise_dn_ds_test.py @@ -0,0 +1,88 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import shutil +import json +from pathlib import Path + +mcp = FastMCP("paml") + +@mcp.tool() +def pairwise_dn_ds( + input_sequences: str, + control_file: str, + output_results: str, + output_dn: str +) -> str: + """ + Compute pairwise dN/dS ratios using PAML's yn00 program. + + Args: + input_sequences: Path to the input sequence file (PHYLIP format) + control_file: Path to the control file (will be materialized) + output_results: Path where the main results file will be written + output_dn: Path where the dN matrix will be copied + """ + # Create output parent directories + for path in [output_results, output_dn]: + parent = os.path.dirname(os.path.abspath(path)) + os.makedirs(parent, exist_ok=True) + + # Materialize control file + control_dir = os.path.dirname(os.path.abspath(control_file)) + os.makedirs(control_dir, exist_ok=True) + + # Step 1: Copy input sequences to control file directory + seq_copy = f"{control_file}.seq" + shutil.copy2(input_sequences, seq_copy) + + # Step 2: Write control file + ctl_content = ( + "seqfile = yn00.ctl.seq\n" + "outfile = results.txt\n" + "verbose = 0\n" + "icode = 0\n" + "weighting = 0\n" + "commonf3x4 = 0\n" + ) + ctl_path = os.path.join(control_dir, "yn00.ctl") + with open(ctl_path, "w") as f: + f.write(ctl_content) + + # Step 3: Run yn00 + try: + result = subprocess.run( + ["yn00", "yn00.ctl"], + cwd=control_dir, + capture_output=True, + text=True, + check=False + ) + if result.returncode != 0: + raise RuntimeError(f"yn00 failed with exit code {result.returncode}: {result.stderr}") + except FileNotFoundError: + raise RuntimeError("yn00 executable not found in PATH") + + # Step 4: Copy results to output paths + results_source = os.path.join(control_dir, "results.txt") + if not os.path.exists(results_source): + raise RuntimeError("yn00 did not produce results.txt") + shutil.copy2(results_source, output_results) + + # Step 5: Copy dN matrix + dn_source = os.path.join(control_dir, "2YN.dN") + if not os.path.exists(dn_source): + raise RuntimeError("yn00 did not produce 2YN.dN") + shutil.copy2(dn_source, output_dn) + + # Return structured metadata + return json.dumps({ + "status": "success", + "output_results": output_results, + "output_dn": output_dn, + "control_file": control_file, + "input_sequences": input_sequences + }, indent=2) + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/paml_pairwise_dn_ds_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/paml_pairwise_dn_ds_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..56c4e9f90346bdcd0a5006b30af448a253adbd49 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/paml_pairwise_dn_ds_test.py.raw.txt @@ -0,0 +1,90 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import shutil +import json +from pathlib import Path + +mcp = FastMCP("paml") + +@mcp.tool() +def pairwise_dn_ds( + input_sequences: str, + control_file: str, + output_results: str, + output_dn: str +) -> str: + """ + Compute pairwise dN/dS ratios using PAML's yn00 program. + + Args: + input_sequences: Path to the input sequence file (PHYLIP format) + control_file: Path to the control file (will be materialized) + output_results: Path where the main results file will be written + output_dn: Path where the dN matrix will be copied + """ + # Create output parent directories + for path in [output_results, output_dn]: + parent = os.path.dirname(os.path.abspath(path)) + os.makedirs(parent, exist_ok=True) + + # Materialize control file + control_dir = os.path.dirname(os.path.abspath(control_file)) + os.makedirs(control_dir, exist_ok=True) + + # Step 1: Copy input sequences to control file directory + seq_copy = f"{control_file}.seq" + shutil.copy2(input_sequences, seq_copy) + + # Step 2: Write control file + ctl_content = ( + "seqfile = yn00.ctl.seq\n" + "outfile = results.txt\n" + "verbose = 0\n" + "icode = 0\n" + "weighting = 0\n" + "commonf3x4 = 0\n" + ) + ctl_path = os.path.join(control_dir, "yn00.ctl") + with open(ctl_path, "w") as f: + f.write(ctl_content) + + # Step 3: Run yn00 + try: + result = subprocess.run( + ["yn00", "yn00.ctl"], + cwd=control_dir, + capture_output=True, + text=True, + check=False + ) + if result.returncode != 0: + raise RuntimeError(f"yn00 failed with exit code {result.returncode}: {result.stderr}") + except FileNotFoundError: + raise RuntimeError("yn00 executable not found in PATH") + + # Step 4: Copy results to output paths + results_source = os.path.join(control_dir, "results.txt") + if not os.path.exists(results_source): + raise RuntimeError("yn00 did not produce results.txt") + shutil.copy2(results_source, output_results) + + # Step 5: Copy dN matrix + dn_source = os.path.join(control_dir, "2YN.dN") + if not os.path.exists(dn_source): + raise RuntimeError("yn00 did not produce 2YN.dN") + shutil.copy2(dn_source, output_dn) + + # Return structured metadata + return json.dumps({ + "status": "success", + "output_results": output_results, + "output_dn": output_dn, + "control_file": control_file, + "input_sequences": input_sequences + }, indent=2) + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/paml_pairwise_dn_ds_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/paml_pairwise_dn_ds_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..7e9be4b5531c14f96fbf11d7292cac376296b3ae --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/paml_pairwise_dn_ds_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "79f30ea7258ecd8610dd8f1d190dc45346aa92716e6b01a89c591037643c3250", + "elapsed_seconds": 5.604968309402466, + "usage": { + "prompt_tokens": 9957, + "completion_tokens": 723, + "total_tokens": 10680, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9957 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "105e1013-37e6-45f9-a260-3f0f29f87534" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/parasail-python_global_align_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/parasail-python_global_align_test.py new file mode 100644 index 0000000000000000000000000000000000000000..c441ee144ae493189d590b0394c889a612c39f82 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/parasail-python_global_align_test.py @@ -0,0 +1,50 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import json +import os +import sys + +mcp = FastMCP("parasail-python") + +@mcp.tool() +def global_align(sequence_a: str, sequence_b: str, output_json: str) -> dict: + """ + Perform global pairwise sequence alignment using parasail NW trace with gap-open 10 and gap-extension 1. + + Args: + sequence_a: Path to FASTA file containing first sequence + sequence_b: Path to FASTA file containing second sequence + output_json: Path where JSON output will be written + + Returns: + Dictionary with alignment results and metadata + """ + # Create output directory if needed + output_dir = os.path.dirname(os.path.abspath(output_json)) + os.makedirs(output_dir, exist_ok=True) + + # Build command exactly as specified in execution plan + cmd = [ + "python3.13", + "-c", + "import json,parasail,sys; rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>')); r=parasail.nw_trace_striped_16(rd(sys.argv[1]),rd(sys.argv[2]),10,1,parasail.dnafull); d={'score':r.score,'end_query':r.end_query,'end_ref':r.end_ref,'cigar':r.cigar.decode.decode()}; open(sys.argv[3],'w').write(json.dumps(d,sort_keys=True)+'\\n')", + sequence_a, + sequence_b, + output_json + ] + + # Execute without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + if result.returncode != 0: + raise RuntimeError(f"Alignment failed with exit code {result.returncode}: {result.stderr}") + + # Read and return the output + with open(output_json, 'r') as f: + output_data = json.load(f) + + return { + "status": "success", + "output_file": output_json, + "result": output_data + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/parasail-python_global_align_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/parasail-python_global_align_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2cfa395fee60a3a190c2a98215d8d50a443d7ebf --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/parasail-python_global_align_test.py.raw.txt @@ -0,0 +1,52 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import json +import os +import sys + +mcp = FastMCP("parasail-python") + +@mcp.tool() +def global_align(sequence_a: str, sequence_b: str, output_json: str) -> dict: + """ + Perform global pairwise sequence alignment using parasail NW trace with gap-open 10 and gap-extension 1. + + Args: + sequence_a: Path to FASTA file containing first sequence + sequence_b: Path to FASTA file containing second sequence + output_json: Path where JSON output will be written + + Returns: + Dictionary with alignment results and metadata + """ + # Create output directory if needed + output_dir = os.path.dirname(os.path.abspath(output_json)) + os.makedirs(output_dir, exist_ok=True) + + # Build command exactly as specified in execution plan + cmd = [ + "python3.13", + "-c", + "import json,parasail,sys; rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>')); r=parasail.nw_trace_striped_16(rd(sys.argv[1]),rd(sys.argv[2]),10,1,parasail.dnafull); d={'score':r.score,'end_query':r.end_query,'end_ref':r.end_ref,'cigar':r.cigar.decode.decode()}; open(sys.argv[3],'w').write(json.dumps(d,sort_keys=True)+'\\n')", + sequence_a, + sequence_b, + output_json + ] + + # Execute without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + if result.returncode != 0: + raise RuntimeError(f"Alignment failed with exit code {result.returncode}: {result.stderr}") + + # Read and return the output + with open(output_json, 'r') as f: + output_data = json.load(f) + + return { + "status": "success", + "output_file": output_json, + "result": output_data + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/parasail-python_global_align_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/parasail-python_global_align_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..e48db2f8b9a40e7f5cb848557991b419d1cfde16 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/parasail-python_global_align_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "54c5783c75c8460a2e53891ef76b203a489d0be3a9b540464f7502d537ce3250", + "elapsed_seconds": 3.968867063522339, + "usage": { + "prompt_tokens": 11570, + "completion_tokens": 472, + "total_tokens": 12042, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11570 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "58f21260-9d8a-4eab-8072-ee1b39579c33" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/picard_sort_sam_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/picard_sort_sam_test.py new file mode 100644 index 0000000000000000000000000000000000000000..773d0ae6c270df9f5243a10e91b3c2f81444a7c4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/picard_sort_sam_test.py @@ -0,0 +1,94 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("picard-sort-sam") + + +@mcp.tool() +def sort_sam(input_bam: str, output_bam: str, output_sam: str) -> dict: + """ + Sort a BAM file by coordinate order, create an index, and render the sorted + BAM as SAM text. + + Args: + input_bam: Path to the input BAM file. + output_bam: Path where the sorted, indexed BAM file will be written. + output_sam: Path where the SAM text output will be written. + """ + # Create parent directories for output files + for path_str in [output_bam, output_sam]: + path = Path(path_str) + if path.parent and not path.parent.exists(): + path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run SortSam + sort_cmd = [ + "picard", + "SortSam", + f"INPUT={input_bam}", + f"OUTPUT={output_bam}", + "SORT_ORDER=coordinate", + "CREATE_INDEX=true", + "VALIDATION_STRINGENCY=SILENT", + ] + try: + result = subprocess.run( + sort_cmd, + check=True, + capture_output=True, + text=True, + ) + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"SortSam failed with exit code {e.returncode}\n" + f"stdout: {e.stdout}\nstderr: {e.stderr}" + ) from e + + # Step 2: Run ViewSam and capture stdout to output_sam + view_cmd = [ + "picard", + "ViewSam", + f"I={output_bam}", + "ALIGNMENT_STATUS=All", + "PF_STATUS=All", + ] + try: + result = subprocess.run( + view_cmd, + check=True, + capture_output=True, + text=True, + ) + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"ViewSam failed with exit code {e.returncode}\n" + f"stdout: {e.stdout}\nstderr: {e.stderr}" + ) from e + + # Write captured stdout to output_sam + with open(output_sam, "w", encoding="utf-8") as f: + f.write(result.stdout) + + # Return structured metadata + return { + "input_bam": input_bam, + "output_bam": output_bam, + "output_sam": output_sam, + "sort_order": "coordinate", + "index_created": True, + "validation_stringency": "SILENT", + "view_sam_arguments": { + "alignment_status": "All", + "pf_status": "All", + }, + "status": "success", + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/picard_sort_sam_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/picard_sort_sam_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..cb2f08cd9a90b9cf3dbf5b842ee5cbdfd08f0637 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/picard_sort_sam_test.py.raw.txt @@ -0,0 +1,96 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("picard-sort-sam") + + +@mcp.tool() +def sort_sam(input_bam: str, output_bam: str, output_sam: str) -> dict: + """ + Sort a BAM file by coordinate order, create an index, and render the sorted + BAM as SAM text. + + Args: + input_bam: Path to the input BAM file. + output_bam: Path where the sorted, indexed BAM file will be written. + output_sam: Path where the SAM text output will be written. + """ + # Create parent directories for output files + for path_str in [output_bam, output_sam]: + path = Path(path_str) + if path.parent and not path.parent.exists(): + path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run SortSam + sort_cmd = [ + "picard", + "SortSam", + f"INPUT={input_bam}", + f"OUTPUT={output_bam}", + "SORT_ORDER=coordinate", + "CREATE_INDEX=true", + "VALIDATION_STRINGENCY=SILENT", + ] + try: + result = subprocess.run( + sort_cmd, + check=True, + capture_output=True, + text=True, + ) + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"SortSam failed with exit code {e.returncode}\n" + f"stdout: {e.stdout}\nstderr: {e.stderr}" + ) from e + + # Step 2: Run ViewSam and capture stdout to output_sam + view_cmd = [ + "picard", + "ViewSam", + f"I={output_bam}", + "ALIGNMENT_STATUS=All", + "PF_STATUS=All", + ] + try: + result = subprocess.run( + view_cmd, + check=True, + capture_output=True, + text=True, + ) + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"ViewSam failed with exit code {e.returncode}\n" + f"stdout: {e.stdout}\nstderr: {e.stderr}" + ) from e + + # Write captured stdout to output_sam + with open(output_sam, "w", encoding="utf-8") as f: + f.write(result.stdout) + + # Return structured metadata + return { + "input_bam": input_bam, + "output_bam": output_bam, + "output_sam": output_sam, + "sort_order": "coordinate", + "index_created": True, + "validation_stringency": "SILENT", + "view_sam_arguments": { + "alignment_status": "All", + "pf_status": "All", + }, + "status": "success", + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/picard_sort_sam_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/picard_sort_sam_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..3c7fd9cb4f955a98cf98fd76b5630ff197d94aad --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/picard_sort_sam_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "3d8cabe2afe03f67d93e71aaa5e19bccc557e3c0f91866f27516dbb9e561fd0a", + "elapsed_seconds": 4.0612123012542725, + "usage": { + "prompt_tokens": 4073, + "completion_tokens": 677, + "total_tokens": 4750, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 4073 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "03273485-162e-48f5-8905-7a7c8d39a3a5" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/portcullis_prepare_splice_inputs_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/portcullis_prepare_splice_inputs_test.py new file mode 100644 index 0000000000000000000000000000000000000000..7ed74b0da01904fe08f17de425e624f701aa3342 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/portcullis_prepare_splice_inputs_test.py @@ -0,0 +1,90 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("portcullis") + +@mcp.tool() +def prepare_splice_inputs( + reference_fasta: str, + input_bam: str, + output_dir: str +) -> str: + """ + Prepare splice junction analysis inputs by copying and indexing the genome + and sorting/indexing one BAM file. + + Args: + reference_fasta: Path to the reference genome FASTA file + input_bam: Path to the input BAM file + output_dir: Directory for output files + + Returns: + JSON-serializable metadata about the operation + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "portcullis", + "prep", + "-o", + output_dir, + "--force", + "--copy", + "-t", + "1", + reference_fasta, + input_bam + ] + + # Set environment with PATH prepend + env = os.environ.copy() + env["PATH"] = "/225040511/miniconda3/envs/bioenv/bin:" + env.get("PATH", "") + + try: + # Execute the command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"portcullis prep failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + metadata = { + "endpoint": "prepare_splice_inputs", + "tool": "portcullis", + "version": "1.2.4", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": str(output_path.resolve()), + "reference_fasta": reference_fasta, + "input_bam": input_bam, + "status": "success" + } + + return json.dumps(metadata, indent=2) + + except FileNotFoundError as e: + raise RuntimeError(f"portcullis executable not found: {e}") + except Exception as e: + raise RuntimeError(f"Error executing portcullis prep: {e}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/portcullis_prepare_splice_inputs_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/portcullis_prepare_splice_inputs_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..d0d28e6a64d39b06e1ff508b6beebd26d76c3dae --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/portcullis_prepare_splice_inputs_test.py.raw.txt @@ -0,0 +1,92 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("portcullis") + +@mcp.tool() +def prepare_splice_inputs( + reference_fasta: str, + input_bam: str, + output_dir: str +) -> str: + """ + Prepare splice junction analysis inputs by copying and indexing the genome + and sorting/indexing one BAM file. + + Args: + reference_fasta: Path to the reference genome FASTA file + input_bam: Path to the input BAM file + output_dir: Directory for output files + + Returns: + JSON-serializable metadata about the operation + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "portcullis", + "prep", + "-o", + output_dir, + "--force", + "--copy", + "-t", + "1", + reference_fasta, + input_bam + ] + + # Set environment with PATH prepend + env = os.environ.copy() + env["PATH"] = "/225040511/miniconda3/envs/bioenv/bin:" + env.get("PATH", "") + + try: + # Execute the command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"portcullis prep failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + metadata = { + "endpoint": "prepare_splice_inputs", + "tool": "portcullis", + "version": "1.2.4", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": str(output_path.resolve()), + "reference_fasta": reference_fasta, + "input_bam": input_bam, + "status": "success" + } + + return json.dumps(metadata, indent=2) + + except FileNotFoundError as e: + raise RuntimeError(f"portcullis executable not found: {e}") + except Exception as e: + raise RuntimeError(f"Error executing portcullis prep: {e}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/portcullis_prepare_splice_inputs_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/portcullis_prepare_splice_inputs_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..eecf1078308f2f1757dbc4be52f015a57c6d8cfb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/portcullis_prepare_splice_inputs_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "0dfbc9bd46d8949912dcb7fc93596bab2a26bb2a312b7d8199fef20252e14bf5", + "elapsed_seconds": 4.275843858718872, + "usage": { + "prompt_tokens": 8733, + "completion_tokens": 597, + "total_tokens": 9330, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 8733 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "61f647bb-42bf-4e62-84b2-f5c832234018" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prank_align_proteins_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prank_align_proteins_test.py new file mode 100644 index 0000000000000000000000000000000000000000..83e17ce14d36ad2e1ee2a9efe3dc3dfe6046637f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prank_align_proteins_test.py @@ -0,0 +1,101 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("prank-align-proteins") + +@mcp.tool() +def align_proteins(input_fasta: str, output_prefix: str) -> dict: + """ + Align protein sequences using PRANK. + + Args: + input_fasta: Path to input FASTA file + output_prefix: Prefix for output files (FASTA output will be written to {output_prefix}.fasta) + + Returns: + JSON-serializable metadata about the alignment run + """ + # Validate input file exists + input_path = Path(input_fasta) + if not input_path.is_file(): + raise FileNotFoundError(f"Input FASTA file not found: {input_fasta}") + + # Create output parent directory if needed + output_path = Path(output_prefix) + output_dir = output_path.parent if output_path.parent != Path('.') else Path('.') + output_dir.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution plan + cmd = [ + "prank", + f"-d={input_fasta}", + f"-o={output_prefix}", + "-f=fasta", + "-once", + "-quiet" + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("PRANK executable 'prank' not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute PRANK: {str(e)}") + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr.strip() else result.stdout.strip() + raise RuntimeError(f"PRANK failed with exit code {result.returncode}: {error_msg}") + + # Determine output file paths + fasta_output = f"{output_prefix}.fasta" + # PRANK may also produce other files (e.g., .dnd, .xml) but we only report the main FASTA output + + # Check if output file was created + if not os.path.isfile(fasta_output): + # Try alternative naming patterns + alt_outputs = [ + f"{output_prefix}.best.fas", + f"{output_prefix}.fas", + f"{output_prefix}.fasta" + ] + for alt in alt_outputs: + if os.path.isfile(alt): + fasta_output = alt + break + else: + raise RuntimeError(f"PRANK completed but output FASTA file not found. Expected {fasta_output}") + + # Collect metadata + metadata = { + "endpoint": "align_proteins", + "tool": "prank", + "version": "251117", + "input_fasta": str(input_path.resolve()), + "output_prefix": str(output_path.resolve()), + "output_fasta": str(Path(fasta_output).resolve()), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + "parameters": { + "input_fasta": input_fasta, + "output_prefix": output_prefix + } + } + + return metadata + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prank_align_proteins_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prank_align_proteins_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..5af3723d5ac84a6426abbea16646cca6ff0558e6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prank_align_proteins_test.py.raw.txt @@ -0,0 +1,103 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("prank-align-proteins") + +@mcp.tool() +def align_proteins(input_fasta: str, output_prefix: str) -> dict: + """ + Align protein sequences using PRANK. + + Args: + input_fasta: Path to input FASTA file + output_prefix: Prefix for output files (FASTA output will be written to {output_prefix}.fasta) + + Returns: + JSON-serializable metadata about the alignment run + """ + # Validate input file exists + input_path = Path(input_fasta) + if not input_path.is_file(): + raise FileNotFoundError(f"Input FASTA file not found: {input_fasta}") + + # Create output parent directory if needed + output_path = Path(output_prefix) + output_dir = output_path.parent if output_path.parent != Path('.') else Path('.') + output_dir.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution plan + cmd = [ + "prank", + f"-d={input_fasta}", + f"-o={output_prefix}", + "-f=fasta", + "-once", + "-quiet" + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("PRANK executable 'prank' not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute PRANK: {str(e)}") + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr.strip() else result.stdout.strip() + raise RuntimeError(f"PRANK failed with exit code {result.returncode}: {error_msg}") + + # Determine output file paths + fasta_output = f"{output_prefix}.fasta" + # PRANK may also produce other files (e.g., .dnd, .xml) but we only report the main FASTA output + + # Check if output file was created + if not os.path.isfile(fasta_output): + # Try alternative naming patterns + alt_outputs = [ + f"{output_prefix}.best.fas", + f"{output_prefix}.fas", + f"{output_prefix}.fasta" + ] + for alt in alt_outputs: + if os.path.isfile(alt): + fasta_output = alt + break + else: + raise RuntimeError(f"PRANK completed but output FASTA file not found. Expected {fasta_output}") + + # Collect metadata + metadata = { + "endpoint": "align_proteins", + "tool": "prank", + "version": "251117", + "input_fasta": str(input_path.resolve()), + "output_prefix": str(output_path.resolve()), + "output_fasta": str(Path(fasta_output).resolve()), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + "parameters": { + "input_fasta": input_fasta, + "output_prefix": output_prefix + } + } + + return metadata + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prank_align_proteins_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prank_align_proteins_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..15500c20ca2ca90f89dcbf204f3f3afd9ccc0f15 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prank_align_proteins_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e40753483857cbbf015c374349b40fd478fdc95f686b10f8826b45b375d565ed", + "elapsed_seconds": 5.010763883590698, + "usage": { + "prompt_tokens": 970, + "completion_tokens": 754, + "total_tokens": 1724, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 970 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "f2dfb872-105e-4863-8804-c2791103d1ce" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prophyle_index_and_classify_reads_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prophyle_index_and_classify_reads_test.py new file mode 100644 index 0000000000000000000000000000000000000000..8123bb06dd3e4170408120e8e8d458b45fa4bd2e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prophyle_index_and_classify_reads_test.py @@ -0,0 +1,98 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("prophyle") + + +@mcp.tool() +def index_and_classify_reads( + library_dir: str, + tree_file: str, + reads_fasta: str, + index_dir: str, + output_kraken: str, +) -> dict: + """ + Index a reference library and classify reads using ProPhyle. + + Args: + library_dir: Path to the directory containing the reference library (FASTA files). + tree_file: Path to the phylogenetic tree file (Newick format). + reads_fasta: Path to the input reads file in FASTA format. + index_dir: Path to the directory where the index will be created. + output_kraken: Path to the output file for Kraken-format classification results. + """ + # Create output parent directories + for path in [index_dir, output_kraken]: + parent = Path(path).parent + if parent and not parent.exists(): + parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Index + index_cmd = [ + "prophyle", + "index", + "-A", + "-g", + library_dir, + "-j", + "1", + "-k", + "15", + tree_file, + index_dir, + ] + index_result = subprocess.run( + index_cmd, + capture_output=True, + text=True, + check=False, + ) + if index_result.returncode != 0: + raise RuntimeError( + f"prophyle index failed with exit code {index_result.returncode}\n" + f"stdout: {index_result.stdout}\n" + f"stderr: {index_result.stderr}" + ) + + # Step 2: Classify + classify_cmd = [ + "prophyle", + "classify", + "-k", + "15", + "-f", + "kraken", + index_dir, + reads_fasta, + ] + classify_result = subprocess.run( + classify_cmd, + capture_output=True, + text=True, + check=False, + ) + if classify_result.returncode != 0: + raise RuntimeError( + f"prophyle classify failed with exit code {classify_result.returncode}\n" + f"stdout: {classify_result.stdout}\n" + f"stderr: {classify_result.stderr}" + ) + + # Write stdout to output_kraken + with open(output_kraken, "w") as f: + f.write(classify_result.stdout) + + return { + "index_dir": index_dir, + "output_kraken": output_kraken, + "index_exit_code": index_result.returncode, + "classify_exit_code": classify_result.returncode, + "index_stdout": index_result.stdout, + "index_stderr": index_result.stderr, + "classify_stderr": classify_result.stderr, + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prophyle_index_and_classify_reads_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prophyle_index_and_classify_reads_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..2f8aa2527415bccf5e4c4928c5e0ff47e063bb37 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prophyle_index_and_classify_reads_test.py.raw.txt @@ -0,0 +1,100 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("prophyle") + + +@mcp.tool() +def index_and_classify_reads( + library_dir: str, + tree_file: str, + reads_fasta: str, + index_dir: str, + output_kraken: str, +) -> dict: + """ + Index a reference library and classify reads using ProPhyle. + + Args: + library_dir: Path to the directory containing the reference library (FASTA files). + tree_file: Path to the phylogenetic tree file (Newick format). + reads_fasta: Path to the input reads file in FASTA format. + index_dir: Path to the directory where the index will be created. + output_kraken: Path to the output file for Kraken-format classification results. + """ + # Create output parent directories + for path in [index_dir, output_kraken]: + parent = Path(path).parent + if parent and not parent.exists(): + parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Index + index_cmd = [ + "prophyle", + "index", + "-A", + "-g", + library_dir, + "-j", + "1", + "-k", + "15", + tree_file, + index_dir, + ] + index_result = subprocess.run( + index_cmd, + capture_output=True, + text=True, + check=False, + ) + if index_result.returncode != 0: + raise RuntimeError( + f"prophyle index failed with exit code {index_result.returncode}\n" + f"stdout: {index_result.stdout}\n" + f"stderr: {index_result.stderr}" + ) + + # Step 2: Classify + classify_cmd = [ + "prophyle", + "classify", + "-k", + "15", + "-f", + "kraken", + index_dir, + reads_fasta, + ] + classify_result = subprocess.run( + classify_cmd, + capture_output=True, + text=True, + check=False, + ) + if classify_result.returncode != 0: + raise RuntimeError( + f"prophyle classify failed with exit code {classify_result.returncode}\n" + f"stdout: {classify_result.stdout}\n" + f"stderr: {classify_result.stderr}" + ) + + # Write stdout to output_kraken + with open(output_kraken, "w") as f: + f.write(classify_result.stdout) + + return { + "index_dir": index_dir, + "output_kraken": output_kraken, + "index_exit_code": index_result.returncode, + "classify_exit_code": classify_result.returncode, + "index_stdout": index_result.stdout, + "index_stderr": index_result.stderr, + "classify_stderr": classify_result.stderr, + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prophyle_index_and_classify_reads_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prophyle_index_and_classify_reads_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..7a281bcb4ac9ae3baea901ece4159ca282a9b2c4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/prophyle_index_and_classify_reads_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "05244b70bf4243c31ccd4e3cad2e40ddaae83f28cea0f1fee803107ad3b123de", + "elapsed_seconds": 4.159008264541626, + "usage": { + "prompt_tokens": 7252, + "completion_tokens": 670, + "total_tokens": 7922, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7252 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "f6301926-e406-4e0a-a4ff-55728ff4cf20" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyfastx_fasta_statistics_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyfastx_fasta_statistics_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2ba56def34bb52849f0cc827864686cace79bdce --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyfastx_fasta_statistics_test.py @@ -0,0 +1,76 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any + +from mcp.server.fastmcp import FastMCP + +# Initialize FastMCP server +mcp = FastMCP("pyfastx-fasta-statistics") + + +@mcp.tool() +def fasta_statistics(input_fasta: str, output_tsv: str) -> dict[str, Any]: + """ + Compute detailed statistics for a FASTA file using pyfastx stat. + + Args: + input_fasta: Path to the input FASTA file. + output_tsv: Path where the statistics TSV output will be written. + + Returns: + JSON-serializable metadata about the execution. + """ + # Validate input path + input_path = Path(input_fasta) + if not input_path.exists(): + raise FileNotFoundError(f"Input FASTA file not found: {input_fasta}") + + # Prepare output path + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + command = ["pyfastx", "stat", str(input_path)] + + # Execute the command without shell=True + try: + result = subprocess.run( + command, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "pyfastx executable not found. Ensure it is installed and in PATH." + ) + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError( + f"pyfastx stat failed with exit code {result.returncode}: {error_msg}" + ) + + # Write stdout to output file + output_path.write_text(result.stdout, encoding="utf-8") + + # Return structured metadata + return { + "endpoint": "fasta_statistics", + "input_fasta": str(input_path), + "output_tsv": str(output_path), + "exit_code": result.returncode, + "stdout_bytes": len(result.stdout.encode("utf-8")), + "stderr_bytes": len(result.stderr.encode("utf-8")), + "command": command, + "success": True, + } + + +# Main entry point for MCP server +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyfastx_fasta_statistics_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyfastx_fasta_statistics_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..d3ace6840c5a72c5b599106de7502059da821825 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyfastx_fasta_statistics_test.py.raw.txt @@ -0,0 +1,78 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any + +from mcp.server.fastmcp import FastMCP + +# Initialize FastMCP server +mcp = FastMCP("pyfastx-fasta-statistics") + + +@mcp.tool() +def fasta_statistics(input_fasta: str, output_tsv: str) -> dict[str, Any]: + """ + Compute detailed statistics for a FASTA file using pyfastx stat. + + Args: + input_fasta: Path to the input FASTA file. + output_tsv: Path where the statistics TSV output will be written. + + Returns: + JSON-serializable metadata about the execution. + """ + # Validate input path + input_path = Path(input_fasta) + if not input_path.exists(): + raise FileNotFoundError(f"Input FASTA file not found: {input_fasta}") + + # Prepare output path + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + command = ["pyfastx", "stat", str(input_path)] + + # Execute the command without shell=True + try: + result = subprocess.run( + command, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "pyfastx executable not found. Ensure it is installed and in PATH." + ) + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError( + f"pyfastx stat failed with exit code {result.returncode}: {error_msg}" + ) + + # Write stdout to output file + output_path.write_text(result.stdout, encoding="utf-8") + + # Return structured metadata + return { + "endpoint": "fasta_statistics", + "input_fasta": str(input_path), + "output_tsv": str(output_path), + "exit_code": result.returncode, + "stdout_bytes": len(result.stdout.encode("utf-8")), + "stderr_bytes": len(result.stderr.encode("utf-8")), + "command": command, + "success": True, + } + + +# Main entry point for MCP server +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyfastx_fasta_statistics_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyfastx_fasta_statistics_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..2660481e946235a0ae097727206cb2003b58b4ea --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyfastx_fasta_statistics_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "a02795fc00209054d5b8ed655cc328d48706cf3b5adef5d702ed96ffce74df9e", + "elapsed_seconds": 5.375133275985718, + "usage": { + "prompt_tokens": 609, + "completion_tokens": 528, + "total_tokens": 1137, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 609 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "f9ed8123-3b27-4674-a6f5-4d97abdee400" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyranges_merge_genomic_ranges_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyranges_merge_genomic_ranges_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2ce2e41acfa86ec05b284d7fac444d26052fcd0e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyranges_merge_genomic_ranges_test.py @@ -0,0 +1,60 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import sys +import os +import json + +mcp = FastMCP("pyranges") + +@mcp.tool() +def merge_genomic_ranges(input_bed: str, output_tsv: str) -> dict: + """ + Read BED into PyRanges, merge overlaps, and write the canonical three-column table. + + Args: + input_bed: Path to input BED file + output_tsv: Path to output TSV file + """ + # Create output parent directories + output_dir = os.path.dirname(os.path.abspath(output_tsv)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command + code = ( + "import sys; " + "import pyranges as pr; " + "x=pr.read_bed(sys.argv[1]); " + "x.merge().df.to_csv(sys.argv[2],sep='\\t',index=False)" + ) + cmd = [ + "python", + "-c", + code, + input_bed, + output_tsv + ] + + # Execute the command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}: {result.stderr}" + ) + + return { + "endpoint": "merge_genomic_ranges", + "input_bed": input_bed, + "output_tsv": output_tsv, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyranges_merge_genomic_ranges_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyranges_merge_genomic_ranges_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..5102ce65b3abea5e5b6440310160bfdf29e0e179 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyranges_merge_genomic_ranges_test.py.raw.txt @@ -0,0 +1,62 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import sys +import os +import json + +mcp = FastMCP("pyranges") + +@mcp.tool() +def merge_genomic_ranges(input_bed: str, output_tsv: str) -> dict: + """ + Read BED into PyRanges, merge overlaps, and write the canonical three-column table. + + Args: + input_bed: Path to input BED file + output_tsv: Path to output TSV file + """ + # Create output parent directories + output_dir = os.path.dirname(os.path.abspath(output_tsv)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command + code = ( + "import sys; " + "import pyranges as pr; " + "x=pr.read_bed(sys.argv[1]); " + "x.merge().df.to_csv(sys.argv[2],sep='\\t',index=False)" + ) + cmd = [ + "python", + "-c", + code, + input_bed, + output_tsv + ] + + # Execute the command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}: {result.stderr}" + ) + + return { + "endpoint": "merge_genomic_ranges", + "input_bed": input_bed, + "output_tsv": output_tsv, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyranges_merge_genomic_ranges_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyranges_merge_genomic_ranges_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..931d81e38080e9b2a10f8ad4dec2bf76695a9a62 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyranges_merge_genomic_ranges_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "57e5d639f36307a1dde10cb892b9863c87ee25629f95742e7af899ad800f0e9d", + "elapsed_seconds": 2.44508695602417, + "usage": { + "prompt_tokens": 9250, + "completion_tokens": 396, + "total_tokens": 9646, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9250 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "bb258337-577b-4e4a-ad7a-b93e728fc1c3" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyrodigal_predict_genes_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyrodigal_predict_genes_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ca0aa4f2ddfa7f33ff3b916e07f89cc1f0e6965b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyrodigal_predict_genes_test.py @@ -0,0 +1,87 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("pyrodigal-predict-genes") + +@mcp.tool() +def predict_genes( + input_file: str, + output_gff: str, + output_proteins: str, + output_genes: str +) -> dict: + """ + Predict genes using pyrodigal in metagenomic mode with one worker. + + Args: + input_file: Path to input FASTA file + output_gff: Path to output GFF file + output_proteins: Path to output protein translations file + output_genes: Path to output nucleotide sequences of genes file + """ + # Create parent directories for all output files + for output_path in [output_gff, output_proteins, output_genes]: + parent_dir = os.path.dirname(os.path.abspath(output_path)) + os.makedirs(parent_dir, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "pyrodigal", + "-p", "meta", + "-i", input_file, + "-o", output_gff, + "-a", output_proteins, + "-d", output_genes, + "-j", "1" + ] + + # Execute command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"pyrodigal failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output files were created + output_files = { + "gff": output_gff, + "proteins": output_proteins, + "genes": output_genes + } + + file_sizes = {} + for key, path in output_files.items(): + if os.path.exists(path): + file_sizes[key] = os.path.getsize(path) + else: + file_sizes[key] = 0 + + # Return structured JSON-serializable metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "output_files": { + "gff": output_gff, + "proteins": output_proteins, + "genes": output_genes + }, + "file_sizes": file_sizes, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyrodigal_predict_genes_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyrodigal_predict_genes_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..a62e0bc79a4d68e954b7c0365e6532c1d4b23703 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyrodigal_predict_genes_test.py.raw.txt @@ -0,0 +1,89 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("pyrodigal-predict-genes") + +@mcp.tool() +def predict_genes( + input_file: str, + output_gff: str, + output_proteins: str, + output_genes: str +) -> dict: + """ + Predict genes using pyrodigal in metagenomic mode with one worker. + + Args: + input_file: Path to input FASTA file + output_gff: Path to output GFF file + output_proteins: Path to output protein translations file + output_genes: Path to output nucleotide sequences of genes file + """ + # Create parent directories for all output files + for output_path in [output_gff, output_proteins, output_genes]: + parent_dir = os.path.dirname(os.path.abspath(output_path)) + os.makedirs(parent_dir, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "pyrodigal", + "-p", "meta", + "-i", input_file, + "-o", output_gff, + "-a", output_proteins, + "-d", output_genes, + "-j", "1" + ] + + # Execute command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"pyrodigal failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output files were created + output_files = { + "gff": output_gff, + "proteins": output_proteins, + "genes": output_genes + } + + file_sizes = {} + for key, path in output_files.items(): + if os.path.exists(path): + file_sizes[key] = os.path.getsize(path) + else: + file_sizes[key] = 0 + + # Return structured JSON-serializable metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "output_files": { + "gff": output_gff, + "proteins": output_proteins, + "genes": output_genes + }, + "file_sizes": file_sizes, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyrodigal_predict_genes_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyrodigal_predict_genes_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..de726d0bc128926a5caa86919be7c6c7c6b504f1 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pyrodigal_predict_genes_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "97e44fe4d1cca9f537035913ba61aae586e473c8b77e7d80436e1f422b314b38", + "elapsed_seconds": 3.4061594009399414, + "usage": { + "prompt_tokens": 1184, + "completion_tokens": 592, + "total_tokens": 1776, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1184 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "1853fa08-341a-4931-bb67-c0b043213c6e" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pysam_summarize_bam_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pysam_summarize_bam_test.py new file mode 100644 index 0000000000000000000000000000000000000000..719e934ee36a3cc61acc7bf9be73f5628dc94622 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pysam_summarize_bam_test.py @@ -0,0 +1,98 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("pysam") + + +@mcp.tool() +def summarize_bam(input_bam: str, output_json: str) -> dict: + """ + Summarize a BAM file using pinned pysam 0.24.0 (py310h4a09ff2_1). + + Args: + input_bam: Path to input BAM file (BAI sidecar is implicit). + output_json: Path where JSON summary will be written. + + Returns: + JSON-serializable metadata about the operation. + """ + # Validate required parameters + if not input_bam: + raise ValueError("input_bam is required") + if not output_json: + raise ValueError("output_json is required") + + input_bam_path = Path(input_bam) + output_json_path = Path(output_json) + + # Create output parent directories + output_json_path.parent.mkdir(parents=True, exist_ok=True) + + # Python code to execute (from execution_plan) + python_code = ( + "import json,pysam,sys; " + "b=pysam.AlignmentFile(sys.argv[1],'rb'); " + "d={'references':list(b.references),'mapped':b.mapped,'unmapped':b.unmapped," + "'records':sum(1 for _ in b.fetch(until_eof=True))}; " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + # Build command exactly as specified in execution_plan + cmd = [ + "python3.10", + "-c", + python_code, + str(input_bam_path), + str(output_json_path), + ] + + # Execute without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"Executable not found: {e}") from e + except Exception as e: + raise RuntimeError(f"Failed to execute command: {e}") from e + + # Raise on non-zero exit + if result.returncode != 0: + stderr_msg = result.stderr.strip() if result.stderr else "" + raise RuntimeError( + f"Command failed with exit code {result.returncode}: {stderr_msg}" + ) + + # Verify output file was created + if not output_json_path.exists(): + raise RuntimeError(f"Output file was not created: {output_json_path}") + + # Read and validate the output JSON + try: + with open(output_json_path, "r") as f: + summary = json.load(f) + except (json.JSONDecodeError, OSError) as e: + raise RuntimeError(f"Failed to read output JSON: {e}") from e + + # Return structured metadata + return { + "endpoint": "summarize_bam", + "input_bam": str(input_bam_path), + "output_json": str(output_json_path), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "summary": summary, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pysam_summarize_bam_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pysam_summarize_bam_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..4052cc46234b71e5bdcd24f29e885b0fe802f6b7 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pysam_summarize_bam_test.py.raw.txt @@ -0,0 +1,100 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("pysam") + + +@mcp.tool() +def summarize_bam(input_bam: str, output_json: str) -> dict: + """ + Summarize a BAM file using pinned pysam 0.24.0 (py310h4a09ff2_1). + + Args: + input_bam: Path to input BAM file (BAI sidecar is implicit). + output_json: Path where JSON summary will be written. + + Returns: + JSON-serializable metadata about the operation. + """ + # Validate required parameters + if not input_bam: + raise ValueError("input_bam is required") + if not output_json: + raise ValueError("output_json is required") + + input_bam_path = Path(input_bam) + output_json_path = Path(output_json) + + # Create output parent directories + output_json_path.parent.mkdir(parents=True, exist_ok=True) + + # Python code to execute (from execution_plan) + python_code = ( + "import json,pysam,sys; " + "b=pysam.AlignmentFile(sys.argv[1],'rb'); " + "d={'references':list(b.references),'mapped':b.mapped,'unmapped':b.unmapped," + "'records':sum(1 for _ in b.fetch(until_eof=True))}; " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + # Build command exactly as specified in execution_plan + cmd = [ + "python3.10", + "-c", + python_code, + str(input_bam_path), + str(output_json_path), + ] + + # Execute without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"Executable not found: {e}") from e + except Exception as e: + raise RuntimeError(f"Failed to execute command: {e}") from e + + # Raise on non-zero exit + if result.returncode != 0: + stderr_msg = result.stderr.strip() if result.stderr else "" + raise RuntimeError( + f"Command failed with exit code {result.returncode}: {stderr_msg}" + ) + + # Verify output file was created + if not output_json_path.exists(): + raise RuntimeError(f"Output file was not created: {output_json_path}") + + # Read and validate the output JSON + try: + with open(output_json_path, "r") as f: + summary = json.load(f) + except (json.JSONDecodeError, OSError) as e: + raise RuntimeError(f"Failed to read output JSON: {e}") from e + + # Return structured metadata + return { + "endpoint": "summarize_bam", + "input_bam": str(input_bam_path), + "output_json": str(output_json_path), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "summary": summary, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pysam_summarize_bam_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pysam_summarize_bam_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..0d660823b4a45afaa58ddf45d6e23693cf0b067f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/pysam_summarize_bam_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "f0e10bb990ba7ef00f052ae7dfc67b26270fe64964099f70407cff6594bd241e", + "elapsed_seconds": 5.8101348876953125, + "usage": { + "prompt_tokens": 7767, + "completion_tokens": 740, + "total_tokens": 8507, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7767 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "5fdd45a8-ce7d-4641-9ba2-aae5fb151301" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/python-edlib_global_align_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/python-edlib_global_align_test.py new file mode 100644 index 0000000000000000000000000000000000000000..9e3fd09e1339daa7e0cebee2f80f6ef4dee992f8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/python-edlib_global_align_test.py @@ -0,0 +1,66 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("python-edlib") + + +@mcp.tool() +def global_align(sequence_a: str, sequence_b: str, output_json: str) -> dict[str, Any]: + """Perform global (NW) sequence alignment using edlib. + + Args: + sequence_a: Path to a FASTA or raw sequence file for the first sequence. + sequence_b: Path to a FASTA or raw sequence file for the second sequence. + output_json: Path where the alignment result JSON will be written. + """ + # Create output parent directory if needed + output_path = Path(output_json) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "python3.10", + "-c", + "import json,edlib,sys; rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>')); r=edlib.align(rd(sys.argv[1]),rd(sys.argv[2]),mode='NW',task='path'); open(sys.argv[3],'w').write(json.dumps(r,sort_keys=True)+'\\n')", + sequence_a, + sequence_b, + output_json, + ] + + # Run the command without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"edlib alignment failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Read the output JSON to return structured metadata + try: + with open(output_json, "r") as f: + alignment_result = json.load(f) + except (OSError, json.JSONDecodeError) as e: + raise RuntimeError(f"Failed to read alignment output: {e}") + + return { + "output_json": output_json, + "edit_distance": alignment_result.get("editDistance"), + "alignment_length": alignment_result.get("alignmentLength"), + "cigar": alignment_result.get("cigar"), + "locations": alignment_result.get("locations"), + "status": alignment_result.get("status"), + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/python-edlib_global_align_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/python-edlib_global_align_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..ccda1ab9d4fe9effa5d22e688bc9d71a91ec5faa --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/python-edlib_global_align_test.py.raw.txt @@ -0,0 +1,68 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("python-edlib") + + +@mcp.tool() +def global_align(sequence_a: str, sequence_b: str, output_json: str) -> dict[str, Any]: + """Perform global (NW) sequence alignment using edlib. + + Args: + sequence_a: Path to a FASTA or raw sequence file for the first sequence. + sequence_b: Path to a FASTA or raw sequence file for the second sequence. + output_json: Path where the alignment result JSON will be written. + """ + # Create output parent directory if needed + output_path = Path(output_json) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "python3.10", + "-c", + "import json,edlib,sys; rd=lambda p:''.join(x.strip() for x in open(p) if not x.startswith('>')); r=edlib.align(rd(sys.argv[1]),rd(sys.argv[2]),mode='NW',task='path'); open(sys.argv[3],'w').write(json.dumps(r,sort_keys=True)+'\\n')", + sequence_a, + sequence_b, + output_json, + ] + + # Run the command without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"edlib alignment failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Read the output JSON to return structured metadata + try: + with open(output_json, "r") as f: + alignment_result = json.load(f) + except (OSError, json.JSONDecodeError) as e: + raise RuntimeError(f"Failed to read alignment output: {e}") + + return { + "output_json": output_json, + "edit_distance": alignment_result.get("editDistance"), + "alignment_length": alignment_result.get("alignmentLength"), + "cigar": alignment_result.get("cigar"), + "locations": alignment_result.get("locations"), + "status": alignment_result.get("status"), + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/python-edlib_global_align_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/python-edlib_global_align_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..a5f30826978e7ba1e3f55e062e816eb98ea9e924 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/python-edlib_global_align_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "691a420c6e9ef00791e64e39f75397882e24134155fe192cd2e3264f413200ac", + "elapsed_seconds": 3.420154333114624, + "usage": { + "prompt_tokens": 17569, + "completion_tokens": 562, + "total_tokens": 18131, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 17569 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "69ac0264-4973-48f6-96d7-ee01ce08ee97" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/raxml_infer_protein_tree_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/raxml_infer_protein_tree_test.py new file mode 100644 index 0000000000000000000000000000000000000000..daf2200014cdb81d8561d700efa11a6ffdaf5563 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/raxml_infer_protein_tree_test.py @@ -0,0 +1,99 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("raxml") + +@mcp.tool() +def infer_protein_tree(alignment_file: str, output_dir: str) -> dict: + """ + Infer a protein tree using RAxML with PROTGAMMALG model, parsimony seed 1, and one search. + + Args: + alignment_file: Path to the input alignment file (PHYLIP format) + output_dir: Directory where RAxML output files will be written + + Returns: + Dictionary containing metadata about the run and output file paths + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "raxmlHPC", + "-s", alignment_file, + "-n", "fixture", + "-m", "PROTGAMMALG", + "-p", "1", + "-N", "1", + "-w", output_dir + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("raxmlHPC executable not found in PATH") + + if result.returncode != 0: + raise RuntimeError( + f"RAxML failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Collect output file paths + output_files = {} + output_prefix = f"RAxML_{output_path.name}" + + # Common RAxML output files + possible_files = [ + "RAxML_bestTree.fixture", + "RAxML_bipartitions.fixture", + "RAxML_bipartitionsBranchLabels.fixture", + "RAxML_bootstrap.fixture", + "RAxML_info.fixture", + "RAxML_log.fixture", + "RAxML_parsimonyTree.fixture", + "RAxML_result.fixture", + "RAxML_bestTree." + output_path.name, + "RAxML_bipartitions." + output_path.name, + "RAxML_bipartitionsBranchLabels." + output_path.name, + "RAxML_bootstrap." + output_path.name, + "RAxML_info." + output_path.name, + "RAxML_log." + output_path.name, + "RAxML_parsimonyTree." + output_path.name, + "RAxML_result." + output_path.name + ] + + for fname in possible_files: + fpath = output_path / fname + if fpath.exists(): + output_files[fname] = str(fpath) + + # Also check for any RAxML_* files in the output directory + for fpath in output_path.glob("RAxML_*"): + if fpath.name not in output_files: + output_files[fpath.name] = str(fpath) + + return { + "status": "success", + "command": " ".join(cmd), + "exit_code": result.returncode, + "output_dir": str(output_path), + "output_files": output_files, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/raxml_infer_protein_tree_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/raxml_infer_protein_tree_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..3a22efa062ac5dc8d4760b49b8557eb4f149e2ab --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/raxml_infer_protein_tree_test.py.raw.txt @@ -0,0 +1,101 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("raxml") + +@mcp.tool() +def infer_protein_tree(alignment_file: str, output_dir: str) -> dict: + """ + Infer a protein tree using RAxML with PROTGAMMALG model, parsimony seed 1, and one search. + + Args: + alignment_file: Path to the input alignment file (PHYLIP format) + output_dir: Directory where RAxML output files will be written + + Returns: + Dictionary containing metadata about the run and output file paths + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "raxmlHPC", + "-s", alignment_file, + "-n", "fixture", + "-m", "PROTGAMMALG", + "-p", "1", + "-N", "1", + "-w", output_dir + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("raxmlHPC executable not found in PATH") + + if result.returncode != 0: + raise RuntimeError( + f"RAxML failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Collect output file paths + output_files = {} + output_prefix = f"RAxML_{output_path.name}" + + # Common RAxML output files + possible_files = [ + "RAxML_bestTree.fixture", + "RAxML_bipartitions.fixture", + "RAxML_bipartitionsBranchLabels.fixture", + "RAxML_bootstrap.fixture", + "RAxML_info.fixture", + "RAxML_log.fixture", + "RAxML_parsimonyTree.fixture", + "RAxML_result.fixture", + "RAxML_bestTree." + output_path.name, + "RAxML_bipartitions." + output_path.name, + "RAxML_bipartitionsBranchLabels." + output_path.name, + "RAxML_bootstrap." + output_path.name, + "RAxML_info." + output_path.name, + "RAxML_log." + output_path.name, + "RAxML_parsimonyTree." + output_path.name, + "RAxML_result." + output_path.name + ] + + for fname in possible_files: + fpath = output_path / fname + if fpath.exists(): + output_files[fname] = str(fpath) + + # Also check for any RAxML_* files in the output directory + for fpath in output_path.glob("RAxML_*"): + if fpath.name not in output_files: + output_files[fpath.name] = str(fpath) + + return { + "status": "success", + "command": " ".join(cmd), + "exit_code": result.returncode, + "output_dir": str(output_path), + "output_files": output_files, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/raxml_infer_protein_tree_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/raxml_infer_protein_tree_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..450946e1c7246596f87fa91ee3984296a312efe5 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/raxml_infer_protein_tree_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "130a02166551f581f98bbae5b4c3f4408870b8a90d1c859101437c2bbebeb887", + "elapsed_seconds": 4.822917699813843, + "usage": { + "prompt_tokens": 8809, + "completion_tokens": 778, + "total_tokens": 9587, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 8809 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "e75e7d2e-ddd9-4b65-8532-b4d605b83789" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rgi_remove_duplicate_prevalence_sequences_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rgi_remove_duplicate_prevalence_sequences_test.py new file mode 100644 index 0000000000000000000000000000000000000000..f3142124bcc8854c77fa9e95ff9e01239568ea4e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rgi_remove_duplicate_prevalence_sequences_test.py @@ -0,0 +1,66 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("rgi") + +@mcp.tool() +def remove_duplicate_prevalence_sequences( + prevalence_fasta: str, + card_annotation: str, + output_fasta: str +) -> dict: + """ + Apply RGI's native CARD-length filter and sequence deduplication to three pinned prevalence records. + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_fasta)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "rgi", + "remove_duplicates", + "-i", prevalence_fasta, + "--card_annotation", card_annotation, + "-o", output_fasta + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"rgi remove_duplicates failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "endpoint": "remove_duplicate_prevalence_sequences", + "status": "success", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_fasta": output_fasta, + "prevalence_fasta": prevalence_fasta, + "card_annotation": card_annotation + } + + except FileNotFoundError as e: + raise RuntimeError(f"Executable 'rgi' not found: {e}") + except Exception as e: + raise RuntimeError(f"Error executing rgi remove_duplicates: {e}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rgi_remove_duplicate_prevalence_sequences_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rgi_remove_duplicate_prevalence_sequences_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..86fc970ebc97de07919df946d8eb6c7a3db39ae5 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rgi_remove_duplicate_prevalence_sequences_test.py.raw.txt @@ -0,0 +1,68 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("rgi") + +@mcp.tool() +def remove_duplicate_prevalence_sequences( + prevalence_fasta: str, + card_annotation: str, + output_fasta: str +) -> dict: + """ + Apply RGI's native CARD-length filter and sequence deduplication to three pinned prevalence records. + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_fasta)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "rgi", + "remove_duplicates", + "-i", prevalence_fasta, + "--card_annotation", card_annotation, + "-o", output_fasta + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"rgi remove_duplicates failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "endpoint": "remove_duplicate_prevalence_sequences", + "status": "success", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_fasta": output_fasta, + "prevalence_fasta": prevalence_fasta, + "card_annotation": card_annotation + } + + except FileNotFoundError as e: + raise RuntimeError(f"Executable 'rgi' not found: {e}") + except Exception as e: + raise RuntimeError(f"Error executing rgi remove_duplicates: {e}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rgi_remove_duplicate_prevalence_sequences_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rgi_remove_duplicate_prevalence_sequences_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..40d53cbf4525e4240f2d7a3cf49deec6bff63647 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rgi_remove_duplicate_prevalence_sequences_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e66e49411d57e498dbd04af2653f00040b90b74e4f46dfdbe79f8a15034ddad5", + "elapsed_seconds": 5.831080913543701, + "usage": { + "prompt_tokens": 7818, + "completion_tokens": 463, + "total_tokens": 8281, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7818 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "02e1d568-881b-4a71-addc-9234bcd03f62" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rnastructure_fold_rna_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rnastructure_fold_rna_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2f146217b15cdc42a85b6f49b9f45c43162c6b2f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rnastructure_fold_rna_test.py @@ -0,0 +1,62 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("rnastructure") + +@mcp.tool() +def fold_rna(input_rna: str, output_dbn: str) -> dict: + """ + Predict RNA secondary structure using RNAstructure Fold. + + Args: + input_rna: Path to input RNA sequence file + output_dbn: Path to output dot-bracket file + """ + # Create output parent directories + output_path = Path(output_dbn) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Set up environment with pinned DATAPATH + env = os.environ.copy() + env["DATAPATH"] = "/225040511/miniconda3/envs/experiment1_test_pinned/rnastructure-6.6-hde5307d_0/share/rnastructure/data_tables" + + # Build command + cmd = [ + "Fold", + input_rna, + output_dbn, + "--bracket", + "--MFE", + "--quiet" + ] + + # Execute command + result = subprocess.run( + cmd, + env=env, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"Fold failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "endpoint": "fold_rna", + "input_rna": input_rna, + "output_dbn": output_dbn, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_exists": output_path.exists(), + "output_size": output_path.stat().st_size if output_path.exists() else 0 + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rnastructure_fold_rna_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rnastructure_fold_rna_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..43f439ab38bb0ccacf2a92838562c10ca66a458a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rnastructure_fold_rna_test.py.raw.txt @@ -0,0 +1,64 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("rnastructure") + +@mcp.tool() +def fold_rna(input_rna: str, output_dbn: str) -> dict: + """ + Predict RNA secondary structure using RNAstructure Fold. + + Args: + input_rna: Path to input RNA sequence file + output_dbn: Path to output dot-bracket file + """ + # Create output parent directories + output_path = Path(output_dbn) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Set up environment with pinned DATAPATH + env = os.environ.copy() + env["DATAPATH"] = "/225040511/miniconda3/envs/experiment1_test_pinned/rnastructure-6.6-hde5307d_0/share/rnastructure/data_tables" + + # Build command + cmd = [ + "Fold", + input_rna, + output_dbn, + "--bracket", + "--MFE", + "--quiet" + ] + + # Execute command + result = subprocess.run( + cmd, + env=env, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"Fold failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "endpoint": "fold_rna", + "input_rna": input_rna, + "output_dbn": output_dbn, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_exists": output_path.exists(), + "output_size": output_path.stat().st_size if output_path.exists() else 0 + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rnastructure_fold_rna_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rnastructure_fold_rna_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..e5663a34ff342d5434c72e476b626a4c193b571c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rnastructure_fold_rna_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "92403a305e1456749716b320c63ff6008623d29e152f5d28aa58d2a92cc2cf26", + "elapsed_seconds": 2.7175519466400146, + "usage": { + "prompt_tokens": 5868, + "completion_tokens": 444, + "total_tokens": 6312, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 5868 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "27d98960-f1ed-4b5f-a33d-8422ac592661" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rust-bio-tools_fastq_sequence_stats_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rust-bio-tools_fastq_sequence_stats_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2dcb4087f7d26ccadebd390f71932511e0b8d8cc --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rust-bio-tools_fastq_sequence_stats_test.py @@ -0,0 +1,64 @@ +import json +import os +import subprocess +import tempfile +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("rust-bio-tools") + +@mcp.tool() +def fastq_sequence_stats(input_fastq: str, output_yaml: str) -> dict: + """ + Compute sequence statistics from a FASTQ file and write results as YAML. + + Args: + input_fastq: Path to input FASTQ file (read from stdin). + output_yaml: Path where YAML output will be written (captured from stdout). + """ + # Create parent directory for output if needed + output_path = Path(output_yaml) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command: rbt sequence-stats -q < input > output + cmd = ["rbt", "sequence-stats", "-q"] + + try: + # Open input file for stdin redirection + with open(input_fastq, "rb") as f_in: + # Run command, capture stdout (YAML output) + result = subprocess.run( + cmd, + stdin=f_in, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False, + ) + + # Check exit code + if result.returncode != 0: + raise RuntimeError( + f"rbt sequence-stats failed with exit code {result.returncode}: " + f"{result.stderr.decode('utf-8', errors='replace')}" + ) + + # Write stdout (YAML) to output file + with open(output_path, "wb") as f_out: + f_out.write(result.stdout) + + # Return structured metadata + return { + "endpoint": "fastq_sequence_stats", + "input_fastq": str(input_fastq), + "output_yaml": str(output_path), + "exit_code": result.returncode, + "stdout_bytes": len(result.stdout), + "stderr": result.stderr.decode("utf-8", errors="replace"), + "status": "success", + } + + except FileNotFoundError as e: + raise RuntimeError(f"Input file not found: {input_fastq}") from e + except Exception as e: + raise RuntimeError(f"Error executing rbt sequence-stats: {str(e)}") from e \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rust-bio-tools_fastq_sequence_stats_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rust-bio-tools_fastq_sequence_stats_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..1a11113bf92fd86ac9eab36415e4f00f69f4709e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rust-bio-tools_fastq_sequence_stats_test.py.raw.txt @@ -0,0 +1,66 @@ +```python +import json +import os +import subprocess +import tempfile +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("rust-bio-tools") + +@mcp.tool() +def fastq_sequence_stats(input_fastq: str, output_yaml: str) -> dict: + """ + Compute sequence statistics from a FASTQ file and write results as YAML. + + Args: + input_fastq: Path to input FASTQ file (read from stdin). + output_yaml: Path where YAML output will be written (captured from stdout). + """ + # Create parent directory for output if needed + output_path = Path(output_yaml) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command: rbt sequence-stats -q < input > output + cmd = ["rbt", "sequence-stats", "-q"] + + try: + # Open input file for stdin redirection + with open(input_fastq, "rb") as f_in: + # Run command, capture stdout (YAML output) + result = subprocess.run( + cmd, + stdin=f_in, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + check=False, + ) + + # Check exit code + if result.returncode != 0: + raise RuntimeError( + f"rbt sequence-stats failed with exit code {result.returncode}: " + f"{result.stderr.decode('utf-8', errors='replace')}" + ) + + # Write stdout (YAML) to output file + with open(output_path, "wb") as f_out: + f_out.write(result.stdout) + + # Return structured metadata + return { + "endpoint": "fastq_sequence_stats", + "input_fastq": str(input_fastq), + "output_yaml": str(output_path), + "exit_code": result.returncode, + "stdout_bytes": len(result.stdout), + "stderr": result.stderr.decode("utf-8", errors="replace"), + "status": "success", + } + + except FileNotFoundError as e: + raise RuntimeError(f"Input file not found: {input_fastq}") from e + except Exception as e: + raise RuntimeError(f"Error executing rbt sequence-stats: {str(e)}") from e +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rust-bio-tools_fastq_sequence_stats_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rust-bio-tools_fastq_sequence_stats_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..de0bfa4844eac01a43a49ed6fe97d836378533f8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/rust-bio-tools_fastq_sequence_stats_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "28bd3a1e6f3c548f2693f01a7a0970b27a070fb9bfc98d7a32772fb3f62a96d2", + "elapsed_seconds": 3.280121326446533, + "usage": { + "prompt_tokens": 9334, + "completion_tokens": 533, + "total_tokens": 9867, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9334 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "d93c4e85-5464-4edd-aa77-b52b0ba8f41a" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samblaster_mark_duplicates_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samblaster_mark_duplicates_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2eb86c513d75c9b1d1fa6d1bdd7c2335be13220e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samblaster_mark_duplicates_test.py @@ -0,0 +1,69 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("samblaster-mark-duplicates") + +@mcp.tool() +def mark_duplicates(input_sam: str, output_sam: str) -> dict: + """ + Mark duplicates in a SAM file using samblaster. + + Args: + input_sam: Path to input SAM file + output_sam: Path to output SAM file with duplicates marked + + Returns: + Dictionary with execution metadata + """ + # Create output parent directory if needed + output_path = Path(output_sam) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "samblaster", + "-i", input_sam, + "-o", output_sam, + "--ignoreUnmated" + ] + + try: + # Execute command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"samblaster failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "endpoint": "mark_duplicates", + "input_sam": input_sam, + "output_sam": output_sam, + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_exists": output_path.exists(), + "output_size": output_path.stat().st_size if output_path.exists() else 0 + } + + except FileNotFoundError: + raise RuntimeError("samblaster executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing samblaster: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samblaster_mark_duplicates_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samblaster_mark_duplicates_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..fe162cddf1a91131d2790a5dece319f7be5e0d6b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samblaster_mark_duplicates_test.py.raw.txt @@ -0,0 +1,71 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("samblaster-mark-duplicates") + +@mcp.tool() +def mark_duplicates(input_sam: str, output_sam: str) -> dict: + """ + Mark duplicates in a SAM file using samblaster. + + Args: + input_sam: Path to input SAM file + output_sam: Path to output SAM file with duplicates marked + + Returns: + Dictionary with execution metadata + """ + # Create output parent directory if needed + output_path = Path(output_sam) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "samblaster", + "-i", input_sam, + "-o", output_sam, + "--ignoreUnmated" + ] + + try: + # Execute command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"samblaster failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "endpoint": "mark_duplicates", + "input_sam": input_sam, + "output_sam": output_sam, + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_exists": output_path.exists(), + "output_size": output_path.stat().st_size if output_path.exists() else 0 + } + + except FileNotFoundError: + raise RuntimeError("samblaster executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing samblaster: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samblaster_mark_duplicates_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samblaster_mark_duplicates_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..b781d0df7d3329c22d8cc8f43f41b206e73eda79 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samblaster_mark_duplicates_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "d94d5bab13d545699c5418bd99f6394369130d2bb3bd1c91bd8f07dee197416f", + "elapsed_seconds": 8.417049169540405, + "usage": { + "prompt_tokens": 1421, + "completion_tokens": 472, + "total_tokens": 1893, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1421 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "786fe6b7-afd2-4deb-aeaa-2a3a1a54525c" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samsift_filter_alignments_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samsift_filter_alignments_test.py new file mode 100644 index 0000000000000000000000000000000000000000..98086c922c4fba1eb8a5c660122d7cc2fcdc1f83 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samsift_filter_alignments_test.py @@ -0,0 +1,69 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("samsift") + +@mcp.tool() +def filter_alignments(input_sam: str, output_sam: str) -> dict: + """ + Filter SAM/BAM alignments, retaining records with MAPQ >= 60. + + Args: + input_sam: Path to input SAM/BAM file + output_sam: Path to output SAM/BAM file + + Returns: + Dictionary with execution metadata + """ + # Create output parent directory if needed + output_path = Path(output_sam) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "samsift", + "-i", input_sam, + "-o", output_sam, + "-f", "MAPQ >= 60" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"samsift executable not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"samsift failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "input_sam": input_sam, + "output_sam": output_sam, + "filter": "MAPQ >= 60", + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samsift_filter_alignments_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samsift_filter_alignments_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..c80ebcbd751500cfea98fc50de41f7c2c411addc --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samsift_filter_alignments_test.py.raw.txt @@ -0,0 +1,71 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("samsift") + +@mcp.tool() +def filter_alignments(input_sam: str, output_sam: str) -> dict: + """ + Filter SAM/BAM alignments, retaining records with MAPQ >= 60. + + Args: + input_sam: Path to input SAM/BAM file + output_sam: Path to output SAM/BAM file + + Returns: + Dictionary with execution metadata + """ + # Create output parent directory if needed + output_path = Path(output_sam) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "samsift", + "-i", input_sam, + "-o", output_sam, + "-f", "MAPQ >= 60" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"samsift executable not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"samsift failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "input_sam": input_sam, + "output_sam": output_sam, + "filter": "MAPQ >= 60", + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samsift_filter_alignments_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samsift_filter_alignments_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..f1a5e280264fedeb6b254e84fb48f875ee34982c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/samsift_filter_alignments_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "6e9b95d4a5af2a59da5f22aa90d5432cb6c18f8438b26301953b481c580d98f2", + "elapsed_seconds": 3.357921838760376, + "usage": { + "prompt_tokens": 11292, + "completion_tokens": 430, + "total_tokens": 11722, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11292 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "44cad215-8156-478e-9195-e0f1b52840ba" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/segemehl_index_and_align_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/segemehl_index_and_align_test.py new file mode 100644 index 0000000000000000000000000000000000000000..9e4e57786eac3887d7eb21015e0a9981587991b3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/segemehl_index_and_align_test.py @@ -0,0 +1,103 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("segemehl") + +@mcp.tool() +def index_and_align( + reference_fasta: str, + query_fasta: str, + index_file: str, + output_sam: str +) -> dict: + """ + Build the suffix-array index, then align one exact query with one thread and a fixed accuracy threshold. + """ + # Resolve paths to absolute paths + reference_fasta = str(Path(reference_fasta).resolve()) + query_fasta = str(Path(query_fasta).resolve()) + index_file = str(Path(index_file).resolve()) + output_sam = str(Path(output_sam).resolve()) + + # Create parent directories for output files + for path in [index_file, output_sam]: + parent = Path(path).parent + if parent and not parent.exists(): + parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Generate index + cmd1 = [ + "segemehl.x", + "-x", index_file, + "-d", reference_fasta + ] + try: + result1 = subprocess.run( + cmd1, + capture_output=True, + text=True, + check=False + ) + if result1.returncode != 0: + raise RuntimeError( + f"Index generation failed with exit code {result1.returncode}\n" + f"STDOUT: {result1.stdout}\n" + f"STDERR: {result1.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("segemehl.x executable not found in PATH") + + # Step 2: Align reads + cmd2 = [ + "segemehl.x", + "-i", index_file, + "-d", reference_fasta, + "-q", query_fasta, + "-o", output_sam, + "-t", "1", + "-A", "80" + ] + try: + result2 = subprocess.run( + cmd2, + capture_output=True, + text=True, + check=False + ) + if result2.returncode != 0: + raise RuntimeError( + f"Alignment failed with exit code {result2.returncode}\n" + f"STDOUT: {result2.stdout}\n" + f"STDERR: {result2.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("segemehl.x executable not found in PATH") + + # Verify output file was created + if not os.path.exists(output_sam): + raise RuntimeError(f"Output SAM file was not created: {output_sam}") + + # Return structured metadata + return { + "status": "success", + "index_file": index_file, + "output_sam": output_sam, + "reference_fasta": reference_fasta, + "query_fasta": query_fasta, + "index_generation": { + "command": cmd1, + "exit_code": result1.returncode, + "stdout": result1.stdout, + "stderr": result1.stderr + }, + "alignment": { + "command": cmd2, + "exit_code": result2.returncode, + "stdout": result2.stdout, + "stderr": result2.stderr + } + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/segemehl_index_and_align_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/segemehl_index_and_align_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..c3b229624637260be469987151c93eb269634574 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/segemehl_index_and_align_test.py.raw.txt @@ -0,0 +1,105 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("segemehl") + +@mcp.tool() +def index_and_align( + reference_fasta: str, + query_fasta: str, + index_file: str, + output_sam: str +) -> dict: + """ + Build the suffix-array index, then align one exact query with one thread and a fixed accuracy threshold. + """ + # Resolve paths to absolute paths + reference_fasta = str(Path(reference_fasta).resolve()) + query_fasta = str(Path(query_fasta).resolve()) + index_file = str(Path(index_file).resolve()) + output_sam = str(Path(output_sam).resolve()) + + # Create parent directories for output files + for path in [index_file, output_sam]: + parent = Path(path).parent + if parent and not parent.exists(): + parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Generate index + cmd1 = [ + "segemehl.x", + "-x", index_file, + "-d", reference_fasta + ] + try: + result1 = subprocess.run( + cmd1, + capture_output=True, + text=True, + check=False + ) + if result1.returncode != 0: + raise RuntimeError( + f"Index generation failed with exit code {result1.returncode}\n" + f"STDOUT: {result1.stdout}\n" + f"STDERR: {result1.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("segemehl.x executable not found in PATH") + + # Step 2: Align reads + cmd2 = [ + "segemehl.x", + "-i", index_file, + "-d", reference_fasta, + "-q", query_fasta, + "-o", output_sam, + "-t", "1", + "-A", "80" + ] + try: + result2 = subprocess.run( + cmd2, + capture_output=True, + text=True, + check=False + ) + if result2.returncode != 0: + raise RuntimeError( + f"Alignment failed with exit code {result2.returncode}\n" + f"STDOUT: {result2.stdout}\n" + f"STDERR: {result2.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("segemehl.x executable not found in PATH") + + # Verify output file was created + if not os.path.exists(output_sam): + raise RuntimeError(f"Output SAM file was not created: {output_sam}") + + # Return structured metadata + return { + "status": "success", + "index_file": index_file, + "output_sam": output_sam, + "reference_fasta": reference_fasta, + "query_fasta": query_fasta, + "index_generation": { + "command": cmd1, + "exit_code": result1.returncode, + "stdout": result1.stdout, + "stderr": result1.stderr + }, + "alignment": { + "command": cmd2, + "exit_code": result2.returncode, + "stdout": result2.stdout, + "stderr": result2.stderr + } + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/segemehl_index_and_align_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/segemehl_index_and_align_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..eac2375188806f96c11cab4dfbb62b727862bb8f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/segemehl_index_and_align_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "05a860f418f7f1d21c089ec598413c8a36314cc991d2cbc16f116f189e4bc2d0", + "elapsed_seconds": 4.342961311340332, + "usage": { + "prompt_tokens": 11459, + "completion_tokens": 748, + "total_tokens": 12207, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11459 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "c49018a3-4a1b-4d7c-9409-46a1c6b70832" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sentieon_index_reference_with_bwa_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sentieon_index_reference_with_bwa_test.py new file mode 100644 index 0000000000000000000000000000000000000000..0f9602aa835d8ce340db6f12137aabd921c81fec --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sentieon_index_reference_with_bwa_test.py @@ -0,0 +1,89 @@ +from mcp.server.fastmcp import FastMCP +import os +import shutil +import subprocess +import sys +from pathlib import Path + +mcp = FastMCP("sentieon") + + +@mcp.tool() +def index_reference_with_bwa( + input_fasta: str, + work_dir: str, + output_tsv: str, +) -> dict: + """ + Build all BWA index components for a pinned reference FASTA through the Sentieon command dispatcher. + + Args: + input_fasta: Path to the input reference FASTA file. + work_dir: Path to the staging directory where intermediate files will be created. + output_tsv: Path to the output TSV manifest file listing the generated index files. + """ + # Convert paths to Path objects for easier manipulation + input_fasta_path = Path(input_fasta) + work_dir_path = Path(work_dir) + output_tsv_path = Path(output_tsv) + + # Create output parent directories + work_dir_path.mkdir(parents=True, exist_ok=True) + output_tsv_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: stage_reference - copy the input FASTA to the work directory as reference.fa + staged_reference = work_dir_path / "reference.fa" + shutil.copy2(input_fasta_path, staged_reference) + + # Step 2: Run sentieon bwa index in the work directory + # The command is: sentieon bwa index reference.fa + # cwd is set to work_dir + cmd = ["sentieon", "bwa", "index", "reference.fa"] + try: + result = subprocess.run( + cmd, + cwd=str(work_dir_path), + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"Failed to execute sentieon: {e}") from e + + if result.returncode != 0: + raise RuntimeError( + f"sentieon bwa index failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Step 3: manifest_bwa_index - generate a TSV manifest of the index files + # The index files produced by bwa index are: + # reference.fa.amb, reference.fa.ann, reference.fa.bwt, reference.fa.pac, reference.fa.sa + # We list them in the manifest with their absolute paths. + index_suffixes = [".amb", ".ann", ".bwt", ".pac", ".sa"] + index_files = [] + for suffix in index_suffixes: + index_file = staged_reference.with_suffix(staged_reference.suffix + suffix) + if not index_file.exists(): + raise RuntimeError(f"Expected index file {index_file} was not created") + index_files.append(str(index_file)) + + # Write the manifest TSV: one column with the file paths + with open(output_tsv_path, "w") as f: + for file_path in index_files: + f.write(file_path + "\n") + + # Return structured JSON-serializable metadata + return { + "status": "success", + "staged_reference": str(staged_reference), + "index_files": index_files, + "manifest": str(output_tsv_path), + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sentieon_index_reference_with_bwa_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sentieon_index_reference_with_bwa_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..a1162b36b408b28965618bd65a0e37d615583dcb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sentieon_index_reference_with_bwa_test.py.raw.txt @@ -0,0 +1,91 @@ +```python +from mcp.server.fastmcp import FastMCP +import os +import shutil +import subprocess +import sys +from pathlib import Path + +mcp = FastMCP("sentieon") + + +@mcp.tool() +def index_reference_with_bwa( + input_fasta: str, + work_dir: str, + output_tsv: str, +) -> dict: + """ + Build all BWA index components for a pinned reference FASTA through the Sentieon command dispatcher. + + Args: + input_fasta: Path to the input reference FASTA file. + work_dir: Path to the staging directory where intermediate files will be created. + output_tsv: Path to the output TSV manifest file listing the generated index files. + """ + # Convert paths to Path objects for easier manipulation + input_fasta_path = Path(input_fasta) + work_dir_path = Path(work_dir) + output_tsv_path = Path(output_tsv) + + # Create output parent directories + work_dir_path.mkdir(parents=True, exist_ok=True) + output_tsv_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: stage_reference - copy the input FASTA to the work directory as reference.fa + staged_reference = work_dir_path / "reference.fa" + shutil.copy2(input_fasta_path, staged_reference) + + # Step 2: Run sentieon bwa index in the work directory + # The command is: sentieon bwa index reference.fa + # cwd is set to work_dir + cmd = ["sentieon", "bwa", "index", "reference.fa"] + try: + result = subprocess.run( + cmd, + cwd=str(work_dir_path), + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"Failed to execute sentieon: {e}") from e + + if result.returncode != 0: + raise RuntimeError( + f"sentieon bwa index failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Step 3: manifest_bwa_index - generate a TSV manifest of the index files + # The index files produced by bwa index are: + # reference.fa.amb, reference.fa.ann, reference.fa.bwt, reference.fa.pac, reference.fa.sa + # We list them in the manifest with their absolute paths. + index_suffixes = [".amb", ".ann", ".bwt", ".pac", ".sa"] + index_files = [] + for suffix in index_suffixes: + index_file = staged_reference.with_suffix(staged_reference.suffix + suffix) + if not index_file.exists(): + raise RuntimeError(f"Expected index file {index_file} was not created") + index_files.append(str(index_file)) + + # Write the manifest TSV: one column with the file paths + with open(output_tsv_path, "w") as f: + for file_path in index_files: + f.write(file_path + "\n") + + # Return structured JSON-serializable metadata + return { + "status": "success", + "staged_reference": str(staged_reference), + "index_files": index_files, + "manifest": str(output_tsv_path), + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sentieon_index_reference_with_bwa_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sentieon_index_reference_with_bwa_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..70cca36483e0a626556d6680382073db9af3cce4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sentieon_index_reference_with_bwa_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "2c648ff381a3d56c9cc80b2722e206d7e1eb52b0e23ffa6657929a3fcba83e01", + "elapsed_seconds": 5.302231788635254, + "usage": { + "prompt_tokens": 5504, + "completion_tokens": 792, + "total_tokens": 6296, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 5504 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "21f7e100-6c7b-4d58-b623-60eba12a1f9f" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/seqcluster_collapse_small_rna_reads_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/seqcluster_collapse_small_rna_reads_test.py new file mode 100644 index 0000000000000000000000000000000000000000..901ec2c625c6bfde950165a0521dc0970e6fd18c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/seqcluster_collapse_small_rna_reads_test.py @@ -0,0 +1,80 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("seqcluster") + +@mcp.tool() +def collapse_small_rna_reads(input_fastq: str, output_dir: str) -> dict: + """ + Collapse identical small-RNA FASTQ sequences and encode observed abundance in each output read identifier. + + Args: + input_fastq: Path to input FASTQ file + output_dir: Directory where output files will be written + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "seqcluster", + "collapse", + "--fastq", + input_fastq, + "--min", + "1", + "--min_size", + "10", + "--out", + output_dir + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "seqcluster executable not found in PATH", + "command": cmd + } + + # Check for non-zero exit + if result.returncode != 0: + return { + "success": False, + "error": f"seqcluster failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Collect output files that were generated + output_files = [] + if output_path.exists(): + for item in output_path.iterdir(): + if item.is_file(): + output_files.append(str(item)) + + return { + "success": True, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": output_dir, + "output_files": output_files + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/seqcluster_collapse_small_rna_reads_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/seqcluster_collapse_small_rna_reads_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..d2e1cd1d96c7bbd179333ff4759b307c0541a7c4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/seqcluster_collapse_small_rna_reads_test.py.raw.txt @@ -0,0 +1,82 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("seqcluster") + +@mcp.tool() +def collapse_small_rna_reads(input_fastq: str, output_dir: str) -> dict: + """ + Collapse identical small-RNA FASTQ sequences and encode observed abundance in each output read identifier. + + Args: + input_fastq: Path to input FASTQ file + output_dir: Directory where output files will be written + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "seqcluster", + "collapse", + "--fastq", + input_fastq, + "--min", + "1", + "--min_size", + "10", + "--out", + output_dir + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "seqcluster executable not found in PATH", + "command": cmd + } + + # Check for non-zero exit + if result.returncode != 0: + return { + "success": False, + "error": f"seqcluster failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Collect output files that were generated + output_files = [] + if output_path.exists(): + for item in output_path.iterdir(): + if item.is_file(): + output_files.append(str(item)) + + return { + "success": True, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": output_dir, + "output_files": output_files + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/seqcluster_collapse_small_rna_reads_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/seqcluster_collapse_small_rna_reads_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..0090c782f4aab455b525640b700d7e58ea771711 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/seqcluster_collapse_small_rna_reads_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "dccb227fde8d302805ac58a0d4b0118914ccf5cfe46ac9a4e0af69d72e28c85f", + "elapsed_seconds": 3.155949115753174, + "usage": { + "prompt_tokens": 5804, + "completion_tokens": 486, + "total_tokens": 6290, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 5804 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "5a8e1921-3652-49e0-aaf3-027246c629e0" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/slow5tools_signal_stats_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/slow5tools_signal_stats_test.py new file mode 100644 index 0000000000000000000000000000000000000000..031b38390bd6e3112a6a01023b40470217c122e9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/slow5tools_signal_stats_test.py @@ -0,0 +1,71 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("slow5tools-signal-stats") + +@mcp.tool() +def signal_stats(input_slow5: str, output_stats: str) -> dict: + """ + Compute statistics for a SLOW5/BLOW5 file and write them to the specified output path. + + Args: + input_slow5: Path to the input SLOW5/BLOW5 file. + output_stats: Path where the statistics output will be written. + + Returns: + JSON-serializable metadata about the execution. + """ + # Validate input path + input_path = Path(input_slow5) + if not input_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_slow5}") + + # Create output parent directories if needed + output_path = Path(output_stats) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = ["slow5tools", "stats", str(input_path)] + + try: + # Execute command, capture stdout and stderr + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"slow5tools stats failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Write stdout to output file + with open(output_path, "w") as f: + f.write(result.stdout) + + # Return metadata + return { + "status": "success", + "input_file": str(input_path), + "output_file": str(output_path), + "exit_code": result.returncode, + "stdout_bytes": len(result.stdout.encode()), + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("slow5tools executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing slow5tools stats: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/slow5tools_signal_stats_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/slow5tools_signal_stats_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..323d5fe3a6044d317b669ec20365dad7f592c9e1 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/slow5tools_signal_stats_test.py.raw.txt @@ -0,0 +1,73 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("slow5tools-signal-stats") + +@mcp.tool() +def signal_stats(input_slow5: str, output_stats: str) -> dict: + """ + Compute statistics for a SLOW5/BLOW5 file and write them to the specified output path. + + Args: + input_slow5: Path to the input SLOW5/BLOW5 file. + output_stats: Path where the statistics output will be written. + + Returns: + JSON-serializable metadata about the execution. + """ + # Validate input path + input_path = Path(input_slow5) + if not input_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_slow5}") + + # Create output parent directories if needed + output_path = Path(output_stats) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = ["slow5tools", "stats", str(input_path)] + + try: + # Execute command, capture stdout and stderr + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"slow5tools stats failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Write stdout to output file + with open(output_path, "w") as f: + f.write(result.stdout) + + # Return metadata + return { + "status": "success", + "input_file": str(input_path), + "output_file": str(output_path), + "exit_code": result.returncode, + "stdout_bytes": len(result.stdout.encode()), + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("slow5tools executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing slow5tools stats: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/slow5tools_signal_stats_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/slow5tools_signal_stats_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..73a13d471f740220e632191f85f5918d9e2043a0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/slow5tools_signal_stats_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "e1e9739c4f7adb6f258808fadbeed56da5365dc4646c08b2857b2a0bd98b634b", + "elapsed_seconds": 3.2668063640594482, + "usage": { + "prompt_tokens": 753, + "completion_tokens": 502, + "total_tokens": 1255, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 753 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "a68a333f-ef7e-446d-9bd3-937b77084a8a" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sourmash_compute_signature_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sourmash_compute_signature_test.py new file mode 100644 index 0000000000000000000000000000000000000000..7ba921b7e719302eb74ef4b13dfa859e97ef3462 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sourmash_compute_signature_test.py @@ -0,0 +1,81 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("sourmash") + + +@mcp.tool() +def compute_signature(input_fasta: str, output_signature: str) -> dict: + """ + Compute a sourmash signature from a FASTA file. + + Args: + input_fasta: Path to the input FASTA file. + output_signature: Path where the output signature file will be written. + """ + # Create output parent directories + output_dir = os.path.dirname(os.path.abspath(output_signature)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command + cmd = [ + "sourmash", + "compute", + "-k", + "5", + "--scaled", + "1", + "-o", + output_signature, + input_fasta, + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd, + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + # Verify output file was created + if not os.path.exists(output_signature): + return { + "success": False, + "error": "Output file was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + return { + "success": True, + "output_signature": output_signature, + "input_fasta": input_fasta, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sourmash_compute_signature_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sourmash_compute_signature_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..a66df9589f9276ff1ce9348d6b485de61d38cfda --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sourmash_compute_signature_test.py.raw.txt @@ -0,0 +1,83 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("sourmash") + + +@mcp.tool() +def compute_signature(input_fasta: str, output_signature: str) -> dict: + """ + Compute a sourmash signature from a FASTA file. + + Args: + input_fasta: Path to the input FASTA file. + output_signature: Path where the output signature file will be written. + """ + # Create output parent directories + output_dir = os.path.dirname(os.path.abspath(output_signature)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command + cmd = [ + "sourmash", + "compute", + "-k", + "5", + "--scaled", + "1", + "-o", + output_signature, + input_fasta, + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd, + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + # Verify output file was created + if not os.path.exists(output_signature): + return { + "success": False, + "error": "Output file was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + return { + "success": True, + "output_signature": output_signature, + "input_fasta": input_fasta, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sourmash_compute_signature_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sourmash_compute_signature_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..e0f248928fabd1d82540d6bd1f7d43065fb6852b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/sourmash_compute_signature_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "d5da6ff3f18a9cedf8c1b9eebf485ef2a709e27c169c978f9eac5fa367f421f6", + "elapsed_seconds": 8.328354120254517, + "usage": { + "prompt_tokens": 10745, + "completion_tokens": 472, + "total_tokens": 11217, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10745 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "e60f74fb-8ff3-41f7-a632-2193932e89a0" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/spades_assemble_paired_reads_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/spades_assemble_paired_reads_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2e2805f7dc9cfa051cf2ab87c7c25c748bb24da3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/spades_assemble_paired_reads_test.py @@ -0,0 +1,89 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("spades") + + +@mcp.tool() +def assemble_paired_reads(reads_r1: str, reads_r2: str, output_dir: str) -> dict: + """ + Assemble paired-end reads using SPAdes assembler. + + Args: + reads_r1: Path to the first read file (forward reads). + reads_r2: Path to the second read file (reverse reads). + output_dir: Directory where assembly results will be written. + + Returns: + A JSON-serializable dictionary with metadata about the assembly run. + """ + # Create output directory if it doesn't exist + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "spades.py", + "--only-assembler", + "-1", + reads_r1, + "-2", + reads_r2, + "-o", + output_dir, + "-t", + "1", + "-m", + "1", + "-k", + "21" + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"spades.py executable not found: {e}", + "command": cmd + } + + # Check for non-zero exit code + if result.returncode != 0: + return { + "success": False, + "error": f"SPAdes failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": output_dir, + "reads_r1": reads_r1, + "reads_r2": reads_r2, + "parameters": { + "only_assembler": True, + "threads": 1, + "memory_gb": 1, + "kmer": 21 + } + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/spades_assemble_paired_reads_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/spades_assemble_paired_reads_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..974c219edc0af0468c7c8f8d54a0365c79c323d8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/spades_assemble_paired_reads_test.py.raw.txt @@ -0,0 +1,91 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("spades") + + +@mcp.tool() +def assemble_paired_reads(reads_r1: str, reads_r2: str, output_dir: str) -> dict: + """ + Assemble paired-end reads using SPAdes assembler. + + Args: + reads_r1: Path to the first read file (forward reads). + reads_r2: Path to the second read file (reverse reads). + output_dir: Directory where assembly results will be written. + + Returns: + A JSON-serializable dictionary with metadata about the assembly run. + """ + # Create output directory if it doesn't exist + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "spades.py", + "--only-assembler", + "-1", + reads_r1, + "-2", + reads_r2, + "-o", + output_dir, + "-t", + "1", + "-m", + "1", + "-k", + "21" + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"spades.py executable not found: {e}", + "command": cmd + } + + # Check for non-zero exit code + if result.returncode != 0: + return { + "success": False, + "error": f"SPAdes failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": output_dir, + "reads_r1": reads_r1, + "reads_r2": reads_r2, + "parameters": { + "only_assembler": True, + "threads": 1, + "memory_gb": 1, + "kmer": 21 + } + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/spades_assemble_paired_reads_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/spades_assemble_paired_reads_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..748c6b0b401e2ffbc29ac4030e228018cb2425e6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/spades_assemble_paired_reads_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "06b0f64757ecef595db3ab386dbd2029a6dba239ad78c9c5ae4a88c2279d2c76", + "elapsed_seconds": 3.0957047939300537, + "usage": { + "prompt_tokens": 9913, + "completion_tokens": 541, + "total_tokens": 10454, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9913 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "6efb1347-46f3-440a-89c2-0abdbb036a2d" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/stringtie_assemble_transcripts_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/stringtie_assemble_transcripts_test.py new file mode 100644 index 0000000000000000000000000000000000000000..489574657e49ea45f89e1a6b25c8d3e4dfb506c5 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/stringtie_assemble_transcripts_test.py @@ -0,0 +1,85 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("stringtie-assemble-transcripts") + +@mcp.tool() +def assemble_transcripts(input_bam: str, output_gtf: str) -> dict: + """ + Assemble RNA-Seq alignments into potential transcripts using StringTie. + + Args: + input_bam: Path to input BAM file + output_gtf: Path to output GTF file + + Returns: + Dictionary with execution metadata + """ + # Validate input file exists + if not os.path.isfile(input_bam): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + # Create output parent directory if needed + output_path = Path(output_gtf) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "stringtie", + input_bam, + "-o", + output_gtf, + "-p", + "1", + "-m", + "30", + "-s", + "1", + "-c", + "1" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("stringtie executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute stringtie: {str(e)}") + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError(f"stringtie failed with exit code {result.returncode}: {error_msg}") + + # Verify output file was created + if not os.path.isfile(output_gtf): + raise RuntimeError(f"Output GTF file was not created: {output_gtf}") + + # Return structured metadata + return { + "endpoint": "assemble_transcripts", + "tool": "stringtie", + "version": "3.0.3", + "input_bam": input_bam, + "output_gtf": output_gtf, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + "output_exists": True, + "output_size_bytes": os.path.getsize(output_gtf) + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/stringtie_assemble_transcripts_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/stringtie_assemble_transcripts_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..4712232cd13ffc1106f34ba9b06d768d821beff0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/stringtie_assemble_transcripts_test.py.raw.txt @@ -0,0 +1,87 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("stringtie-assemble-transcripts") + +@mcp.tool() +def assemble_transcripts(input_bam: str, output_gtf: str) -> dict: + """ + Assemble RNA-Seq alignments into potential transcripts using StringTie. + + Args: + input_bam: Path to input BAM file + output_gtf: Path to output GTF file + + Returns: + Dictionary with execution metadata + """ + # Validate input file exists + if not os.path.isfile(input_bam): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + # Create output parent directory if needed + output_path = Path(output_gtf) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "stringtie", + input_bam, + "-o", + output_gtf, + "-p", + "1", + "-m", + "30", + "-s", + "1", + "-c", + "1" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("stringtie executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute stringtie: {str(e)}") + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError(f"stringtie failed with exit code {result.returncode}: {error_msg}") + + # Verify output file was created + if not os.path.isfile(output_gtf): + raise RuntimeError(f"Output GTF file was not created: {output_gtf}") + + # Return structured metadata + return { + "endpoint": "assemble_transcripts", + "tool": "stringtie", + "version": "3.0.3", + "input_bam": input_bam, + "output_gtf": output_gtf, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + "output_exists": True, + "output_size_bytes": os.path.getsize(output_gtf) + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/stringtie_assemble_transcripts_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/stringtie_assemble_transcripts_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..c02cf123285f2f59eca0c438567c956431815c2a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/stringtie_assemble_transcripts_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "de8650047a17077b5a0590f2c4b464816ef050e440884b948fd16f0ae84c6e65", + "elapsed_seconds": 3.6781747341156006, + "usage": { + "prompt_tokens": 1546, + "completion_tokens": 593, + "total_tokens": 2139, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1546 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "c0592f54-2436-40b0-b5e1-ad9bb29128ca" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/subread_count_features_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/subread_count_features_test.py new file mode 100644 index 0000000000000000000000000000000000000000..4580ee55163284b4f70c4f994dead248079bf3b6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/subread_count_features_test.py @@ -0,0 +1,61 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("subread") + + +@mcp.tool() +def count_features( + annotation_gtf: str, + input_bam: str, + output_counts: str, +) -> dict: + """ + Count paired fragments with one thread using featureCounts from the subread package. + + Args: + annotation_gtf: Path to the annotation file in GTF format. + input_bam: Path to the input BAM file. + output_counts: Path where the output counts file will be written. + """ + # Create output parent directories + output_path = Path(output_counts) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "featureCounts", + "-T", + "1", + "-p", + "--countReadPairs", + "-a", + annotation_gtf, + "-o", + output_counts, + input_bam, + ] + + # Run the command without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"featureCounts failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured JSON-serializable metadata + return { + "endpoint": "count_features", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_counts": output_counts, + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/subread_count_features_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/subread_count_features_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..0dc2f94a3e4cd771e69fe3b4d9cb6791b68f7dfc --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/subread_count_features_test.py.raw.txt @@ -0,0 +1,63 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("subread") + + +@mcp.tool() +def count_features( + annotation_gtf: str, + input_bam: str, + output_counts: str, +) -> dict: + """ + Count paired fragments with one thread using featureCounts from the subread package. + + Args: + annotation_gtf: Path to the annotation file in GTF format. + input_bam: Path to the input BAM file. + output_counts: Path where the output counts file will be written. + """ + # Create output parent directories + output_path = Path(output_counts) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "featureCounts", + "-T", + "1", + "-p", + "--countReadPairs", + "-a", + annotation_gtf, + "-o", + output_counts, + input_bam, + ] + + # Run the command without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"featureCounts failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured JSON-serializable metadata + return { + "endpoint": "count_features", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_counts": output_counts, + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/subread_count_features_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/subread_count_features_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..b4da43bf6e75ced959be03e571a83e073c1a6fc4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/subread_count_features_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "8dbf3f63a7056917d961c39302d96ef3c115918e217288fde8757e28b22422cc", + "elapsed_seconds": 3.2347118854522705, + "usage": { + "prompt_tokens": 24655, + "completion_tokens": 397, + "total_tokens": 25052, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 24655 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "3a49c311-9004-4af4-8448-2386a9335756" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tabixpp_query_vcf_region_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tabixpp_query_vcf_region_test.py new file mode 100644 index 0000000000000000000000000000000000000000..3eb4d90b58470cb0777b772297ea8129d039658f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tabixpp_query_vcf_region_test.py @@ -0,0 +1,67 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("tabixpp") + +@mcp.tool() +def query_vcf_region(input_vcf: str, output_records: str) -> dict: + """ + Query the fixed region chrTiny:1-40 from a tabix-indexed VCF file and capture record lines. + + Args: + input_vcf: Path to the tabix-indexed VCF file + output_records: Path where the query results (record lines) will be written + """ + # Create output parent directories + output_path = Path(output_records) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command: tabix++ {input_vcf} chrTiny:1-40 + cmd = [ + "tabix++", + input_vcf, + "chrTiny:1-40" + ] + + # Execute the command, capturing stdout + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "tabix++ executable not found. Ensure tabixpp is installed and in PATH." + } + + # Check for non-zero exit + if result.returncode != 0: + return { + "success": False, + "error": f"tabix++ failed with exit code {result.returncode}", + "stderr": result.stderr + } + + # Write stdout to the output_records path + try: + with open(output_path, 'w') as f: + f.write(result.stdout) + except OSError as e: + return { + "success": False, + "error": f"Failed to write output file: {str(e)}" + } + + # Return structured JSON-serializable metadata + return { + "success": True, + "output_records": str(output_path), + "record_count": len(result.stdout.splitlines()) if result.stdout.strip() else 0, + "exit_code": result.returncode + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tabixpp_query_vcf_region_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tabixpp_query_vcf_region_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..ec0d045a6c91edccd5629ce144be84db112caee2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tabixpp_query_vcf_region_test.py.raw.txt @@ -0,0 +1,69 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("tabixpp") + +@mcp.tool() +def query_vcf_region(input_vcf: str, output_records: str) -> dict: + """ + Query the fixed region chrTiny:1-40 from a tabix-indexed VCF file and capture record lines. + + Args: + input_vcf: Path to the tabix-indexed VCF file + output_records: Path where the query results (record lines) will be written + """ + # Create output parent directories + output_path = Path(output_records) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command: tabix++ {input_vcf} chrTiny:1-40 + cmd = [ + "tabix++", + input_vcf, + "chrTiny:1-40" + ] + + # Execute the command, capturing stdout + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "tabix++ executable not found. Ensure tabixpp is installed and in PATH." + } + + # Check for non-zero exit + if result.returncode != 0: + return { + "success": False, + "error": f"tabix++ failed with exit code {result.returncode}", + "stderr": result.stderr + } + + # Write stdout to the output_records path + try: + with open(output_path, 'w') as f: + f.write(result.stdout) + except OSError as e: + return { + "success": False, + "error": f"Failed to write output file: {str(e)}" + } + + # Return structured JSON-serializable metadata + return { + "success": True, + "output_records": str(output_path), + "record_count": len(result.stdout.splitlines()) if result.stdout.strip() else 0, + "exit_code": result.returncode + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tabixpp_query_vcf_region_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tabixpp_query_vcf_region_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..7e839ffd97540917510bb6053b6513f5320bcecb --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tabixpp_query_vcf_region_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "b121e5f93fbe106db1878f2a248c25f469561b6f1bad9c9ff1d6bcc5fab55603", + "elapsed_seconds": 4.102203130722046, + "usage": { + "prompt_tokens": 7724, + "completion_tokens": 488, + "total_tokens": 8212, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 7724 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "3068ae62-4767-4fad-9e8d-335298788b73" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/taxonkit_create_taxdump_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/taxonkit_create_taxdump_test.py new file mode 100644 index 0000000000000000000000000000000000000000..89c519d250b002688a78f9f05bf080cfd7fd5495 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/taxonkit_create_taxdump_test.py @@ -0,0 +1,84 @@ +import json +import os +import subprocess +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("taxonkit") + +@mcp.tool() +def create_taxdump(taxonomy_tsv: str, output_dir: str) -> dict: + """ + Create NCBI-style taxdump files for custom taxonomy from a TSV file. + + Args: + taxonomy_tsv: Path to the input taxonomy TSV file (positional argument) + output_dir: Directory where taxdump files will be written (-O option) + + Returns: + JSON-serializable metadata about the execution + """ + # Validate input file exists + tsv_path = Path(taxonomy_tsv) + if not tsv_path.is_file(): + raise FileNotFoundError(f"Input taxonomy TSV file not found: {taxonomy_tsv}") + + # Create output directory (including parents) if it doesn't exist + out_path = Path(output_dir) + out_path.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "taxonkit", + "create-taxdump", + "-A", "4", + "-O", str(out_path), + "--force", + str(tsv_path) + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError( + "Native executable 'taxonkit' not found. " + "Please ensure it is installed and available in PATH." + ) + + # Check for non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError( + f"taxonkit create-taxdump failed with exit code {result.returncode}: {error_msg}" + ) + + # Collect output files created in the output directory + output_files = [] + if out_path.is_dir(): + for item in sorted(out_path.iterdir()): + if item.is_file(): + output_files.append(item.name) + + # Return structured metadata + return { + "endpoint": "create_taxdump", + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": str(out_path), + "output_files": output_files, + "input_file": str(tsv_path), + "accession_field": 4, + "force": True + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/taxonkit_create_taxdump_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/taxonkit_create_taxdump_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..99bb082321ff06254d8c8a034c8ebbbbd75d631c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/taxonkit_create_taxdump_test.py.raw.txt @@ -0,0 +1,86 @@ +```python +import json +import os +import subprocess +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("taxonkit") + +@mcp.tool() +def create_taxdump(taxonomy_tsv: str, output_dir: str) -> dict: + """ + Create NCBI-style taxdump files for custom taxonomy from a TSV file. + + Args: + taxonomy_tsv: Path to the input taxonomy TSV file (positional argument) + output_dir: Directory where taxdump files will be written (-O option) + + Returns: + JSON-serializable metadata about the execution + """ + # Validate input file exists + tsv_path = Path(taxonomy_tsv) + if not tsv_path.is_file(): + raise FileNotFoundError(f"Input taxonomy TSV file not found: {taxonomy_tsv}") + + # Create output directory (including parents) if it doesn't exist + out_path = Path(output_dir) + out_path.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "taxonkit", + "create-taxdump", + "-A", "4", + "-O", str(out_path), + "--force", + str(tsv_path) + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError( + "Native executable 'taxonkit' not found. " + "Please ensure it is installed and available in PATH." + ) + + # Check for non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError( + f"taxonkit create-taxdump failed with exit code {result.returncode}: {error_msg}" + ) + + # Collect output files created in the output directory + output_files = [] + if out_path.is_dir(): + for item in sorted(out_path.iterdir()): + if item.is_file(): + output_files.append(item.name) + + # Return structured metadata + return { + "endpoint": "create_taxdump", + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": str(out_path), + "output_files": output_files, + "input_file": str(tsv_path), + "accession_field": 4, + "force": True + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/taxonkit_create_taxdump_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/taxonkit_create_taxdump_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..d746b94bb8fc264038f86fcc8ac09ad68d684e51 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/taxonkit_create_taxdump_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "8ba44c50210f5deda281fcff5303e5e41c4a9d107cb3a42fac65aa11d2b4a82f", + "elapsed_seconds": 3.5593600273132324, + "usage": { + "prompt_tokens": 1078, + "completion_tokens": 594, + "total_tokens": 1672, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1078 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "a5eda04a-83cd-417d-b4ca-454f30b7d5e2" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tidyp_tidy_html_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tidyp_tidy_html_test.py new file mode 100644 index 0000000000000000000000000000000000000000..545e6a3f8e555a24250ed31a2f052254ce751909 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tidyp_tidy_html_test.py @@ -0,0 +1,79 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("tidyp") + +@mcp.tool() +def tidy_html(input_html: str, output_html: str) -> dict: + """ + Tidy an HTML file using tidyp v1.04 with quiet UTF-8 output. + + Args: + input_html: Path to the input HTML file. + output_html: Path where the tidied HTML output will be written. + + Returns: + A JSON-serializable dictionary with metadata about the operation. + """ + # Resolve paths + input_path = Path(input_html) + output_path = Path(output_html) + + # Validate input exists + if not input_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_path}") + + # Create output parent directories + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "tidyp", + "-quiet", + "-utf8", + "-o", + str(output_path), + str(input_path) + ] + + # Execute without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("tidyp executable not found in PATH") + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"tidyp failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output was created + if not output_path.exists(): + raise RuntimeError(f"tidyp did not produce output file: {output_path}") + + # Return structured metadata + return { + "endpoint": "tidy_html", + "input_html": str(input_path), + "output_html": str(output_path), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": output_path.stat().st_size, + "status": "success" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tidyp_tidy_html_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tidyp_tidy_html_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..999a1e66923cf42855855b6e071bd61813736a09 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tidyp_tidy_html_test.py.raw.txt @@ -0,0 +1,81 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("tidyp") + +@mcp.tool() +def tidy_html(input_html: str, output_html: str) -> dict: + """ + Tidy an HTML file using tidyp v1.04 with quiet UTF-8 output. + + Args: + input_html: Path to the input HTML file. + output_html: Path where the tidied HTML output will be written. + + Returns: + A JSON-serializable dictionary with metadata about the operation. + """ + # Resolve paths + input_path = Path(input_html) + output_path = Path(output_html) + + # Validate input exists + if not input_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_path}") + + # Create output parent directories + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "tidyp", + "-quiet", + "-utf8", + "-o", + str(output_path), + str(input_path) + ] + + # Execute without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("tidyp executable not found in PATH") + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"tidyp failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output was created + if not output_path.exists(): + raise RuntimeError(f"tidyp did not produce output file: {output_path}") + + # Return structured metadata + return { + "endpoint": "tidy_html", + "input_html": str(input_path), + "output_html": str(output_path), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": output_path.stat().st_size, + "status": "success" + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tidyp_tidy_html_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tidyp_tidy_html_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..b391fabcfb2260dc2e7818a62c994973f89cc845 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tidyp_tidy_html_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "b9445119e4d450bf62c8c05b6b97225ffa1b5e814468d5171f8bc44f166bbc48", + "elapsed_seconds": 3.8693771362304688, + "usage": { + "prompt_tokens": 678, + "completion_tokens": 512, + "total_tokens": 1190, + "prompt_tokens_details": { + "cached_tokens": 640 + }, + "prompt_cache_hit_tokens": 640, + "prompt_cache_miss_tokens": 38 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "a15d5b83-292a-41b1-bf5a-ace3998fb790" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tmalign_align_structures_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tmalign_align_structures_test.py new file mode 100644 index 0000000000000000000000000000000000000000..952d6127e5d2987c07058e2dbb92a95b61a413a6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tmalign_align_structures_test.py @@ -0,0 +1,73 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("tmalign") + + +@mcp.tool() +def align_structures( + structure_a: str, + structure_b: str, + output_table: str, +) -> dict: + """ + Align two protein structures using TM-align and return the alignment results. + + Args: + structure_a: Path to the first structure file (PDB or mmCIF format). + structure_b: Path to the second structure file (PDB or mmCIF format). + output_table: Path where the machine-readable alignment output will be written. + + Returns: + A dictionary containing the output file path and metadata about the execution. + """ + # Resolve paths + structure_a_path = Path(structure_a) + structure_b_path = Path(structure_b) + output_table_path = Path(output_table) + + # Create output parent directory if it doesn't exist + output_table_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "TMalign", + str(structure_a_path), + str(structure_b_path), + "-outfmt", + "2", + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"TMalign executable not found: {e}") + + # Check for non-zero exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr.strip() else result.stdout.strip() + raise RuntimeError( + f"TMalign failed with exit code {result.returncode}: {error_msg}" + ) + + # Write stdout to the output file + with open(output_table_path, "w") as f: + f.write(result.stdout) + + # Return structured metadata + return { + "output_table": str(output_table_path), + "exit_code": result.returncode, + "stdout_length": len(result.stdout), + "stderr_length": len(result.stderr), + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tmalign_align_structures_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tmalign_align_structures_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..df703f6ddf81d0bf17dd050970aad53d39fe845b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tmalign_align_structures_test.py.raw.txt @@ -0,0 +1,75 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("tmalign") + + +@mcp.tool() +def align_structures( + structure_a: str, + structure_b: str, + output_table: str, +) -> dict: + """ + Align two protein structures using TM-align and return the alignment results. + + Args: + structure_a: Path to the first structure file (PDB or mmCIF format). + structure_b: Path to the second structure file (PDB or mmCIF format). + output_table: Path where the machine-readable alignment output will be written. + + Returns: + A dictionary containing the output file path and metadata about the execution. + """ + # Resolve paths + structure_a_path = Path(structure_a) + structure_b_path = Path(structure_b) + output_table_path = Path(output_table) + + # Create output parent directory if it doesn't exist + output_table_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "TMalign", + str(structure_a_path), + str(structure_b_path), + "-outfmt", + "2", + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"TMalign executable not found: {e}") + + # Check for non-zero exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr.strip() else result.stdout.strip() + raise RuntimeError( + f"TMalign failed with exit code {result.returncode}: {error_msg}" + ) + + # Write stdout to the output file + with open(output_table_path, "w") as f: + f.write(result.stdout) + + # Return structured metadata + return { + "output_table": str(output_table_path), + "exit_code": result.returncode, + "stdout_length": len(result.stdout), + "stderr_length": len(result.stderr), + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tmalign_align_structures_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tmalign_align_structures_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..87eb09926ac39b027b02a35d6bc6106bfcd12155 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/tmalign_align_structures_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "a4536ad46a14941c379be6f42d390f9421f794645ecb52b70ab20cd9b0404304", + "elapsed_seconds": 3.595705032348633, + "usage": { + "prompt_tokens": 10159, + "completion_tokens": 483, + "total_tokens": 10642, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10159 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "9611cfd7-f44b-4f76-9629-0b6a235cbd51" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/treetime_ancestral_reconstruction_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/treetime_ancestral_reconstruction_test.py new file mode 100644 index 0000000000000000000000000000000000000000..e965925411ea49dc07e2d7bb5412721d8d03b3e8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/treetime_ancestral_reconstruction_test.py @@ -0,0 +1,86 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import shutil +import json +from pathlib import Path + +mcp = FastMCP("treetime") + +@mcp.tool() +def ancestral_reconstruction( + alignment_fasta: str, + input_tree: str, + output_dir: str +) -> dict: + """ + Reconstruct ancestral sequences using TreeTime with the JC69 model. + + Args: + alignment_fasta: Path to the input alignment file in FASTA format + input_tree: Path to the input phylogenetic tree in Newick format + output_dir: Directory where output files will be written + + Returns: + Dictionary containing output file paths and metadata + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Copy input files to working directory with deterministic names + aln_dest = output_path / "alignment.fa" + tree_dest = output_path / "tree.nwk" + + shutil.copy2(alignment_fasta, aln_dest) + shutil.copy2(input_tree, tree_dest) + + # Build command + cmd = [ + "ancestral_reconstruction.py", + "--aln", + "alignment.fa", + "--tree", + "tree.nwk", + "--gtr", + "JC69", + "--verbose", + "0" + ] + + # Run the command + try: + result = subprocess.run( + cmd, + cwd=str(output_path), + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"ancestral_reconstruction.py failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + except FileNotFoundError: + raise RuntimeError("ancestral_reconstruction.py executable not found in PATH") + + # Collect output files + output_files = {} + for f in output_path.iterdir(): + if f.is_file() and f.name not in ["alignment.fa", "tree.nwk"]: + output_files[f.name] = str(f) + + return { + "status": "success", + "output_dir": str(output_path), + "output_files": output_files, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/treetime_ancestral_reconstruction_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/treetime_ancestral_reconstruction_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..79a04f91453a8566bcdd9f01f8f531b24ac3a2fd --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/treetime_ancestral_reconstruction_test.py.raw.txt @@ -0,0 +1,88 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import shutil +import json +from pathlib import Path + +mcp = FastMCP("treetime") + +@mcp.tool() +def ancestral_reconstruction( + alignment_fasta: str, + input_tree: str, + output_dir: str +) -> dict: + """ + Reconstruct ancestral sequences using TreeTime with the JC69 model. + + Args: + alignment_fasta: Path to the input alignment file in FASTA format + input_tree: Path to the input phylogenetic tree in Newick format + output_dir: Directory where output files will be written + + Returns: + Dictionary containing output file paths and metadata + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Copy input files to working directory with deterministic names + aln_dest = output_path / "alignment.fa" + tree_dest = output_path / "tree.nwk" + + shutil.copy2(alignment_fasta, aln_dest) + shutil.copy2(input_tree, tree_dest) + + # Build command + cmd = [ + "ancestral_reconstruction.py", + "--aln", + "alignment.fa", + "--tree", + "tree.nwk", + "--gtr", + "JC69", + "--verbose", + "0" + ] + + # Run the command + try: + result = subprocess.run( + cmd, + cwd=str(output_path), + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"ancestral_reconstruction.py failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + except FileNotFoundError: + raise RuntimeError("ancestral_reconstruction.py executable not found in PATH") + + # Collect output files + output_files = {} + for f in output_path.iterdir(): + if f.is_file() and f.name not in ["alignment.fa", "tree.nwk"]: + output_files[f.name] = str(f) + + return { + "status": "success", + "output_dir": str(output_path), + "output_files": output_files, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/treetime_ancestral_reconstruction_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/treetime_ancestral_reconstruction_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..7010934832f7e8f7668eb923197166dd6ecc1fd9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/treetime_ancestral_reconstruction_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "0b691af43ce1007f1cb8396ab93c0943f7f822fc6723993f5c5b1531ec483636", + "elapsed_seconds": 5.324185371398926, + "usage": { + "prompt_tokens": 11690, + "completion_tokens": 561, + "total_tokens": 12251, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11690 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "7556eb95-9ca2-47e2-b035-bc3663f57034" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trim-galore_trim_adapters_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trim-galore_trim_adapters_test.py new file mode 100644 index 0000000000000000000000000000000000000000..87947544b6642184d2d376446906de3acf80ce88 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trim-galore_trim_adapters_test.py @@ -0,0 +1,89 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("trim-galore") + +@mcp.tool() +def trim_adapters(input_fastq: str, output_dir: str) -> dict: + """ + Trim adapters from a FASTQ file using trim_galore with fixed parameters. + + Args: + input_fastq: Path to input FASTQ file + output_dir: Directory to write output files + + Returns: + Dictionary with output file paths and metadata + """ + # Create output directory if it doesn't exist + output_dir_path = Path(output_dir) + output_dir_path.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "trim_galore", + "-a", "ACGTTGCA", + "-q", "0", + "--length", "1", + "--cores", "1", + "--basename", "trimmed", + "--output_dir", str(output_dir_path), + str(input_fastq) + ] + + # Execute command + result = subprocess.run(cmd, capture_output=True, text=True) + + if result.returncode != 0: + raise RuntimeError(f"trim_galore failed with exit code {result.returncode}: {result.stderr}") + + # Determine output file paths based on input filename + input_path = Path(input_fastq) + input_stem = input_path.stem + if input_stem.endswith(".fastq"): + input_stem = input_stem[:-6] + elif input_stem.endswith(".fq"): + input_stem = input_stem[:-3] + + # trim_galore with --basename produces trimmed_trimmed.fq.gz or similar + # Check for common output patterns + output_candidates = [ + output_dir_path / f"trimmed_trimmed.fq.gz", + output_dir_path / f"trimmed_trimmed.fastq.gz", + output_dir_path / f"trimmed_{input_stem}_trimmed.fq.gz", + output_dir_path / f"trimmed_{input_stem}_trimmed.fastq.gz", + ] + + output_file = None + for candidate in output_candidates: + if candidate.exists(): + output_file = str(candidate) + break + + if output_file is None: + # Try to find any .fq.gz or .fastq.gz file in output dir + for ext in ["*.fq.gz", "*.fastq.gz"]: + matches = list(output_dir_path.glob(ext)) + if matches: + output_file = str(matches[0]) + break + + if output_file is None: + raise RuntimeError("Could not determine output file from trim_galore execution") + + # Return structured metadata + return { + "output_file": output_file, + "output_dir": str(output_dir_path), + "input_file": str(input_fastq), + "adapter": "ACGTTGCA", + "quality_threshold": 0, + "min_length": 1, + "cores": 1, + "basename": "trimmed", + "stdout": result.stdout, + "stderr": result.stderr + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trim-galore_trim_adapters_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trim-galore_trim_adapters_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..837b1fc4b444d31e69169f444465f416625a3b0f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trim-galore_trim_adapters_test.py.raw.txt @@ -0,0 +1,91 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("trim-galore") + +@mcp.tool() +def trim_adapters(input_fastq: str, output_dir: str) -> dict: + """ + Trim adapters from a FASTQ file using trim_galore with fixed parameters. + + Args: + input_fastq: Path to input FASTQ file + output_dir: Directory to write output files + + Returns: + Dictionary with output file paths and metadata + """ + # Create output directory if it doesn't exist + output_dir_path = Path(output_dir) + output_dir_path.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "trim_galore", + "-a", "ACGTTGCA", + "-q", "0", + "--length", "1", + "--cores", "1", + "--basename", "trimmed", + "--output_dir", str(output_dir_path), + str(input_fastq) + ] + + # Execute command + result = subprocess.run(cmd, capture_output=True, text=True) + + if result.returncode != 0: + raise RuntimeError(f"trim_galore failed with exit code {result.returncode}: {result.stderr}") + + # Determine output file paths based on input filename + input_path = Path(input_fastq) + input_stem = input_path.stem + if input_stem.endswith(".fastq"): + input_stem = input_stem[:-6] + elif input_stem.endswith(".fq"): + input_stem = input_stem[:-3] + + # trim_galore with --basename produces trimmed_trimmed.fq.gz or similar + # Check for common output patterns + output_candidates = [ + output_dir_path / f"trimmed_trimmed.fq.gz", + output_dir_path / f"trimmed_trimmed.fastq.gz", + output_dir_path / f"trimmed_{input_stem}_trimmed.fq.gz", + output_dir_path / f"trimmed_{input_stem}_trimmed.fastq.gz", + ] + + output_file = None + for candidate in output_candidates: + if candidate.exists(): + output_file = str(candidate) + break + + if output_file is None: + # Try to find any .fq.gz or .fastq.gz file in output dir + for ext in ["*.fq.gz", "*.fastq.gz"]: + matches = list(output_dir_path.glob(ext)) + if matches: + output_file = str(matches[0]) + break + + if output_file is None: + raise RuntimeError("Could not determine output file from trim_galore execution") + + # Return structured metadata + return { + "output_file": output_file, + "output_dir": str(output_dir_path), + "input_file": str(input_fastq), + "adapter": "ACGTTGCA", + "quality_threshold": 0, + "min_length": 1, + "cores": 1, + "basename": "trimmed", + "stdout": result.stdout, + "stderr": result.stderr + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trim-galore_trim_adapters_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trim-galore_trim_adapters_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..822bd3c76a7e6c2e4aecfb60092f961d32d4e591 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trim-galore_trim_adapters_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "dfffac9d79b9ce1e99dbb52d8f3efff7f1a5773ef24bc301e1c5dac23459e1fe", + "elapsed_seconds": 4.977750062942505, + "usage": { + "prompt_tokens": 8023, + "completion_tokens": 719, + "total_tokens": 8742, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 8023 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "b40f6f34-b66b-4b60-bf53-a039e4d7520a" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trimadap_trim_adapter_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trimadap_trim_adapter_test.py new file mode 100644 index 0000000000000000000000000000000000000000..de81f89a29dd23bf12dad7493beef3501db31910 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trimadap_trim_adapter_test.py @@ -0,0 +1,82 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("trimadap") + + +@mcp.tool() +def trim_adapter(input_fastq: str, output_fastq: str) -> dict: + """ + Trim 3-prime adapter (ACGTTGCA) from Illumina reads using trimadap-mt. + + Args: + input_fastq: Path to input FASTQ file + output_fastq: Path where trimmed FASTQ output will be written + """ + # Validate input path + input_path = Path(input_fastq) + if not input_path.is_file(): + raise FileNotFoundError(f"Input FASTQ file not found: {input_fastq}") + + # Create output parent directory if needed + output_path = Path(output_fastq) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "trimadap-mt", + "-3", "ACGTTGCA", + "-l", "1", + "-s", "4", + "-p", "1", + str(input_path) + ] + + try: + # Execute command, capture stdout + result = subprocess.run( + cmd, + capture_output=True, + text=False, # binary mode for FASTQ data + check=False + ) + + if result.returncode != 0: + stderr_msg = result.stderr.decode('utf-8', errors='replace') if result.stderr else "" + raise RuntimeError( + f"trimadap-mt failed with exit code {result.returncode}: {stderr_msg}" + ) + + # Write stdout to output file + with open(output_path, 'wb') as f: + f.write(result.stdout) + + # Return structured metadata + return { + "status": "success", + "input_fastq": str(input_path), + "output_fastq": str(output_path), + "reads_processed": None, # trimadap doesn't report read counts + "adapter": "ACGTTGCA", + "min_score": 4, + "min_length": 1, + "threads": 1, + "command": " ".join(cmd), + "exit_code": result.returncode + } + + except FileNotFoundError: + raise RuntimeError( + "trimadap-mt executable not found. Ensure trimadap r11 (build h577a1d6_7) " + "is installed and available in PATH." + ) + except subprocess.SubprocessError as e: + raise RuntimeError(f"Failed to execute trimadap-mt: {str(e)}") + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trimadap_trim_adapter_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trimadap_trim_adapter_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..da56b2ec095ecf71267cc13c418fa3d691c4c69b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trimadap_trim_adapter_test.py.raw.txt @@ -0,0 +1,84 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("trimadap") + + +@mcp.tool() +def trim_adapter(input_fastq: str, output_fastq: str) -> dict: + """ + Trim 3-prime adapter (ACGTTGCA) from Illumina reads using trimadap-mt. + + Args: + input_fastq: Path to input FASTQ file + output_fastq: Path where trimmed FASTQ output will be written + """ + # Validate input path + input_path = Path(input_fastq) + if not input_path.is_file(): + raise FileNotFoundError(f"Input FASTQ file not found: {input_fastq}") + + # Create output parent directory if needed + output_path = Path(output_fastq) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "trimadap-mt", + "-3", "ACGTTGCA", + "-l", "1", + "-s", "4", + "-p", "1", + str(input_path) + ] + + try: + # Execute command, capture stdout + result = subprocess.run( + cmd, + capture_output=True, + text=False, # binary mode for FASTQ data + check=False + ) + + if result.returncode != 0: + stderr_msg = result.stderr.decode('utf-8', errors='replace') if result.stderr else "" + raise RuntimeError( + f"trimadap-mt failed with exit code {result.returncode}: {stderr_msg}" + ) + + # Write stdout to output file + with open(output_path, 'wb') as f: + f.write(result.stdout) + + # Return structured metadata + return { + "status": "success", + "input_fastq": str(input_path), + "output_fastq": str(output_path), + "reads_processed": None, # trimadap doesn't report read counts + "adapter": "ACGTTGCA", + "min_score": 4, + "min_length": 1, + "threads": 1, + "command": " ".join(cmd), + "exit_code": result.returncode + } + + except FileNotFoundError: + raise RuntimeError( + "trimadap-mt executable not found. Ensure trimadap r11 (build h577a1d6_7) " + "is installed and available in PATH." + ) + except subprocess.SubprocessError as e: + raise RuntimeError(f"Failed to execute trimadap-mt: {str(e)}") + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trimadap_trim_adapter_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trimadap_trim_adapter_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..1b09e5f70bc6e73da9e23048fbc73a6b3343fc27 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trimadap_trim_adapter_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "6c9aa35ecc93a9f528ba68d9e4edfec2a6e3778da4e508517eb07feca959f22b", + "elapsed_seconds": 3.9637837409973145, + "usage": { + "prompt_tokens": 4581, + "completion_tokens": 623, + "total_tokens": 5204, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 4581 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "35eb2b2d-161b-40e0-998e-9ad2a2c64b89" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trnascan-se_scan_trna_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trnascan-se_scan_trna_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2051b56bac10df290ab3711fb6895e0500e77841 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trnascan-se_scan_trna_test.py @@ -0,0 +1,72 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("trnascan-se") + +@mcp.tool() +def scan_trna(input_fasta: str, output_table: str, stats_file: str) -> dict: + """ + Scan tRNA sequences in a FASTA file using tRNAscan-SE. + + Args: + input_fasta: Path to input FASTA file + output_table: Path to output table file + stats_file: Path to statistics file + + Returns: + Dictionary with execution metadata + """ + # Create output parent directories + output_table_path = Path(output_table) + stats_file_path = Path(stats_file) + output_table_path.parent.mkdir(parents=True, exist_ok=True) + stats_file_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "tRNAscan-SE", + "-G", + "-o", output_table, + "-m", stats_file, + "-q", + input_fasta + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"tRNAscan-SE failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "output_table": output_table, + "stats_file": stats_file, + "input_fasta": input_fasta, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("tRNAscan-SE executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing tRNAscan-SE: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trnascan-se_scan_trna_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trnascan-se_scan_trna_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..8fa1c090a35466c46cb947805a0843d524c867e8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trnascan-se_scan_trna_test.py.raw.txt @@ -0,0 +1,74 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("trnascan-se") + +@mcp.tool() +def scan_trna(input_fasta: str, output_table: str, stats_file: str) -> dict: + """ + Scan tRNA sequences in a FASTA file using tRNAscan-SE. + + Args: + input_fasta: Path to input FASTA file + output_table: Path to output table file + stats_file: Path to statistics file + + Returns: + Dictionary with execution metadata + """ + # Create output parent directories + output_table_path = Path(output_table) + stats_file_path = Path(stats_file) + output_table_path.parent.mkdir(parents=True, exist_ok=True) + stats_file_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "tRNAscan-SE", + "-G", + "-o", output_table, + "-m", stats_file, + "-q", + input_fasta + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"tRNAscan-SE failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "output_table": output_table, + "stats_file": stats_file, + "input_fasta": input_fasta, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("tRNAscan-SE executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing tRNAscan-SE: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trnascan-se_scan_trna_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trnascan-se_scan_trna_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..3ced6a8f8f4c81cb70169bcd5b77d00711a118c4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/trnascan-se_scan_trna_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "45ebb23af5153dc7e90d6bfc1814f16340246d13c836c4cc0b61d37de24ff1eb", + "elapsed_seconds": 5.0801544189453125, + "usage": { + "prompt_tokens": 6207, + "completion_tokens": 478, + "total_tokens": 6685, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6207 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "d1a85b19-1438-4194-818d-fc451415acf2" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-bedtobigbed_bed_to_bigbed_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-bedtobigbed_bed_to_bigbed_test.py new file mode 100644 index 0000000000000000000000000000000000000000..04308016046cec4c1910312e95f256c160489c87 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-bedtobigbed_bed_to_bigbed_test.py @@ -0,0 +1,85 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("ucsc-bedtobigbed") + +@mcp.tool() +def bed_to_bigbed(input_bed: str, chrom_sizes: str, output_bigbed: str) -> dict: + """ + Convert bed file to bigBed. (BigBed version: 4) + + Args: + input_bed: Path to the input BED file + chrom_sizes: Path to the chromosome sizes file + output_bigbed: Path where the output bigBed file will be written + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_bigbed) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "bedToBigBed", + input_bed, + chrom_sizes, + output_bigbed + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable 'bedToBigBed' not found: {str(e)}", + "command": cmd + } + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": cmd + } + + # Check if the command failed + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else f"Exit code {result.returncode}" + return { + "success": False, + "error": error_msg, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file '{output_bigbed}' was not created", + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + + # Return success metadata + return { + "success": True, + "output_bigbed": str(output_path), + "output_size_bytes": output_path.stat().st_size, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-bedtobigbed_bed_to_bigbed_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-bedtobigbed_bed_to_bigbed_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..7360cb25fc865206a86a0c207d06623c64873d41 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-bedtobigbed_bed_to_bigbed_test.py.raw.txt @@ -0,0 +1,87 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("ucsc-bedtobigbed") + +@mcp.tool() +def bed_to_bigbed(input_bed: str, chrom_sizes: str, output_bigbed: str) -> dict: + """ + Convert bed file to bigBed. (BigBed version: 4) + + Args: + input_bed: Path to the input BED file + chrom_sizes: Path to the chromosome sizes file + output_bigbed: Path where the output bigBed file will be written + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_bigbed) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "bedToBigBed", + input_bed, + chrom_sizes, + output_bigbed + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable 'bedToBigBed' not found: {str(e)}", + "command": cmd + } + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": cmd + } + + # Check if the command failed + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else f"Exit code {result.returncode}" + return { + "success": False, + "error": error_msg, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file '{output_bigbed}' was not created", + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + + # Return success metadata + return { + "success": True, + "output_bigbed": str(output_path), + "output_size_bytes": output_path.stat().st_size, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-bedtobigbed_bed_to_bigbed_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-bedtobigbed_bed_to_bigbed_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..82f746658fd36ce0552ac84939acd32d49e1ad71 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-bedtobigbed_bed_to_bigbed_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "b48d2b0a81f767b98faf9823f7a34dcb65775ec784a378d81dd24def845f1e2e", + "elapsed_seconds": 4.113385200500488, + "usage": { + "prompt_tokens": 10965, + "completion_tokens": 576, + "total_tokens": 11541, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10965 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "8cc2a0eb-2b82-4831-858c-4dcb67826bfd" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-fatotwobit_fasta_to_twobit_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-fatotwobit_fasta_to_twobit_test.py new file mode 100644 index 0000000000000000000000000000000000000000..d217904c87283c96fd3d7235a805c2d436f0f22e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-fatotwobit_fasta_to_twobit_test.py @@ -0,0 +1,46 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("ucsc-fatotwobit") + + +@mcp.tool() +def fasta_to_twobit(input_fasta: str, output_twobit: str) -> dict: + """ + Convert DNA from fasta to 2bit format. + + Args: + input_fasta: Path to the input FASTA file. + output_twobit: Path to the output 2bit file. + """ + input_path = Path(input_fasta) + output_path = Path(output_twobit) + + # Create output parent directories + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = ["faToTwoBit", str(input_path), str(output_path)] + + # Run the command + result = subprocess.run(cmd, capture_output=True, text=True, check=False) + + if result.returncode != 0: + raise RuntimeError( + f"faToTwoBit failed with exit code {result.returncode}: {result.stderr}" + ) + + return { + "input_fasta": str(input_path), + "output_twobit": str(output_path), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-fatotwobit_fasta_to_twobit_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-fatotwobit_fasta_to_twobit_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..1af5125c107cf4f41001c0d2060b6475393143f9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-fatotwobit_fasta_to_twobit_test.py.raw.txt @@ -0,0 +1,48 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("ucsc-fatotwobit") + + +@mcp.tool() +def fasta_to_twobit(input_fasta: str, output_twobit: str) -> dict: + """ + Convert DNA from fasta to 2bit format. + + Args: + input_fasta: Path to the input FASTA file. + output_twobit: Path to the output 2bit file. + """ + input_path = Path(input_fasta) + output_path = Path(output_twobit) + + # Create output parent directories + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = ["faToTwoBit", str(input_path), str(output_path)] + + # Run the command + result = subprocess.run(cmd, capture_output=True, text=True, check=False) + + if result.returncode != 0: + raise RuntimeError( + f"faToTwoBit failed with exit code {result.returncode}: {result.stderr}" + ) + + return { + "input_fasta": str(input_path), + "output_twobit": str(output_path), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-fatotwobit_fasta_to_twobit_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-fatotwobit_fasta_to_twobit_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..00c42a80c60204f6126ed536bc6c4ca50cb69da1 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-fatotwobit_fasta_to_twobit_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "70b6678f9b80698f3716bb64dd6af0ffbb8d085c6318484f6066ea513e320022", + "elapsed_seconds": 2.4656786918640137, + "usage": { + "prompt_tokens": 11050, + "completion_tokens": 323, + "total_tokens": 11373, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11050 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "276df09b-a499-4b09-9f74-2b271850b1a2" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-gtftogenepred_gtf_to_genepred_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-gtftogenepred_gtf_to_genepred_test.py new file mode 100644 index 0000000000000000000000000000000000000000..dff00e64ad68a39bacac0c2ffcbe28834d42931f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-gtftogenepred_gtf_to_genepred_test.py @@ -0,0 +1,72 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("ucsc-gtftogenepred") + + +@mcp.tool() +def gtf_to_genepred(input_gtf: str, output_genepred: str) -> str: + """ + Convert a GTF file to a genePred. + + Args: + input_gtf: Path to the input GTF file. + output_genepred: Path where the output genePred file will be written. + """ + # Create output parent directories if they don't exist + output_dir = os.path.dirname(os.path.abspath(output_genepred)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command + cmd = ["gtfToGenePred", input_gtf, output_genepred] + + # Run the command + try: + result = subprocess.run( + cmd, + check=False, + capture_output=True, + text=True, + ) + except FileNotFoundError: + return json.dumps({ + "success": False, + "error": f"Executable 'gtfToGenePred' not found. Ensure it is installed and in PATH.", + "returncode": -1, + "stdout": "", + "stderr": "" + }) + + if result.returncode != 0: + return json.dumps({ + "success": False, + "error": f"gtfToGenePred failed with exit code {result.returncode}", + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + }) + + # Verify output file was created + if not os.path.exists(output_genepred): + return json.dumps({ + "success": False, + "error": f"Output file '{output_genepred}' was not created.", + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + }) + + return json.dumps({ + "success": True, + "output_genepred": output_genepred, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + }) + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-gtftogenepred_gtf_to_genepred_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-gtftogenepred_gtf_to_genepred_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..39bbe605e64db72e6b8dd13e86400bab6535f356 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-gtftogenepred_gtf_to_genepred_test.py.raw.txt @@ -0,0 +1,74 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("ucsc-gtftogenepred") + + +@mcp.tool() +def gtf_to_genepred(input_gtf: str, output_genepred: str) -> str: + """ + Convert a GTF file to a genePred. + + Args: + input_gtf: Path to the input GTF file. + output_genepred: Path where the output genePred file will be written. + """ + # Create output parent directories if they don't exist + output_dir = os.path.dirname(os.path.abspath(output_genepred)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command + cmd = ["gtfToGenePred", input_gtf, output_genepred] + + # Run the command + try: + result = subprocess.run( + cmd, + check=False, + capture_output=True, + text=True, + ) + except FileNotFoundError: + return json.dumps({ + "success": False, + "error": f"Executable 'gtfToGenePred' not found. Ensure it is installed and in PATH.", + "returncode": -1, + "stdout": "", + "stderr": "" + }) + + if result.returncode != 0: + return json.dumps({ + "success": False, + "error": f"gtfToGenePred failed with exit code {result.returncode}", + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + }) + + # Verify output file was created + if not os.path.exists(output_genepred): + return json.dumps({ + "success": False, + "error": f"Output file '{output_genepred}' was not created.", + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + }) + + return json.dumps({ + "success": True, + "output_genepred": output_genepred, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + }) + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-gtftogenepred_gtf_to_genepred_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-gtftogenepred_gtf_to_genepred_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..450e787630ad4b901260923eed137d7ef3633e6c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-gtftogenepred_gtf_to_genepred_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "b560858585684202e9d34c8d56ea774214bda9caacf8609f6cbb74cf526bd154", + "elapsed_seconds": 4.415366172790527, + "usage": { + "prompt_tokens": 10981, + "completion_tokens": 512, + "total_tokens": 11493, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10981 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "092384b3-f58b-4974-b5fd-77d678f33197" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-liftover_lift_bed_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-liftover_lift_bed_test.py new file mode 100644 index 0000000000000000000000000000000000000000..2c3c0bd75329f35fa52e0e52e51a5cfd2ac0ffbd --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-liftover_lift_bed_test.py @@ -0,0 +1,69 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("ucsc-liftover") + + +@mcp.tool() +def lift_bed( + input_bed: str, + chain_file: str, + output_bed: str, + unmapped_bed: str, +) -> dict: + """ + Lift over BED annotations from one assembly to another using UCSC liftOver. + + Args: + input_bed: Path to the input BED file. + chain_file: Path to the chain file defining the assembly conversion. + output_bed: Path where the lifted BED file will be written. + unmapped_bed: Path where unmapped regions will be written. + """ + # Create parent directories for output files + for path_str in [output_bed, unmapped_bed]: + path = Path(path_str) + if path.parent and not path.parent.exists(): + path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "liftOver", + input_bed, + chain_file, + output_bed, + unmapped_bed, + ] + + # Run the command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + + if result.returncode != 0: + raise RuntimeError( + f"liftOver failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "status": "success", + "command": " ".join(cmd), + "exit_code": result.returncode, + "output_bed": output_bed, + "unmapped_bed": unmapped_bed, + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-liftover_lift_bed_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-liftover_lift_bed_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..caca9e9c7fa1a2ea4476ffc084d7989805f315f2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-liftover_lift_bed_test.py.raw.txt @@ -0,0 +1,71 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("ucsc-liftover") + + +@mcp.tool() +def lift_bed( + input_bed: str, + chain_file: str, + output_bed: str, + unmapped_bed: str, +) -> dict: + """ + Lift over BED annotations from one assembly to another using UCSC liftOver. + + Args: + input_bed: Path to the input BED file. + chain_file: Path to the chain file defining the assembly conversion. + output_bed: Path where the lifted BED file will be written. + unmapped_bed: Path where unmapped regions will be written. + """ + # Create parent directories for output files + for path_str in [output_bed, unmapped_bed]: + path = Path(path_str) + if path.parent and not path.parent.exists(): + path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "liftOver", + input_bed, + chain_file, + output_bed, + unmapped_bed, + ] + + # Run the command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + + if result.returncode != 0: + raise RuntimeError( + f"liftOver failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "status": "success", + "command": " ".join(cmd), + "exit_code": result.returncode, + "output_bed": output_bed, + "unmapped_bed": unmapped_bed, + "stdout": result.stdout, + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-liftover_lift_bed_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-liftover_lift_bed_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..691e81fd9b03075ad058b0a4cc9cebcda9667ed6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-liftover_lift_bed_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "89d1dd7fd3386fa636ffef9e5e25c5a275e6814b346e205e6cea21ea6f59a735", + "elapsed_seconds": 2.5943796634674072, + "usage": { + "prompt_tokens": 11028, + "completion_tokens": 444, + "total_tokens": 11472, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 11028 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "0565cce5-8e05-4b8a-90a3-e689051e5d80" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-nibfrag_extract_nib_fragment_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-nibfrag_extract_nib_fragment_test.py new file mode 100644 index 0000000000000000000000000000000000000000..720106fd3ca868d27b937225c6ec7d63eb1bd757 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-nibfrag_extract_nib_fragment_test.py @@ -0,0 +1,54 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("ucsc-nibfrag") + + +@mcp.tool() +def extract_nib_fragment(input_nib: str, output_fasta: str) -> dict: + """ + Extract bases 4-20 on the plus strand in uppercase with fixed name fragment. + + Args: + input_nib: Path to the input .nib file + output_fasta: Path where the output FASTA file will be written + """ + # Create output parent directories + output_path = Path(output_fasta) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "nibFrag", + "-upper", + "-name=fragment", + input_nib, + "4", + "20", + "+", + output_fasta, + ] + + # Execute without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + if result.returncode != 0: + raise RuntimeError( + f"nibFrag failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured JSON-serializable metadata + return { + "endpoint": "extract_nib_fragment", + "input_nib": input_nib, + "output_fasta": output_fasta, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-nibfrag_extract_nib_fragment_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-nibfrag_extract_nib_fragment_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..96fc1e1e7c48a619992e04baadacd0786595e7de --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-nibfrag_extract_nib_fragment_test.py.raw.txt @@ -0,0 +1,56 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("ucsc-nibfrag") + + +@mcp.tool() +def extract_nib_fragment(input_nib: str, output_fasta: str) -> dict: + """ + Extract bases 4-20 on the plus strand in uppercase with fixed name fragment. + + Args: + input_nib: Path to the input .nib file + output_fasta: Path where the output FASTA file will be written + """ + # Create output parent directories + output_path = Path(output_fasta) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "nibFrag", + "-upper", + "-name=fragment", + input_nib, + "4", + "20", + "+", + output_fasta, + ] + + # Execute without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + if result.returncode != 0: + raise RuntimeError( + f"nibFrag failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured JSON-serializable metadata + return { + "endpoint": "extract_nib_fragment", + "input_nib": input_nib, + "output_fasta": output_fasta, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-nibfrag_extract_nib_fragment_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-nibfrag_extract_nib_fragment_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..a03a71dbb0a94b1950842c910320949f43313de2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-nibfrag_extract_nib_fragment_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "24b5eb38d6d9b55ff4ad2ac2aa45cf8cc2dbb3087305215452fb88ac27da4ed2", + "elapsed_seconds": 3.0941779613494873, + "usage": { + "prompt_tokens": 10078, + "completion_tokens": 380, + "total_tokens": 10458, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10078 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "a50ee890-7c9e-4d68-94c1-d9fb6885a43f" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobitinfo_twobit_info_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobitinfo_twobit_info_test.py new file mode 100644 index 0000000000000000000000000000000000000000..46d66f38850caf929af9fdd043efe3286924f009 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobitinfo_twobit_info_test.py @@ -0,0 +1,83 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("ucsc-twobitinfo") + + +@mcp.tool() +def twobit_info(input_twobit: str, output_file: str) -> dict: + """ + Get information about sequences in a .2bit file. + + Args: + input_twobit: Path to the input .2bit file. + output_file: Path to the output file where sequence information will be written. + """ + # Create parent directories for output_file + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "twoBitInfo", + input_twobit, + output_file + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable 'twoBitInfo' not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Check if output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file '{output_file}' was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Read the output file content for metadata + try: + with open(output_path, 'r') as f: + content = f.read() + except Exception as e: + content = f"" + + return { + "success": True, + "output_file": str(output_path), + "output_file_size": output_path.stat().st_size, + "output_content_preview": content[:2000], + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobitinfo_twobit_info_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobitinfo_twobit_info_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..bf658fbc29c53ed57b800eeb23b711cf18e4ee52 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobitinfo_twobit_info_test.py.raw.txt @@ -0,0 +1,85 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("ucsc-twobitinfo") + + +@mcp.tool() +def twobit_info(input_twobit: str, output_file: str) -> dict: + """ + Get information about sequences in a .2bit file. + + Args: + input_twobit: Path to the input .2bit file. + output_file: Path to the output file where sequence information will be written. + """ + # Create parent directories for output_file + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "twoBitInfo", + input_twobit, + output_file + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable 'twoBitInfo' not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Check if output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file '{output_file}' was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Read the output file content for metadata + try: + with open(output_path, 'r') as f: + content = f.read() + except Exception as e: + content = f"" + + return { + "success": True, + "output_file": str(output_path), + "output_file_size": output_path.stat().st_size, + "output_content_preview": content[:2000], + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobitinfo_twobit_info_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobitinfo_twobit_info_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..2de169fe9eac17282ab36ee87744c065bd08dd47 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobitinfo_twobit_info_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "03ea0f8995cb09a7fdeaa1531755a451813be2c02b9bb101f0ae0eb6caccd4ae", + "elapsed_seconds": 3.1119980812072754, + "usage": { + "prompt_tokens": 10700, + "completion_tokens": 528, + "total_tokens": 11228, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 10700 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "1eef2543-ed4e-446b-b90b-592de6401df2" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobittofa_twobit_to_fasta_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobittofa_twobit_to_fasta_test.py new file mode 100644 index 0000000000000000000000000000000000000000..e9b3c8d6b0562be1416e6cd05fa9762074413fbf --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobittofa_twobit_to_fasta_test.py @@ -0,0 +1,63 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("ucsc-twobittofa") + +@mcp.tool() +def twobit_to_fasta(input_twobit: str, output_file: str) -> str: + """ + Convert all or part of .2bit file to fasta. + + Args: + input_twobit: Path to the input .2bit file. + output_file: Path to the output FASTA file. + """ + # Create output parent directories if they don't exist + output_dir = os.path.dirname(os.path.abspath(output_file)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command + cmd = ["twoBitToFa", input_twobit, output_file] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return json.dumps({ + "success": False, + "error": "twoBitToFa executable not found. Ensure ucsc-twobittofa is installed and in PATH." + }) + + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else f"Exit code {result.returncode}" + return json.dumps({ + "success": False, + "error": error_msg, + "stdout": result.stdout, + "stderr": result.stderr + }) + + # Verify output file was created + if not os.path.exists(output_file): + return json.dumps({ + "success": False, + "error": "Output file was not created" + }) + + return json.dumps({ + "success": True, + "input_twobit": input_twobit, + "output_file": output_file, + "output_size": os.path.getsize(output_file) + }) + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobittofa_twobit_to_fasta_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobittofa_twobit_to_fasta_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..beeb819693652f0b887bb908baf42cb3266116ea --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobittofa_twobit_to_fasta_test.py.raw.txt @@ -0,0 +1,65 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("ucsc-twobittofa") + +@mcp.tool() +def twobit_to_fasta(input_twobit: str, output_file: str) -> str: + """ + Convert all or part of .2bit file to fasta. + + Args: + input_twobit: Path to the input .2bit file. + output_file: Path to the output FASTA file. + """ + # Create output parent directories if they don't exist + output_dir = os.path.dirname(os.path.abspath(output_file)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command + cmd = ["twoBitToFa", input_twobit, output_file] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return json.dumps({ + "success": False, + "error": "twoBitToFa executable not found. Ensure ucsc-twobittofa is installed and in PATH." + }) + + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else f"Exit code {result.returncode}" + return json.dumps({ + "success": False, + "error": error_msg, + "stdout": result.stdout, + "stderr": result.stderr + }) + + # Verify output file was created + if not os.path.exists(output_file): + return json.dumps({ + "success": False, + "error": "Output file was not created" + }) + + return json.dumps({ + "success": True, + "input_twobit": input_twobit, + "output_file": output_file, + "output_size": os.path.getsize(output_file) + }) + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobittofa_twobit_to_fasta_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobittofa_twobit_to_fasta_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..2bd58dc6b4a9356618172910e2e5a901fedca416 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/ucsc-twobittofa_twobit_to_fasta_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "5138ab6557dc27ef01e060868d3aee297a2161b956a17a58c691667f61e16b8a", + "elapsed_seconds": 2.978602886199951, + "usage": { + "prompt_tokens": 9189, + "completion_tokens": 442, + "total_tokens": 9631, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9189 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "02daa054-4132-46bb-8a12-82ef5ff7340e" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/umis_csv_to_sparse_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/umis_csv_to_sparse_test.py new file mode 100644 index 0000000000000000000000000000000000000000..9638cf0123372cf79bb6fafc89eb815f24531e03 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/umis_csv_to_sparse_test.py @@ -0,0 +1,48 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("umis") + +@mcp.tool() +def csv_to_sparse(input_csv: str, output_matrix: str) -> dict: + """ + Convert a CSV file to a sparse matrix using umis sparse. + + Args: + input_csv: Path to input CSV file + output_matrix: Path to output sparse matrix file + """ + # Create output parent directories + output_path = Path(output_matrix) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = ["umis", "sparse", input_csv, output_matrix] + + # Execute command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"umis sparse failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + return { + "endpoint": "csv_to_sparse", + "input_csv": input_csv, + "output_matrix": output_matrix, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_exists": output_path.exists() + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/umis_csv_to_sparse_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/umis_csv_to_sparse_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..7cc9bbd37272ee603062b79dd5b6b2cc38583724 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/umis_csv_to_sparse_test.py.raw.txt @@ -0,0 +1,50 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("umis") + +@mcp.tool() +def csv_to_sparse(input_csv: str, output_matrix: str) -> dict: + """ + Convert a CSV file to a sparse matrix using umis sparse. + + Args: + input_csv: Path to input CSV file + output_matrix: Path to output sparse matrix file + """ + # Create output parent directories + output_path = Path(output_matrix) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = ["umis", "sparse", input_csv, output_matrix] + + # Execute command + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"umis sparse failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + return { + "endpoint": "csv_to_sparse", + "input_csv": input_csv, + "output_matrix": output_matrix, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_exists": output_path.exists() + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/umis_csv_to_sparse_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/umis_csv_to_sparse_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..245ce47a889fa7d8d34f1d7a95d21c1b59887470 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/umis_csv_to_sparse_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "c39fd54c8cfdb3dada4b696b1fb6994bf977ebabe69cf0cebe94cd0fb0f41f07", + "elapsed_seconds": 2.552090644836426, + "usage": { + "prompt_tokens": 9204, + "completion_tokens": 323, + "total_tokens": 9527, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 9204 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "480a085e-3a2d-480d-9030-aa9be9403c05" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unicycler_assemble_paired_reads_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unicycler_assemble_paired_reads_test.py new file mode 100644 index 0000000000000000000000000000000000000000..e0fa0561fc100df3dded75a3516dc8e6623106db --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unicycler_assemble_paired_reads_test.py @@ -0,0 +1,86 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("unicycler") + + +@mcp.tool() +def assemble_paired_reads(reads_r1: str, reads_r2: str, output_dir: str) -> dict: + """ + Assemble 3000 deterministic paired lambda reads into a single linear contig + with one thread and a stable k-mer schedule. + + Args: + reads_r1: Path to FASTQ file of first short reads in each pair. + reads_r2: Path to FASTQ file of second short reads in each pair. + output_dir: Path to output directory. + + Returns: + JSON-serializable metadata with the output directory and exit code. + """ + # Validate input paths exist + r1_path = Path(reads_r1) + r2_path = Path(reads_r2) + if not r1_path.is_file(): + raise FileNotFoundError(f"Reads R1 file not found: {reads_r1}") + if not r2_path.is_file(): + raise FileNotFoundError(f"Reads R2 file not found: {reads_r2}") + + # Create output directory (including parents) + out_path = Path(output_dir) + out_path.mkdir(parents=True, exist_ok=True) + + # Build command per execution_plan + cmd = [ + "unicycler", + "-1", str(r1_path), + "-2", str(r2_path), + "-o", str(out_path), + "-t", "1", + "--linear_seqs", "1", + "--keep", "0", + "--verbosity", "1", + "--kmers", "27,53,71,87,99" + ] + + # Environment: prepend PATH and set TERM + env = os.environ.copy() + env["PATH"] = "/225040511/miniconda3/envs/bioenv_cli/bin" + os.pathsep + env.get("PATH", "") + env["TERM"] = "xterm" + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + except Exception as e: + raise RuntimeError(f"Failed to execute unicycler: {e}") from e + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Unicycler failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "output_dir": str(out_path), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unicycler_assemble_paired_reads_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unicycler_assemble_paired_reads_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..e6554995dfaf16febb1628e38ade58b84aad6802 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unicycler_assemble_paired_reads_test.py.raw.txt @@ -0,0 +1,88 @@ +```python +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("unicycler") + + +@mcp.tool() +def assemble_paired_reads(reads_r1: str, reads_r2: str, output_dir: str) -> dict: + """ + Assemble 3000 deterministic paired lambda reads into a single linear contig + with one thread and a stable k-mer schedule. + + Args: + reads_r1: Path to FASTQ file of first short reads in each pair. + reads_r2: Path to FASTQ file of second short reads in each pair. + output_dir: Path to output directory. + + Returns: + JSON-serializable metadata with the output directory and exit code. + """ + # Validate input paths exist + r1_path = Path(reads_r1) + r2_path = Path(reads_r2) + if not r1_path.is_file(): + raise FileNotFoundError(f"Reads R1 file not found: {reads_r1}") + if not r2_path.is_file(): + raise FileNotFoundError(f"Reads R2 file not found: {reads_r2}") + + # Create output directory (including parents) + out_path = Path(output_dir) + out_path.mkdir(parents=True, exist_ok=True) + + # Build command per execution_plan + cmd = [ + "unicycler", + "-1", str(r1_path), + "-2", str(r2_path), + "-o", str(out_path), + "-t", "1", + "--linear_seqs", "1", + "--keep", "0", + "--verbosity", "1", + "--kmers", "27,53,71,87,99" + ] + + # Environment: prepend PATH and set TERM + env = os.environ.copy() + env["PATH"] = "/225040511/miniconda3/envs/bioenv_cli/bin" + os.pathsep + env.get("PATH", "") + env["TERM"] = "xterm" + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + except Exception as e: + raise RuntimeError(f"Failed to execute unicycler: {e}") from e + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Unicycler failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured metadata + return { + "output_dir": str(out_path), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unicycler_assemble_paired_reads_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unicycler_assemble_paired_reads_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..e712336ac27efe1a937fd0c8103e372312e4d384 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unicycler_assemble_paired_reads_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "f68675a66e82aa71e4c8403a5dbbbdf9271eb96ad433870c1fd388e34c1a0d67", + "elapsed_seconds": 8.627041101455688, + "usage": { + "prompt_tokens": 1883, + "completion_tokens": 650, + "total_tokens": 2533, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 1883 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "885dd7d8-bae8-4f92-bb9d-0dfdbfb95665" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unifrac_unweighted_distance_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unifrac_unweighted_distance_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ac226058165b23e00e8f77dd60766567d992cdaa --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unifrac_unweighted_distance_test.py @@ -0,0 +1,93 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("unifrac") + + +@mcp.tool() +def unweighted_distance(input_biom: str, tree_newick: str, distance_matrix: str) -> dict: + """ + Compute unweighted UniFrac distance matrix. + + Args: + input_biom: Path to the input BIOM table. + tree_newick: Path to the Newick formatted phylogeny. + distance_matrix: Path where the output distance matrix will be written. + + Returns: + A dictionary with metadata about the execution. + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(distance_matrix)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command + cmd = [ + "ssu", + "-i", + input_biom, + "-o", + distance_matrix, + "-m", + "unweighted", + "-t", + tree_newick, + "--format", + "ascii", + ] + + # Environment variables + env = os.environ.copy() + env["OMP_NUM_THREADS"] = "1" + env["UNIFRAC_USE_GPU"] = "N" + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False, + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable 'ssu' not found: {e}", + "command": cmd, + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + # Check that the output file was created + if not os.path.exists(distance_matrix): + return { + "success": False, + "error": f"Output file {distance_matrix} was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + return { + "success": True, + "output_file": distance_matrix, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + "exit_code": result.returncode, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unifrac_unweighted_distance_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unifrac_unweighted_distance_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..cf13cc454a0a8324759e5f4aebd65df3b1471da3 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unifrac_unweighted_distance_test.py.raw.txt @@ -0,0 +1,95 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("unifrac") + + +@mcp.tool() +def unweighted_distance(input_biom: str, tree_newick: str, distance_matrix: str) -> dict: + """ + Compute unweighted UniFrac distance matrix. + + Args: + input_biom: Path to the input BIOM table. + tree_newick: Path to the Newick formatted phylogeny. + distance_matrix: Path where the output distance matrix will be written. + + Returns: + A dictionary with metadata about the execution. + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(distance_matrix)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command + cmd = [ + "ssu", + "-i", + input_biom, + "-o", + distance_matrix, + "-m", + "unweighted", + "-t", + tree_newick, + "--format", + "ascii", + ] + + # Environment variables + env = os.environ.copy() + env["OMP_NUM_THREADS"] = "1" + env["UNIFRAC_USE_GPU"] = "N" + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False, + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable 'ssu' not found: {e}", + "command": cmd, + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + # Check that the output file was created + if not os.path.exists(distance_matrix): + return { + "success": False, + "error": f"Output file {distance_matrix} was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + return { + "success": True, + "output_file": distance_matrix, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + "exit_code": result.returncode, + } + + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unifrac_unweighted_distance_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unifrac_unweighted_distance_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..aebc4ae8d4436812b030372093f99648c3849d2c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/unifrac_unweighted_distance_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "b42f8f190bb99c4cd80d9e9eedf6657d735d913516fbe2dcded4dd91e3c83729", + "elapsed_seconds": 4.027470588684082, + "usage": { + "prompt_tokens": 22719, + "completion_tokens": 574, + "total_tokens": 23293, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 22719 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "b68f6b81-9cd5-400e-b72b-58c8a964defa" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/vt_normalize_vcf_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/vt_normalize_vcf_test.py new file mode 100644 index 0000000000000000000000000000000000000000..7e837a77ffd6a4dccdc22320c5869fbc1bb91c37 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/vt_normalize_vcf_test.py @@ -0,0 +1,72 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("vt") + +@mcp.tool() +def normalize_vcf(input_vcf: str, reference_file: str, output_vcf: str) -> dict: + """ + Normalize a VCF file using the vt normalize command. + + Args: + input_vcf: Path to input VCF file + reference_file: Path to reference genome FASTA file + output_vcf: Path where the normalized VCF output will be written + + Returns: + Dictionary with execution metadata including output path and exit code + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_vcf) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "vt", + "normalize", + input_vcf, + "-r", + reference_file, + "-o", + output_vcf + ] + + # Execute the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Check for non-zero exit code + if result.returncode != 0: + error_msg = f"vt normalize failed with exit code {result.returncode}\n" + if result.stderr: + error_msg += f"stderr: {result.stderr}\n" + if result.stdout: + error_msg += f"stdout: {result.stdout}\n" + raise RuntimeError(error_msg) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_vcf} was not created") + + # Return structured metadata + return { + "status": "success", + "output_vcf": str(output_path), + "exit_code": result.returncode, + "stdout": result.stdout if result.stdout else "", + "stderr": result.stderr if result.stderr else "" + } + + except FileNotFoundError: + raise RuntimeError("Executable 'vt' not found in PATH") + except subprocess.SubprocessError as e: + raise RuntimeError(f"Subprocess execution failed: {str(e)}") \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/vt_normalize_vcf_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/vt_normalize_vcf_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..13fc598e5875d749523e4ea93fc856b892c5eaea --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/vt_normalize_vcf_test.py.raw.txt @@ -0,0 +1,74 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("vt") + +@mcp.tool() +def normalize_vcf(input_vcf: str, reference_file: str, output_vcf: str) -> dict: + """ + Normalize a VCF file using the vt normalize command. + + Args: + input_vcf: Path to input VCF file + reference_file: Path to reference genome FASTA file + output_vcf: Path where the normalized VCF output will be written + + Returns: + Dictionary with execution metadata including output path and exit code + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_vcf) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "vt", + "normalize", + input_vcf, + "-r", + reference_file, + "-o", + output_vcf + ] + + # Execute the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Check for non-zero exit code + if result.returncode != 0: + error_msg = f"vt normalize failed with exit code {result.returncode}\n" + if result.stderr: + error_msg += f"stderr: {result.stderr}\n" + if result.stdout: + error_msg += f"stdout: {result.stdout}\n" + raise RuntimeError(error_msg) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_vcf} was not created") + + # Return structured metadata + return { + "status": "success", + "output_vcf": str(output_path), + "exit_code": result.returncode, + "stdout": result.stdout if result.stdout else "", + "stderr": result.stderr if result.stderr else "" + } + + except FileNotFoundError: + raise RuntimeError("Executable 'vt' not found in PATH") + except subprocess.SubprocessError as e: + raise RuntimeError(f"Subprocess execution failed: {str(e)}") +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/vt_normalize_vcf_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/vt_normalize_vcf_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..8d68650017cf0353982421e2eda792fcb76f8bbd --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/vt_normalize_vcf_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "65c3ffdbefaeb49181baaa25c315f8659c29a03627ce0a3fe66ac17bacd413a4", + "elapsed_seconds": 3.344587802886963, + "usage": { + "prompt_tokens": 6191, + "completion_tokens": 511, + "total_tokens": 6702, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6191 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "6048a7ae-3b56-4fd2-ad1a-2ac0843955be" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/wasp2_find_allelic_imbalance_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/wasp2_find_allelic_imbalance_test.py new file mode 100644 index 0000000000000000000000000000000000000000..350d6ae6e06018920e08a9ae2d7c02dad43a7ca9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/wasp2_find_allelic_imbalance_test.py @@ -0,0 +1,43 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("wasp2") + +@mcp.tool() +def find_allelic_imbalance(count_tsv: str, output_tsv: str) -> dict: + """ + Fit the WASP2 allelic-imbalance model to six pinned count records and report likelihood, effect-size, p-value, and FDR columns. + """ + # Create output parent directories + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "wasp2-analyze", + "find-imbalance", + count_tsv, + "--min", + "10", + "-o", + output_tsv + ] + + # Run command + result = subprocess.run(cmd, capture_output=True, text=True, shell=False) + + if result.returncode != 0: + raise RuntimeError(f"Command failed with exit code {result.returncode}: {result.stderr}") + + # Return structured metadata + return { + "endpoint": "find_allelic_imbalance", + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_file": output_tsv + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/wasp2_find_allelic_imbalance_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/wasp2_find_allelic_imbalance_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..56a06f437ff41fbd1ff08b34d9a37ab8275e9973 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/wasp2_find_allelic_imbalance_test.py.raw.txt @@ -0,0 +1,45 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("wasp2") + +@mcp.tool() +def find_allelic_imbalance(count_tsv: str, output_tsv: str) -> dict: + """ + Fit the WASP2 allelic-imbalance model to six pinned count records and report likelihood, effect-size, p-value, and FDR columns. + """ + # Create output parent directories + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "wasp2-analyze", + "find-imbalance", + count_tsv, + "--min", + "10", + "-o", + output_tsv + ] + + # Run command + result = subprocess.run(cmd, capture_output=True, text=True, shell=False) + + if result.returncode != 0: + raise RuntimeError(f"Command failed with exit code {result.returncode}: {result.stderr}") + + # Return structured metadata + return { + "endpoint": "find_allelic_imbalance", + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_file": output_tsv + } +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/wasp2_find_allelic_imbalance_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/wasp2_find_allelic_imbalance_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..b138e6b4ffc6451be49e905ff593a45330ce3cce --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/wasp2_find_allelic_imbalance_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "218f54e432ea19e0809ed988d320526066cc810d1f2f7b8194c514208ec9286c", + "elapsed_seconds": 4.788642168045044, + "usage": { + "prompt_tokens": 5894, + "completion_tokens": 318, + "total_tokens": 6212, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 5894 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "78146ef2-25c2-431f-95e2-bbdf19fb76a0" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/whatshap_phasing_stats_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/whatshap_phasing_stats_test.py new file mode 100644 index 0000000000000000000000000000000000000000..88c173b8dbc0bf22d09597baa7c51262efb19632 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/whatshap_phasing_stats_test.py @@ -0,0 +1,73 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("whatshap") + +@mcp.tool() +def phasing_stats(input_vcf: str, output_tsv: str) -> dict: + """ + Compute phasing statistics from a VCF file and write them to a TSV file. + + Args: + input_vcf: Path to the input VCF file + output_tsv: Path where the TSV output will be written + """ + # Create output parent directories + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "whatshap", + "stats", + "--tsv", + output_tsv, + "--sample", + "SAMPLE", + input_vcf + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"whatshap stats failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_tsv} was not created") + + # Return structured metadata + return { + "status": "success", + "input_vcf": input_vcf, + "output_tsv": output_tsv, + "sample": "SAMPLE", + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": output_path.stat().st_size + } + + except FileNotFoundError: + raise RuntimeError("whatshap executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing whatshap stats: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/whatshap_phasing_stats_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/whatshap_phasing_stats_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..80815b3eba1a1c5ce20d7eb6540ffa0a988f1a40 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/whatshap_phasing_stats_test.py.raw.txt @@ -0,0 +1,75 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("whatshap") + +@mcp.tool() +def phasing_stats(input_vcf: str, output_tsv: str) -> dict: + """ + Compute phasing statistics from a VCF file and write them to a TSV file. + + Args: + input_vcf: Path to the input VCF file + output_tsv: Path where the TSV output will be written + """ + # Create output parent directories + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "whatshap", + "stats", + "--tsv", + output_tsv, + "--sample", + "SAMPLE", + input_vcf + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"whatshap stats failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_tsv} was not created") + + # Return structured metadata + return { + "status": "success", + "input_vcf": input_vcf, + "output_tsv": output_tsv, + "sample": "SAMPLE", + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": output_path.stat().st_size + } + + except FileNotFoundError: + raise RuntimeError("whatshap executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing whatshap stats: {str(e)}") + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/whatshap_phasing_stats_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/whatshap_phasing_stats_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..5ab4d81d692b7810a728d1f7a9cf5418b6697564 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/whatshap_phasing_stats_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "9ecd0d27baca3e442087339b054c34145f0a546aa09b7df2de19c59c067e15a8", + "elapsed_seconds": 3.5734102725982666, + "usage": { + "prompt_tokens": 6846, + "completion_tokens": 501, + "total_tokens": 7347, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 6846 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "1bce8876-6bc8-49ed-9cca-cd18bfdeb211" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/zol_extract_genomic_region_test.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/zol_extract_genomic_region_test.py new file mode 100644 index 0000000000000000000000000000000000000000..339ac7ce1b702f3bc948085ce8fb3a748f9e3031 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/zol_extract_genomic_region_test.py @@ -0,0 +1,93 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("zol") + +@mcp.tool() +def extract_genomic_region( + input_genbank: str, + output_genbank: str, + temp_dir: str +) -> dict: + """ + Extract bases 5-30 from a named GenBank scaffold and remove temporary intermediates. + + Args: + input_genbank: Path to input GenBank file + output_genbank: Path to output GenBank file + temp_dir: Path to temporary directory for intermediate files + """ + # Create output parent directories + output_path = Path(output_genbank) + output_path.parent.mkdir(parents=True, exist_ok=True) + + temp_path = Path(temp_dir) + temp_path.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "zol-suite", + "regex", + "-i", input_genbank, + "-s", "chrTiny.1", + "-b", "5", + "-e", "30", + "-o", output_genbank, + "-t", temp_dir, + "--cleanup" + ] + + # Set environment + env = os.environ.copy() + env["ZOL_EXEC_PATH"] = "/225040511/miniconda3/envs/experiment1_test_pinned/zol-1.7.0-py313h0bdc4b4_0/bin" + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file {output_genbank} was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "output_genbank": str(output_path), + "temp_dir": str(temp_path), + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/zol_extract_genomic_region_test.py.raw.txt b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/zol_extract_genomic_region_test.py.raw.txt new file mode 100644 index 0000000000000000000000000000000000000000..21724686a478701747ed800363f30ad0a097fb70 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/zol_extract_genomic_region_test.py.raw.txt @@ -0,0 +1,95 @@ +```python +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("zol") + +@mcp.tool() +def extract_genomic_region( + input_genbank: str, + output_genbank: str, + temp_dir: str +) -> dict: + """ + Extract bases 5-30 from a named GenBank scaffold and remove temporary intermediates. + + Args: + input_genbank: Path to input GenBank file + output_genbank: Path to output GenBank file + temp_dir: Path to temporary directory for intermediate files + """ + # Create output parent directories + output_path = Path(output_genbank) + output_path.parent.mkdir(parents=True, exist_ok=True) + + temp_path = Path(temp_dir) + temp_path.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "zol-suite", + "regex", + "-i", input_genbank, + "-s", "chrTiny.1", + "-b", "5", + "-e", "30", + "-o", output_genbank, + "-t", temp_dir, + "--cleanup" + ] + + # Set environment + env = os.environ.copy() + env["ZOL_EXEC_PATH"] = "/225040511/miniconda3/envs/experiment1_test_pinned/zol-1.7.0-py313h0bdc4b4_0/bin" + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file {output_genbank} was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "output_genbank": str(output_path), + "temp_dir": str(temp_path), + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() +``` \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/zol_extract_genomic_region_test.py.usage.json b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/zol_extract_genomic_region_test.py.usage.json new file mode 100644 index 0000000000000000000000000000000000000000..227bbdb98349c7edf5f5e40aec3bb450da2cff16 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/direct_prompt/zol_extract_genomic_region_test.py.usage.json @@ -0,0 +1,26 @@ +{ + "mode": "direct_prompt", + "provider": "deepseek", + "model": "deepseek-v4-flash", + "base_url": "https://api.deepseek.com/v1", + "temperature": 0.1, + "max_output_tokens": 16384, + "thinking": "disabled", + "backend_config_sha256": "b1441f3e96893718c3b4a98090b10b8bffb0cbd24041fd433cd5352e7f65008b", + "prompt_sha256": "49ba530a78c5d33786735af97600fce44369fba55d3bde79d8aa6fb4bbd6d107", + "help_sha256": "0bcf38eaea34a68b01e14e7096179a4311e1f5714ad0d9a872991e125daebbbc", + "elapsed_seconds": 4.309859752655029, + "usage": { + "prompt_tokens": 16441, + "completion_tokens": 614, + "total_tokens": 17055, + "prompt_tokens_details": { + "cached_tokens": 0 + }, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 16441 + }, + "parse_errors": [], + "normalization_changes": [], + "response_id": "53491cb5-065a-4fb9-b5b6-56430fd0679c" +} diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/abundancebin_bin_by_abundance_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/abundancebin_bin_by_abundance_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..aeaf83dca5df0004d01c2a100712cb41eb83db53 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/abundancebin_bin_by_abundance_test_server.py @@ -0,0 +1,97 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("abundancebin") + + +@mcp.tool() +def bin_by_abundance(input_fasta: str, output_log: str) -> dict: + """ + Classify the official two-genome example into two abundance bins and report + their inferred abundances and genome sizes. + + Args: + input_fasta: Path to the input FASTA file. + output_log: Path to the output log file. + """ + # Resolve paths + input_path = Path(input_fasta) + output_path = Path(output_log) + + # Create output parent directories + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "abundancebin", + "-input", + str(input_path), + "-bin_num", + "2", + "-output", + str(output_path), + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd, + } + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}: {result.stderr}" + ) + + # Parse output log to extract abundance and genome size information + # The log format is tool-specific; we attempt to extract key-value pairs + # and structured data. If parsing fails, return raw content. + metadata = { + "success": True, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_log": str(output_path), + } + + # Attempt to parse the log file for abundance and genome size info + try: + if output_path.exists(): + content = output_path.read_text() + metadata["log_content"] = content + # Simple heuristic: look for lines with "abundance" or "genome size" + # This is a placeholder; adjust based on actual tool output format. + parsed = {} + for line in content.splitlines(): + lower = line.lower() + if "abundance" in lower or "genome size" in lower: + # Try to extract key: value + if ":" in line: + key, _, value = line.partition(":") + parsed[key.strip()] = value.strip() + if parsed: + metadata["parsed"] = parsed + except Exception as e: + metadata["parse_error"] = str(e) + + return metadata + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/adapterremoval_trim_adapters_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/adapterremoval_trim_adapters_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..500d950a725eaef427c3314ee5d55098ebcafd55 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/adapterremoval_trim_adapters_test_server.py @@ -0,0 +1,88 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("adapterremoval") + +@mcp.tool() +def trim_adapters(input_fastq: str, output_fastq: str) -> dict: + """ + Trim adapter sequences from a FASTQ file using adapterremoval3. + + Args: + input_fastq: Path to input FASTQ file + output_fastq: Path to output FASTQ file + + Returns: + Dictionary with execution metadata + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_fastq)) + os.makedirs(output_dir, exist_ok=True) + + # Build command + cmd = [ + "adapterremoval3", + "--in-file1", + input_fastq, + "--out-file1", + output_fastq, + "--adapter1", + "ACGTTGCA", + "--min-length", + "1", + "--threads", + "1" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "adapterremoval3 executable not found", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"adapterremoval3 exited with code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Check if output file was created + if not os.path.exists(output_fastq): + return { + "success": False, + "error": "Output file was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "adapter": "ACGTTGCA", + "min_length": 1, + "threads": 1, + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/alfred_pairwise_align_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/alfred_pairwise_align_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..9e5a59e9653feb541854227d40f1674463cfee48 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/alfred_pairwise_align_test_server.py @@ -0,0 +1,92 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("alfred") + + +@mcp.tool() +def pairwise_align(sequence_a: str, sequence_b: str, output_alignment: str) -> dict: + """ + Perform pairwise alignment of two sequences using alfred pwalign. + + Args: + sequence_a: Path to the first sequence file (FASTA/FASTQ) + sequence_b: Path to the second sequence file (FASTA/FASTQ) + output_alignment: Path where the alignment output will be written + + Returns: + JSON-serializable metadata about the alignment operation + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_alignment) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command according to the execution plan + cmd = [ + "alfred", + "pwalign", + "-f", + "h", + "-a", + output_alignment, + sequence_a, + sequence_b + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"alfred pwalign failed with exit code {result.returncode}\n" + f"stderr: {result.stderr}" + ) + + # Check that the output file was created + if not output_path.exists(): + raise RuntimeError( + f"alfred pwalign did not create the expected output file: {output_alignment}" + ) + + # Return structured metadata + return { + "status": "success", + "endpoint": "pairwise_align", + "tool": "alfred", + "version": "0.6.2", + "subcommand": "pwalign", + "inputs": { + "sequence_a": sequence_a, + "sequence_b": sequence_b + }, + "outputs": { + "output_alignment": output_alignment + }, + "alignment_format": "horizontal", + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError( + "alfred executable not found. Please ensure alfred is installed and in PATH." + ) + except subprocess.SubprocessError as e: + raise RuntimeError(f"Failed to execute alfred pwalign: {str(e)}") + except Exception as e: + raise RuntimeError(f"Unexpected error during pairwise alignment: {str(e)}") + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/ariba_prepare_reference_database_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/ariba_prepare_reference_database_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..11d43b3d8ac2fa8eba86bf3d34b26f8bc1de5da2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/ariba_prepare_reference_database_test_server.py @@ -0,0 +1,80 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("ariba") + +@mcp.tool() +def prepare_reference_database(input_fasta: str, output_dir: str) -> dict: + """ + Validate two coding reference genes and place each into its own stable cluster without external downloads. + + Args: + input_fasta: Path to input FASTA file of reference sequences + output_dir: Path to output directory for prepared reference data + """ + # Create output parent directories + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "ariba", + "prepareref", + "-f", + input_fasta, + "--all_coding", + "yes", + "--no_cdhit", + "--threads", + "1", + "--force", + output_dir + ] + + # Set environment with PATH_PREPEND + env = os.environ.copy() + path_prepend = "/225040511/miniconda3/pkgs/mummer-3.23-pl5321h503566f_21/bin" + if path_prepend: + env["PATH"] = path_prepend + os.pathsep + env.get("PATH", "") + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False + ) + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr, + "output_dir": str(output_path), + "input_fasta": input_fasta + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/atropos_trim_adapters_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/atropos_trim_adapters_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..80e0949b6e2313ac9eea3859b05303ac2b6fd8b9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/atropos_trim_adapters_test_server.py @@ -0,0 +1,98 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("atropos") + +@mcp.tool() +def trim_adapters(input_fastq: str, output_fastq: str) -> dict: + """ + Trim adapters from high-throughput sequencing reads using atropos. + + Args: + input_fastq: Path to input FASTQ file (single-end) + output_fastq: Path to output FASTQ file + + Returns: + JSON-serializable metadata about the operation + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_fastq) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command according to the execution plan + command = [ + "atropos", + "trim", + "-se", + input_fastq, + "-o", + output_fastq, + "-a", + "ACGTTGCA", + "--threads", + "2", + "--minimum-length", + "1" + ] + + # Execute the command + try: + result = subprocess.run( + command, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + return { + "success": False, + "error": "atropos executable not found in PATH", + "command": command + } + except Exception as e: + return { + "success": False, + "error": f"Failed to execute command: {str(e)}", + "command": command + } + + # Check for non-zero exit code + if result.returncode != 0: + return { + "success": False, + "error": f"atropos exited with code {result.returncode}", + "stderr": result.stderr, + "stdout": result.stdout, + "command": command + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": "Output file was not created", + "command": command + } + + # Return structured metadata + return { + "success": True, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "adapter": "ACGTTGCA", + "threads": 2, + "minimum_length": 1, + "command": command, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_size_bytes": output_path.stat().st_size + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bamtools_bam_to_sam_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bamtools_bam_to_sam_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..c540f5d4276fe237e3146ccdf097313f07df4730 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bamtools_bam_to_sam_test_server.py @@ -0,0 +1,59 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("bamtools") + +@mcp.tool() +def bam_to_sam(input_bam: str, output_sam: str) -> dict: + """ + Convert a BAM file to SAM format using bamtools convert. + + Args: + input_bam: Path to input BAM file + output_sam: Path to output SAM file + """ + # Create output parent directory if needed + output_path = Path(output_sam) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "bamtools", + "convert", + "-in", + input_bam, + "-format", + "sam", + "-out", + output_sam + ] + + # Execute command without shell + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"bamtools convert failed with exit code {result.returncode}: " + f"{result.stderr}" + ) + + # Return structured metadata + return { + "endpoint": "bam_to_sam", + "input_bam": input_bam, + "output_sam": output_sam, + "command": cmd, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_exists": output_path.exists(), + "output_size_bytes": output_path.stat().st_size if output_path.exists() else 0 + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bcbio-nextgen_build_sample_configuration_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bcbio-nextgen_build_sample_configuration_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..78639deba4c8c3ce438cbca3b63e2b06bae90929 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bcbio-nextgen_build_sample_configuration_test_server.py @@ -0,0 +1,85 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("bcbio-nextgen") + +@mcp.tool() +def build_sample_configuration( + template_yaml: str, + metadata_csv: str, + input_fastq: str, + output_root: str +) -> dict: + """ + Generate a one-sample RNA-seq configuration from local template, metadata, and FASTQ. + + Args: + template_yaml: Path to the template YAML configuration file + metadata_csv: Path to the metadata CSV file + input_fastq: Path to the input FASTQ file(s) + output_root: Working directory for the output + + Returns: + Dictionary with execution metadata including paths and status + """ + # Create output directory if it doesn't exist + output_dir = Path(output_root) + output_dir.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "bcbio_nextgen.py", + "-w", + "template", + template_yaml, + metadata_csv, + input_fastq + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + cwd=str(output_dir), + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"bcbio_nextgen.py failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Determine the output configuration file path + # bcbio-nextgen template creates a config file in the working directory + # based on the metadata CSV name + config_name = Path(metadata_csv).stem + ".yaml" + config_path = output_dir / "config" / config_name + + return { + "status": "success", + "command": " ".join(cmd), + "working_directory": str(output_dir), + "template_yaml": template_yaml, + "metadata_csv": metadata_csv, + "input_fastq": input_fastq, + "output_config": str(config_path), + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("bcbio_nextgen.py executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing bcbio_nextgen.py: {str(e)}") + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bedops_intersect_bed_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bedops_intersect_bed_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..f760e6c150c4d286e52965b07e02c1dd9a343191 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bedops_intersect_bed_test_server.py @@ -0,0 +1,81 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("bedops-intersect") + +@mcp.tool() +def intersect_bed(input_a: str, input_b: str, output_file: str) -> dict: + """ + Intersect two BED files using bedops --intersect. + + Args: + input_a: Path to first BED file (sorted per sort-bed) + input_b: Path to second BED file (sorted per sort-bed) + output_file: Path where the intersection result will be written + + Returns: + JSON-serializable metadata about the operation + """ + # Validate input paths exist + input_a_path = Path(input_a) + input_b_path = Path(input_b) + if not input_a_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_a}") + if not input_b_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_b}") + + # Create output parent directory if needed + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command exactly as specified in execution_plan + cmd = [ + "bedops", + "--intersect", + str(input_a_path), + str(input_b_path) + ] + + # Execute command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("bedops executable not found in PATH. Ensure bedops 2.4.42 is installed.") + except Exception as e: + raise RuntimeError(f"Failed to execute bedops: {str(e)}") + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError(f"bedops --intersect failed with exit code {result.returncode}: {error_msg}") + + # Write stdout to output file + try: + with open(output_path, 'w') as f: + f.write(result.stdout) + except Exception as e: + raise RuntimeError(f"Failed to write output file: {str(e)}") + + # Return structured metadata + return { + "status": "success", + "command": " ".join(cmd), + "input_a": str(input_a_path), + "input_b": str(input_b_path), + "output_file": str(output_path), + "exit_code": result.returncode, + "stdout_bytes": len(result.stdout.encode('utf-8')), + "stderr": result.stderr.strip() if result.stderr else "" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bedtools_intersect_bed_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bedtools_intersect_bed_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..cd067cb6caf4ca1e06c330778ea0d5946d9a9fd9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bedtools_intersect_bed_test_server.py @@ -0,0 +1,80 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("bedtools") + +@mcp.tool() +def intersect_bed(input_a: str, input_b: str, output_file: str) -> dict: + """ + Find overlapping intervals between two BED files using bedtools intersect. + + Args: + input_a: Path to the first BED file (interval file A) + input_b: Path to the second BED file (interval file B) + output_file: Path where the intersection results will be written + + Returns: + Dictionary containing metadata about the operation + """ + # Validate input files exist + if not os.path.isfile(input_a): + raise FileNotFoundError(f"Input file A not found: {input_a}") + if not os.path.isfile(input_b): + raise FileNotFoundError(f"Input file B not found: {input_b}") + + # Create output directory if it doesn't exist + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command - output_file is stdout capture, so not passed to CLI + cmd = [ + "bedtools", + "intersect", + "-a", input_a, + "-b", input_b + ] + + try: + # Execute command, capture stdout + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"bedtools intersect failed with exit code {result.returncode}: " + f"{result.stderr}" + ) + + # Write stdout to output file + with open(output_file, 'w') as f: + f.write(result.stdout) + + # Count lines in output for metadata + line_count = len(result.stdout.splitlines()) if result.stdout else 0 + + return { + "status": "success", + "endpoint": "intersect_bed", + "input_a": input_a, + "input_b": input_b, + "output_file": output_file, + "line_count": line_count, + "exit_code": result.returncode, + "stderr": result.stderr if result.stderr else "" + } + + except subprocess.TimeoutExpired: + raise RuntimeError("bedtools intersect timed out") + except OSError as e: + raise RuntimeError(f"Failed to execute bedtools: {e}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/biobambam_sort_bam_to_sam_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/biobambam_sort_bam_to_sam_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..b51bc638753c216dc69c2eed582f312cd4d85327 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/biobambam_sort_bam_to_sam_test_server.py @@ -0,0 +1,69 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("biobambam") + +@mcp.tool() +def sort_bam_to_sam(input_bam: str, output_sam: str) -> dict: + """ + Coordinate-sort a BAM file and render it as SAM. + + Args: + input_bam: Path to input BAM file + output_sam: Path to output SAM file + """ + # Create output parent directories + output_path = Path(output_sam) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command + cmd = [ + "bamsort", + f"I={input_bam}", + f"O={output_sam}", + "inputformat=bam", + "outputformat=sam", + "SO=coordinate", + "verbose=0" + ] + + try: + # Execute command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"bamsort failed with exit code {result.returncode}: " + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_sam} was not created") + + return { + "status": "success", + "input_bam": input_bam, + "output_sam": output_sam, + "command": " ".join(cmd), + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("bamsort executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Error executing bamsort: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/blast-legacy_blastn_search_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/blast-legacy_blastn_search_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..d823b972455b9c8a31397c9b6439801cbb408685 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/blast-legacy_blastn_search_test_server.py @@ -0,0 +1,116 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("blast-legacy") + + +@mcp.tool() +def blastn_search( + reference_fasta: str, + query_fasta: str, + database_prefix: str, + output_hits: str, +) -> dict: + """ + Build a nucleotide database, then emit legacy BLAST tabular format 8. + + Args: + reference_fasta: Path to the reference FASTA file used to build the database. + query_fasta: Path to the query FASTA file to search. + database_prefix: Prefix for the database files created by formatdb. + output_hits: Path where the BLAST tabular output will be written. + """ + # Validate required inputs exist + ref_path = Path(reference_fasta) + query_path = Path(query_fasta) + if not ref_path.is_file(): + raise FileNotFoundError(f"Reference FASTA file not found: {reference_fasta}") + if not query_path.is_file(): + raise FileNotFoundError(f"Query FASTA file not found: {query_fasta}") + + # Create output parent directory if needed + output_path = Path(output_hits) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: formatdb -i {reference_fasta} -p F -n {database_prefix} + formatdb_cmd = [ + "formatdb", + "-i", + reference_fasta, + "-p", + "F", + "-n", + database_prefix, + ] + try: + formatdb_result = subprocess.run( + formatdb_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"formatdb executable not found: {e}") from e + + if formatdb_result.returncode != 0: + raise RuntimeError( + f"formatdb failed with exit code {formatdb_result.returncode}\n" + f"stdout: {formatdb_result.stdout}\n" + f"stderr: {formatdb_result.stderr}" + ) + + # Step 2: blastall -p blastn -d {database_prefix} -i {query_fasta} -m 8 -F F -o {output_hits} + blastall_cmd = [ + "blastall", + "-p", + "blastn", + "-d", + database_prefix, + "-i", + query_fasta, + "-m", + "8", + "-F", + "F", + "-o", + output_hits, + ] + try: + blastall_result = subprocess.run( + blastall_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"blastall executable not found: {e}") from e + + if blastall_result.returncode != 0: + raise RuntimeError( + f"blastall failed with exit code {blastall_result.returncode}\n" + f"stdout: {blastall_result.stdout}\n" + f"stderr: {blastall_result.stderr}" + ) + + # Verify output file was created + if not output_path.is_file(): + raise RuntimeError(f"Expected output file was not created: {output_hits}") + + # Return structured metadata + return { + "endpoint": "blastn_search", + "status": "success", + "reference_fasta": reference_fasta, + "query_fasta": query_fasta, + "database_prefix": database_prefix, + "output_hits": output_hits, + "formatdb_exit_code": formatdb_result.returncode, + "blastall_exit_code": blastall_result.returncode, + "formatdb_stdout": formatdb_result.stdout, + "formatdb_stderr": formatdb_result.stderr, + "blastall_stdout": blastall_result.stdout, + "blastall_stderr": blastall_result.stderr, + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/busco_assess_bacterial_genome_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/busco_assess_bacterial_genome_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..66dc093961e71165e2a53a74ab0418f2681c66a5 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/busco_assess_bacterial_genome_test_server.py @@ -0,0 +1,115 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("busco") + +@mcp.tool() +def assess_bacterial_genome( + input_fasta: str, + lineage_dir: str, + run_dir: str, + output_tsv: str +) -> dict: + """ + Assess completeness of a pinned bacterial genome against a local BUSCO lineage with two CPUs in offline mode. + """ + # Create output parent directories + Path(run_dir).mkdir(parents=True, exist_ok=True) + Path(output_tsv).parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run BUSCO + busco_cmd = [ + "busco", + "-i", input_fasta, + "-l", lineage_dir, + "-o", "ecoli_busco", + "-m", "genome", + "-c", "2", + "--offline", + "--out_path", run_dir + ] + + try: + result1 = subprocess.run( + busco_cmd, + capture_output=True, + text=True, + check=False + ) + if result1.returncode != 0: + raise RuntimeError( + f"BUSCO failed with exit code {result1.returncode}\n" + f"stdout: {result1.stdout}\n" + f"stderr: {result1.stderr}" + ) + except FileNotFoundError as e: + raise RuntimeError(f"BUSCO executable not found: {e}") + + # Step 2: Normalize BUSCO summary + summary_file = os.path.join(run_dir, "ecoli_busco", "short_summary.specific.bacteria_odb10.ecoli_busco.txt") + + if not os.path.exists(summary_file): + raise RuntimeError(f"BUSCO summary file not found: {summary_file}") + + # Parse the summary file and write normalized TSV + try: + with open(summary_file, 'r') as f: + content = f.read() + + # Parse BUSCO summary format + lines = content.strip().split('\n') + data = {} + + for line in lines: + line = line.strip() + if line.startswith('#') or not line: + continue + + # Look for key-value patterns like "C:95.2%[S:90.1%,D:5.1%],F:2.3%,M:2.5%,n:124" + if 'C:' in line and 'S:' in line and 'D:' in line and 'F:' in line and 'M:' in line and 'n:' in line: + # Extract percentages + import re + c_match = re.search(r'C:([\d.]+)%', line) + s_match = re.search(r'S:([\d.]+)%', line) + d_match = re.search(r'D:([\d.]+)%', line) + f_match = re.search(r'F:([\d.]+)%', line) + m_match = re.search(r'M:([\d.]+)%', line) + n_match = re.search(r'n:(\d+)', line) + + if all([c_match, s_match, d_match, f_match, m_match, n_match]): + data = { + 'Complete': float(c_match.group(1)), + 'Single_copy': float(s_match.group(1)), + 'Duplicated': float(d_match.group(1)), + 'Fragmented': float(f_match.group(1)), + 'Missing': float(m_match.group(1)), + 'Total_BUSCOs': int(n_match.group(1)) + } + break + + if not data: + raise RuntimeError(f"Could not parse BUSCO summary from {summary_file}") + + # Write TSV + with open(output_tsv, 'w') as f: + f.write("Metric\tValue\n") + for key, value in data.items(): + f.write(f"{key}\t{value}\n") + + except Exception as e: + raise RuntimeError(f"Failed to normalize BUSCO summary: {e}") + + return { + "status": "success", + "input_fasta": input_fasta, + "lineage_dir": lineage_dir, + "run_dir": run_dir, + "output_tsv": output_tsv, + "busco_output_dir": os.path.join(run_dir, "ecoli_busco"), + "summary_file": summary_file, + "metrics": data + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bx-python_intersect_intervals_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bx-python_intersect_intervals_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..16d9bd4086ed15efb9da4aad4526b089703629de --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/bx-python_intersect_intervals_test_server.py @@ -0,0 +1,89 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("bx-python") + + +@mcp.tool() +def intersect_intervals( + target_bed: str, + query_bed: str, + output_json: str, +) -> dict: + """ + Intersect intervals from a target BED file with a query BED file using bx-python's Intersecter. + + Args: + target_bed: Path to the target BED file (intervals to be indexed). + query_bed: Path to the query BED file (intervals to be tested for overlap). + output_json: Path where the JSON output will be written. + + Returns: + A dictionary with metadata about the operation. + """ + # Create output parent directories + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + code = ( + "import json,sys; " + "from bx.intervals.intersection import Intersecter,Interval; " + "t=Intersecter(); " + "q=[]; " + "[t.add_interval(Interval(int(c[1]),int(c[2]),value=c[3] if len(c)>3 else '.')) " + "for c in (x.rstrip().split('\\t') for x in open(sys.argv[1])) if c[0]=='chrTiny']; " + "[q.append({'start':int(c[1]),'end':int(c[2]),'hits':sorted(x.value for x in t.find(int(c[1]),int(c[2])))}) " + "for c in (x.rstrip().split('\\t') for x in open(sys.argv[2])) if c[0]=='chrTiny']; " + "open(sys.argv[3],'w').write(json.dumps(q,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.13", + "-c", + code, + target_bed, + query_bed, + output_json, + ] + + # Run the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_json} was not created") + + # Read the output to include in metadata + with open(output_path, "r") as f: + output_content = f.read() + + return { + "status": "success", + "output_json": output_json, + "output_content": output_content, + "target_bed": target_bed, + "query_bed": query_bed, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cd-hit_cluster_proteins_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cd-hit_cluster_proteins_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..5cfa0093e8da248ad3da39dc0d8de84649c3300f --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cd-hit_cluster_proteins_test_server.py @@ -0,0 +1,85 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("cd-hit") + +@mcp.tool() +def cluster_proteins(input_file: str, output_file: str) -> dict: + """ + Cluster protein sequences using CD-HIT with fixed parameters. + + Args: + input_file: Path to input FASTA file + output_file: Path to output file (cluster representatives) + + Returns: + Dictionary containing output file paths and metadata + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Derive cluster file path (CD-HIT appends .clstr to output file) + cluster_file = str(output_path) + ".clstr" + + # Build command with fixed parameters + cmd = [ + "cd-hit", + "-i", input_file, + "-o", output_file, + "-c", "0.9", + "-n", "5", + "-T", "1", + "-M", "100" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("cd-hit executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute cd-hit: {str(e)}") + + # Check for non-zero exit code + if result.returncode != 0: + error_msg = f"cd-hit failed with exit code {result.returncode}\n" + if result.stderr: + error_msg += f"stderr: {result.stderr}\n" + if result.stdout: + error_msg += f"stdout: {result.stdout}\n" + raise RuntimeError(error_msg) + + # Verify output files exist + if not os.path.exists(output_file): + raise RuntimeError(f"Output file {output_file} was not created") + if not os.path.exists(cluster_file): + raise RuntimeError(f"Cluster file {cluster_file} was not created") + + # Return structured metadata + return { + "output_file": output_file, + "cluster_file": cluster_file, + "input_file": input_file, + "parameters": { + "identity_threshold": 0.9, + "word_length": 5, + "threads": 1, + "memory_limit_mb": 100 + }, + "stdout": result.stdout, + "stderr": result.stderr, + "exit_code": result.returncode + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cdbtools_extract_fasta_record_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cdbtools_extract_fasta_record_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..f39a2d5fa536de75ed44754596be186db6794723 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cdbtools_extract_fasta_record_test_server.py @@ -0,0 +1,96 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("cdbtools") + + +@mcp.tool() +def extract_fasta_record( + input_fasta: str, + index_file: str, + output_fasta: str, +) -> Dict[str, Any]: + """ + Index a FASTA file with cdbfasta, then retrieve the record with key 'chrTiny' + using cdbyank and write the result to the specified output file. + + Args: + input_fasta: Path to the input FASTA file to be indexed. + index_file: Path where the CDB index file will be created. + output_fasta: Path where the retrieved FASTA record will be written. + """ + # Validate input file exists + input_path = Path(input_fasta) + if not input_path.exists(): + raise FileNotFoundError(f"Input FASTA file not found: {input_fasta}") + + # Create parent directories for output files + index_path = Path(index_file) + output_path = Path(output_fasta) + index_path.parent.mkdir(parents=True, exist_ok=True) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Index the FASTA file with cdbfasta + cmd_index = ["cdbfasta", str(input_path), "-o", str(index_path)] + try: + result_index = subprocess.run( + cmd_index, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError( + f"cdbfasta executable not found. Ensure cdbtools is installed and in PATH. Error: {e}" + ) from e + + if result_index.returncode != 0: + raise RuntimeError( + f"cdbfasta failed with exit code {result_index.returncode}.\n" + f"stderr: {result_index.stderr}\n" + f"stdout: {result_index.stdout}" + ) + + # Step 2: Retrieve the record with key 'chrTiny' using cdbyank + cmd_yank = ["cdbyank", "-a", "chrTiny", str(index_path)] + try: + result_yank = subprocess.run( + cmd_yank, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError( + f"cdbyank executable not found. Ensure cdbtools is installed and in PATH. Error: {e}" + ) from e + + if result_yank.returncode != 0: + raise RuntimeError( + f"cdbyank failed with exit code {result_yank.returncode}.\n" + f"stderr: {result_yank.stderr}\n" + f"stdout: {result_yank.stdout}" + ) + + # Write the captured stdout to the output file + try: + output_path.write_text(result_yank.stdout, encoding="utf-8") + except OSError as e: + raise RuntimeError(f"Failed to write output file {output_fasta}: {e}") from e + + # Return structured metadata + return { + "status": "success", + "input_fasta": str(input_path), + "index_file": str(index_path), + "output_fasta": str(output_path), + "cdbfasta_exit_code": result_index.returncode, + "cdbyank_exit_code": result_yank.returncode, + "output_size_bytes": output_path.stat().st_size, + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cell2cell_preprocess_expression_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cell2cell_preprocess_expression_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..bd7390a1c995250676549957ce95ca5d8e79602d --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cell2cell_preprocess_expression_test_server.py @@ -0,0 +1,75 @@ +import json +import os +import subprocess +import sys +from pathlib import Path + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("cell2cell") + + +@mcp.tool() +def preprocess_expression(expression_csv: str, output_json: str) -> dict: + """ + Preprocess expression data using cell2cell. + + Args: + expression_csv: Path to the input expression CSV file. + output_json: Path to the output JSON file. + """ + expression_csv_path = Path(expression_csv) + output_json_path = Path(output_json) + + # Create output parent directories + output_json_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + code = ( + "import json,pandas as pd,sys; " + "from cell2cell.preprocessing import get_global_percentile_cutoffs,get_thresholded_rnaseq,scale_expression_by_sum; " + "x=pd.read_csv(sys.argv[1],index_col=0); " + "cut=get_global_percentile_cutoffs(x,percentile=0.5); " + "y=get_thresholded_rnaseq(x,cut); " + "z=scale_expression_by_sum(x,axis=0,sum_value=100.0); " + "d={'cutoffs':cut.to_dict() if hasattr(cut,'to_dict') else cut," + "'thresholded':y.to_dict(),'scaled':z.round(6).to_dict()}; " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.9", + "-c", + code, + str(expression_csv_path), + str(output_json_path), + ] + + # Run the command without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Read the output JSON to return structured metadata + try: + with open(output_json_path, "r") as f: + output_data = json.load(f) + except Exception as e: + raise RuntimeError(f"Failed to read output JSON: {e}") + + return { + "status": "success", + "output_json": str(output_json_path), + "cutoffs": output_data.get("cutoffs"), + "thresholded": output_data.get("thresholded"), + "scaled": output_data.get("scaled"), + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/checkm-genome_assess_bin_quality_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/checkm-genome_assess_bin_quality_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..39cbf8181995ac7cb45b6ec396e7cd5191d0799b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/checkm-genome_assess_bin_quality_test_server.py @@ -0,0 +1,106 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("checkm-genome") + + +@mcp.tool() +def assess_bin_quality( + marker_file: str, + bins_dir: str, + analysis_dir: str, + output_tsv: str, +) -> dict: + """ + Analyze a pinned bacterial genome bin with its fixed lineage marker set and report + tab-separated completeness and contamination estimates. + + Args: + marker_file: Path to the marker file (lineage-specific marker set). + bins_dir: Directory containing the genome bins (FASTA files with .fna extension). + analysis_dir: Directory where intermediate analysis results will be stored. + output_tsv: Path to the output TSV file containing completeness and contamination estimates. + + Returns: + A dictionary with metadata about the execution, including the output file path. + """ + # Create output parent directories + for path in [analysis_dir, output_tsv]: + parent = os.path.dirname(os.path.abspath(path)) + os.makedirs(parent, exist_ok=True) + + # Step 1: checkm analyze + analyze_cmd = [ + "checkm", + "analyze", + "-x", + "fna", + "-t", + "2", + marker_file, + bins_dir, + analysis_dir, + ] + try: + analyze_result = subprocess.run( + analyze_cmd, + capture_output=True, + text=True, + check=False, + ) + if analyze_result.returncode != 0: + raise RuntimeError( + f"checkm analyze failed with exit code {analyze_result.returncode}: " + f"{analyze_result.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("checkm executable not found. Ensure checkm-genome is installed and in PATH.") + + # Step 2: checkm qa + qa_cmd = [ + "checkm", + "qa", + "-f", + output_tsv, + "--tab_table", + marker_file, + analysis_dir, + ] + try: + qa_result = subprocess.run( + qa_cmd, + capture_output=True, + text=True, + check=False, + ) + if qa_result.returncode != 0: + raise RuntimeError( + f"checkm qa failed with exit code {qa_result.returncode}: " + f"{qa_result.stderr}" + ) + except FileNotFoundError: + raise RuntimeError("checkm executable not found. Ensure checkm-genome is installed and in PATH.") + + # Verify output file was created + if not os.path.isfile(output_tsv): + raise RuntimeError(f"Expected output file {output_tsv} was not created.") + + return { + "output_tsv": output_tsv, + "analysis_dir": analysis_dir, + "marker_file": marker_file, + "bins_dir": bins_dir, + "analyze_exit_code": analyze_result.returncode, + "qa_exit_code": qa_result.returncode, + "analyze_stdout": analyze_result.stdout, + "analyze_stderr": analyze_result.stderr, + "qa_stdout": qa_result.stdout, + "qa_stderr": qa_result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/circexplorer2_parse_star_junctions_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/circexplorer2_parse_star_junctions_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..a7dc79b8de215d8170701851ef2eba0e9045a4e0 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/circexplorer2_parse_star_junctions_test_server.py @@ -0,0 +1,76 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("circexplorer2") + +@mcp.tool() +def parse_star_junctions(star_junctions: str, output_bed: str) -> dict: + """ + Parse STAR chimeric junctions, retain same-chromosome same-strand back-splices, + and aggregate duplicate read support. + + Args: + star_junctions: Path to STAR chimeric junction file (input) + output_bed: Path to output BED file + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_bed) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "CIRCexplorer2", + "parse", + "-t", + "STAR", + "-b", + output_bed, + star_junctions + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file {output_bed} was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Return structured metadata + return { + "success": True, + "output_bed": str(output_path), + "output_bed_size": output_path.stat().st_size, + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/clustalo_align_proteins_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/clustalo_align_proteins_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..71c8f7a2ad0b7c720fc2ee42d8ddd4a570aa748c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/clustalo_align_proteins_test_server.py @@ -0,0 +1,91 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("clustalo") + +@mcp.tool() +def align_proteins(input_file: str, output_file: str) -> dict: + """ + Align protein sequences using Clustal Omega. + + Args: + input_file: Path to input FASTA file with protein sequences + output_file: Path where the alignment will be written (FASTA format) + + Returns: + JSON-serializable metadata about the alignment result + """ + # Validate input file exists + input_path = Path(input_file) + if not input_path.exists(): + raise FileNotFoundError(f"Input file not found: {input_file}") + + # Create output parent directories + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "clustalo", + "-i", + input_file, + "-o", + output_file, + "--outfmt=fasta", + "--threads=1", + "--force" + ] + + # Execute command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("clustalo executable not found in PATH") + except Exception as e: + raise RuntimeError(f"Failed to execute clustalo: {str(e)}") + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError(f"clustalo failed with exit code {result.returncode}: {error_msg}") + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file was not created: {output_file}") + + # Read output file to get basic stats + try: + with open(output_path, 'r') as f: + content = f.read() + sequences = [line for line in content.split('\n') if line.startswith('>')] + num_sequences = len(sequences) + total_length = sum(len(line) for line in content.split('\n') if not line.startswith('>') and line.strip()) + except Exception as e: + raise RuntimeError(f"Failed to read output file: {str(e)}") + + # Return structured metadata + return { + "status": "success", + "tool": "clustalo", + "version": "1.2.4", + "input_file": str(input_path), + "output_file": str(output_path), + "output_format": "fasta", + "num_sequences": num_sequences, + "total_alignment_length": total_length, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/clustalw_align_proteins_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/clustalw_align_proteins_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..630fabe6c736b30c6dc538bc420517f00bfe2a2b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/clustalw_align_proteins_test_server.py @@ -0,0 +1,75 @@ +import json +import os +import subprocess +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("clustalw-align-proteins") + +@mcp.tool() +def align_proteins(input_file: str, output_file: str) -> dict: + """ + Align protein sequences using ClustalW 2.1. + + Args: + input_file: Path to the input file containing protein sequences. + output_file: Path where the FASTA alignment will be written. + + Returns: + JSON-serializable metadata about the alignment run. + """ + # Resolve paths + input_path = Path(input_file) + output_path = Path(output_file) + + # Create output parent directories if they don't exist + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "clustalw", + f"-INFILE={input_path}", + f"-OUTFILE={output_path}", + "-OUTPUT=FASTA", + "-QUIET" + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("clustalw executable not found in PATH") + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"clustalw failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_path} was not created") + + # Return structured metadata + return { + "status": "success", + "tool": "clustalw", + "version": "2.1", + "input_file": str(input_path), + "output_file": str(output_path), + "output_format": "FASTA", + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cmappy_parse_gct_matrix_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cmappy_parse_gct_matrix_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..31ad6f5bccb1defd6056ef68840e980f1479e462 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cmappy_parse_gct_matrix_test_server.py @@ -0,0 +1,87 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import sys +import os +import json +from pathlib import Path + +mcp = FastMCP("cmappy") + +@mcp.tool() +def parse_gct_matrix(input_gct: str, output_json: str) -> dict: + """ + Parse a GCT matrix file and emit matrix values as deterministic JSON. + + Args: + input_gct: Path to the input GCT file + output_json: Path where the output JSON will be written + """ + # Create output parent directories + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + python_code = ( + "import json,sys; " + "from cmapPy.pandasGEXpress import parse; " + "g=parse.parse(sys.argv[1]); " + "d={'rows':list(g.data_df.index),'columns':list(g.data_df.columns)," + "'values':g.data_df.values.tolist()}; " + "open(sys.argv[2],'w').write(json.dumps(d,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.9", + "-c", + python_code, + input_gct, + output_json + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}: " + f"{result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_json} was not created") + + # Read and validate the output + with open(output_path, 'r') as f: + output_data = json.load(f) + + return { + "status": "success", + "input_gct": input_gct, + "output_json": output_json, + "rows_count": len(output_data.get("rows", [])), + "columns_count": len(output_data.get("columns", [])), + "values_shape": [ + len(output_data.get("values", [])), + len(output_data.get("values", [[]])[0]) if output_data.get("values") else 0 + ] + } + + except subprocess.TimeoutExpired: + raise RuntimeError("Command timed out") + except FileNotFoundError as e: + raise RuntimeError(f"Executable not found: {e}") + except json.JSONDecodeError as e: + raise RuntimeError(f"Output file contains invalid JSON: {e}") + except Exception as e: + raise RuntimeError(f"Error executing parse_gct_matrix: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/comet-ms_search_tandem_mass_spectrum_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/comet-ms_search_tandem_mass_spectrum_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..bb49d3a161d4cb6b9a97f438c0ad6372f6b0474b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/comet-ms_search_tandem_mass_spectrum_test_server.py @@ -0,0 +1,119 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("comet-ms") + + +@mcp.tool() +def search_tandem_mass_spectrum( + params_file: str, + protein_fasta: str, + spectrum_mgf: str, + output_tsv: str, +) -> dict: + """ + Search one pinned tandem mass spectrum against one pinned protein and return the stable peptide-spectrum match table. + + Args: + params_file: Path to the Comet parameter file. + protein_fasta: Path to the protein FASTA database. + spectrum_mgf: Path to the input MGF spectrum file. + output_tsv: Path where the resulting TSV table will be written. + """ + # Validate input paths exist + for path, name in [ + (params_file, "params_file"), + (protein_fasta, "protein_fasta"), + (spectrum_mgf, "spectrum_mgf"), + ]: + if not os.path.isfile(path): + raise FileNotFoundError(f"{name} path does not exist: {path}") + + # Create output parent directory if needed + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Step 1: Run comet with the given parameters + raw_output = f"{output_tsv}.raw" + comet_cmd = [ + "comet", + f"-P{params_file}", + f"-D{protein_fasta}", + f"-N{raw_output}", + spectrum_mgf, + ] + + try: + result = subprocess.run( + comet_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError("comet executable not found in PATH") + + if result.returncode != 0: + raise RuntimeError( + f"comet failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Comet writes output to {raw_output}.txt + raw_txt = f"{raw_output}.txt" + if not os.path.isfile(raw_txt): + raise RuntimeError(f"Expected comet output file not found: {raw_txt}") + + # Step 2: Strip header line (first line) using tail -n +2 + tail_cmd = ["tail", "-n", "+2", raw_txt] + try: + tail_result = subprocess.run( + tail_cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError("tail executable not found in PATH") + + if tail_result.returncode != 0: + raise RuntimeError( + f"tail failed with exit code {tail_result.returncode}\n" + f"stdout: {tail_result.stdout}\n" + f"stderr: {tail_result.stderr}" + ) + + # Write the captured stdout to the output_tsv path + with open(output_tsv, "w") as f: + f.write(tail_result.stdout) + + # Clean up intermediate files + for intermediate in [raw_output, raw_txt]: + try: + os.remove(intermediate) + except OSError: + pass + + # Return structured metadata + return { + "status": "success", + "output_tsv": output_tsv, + "spectrum_mgf": spectrum_mgf, + "protein_fasta": protein_fasta, + "params_file": params_file, + "comet_exit_code": result.returncode, + "tail_exit_code": tail_result.returncode, + "comet_stdout": result.stdout, + "comet_stderr": result.stderr, + "tail_stdout": tail_result.stdout, + "tail_stderr": tail_result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cooltools_binnify_genome_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cooltools_binnify_genome_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..cae13d9d54bafa6a553cd4dcf023dfba37e068d9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cooltools_binnify_genome_test_server.py @@ -0,0 +1,79 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("cooltools") + + +@mcp.tool() +def binnify_genome(chrom_sizes: str, output_bed: str) -> dict: + """ + Binnify a genome into fixed-size bins (10 bp) for all chromosome names. + + Args: + chrom_sizes: Path to a chromosome sizes file (two-column: name, size). + output_bed: Path where the resulting BED file will be written. + """ + # Create output parent directory if needed + output_dir = os.path.dirname(os.path.abspath(output_bed)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "cooltools", + "genome", + "binnify", + "--all-names", + chrom_sizes, + "10" + ] + + # Run the command, capturing stdout + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stderr": result.stderr, + "stdout": result.stdout, + "command": cmd + } + + # Write captured stdout to the output file + try: + with open(output_bed, "w") as f: + f.write(result.stdout) + except OSError as e: + return { + "success": False, + "error": f"Failed to write output file: {e}", + "command": cmd + } + + return { + "success": True, + "output_bed": output_bed, + "command": cmd, + "exit_code": result.returncode, + "stdout_size": len(result.stdout), + "stderr": result.stderr + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/crispritz_score_off_targets_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/crispritz_score_off_targets_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..01a0a1881404c3cc86c9ea549f935cd1fa732fb8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/crispritz_score_off_targets_test_server.py @@ -0,0 +1,99 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import shutil +import tempfile +from pathlib import Path + +mcp = FastMCP("crispritz") + +@mcp.tool() +def score_off_targets( + input_targets: str, + pam_file: str, + guide_file: str, + genome_dir: str, + cfd_table: str, + guide_scores: str +) -> dict: + """ + Compute CFD scores for nine pinned CRISPR off-target candidates and emit both per-target and per-guide tables. + """ + # Create output parent directories + for out_path in [cfd_table, guide_scores]: + parent = os.path.dirname(os.path.abspath(out_path)) + os.makedirs(parent, exist_ok=True) + + # Create a temporary working directory for staging + with tempfile.TemporaryDirectory() as tmpdir: + staged_targets = os.path.join(tmpdir, "staged_targets.txt") + + # Step 1: Copy input targets to staged location + shutil.copy2(input_targets, staged_targets) + + # Step 2: Run crispritz.py scores + cmd = [ + "crispritz.py", + "scores", + staged_targets, + pam_file, + guide_file, + genome_dir + ] + + # Run the command, capturing stdout and stderr + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"crispritz.py scores failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # The tool generates files in the current working directory. + # We need to find the generated files. Based on the tool's behavior, + # it generates files with specific naming patterns. + # The input targets file is named "staged_targets.txt", so the outputs + # should be "staged_targets.targets.CFD.txt" and "staged_targets.scores.txt" + # in the current working directory. + + # Find the generated files + cfd_source = os.path.join(os.getcwd(), "staged_targets.targets.CFD.txt") + scores_source = os.path.join(os.getcwd(), "staged_targets.scores.txt") + + if not os.path.exists(cfd_source): + raise RuntimeError(f"Expected CFD output file not found: {cfd_source}") + if not os.path.exists(scores_source): + raise RuntimeError(f"Expected scores output file not found: {scores_source}") + + # Copy the generated files to the requested output paths + shutil.copy2(cfd_source, cfd_table) + shutil.copy2(scores_source, guide_scores) + + # Clean up the generated files from the working directory + os.remove(cfd_source) + os.remove(scores_source) + + # Return structured metadata + return { + "status": "success", + "outputs": { + "cfd_table": cfd_table, + "guide_scores": guide_scores + }, + "command": [ + "crispritz.py", + "scores", + input_targets, + pam_file, + guide_file, + genome_dir + ] + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cutadapt_trim_front_adapter_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cutadapt_trim_front_adapter_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..d1431eedc484b5738dc51fa4c960e6055e82f0b9 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cutadapt_trim_front_adapter_test_server.py @@ -0,0 +1,76 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("cutadapt") + + +@mcp.tool() +def trim_front_adapter(input_fastq: str, output_fastq: str) -> dict: + """ + Trim the anchored front adapter ^ACGTTGCA from reads in a FASTQ file using cutadapt. + + Args: + input_fastq: Path to the input FASTQ file. + output_fastq: Path where the trimmed FASTQ output will be written. + + Returns: + A JSON-serializable dictionary with metadata about the operation. + """ + # Create output parent directory if it doesn't exist + output_dir = os.path.dirname(os.path.abspath(output_fastq)) + os.makedirs(output_dir, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "cutadapt", + "-g", + "^ACGTTGCA", + "-o", + output_fastq, + input_fastq + ] + + try: + # Run the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + # Raise on non-zero exit + raise subprocess.CalledProcessError( + result.returncode, + cmd, + output=result.stdout, + stderr=result.stderr + ) + + # Return structured metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "adapter": "^ACGTTGCA" + } + + except subprocess.CalledProcessError as e: + # Re-raise with more context + raise RuntimeError( + f"cutadapt failed with exit code {e.returncode}: {e.stderr}" + ) from e + except FileNotFoundError as e: + raise RuntimeError( + "cutadapt executable not found. Please ensure it is installed and in PATH." + ) from e + except Exception as e: + raise RuntimeError(f"Unexpected error running cutadapt: {str(e)}") from e \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cyvcf2_read_vcf_records_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cyvcf2_read_vcf_records_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..36c15a640019ad124de449bfb64d68fe800d6fe8 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/cyvcf2_read_vcf_records_test_server.py @@ -0,0 +1,72 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("cyvcf2") + + +@mcp.tool() +def read_vcf_records(input_vcf: str, output_vcf: str) -> Dict[str, Any]: + """ + Read VCF records from an input VCF file, suppressing genotype columns, + and write the result to an output VCF file. + + Args: + input_vcf: Path to the input VCF file. + output_vcf: Path where the output VCF will be written. + + Returns: + A JSON-serializable dictionary containing metadata about the operation. + """ + input_path = Path(input_vcf) + output_path = Path(output_vcf) + + # Create output parent directories if they don't exist + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "cyvcf2", + "--no-inds", + str(input_path), + ] + + try: + # Run the command, capturing stdout + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False, + ) + + if result.returncode != 0: + raise RuntimeError( + f"cyvcf2 failed with exit code {result.returncode}: {result.stderr}" + ) + + # Write stdout to the output file + output_path.write_text(result.stdout) + + return { + "status": "success", + "input_vcf": str(input_path), + "output_vcf": str(output_path), + "records_written": len(result.stdout.splitlines()), + "exit_code": result.returncode, + } + + except FileNotFoundError: + raise RuntimeError("cyvcf2 executable not found. Please ensure it is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error executing cyvcf2: {str(e)}") + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/ddocent_quality_trim_rad_reads_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/ddocent_quality_trim_rad_reads_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..408a9922fdcdf60dbdb45024a43105f1efb937af --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/ddocent_quality_trim_rad_reads_test_server.py @@ -0,0 +1,223 @@ +from mcp.server.fastmcp import FastMCP +import os +import subprocess +import sys +import json +import glob +import shutil +import re +from pathlib import Path + +mcp = FastMCP("ddocent") + + +def stage_ddocent_reads(input_dir: str, work_dir: str) -> dict: + """Stage raw FASTQ files from input_dir into work_dir. + + dDocent expects raw gzipped FASTQ files in the working directory with + naming convention Pop_Sample.F.fq.gz and Pop_Sample.R.fq.gz. + This function copies all .fq.gz files from input_dir to work_dir. + """ + input_path = Path(input_dir) + work_path = Path(work_dir) + work_path.mkdir(parents=True, exist_ok=True) + + # Find all gzipped FASTQ files + fastq_files = list(input_path.glob("*.fq.gz")) + list(input_path.glob("*.fastq.gz")) + if not fastq_files: + raise FileNotFoundError(f"No FASTQ files (*.fq.gz or *.fastq.gz) found in {input_dir}") + + staged_files = [] + for f in fastq_files: + dest = work_path / f.name + shutil.copy2(f, dest) + staged_files.append(str(dest)) + + return {"staged_files": staged_files} + + +def normalize_ddocent_run(runs_file: str, trimmed_forward: str, trimmed_reverse: str, output_tsv: str) -> dict: + """Normalize dDocent run output into a structured TSV summary. + + Reads the dDocent.runs log file and extracts trimming statistics, + then writes a normalized summary to output_tsv. + """ + output_path = Path(output_tsv) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Parse the dDocent.runs file for trimming statistics + stats = { + "input_reads": 0, + "surviving_reads": 0, + "trimmed_forward": trimmed_forward, + "trimmed_reverse": trimmed_reverse, + "status": "completed" + } + + if os.path.exists(runs_file): + with open(runs_file, 'r') as f: + content = f.read() + + # Try to extract read counts from common patterns + # Look for Trimmomatic-style output or dDocent summary lines + for line in content.split('\n'): + # Pattern for "Input Read Pairs: N" or similar + m = re.search(r'Input Read Pairs:\s*(\d+)', line) + if m: + stats["input_reads"] = int(m.group(1)) + m = re.search(r'Both Surviving:\s*(\d+)', line) + if m: + stats["surviving_reads"] = int(m.group(1)) + # dDocent specific patterns + m = re.search(r'(\d+)\s+reads\s+input', line, re.IGNORECASE) + if m: + stats["input_reads"] = int(m.group(1)) + m = re.search(r'(\d+)\s+reads\s+surviving', line, re.IGNORECASE) + if m: + stats["surviving_reads"] = int(m.group(1)) + + # Write normalized TSV + with open(output_path, 'w') as f: + f.write("sample\tinput_reads\tsurviving_reads\ttrimmed_forward\ttrimmed_reverse\tstatus\n") + # Determine sample name from trimmed forward filename + sample = Path(trimmed_forward).stem + # Remove .R1.fq or .F.fq suffix + sample = re.sub(r'\.(R1|F)\.fq$', '', sample) + f.write(f"{sample}\t{stats['input_reads']}\t{stats['surviving_reads']}\t" + f"{trimmed_forward}\t{trimmed_reverse}\t{stats['status']}\n") + + return stats + + +@mcp.tool() +def quality_trim_rad_reads( + input_dir: str, + config_file: str, + work_dir: str, + output_tsv: str +) -> dict: + """Quality-trim RAD sequencing reads using dDocent with a configuration file. + + This endpoint: + 1. Stages raw FASTQ files from input_dir into work_dir + 2. Runs dDocent with the provided configuration file (which must have Trimming set to yes) + 3. Normalizes the dDocent run log into a structured TSV summary + + Args: + input_dir: Directory containing raw gzipped FASTQ files (*.fq.gz) + config_file: dDocent configuration file (must have Trimming set to yes) + work_dir: Working directory for the dDocent run + output_tsv: Path to write the normalized summary TSV + + Returns: + JSON-serializable metadata about the trimming run + """ + # Validate inputs + if not os.path.isdir(input_dir): + raise FileNotFoundError(f"Input directory not found: {input_dir}") + if not os.path.isfile(config_file): + raise FileNotFoundError(f"Config file not found: {config_file}") + + # Read and validate config file + with open(config_file, 'r') as f: + config_content = f.read() + + # Verify trimming is enabled in config + if not re.search(r'^Trimming\s+yes\s*$', config_content, re.IGNORECASE | re.MULTILINE): + raise ValueError("Config file must have 'Trimming yes' to perform quality trimming") + + # Step 1: Stage reads + staging_result = stage_ddocent_reads(input_dir, work_dir) + + # Step 2: Run dDocent with config file + work_path = Path(work_dir) + work_path.mkdir(parents=True, exist_ok=True) + + # Copy config file to working directory if not already there + config_path = Path(config_file) + if config_path.parent != work_path: + local_config = work_path / config_path.name + shutil.copy2(config_path, local_config) + config_arg = str(local_config) + else: + config_arg = config_file + + # Run dDocent + cmd = ["dDocent", config_arg] + try: + result = subprocess.run( + cmd, + cwd=work_dir, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + raise RuntimeError("dDocent executable not found in PATH. Please ensure it is installed.") + + if result.returncode != 0: + error_msg = f"dDocent failed with exit code {result.returncode}\n" + error_msg += f"STDOUT: {result.stdout[-2000:]}\n" + error_msg += f"STDERR: {result.stderr[-2000:]}" + raise RuntimeError(error_msg) + + # Step 3: Find trimmed output files + # dDocent produces trimmed files with .R1.fq and .R2.fq suffixes + trimmed_forward = None + trimmed_reverse = None + + # Look for trimmed files in working directory + r1_files = sorted(work_path.glob("*.R1.fq")) + sorted(work_path.glob("*.R1.fq.gz")) + r2_files = sorted(work_path.glob("*.R2.fq")) + sorted(work_path.glob("*.R2.fq.gz")) + + if r1_files and r2_files: + # Use the first pair found + trimmed_forward = str(r1_files[0]) + trimmed_reverse = str(r2_files[0]) + else: + # Also check for .F.fq and .R.fq naming convention + f_files = sorted(work_path.glob("*.F.fq")) + sorted(work_path.glob("*.F.fq.gz")) + r_files = sorted(work_path.glob("*.R.fq")) + sorted(work_path.glob("*.R.fq.gz")) + if f_files and r_files: + trimmed_forward = str(f_files[0]) + trimmed_reverse = str(r_files[0]) + + if not trimmed_forward or not trimmed_reverse: + raise RuntimeError( + "Could not find trimmed output files. Expected *.R1.fq/*.R2.fq or *.F.fq/*.R.fq in working directory. " + f"Files found: {[str(p) for p in work_path.iterdir() if p.is_file()]}" + ) + + # Step 4: Normalize run output + runs_file = str(work_path / "dDocent.runs") + if not os.path.exists(runs_file): + # Try alternative log file names + for alt in ["dDocent_main.LOG", "dDocent.log"]: + alt_path = work_path / alt + if alt_path.exists(): + runs_file = str(alt_path) + break + + normalize_result = normalize_ddocent_run(runs_file, trimmed_forward, trimmed_reverse, output_tsv) + + # Build result metadata + result_metadata = { + "status": "success", + "input_dir": input_dir, + "config_file": config_file, + "work_dir": work_dir, + "output_tsv": output_tsv, + "trimmed_forward": trimmed_forward, + "trimmed_reverse": trimmed_reverse, + "staged_files": staging_result["staged_files"], + "normalization": normalize_result, + "dDocent_stdout": result.stdout, + "dDocent_stderr": result.stderr + } + + return result_metadata + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/deeptools_bam_coverage_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/deeptools_bam_coverage_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..0217b0ec9db6f69ddb70fb58fe3bfd92b75ab198 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/deeptools_bam_coverage_test_server.py @@ -0,0 +1,73 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("deeptools") + + +@mcp.tool() +def bam_coverage(input_bam: str, output_bigwig: str) -> dict: + """ + Generate a bigWig coverage file from a BAM file using bamCoverage. + + Args: + input_bam: Path to the input BAM file. + output_bigwig: Path to the output bigWig file. + + Returns: + A dictionary containing the endpoint name, input/output paths, and exit code. + """ + # Create output parent directories if they don't exist + output_path = Path(output_bigwig) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "bamCoverage", + "-b", input_bam, + "-o", output_bigwig, + "--binSize", "10", + "-p", "1", + "--normalizeUsing", "None" + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + check=False, + capture_output=True, + text=True + ) + except FileNotFoundError as e: + return { + "endpoint": "bam_coverage", + "input_bam": input_bam, + "output_bigwig": output_bigwig, + "exit_code": -1, + "error": f"Executable not found: {e}" + } + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else "Unknown error" + raise RuntimeError( + f"bamCoverage failed with exit code {result.returncode}: {error_msg}" + ) + + # Return structured JSON-serializable metadata + return { + "endpoint": "bam_coverage", + "input_bam": input_bam, + "output_bigwig": output_bigwig, + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/deeptoolsintervals_query_intervals_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/deeptoolsintervals_query_intervals_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..3de186356f0a155e04319db4c3acff71b2e73187 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/deeptoolsintervals_query_intervals_test_server.py @@ -0,0 +1,76 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import sys +import os +import json +from pathlib import Path + +mcp = FastMCP("deeptoolsintervals") + +@mcp.tool() +def query_intervals(input_bed: str, output_json: str) -> dict: + """ + Build the pinned interval tree and query chrTiny:0-100. + + Args: + input_bed: Path to the input BED/GTF file + output_json: Path where the JSON output will be written + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_json) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "python3.11", + "-c", + "import json,sys; from deeptoolsintervals import parse; g=parse.GTF(sys.argv[1]); rows=g.findOverlaps('chrTiny',0,100); open(sys.argv[2],'w').write(json.dumps(rows,sort_keys=True)+'\\n')", + input_bed, + output_json + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Read the output file to return structured metadata + if output_path.exists(): + with open(output_path, 'r') as f: + output_content = f.read() + try: + output_data = json.loads(output_content) + except json.JSONDecodeError: + output_data = output_content + else: + output_data = None + + return { + "status": "success", + "input_bed": input_bed, + "output_json": output_json, + "output_content": output_data, + "stdout": result.stdout, + "stderr": result.stderr, + "returncode": result.returncode + } + + except FileNotFoundError as e: + raise RuntimeError(f"Executable not found: {e}") + except Exception as e: + raise RuntimeError(f"Error executing command: {e}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/dropkick_filter_cells_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/dropkick_filter_cells_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..604530b31729344b46b0974c2cec085a8f5500ff --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/dropkick_filter_cells_test_server.py @@ -0,0 +1,85 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys + +mcp = FastMCP("dropkick") + +@mcp.tool() +def filter_cells(counts_tsv: str, output_dir: str) -> dict: + """ + Filter a deterministic 80-cell count matrix and emit the per-cell Dropkick score/label CSV. + + Args: + counts_tsv: Path to the input counts TSV file. + output_dir: Directory where output files will be written. + """ + # Create output directory if it doesn't exist + os.makedirs(output_dir, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "dropkick", + "run", + counts_tsv, + "-o", + output_dir, + "--min-genes", + "2", + "--n-ambient", + "5", + "--n-hvgs", + "30", + "-j", + "1", + "-i", + "500", + "--csv", + "-q" + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"dropkick run failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Determine output files that dropkick generates + # Based on the tool's behavior, it writes a CSV with scores/labels + # The exact filename may vary; we'll look for common patterns + output_files = [] + for f in os.listdir(output_dir): + if f.endswith('.csv'): + output_files.append(os.path.join(output_dir, f)) + + # Also check for h5ad files that might be generated + for f in os.listdir(output_dir): + if f.endswith('.h5ad'): + output_files.append(os.path.join(output_dir, f)) + + return { + "status": "success", + "output_dir": output_dir, + "output_files": output_files, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("dropkick executable not found. Ensure it is installed and in PATH.") + except Exception as e: + raise RuntimeError(f"Error executing dropkick: {str(e)}") + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/emboss_convert_fasta_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/emboss_convert_fasta_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..8d73029083258433491a438881103cc5fd102c2a --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/emboss_convert_fasta_test_server.py @@ -0,0 +1,62 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("emboss") + +@mcp.tool() +def convert_fasta(input_file: str, output_file: str) -> dict: + """ + Convert a FASTA file using the EMBOSS seqret tool. + + Args: + input_file: Path to the input sequence file + output_file: Path where the converted output will be written + """ + # Create output parent directories + output_path = Path(output_file) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command + cmd = [ + "seqret", + "-sequence", input_file, + "-outseq", output_file, + "-auto" + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"seqret failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Verify output file was created + if not output_path.exists(): + raise RuntimeError(f"Output file {output_file} was not created") + + return { + "success": True, + "input_file": input_file, + "output_file": output_file, + "output_size": output_path.stat().st_size, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("seqret executable not found. Ensure EMBOSS is installed and in PATH") + except Exception as e: + raise RuntimeError(f"Error executing seqret: {str(e)}") \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/entrez-direct_extract_assembly_metadata_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/entrez-direct_extract_assembly_metadata_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..569b18fa70daaa6ce622fb8a188847153261d523 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/entrez-direct_extract_assembly_metadata_test_server.py @@ -0,0 +1,74 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("entrez-direct") + + +@mcp.tool() +def extract_assembly_metadata(input_xml: str, output_tsv: str) -> dict: + """ + Extract accession, organism, and assembly status from each local NCBI-style + DocumentSummary record without a network request. + + Args: + input_xml: Path to the input XML file containing DocumentSummary records. + output_tsv: Path where the tab-separated output will be written. + """ + # Resolve paths + input_path = Path(input_xml) + output_path = Path(output_tsv) + + # Validate input file exists + if not input_path.is_file(): + raise FileNotFoundError(f"Input XML file not found: {input_path}") + + # Create output parent directory if needed + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "xtract", + "-input", + str(input_path), + "-pattern", + "DocumentSummary", + "-element", + "AssemblyAccession", + "Organism", + "AssemblyStatus", + ] + + # Execute command + try: + result = subprocess.run( + cmd, + stdin=subprocess.DEVNULL, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError("xtract executable not found in PATH") + + # Check for non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"xtract failed with exit code {result.returncode}: {result.stderr}" + ) + + # Write stdout to output file + output_path.write_text(result.stdout, encoding="utf-8") + + # Return structured metadata + return { + "status": "success", + "output_file": str(output_path), + "records_processed": len(result.stdout.strip().splitlines()) if result.stdout.strip() else 0, + "bytes_written": len(result.stdout.encode("utf-8")), + "command": cmd, + "exit_code": result.returncode, + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/epic_call_diffuse_peaks_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/epic_call_diffuse_peaks_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..faa6e6822545eb6ad1a598149a0c3bc584449310 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/epic_call_diffuse_peaks_test_server.py @@ -0,0 +1,103 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("epic") + + +@mcp.tool() +def call_diffuse_peaks( + treatment_bed: str, + control_bed: str, + chrom_sizes: str, + output_tsv: str, + output_bed: str, + log_file: str, +) -> Dict[str, Any]: + """ + Call diffuse peaks using epic. + + Args: + treatment_bed: Path to treatment (ChIP) BED file. + control_bed: Path to control (Input) BED file. + chrom_sizes: Path to chromosome sizes file (two columns: name, size). + output_tsv: Path to write the results TSV file. + output_bed: Path to write the summary BED file. + log_file: Path to write log messages. + + Returns: + JSON-serializable metadata about the invocation. + """ + # Create output parent directories + for out_path in [output_tsv, output_bed, log_file]: + parent = Path(out_path).parent + if parent and not parent.exists(): + parent.mkdir(parents=True, exist_ok=True) + + # Build command per execution plan + cmd = [ + "epic", + "-t", treatment_bed, + "-c", control_bed, + "-cs", chrom_sizes, + "-cpu", "1", + "-w", "10", + "-g", "1", + "-fs", "10", + "-fdr", "1.0", + "-egf", "1.0", + "-o", output_tsv, + "-b", output_bed, + "-l", log_file, + ] + + try: + result = subprocess.run( + cmd, + check=False, + capture_output=True, + text=True, + shell=False, + ) + except Exception as e: + return { + "status": "error", + "error": str(e), + "command": cmd, + } + + if result.returncode != 0: + return { + "status": "error", + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + # Write captured streams to log file (append to log if it exists) + with open(log_file, "a") as f: + if result.stdout: + f.write(result.stdout) + if result.stderr: + f.write(result.stderr) + + return { + "status": "success", + "returncode": result.returncode, + "command": cmd, + "outputs": { + "output_tsv": output_tsv, + "output_bed": output_bed, + "log_file": log_file, + }, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/f5c_merge_methylation_frequencies_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/f5c_merge_methylation_frequencies_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..e2d8a7974a4014e142b9294989d0c2a9bb57796e --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/f5c_merge_methylation_frequencies_test_server.py @@ -0,0 +1,73 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json + +mcp = FastMCP("f5c") + +@mcp.tool() +def merge_methylation_frequencies(input_a: str, input_b: str, output_tsv: str) -> dict: + """ + Merge called and methylated-site counts at shared CpG coordinates and preserve non-overlapping sites. + """ + # Create output parent directories if they don't exist + output_dir = os.path.dirname(os.path.abspath(output_tsv)) + os.makedirs(output_dir, exist_ok=True) + + # Build command exactly as per execution plan + cmd = [ + "f5c", + "freq-merge", + "-o", + output_tsv, + input_a, + input_b + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable not found: {e}", + "command": cmd + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + # Check that output file was created + if not os.path.isfile(output_tsv): + return { + "success": False, + "error": "Output file was not created", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + + return { + "success": True, + "output_tsv": output_tsv, + "input_a": input_a, + "input_b": input_b, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/famsa_align_proteins_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/famsa_align_proteins_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..26e64130b0d21bb38c5981efdec0214b1380c7f4 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/famsa_align_proteins_test_server.py @@ -0,0 +1,95 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("famsa-mcp") + +@mcp.tool() +def align_proteins(input_file: str, output_file: str) -> dict: + """ + Align protein sequences using FAMSA. + + Args: + input_file: Path to input FASTA file + output_file: Path to output alignment file (FASTA format) + + Returns: + Dictionary with execution metadata + """ + # Create output parent directories if they don't exist + output_path = Path(output_file) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "famsa", + "-t", "1", + input_file, + output_file + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + shell=False + ) + except FileNotFoundError: + return { + "success": False, + "error": f"Executable 'famsa' not found. Ensure it is installed and in PATH.", + "command": cmd, + "returncode": None + } + except Exception as e: + return { + "success": False, + "error": f"Execution failed: {str(e)}", + "command": cmd, + "returncode": None + } + + # Check for non-zero exit + if result.returncode != 0: + return { + "success": False, + "error": f"FAMSA exited with code {result.returncode}", + "stderr": result.stderr, + "stdout": result.stdout, + "command": cmd, + "returncode": result.returncode + } + + # Verify output file was created + if not output_path.exists(): + return { + "success": False, + "error": f"Output file {output_file} was not created", + "stderr": result.stderr, + "stdout": result.stdout, + "command": cmd, + "returncode": result.returncode + } + + # Return structured metadata + return { + "success": True, + "command": cmd, + "returncode": result.returncode, + "input_file": input_file, + "output_file": output_file, + "output_exists": True, + "output_size": output_path.stat().st_size if output_path.exists() else 0, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/fastani_compute_ani_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/fastani_compute_ani_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..2b2925697d15ed1e1de6ee0e7c2eece9db655666 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/fastani_compute_ani_test_server.py @@ -0,0 +1,63 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +from pathlib import Path + +mcp = FastMCP("fastani") + + +@mcp.tool() +def compute_ani(query_fasta: str, reference_fasta: str, output_table: str) -> dict: + """ + Compute ANI between a query and reference genome using FastANI. + + Args: + query_fasta: Path to the query genome FASTA file. + reference_fasta: Path to the reference genome FASTA file. + output_table: Path where the output table will be written. + + Returns: + A dictionary with metadata about the execution. + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_table) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "fastANI", + "-q", + query_fasta, + "-r", + reference_fasta, + "--fragLen", + "100", + "-t", + "1", + "-o", + output_table, + ] + + # Run the command without shell=True + result = subprocess.run(cmd, capture_output=True, text=True) + + # Raise on non-zero exit + if result.returncode != 0: + raise RuntimeError( + f"fastANI failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + # Return structured JSON-serializable metadata + return { + "status": "success", + "command": cmd, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "output_table": output_table, + "query_fasta": query_fasta, + "reference_fasta": reference_fasta, + } \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/fastp_preprocess_reads_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/fastp_preprocess_reads_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..6c6f7866bbebbbf3b4a51fe62695082c7502cbae --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/fastp_preprocess_reads_test_server.py @@ -0,0 +1,90 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("fastp") + +@mcp.tool() +def preprocess_reads( + input_fastq: str, + output_fastq: str, + report_json: str, + report_html: str, +) -> dict: + """ + Preprocess a single-end FASTQ file using fastp with minimal filtering. + Adapter trimming and quality filtering are disabled; only length filtering + is effectively disabled by setting length_required to 1. + """ + # Create output parent directories + for path_str in [output_fastq, report_json, report_html]: + path = Path(path_str) + if path.parent and not path.parent.exists(): + path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "fastp", + "-i", input_fastq, + "-o", output_fastq, + "--json", report_json, + "--html", report_html, + "--thread", "1", + "--disable_adapter_trimming", + "--disable_quality_filtering", + "--length_required", "1" + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + return { + "success": False, + "error": f"Executable 'fastp' not found in PATH. Please ensure fastp 1.3.6 is installed.", + "command": cmd + } + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr.strip() else result.stdout.strip() + return { + "success": False, + "error": f"fastp exited with code {result.returncode}: {error_msg}", + "command": cmd, + "stdout": result.stdout, + "stderr": result.stderr + } + + # Read the JSON report if it exists + report_data = None + if os.path.exists(report_json): + try: + with open(report_json, "r") as f: + report_data = json.load(f) + except (json.JSONDecodeError, OSError) as e: + report_data = {"error": f"Failed to parse JSON report: {str(e)}"} + + # Return structured metadata + return { + "success": True, + "command": cmd, + "input_fastq": input_fastq, + "output_fastq": output_fastq, + "report_json": report_json, + "report_html": report_html, + "report": report_data, + "stdout": result.stdout, + "stderr": result.stderr + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/flye_assemble_hifi_reads_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/flye_assemble_hifi_reads_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..dbc13353a3963de094bdfa5a59078728387df5f2 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/flye_assemble_hifi_reads_test_server.py @@ -0,0 +1,104 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("flye-mcp") + +@mcp.tool() +def assemble_hifi_reads(reads_fasta: str, output_dir: str) -> dict: + """ + Assemble PacBio HiFi reads using Flye. + + Args: + reads_fasta: Path to input reads file (FASTA/FASTQ, optionally gzipped) + output_dir: Directory for assembly output + + Returns: + Dictionary with assembly metadata + """ + # Validate input file exists + reads_path = Path(reads_fasta) + if not reads_path.exists(): + raise FileNotFoundError(f"Input reads file not found: {reads_fasta}") + + # Create output directory if it doesn't exist + out_path = Path(output_dir) + out_path.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "flye", + "--pacbio-hifi", + str(reads_path), + "--out-dir", + str(out_path), + "--genome-size", + "10k", + "--threads", + "1", + "--iterations", + "0", + "--min-overlap", + "1000" + ] + + # Execute command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("Flye executable not found in PATH. Please ensure flye is installed.") + except Exception as e: + raise RuntimeError(f"Failed to execute Flye: {str(e)}") + + # Check exit code + if result.returncode != 0: + error_msg = f"Flye failed with exit code {result.returncode}\n" + if result.stderr: + error_msg += f"stderr: {result.stderr}\n" + if result.stdout: + error_msg += f"stdout: {result.stdout}\n" + raise RuntimeError(error_msg) + + # Collect output metadata + assembly_files = [] + if out_path.exists(): + for f in sorted(out_path.iterdir()): + if f.is_file(): + assembly_files.append(str(f)) + + # Check for expected output files + expected_files = [ + "assembly.fasta", + "assembly_graph.gfa", + "assembly_graph.gv", + "assembly_info.txt", + "scaffolds.fasta" # may not exist if scaffolding disabled + ] + + found_files = {} + for expected in expected_files: + fpath = out_path / expected + found_files[expected] = str(fpath) if fpath.exists() else None + + return { + "status": "success", + "output_dir": str(out_path), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "assembly_files": assembly_files, + "expected_outputs": found_files, + "command": cmd + } + +# Keep the server running +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/freebayes_call_variants_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/freebayes_call_variants_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..9032008223838e3fba4d44ab80c94d6e5924891b --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/freebayes_call_variants_test_server.py @@ -0,0 +1,89 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("freebayes") + + +@mcp.tool() +def call_variants( + reference_fasta: str, + input_bam: str, + output_vcf: str, +) -> dict[str, Any]: + """ + Call variants from aligned short-read sequencing data using FreeBayes. + + Args: + reference_fasta: Path to the reference FASTA file. + input_bam: Path to the input BAM file. + output_vcf: Path where the VCF output will be written. + """ + # Validate required inputs + if not reference_fasta: + raise ValueError("reference_fasta is required") + if not input_bam: + raise ValueError("input_bam is required") + if not output_vcf: + raise ValueError("output_vcf is required") + + # Create output parent directory if needed + output_path = Path(output_vcf) + if output_path.parent and not output_path.parent.exists(): + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "freebayes", + "-f", + reference_fasta, + input_bam, + ] + + # Execute the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "freebayes executable not found. Ensure it is installed and in PATH." + ) + + # Check exit code + if result.returncode != 0: + stderr_msg = result.stderr.strip() if result.stderr else "No stderr output" + raise RuntimeError( + f"freebayes failed with exit code {result.returncode}: {stderr_msg}" + ) + + # Write stdout to output file + try: + with open(output_path, "w", encoding="utf-8") as f: + f.write(result.stdout) + except OSError as e: + raise RuntimeError(f"Failed to write output file {output_path}: {e}") + + # Return structured metadata + return { + "endpoint": "call_variants", + "status": "success", + "output_vcf": str(output_path), + "command": cmd, + "exit_code": result.returncode, + "stdout_size": len(result.stdout), + "stderr_size": len(result.stderr), + "stderr_preview": result.stderr[:500] if result.stderr else "", + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/genoboo_launch_local_notebook_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/genoboo_launch_local_notebook_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..54f7d54decdf9c6ba959dd5eb712d272af0b44ed --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/genoboo_launch_local_notebook_test_server.py @@ -0,0 +1,134 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import time +import signal +import json +import urllib.request +import urllib.error +from pathlib import Path + +mcp = FastMCP("genoboo") + +@mcp.tool() +def launch_local_notebook( + config_json: str, + db_dir: str, + storage_dir: str, + landing_html: str, + server_log: str, + mongo_log: str +) -> dict: + """ + Launch a fresh local GeneNoteBook service, verify its HTTP landing page, + and leave no background process running. + """ + # Create output parent directories + for path_str in [landing_html, server_log, mongo_log]: + Path(path_str).parent.mkdir(parents=True, exist_ok=True) + Path(db_dir).mkdir(parents=True, exist_ok=True) + Path(storage_dir).mkdir(parents=True, exist_ok=True) + + # Start mongod + mongo_cmd = [ + "mongod", + "--dbpath", db_dir, + "--port", "39224", + "--bind_ip", "127.0.0.1", + "--logpath", mongo_log + ] + mongo_proc = subprocess.Popen( + mongo_cmd, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True + ) + + # Start genoboo server + genoboo_cmd = [ + "genoboo", + "run", + "--config", config_json, + "--mongo-url", "mongodb://127.0.0.1:39224/genenotebook", + "--storage-path", storage_dir, + "--port", "39223" + ] + server_proc = subprocess.Popen( + genoboo_cmd, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True + ) + + try: + # Poll mongod until ready (up to 30 seconds) + mongo_ready = False + for _ in range(60): + if mongo_proc.poll() is not None: + break + try: + with urllib.request.urlopen("http://127.0.0.1:39224", timeout=1) as resp: + if resp.status == 200: + mongo_ready = True + break + except (urllib.error.URLError, OSError): + pass + time.sleep(0.5) + + if not mongo_ready: + raise RuntimeError("MongoDB failed to start within 30 seconds") + + # Poll genoboo server until ready (up to 60 seconds) + server_ready = False + for _ in range(120): + if server_proc.poll() is not None: + break + try: + with urllib.request.urlopen("http://127.0.0.1:39223/", timeout=1) as resp: + if resp.status == 200: + server_ready = True + break + except (urllib.error.URLError, OSError): + pass + time.sleep(0.5) + + if not server_ready: + raise RuntimeError("Genoboo server failed to start within 60 seconds") + + # Capture landing page + with urllib.request.urlopen("http://127.0.0.1:39223/", timeout=5) as resp: + landing_content = resp.read().decode("utf-8") + with open(landing_html, "w", encoding="utf-8") as f: + f.write(landing_content) + + # Capture server logs + server_stdout, _ = server_proc.communicate(timeout=5) + with open(server_log, "w", encoding="utf-8") as f: + f.write(server_stdout or "") + + # Capture mongo logs + mongo_stdout, _ = mongo_proc.communicate(timeout=5) + with open(mongo_log, "a", encoding="utf-8") as f: + f.write(mongo_stdout or "") + + return { + "status": "success", + "landing_html": landing_html, + "server_log": server_log, + "mongo_log": mongo_log, + "landing_page_size": len(landing_content), + "server_pid": server_proc.pid, + "mongo_pid": mongo_proc.pid + } + + finally: + # Clean up processes + for proc in [server_proc, mongo_proc]: + if proc.poll() is None: + proc.terminate() + try: + proc.wait(timeout=5) + except subprocess.TimeoutExpired: + proc.kill() + proc.wait() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/genometools-genometools_sort_gff3_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/genometools-genometools_sort_gff3_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..33e5f2f40f11ebf45363f9de11bb60cf1735de61 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/genometools-genometools_sort_gff3_test_server.py @@ -0,0 +1,66 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("genometools-genometools") + +@mcp.tool() +def sort_gff3(input_gff3: str, output_gff3: str) -> dict: + """ + Sort and tidy a GFF3 file using GenomeTools. + + Args: + input_gff3: Path to the input GFF3 file. + output_gff3: Path where the sorted and tidied GFF3 output will be written. + + Returns: + A dictionary with metadata about the operation. + """ + # Create output parent directory if it doesn't exist + output_path = Path(output_gff3) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command exactly as specified in the execution plan + cmd = [ + "gt", + "gff3", + "-sort", + "-tidy", + "-o", + output_gff3, + input_gff3 + ] + + # Run the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + # Raise on non-zero exit + if result.returncode != 0: + error_msg = f"gt gff3 failed with exit code {result.returncode}\n" + if result.stderr: + error_msg += f"stderr: {result.stderr}\n" + if result.stdout: + error_msg += f"stdout: {result.stdout}\n" + raise RuntimeError(error_msg) + + # Return structured JSON-serializable metadata + return { + "endpoint": "sort_gff3", + "input_gff3": input_gff3, + "output_gff3": output_gff3, + "returncode": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gffread_extract_transcripts_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gffread_extract_transcripts_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..76e285ccf886a752605d060f998767b8c52c1699 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gffread_extract_transcripts_test_server.py @@ -0,0 +1,99 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("gffread-extract-transcripts") + +@mcp.tool() +def extract_transcripts( + annotation_file: str, + reference_file: str, + output_fasta: str, +) -> dict: + """ + Extract spliced exon sequences for each transcript from a GFF/GTF/BED + annotation file using the reference genome. + + Args: + annotation_file: Path to the input GFF/GTF/BED annotation file. + reference_file: Path to the multi-fasta file with genomic sequences. + output_fasta: Path where the output FASTA file with spliced exons will be written. + """ + # Validate required inputs + annotation_path = Path(annotation_file) + reference_path = Path(reference_file) + output_path = Path(output_fasta) + + if not annotation_path.exists(): + raise FileNotFoundError(f"Annotation file not found: {annotation_path}") + if not reference_path.exists(): + raise FileNotFoundError(f"Reference file not found: {reference_path}") + + # Create output parent directory if needed + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command according to execution plan + cmd = [ + "gffread", + str(annotation_path), + "-g", + str(reference_path), + "-w", + str(output_path), + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError: + raise RuntimeError( + "gffread executable not found. Please ensure it is installed and in PATH." + ) + + if result.returncode != 0: + error_msg = result.stderr.strip() or result.stdout.strip() or "Unknown error" + raise RuntimeError( + f"gffread failed with exit code {result.returncode}: {error_msg}" + ) + + # Verify output was created + if not output_path.exists(): + raise RuntimeError( + f"gffread completed but output file was not created: {output_path}" + ) + + # Gather metadata about the output + output_size = output_path.stat().st_size + output_lines = 0 + transcript_count = 0 + try: + with open(output_path, "r", encoding="utf-8", errors="replace") as f: + for line in f: + output_lines += 1 + if line.startswith(">"): + transcript_count += 1 + except Exception: + pass + + return { + "status": "success", + "command": cmd, + "exit_code": result.returncode, + "output_file": str(output_path), + "output_size_bytes": output_size, + "output_lines": output_lines, + "transcript_count": transcript_count, + "stdout": result.stdout, + "stderr": result.stderr, + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gffutils_build_feature_database_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gffutils_build_feature_database_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..7622e6cdfacee2fa739477d309433d93ea5315a6 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gffutils_build_feature_database_test_server.py @@ -0,0 +1,97 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from typing import Any, Dict + +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("gffutils") + + +@mcp.tool() +def build_feature_database( + input_gff: str, + output_db: str, + output_json: str, +) -> Dict[str, Any]: + """ + Build a SQLite feature database from a GFF file using gffutils, then emit + a deterministic JSON oracle of all features. + + Args: + input_gff: Path to the input GFF/GTF file. + output_db: Path where the SQLite database will be written. + output_json: Path where the JSON feature oracle will be written. + """ + # Create parent directories for all output paths + for path_str in [output_db, output_json]: + path = Path(path_str) + if path.parent and not path.parent.exists(): + path.parent.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + python_code = ( + "import gffutils,json,sys; " + "db=gffutils.create_db(sys.argv[1],dbfn=sys.argv[2],force=True," + "keep_order=True,merge_strategy='merge',sort_attribute_values=True); " + "rows=[{'id':x.id,'seqid':x.seqid,'source':x.source,'type':x.featuretype," + "'start':x.start,'end':x.end,'strand':x.strand," + "'attributes':dict(x.attributes)} for x in " + "db.all_features(order_by=('seqid','start'))]; " + "open(sys.argv[3],'w').write(json.dumps(rows,sort_keys=True)+'\\n')" + ) + + cmd = [ + "python3.6", + "-c", + python_code, + input_gff, + output_db, + output_json, + ] + + # Run the command without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False, + ) + except FileNotFoundError as e: + raise RuntimeError(f"Failed to execute python3.6: {e}") from e + + if result.returncode != 0: + error_msg = ( + f"Command failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + raise RuntimeError(error_msg) + + # Verify that the output files were created + if not os.path.exists(output_db): + raise RuntimeError(f"Expected database file not created: {output_db}") + if not os.path.exists(output_json): + raise RuntimeError(f"Expected JSON file not created: {output_json}") + + # Read the JSON output to include in the response + try: + with open(output_json, "r") as f: + features = json.load(f) + except (json.JSONDecodeError, OSError) as e: + raise RuntimeError(f"Failed to read output JSON: {e}") from e + + return { + "status": "success", + "database_path": output_db, + "json_path": output_json, + "feature_count": len(features), + "features": features, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gimmemotifs_scan_custom_motif_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gimmemotifs_scan_custom_motif_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..790cea98599e4a8ad79ca739af02fc8e71b39b7c --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gimmemotifs_scan_custom_motif_test_server.py @@ -0,0 +1,101 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import sys +import json +from pathlib import Path + +mcp = FastMCP("gimmemotifs-scan-custom-motif") + + +@mcp.tool() +def scan_custom_motif( + input_fasta: str, + motif_pfm: str, + output_bed: str, +) -> dict: + """ + Scan one custom ACGT PFM at a fixed cutoff, report three hits, and use one thread. + + Args: + input_fasta: Path to the input FASTA file. + motif_pfm: Path to the custom ACGT PFM file. + output_bed: Path where the BED output will be written. + """ + # Resolve paths + input_fasta_path = Path(input_fasta) + motif_pfm_path = Path(motif_pfm) + output_bed_path = Path(output_bed) + + # Create output parent directories + output_bed_path.parent.mkdir(parents=True, exist_ok=True) + + # Set up environment + env = os.environ.copy() + env["HOME"] = ".gimme_home" + env["XDG_CONFIG_HOME"] = ".gimme_home/config" + + # Build command + cmd = [ + "gimme", + "scan", + str(input_fasta_path), + "-p", + str(motif_pfm_path), + "-c", + "0.0", + "-n", + "3", + "-N", + "1", + "-b", + ] + + # Run the command + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + env=env, + check=False, + ) + except FileNotFoundError as e: + return { + "success": False, + "error": f"Executable 'gimme' not found: {e}", + "command": cmd, + } + + if result.returncode != 0: + return { + "success": False, + "error": f"Command failed with exit code {result.returncode}", + "stdout": result.stdout, + "stderr": result.stderr, + "command": cmd, + } + + # Write stdout to output file + try: + with open(output_bed_path, "w") as f: + f.write(result.stdout) + except OSError as e: + return { + "success": False, + "error": f"Failed to write output file: {e}", + "command": cmd, + } + + return { + "success": True, + "output_bed": str(output_bed_path), + "command": cmd, + "returncode": result.returncode, + "stdout_length": len(result.stdout), + "stderr": result.stderr, + } + + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/goleft_bam_sample_name_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/goleft_bam_sample_name_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..9cb3a19180053b85138420b21315583ae9dd5faf --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/goleft_bam_sample_name_test_server.py @@ -0,0 +1,63 @@ +import json +import os +import subprocess +import sys +from pathlib import Path +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("goleft-bam_sample_name") + +@mcp.tool() +def bam_sample_name(input_bam: str, output_text: str) -> dict: + """ + Extract the unique SM tag from BAM read-group metadata. + + Args: + input_bam: Path to the input BAM file + output_text: Path where the extracted sample name will be written + """ + # Validate input path + input_path = Path(input_bam) + if not input_path.exists(): + raise FileNotFoundError(f"Input BAM file not found: {input_bam}") + + # Create output parent directory if needed + output_path = Path(output_text) + output_path.parent.mkdir(parents=True, exist_ok=True) + + # Build command: goleft samplename {input_bam} + cmd = ["goleft", "samplename", str(input_path)] + + # Execute without shell=True + try: + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + except FileNotFoundError: + raise RuntimeError("goleft executable not found in PATH") + + # Check exit code + if result.returncode != 0: + error_msg = result.stderr.strip() if result.stderr else f"Exit code {result.returncode}" + raise RuntimeError(f"goleft samplename failed: {error_msg}") + + # Write stdout to output file + output_text_content = result.stdout + with open(output_path, "w", encoding="utf-8") as f: + f.write(output_text_content) + + # Return structured metadata + return { + "endpoint": "bam_sample_name", + "input_bam": str(input_path), + "output_text": str(output_path), + "sample_name": output_text_content.strip(), + "exit_code": result.returncode, + "stderr": result.stderr.strip() if result.stderr else "" + } + +if __name__ == "__main__": + mcp.run() \ No newline at end of file diff --git a/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gseapy_prerank_gene_sets_test_server.py b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gseapy_prerank_gene_sets_test_server.py new file mode 100644 index 0000000000000000000000000000000000000000..d029bc7726f994c13c1432fa5a5fa84eabe227a5 --- /dev/null +++ b/Biomanus-V2/Experiment1/runs/v4_flash_formal_133_20260826/evaluation_generated/direct_prompt/gseapy_prerank_gene_sets_test_server.py @@ -0,0 +1,68 @@ +from mcp.server.fastmcp import FastMCP +import subprocess +import os +import json +import sys +from pathlib import Path + +mcp = FastMCP("gseapy") + +@mcp.tool() +def prerank_gene_sets(ranking_file: str, gene_sets: str, output_dir: str) -> dict: + """ + Run GSEA Prerank analysis with fixed parameters (no plots, 20 permutations, seed 1, one thread). + + Args: + ranking_file: Path to the pre-ranked gene list file (.rnk format) + gene_sets: Path to the gene sets file (.gmt format) + output_dir: Directory where results will be written + + Returns: + Dictionary containing the output directory path and exit status + """ + # Create output directory if it doesn't exist + output_path = Path(output_dir) + output_path.mkdir(parents=True, exist_ok=True) + + # Build the command as specified in the execution plan + cmd = [ + "gseapy", + "prerank", + "-r", ranking_file, + "-g", gene_sets, + "-o", output_dir, + "--no-plot", + "-n", "20", + "--min-size", "2", + "--max-size", "20", + "-s", "1", + "-p", "1" + ] + + try: + # Execute the command without shell=True + result = subprocess.run( + cmd, + capture_output=True, + text=True, + check=False + ) + + if result.returncode != 0: + raise RuntimeError( + f"gseapy prerank failed with exit code {result.returncode}\n" + f"stdout: {result.stdout}\n" + f"stderr: {result.stderr}" + ) + + return { + "output_dir": str(output_path.resolve()), + "exit_code": result.returncode, + "stdout": result.stdout, + "stderr": result.stderr + } + + except FileNotFoundError: + raise RuntimeError("gseapy executable not found. Please ensure it is installed and in PATH.") + except subprocess.SubprocessError as e: + raise RuntimeError(f"Failed to execute gseapy: {str(e)}") \ No newline at end of file