harbor run -t openthoughts/tasktrove-exp-rpt-stack-dockerfile-gpt5mini-v3-stack-dockerfile-gpt4o-4245harbor download openthoughts/tasktrove-exp-rpt-stack-dockerfile-gpt5mini-v3-stack-dockerfile-gpt4o-4245Task: Protein clustering and alignment pipeline
Write a self-contained Python application (and minimal test) and place all files under /app/. The application will cluster protein sequences using DIAMOND + MCL and produce per-cluster multiple sequence alignments using MUSCLE. The environment already has DIAMOND, mcl, and muscle installed; call them via subprocess.
Requirements
Program entry point
Input
Processing pipeline (implement exactly these steps) a. Build a DIAMOND database for the input FASTA (diamond makedb). b. Run DIAMOND blastp in all-vs-all mode (query = input FASTA, db = created DB), retrieving up to 500 hits per query, output format tabular with at least: qseqid sseqid bitscore. Use the specified number of threads. c. Filter DIAMOND hits to include only matches with bitscore >= min-bitscore. Discard self-hits (qseqid == sseqid). d. Convert the filtered hits into an MCL input edge list: one line "qseqid sseqid weight" where weight is the bitscore (use integer or float as produced). Ensure edges are undirected / symmetric for MCL (i.e., if only one direction present, include both directions or otherwise ensure MCL sees both). e. Run mcl on the edge list with the given inflation parameter. Capture clusters output. f. Parse MCL output into clusters, assigning sequential cluster IDs (1,2,3,...). For clusters with a single sequence, still include them as cluster of size 1. g. For each cluster with size >= 2, extract the member sequences from the input FASTA and run MUSCLE to produce a multiple sequence alignment in FASTA or CLUSTAL format. Save each alignment as output_dir/alignments/cluster_<N>.aln (where <N> is the cluster ID). For singletons, you may skip alignment or write a trivial alignment file containing the single sequence. h. Create a cluster summary JSON file output_dir/clusters.json containing for each cluster:
Implementation details and constraints
Tests
Deliverables (what your repository /app/ should contain)
Expected behavior / example usage
Notes / hints
The task must be solved entirely inside the container environment; place the final solution files under /app/ so automatic evaluation can run the script.