def print_to_file(self, filename="stdout", sorted=False):
        if sorted:
            self.sort(key=self.key)

        fw = must_open(filename, "w")
        for b in self:
            if b.start < 1:
                logging.error("Start < 1. Reset start for `{0}`.".format(b.accn))
                b.start = 1
            print >> fw, b
        fw.close()
dataset/ETHPy150Open tanghaibao/jcvi/formats/bed.py/Bed.print_to_file/original