Projecting proteins and random walks: knotting in open curves via virtual knots