1 Introduction

The motility of microorganism and other self-propelled particles has been studied extensively over the last years, aiming at an understanding of the physical mechanisms of micron-scale self-propulsion and of the rich collective behavior shown by such active particles [13]. In addition, biomedical and environmental applications of functionalized self-propelled particles or microrobots are being developed [46]. Often microorganisms in their natural habitats and microrobots in some of their envisioned applications move in complex environments rather than in a homogeneous space. Therefore, the interactions of self-propelled particles with walls and obstacles play a key role in their motility and have received considerable attention [1].

The complexity of an environment may arise on multiple scales: specifically, an environment may be geometrically complex, e.g., a porous medium, a space filled with obstacles or a maze [710], or the interaction with walls and obstacles may itself be complex and reflect a combination of hydrodynamic and steric interactions [1115] or even behavioral responses to the encounter with an obstacle, such as direction reversals [16].

Both steric and hydrodynamic interactions with walls have been the subject of numerous theoretical and computational as well as experimental studies [1115, 17]. A useful approach to wall interactions is the trapping of microorganisms to microfluidic chambers [14, 15, 18], which is also of interest in itself to understand their behavior in confinement, which is again a common feature of complex natural habits, e.g. in porous media. Surprisingly, the behavior of microorganisms with different hydrodynamic mechanisms was seen to be rather similar under such confinement [14, 15]. The motility of microorganism through arrays of obstacles or through porous materials has also been addressed in several experimental and theoretical studies, but mostly in geometric arrays of pillars of the same morphologies [8, 1922].

In addition to obstacles, the complexity of an environment may reflect directional cues such as chemical gradients or external fields, to which the microrganisms show a behavioral response such as chemotaxis, phototaxis or magnetotaxis [3, 23]. Yet another common factor of complexity is fluid flow for active particles that swim [2426]. Thus, understanding the motility of microrganisms in such environments requires an understanding of the interplay of these different influences, which in general could either have synergistic effects or compete with each other in determining the direction of motion of a microorganism.

Here, we study the navigation of magnetotactic bacteria through a disordered obstacle array as an example for motility in a complex environment. Specifically, we are interested in the interplay of directed motility due to the magnetic field and the randomization of motion required to navigate the obstacles.

Magnetotactic bacteria are a group of bacteria that form a chain of specific organelles called magnetosomes, which contain magnetic nanoparticles and equip the cells with a magnetic moment. As a consequence, the cells align with magnetic fields, resulting in directional swimming of the cells, powered by their flagella, along the field lines of the magnetic field. In their natural habitats, these bacteria follow the magnetic field of the Earth, so they align to fields of the order of 50 µT. The swimming of magnetotactic bacteria has been studied in free space, in the presence of oxygen gradients, in hydrodynamic flow, and in confinement to small chambers [15, 2733].

Here, we study their swimming in obstacle arrays that mimic their natural environment: magnetotactic bacteria are predominantly found in micro-oxic aquatic environments, near the oxic-anoxic transition zone [34]. Often, these micro-oxic regions are found in the sediment rather than in open water, so that magneto-tactic bacteria typically live in a sedimentary environment that is sand or mud. We thus prepare microfluiudic environments that mimic these sediments and consist of arrays of irregularly shaped obstacles. We study the swimming of magnetotactic bacteria through these environments and ask how a magnetic field influences their throughput, as the field directs and constrains their motion, while navigation in the obstacle array requires the exploration of other swimming directions. Based on a combination of swimming experiments in the microfluidic environments and extensive computer simulations of an active Brownian particle model [35], we show that intermediate magnetic field strength of the intensity of the geomagnetic field enhance throughput, while strong fields suppress it. We show that the suppression is due to trapping of bacteria in corners of the obstacle array from which the bacteria can only escape by transiently swimming against the magnetic field direction. This situation is reminiscent of escape problems from statistical physics, but is not driven by thermal fluctuations, but rather by the interplay of active motility and interactions with the obstacle surfaces.

2 Results and discussion

2.1 Characterization of sediment and construction of sediment-mimicking microfluidic channels

