Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade pyranges and pandas #43

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda install -n base python=3.9 conda-forge::biopython numpy==1.23 bioconda::pyranges==0.0.120 packaging bioconda::scanpy pytest -y
conda install -n base python=3.10 conda-forge::biopython numpy==1.26 bioconda::pyranges==0.0.129 packaging bioconda::scanpy pytest -y

- name: pytest
run: |
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = "Dongze He, Rob Patro"

# The full version, including alpha/beta/rc tags
release = "0.8.1"
release = "0.10.0"

master_doc = "index"

Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Welcome to the documentation for pyroe
What is pyroe?
===================

The pyroe package provides useful functions for analyzing single-cell or single-nucleus RNA-sequencing data using `alevin-fry`.
The pyroe package provides useful functions for analyzing single-cell or single-nucleus RNA-sequencing data using `alevin-fry`. Since `simpleaf` version 0.14.0, `roers <https://github.com/COMBINE-lab/roers>`_, instead of pyroe, became as the default augmented reference constructor for `alevin-fry` and `simpleaf`. Now, the main purpose of `pyroe` is to provide the function `load_fry` to load `alevin-fry` quantification results into Python as an `anndata <http://anndata.readthedocs.io/>`_ object, so as to be compatible with `scanpy <https://scanpy.readthedocs.io/en/stable/index.html>`_. If you have trouble installing `pyroe`, you can also define the ``load_fry`` function in your own Python script, the definition of ``load_fry`` can be found at here: `load_fry <https://github.com/COMBINE-lab/pyroe/blob/main/src/pyroe/load_fry.py>`_.

.. toctree::
:maxdepth: 2
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pyroe
version = 0.9.3
version = 0.10.0
author = Dongze He, Rob Patro
author_email = [email protected], [email protected]
description = utilities of alevin-fry
Expand All @@ -21,8 +21,8 @@ scripts =
python_requires = >=3.7
include_package_data = True
install_requires =
pandas >= 1.3.0, < 2.0.0
pyranges == 0.0.120
pandas >= 1.3.0, < 2.2.0
pyranges == 0.0.129
biopython >= 1.77
packaging >= 21.0
scanpy >= 1.8.2
Expand Down
2 changes: 1 addition & 1 deletion src/pyroe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.9.3"
__version__ = "0.10.0"

from pyroe.load_fry import load_fry
from pyroe.make_txome import make_splici_txome, make_spliceu_txome
Expand Down
2 changes: 1 addition & 1 deletion src/pyroe/id_to_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def id_to_name(params):
annot_reader = None
if params.format is None:
p = pathlib.Path(params.gtf_file)
suffs = [z.lower().strip('.') for z in p.suffixes]
suffs = [z.lower().strip(".") for z in p.suffixes]

z = None
if len(suffs) >= 1:
Expand Down
4 changes: 2 additions & 2 deletions src/pyroe/load_fry.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def process_output_format(output_format, quiet):
print(
f"Will populate output field X with sum of counts frorm {predefined_format[output_format]['X']}."
)
for (k, v) in predefined_format[output_format].items():
for k, v in predefined_format[output_format].items():
if k != "X":
print(f"Will combine {v} into output layer {k}.")

Expand All @@ -253,7 +253,7 @@ def process_output_format(output_format, quiet):
f"Will populate output field X with sum of counts frorm {output_format['X']}."
)

for (k, v) in output_format.items():
for k, v in output_format.items():
if not v:
# empty list
raise ValueError(
Expand Down
6 changes: 3 additions & 3 deletions src/pyroe/make_splici_txome.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def check_bedtools_version(bt_check_path):
# init seq list
intron_seqs = []
# for each intron record
for (idx, intron_record) in chr_records.iterrows():
for idx, intron_record in chr_records.iterrows():
# create Seqeture object for extracting sequence from chromosome
intron_feature = SeqFeature(
FeatureLocation(intron_record.Start, intron_record.End),
Expand All @@ -601,12 +601,12 @@ def check_bedtools_version(bt_check_path):
if not chr_records.empty:
txp_seqs = []
# as spliced txps are the concat of all exon sequences, fist get the sequence of each exon separately,then sum them up.
for (tid, exon_records) in chr_records.groupby("Name"):
for tid, exon_records in chr_records.groupby("Name"):

# init exon seq list
exon_seqs = []
# get the sequence of each exon
for (idx, exon_record) in exon_records.iterrows():
for idx, exon_record in exon_records.iterrows():
# create SeqFeature object for the exon record
# ignore strand for now, get reverse complement later if needed
exon_feature = SeqFeature(
Expand Down
12 changes: 6 additions & 6 deletions src/pyroe/make_txome.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ def make_splici_txome(
# init seq list
intron_seqs = []
# for each intron record
for (idx, intron_record) in chr_records.iterrows():
for idx, intron_record in chr_records.iterrows():
# create Seqeture object for extracting sequence from chromosome
intron_feature = SeqFeature(
FeatureLocation(intron_record.Start, intron_record.End),
Expand All @@ -823,12 +823,12 @@ def make_splici_txome(
if not chr_records.empty:
txp_seqs = []
# as spliced txps are the concat of all exon sequences, fist get the sequence of each exon separately,then sum them up.
for (tid, exon_records) in chr_records.groupby("Name"):
for tid, exon_records in chr_records.groupby("Name"):

# init exon seq list
exon_seqs = []
# get the sequence of each exon
for (idx, exon_record) in exon_records.iterrows():
for idx, exon_record in exon_records.iterrows():
# create SeqFeature object for the exon record
# ignore strand for now, get reverse complement later if needed
exon_feature = SeqFeature(
Expand Down Expand Up @@ -1155,7 +1155,7 @@ def make_spliceu_txome(
# init seq list
unspliced_seqs = []
# for each unspliced record
for (idx, unspliced_record) in chr_records.iterrows():
for idx, unspliced_record in chr_records.iterrows():
# create Seqeture object for extracting sequence from chromosome
unspliced_feature = SeqFeature(
FeatureLocation(
Expand All @@ -1181,12 +1181,12 @@ def make_spliceu_txome(
if not chr_records.empty:
txp_seqs = []
# as spliced txps are the concat of all exon sequences, fist get the sequence of each exon separately,then sum them up.
for (tid, exon_records) in chr_records.groupby("Name"):
for tid, exon_records in chr_records.groupby("Name"):

# init exon seq list
exon_seqs = []
# get the sequence of each exon
for (idx, exon_record) in exon_records.iterrows():
for idx, exon_record in exon_records.iterrows():
# create SeqFeature object for the exon record
# ignore strand for now, get reverse complement later if needed
exon_feature = SeqFeature(
Expand Down
2 changes: 1 addition & 1 deletion src/pyroe/pyroe_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def check_dataset_ids(n_ds, dataset_ids):
# check the validity of dataset_ids
invalid_ids = []
for idx, dataset_id in enumerate(dataset_ids):
if type(dataset_id) == int:
if type(dataset_id) is int:
if dataset_id > n_ds or dataset_id < 1:
print(f"Found invalid dataset id '{dataset_id}', ignored.")
invalid_ids.append(idx)
Expand Down
Loading