This repository has been archived by the owner on May 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Add base for c++ xeus-cling notebooks to run google collab, mybinder.org #1
Open
tapaswenipathak
wants to merge
1
commit into
OpenMS:main
Choose a base branch
from
tapaswenipathak:base
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
# cling-notebooks | ||
# cling-notebooks | ||
|
||
This repository contains xeus-cling notebooks of OpenMS C++ code example files. | ||
|
||
Users can run in local or try it online on mybinder.org. | ||
|
||
## To run in local | ||
|
||
1. Create conda environment `cling-notebooks` using: `conda create -n cling-notebooks`. | ||
2. Activate conda environment using: `conda activate cling-notebooks`. | ||
3. Install xeus-cling using: `conda install xeus-cling -c conda-forge`. | ||
4. Install jupyterlab using: `conda install jupyterlab -c conda-forge`. | ||
5. Install openms using conda or bioconda following the instructions given [here](https://openms.readthedocs.io/en/latest/installations/installation-on-macos.html#install-via-conda-or-bioconda). | ||
6. Browse for the `.ipynb` notebooks and click on run. | ||
|
||
## Browse the C++ notebooks online on mybinder.org | ||
|
||
https://mybinder.org/v2/gh/OpenMS/OpenMS/develop?urlpath=https%3A%2F%2Fgithub.com%2Ftapaswenipathak%2FOpenMS%2Fblob%2Fdevelop%2FTutorial_AASequence.ipynb | ||
|
||
## Browse the C++ notebooks on Google Collab | ||
|
||
## Troubleshooting | ||
|
||
Please read the issues having documentation on common errors you might get and how | ||
to resolve them. | ||
|
||
Let us know if you get errors not already mentioned. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "182ebb96", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#include <iostream>\n", | ||
"#pragma base add_include_path(\"/Users/tapaswenipathak/miniconda3/envs/cling/include/OpenMS/\")\n", | ||
"#include \"OpenMS/CHEMISTRY/AASequence.h\"\n", | ||
"\n", | ||
"using namespace OpenMS;\n", | ||
"using namespace std;\n", | ||
"\n", | ||
"\n", | ||
" // generate AASequence object from String\n", | ||
" const String s = \"DEFIANGER\";\n", | ||
" AASequence peptide1 = AASequence::fromString(s);\n", | ||
"\n", | ||
" // generate AASequence object from string literal\n", | ||
" AASequence peptide2 = AASequence::fromString(\"PEPTIDER\");\n", | ||
"\n", | ||
" // extract prefix and suffix\n", | ||
" AASequence prefix(peptide1.getPrefix(2));\n", | ||
" AASequence suffix(peptide1.getSuffix(3));\n", | ||
" cout << peptide1.toString() << \" \"\n", | ||
" << prefix << \" \"\n", | ||
" << suffix << endl;\n", | ||
" \n", | ||
" // create chemically modified peptide\n", | ||
" AASequence peptide_meth_ox = AASequence::fromString(\"PEPTIDESEKUEM(Oxidation)CER\");\n", | ||
" cout << peptide_meth_ox.toString() << \" \"\n", | ||
" << peptide_meth_ox.toUnmodifiedString()\n", | ||
" << endl;\n", | ||
"\n", | ||
" // mass of the full, uncharged peptide\n", | ||
" double peptide_mass_mono = peptide_meth_ox.getMonoWeight();\n", | ||
" cout << \"Monoisotopic mass of the uncharged, full peptide: \" << peptide_mass_mono << endl;\n", | ||
"\n", | ||
" double peptide_mass_avg = peptide_meth_ox.getAverageWeight();\n", | ||
" cout << \"Average mass of the uncharged, full peptide: \" << peptide_mass_avg << endl;\n", | ||
"\n", | ||
" // mass of the 2+ charged b-ion with the given sequence\n", | ||
" double ion_mass_2plus = peptide_meth_ox.getMonoWeight(Residue::BIon, 2);\n", | ||
" cout << \"Mass of the doubly positively charged b-ion: \" << ion_mass_2plus << endl;\n", | ||
"\n", | ||
" // mass-to-charge ratio (m/z) of the 2+ charged b-ion and full peptide with the given sequence\n", | ||
" cout << \"Mass-to-charge of the doubly positively charged b-ion: \" << peptide_meth_ox.getMZ(2, Residue::BIon) << endl;\n", | ||
" cout << \"Mass-to-charge of the doubly positively charged peptide: \" << peptide_meth_ox.getMZ(2) << endl;\n", | ||
"\n", | ||
" // ... many more\n" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "C++17", | ||
"language": "C++17", | ||
"name": "xeus-cling-cpp17" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: openms | ||
channels: | ||
- openms | ||
- conda-forge | ||
dependencies: | ||
- xeus-cling | ||
- openms |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use the environment.yml?