Skip to content

Commit 66c74c1

Browse files
RJMWwanchanglin
andauthored
Release v1.2.0 (#18)
* Add "positive" flag for correlation analysis and update pandas data fra… (#15) * Add check box to GUI for "filtering" positive correlations * Update CLI for neutral losses * Update GitHub actions and configs (#17) * Update README.rst (Minor) --------- Co-authored-by: Wanchang Lin <[email protected]>
1 parent d87c1d5 commit 66c74c1

27 files changed

+1890
-926
lines changed

.github/workflows/build-test.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
os: [ubuntu-latest, windows-latest, macos-latest]
12-
python-version: [3.7, 3.8]
12+
python-version: ['3.8', '3.9', '3.10']
1313

1414
env:
1515
OS: ${{ matrix.os }}
@@ -29,7 +29,7 @@ jobs:
2929
run: |
3030
3131
python --version
32-
conda env update --file environment.yml --name base
32+
conda env update --file environment.yml --name __setup_conda
3333
3434
- name: Lint with flake8
3535
run: |
@@ -44,15 +44,16 @@ jobs:
4444
4545
- name: Test with pytest-cov
4646
run: |
47-
48-
python setup.py install
49-
beamspy --help
50-
5147
conda install pytest codecov pytest-cov -c conda-forge
48+
49+
python -m pip install --no-deps -e .
50+
beamspy --help
51+
5252
pytest --cov ./ --cov-config=.coveragerc --cov-report=xml
5353
5454
- name: Upload code coverage to codecov
5555
uses: codecov/codecov-action@v1
56+
if: matrix.os == 'ubuntu-latest'
5657
with:
5758
flags: unittests
5859
env_vars: OS,PYTHON

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BEAMSpy - Birmingham mEtabolite Annotation for Mass Spectrometry (Python package)
22
==================================================================================
3-
|Version| |Py versions| |Git| |Bioconda| |Build Status| |Build Status (AppVeyor)| |License| |RTD doc| |codecov| |mybinder|
3+
|Version| |Py versions| |Git| |Bioconda| |Build Status| |License| |RTD doc| |codecov| |mybinder|
44

55
BEAMSpy (Birmingham mEtabolite Annotation for Mass Spectrometry) is a Python package that includes several automated and
66
seamless computational modules that are applied to putatively annotate metabolites detected in untargeted ultra (high)
@@ -82,9 +82,6 @@ Released under the GNU General Public License v3.0 (see `LICENSE <https://github
8282
.. |Build Status| image:: https://github.com/computational-metabolomics/beamspy/workflows/beamspy/badge.svg
8383
:target: https://github.com/computational-metabolomics/beamspy/actions
8484

85-
.. |Build Status (AppVeyor)| image:: https://img.shields.io/appveyor/ci/RJMW/beamspy.svg?style=flat&maxAge=3600&label=AppVeyor
86-
:target: https://ci.appveyor.com/project/RJMW/beamspy
87-
8885
.. |Py versions| image:: https://img.shields.io/pypi/pyversions/beamspy.svg?style=flat&maxAge=3600
8986
:target: https://pypi.python.org/pypi/beamspy/
9087

appveyor.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

beamspy/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__author__ = '[email protected]'
22
__credits__ = '[email protected]'
3-
__version__ = '1.1.0'
4-
__license__ = 'GPLv3'
3+
__version__ = '1.2.0'
4+
__license__ = 'GPLv3'

beamspy/__main__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def main():
7171
parser_gf.add_argument('-p', '--pvalue-threshold', default=0.01, type=float, required=True,
7272
help="Threshold for p-value.")
7373

74+
parser_gf.add_argument('-o', '--positive', action="store_true",
75+
help="Use positive correlation only otherwise use both positive and negative correlation.")
76+
7477
parser_gf.add_argument('-g', '--gml-file', type=str, required=True,
7578
help="Write graph to GraphML format.")
7679

@@ -237,7 +240,7 @@ def main():
237240
df = in_out.combine_peaklist_matrix(args.peaklist, args.intensity_matrix)
238241
graph = grouping.group_features(df, db_out=args.db, max_rt_diff=args.max_rt_diff,
239242
coeff_thres=args.coeff_threshold, pvalue_thres=args.pvalue_threshold,
240-
method=args.method, ncpus=args.ncpus)
243+
method=args.method, positive=args.positive, ncpus=args.ncpus)
241244
nx.write_gml(graph, str(args.gml_file))
242245

243246
if args.step == "annotate-peak-patterns":
@@ -274,7 +277,7 @@ def main():
274277
path = 'data/neutral_losses.txt'
275278
p = os.path.join(os.path.dirname(os.path.abspath(__file__)), path)
276279
lib = in_out.read_neutral_losses(p)
277-
annotation.neutral_losses(inp, db_out=args.db, ppm=args.ppm, lib=lib)
280+
annotation.annotate_neutral_losses(inp, db_out=args.db, ppm=args.ppm, lib=lib)
278281

279282
if args.oligomers:
280283
if args.adducts_library:

beamspy/annotation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,8 @@ def summary(df, db, single_row=False, single_column=False, convert_rt=None, ndig
16151615

16161616
records = [(str(record[0]), str(record[1])) for record in cursor.fetchall()]
16171617

1618-
G = nx.OrderedDiGraph()
1618+
# G = nx.OrderedDiGraph() # networkx version < 3.0
1619+
G = nx.DiGraph()
16191620
G.add_edges_from(records)
16201621

16211622
graphs = list(G.subgraph(c) for c in nx.weakly_connected_components(G))

beamspy/data/adducts.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
label exact_mass charge ion_mode[M+H]+ 1.007276 1 pos[M+Na]+ 22.989221 1 pos[M+K]+ 38.963158 1 pos[M-H]- -1.007276 1 neg[M+Cl]- 34.969401 1 neg[M+Na-2H]- 20.974668 1 neg[M+K-2H]- 36.948605 1 neg[M+Hac-H]- 59.013853 1 neg
1+
label exact_mass charge ion_mode
2+
[M+H]+ 1.007276 1 pos
3+
[M+Na]+ 22.989221 1 pos
4+
[M+K]+ 38.963158 1 pos
5+
[M-H]- -1.007276 1 neg
6+
[M+Cl]- 34.969401 1 neg
7+
[M+Na-2H]- 20.974668 1 neg
8+
[M+K-2H]- 36.948605 1 neg
9+
[M+Hac-H]- 59.013853 1 neg

beamspy/data/isotopes.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
label_x label_y mass_difference abundance_x abundance_y ion_mode chargeC (13C) 1.003355 98.93 1.07 both 1C (13C) 0.5016775 98.93 1.07 both 2S (34S) 1.995796 94.99 4.25 both 1K (41K) 1.998119 93.25 6.73 pos 1Cl (37Cl) 1.99705 75.76 24.24 neg 1
1+
label_x label_y mass_difference abundance_x abundance_y ion_mode charge
2+
C (13C) 1.003355 98.93 1.07 both 1
3+
C (13C) 0.5016775 98.93 1.07 both 2
4+
S (34S) 1.995796 94.99 4.25 both 1
5+
K (41K) 1.998119 93.25 6.73 pos 1
6+
Cl (37Cl) 1.99705 75.76 24.24 neg 1
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
label exact_mass charge ion_mode[M+H]+ 1.007276 1 pos[M+Na]+ 22.989221 1 pos[M+2H]2+ 1.007276 2 pos[M+H+Na]2+ 11.9982485 2 pos
1+
label exact_mass charge ion_mode
2+
[M+H]+ 1.007276 1 pos
3+
[M+Na]+ 22.989221 1 pos
4+
[M+2H]2+ 1.007276 2 pos
5+
[M+H+Na]2+ 11.9982485 2 pos

0 commit comments

Comments
 (0)