Skip to content

Commit

Permalink
Merge pull request #8 from phenomecentre/pyqt6
Browse files Browse the repository at this point in the history
Pyqt6
  • Loading branch information
duibuqi authored May 15, 2024
2 parents f6577b7 + 93ad913 commit 63035dd
Show file tree
Hide file tree
Showing 16 changed files with 486 additions and 522 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.pdf
*.html
.ipynb_checkpoints/
.DS_Store
Example Data/
.idea/
.idea/other.xml
**/__pycache__/
8 changes: 0 additions & 8 deletions .idea/ISTOCSY.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

113 changes: 0 additions & 113 deletions .idea/workspace.xml

This file was deleted.

31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ISTOCSY

* Version 2.0.0
* Version 3.0.0

ISTOCSY is a python library for interactively exploring the correlations between features in metabolomics datasets

Expand All @@ -19,19 +19,20 @@ Exports:
- Interactive html plots (plotly)

## Installation

Download and unzip ISTOCSY code from Git:
https://github.com/phenomecentre/ISTOCSY/archive/refs/heads/pyqt6.zip

### Windows


In a PowerShell terminal window, cd to the unzipped directory and run the batch file
called install_and_run_istocsy.bat

### Mac


In a terminal window, cd to the unzipped directory and run the batch file
called install_and_run_istocsy.sh

Download or clone ISTOCSY repo, then from inside Python run:

import sys
sys.path.append('path to saved ISTOCSY code')
import runISTOCSY
runISTOCSY.main()

## Documentation

See 'Example input data' files for examples of required format.
Documentation in progress - watch this space!

## Testing

Unit testing code in progress - watch this space!
22 changes: 22 additions & 0 deletions install_and_run_istocsy.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@echo off
REM First download and unzip ISTOCSY code from Git:

REM https://github.com/phenomecentre/ISTOCSY/archive/refs/heads/pyqt6.zip
REM then in a PowerShell terminal window, cd to the unzipped directory and run this batch file.

echo "=== Making Python3 environment ==="
python3 "-m" "venv" "istocsy-env"
call istocsy-env\Scripts\activate.bat

echo "=== Installing ISTOCSY Python libraries ==="
pip "install" "-r" "requirements.txt"
echo "=== Launching app ==="
python "pyIstocsy\runISTOCSY.py"

REM using Conda:
REM conda create -n istocsy python=3.7.1 ipykernel # this creates istocsy environment
REM conda activate istocsy # this activates the environment
REM navigate to the folder which contains requirements.txt file and use cd to change directories, then run line 4
REM pip install -r requirements.txt
REM Once everything’s downloaded then navigate to the folder which contains runISTOCSY.py file and use cd to change directories, then run line 6
REM python runISTOCSY.py # Runs ISTOCSY
14 changes: 14 additions & 0 deletions install_and_run_istocsy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh -e

echo "=== Making Python3 environment ==="
python3 -m venv istocsy-env
source istocsy-env/bin/activate
echo "=== Upgrading pip ==="
python3 -m pip install --upgrade pip
echo "=== Installing ISTOCSY Python libraries ==="
pip install -r requirements.txt

echo "=== Launching app ==="
python pyIstocsy/runISTOCSY.py


17 changes: 9 additions & 8 deletions pyIstocsy/_annotationsDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
@author: cs401
"""

import sip
from PyQt5 import QtGui, QtCore
from PyQt5.QtWidgets import QLabel, QDialog, QFileDialog
from PyQt6 import sip
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QInputDialog, QWidget, QApplication, QPushButton, QGridLayout
from PyQt6.QtWidgets import QLabel, QDialog, QFileDialog
import pyqtgraph as pg
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
Expand Down Expand Up @@ -46,29 +47,29 @@ def init_ui(self):
self.setWindowTitle('Load/match Annotations')
self.setGeometry(10, 10, 500, 300)

self.hbox = QtGui.QGridLayout()
self.hbox = QGridLayout()
self.setLayout(self.hbox)

# Display annotations file
self.annotationFileText = QLabel('Annotations file location: ' + str(self.Attributes['annotationFilePath']))
self.hbox.addWidget(self.annotationFileText, 1, 0)

# Update annotations file
self.annotationFileButton = QtGui.QPushButton("Load new annotations file")
self.annotationFileButton.setFocusPolicy(QtCore.Qt.NoFocus)
self.annotationFileButton = QPushButton("Load new annotations file")
self.annotationFileButton.setFocusPolicy(Qt.FocusPolicy.NoFocus)
self.annotationFileButton.clicked.connect(self.on_annotationFileButton_clicked)
self.hbox.addWidget(self.annotationFileButton, 1, 1)

# Match annotations file to dataset
self.closeButton = QtGui.QPushButton("Match to ISTOCSY dataset (if available) and close")
self.closeButton = QPushButton("Match to ISTOCSY dataset (if available) and close")
self.closeButton.clicked.connect(self.on_closeButton_clicked)
self.hbox.addWidget(self.closeButton, 2, 1)


def getResults(self):
""" Return results """

if self.exec_() == QDialog.Accepted:
if self.exec() == QDialog.DialogCode.Accepted:

return self.Attributes

Expand Down
17 changes: 9 additions & 8 deletions pyIstocsy/_batchDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"""


import sip
from PyQt5 import QtGui, QtCore
from PyQt5.QtWidgets import QLabel, QDialog, QFileDialog
from PyQt6 import sip
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QInputDialog, QWidget, QApplication, QPushButton, QGridLayout
from PyQt6.QtWidgets import QLabel, QDialog, QFileDialog
import pyqtgraph as pg
pg.setConfigOption('background', 'w')
pg.setConfigOption('foreground', 'k')
Expand Down Expand Up @@ -47,29 +48,29 @@ def init_ui(self):
self.setWindowTitle('Load/run Batch file')
self.setGeometry(10, 10, 500, 300)

self.hbox = QtGui.QGridLayout()
self.hbox = QGridLayout()
self.setLayout(self.hbox)

# Display batch file
self.batchFileText = QLabel('Batch file location: ' + str(self.Attributes['batchFilePath']))
self.hbox.addWidget(self.batchFileText, 1, 0)

# Update annotations file
self.batchFileButton = QtGui.QPushButton("Load new batch file")
self.batchFileButton.setFocusPolicy(QtCore.Qt.NoFocus)
self.batchFileButton = QPushButton("Load new batch file")
self.batchFileButton.setFocusPolicy(Qt.FocusPolicy.NoFocus)
self.batchFileButton.clicked.connect(self.on_batchFileButton_clicked)
self.hbox.addWidget(self.batchFileButton, 1, 1)

# Match annotations file to dataset
self.closeButton = QtGui.QPushButton("Run ISTOCSY from batch file (if dataset loaded) and close")
self.closeButton = QPushButton("Run ISTOCSY from batch file (if dataset loaded) and close")
self.closeButton.clicked.connect(self.on_closeButton_clicked)
self.hbox.addWidget(self.closeButton, 2, 1)


def getResults(self):
""" Return results """

if self.exec_() == QDialog.Accepted:
if self.exec() == QDialog.DialogCode.Accepted:

return self.Attributes

Expand Down
Loading

0 comments on commit 63035dd

Please sign in to comment.