Scripts/CNV_vis.py
def fetch_reads(regions):
    """ The fetch_reads function fetches the reads and matches them with their pairs from the regions specified in the
    regions list.

    :param regions: A list containing the chromosome and coordinates for every region.
    :return all_reads: A list containing the number of reads in the specified region
    """
    bamfile = pysam.AlignmentFile(args.bam, 'rb')
    all_reads = []

    for loc in regions:
        reads = bamfile.fetch(str(loc[0]), int(loc[1]), int(loc[2]))

        all_reads.append(list(reads))

    bamfile.close()

    return all_reads
 The fetch_reads function fetches the reads and matches them with their pairs from the regions specified in the
    regions list.

    :param regions: A list containing the chromosome and coordinates for every region.
    :return all_reads: A list containing the number of reads in the specified region
    
The fetch_reads function fetches the reads and matches them with their pairs from the regions specified in the
regions list.
The fetch_reads function fetches the reads and matches them with their pairs from the regions specified in the regions list .
def fetch_reads(regions):
    bamfile = pysam.AlignmentFile(args.bam, 'rb')
    all_reads = []
    for loc in regions:
        reads = bamfile.fetch(str(loc[0]), int(loc[1]), int(loc[2]))
        all_reads.append(list(reads))
    bamfile.close()
    return all_reads
def fetch_reads ( regions ) : bamfile = pysam . AlignmentFile ( args . bam , 'rb' ) all_reads = [ ] for loc in regions : reads = bamfile . fetch ( str ( loc [ 0 ] ) , int ( loc [ 1 ] ) , int ( loc [ 2 ] ) ) all_reads . append ( list ( reads ) ) bamfile . close ( ) return all_reads
The fetch_reads function fetches the reads and matches them with their pairs from the regions specified in the
regions list.
The fetch_reads function fetches the reads and matches them with their pairs from the regions specified in the regions list .
""" The fetch_reads function fetches the reads and matches them with their pairs from the regions specified in the
    regions list.

    :param regions: A list containing the chromosome and coordinates for every region.
    :return all_reads: A list containing the number of reads in the specified region
    """
A list containing the number of reads in the specified region
A list containing the number of reads in the specified region
all_reads
regions
A list containing the chromosome and coordinates for every region.
A list containing the chromosome and coordinates for every region .