lmdu / pyfastx

a python package for fast random access to sequences from plain and gzipped FASTA/Q files
https://pyfastx.readthedocs.io
MIT License
262 stars 23 forks source link

streaming multiple fastq files at the same time? #42

Open Irenexzwen opened 2 years ago

Irenexzwen commented 2 years ago

Hi, is it possible to open multiple fastq files (and process) at the same time using pyfastx.Fastq? With file handle, I could do something like this:

with gzip.open(R1_fastq_file, 'r') as R1: 
    with gzip.open(R2_fastq_file,'r') as R2:
        with open(output_path, 'w') as out:
            DO SOMETHING HERE...

Is it possible to achieve the same thing using pyfastx? The situation here is I need information from both read1 and read2 fastq file, and I need to scan through a really large pair-end fastq file.

Thank you!

lmdu commented 2 years ago

It's very complicated. Currently, I could not resolve this problem.