To study swimming of magnetotactic bacteria in a near-realistic sediment environment that resembles their natural habitat, we produced microfluidic channels that contained sediment-mimicking obstacles (Fig. 1 and Supporting Figure S1). To that end, we first characterized a sediment sample in water from the magnetotactic bacteria-rich lake Grosser Zernsee (Potsdam, Germany). We determined a 3D reconstruction of the sample using micro-computer tomography (muCT) with a resolution of 1.56 µm (Fig. 2a-d) and analyzed the sizes of sediment particles (sand grains) and of water gaps. In total, the sample consists of 61% sand and 39% water. The distribution of particle sizes is approximately a log-normal distribution with a mean particle diameter of 46 µm (Fig. 2e), which classifies this sediment as silt [36]. The water gap sizes follow a normal distribution with a mean of 43 µm (Fig. 2f).

Construction of sediment-mimicking obstacle channels:

Micro-computer tomography slices of sediment samples (a) are cropped out to ignore border effect due to the reconstruction and binarized (b). The binarized images are then fitted with circles (c) for statistical analysis (grain size distribution in d) and for construction of arrays of pillar-shaped obstacles (e). The images of irregular grains (b) and fitted circles (e) are used as masks to design microfluidic channels with obstacle arrays (f), in which the bacteria are injected in the middle channel (3.5 mm × 1.2 mm × 10 µm) where they encounter the obstacles.

Analysis of micro-computer tomography images of a sediment sample in water:

a) Slice of the sediment sample, b) cube from the center of the cuvette, c) and d) examples of water gaps rendered with the Amira software. e) Distribution of the smallest grain dimension (i.e., trabecular thickness analyzed with CTAn) with Gaussian fit a exp((x− µ)2/c2), µ = 3.83, c = 0.5903, corresponding to a mean sand grain diameter of 46 µm. f) Distribution of the water gap size (i.e., trabecular separation) with Gaussian fit a exp((x−µ)2/c2), µ = 42.94 µm, c = 28.66 µm. g) Percentage of sand over water as function of the distance from the bottom of the cuvette as obtained from 2D slices of the µCT images (yellow filled line) and for the equivalent fit with circles (yellow dashed line). The red points show the mean radius of the fitted circles (± standard error of the mean) in µm (right axis).

We next analyzed two-dimensional slices of the µCT images at various depths of the sample to study if any difference is observed. This analysis returns similar values of the sand to water percentage (62 – 66% from top to bottom, see Fig. 2g, with the small difference possibly due to sedimentation of the sediment under gravity). The mean radii of circular fits to the grains varies from 68 to 62 µm from bottom to top (Fig. 2g), further potentially indicating a slight effect of sedimentation by gravity. This analysis provides the basis for the construction of our 2D microfluidic channels.

To realistically represent the porous environment where magnetotactic bacteria live, we constructed quasitwodimensional microfluidic channels based on the 2D µCT images at different depths (Figure 1). These images (shown in Supporting Figure S2) were used as masks (see Methods), such that each sediment grain becomes an irregularly shaped pillar in our quasi-2D structure. Bacteria thus swim through an array of pillars that act as obstacles for their motion. In addition, we generated channels with cylindrical pillars by fitting circles to the two-dimensional grain images (Figure 1 and Supporting Figure S2). These rounded-shaped pillars of different diameters are used for a comparison of our experiments with computer simulations below.

2.2 Swimming of magnetotactic bacteria through sediment-mimicking obstacle channels

With the sediment-mimicking channels at hand, we studied the motion of magnetotactic bacteria through those channels. A droplet of culture medium containing bacteria was injected into the entrance channel, which is placed under a custom-designed microscope [27], with a controlled magnetic field of either 0 µT (field cancelled), 50 µT (intensity of the geomagnetic field) or 500 (one order of magnitude larger than the geomagnetic field) µT.

We then imaged the entrance and exit regions of the microfluidic channel in an alternating fashion (Figure 3a), with snapshots every 20 s and counted the number of bacteria in these two regions. These counts are noisy and some bacteria pass the channel rapidly, within the first few snapshots. The delay time after which the first bacteria reach the exit region of the channel could therefore not be reliably quantified. Instead, we determined the cumulative density of bacteria in the exit and in the entrance regions of the channel (Figure 3b) and used their ratio, determined 30 min after injecting the bacteria, as a measure of the throughput of bacteria through the channel (see Methods). We determined the throughput in this way for 20 different channels, 10 with irregularly shaped obstacles and 10 with cylindrical pillars (Supporting Figure S2). We obtained very similar results for channels with cylindrical pillars and with irregularly shaped pillars (Supporting Figure S3). However, we found the strength of the magnetic field to have a strong impact on the throughput, with a non-monotonic dependence on the field strength (Figure 3c). The maximal throughput was obtained for the intermediate field strength of 50 µT, while without a field as well as with a field of 500 µT the throughput was smaller. By contrast, for a channel without obstacles, the throughput increased monotonically with the field strength (Supporting Figure S4). This observation suggests that a magnetic field of a similar strength of the Earth’s field enhances the flux of bacteria through the obstacle channel, but a too strong or null magnetic field inhibits it.

