\documentclass[tikz]{standalone} \usepackage{luacode} \usepackage{tikz} \begin{document} \begin{tikzpicture} \newcommand{\seqone}{TGCATA} \newcommand{\seqtwo}{ATCTGAT} \begin{luacode} local needle = require("needle") seq1 = \luastring{\seqone} seq2 = \luastring{\seqtwo} local tikz_code = needle.draw(seq1, seq2) tex.print(tikz_code) \end{luacode} \end{tikzpicture} \end{document}