File size: 879 Bytes
c97e6e7 6c1102a 20e855d 3a4a990 c97e6e7 6c1102a c97e6e7 6c1102a c97e6e7 6c1102a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import pandas as pd
df = pd.read_csv('https://services.healthtech.dtu.dk/services/DeepLoc-2.0/data/Swissprot_Train_Validation_dataset.csv').drop(['Unnamed: 0', 'Partition'], axis=1)
df['labels'] = df[['Cell membrane', 'Cytoplasm','Endoplasmic reticulum', 'Extracellular', 'Golgi apparatus', 'Lysosome/Vacuole', 'Mitochondrion', 'Nucleus', 'Peroxisome', 'Plastid']].astype('float16').values.tolist()
df['Membrane'] = df['Membrane'].astype('int8')
df = df[['Kingdom', 'ACC', 'Sequence','Membrane','labels']]
train = df.sample(frac=0.8)
df = df.drop(train.index)
val = df.sample(frac=0.5)
test = df.drop(val.index)
train = train.reset_index(drop=True)
val = val.reset_index(drop=True)
test = test.reset_index(drop=True)
train.to_parquet('deeploc-train.parquet', index=False)
val.to_parquet('deploc-val.parquet', index=False)
test.to_parquet('deeploc-test.parquet', index=False)
|