def extract(infile):
    '\n    Merges bioindex.tsv with the infile (balanced data),\n    finds the volsplit.zip location for each bio file and \n    extracts the files into secure_volume/holding_folder.\n    '
    bioindex = pd.read_csv('/media/secure_volume/index/bioindex.tsv', sep='\t')
    balanced_bioindex = pd.read_table(infile)
    for suffix in balanced_bioindex.filesuffix.unique():
        volsplit_file = (('volsplit' + str(suffix)) + '.zip')
        volsplit_df = balanced_bioindex.loc[(balanced_bioindex.filesuffix == suffix), :]
        try:
            with zipfile.ZipFile(('/media/secure_volume/' + volsplit_file), 'r') as myzip:
                for (idx, row) in volsplit_df.iterrows():
                    filename = (row['mainid'] + '.zip')
                    myzip.extract(filename, '/media/secure_volume/holding_folder')
        except Exception as e:
            print('ERROR:', filename, 'not found in', volsplit_file, '!', e)
Merges bioindex.tsv with the infile (balanced data),
finds the volsplit.zip location for each bio file and 
extracts the files into secure_volume/holding_folder.
def extract(infile):
    '\n    Merges bioindex.tsv with the infile (balanced data),\n    finds the volsplit.zip location for each bio file and \n    extracts the files into secure_volume/holding_folder.\n    '
    bioindex = pd.read_csv('/media/secure_volume/index/bioindex.tsv', sep='\t')
    balanced_bioindex = pd.read_table(infile)
    for suffix in balanced_bioindex.filesuffix.unique():
        volsplit_file = (('volsplit' + str(suffix)) + '.zip')
        volsplit_df = balanced_bioindex.loc[(balanced_bioindex.filesuffix == suffix), :]
        try:
            with zipfile.ZipFile(('/media/secure_volume/' + volsplit_file), 'r') as myzip:
                for (idx, row) in volsplit_df.iterrows():
                    filename = (row['mainid'] + '.zip')
                    myzip.extract(filename, '/media/secure_volume/holding_folder')
        except Exception as e:
            print('ERROR:', filename, 'not found in', volsplit_file, '!', e)