utils/genome_search_utils.py
def split_seq_file(seq_file, size, dest_dir=None):
    """
    Splits a fasta sequence file of size X into chunks of specified size using
    Bio-Easel's esl-ssplit.pl

    seq_file (string): A string representing the path to the sequence file
    size (int): An integer specifying the size of the file chunks
    dest_dir (string): A string representing the path to the output directory
    """

    # get seq_file's size
    seq_file_size = os.path.getsize(seq_file)

    # calculate number of files to split seq_file to
    chunks_no = int(math.ceil(seq_file_size / size))

    # execute command
    try:
        cmd = ''
        filename = os.path.basename(seq_file).partition('.')[0]

        if dest_dir is None:
            cmd = "esl-ssplit.pl -n -r %s %s" % (seq_file, str(chunks_no))
        else:
            cmd = "esl-ssplit.pl -n -r -oroot %s -odir %s %s %s" % (filename, dest_dir, seq_file, str(chunks_no))

        subprocess.call(cmd, shell=True)

    except:
        raise IOError

    Splits a fasta sequence file of size X into chunks of specified size using
    Bio-Easel's esl-ssplit.pl

    seq_file (string): A string representing the path to the sequence file
    size (int): An integer specifying the size of the file chunks
    dest_dir (string): A string representing the path to the output directory
    
Splits a fasta sequence file of size X into chunks of specified size using
Bio-Easel's esl-ssplit.pl

seq_file (string): A string representing the path to the sequence file
size (int): An integer specifying the size of the file chunks
dest_dir (string): A string representing the path to the output directory
Splits a fasta sequence file of size X into chunks of specified size using Bio - Easel ' s esl - ssplit . pl seq_file ( string ) : A string representing the path to the sequence file size ( int ) : An integer specifying the size of the file chunks dest_dir ( string ) : A string representing the path to the output directory
def split_seq_file(seq_file, size, dest_dir=None):
    seq_file_size = os.path.getsize(seq_file)
    chunks_no = int(math.ceil(seq_file_size / size))
    try:
        cmd = ''
        filename = os.path.basename(seq_file).partition('.')[0]
        if dest_dir is None:
            cmd = "esl-ssplit.pl -n -r %s %s" % (seq_file, str(chunks_no))
        else:
            cmd = "esl-ssplit.pl -n -r -oroot %s -odir %s %s %s" % (filename, dest_dir, seq_file, str(chunks_no))
        subprocess.call(cmd, shell=True)
    except:
        raise IOError
def split_seq_file ( seq_file , size , dest_dir = None ) : seq_file_size = os . path . getsize ( seq_file ) chunks_no = int ( math . ceil ( seq_file_size / size ) ) try : cmd = '' filename = os . path . basename ( seq_file ) . partition ( '.' ) [ 0 ] if dest_dir is None : cmd = "esl-ssplit.pl -n -r %s %s" % ( seq_file , str ( chunks_no ) ) else : cmd = "esl-ssplit.pl -n -r -oroot %s -odir %s %s %s" % ( filename , dest_dir , seq_file , str ( chunks_no ) ) subprocess . call ( cmd , shell = True ) except : raise IOError
Splits a fasta sequence file of size X into chunks of specified size using
Bio-Easel's esl-ssplit.pl
Splits a fasta sequence file of size X into chunks of specified size using Bio - Easel ' s esl - ssplit . pl
"""
    Splits a fasta sequence file of size X into chunks of specified size using
    Bio-Easel's esl-ssplit.pl

    seq_file (string): A string representing the path to the sequence file
    size (int): An integer specifying the size of the file chunks
    dest_dir (string): A string representing the path to the output directory
    """ # get seq_file's size # calculate number of files to split seq_file to # execute command
seq_file
size
dest_dir