BackgroundFungi are an attractive source of nutrients for predators. As part of their defense, some fungi are able to induce the production of anti-predator protein toxins in response to predation. A previous study on the interaction of the model mushroom Coprinopsis cinerea by the fungivorous nematode Aphelenchus avenae on agar plates has shown that the this fungal defense response is most pronounced in the part of the mycelium that is in direct contact with the nematode. Hence, we hypothesized that, for a comprehensive characterization of this defense response, an experimental setup that maximizes the zone of direct interaction between the fungal mycelium and the nematode, was needed.ResultsIn this study, we conducted a transcriptome analysis of C. cinerea vegetative mycelium upon challenge with A. avenae using a tailor-made microfluidic device. The device was designed such that the interaction between the fungus and the nematode was confined to a specific area and that the mycelium could be retrieved from this area for analysis. We took samples from the confrontation area after different time periods and extracted and sequenced the poly(A)+ RNA thereof. The identification of 1229 differentially expressed genes (DEGs) shows that this setup profoundly improved sensitivity over co-cultivation on agar plates where only 37 DEGs had been identified. The product of one of the most highly upregulated genes shows structural homology to bacterial pore-forming toxins, and revealed strong toxicity to various bacterivorous nematodes. In addition, bacteria associated with the fungivorous nematode A. avenae were profiled with 16S rRNA deep sequencing. Similar to the bacterivorous and plant-feeding nematodes, Proteobacteria and Bacteroidetes were the most dominant phyla in A. avenae.ConclusionsThe use of a novel experimental setup for the investigation of the defense response of a fungal mycelium to predation by fungivorous nematodes resulted in the identification of a comprehensive set of DEGs and the discovery of a novel type of fungal defense protein against nematodes. The bacteria found to be associated with the fungivorous nematode are a possible explanation for the induction of some antibacterial defense proteins upon nematode challenge.Electronic supplementary materialThe online version of this article (10.1186/s12864-019-5607-3) contains supplementary material, which is available to authorized users.