Swimming of magnetotactic bacteria through obstacle channels

A) View of a channel, in which the entrance (IN) and exit regions (OUT) are indicated, in which the bacterial density was monitored. The magnetic field points to the left. B) Cumulative bacterial intensity (measuring the cumulative arrival of bacteria) in these two regions, for three different field strengths. C) Bacterial throughput, quantified by the ratio of the cumulative intensities in the OUT and IN regions as function of the magnetic field.

2.3 Simulations of bacterial swimming through obstacle channels

To gain further insight into how magnetotactic bacteria navigate through these complex environments, we compared our experimental findings to numerical simulations. To this end, we modeled the magnetotactic bacteria as dipolar active Brownian particles that align in an external magnetic field and interact with obstacles and walls present in the simulation box (see Methods).

Most parameters of the model have been directly measured, only the interactions with the obstacles have to be parameterized by matching simulations to experimental data. When interacting with an obstacle or a wall, the active particles are subject to a repulsive force as well as a reorienting torque [17]. The latter is parameterized by an interaction parameter α, the only crucial free parameter of our model. α has the units of length and is expected to be a fraction of the size of a bacterium. To adjust this parameter, we observed the motion of magnetotactic bacteria near the obstacles. When a bacterium meets an obstacle, it slides along the contour of that obstacle for some distance before leaving it again, as shown in figure 4a. Similar behavior has been observed in other microorganisms [3739]. We observe the same behavior in the numerical simulations (figure 4b). Here, the sliding distance along an obstacle is greatly influenced by the surface torque parameter α (Supporting Figure S5). Therefore, we calculated distributions of the sliding distances for different values of α and compared these distributions to the one obtained from the experimental observations (see Figure figure 4c). A good match is obtained for α = 0.2 µm. Therefore, all the following numerical simulations where carried out with the interaction parameter set to α = 0.2 µm.

Sliding of bacteria on obstacle surfaces:

(a) Experimental trajectories of sliding bacteria (B = 0). (b) Trajectory of sliding particle in the simulation. The light blue region shows the spatial extent of the particle. Sliding is defined as motion in the sliding region (up to 2 µm from the surface, dotted line), provided that the particle also reaches the region where interactions with the obstacle take place (up to 0.6 µm from the surface, dashed line). The sliding distance is the distance covered tangentially to the surface. (c) Histogram of sliding distances as measured in the experiment (filled black circles) and the simulation (empty markers, for different values of the wall torque parameter α). We find good agreement for α = 0.2 µm.

When analyzing sliding distances from obstacles of different sizes and thus different curvatures, we saw only a weak dependence on the curvature in both experimental and simulated trajectories (Supporting Figures S5 and S6). However, our obstacles are all much larger than the size of the bacteria, so we cannot exclude a curvature dependence for obstacles comparable to their size. We noticed that in the experiments, the bacteria appeared to be slower while sliding along the walls compared to free swimming. This effect was neglected in the simulations.

Next, we simulated the motion of active dipolar particles representing the bacteria through channels with arrays of spherical obstacles (which may overlap as in the experiments with cylindrical pillars). We varied the magnetic field strength and, to obtain a detailed picture of the swimming paths along which bacteria navigate through these channels, simulated channels with differently arranged obstacles, using the same obstacle arrays as in the experiments. In each simulation, we placed 1000 particles at the entrance end of the channel and calculated their individual trajectories for Nsteps = 1 × 106 steps (corresponding to approximately 30 minutes).

