maom commited on
Commit
1109bbe
·
verified ·
1 Parent(s): f9a7942

fix lookup

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -36,7 +36,6 @@ estimated_expression_meta = estimated_expression_meta["estimated_expression_meta
36
  estimated_expression = datasets.load_dataset(
37
  path = "maomlab/CryptoCEN",
38
  data_files = {"estimated_expression": "estimated_expression_matrix.parquet"})
39
- print(f"dir(estimated_expression): {dir(estimated_expression)}")
40
  estimated_expression = estimated_expression["estimated_expression"].to_pandas()
41
 
42
  #DEBUG
@@ -59,18 +58,18 @@ with col2:
59
 
60
  # check the user input
61
  try:
62
- cnag_id_1 = h99_transcript_annotations.loc[h99_transcript_annotations["gene_id"] == gene_id_1]["cnag_id"]
63
  except:
64
  st.error(f"Unable to locate cnag_id for Gene ID 1: {gene_id_1}, it should be of the form 'CNAG_######'")
65
 
66
  try:
67
- cnag_id_2 = h99_transcript_annotations.loc[h99_transcript_annotations["gene_id"] == gene_id_2]["cnag_id"]
68
  except:
69
  st.error(f"Unable to locate cnag_id for Gene ID 2: {gene_id_2}, it should be of the form 'CNAG_######'")
70
 
71
  chart_data = pd.DataFrame({
72
- "expression_1": np.log10(estimated_expression.loc[estimated_expression.index == cnag_id_1].to_numpy()[0] + 1),
73
- "expression_2": np.log10(estimated_expression.loc[estimated_expression_index == cnag_id_2].to_numpy()[0] + 1),
74
  "run_accession": estimated_expression.columns,
75
  "run_accession_meta": estimated_expression_meta["run_accession"],
76
  "study_accession": estimated_expression_meta["study_accession"]})
 
36
  estimated_expression = datasets.load_dataset(
37
  path = "maomlab/CryptoCEN",
38
  data_files = {"estimated_expression": "estimated_expression_matrix.parquet"})
 
39
  estimated_expression = estimated_expression["estimated_expression"].to_pandas()
40
 
41
  #DEBUG
 
58
 
59
  # check the user input
60
  try:
61
+ cnag_id_1 = h99_transcript_annotations.loc[h99_transcript_annotations["gene_id"] == gene_id_1]["cnag_id"].values
62
  except:
63
  st.error(f"Unable to locate cnag_id for Gene ID 1: {gene_id_1}, it should be of the form 'CNAG_######'")
64
 
65
  try:
66
+ cnag_id_2 = h99_transcript_annotations.loc[h99_transcript_annotations["gene_id"] == gene_id_2]["cnag_id"].values
67
  except:
68
  st.error(f"Unable to locate cnag_id for Gene ID 2: {gene_id_2}, it should be of the form 'CNAG_######'")
69
 
70
  chart_data = pd.DataFrame({
71
+ "expression_1": np.log10(estimated_expression.loc[h99_transcript_annotations["gene_id"] == gene_id_1].to_numpy()[0] + 1),
72
+ "expression_2": np.log10(estimated_expression.loc[h99_transcript_annotations["gene_id"] == gene_id_2].to_numpy()[0] + 1),
73
  "run_accession": estimated_expression.columns,
74
  "run_accession_meta": estimated_expression_meta["run_accession"],
75
  "study_accession": estimated_expression_meta["study_accession"]})