def print_sequences(args): db = sqlite3.connect(args.dbname) sql = fetch_reads if args.limit is not None: sql += ' LIMIT {}'.format(args.limit) for defline, blob in db.execute(sql).fetchall(): x = FASTQ(blob) # x._def = "{}".format(rid) x._def = defline x.unpack() print(x)
# from FASTQ import * def print_info(seq): print() print('defline: ', seq.defline()) print('sequence: ', seq.sequence()) print('quality: ', seq.quality()) print('blob: ', seq.blob()) # Create a FASTQ object from a string seq1 = FASTQ('@NS500451\nNCAAGNGCCA\n+\n#AAAA#FFFF') # The _repr_ method returns a string suitable for printing in a FASTQ file: print('Test Sequence 1:') print(seq1) # Print the attributes: print_info(seq1) # Compress the sequence, print the attributes again: seq1.pack() print_info(seq1)