<commit_before>#!/usr/bin/env python

'''
Compare the forward and reverse fastq files. Find pairs of reads that occur in both files.
Output those reads.
'''

import sys
import util

def fastq_ids(lines):
    '''Extract the read IDs (with no @) from a fastq file'''
    return [at_line[1:] for at_line, seq_line, quality_line in util.fastq_iterator(lines)]

def common_ids(fastq1, fastq2):
    '''
    Get a list of IDs corresponding to reads found in the two fastq files.

    Parameters
    fastq1, fastq2 : sequence or iterator of strings
        lines from the fastq files

    Returns
    common_ids : set
        ids (not including the @)
    '''

    ids1 = set(fastq_ids(fastq1))
    ids2 = set(fastq_ids(fastq2))
<commit_msg>intersect: added critical argparse import<commit_after>#!/usr/bin/env python

'''
Compare the forward and reverse fastq files. Find pairs of reads that occur in both files.
Output those reads.
'''

import sys, argparse
import util

def fastq_ids(lines):
    '''Extract the read IDs (with no @) from a fastq file'''
    return [at_line[1:] for at_line, seq_line, quality_line in util.fastq_iterator(lines)]

def common_ids(fastq1, fastq2):
    '''
    Get a list of IDs corresponding to reads found in the two fastq files.

    Parameters
    fastq1, fastq2 : sequence or iterator of strings
        lines from the fastq files

    Returns
    common_ids : set
        ids (not including the @)
    '''

    ids1 = set(fastq_ids(fastq1))
    ids2 = set(fastq_ids(fastq2))

{'fraction_non_alphanumeric': 0.08909574468085106, 'fraction_numerical': 0.011968085106382979, 'mean_word_length': 3.324712643678161, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3653001', 'n_tokens_mistral': 485, 'n_tokens_neox': 472, 'n_words': 177}