Giter Club home page Giter Club logo

pyopenms-docs's People

Contributors

arslan-siraj avatar axelwalter avatar ayesha-feroz avatar dependabot[bot] avatar eeko-kon avatar enetz avatar greengypsy avatar happy-reindeer007 avatar hillengas avatar hroest avatar jangjang3 avatar jcharkow avatar jeeh-k avatar jpfeuffer avatar kastakin avatar kazoni avatar kyowonjeong avatar leon-bichmann avatar matteopilz avatar oliveralka avatar poshul avatar radusuciu avatar rahul799 avatar tapaswenipathak avatar timosachsenberg avatar tjeerdijk avatar vipul-bajaj avatar wyrdrawere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyopenms-docs's Issues

Buttons for mzTabTablewidget

Currently the .mzTab need to be hardcoded to be loaded into the widget.
An improvement would be to do this over a load button inside an empty widget.
Also other buttons as save could be implemented if one wants to change and save the table

embed python console in GUI app: potentially interesting widget for power users

# -*- coding: utf-8 -*-
"""
ConsoleWidget is used to allow execution of user-supplied python commands
in an application. It also includes a command history and functionality for trapping
and inspecting stack traces.

"""
import initExample ## Add path to library (just for examples; you do not need this)

import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
import pyqtgraph.console

app = pg.mkQApp()

## build an initial namespace for console commands to be executed in (this is optional;
## the user can always import these modules manually)
namespace = {'pg': pg, 'np': np}

## initial text to display in the console
text = """
This is an interactive python console. The numpy and pyqtgraph modules have already been imported 
as 'np' and 'pg'. 

Go, play.
"""
c = pyqtgraph.console.ConsoleWidget(namespace=namespace, text=text)
c.show()
c.setWindowTitle('pyqtgraph example: ConsoleWidget')

## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
    import sys
    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
        QtGui.QApplication.instance().exec_()

plotting of 2D maps

Currently, the fastest way to generate 2D spectra plots is to use either TOPPView or ImageCreator. Both are not available in pyOpenMS and adding ImageCreator to the library would introduce new and possibly conflicting dependencies (e.g., QImage).
https://github.com/OpenMS/OpenMS/blob/develop/src/utils/ImageCreator.cpp
Do we have other options?
E.g. only move the bilinear interpolation and gridding to the library and expose a pyOpenMS interface that returns a numpy image that can be directly displayed in pyqtgraph.

Misleading docs about TIC

In the pyopenms docs there is an example about how to calculate the TIC from a MSExperiment. Isn't it better to use the TIC information in a Chromatogram:

tic = exp.getChromatograms()[0]
for rt, i in zip(*tic.get_peaks()):
    # use rt and i to construct the data structure of your choice

Integrate https://mybinder.org/

might be a nice way to create interactive pyOpenMS jupyter notebooks from examples.
Not sure if it works with our dependencies though...

Reconfigure the build process

e.g. which branches get built, which version of python/sphinx is used etc.
I do not have rights to change that on RTD settings.

on disc reading of spectra data

Currently, the Spectrum viewer widget loads the whole experiment into memory.
That way it is not feasible to inspect many different mzML files.
OpenMS provides an OnDiscExperiment that doesn't load the whole mzML file into memory but directly accesses
the spectra through an index in the mzML file.
It would be beneficial to change that.

Code that should be wrapped in PyOpenMS

Wrapping:

  • ./src/openms/include/OpenMS/METADATA/IonSource.h
static const std::string NamesOfPolarity[SIZE_OF_POLARITY];
static const std::string NamesOfInletType[SIZE_OF_INLETTYPE];
static const std::string NamesOfIonizationMethod[SIZE_OF_IONIZATIONMETHOD];
  • ./src/openms/include/OpenMS/ANALYSIS/QUANTITATION/IsotopeLabelingMDVs.h:
static const std::string NamesOfDerivatizationAgent[static_cast<int>(DerivatizationAgent::SIZE_OF_DERIVATIZATIONAGENT)];
static const std::string NamesOfMassIntensityType[static_cast<int>(MassIntensityType::SIZE_OF_MASSINTENSITYTYPE)];
  • ./src/openms/include/OpenMS/CHEMISTRY/EnzymaticDigestion.h
static const std::string NamesOfSpecificity[SIZE_OF_SPECIFICITY];
  • ./src/openms/include/OpenMS/FORMAT/MSNumpressCoder.h
static const std::string NamesOfNumpressCompression[SIZE_OF_NUMPRESSCOMPRESSION];
  • ./src/openms/include/OpenMS/METADATA/DataProcessing.h
static const std::string NamesOfProcessingAction[SIZE_OF_PROCESSINGACTION];
  • ./src/openms/include/OpenMS/METADATA/Modification.h
static const std::string NamesOfSpecificityType[SIZE_OF_SPECIFICITYTYPE];
  • ./src/openms/include/OpenMS/METADATA/SourceFile.h
static const std::string NamesOfChecksumType[SIZE_OF_CHECKSUMTYPE];
  • ./src/openms/include/OpenMS/METADATA/Instrument.h