Figure 5 shows the time averaged local densities of bacteria during the simulation in one such channel with an external magnetic field of 50 µT pointing from left to right. In this heat map, shades of blue show the density of bacteria that did not arrive at the exit (right end of the channel) within the simulation time, while shades of red show the density of bacteria that did arrive, with purple resulting from a superposition of both color maps. Overall, bacteria are seen to move in a directed fashion, in the direction of the magnetic field (left to right). When they encounter a (single) obstacle, they move along its surface and then leave it, typically tangentially to the surface and in the direction of the magnetic field. In this way, the channel’s geometry organizes the trajectories into “natural paths”. However, when bacteria encounter overlapping obstacles, they can get trapped. Some examples of such traps are marked by green boxes in Figure 5. To escape a trap, bacteria need to reorient temporarily against the direction of the magnetic field. While some traps allow a fraction of the bacteria to escape and eventually arrive at the exit (purple trajectories that turn red), others do not (blue trajectories). Blue trajectories typically end in a trap of the latter type.

Simulated motion of bacteria in an obstacle channel:

Heat maps of the time-averaged density of bacteria from simulations of 2000 bacteria for 30 min with a magnetic field B = 50 µT, pointing from left to right).. The blue map represents bacteria that did not arrive at the right end of the simulation box during the simulated time the red heat map represents those that did. The interplay between magnetic field and the channel’s geometry creates natural paths through the channel. These paths can include or end in traps, formed by overlapping obstacles (examples are indicated by the green boxes).

Figure 6a shows corresponding trajectories (again plotted as heat maps) for different strengths of the magnetic field. Increasing the magnetic field strength has two opposing effects: On the one hand, bacteria are on average more aligned with the direction of the magnetic field and the observed paths through the channel become more focused as their persistence length increases with increasing field. As a consequence, the bacteria are expected to cross the channel faster. For very weak fields, the bacteria explore the channel in an effectively diffusive manner; for the case of 50 µT, we observed one dominant path through most of the channel. On the other hand, bacteria become more susceptible to trapping with increasing field. For a field of 500 µT, no simulated bacterium crossed the channel within the simulation time and the path that was dominant at 50 µT now ends in a trap, from which the bacteria can no longer escape at 500 µT. This negative effect of the magnetic field arises because escape from traps requires that the bacteria transiently orient against the field. These effects thus have opposing influences on the throughput of the channel and provide an explanation for our observation that intermediate field strengths generate the highest throughput. To quantify these observations, we determined the cumulative arrival of bacteria in the exit area, ϕtot, which is plotted in Figure 6b as a function of time. This quantity also exhibits the non-monotonic behavior as a function of the magnetic field. We then performed extensive numerical simulations for a wide range of field strengths and for 10 different channels with different obstacle arrangements. We quantified the time of the first arrival (indicated by circles in Figure 6b) and the overall fraction of bacteria that arrived until the end of the simulation time ϕtot (crosses in Figure 6b) as functions of the field strength (Figure 6 c). The first arrival time decreases with increasing field strength, however, the poor throughput for weak fields is mostly due to the slow arrival of the bulk of the bacteria, while some bacteria still cross the channel on an almost direct path. The fraction of arrivals, by contrast, shows the non-monotonic behavior indicated by our experimental results. Results for different channels (grey lines in Figure 6 c) are qualitatively similar. Quantitatively, the arrival fraction ϕtot shows considerable dependence on the channel geometry, with maximal arrival fractions between 50 and 100 % and maximal throughput in the range between a few and a few tens of µT. By contrast, the first-arrival time t f seems not to be affected by channel geometry (Figure 6 c).

Effect of magnetic field strength on simulated swimming through obstacle channels:

(a) Motion of bacteria in a channel for different values of the field strength B (heat maps of the densities of arriving and non-arriving bacteria, blue and red, respectively, as in Figure 5) (b) Fraction ϕ of simulated bacteria that have arrived up to time t for different B. Circles mark the first-arrival times tf; crosses with thin lines mark total arrival fractions ϕtot. The curve for B = 500 µT remains at 0. (c) First-arrival times tf (top) and total arrival fraction ϕtot (bottom) as a function of the field strength B. With stronger fields, tf converges to the first-arrival time of a persistent swimmer in an empty channel (dashed grey line). ϕtot shows a peak at an intermediate (optimal) field strength, which can be explained by the interplay of two opposing effects that arise with stronger fields: effectively faster motion in the direction of the field and higher susceptibility to trapping. Blue data points show the results for the channel shown in a), gray lines show results in other channels.

2.4 Escape from traps

Our simulations indicate that trapping of bacteria in the corners between overlapping obstacle pillars plays a crucial role for the non-monotonic dependence of the bacterial throughput on the magnetic field. We therefore investigated the escape from traps in more detail by simulating a large number of trap configurations with different geometric features. We first considered symmetric traps as shown in Figure 7a and varied the strengths of the magnetic field and the trap depth d (by varying the overlap between two circular pillars with fixed radius r). In this case, particles escape symmetrically in both directions, with an escape time that is, in a good approximation, exponentially distributed (Figure 7b). Varying the magnetic field strength results in an exponential dependence of the escape time on the field strength (Figure 7c). This result indicates that the escape from a trap is similar to the classical problem of an escape from a potential well due to thermal fluctuations [40, 41], even though the underlying fluctuations that orient the particle against the field are not of thermal origin here, but mostly result from the interaction of the active particle with the obstacle wall. Likewise, we see an approximately exponential dependence on the trap depth d (blue data points in Figure 7e). We also generated a library of traps without the symmetry restriction by choosing the pillar radii and the distance of their centers (parallel and perpendicular to the field) randomly. An example with corresponding escape trajectories is shown in Figure 7d). This set of traps also results in a roughly exponential increase of the escape time τ with trap depth, however with large variability between different traps of the same depth (grey data points in Figure 7e).

Escape from traps: Simulation

(a) Trajectories of 100 bacteria escaping from the apex of a symmetric trap (B = 50 µT). The trap consists of two obstacles of radius 50 µm, in a distance of Δy = 100 µm. This results in a trap depth d = 50 µm. (b) Distribution of escape times of bacteria from the trap in (a). An exponential curve exp(−t/τ) (dashed line) is fitted to the data, with mean escape time τ = 22 s. (c) Dependence of the mean escape time τ on the field strength B for the trap in (a). An exponential curve is fitted to the data (dashed line). (d) Trajectories of 100 bacteria escaping from the apex of a generic trap (B = 50 µT). (e) Dependence of τ on d for B = 50 µT. Blue points show symmetric traps with both obstacles of radius 50 µm, similar to the trap in (a), gray points show a representative sample of all possible traps. An exponential curve is fitted to the blue data points (dashed line).

Finally, we asked whether trapping of bacteria in corners is directly visible in our experiments. For that, we focused on one trap, indicated by the triangular area in Figure 8 (inset) and tracked the bacterial density in that area over time. Indeed, we could see bacteria trapped in this corner as indicated by a constant bacterial density in the trap. We then reduced the field strength in two steps, first from 500 µT to 50 µT and then to 0 µT. After both steps, we could observe a reduction of the bacterial density (Figure 8), indicating the expected release of bacteria from the trap upon reduction of the field and providing direct evidence for trapping in our experiments.

Escape from trap: Experiment

The bacterial density in a trap (indicated by the yellow triangular area in the inset) is monitored over time. At the time points indicated by the arrows, the field strength is reduced (from 500 µT to 50 µT and from 50 µT to 0 µT, respectively), allowing the escape of trapped bacteria.

3 Concluding remarks

In this study, we have used experiments in microfluidic channels and particle-based simulations to address the swimming of magnetotactic bacteria through an obstacle channel mimicking their natural habitat, sediment of a lake. We have shown that the efficiency with which the bacteria navigate through the obstacle array depends on the strength of the magnetic field. For weak fields, the bacteria motion is effectively diffusive and throughput is low, as the bacteria explore the channel in a largely random motion. For high fields, bacteria do not cross the channel as they get trapped in the corners that are created by overlapping cylindrical pillars. To escape from traps, they need to swim against the field, which becomes prohibitively difficult for strong fields. At intermediate field strength, notably comparable to the magnetic field of the Earth that they encounter in the natural habitat, the bacterial throughput is maximal.

Our observation suggests that the ability to swim against the magnetic field, which usually directs the motion of the magnetotactic bacteria may be essential under some conditions such as the escape from traps studied here. This ability requires that the interaction with the magnetic field is not too dominant. Since in the natural habitat, the strength of the field is given by the magnetic field of the Earth and thus fixed, this might constrain the magnetic moment of magnetotactic bacteria. As a consequence, their alignment with a magnetic field of the strength of the Earth’s field will not be perfect, thus reducing the efficiency of magnetic steering. Indeed, the alignment of different strains of magnetotactic bacteria with a field comparable to the Earth field has been observed to be considerably below 100% [3].

The ability to swim against the direction of a magnetic field is also important for magneto-areotactic band formation [35]. Contrary to the situation here, band formation requires swimming against the field direction for an extended amount of time. This is achieved by directional reversals, i.e., backward swimming that allows the bacteria to swim against the magnetic field without antiparallel alignment of their magnetic moment and the field. For escape from a trap, only transient swimming against the field is needed, so direction reversals may be less important here, even though they can also provide a mechanism for escape. In our previous work, we have shown that reversals are rare in M. gryphiswaldense under confinement and that they are not induced by collisions with walls [15]. This may however be different in different species and could for example depend on the mode of propulsion [16], which is rather diverse in magnetotactic bacteria [28]. In general, it will be interesting to see how the competition between magnetic directionality and trapping is resolved in different species. Our microfluidic obstacle channel and our simulations provide tools for such future studies.

4 Methods

4.1 Characterization of sediment

4.1.1 Sample harvesting and preparation

The sediment sample was collected in the Großer Zernsee lake (Potsdam, Germany), from the first layer of sediment (5 cm) in the shallow water nearby the shore. Macroscopic organic matter was manually removed. The sand was stored in lake water, and shaken before sample preparation to avoid strong sedimentation effects. The sample of sand in water was placed in a plastic cuvette of 4 mm in diameter, with a layer of water covering the top of the sand.

4.1.2 Micro-computer tomography

The micro-computer tomography scan was performed with the SkyScan 1172 scanner. For the scans, the following setting were used: X-ray source 89 kV, 112 µA, Image Pixel Size (µm)=1.56, Exposure (ms)=1400, Rotation Step (°)=0.150, with frame averaging. Raw data were reconstructed using NRcon software (Version 1.6.10.4). For the reconstruction: Pixel Size (µm)=1.56202, Reconstruction Angular Range (deg)=360.00, Angular Step (deg)=0.1500, Ring Artifact Correction=10, Smoothing=0, Filter cutoff relative to Nyquist frequency=100, Filter type description=Hamming (Alpha=0.54), Beam Hardening Correction (%)=70.

4.1.3 3D statistical analysis with CTAn

For the statistics, the first 1316 bottom slices were used (2 mm of sample), to avoid slices not completely filled by sand and distortion effects that were seen in the top slices. The microCT images were processed by thresholding with Otsu method, despeckled (for white and black speckles, to reduce the noise) and a Median filter was applied with the the CTAn software (Version 1.16, Brucker). The 3D statistics regarding the grain-size distribution (trabecular thickness) and the water-gap distribution (trabecular separation) was obtained by the CTAn software (Version 1.16, Brucker). In this process, the grain sizes are quantified by the smallest dimension of the sediment grains. The distributions were fitted with a MATLAB fitting tool, using a Gaussian fitting model a exp((x − µ)2/c2). For the grain-size, the fitting was performed on the distribution of the logarithm of the size, while for the water-gaps the fitting was performed on the gap size. The 3D visualization was done with the Amira software.

4.1.4 2D statistical analysis

2D image preparation

The 2D slices obtained from the microCT reconstruction at different regular depths (0, 624, 1248 and 1872 µm) from the bottom of the cuvette, Fig. 1a) were first processed with ImageJ: the images were cropped in the center to avoid the border effects, they were binarized to get black and white masks and a Median filtering was applied for smoothing Fig. 1b.

Circle fitting

Subsequently, the images were analyzed by a custom-made MATLAB program (Fig. 1c): erosion was applied to separate the grains from each other (settings: diamond shape and radius 9 pixels). Subsequently, the centroid function provided the center of each grain and the radius of a circle with equivalent area.

Grain size statistics

The radii of the circular fit were used for calculating the statistics of the slice (Fig. 1d). The percentage of sand was calculated as black pixels number over total number of pixel times 100. While the 3D analysis method estimates the smallest dimension of the grain and thus underestimated grain size, the 2D method slightly overestimates the biggest dimension of the grain (see Fig. 2g).

4.2 Microfluidic channel

4.2.1 Mask template preparation

The 2D microCT binarized and processed images (see section 4.1.4, Fig. 1b), and the binarized images (Fig. 1e) obtained from the circle fitting (see section 4.1.4, Fig. 1c) were adapted to avoid air bubble formation and to improve water perfusion, with water-gaps manually increased in critical points. These binary figures were used as a template to design the photomask in AutoCAD 2015 obtaining 1330 µm-wide microchannels Fig. 1f.

4.2.2 Master mould production

A high resolution chrome photomask was obtained from Compugraphics Jena GmbH and was used to produce a master mould with 10 µm deep features. The master mould was fabricated by baking a silicon wafer at 200 °C for 20 min and allowing it to cool down to room temperature. An SU-8 3010 (MicroChem Inc.) thin film was then spin-coated onto the wafer to a height of 10 µm (spincoating parameters: 15 s at 500 rpm, followed by 30 s at 3,000 rpm), followed by a soft-bake (1 min at 65 °C, followed by 3 min at 95 °C, and 1 min at 65 °C), exposed for 5 s to UV light through the chrome mask with a mask aligner (Kloé UV-KUB 3) according to the manufacturer recommendations, and post-exposure bake (1 min at 65 °C, followed by 3 min at 95 °C, and 1 min at 65 °C). The wafers were then developed with mr-Dev 600 (microresist technologies). Prior to their use, the master molds were treated with 1H,1H,2H,2H-perfluorodecyltriethoxysilane 97% (abcr) to reduce PDMS adhesion upon usage.

4.2.3 Microsystem fabrication

The microfluidic device was produced with polydimethylsiloxane (PDMS) via soft lithography. Briefly, PDMS elastomer monomer and curing agent (Sylgard 184, Dow Corning) were mixed in a ratio 10:1 and then degassed. The PDMS was casted onto the master mold to a height of 5 mm and was cured at 80 °C for 2 h. The inlets for the fluidic channel were then punched with a 1.5 mm diameter biopsy punch (pmfmedical). The PDMS was bonded to a clean glass slide by plasma activation to finish the microfluidic system.

4.3 Swimming in sediment-like obstacle channels

4.3.1 Bacterial culture

Magnetospirillum gryphiswaldense MSR-1 was cultured in MSR-1 growth medium with the composition indicated by Heyen and Schüler [42], with the addition of pyruvate (27 mM) as carbon source instead of lactate. For the creation of an aerotactic band and the subsequent selection of swimming bacteria, the growth medium was supplemented with 0.1% agar. Briefly, 1 mL of bacteria was inoculated into the bottom of a 15 mL Hungate tube filled with 10 mL of MSR-1 growth medium with 0.1% agar. The tube was sealed with a rubber cap pierced with a needle capped with a 0.2 µm filter (Whatman) to allow the formation of an oxygen gradient. To select the North-seeking bacteria (i.e. swimming with the North of their magnet at their front in oxic conditions) in the formed band, the tube was put inside a pair of coils to apply a magnetic field parallel to the oxygen gradient, but pointing downwards to the anoxic region (equivalent to the situation that the bacteria experience in their natural habitat in the Northern Hemisphere). The bacteria were grown at 28 °C and allowed to form an aerotactic band. Once the band had formed, the motile bacteria were selected by aspirating the band with a needle and culturing them for two passes in standard MSR-1 growth medium and microaerobic conditions. Subsequently, the magnetic bacteria were collected with a needle by placing a magnet next to the tube to attract them. The final population of North-seeking bacteria was estimated to be about 80% of the population. In oxic conditions as the ones in our experiment (where oxygen can freely diffuse through the PDMS into the microchannel), these bacteria swim with the North of their magnet at their front. The optical density was measured at 565 nm (OD565) and was adjusted as needed with fresh growth medium for subsequent measurements.

4.3.2 Operation of the chip

The microfluidic system was filled with a syringe pump with MSR-1 standard growth medium at a flow rate of 15µL·min-1 and was incubated at room temperature for 30 min prior to its use. Subsequently, 25 µmL of MSR-1 standard growth medium containing bacteria at an OD565 of 0.1 were placed in the inlet and the bacteria were allowed to swim into the microchannel, placed under a custom-designed magnetic microscope equipped with three pairs of Helmholtz coils [27]. Different magnetic fields intensities (B = 0, 50, 500 µT) were applied parallel to the microchannel length. Bacteria were imaged with a 10x objective using phase contrast microscopy.

4.4 Model and simulations

4.4.1 Equations of Motion

