Skip to content

Commit

Permalink
Update tutorials for refactored changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcharkow committed Sep 30, 2024
1 parent 6f818b3 commit a3c1ed1
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 94 deletions.
106 changes: 43 additions & 63 deletions docs/python_docs/Loading Spectrum Data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,22 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[2024-03-14 10:47:31,256] MzMLDataAccess - INFO - Opening mzml/ionMobilityTest.mzML file...: Elapsed 0.2080221176147461 ms\n",
"[2024-03-14 10:47:31,258] MzMLDataAccess - INFO - There are 50 spectra and 0 chromatograms.\n",
"[2024-03-14 10:47:31,259] MzMLDataAccess - INFO - There are 25 MS1 spectra and 25 MS2 spectra.\n"
"Initializing valid scores for selection\n",
"[2024-09-30 17:29:26,200] MzMLDataAccess - INFO - Opening mzml/ionMobilityTest.mzML file...: Elapsed 0.08319735527038574 ms\n",
"[2024-09-30 17:29:26,201] MzMLDataAccess - INFO - There are 50 spectra and 0 chromatograms.\n",
"[2024-09-30 17:29:26,202] MzMLDataAccess - INFO - There are 25 MS1 spectra and 25 MS2 spectra.\n"
]
}
],
"source": [
"from massdash.loaders import MzMLDataLoader\n",
"loader = MzMLDataLoader(dataFiles=\"mzml/ionMobilityTest.mzML\",\n",
" rsltsFile=\"osw/ionMobilityTest.osw\",\n",
" rsltsFileType=\"OpenSWATH\")"
" rsltsFile=[\"osw/ionMobilityTest.osw\", \"diann/ionMobilityTest-diannReport.tsv\"])"
]
},
{
"cell_type": "markdown",
"id": "c8056e1b-4ca0-48a8-a018-136cfea86d56",
"id": "dde208d2-b025-427e-8061-4fafcfa7ec5f",
"metadata": {
"editable": true,
"slideshow": {
Expand All @@ -182,37 +182,13 @@
"tags": []
},
"source": [
"This same `.MzML` file can also be initiated with DIA-NN output as shown. Note, since DIA-NN results files do not always have transition level information, a library file must also be provided."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "9d07e867-60fd-4112-97d7-9bb7ce8cc2b6",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[2024-03-14 10:47:32,309] MzMLDataAccess - INFO - Opening mzml/ionMobilityTest.mzML file...: Elapsed 0.11989092826843262 ms\n",
"[2024-03-14 10:47:32,310] MzMLDataAccess - INFO - There are 50 spectra and 0 chromatograms.\n",
"[2024-03-14 10:47:32,311] MzMLDataAccess - INFO - There are 25 MS1 spectra and 25 MS2 spectra.\n"
]
}
],
"source": [
"from massdash.loaders import MzMLDataLoader\n",
"loader_diann = MzMLDataLoader(dataFiles=\"mzml/ionMobilityTest.mzML\",\n",
" rsltsFile=\"diann/ionMobilityTest-diannReport.tsv\",\n",
" libraryFile=\"library/ionMobilityTestLibrary.tsv\",\n",
" rsltsFileType='DIA-NN')"
"<div class=\"alert alert-info\">\n",
"\n",
"Note\n",
"\n",
"If only a DIA-NN file is provided, a library must also be provided. If no library file is provided, MassDash will assume the `.osw` file should also be used as the library. The library is required for determining the extraciton coordinates. \n",
"\n",
"</div>"
]
},
{
Expand Down Expand Up @@ -310,7 +286,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"id": "e647514a-0a3f-4055-bee0-d794b05c51c3",
"metadata": {
"editable": true,
Expand Down Expand Up @@ -340,12 +316,12 @@
"tags": []
},
"source": [
"Then we can invoke the :py:func:`~structs.MzMLDataLoader.loadTransitionGroups` method with the target sequence, charge and extraction config."
"Then we can invoke the :py:func:`~structs.MzMLDataLoader.loadTransitionGroups` method with the target sequence, charge and extraction config. Note: the extraction will always occur "
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"id": "49942906-4dc2-4d7a-8a70-812ab233fcd4",
"metadata": {
"editable": true,
Expand All @@ -358,10 +334,14 @@
{
"data": {
"text/plain": [
"{'ionMobilityTest': <massdash.structs.TransitionGroup.TransitionGroup at 0x7e616c4fab50>}"
"TransitionGroupCollection\n",
"ionMobilityTest: -------- TransitionGroup --------\n",
"precursor data: 1\n",
"transition data: 6\n",
"data type: Chromatogram"
]
},
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -373,7 +353,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"id": "c08d60c7-3493-49cd-8de8-24dbda12e043",
"metadata": {},
"outputs": [
Expand All @@ -383,7 +363,7 @@
"massdash.structs.TransitionGroupCollection.TransitionGroupCollection"
]
},
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -440,7 +420,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 7,
"id": "564969ca-c692-4f10-bbb2-87098a74c414",
"metadata": {
"editable": true,
Expand Down Expand Up @@ -577,7 +557,7 @@
"[168 rows x 4 columns]"
]
},
"execution_count": 9,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -667,7 +647,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 8,
"id": "74e8d17b-603b-4e0d-ac02-f2ad5b37309b",
"metadata": {
"editable": true,
Expand All @@ -687,10 +667,10 @@
{
"data": {
"text/plain": [
"{'ionMobilityTest': <massdash.structs.FeatureMap.FeatureMap at 0x7e60a7db25b0>}"
"{'ionMobilityTest': <massdash.structs.FeatureMap.FeatureMap at 0x75219b42d430>}"
]
},
"execution_count": 10,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -737,7 +717,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 9,
"id": "16eb9f10-f1c8-4910-8e93-a197e005e6cf",
"metadata": {
"editable": true,
Expand Down Expand Up @@ -947,7 +927,7 @@
"[6817 rows x 9 columns]"
]
},
"execution_count": 11,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -958,7 +938,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 10,
"id": "ff3e0ad6-3924-49e3-a17b-0d4460223c61",
"metadata": {
"editable": true,
Expand All @@ -971,10 +951,10 @@
{
"data": {
"text/plain": [
"<massdash.structs.TargetedDIAConfig.TargetedDIAConfig at 0x7e60a9587460>"
"<massdash.structs.TargetedDIAConfig.TargetedDIAConfig at 0x75217a365bb0>"
]
},
"execution_count": 12,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -1009,17 +989,17 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 11,
"id": "c985108c-3a95-4475-bd39-32f4f0f38119",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<massdash.structs.TransitionGroup.TransitionGroup at 0x7e60a62d71c0>"
"<massdash.structs.TransitionGroup.TransitionGroup at 0x752179ff22b0>"
]
},
"execution_count": 13,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1031,17 +1011,17 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 12,
"id": "eddc00a5-ef6a-4c01-87f3-4553ad280d4a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<massdash.structs.TransitionGroup.TransitionGroup at 0x7e60a9dc4bb0>"
"<massdash.structs.TransitionGroup.TransitionGroup at 0x75217a365100>"
]
},
"execution_count": 15,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1053,17 +1033,17 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 13,
"id": "766bcae8-96b7-4f8e-940e-e12a83ac0d73",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<massdash.structs.TransitionGroup.TransitionGroup at 0x7e60a9dc4a00>"
"<massdash.structs.TransitionGroup.TransitionGroup at 0x75219aaa41f0>"
]
},
"execution_count": 14,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
Loading

0 comments on commit a3c1ed1

Please sign in to comment.