Skip to content

Commit

Permalink
Merge pull request #124 from faridrashidi/develop
Browse files Browse the repository at this point in the history
release v0.2.0
  • Loading branch information
faridrashidi authored Jan 27, 2023
2 parents badd4d6 + e7eb439 commit 25c0cc5
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.1
current_version = 0.2.0
commit = True
message = [skip ci] {current_version} → {new_version}
tag = False
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
outputs:
skip: ${{ steps.ci-skip-step.outputs.ci-skip }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: ci-skip-step
Expand All @@ -35,7 +35,7 @@ jobs:
if: ${{ github.event_name == 'schedule' || needs.init.outputs.skip == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
PYTHON: ${{ matrix.python }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python }}
Expand Down Expand Up @@ -121,6 +121,8 @@ jobs:
category: "/language:${{ matrix.language }}"

build_wheels:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: test
name: build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -129,9 +131,9 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Build wheels
Expand All @@ -141,12 +143,14 @@ jobs:
path: ./wheelhouse/*.whl

build_sdist:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: build_wheels
name: build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Build sdist
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2021, Farid Rashidi
Copyright (c) 2021-2023, Farid Rashidi
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
1 change: 1 addition & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ This module offers a bunch of functions for simulating data.

datasets.example
datasets.sublines_bwes
datasets.sublines_bwts
datasets.sublines_scrnaseq
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
title = (
"Scalable intratumor heterogeneity inference and validation from single-cell data"
)
copyright = f"2021-2022, {author}"
copyright = f"2021-2023, {author}"
release = "master"
version = f"master ({trisicell.__version__})"

Expand Down
7 changes: 3 additions & 4 deletions docs/source/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ Release Notes
=============


Version 0.1.0 :small:`June 24, 2022`
------------------------------------
Version 0.1.1 :small:`December 28, 2022`
----------------------------------------

This version includes:

- Add sublines bWES dataset.
- Add sublines scRNAseq dataset.
- Fix the bug of CI.


Version 0.0.21 :small:`April 22, 2022`
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ignore =
B020, # B020 Found for loop that reassigns the iterable it is iterating with each
B902, # B902 blind except Exception: statement
C400, # C400 Unnecessary generator - rewrite as a list comprehension
E203, # E203 whitespace before ':'
[tool:pytest]
filterwarnings = ignore::DeprecationWarning
[coverage:run]
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
__author__ = ", ".join(["Farid Rashidi"])
__maintainer__ = ", ".join(["Farid Rashidi"])
__email__ = ", ".join(["[email protected]"])
__version__ = "0.1.1"
__version__ = "0.2.0"

if platform == "linux" or platform == "linux2":
os.environ["CC"] = "g++"
Expand Down Expand Up @@ -185,6 +185,7 @@ def no_cythonize(extensions, **_ignore):
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Visualization",
],
Expand Down
2 changes: 1 addition & 1 deletion trisicell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
__author__ = ", ".join(["Farid Rashidi"])
__maintainer__ = ", ".join(["Farid Rashidi"])
__email__ = ", ".join(["[email protected]"])
__version__ = "0.1.1"
__version__ = "0.2.0"
__all__ = (datasets, io, logg, pl, pp, settings, tl, ul)
4 changes: 2 additions & 2 deletions trisicell/commands/_trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
),
)
def cf2newick(cf_file):
""""""
"""CF2Newick."""

outfile = os.path.splitext(cf_file)[0]
cf = tsc.io.read(cf_file)
Expand All @@ -37,7 +37,7 @@ def cf2newick(cf_file):
),
)
def cf2tree(cf_file):
""""""
"""CF2Tree."""

outfile = os.path.splitext(cf_file)[0]
cf = tsc.io.read(cf_file)
Expand Down
2 changes: 2 additions & 0 deletions trisicell/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
oligodendroglioma_idh_mutated_tumor,
renal_cell_carcinoma,
sublines_bwes,
sublines_bwts,
sublines_scrnaseq,
test,
tnbc,
Expand Down Expand Up @@ -60,4 +61,5 @@
add_doublets,
sublines_bwes,
sublines_scrnaseq,
sublines_bwts,
)
39 changes: 39 additions & 0 deletions trisicell/datasets/_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def sublines_scrnaseq():
See Also
--------
:func:`trisicell.datasets.sublines_bwes`.
:func:`trisicell.datasets.sublines_bwts`.
"""

mdata = md.read_h5mu(
Expand Down Expand Up @@ -69,13 +70,51 @@ def sublines_bwes():
See Also
--------
:func:`trisicell.datasets.sublines_scrnaseq`.
:func:`trisicell.datasets.sublines_bwts`.
"""
adata = tsc.io.read(
tsc.ul.get_file("trisicell.datasets/data/sublines_bwes.h5ad.gz")
)
return adata


def sublines_bwts():
"""Trisicell sublines bWTS data.
The size is n_cells × n_muts = 33 × 536
Returns
-------
:class:`mudata.MuData`
A mudata with two modalities (`.mod`)
Examples
--------
>>> mdata = tsc.datasets.sublines_bwts()
>>> mdata
MuData object with n_obs × n_vars = 33 × 55851
2 modalities
expression: 175 x 55401
obs: 'cells', 'uniquely_mapped_percent', 'num_splices', ...
layers: 'fpkm', 'tpm'
mutation: 33 x 536
obs: 'cells', 'clone', 'mps', 'zscore', 'group', 'Axl', 'Mitf', 'day', ...
var: 'kind', 'amino_acid_change', 'ensemble', 'gene', 'chrom', 'position',...
layers: 'genotype', 'mutant', 'total', 'trisicell_input', 'trisicell_output'
See Also
--------
:func:`trisicell.datasets.sublines_bwes`.
:func:`trisicell.datasets.sublines_scrnaseq`.
"""

mdata = md.read_h5mu(
tsc.ul.get_file("trisicell.datasets/data/sublines_bwts.h5md.gz")
)
return mdata


def example(is_expression=False):
"""Return an example for sanity checking and playing with Trisicell.
Expand Down
Binary file added trisicell/datasets/data/sublines_bwts.h5md.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions trisicell/tl/solver/_bnb.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ def make_constraints_np_matrix(
x = np.empty((r01.shape[0] + r10.shape[0], 2), dtype=np.int)
x[: len(r01), 0] = r01
x[: len(r01), 1] = p
x[-len(r10) :, 0] = r10 # noqa
x[-len(r10) :, 1] = q # noqa
x[-len(r10) :, 0] = r10
x[-len(r10) :, 1] = q

for a, b, ind in itertools.product(r01, r10, range(x.shape[0])):
for row, col in [
Expand Down
4 changes: 2 additions & 2 deletions trisicell/tl/solver/booster/_reconstruct_big_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ def read_matrix_from_file_into_hash(path_matrix_file):
assert len(input_lines) > 0, "ERROR. Input file " + path_matrix_file + " is empty."

header_entries = input_lines[0].strip().split()
column_ids = header_entries[1 : len(header_entries)] # noqa
column_ids = header_entries[1 : len(header_entries)]
num_columns = len(column_ids)
assert num_columns != 0, (
"ERROR. Number of columns in " + path_matrix_file + " equals zero. Exiting!!!"
)

input_lines_without_header = input_lines[1 : len(input_lines)] # noqa
input_lines_without_header = input_lines[1 : len(input_lines)]
D = {}
for line in input_lines_without_header:
line_columns = line.strip().split()
Expand Down

0 comments on commit 25c0cc5

Please sign in to comment.