maom commited on
Commit
3f200c0
·
verified ·
1 Parent(s): 005bc4b

fix indexing into pandas matrix

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,7 +32,7 @@ estimated_expression = datasets.load_dataset(
32
  data_files = {"estimated_expression": "estimated_expression.tsv"})
33
  estimated_expression = estimated_expression["estimated_expression"].to_pandas()
34
 
35
- col1, col2, col3 = st.columns(spec = [0.3, 0.2, 0.5])
36
  with col1:
37
  gene_id_1 = st.text_input(
38
  label = "Gene ID 1",
@@ -48,8 +48,8 @@ with col2:
48
  help = "CNAG Gene ID e.g. CNAG_04222")
49
 
50
  chart_data = pd.DataFrame({
51
- "expression_1": np.log10(estimated_expression[estimated_expression.index == gene_id_1,] + 1),
52
- "expression_2": np.log10(estimated_expression[estimated_expression.index == gene_id_2,] + 1),
53
  "run_accession": estimated_expression.columns,
54
  "run_accession_meta": estimated_expression_meta["run_accession"],
55
  "study_accession": estimated_expression_meta["study_accession"]})
 
32
  data_files = {"estimated_expression": "estimated_expression.tsv"})
33
  estimated_expression = estimated_expression["estimated_expression"].to_pandas()
34
 
35
+ col1, col2, col3 = st.columns(spec = [0.2, 0.2, 0.6])
36
  with col1:
37
  gene_id_1 = st.text_input(
38
  label = "Gene ID 1",
 
48
  help = "CNAG Gene ID e.g. CNAG_04222")
49
 
50
  chart_data = pd.DataFrame({
51
+ "expression_1": np.log10(estimated_expression.loc[estimated_expression.index == gene_id_1].to_numpy()[0] + 1),
52
+ "expression_2": np.log10(estimated_expression.loc[estimated_expression.index == gene_id_2].to_numpy()[0] + 1),
53
  "run_accession": estimated_expression.columns,
54
  "run_accession_meta": estimated_expression_meta["run_accession"],
55
  "study_accession": estimated_expression_meta["study_accession"]})