Skip to content

Commit

Permalink
add demo
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidic committed May 6, 2022
1 parent 5f1a855 commit 6280176
Show file tree
Hide file tree
Showing 3 changed files with 418 additions and 4 deletions.
2 changes: 1 addition & 1 deletion STELLAR_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def main():
parser = argparse.ArgumentParser(description='STELLAR')
parser.add_argument('--dataset', default='CODEX', help='dataset setting')
parser.add_argument('--dataset', default='TonsilBE', help='dataset setting')
parser.add_argument('--seed', type=int, default=1, metavar='S', help='random seed (default: 1)')
parser.add_argument('--name', type=str, default='STELLAR')
parser.add_argument('--epochs', type=int, default=20)
Expand Down
6 changes: 3 additions & 3 deletions datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def load_hubmap_data(labeled_file, unlabeled_file, distance_thres, sample_rate):

def load_tonsilbe_data(filename, mapping_filename, distance_thres, sample_rate):
df = pd.read_csv(filename)
df_sample = df.sample(n=round(sample_rate*len(df)), random_state=1)
train_df = df_sample.loc[df['sample_name'] == 'tonsil']
test_df = df_sample.loc[df_sample['sample_name'] == 'Barretts Esophagus']
train_df = df.loc[df['sample_name'] == 'tonsil']
train_df = train_df.sample(n=round(sample_rate*len(train_df)), random_state=1)
test_df = df.loc[df['sample_name'] == 'Barretts Esophagus']
train_X = train_df.iloc[:, 1:-4].values
test_X = test_df.iloc[:, 1:-4].values
train_y = train_df['final_cell_type'].str.lower()
Expand Down
414 changes: 414 additions & 0 deletions demo.ipynb

Large diffs are not rendered by default.

0 comments on commit 6280176

Please sign in to comment.