jamescasbon / PyVCF

A Variant Call Format reader for Python.
http://pyvcf.readthedocs.org/en/latest/index.html
Other
402 stars 200 forks source link

file progression #312

Open dridk opened 5 years ago

dridk commented 5 years ago

Hi,

I m trying to monitor progression when reading file... Something like this :

   total = os.path.getsize(filename)
   for record in vcf.Reader(open(filename)):
             progression = record.bytes_read / total * 100  
             print(progression) 

How can I achieve this ? Is there a way to access the current raw line from reader._reader?