#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 12 15:29:34 2018

@author: miri-o
"""

import pandas as pd
import numpy as np
import re

infile = pd.read_csv('/media/miri-o/Documents/CDR3_properties_HCV.csv')
infile['CONDITION'] = [re.split('\d', condition)[0] for condition in infile['SUBJECT']]

# generate a vector for total 50k sampled junctions 

n = 50000
np.random.seed(0)
random_indexes = np.random.choice(len(infile['CONDITION']),n)

sampled_rows_df = infile.loc[random_indexes, :]
sampled_rows_df.to_csv('/media/miri-o/Documents/files_to_vectorise/HCV_sampled_50k.csv', columns = ['SEQUENCE_ID','JUNC_AA', 'JUNC_AA_LEN','SUBJECT', 'CONDITION'], index = True, index_label = 'original_index')
778c62cc2536a24f2aaa28755cea388f71d2c253
<mask token>

<mask token>
np.random.seed(0)
<mask token>
sampled_rows_df.to_csv(
    '/media/miri-o/Documents/files_to_vectorise/HCV_sampled_50k.csv',
    columns=['SEQUENCE_ID', 'JUNC_AA', 'JUNC_AA_LEN', 'SUBJECT',
    'CONDITION'], index=True, index_label='original_index')

<mask token>
infile = pd.read_csv('/media/miri-o/Documents/CDR3_properties_HCV.csv')
infile['CONDITION'] = [re.split('\\d', condition)[0] for condition in
    infile['SUBJECT']]
n = 50000
np.random.seed(0)
random_indexes = np.random.choice(len(infile['CONDITION']), n)
sampled_rows_df = infile.loc[random_indexes, :]
sampled_rows_df.to_csv(
    '/media/miri-o/Documents/files_to_vectorise/HCV_sampled_50k.csv',
    columns=['SEQUENCE_ID', 'JUNC_AA', 'JUNC_AA_LEN', 'SUBJECT',
    'CONDITION'], index=True, index_label='original_index')

<mask token>
import pandas as pd
import numpy as np
import re
infile = pd.read_csv('/media/miri-o/Documents/CDR3_properties_HCV.csv')
infile['CONDITION'] = [re.split('\\d', condition)[0] for condition in
    infile['SUBJECT']]
n = 50000
np.random.seed(0)
random_indexes = np.random.choice(len(infile['CONDITION']), n)
sampled_rows_df = infile.loc[random_indexes, :]
sampled_rows_df.to_csv(
    '/media/miri-o/Documents/files_to_vectorise/HCV_sampled_50k.csv',
    columns=['SEQUENCE_ID', 'JUNC_AA', 'JUNC_AA_LEN', 'SUBJECT',
    'CONDITION'], index=True, index_label='original_index')

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 12 15:29:34 2018

@author: miri-o
"""

import pandas as pd
import numpy as np
import re

infile = pd.read_csv('/media/miri-o/Documents/CDR3_properties_HCV.csv')
infile['CONDITION'] = [re.split('\d', condition)[0] for condition in infile['SUBJECT']]

# generate a vector for total 50k sampled junctions 

n = 50000
np.random.seed(0)
random_indexes = np.random.choice(len(infile['CONDITION']),n)

sampled_rows_df = infile.loc[random_indexes, :]
sampled_rows_df.to_csv('/media/miri-o/Documents/files_to_vectorise/HCV_sampled_50k.csv', columns = ['SEQUENCE_ID','JUNC_AA', 'JUNC_AA_LEN','SUBJECT', 'CONDITION'], index = True, index_label = 'original_index')