def process_fastq_rich(fastq, **kwargs):
logging.info("<STR_LIT>")<EOL>inputfastq = handle_compressed_input(fastq)<EOL>res = []<EOL>for record in SeqIO.parse(inputfastq, "<STR_LIT>"):<EOL><INDENT>try:<EOL><INDENT>read_info = info_to_dict(record.description)<EOL>res.append(<EOL>(nanomath.ave_qual(record.letter_annotations["<STR_LIT>"]),<EOL>len(record),<EOL>read_info["<STR_LIT>"],<EOL>read_info["<STR_LIT>"],<EOL>read_info["<STR_LIT>"]))<EOL><DEDENT>except KeyError:<EOL><INDENT>logging.error("<STR_LIT>".format(record.description))<EOL>sys.exit("<STR_LIT>".format(<EOL>record.description))<EOL><DEDENT><DEDENT>df = pd.DataFrame(<EOL>data=res,<EOL>columns=["<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]).dropna()<EOL>df["<STR_LIT>"] = df["<STR_LIT>"].astype("<STR_LIT>")<EOL>return ut.reduce_memory_usage(df)<EOL>
Extract metrics from a richer fastq file.

    Extract information from fastq files generated by albacore or MinKNOW,
    containing richer information in the header (key-value pairs)
    read=<int> [72]
    ch=<int> [159]
    start_time=<timestamp> [2016-07-15T14:23:22Z]  # UTC ISO 8601 ISO 3339 timestamp
    Z indicates UTC time, T is the delimiter between date expression and time expression
    dateutil.parser.parse("2016-07-15T14:23:22Z") imported as dparse
    -> datetime.datetime(2016, 7, 15, 14, 23, 22, tzinfo=tzutc())