Scripts/softclip_graph.py
def fetch_reads():
    """ The fetch_reads function fetches the reads from the bam file

    :return reads: Pysam object containing read information
    """
    bamfile = pysam.AlignmentFile(args.bam, 'rb')

    if args.region == 'all':
        reads = bamfile.fetch()

    else:
        if ':' in args.region and '-' in args.region:
            chromosome, start, end = re.split(':|-', args.region)
            chromosome = chromosome.replace('chr', '')

            reads = bamfile.fetch(chromosome, int(start), int(end))

        else:
            chromosome = args.region.replace('chr', '')
            reads = bamfile.fetch(chromosome)

    return reads
 The fetch_reads function fetches the reads from the bam file

    :return reads: Pysam object containing read information
    
The fetch_reads function fetches the reads from the bam file
The fetch_reads function fetches the reads from the bam file
def fetch_reads():
    bamfile = pysam.AlignmentFile(args.bam, 'rb')
    if args.region == 'all':
        reads = bamfile.fetch()
    else:
        if ':' in args.region and '-' in args.region:
            chromosome, start, end = re.split(':|-', args.region)
            chromosome = chromosome.replace('chr', '')
            reads = bamfile.fetch(chromosome, int(start), int(end))
        else:
            chromosome = args.region.replace('chr', '')
            reads = bamfile.fetch(chromosome)
    return reads
def fetch_reads ( ) : bamfile = pysam . AlignmentFile ( args . bam , 'rb' ) if args . region == 'all' : reads = bamfile . fetch ( ) else : if ':' in args . region and '-' in args . region : chromosome , start , end = re . split ( ':|-' , args . region ) chromosome = chromosome . replace ( 'chr' , '' ) reads = bamfile . fetch ( chromosome , int ( start ) , int ( end ) ) else : chromosome = args . region . replace ( 'chr' , '' ) reads = bamfile . fetch ( chromosome ) return reads
The fetch_reads function fetches the reads from the bam file
The fetch_reads function fetches the reads from the bam file
""" The fetch_reads function fetches the reads from the bam file

    :return reads: Pysam object containing read information
    """
Pysam object containing read information
Pysam object containing read information
reads