static const std::string NamesOfIonOpticsType[SIZE_OF_IONOPTICSTYPE];
  • ./src/openms/include/OpenMS/METADATA/SpectrumSettings.h
static const std::string NamesOfSpectrumType[SIZE_OF_SPECTRUMTYPE];
  • ./src/openms/include/OpenMS/METADATA/IonDetector.h
static const std::string NamesOfType[SIZE_OF_TYPE];
static const std::string NamesOfAcquisitionMode[SIZE_OF_ACQUISITIONMODE];
  • ./src/openms/include/OpenMS/METADATA/Tagging.h
static const std::string NamesOfIsotopeVariant[SIZE_OF_ISOTOPEVARIANT];
  • ./src/openms/include/OpenMS/METADATA/InstrumentSettings.h:
static const std::string NamesOfScanMode[SIZE_OF_SCANMODE];
  • ./src/openms/include/OpenMS/METADATA/Precursor.h
static const std::string NamesOfActivationMethod[SIZE_OF_ACTIVATIONMETHOD];
static const std::string NamesOfActivationMethodShort[SIZE_OF_ACTIVATIONMETHOD];
  • ./src/openms/include/OpenMS/METADATA/MSQuantifications.h
static const std::string NamesOfQuantTypes[SIZE_OF_QUANT_TYPES];
  • ./src/openms/include/OpenMS/METADATA/MassAnalyzer.h
static const std::string NamesOfAnalyzerType[SIZE_OF_ANALYZERTYPE];
static const std::string NamesOfResolutionMethod[SIZE_OF_RESOLUTIONMETHOD];
static const std::string NamesOfResolutionType[SIZE_OF_RESOLUTIONTYPE];
static const std::string NamesOfScanDirection[SIZE_OF_SCANDIRECTION];
static const std::string NamesOfScanLaw[SIZE_OF_SCANLAW];
static const std::string NamesOfReflectronState[SIZE_OF_REFLECTRONSTATE];
  • ./src/openms/include/OpenMS/METADATA/Sample.h
static const std::string NamesOfSampleState[SIZE_OF_SAMPLESTATE];
  • ./src/openms/include/OpenMS/METADATA/ProteinIdentification.h
static const std::string NamesOfPeakMassType[SIZE_OF_PEAKMASSTYPE];
  • ./src/openms/include/OpenMS/KERNEL/BaseFeature.h
static const std::string NamesOfAnnotationState[SIZE_OF_ANNOTATIONSTATE];
  • ./src/openms_gui/include/OpenMS/VISUAL/LayerData.h
static const std::string NamesOfLabelType[SIZE_OF_LABEL_TYPE];

Examples:

  • Add example to readthedocs as this has been requested by users

Publicly available workflows or building blocks?

Hi,

I wonder if there is a repository of workflows are building blocks to build workflows with PyOpenMs?

In particular, I am looking for an implementation of a TMT 11 quantitative proteomics workflow.

possible faeature: adding a filter for the MS column

Some sample code how to add filters to (e.g., the MS column)

#!/usr/bin/env python
#-*- coding:utf-8 -*-

from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QApplication, QMainWindow, QVBoxLayout, \
        QHBoxLayout, QWidget, QDesktopWidget, QMessageBox, \
        QLabel, QAction, QFileDialog, QTableView, QSplitter, QComboBox, \
        QDialog, QToolButton, QLineEdit, QRadioButton, QGroupBox, QGridLayout, QMenu,\
        QFormLayout, QDialogButtonBox, QAbstractItemView
from PyQt5.QtCore import Qt, QAbstractTableModel, pyqtSignal, QItemSelectionModel, QSortFilterProxyModel
from PyQt5.QtGui import QStandardItemModel, QStandardItem, QPainter, QIcon, QBrush, QColor, QPen, QPixmap

import random

