Skip to content

Conversation

@stevenweaver
Copy link
Member

Summary

  • Fix critical issue where FEL jobs were writing empty alignment and tree files for local execution
  • Resolve data streaming pipeline from frontend to HYPHY execution
  • Add proper parameter handling for branches selection

Changes Made

Data Streaming Fixes

  • Router (lib/router.js): Extract alignment data from first parameter as stream for FEL jobs
  • Server (server.js): Merge tree data into job params and add comprehensive logging
  • HyphyJob (app/hyphyjob.js): Enhanced file writing with detailed logging and error handling
  • FEL Constructor (app/fel/fel.js): Improved parameter extraction and tree data handling

Parameter Handling

  • Add branches parameter support with proper extraction and shell script parsing
  • Fix hardcoded branch parameters (FG/All) to use dynamic $BRANCHES variable
  • Change default resample value from 100 to 1 for faster execution

Logging & Debugging

  • Add comprehensive logging throughout the pipeline to trace data flow
  • Enhanced error reporting for file writing operations
  • Better parameter validation and debugging information

Files Modified

  • lib/router.js - Data extraction and routing fixes
  • server.js - Parameter merging and logging
  • app/fel/fel.js - Parameter handling and constructor improvements
  • app/fel/fel.sh - Dynamic parameter usage and branch selection
  • app/hyphyjob.js - File writing enhancements and logging

Test Results

✅ Alignment files now contain proper FASTA data (585 bytes)
✅ Tree files now contain proper Newick data (214 bytes)
✅ HYPHY successfully processes both files
✅ FEL analysis completes successfully with real biological data

Technical Details

The issue was in the data flow pipeline:

  1. Frontend sends {alignment: "...", tree: "...", job: {...}}
  2. Router was setting stream = null instead of extracting alignment data
  3. Tree data wasn't being passed to FEL constructor
  4. Hardcoded branch parameters caused HYPHY validation errors

All issues have been resolved and the complete pipeline now works end-to-end.

🤖 Generated with Claude Code

stevenweaver and others added 3 commits July 19, 2025 17:20
- Modified job.js submit() method to handle local execution when submit_type is "local"
- Enhanced submit_local() function with proper error handling and status updates
- Added LocalJobStatus class for local job monitoring
- Added localJobDelete() function for local job cancellation
- Updated CLIENT_INTEGRATION_GUIDE.md to document local execution option
- Added test setup script for local execution verification

This enables running bioinformatics analyses directly on the local machine without requiring TORQUE or SLURM schedulers.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Fix router.js to extract alignment data from first parameter as stream for FEL jobs
- Add comprehensive logging to trace file writing process through server.js, fel.js, and hyphyjob.js
- Fix tree data extraction by merging tree parameter into job params in server.js
- Add branches parameter support to FEL job with proper shell script parsing
- Change default resample value from 100 to 1 for faster execution
- Fix hardcoded branch parameters (FG/All) to use dynamic BRANCHES variable in fel.sh

Resolves issue where FEL jobs were writing empty alignment and tree files,
now properly streams FASTA alignment data and Newick tree data to HYPHY.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add comprehensive FEL analysis data format specification
- Document new payload structure with alignment and tree data
- Add complete event handling examples with data structures
- Include working FELAnalysisClient class example
- Add data validation requirements for FASTA and Newick formats
- Update parameter validation and error handling sections
- Distinguish FEL format from standard socket.io-stream format

Provides complete integration guide for frontend developers
to properly implement FEL analysis with the corrected data format.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants