We report adsorption isotherms of CO2 and CH4 on the zeolitic imidazolate framework ZIF-7 that exhibit gate opening features associated with a flexible framework structure. This phenomenon has been reported by others for CO2 and light alkanes (e.g. ethane, ethylene, propane), but our study presents for first time experimental data to show that CH4 can also induce a gate opening effect in ZIF-7. Uptakes of CO2, CH4 and N2 on ZIF-7 were measured by a gravimetric adsorption apparatus at temperatures of 303-323 K and pressures up to 4494 kPa. From the CH4 isotherm measured at 303 K the transition pressure for the gate opening in ZIF-7 was estimated as 1245 kPa and the free-energy change associated with the structural phase change was 5.70 kJ mol-1. At an adsorption temperature of 303 K the phase transition pressure for CO2 in ZIF-F was 78 kPa and the free energy change was 2.43 kJ mol-1. The gate opening behaviour observed in this study shows ZIF-7 may have a potential selectivity for CH4 from N2 of more than 10 from an equimolar CH4 + N2 mixture. The equilibrium selectivity of ZIF-7 at 303 K and pressures close to 100 kPa are predicted to be 24 for CO2 from CH4 and 101 for CO2 from N2.