class myWindow(QMainWindow):
    def __init__(self, parent=None):
        super(myWindow, self).__init__(parent)
        self.centralwidget  = QWidget(self)
        self.view           = QTableView(self.centralwidget)
        self.gridLayout = QGridLayout(self.centralwidget)
        self.gridLayout.addWidget(self.view, 1, 0, 1, 3)
        self.setCentralWidget(self.centralwidget)
        self.model = QStandardItemModel(self)

        # fill table with values
        for rowName in range(15):
            self.model.invisibleRootItem().appendRow(
                [QStandardItem("MS {0}".format(random.randint(1,3)))] +
                [ 
                    QStandardItem("blablub")
                    for columns in range(4)
                    ]
                )

        self.proxy = QSortFilterProxyModel(self)
        self.proxy.setSourceModel(self.model)
        self.view.setModel(self.proxy)

        self.horizontalHeader = self.view.horizontalHeader()
        self.horizontalHeader.sectionClicked.connect(self.on_view_horizontalHeader_sectionClicked)

    @QtCore.pyqtSlot(int)
    def on_view_horizontalHeader_sectionClicked(self, logicalIndex):
        if logicalIndex != 0: return # allow filter on first column only

        self.logicalIndex  = logicalIndex
        self.menuValues = QMenu(self)
        self.signalMapper = QtCore.QSignalMapper(self)  

        valuesUnique = [    self.model.item(row, self.logicalIndex).text()
                            for row in range(self.model.rowCount())
                            ]

        actionAll = QAction("All", self)
        actionAll.triggered.connect(self.on_actionAll_triggered)
        self.menuValues.addAction(actionAll)
        self.menuValues.addSeparator()

        for actionNumber, actionName in enumerate(sorted(list(set(valuesUnique)))):              
            action = QAction(actionName, self)
            self.signalMapper.setMapping(action, actionNumber)  
            action.triggered.connect(self.signalMapper.map)  
            self.menuValues.addAction(action)

        self.signalMapper.mapped.connect(self.on_signalMapper_mapped)  

        headerPos = self.view.mapToGlobal(self.horizontalHeader.pos())        

        posY = headerPos.y() + self.horizontalHeader.height()
        posX = headerPos.x() + self.horizontalHeader.sectionPosition(self.logicalIndex)

        self.menuValues.exec_(QtCore.QPoint(posX, posY))

    @QtCore.pyqtSlot()
    def on_actionAll_triggered(self):
        filterColumn = self.logicalIndex
        filterString = QtCore.QRegExp(  "",
                                        QtCore.Qt.CaseInsensitive,
                                        QtCore.QRegExp.RegExp
                                        )

        self.proxy.setFilterRegExp(filterString)
        self.proxy.setFilterKeyColumn(filterColumn)

    @QtCore.pyqtSlot(int)
    def on_signalMapper_mapped(self, i):
        stringAction = self.signalMapper.mapping(i).text()
        filterColumn = self.logicalIndex
        filterString = QtCore.QRegExp(  stringAction,
                                        QtCore.Qt.CaseSensitive,
                                        QtCore.QRegExp.FixedString
                                        )

        self.proxy.setFilterRegExp(filterString)
        self.proxy.setFilterKeyColumn(filterColumn)

if __name__ == "__main__":
    import sys

    app  = QApplication(sys.argv)
    main = myWindow()
    main.show()
    main.resize(400, 600)
    sys.exit(app.exec_())

is there a way to get the polarity of scan out of mzMl file for spectrum ?

Hi I am new to pyopenms
I needed to extract the scan polarity ; I think I can use the tag 'MS:1000130' in mzml file; but I am unable to understand how I can use getitem to do that; so far I understood that I could do that with it ;

<cvParam cvRef="MS" accession="MS:1000130" value="" name="positive scan" />
Any example code will be appreciated.
Thanks
Amnah

Update to v2.6.0 raises BadZipFile

On Windows , Pytho 3.8.6. an upgrade from 2.4.0 tpo 2.6.0 raised the following exception:

Updating dependencies
Resolving dependencies...

Package operations: 0 installs, 1 update, 0 removals

  • Updating pyopenms (2.4.0 -> 2.6.0)

  EnvCommandError

  Command D:\mvp-end-device-agent\.venv\Scripts\pip.exe install --no-deps -U file:///C:/Users/Plasmion/AppData/Local/pypoetry/Cache/artifacts/e5/19/70/ec2071b487ede5fe00136b514692e0ba8dbd27f9303bfa7f79dd9c2fa6/pyopenms-2.6.0-cp38-cp38-win_amd64.whl errored with the following return code 2, and output: 
  Processing c:\users\plasmion\appdata\local\pypoetry\cache\artifacts\e5\19\70\ec2071b487ede5fe00136b514692e0ba8dbd27f9303bfa7f79dd9c2fa6\pyopenms-2.6.0-cp38-cp38-win_amd64.whl
  ERROR: Exception:
  Traceback (most recent call last):
    File "D:\mvp-end-device-agent\.venv\lib\site-packages\pip\_internal\cli\base_command.py", line 228, in _main
      status = self.run(options, args)
    File "D:\mvp-end-device-agent\.venv\lib\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
      return func(self, options, args)
    File "D:\mvp-end-device-agent\.venv\lib\site-packages\pip\_internal\commands\install.py", line 323, in run
      requirement_set = resolver.resolve(
    File "D:\mvp-end-device-agent\.venv\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 183, in resolve
      discovered_reqs.extend(self._resolve_one(requirement_set, req))
    File "D:\mvp-end-device-agent\.venv\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 391, in _resolve_one
      dist = abstract_dist.get_pkg_resources_distribution()
    File "D:\mvp-end-device-agent\.venv\lib\site-packages\pip\_internal\distributions\wheel.py", line 29, in get_pkg_resources_distribution
      with ZipFile(self.req.local_file_path, allowZip64=True) as z:
    File "d:\python\python386\lib\zipfile.py", line 1269, in __init__
      self._RealGetContents()
    File "d:\python\python386\lib\zipfile.py", line 1336, in _RealGetContents
      raise BadZipFile("File is not a zip file")
  zipfile.BadZipFile: File is not a zip file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.