diff --git a/docs/data_view.png b/docs/data_view.png new file mode 100644 index 0000000..b945e0f Binary files /dev/null and b/docs/data_view.png differ diff --git a/docs/tools.rst b/docs/tools.rst index 9a2ea38..4dc007e 100644 --- a/docs/tools.rst +++ b/docs/tools.rst @@ -394,4 +394,20 @@ Example: --project_file PXD014414/project.json --attach_file PXD014414-943a8f02-0527-4528-b1a3-b96de99ebe75.featrue.parquet --category feature_file - --replace_existing \ No newline at end of file + --replace_existing + +Data preview +-------------------------- +This tool is used to preview your feature files and AE files. +You can run ``streamlit run .\visualize_web_commond.py`` start a web service. +Then set up your working directory to preview the data. + +.. image:: data_view.png + :width: 800 + :align: center + +* If you want to manipulate data on NoteBook, you can introduce the ``Statistic`` class. + +.. code:: python + + from quantms_io.core.statistic import Statistic \ No newline at end of file diff --git a/python/quantmsio/quantms_io/commands/visualize_web_commond.py b/python/quantmsio/quantms_io/commands/visualize_web_commond.py index b32a6b5..c6cf180 100644 --- a/python/quantmsio/quantms_io/commands/visualize_web_commond.py +++ b/python/quantmsio/quantms_io/commands/visualize_web_commond.py @@ -3,14 +3,11 @@ import pandas as pd from quantms_io.core.database import Database import os +import random from st_aggrid import AgGrid,ColumnsAutoSizeMode from st_aggrid.grid_options_builder import GridOptionsBuilder -#os.chdir(r'D:\converter\AE\PXD010154\PXD010154') - - st.set_page_config(page_title="quantms_analyze", layout="wide") -#st.title("quantms_io") workdir = st.sidebar.text_input('workdir',value='') def load_unique_list(file_type,View): @@ -19,6 +16,8 @@ def load_unique_list(file_type,View): else: return View.get_unique_proteins(index) +def refresh_keys(query_list): + random.shuffle(query_list) if os.path.exists(workdir): os.chdir(workdir) @@ -46,12 +45,13 @@ def load_unique_list(file_type,View): index = parquet_file_list.index(file_type) else: index = ibaq_list.index(file_type) - + query_list = load_unique_list(file_type,View) query_key = st.sidebar.selectbox( "query peptide or protein", - query_list + query_list[:10] ) + st.sidebar.button("Refresh", on_click=refresh_keys(query_list)) if file_type.endswith('.parquet'): df = View.query_peptide(query_key, index) @@ -61,11 +61,12 @@ def load_unique_list(file_type,View): gb = GridOptionsBuilder.from_dataframe(df) gb.configure_pagination(paginationAutoPageSize=False,paginationPageSize=15) gb.configure_side_bar() - gb.configure_default_column(groupable=True, value=True, enableRowGroup=True, editable=False) + gb.configure_default_column(groupable=True, value=True, enableRowGroup=True, aggFunc="sum", editable=False) gridOptions = gb.build() if file_type.endswith('.parquet'): AgGrid(df,gridOptions,columns_auto_size_mode=ColumnsAutoSizeMode.FIT_CONTENTS,theme='alpine') else: AgGrid(df,gridOptions,columns_auto_size_mode=ColumnsAutoSizeMode.FIT_ALL_COLUMNS_TO_VIEW,theme='alpine') +