Examples#
This page contains example code and configuration files for extending NexusLIMS.
Instrument Profiles#
local_profile_example.py#
A comprehensive, production-ready example of a local instrument profile that demonstrates:
Custom parser functions - Add warnings, detect special acquisition modes, parse vendor-specific formats
Facility metadata injection - Add consistent site-specific metadata to all files
Filename-based heuristics - Detect data types from filename patterns
Static metadata - Inject fixed values for all acquisitions
Best practices - Proper logging, error handling, and documentation
Use this example to:
Create custom profiles for instruments unique to your facility
Understand the full capabilities of the InstrumentProfile system
Learn common patterns for metadata extraction customization
How to use:
Copy this file to your local profiles directory (configured via
NX_LOCAL_PROFILES_PATH)Change the
instrument_idto match your instrument’s name in the databaseCustomize the parser functions for your specific needs
Restart NexusLIMS - the profile will be automatically discovered and loaded
See the Instrument Profiles documentation for detailed information about creating and using instrument profiles.
Contributing Examples#
Have a useful example or pattern you’d like to share? Consider contributing it to this directory:
Ensure your example is well-documented with inline comments
Follow the existing code style and structure
Test your example thoroughly
Submit a pull request to the NexusLIMS repository
Examples that demonstrate common use cases, best practices, or solve frequent challenges are especially welcome!