Nanotubes hold promise for a number of biological and materials applications because of their high aspect ratio and encapsulation potential. A particularly attractive goal is to access nanotubes that exert well-defined control over their cargo, such as selective encapsulation, precise positioning of the guests along the nanotube length and triggered release of this cargo in response to specific external stimuli. Here, we report the construction of DNA nanotubes with longitudinal variation and alternating larger and smaller capsules along the tube length. Size-selective encapsulation of gold nanoparticles into the large capsules of these tubes leads to 'nanopeapod' particle lines with positioning of the particles 65 nm apart. These nanotubes can then be opened when specific DNA strands are added to release their particle cargo spontaneously. This approach could lead to new applications of self-assembled nanotubes, such as in the precise organization of one-dimensional nanomaterials, gene-triggered selective delivery of drugs and biological sensing.