We model a magnetotactic bacterium as an active Brownian sphere in two dimensions that has a permanent dipole moment µ = µ ê with the magnetic strength µ at the particle center [17, 35]. The magnetic moment is aligned with the orientation of the particle ê, which defines the direction of self-propulsion with speed v0. The orientation of the particle is described by an angle φ in the 2d plane. The orientation vector is then given by ê = (cos φ, sin φ) and the position vector is given by r = (x, y). The two-dimensional equations of motion are then

where γT and γR are the translational and rotational drag coefficients, ξ T is the translational stochastic force, and ξ R is the rotational stochastic torque. Both are described by Gaussian white noise with zero mean

DT and DR are the corresponding diffusion coefficients.

F and τ describe forces and torques acting on the particle. In this study, we do not include particle-particle interactions. Forces F thus result solely from interactions with the obstacles representing the sand grains and with the confining walls of the channel. These forces are described by a Weeks-Chandler-Andersen potential between the particle and a virtual particle inside the obstacle (i.e. sand obstacle or wall). The virtual particle is located with its surface at shortest distance to the particle (i.e. with its center at a distance σ/2 from the surface). rS connects the virtual particle to the particle. The repulsive surface force FS is then derived from the potential:

Here, ε calibrates the strength of the force.

The torques τ acting on the particle result from interactions with the obstacles (τS) and the applied external magnetic field (τB). The external magnetic field has magnitude B and is applied in the direction of the exit of the channel. Because the field is homogeneous, particles experience no force but an aligning torque τB = µB sin φ. In addition, a torque arises from steric and hydrodynamic interactions with the surfaces of the obstacles and channel walls [1, 7, 14, 43]. To model the reorientation of the bacteria near a surface, we introduce a surface torque

with a tuning parameter α (with dimension of length), which we determine by matching the sliding distances along an obstacle wall to experimental observations.

For a quantitative comparison between numerical simulations and experimental data, we used the parameter values listed in Table 1.

Model parameters and their values.

4.4.2 Simulations

We solve the equations of motion in two dimensions by using overdamped Brownian dynamics (BD) simulations. The following reduced units were used: time , where is the translational diffusion constant; position r* = r; ε* = ε/kBT; field strength B* = B/B0, where B0 = 1 × 105 T is the order of magnitude of the magnetic field strength of the earth; dipole strength µ* = µB0/kBT. The dimensionless equations of motion were integrated for Nsteps = 5 × 106 time steps using the Euler-Maruyama method [46]with a time step Δt* = 2 × 105. We note that, with this choice of dimensionless units, the self-propulsion velocity is identical to the Péclet number.

For simulations of swimming through obstacle channels, we use spherical obstacles with the same positions and diameters as the cylindrical pillars in our microfluidic channels. We simulated all 10 different obstacle arrays. In each case, we initiated 2000 bacteria at position x = 0 corresponding to the IN region and tracked their motion until they arrived at the end of the channel (with x ≥ 3495 µm) or until the maximal simulated time (of 30 min).

For simulations of the escape from traps, traps with random parameters were constructed from two spherical obstacles as shown in Figure 7 (a) and (d). We simulated the escape of 100 bacteria from each trap to determine the escape time.

4.4.3 Sliding measurements and parameterization of obstacle interactions in the simulations

Figure 4 b) illustrates how we determined the sliding distance. The sliding distance is defined as the arc length (solid green arrow) that is covered by the center of mass trajectory (solid blue line) inside the sliding region (dotted green line). The sliding region was chosen to be slightly larger than the interaction region (orange dotted line), where FS > 0 and thus τS > 0. The sliding region was set to 2 µm, when measured from the obstacles’ surface. This choice allows to compare data from numerical simulations to the experiments. It corresponds to the spatial resolution Δx ≈ 2 µm of the microscope, which limits the precision with which the beginning and the end of contact with an obstacle surface can be identified.

Following that protocol, we measured the sliding distances in the absence of a magnetic field (B = 0) in the numerical simulations and experiment (figure 4 c)) For α = 0.2 µm, the simulations match the experimentally measured sliding distances (Figure 4).

Conflicts of interest

There are no conflicts to declare.

Acknowledgements

Funding from the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation – project ID 446142122) and the ANR (grant PRCI ANR-20-CE92-0051 - project Manaconv) is acknowledged. The simulations were run on the GoeGrid cluster at the University of Göttingen, which is supported by the DFG (project IDs 436382789; 493420525) and MWK Niedersachsen (grant no. 45-10-19-F-02).