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

Develop #45

Merged
merged 4 commits into from
Jan 6, 2025
Merged
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.10 conda-forge::biopython numpy==1.26 bioconda::pyranges==0.0.129 packaging bioconda::scanpy pytest -y
conda install -n base -c bioconda -c conda-forge python=3.10 packaging pandas scanpy pytest -y

- name: pytest
run: |
Expand Down
179 changes: 2 additions & 177 deletions bin/pyroe
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#!/usr/bin/env python

import logging
from pyroe import make_splici_txome, make_spliceu_txome
from pyroe import id_to_name

if make_spliceu_txome is None or make_splici_txome is None or id_to_name is None:
raise ImportError("To run pyroe CLI, Please install pyranges, biopython and bedtools.")
from pyroe import fetch_processed_quant
from pyroe import convert
from pyroe import output_formats
Expand Down Expand Up @@ -37,133 +32,6 @@ if __name__ == "__main__":
help="additional help",
)

# make-splici
parser_makeSplici = subparsers.add_parser(
"make-spliced+intronic",
help="Make spliced + intronic reference",
aliases=["make-splici"],
)
parser_makeSplici.set_defaults(command="make-spliced+intronic")
parser_makeSplici.add_argument(
"genome_path",
metavar="genome-path",
type=str,
help="The path to a genome fasta file.",
)
parser_makeSplici.add_argument(
"gtf_path", metavar="gtf-path", type=str, help="The path to a gtf file."
)
parser_makeSplici.add_argument(
"read_length",
metavar="read-length",
type=int,
help="The read length of the single-cell experiment being processed (determines flank size).",
)
parser_makeSplici.add_argument(
"output_dir",
metavar="output-dir",
type=str,
help="The output directory where splici reference files will be written.",
)
parser_makeSplici.add_argument(
"--filename-prefix",
type=str,
default="splici",
help="The file name prefix of the generated output files.",
)
parser_makeSplici.add_argument(
"--flank-trim-length",
type=int,
default=5,
help="Determines the amount subtracted from the read length to get the flank length.",
)
parser_makeSplici.add_argument(
"--extra-spliced",
type=str,
help="The path to an extra spliced sequence fasta file.",
)
parser_makeSplici.add_argument(
"--extra-unspliced",
type=str,
help="The path to an extra unspliced sequence fasta file.",
)
parser_makeSplici.add_argument(
"--bt-path",
type=str,
default="bedtools",
help="The path to bedtools v2.30.0 or greater.",
)
parser_makeSplici.add_argument(
"--no-bt",
action="store_true",
help="A flag indicates whether bedtools will be used for generating splici reference files.",
)
parser_makeSplici.add_argument(
"--dedup-seqs",
action="store_true",
help="A flag indicates whether identical sequences will be deduplicated.",
)
parser_makeSplici.add_argument(
"--no-flanking-merge",
action="store_true",
help="A flag indicates whether flank lengths will be considered when merging introns.",
)

# make-spliceu
parser_makeSpliceu = subparsers.add_parser(
"make-spliced+unspliced",
help="Make spliced + unspliced reference",
aliases=["make-spliceu"],
)
parser_makeSpliceu.set_defaults(command="make-spliced+unspliced")
parser_makeSpliceu.add_argument(
"genome_path",
metavar="genome-path",
type=str,
help="The path to a genome fasta file.",
)
parser_makeSpliceu.add_argument(
"gtf_path", metavar="gtf-path", type=str, help="The path to a gtf file."
)
parser_makeSpliceu.add_argument(
"output_dir",
metavar="output-dir",
type=str,
help="The output directory where Spliceu reference files will be written.",
)
parser_makeSpliceu.add_argument(
"--filename-prefix",
type=str,
default="spliceu",
help="The file name prefix of the generated output files.",
)
parser_makeSpliceu.add_argument(
"--extra-spliced",
type=str,
help="The path to an extra spliced sequence fasta file.",
)
parser_makeSpliceu.add_argument(
"--extra-unspliced",
type=str,
help="The path to an extra unspliced sequence fasta file.",
)
parser_makeSpliceu.add_argument(
"--bt-path",
type=str,
default="bedtools",
help="The path to bedtools v2.30.0 or greater.",
)
parser_makeSpliceu.add_argument(
"--no-bt",
action="store_true",
help="A flag indicates whether bedtools will be used for generating Spliceu reference files.",
)
parser_makeSpliceu.add_argument(
"--dedup-seqs",
action="store_true",
help="A flag indicates whether identical sequences will be deduplicated.",
)

# parse available datasets
available_datasets = fetch_processed_quant()
epilog = "\n".join(
Expand Down Expand Up @@ -213,20 +81,6 @@ if __name__ == "__main__":
help="A flag indicates whether help messaged should not be printed.",
)

parser_id_to_name = subparsers.add_parser(
"id-to-name", help="Generate a gene id to gene name mapping file from a GTF."
)
parser_id_to_name.set_defaults(command="id-to-name")
parser_id_to_name.add_argument("gtf_file", help="The GTF input file.")
parser_id_to_name.add_argument(
"output", help="The path to where the output tsv file will be written."
)
parser_id_to_name.add_argument(
"--format",
help="The input format of the file (must be either GTF or GFF3). This will be inferred from the filename, but if that fails it can be provided explicitly.",
default=None,
)

out_formats = output_formats()
parser_convert = subparsers.add_parser(
"convert", help="Convert alevin-fry quantification result to another format."
Expand All @@ -244,7 +98,7 @@ if __name__ == "__main__":
)
parser_convert.add_argument(
"--output-structure",
help="The structure that U,S and A counts should occupy in the output matrix.",
help="The structure that U,S and A counts should occupy in the output matrix. It will be passed to the output_format argument of the `load_fry` function.",
)
parser_convert.add_argument(
"--output-format",
Expand All @@ -262,34 +116,7 @@ if __name__ == "__main__":

# Execute the parse_args() method
args = parser.parse_args()
if args.command == "make-spliced+intronic":
make_splici_txome(
genome_path=args.genome_path,
gtf_path=args.gtf_path,
read_length=args.read_length,
output_dir=args.output_dir,
flank_trim_length=args.flank_trim_length,
filename_prefix=args.filename_prefix,
extra_spliced=args.extra_spliced,
extra_unspliced=args.extra_unspliced,
dedup_seqs=args.dedup_seqs,
no_bt=args.no_bt,
bt_path=args.bt_path,
no_flanking_merge=args.no_flanking_merge,
)
elif args.command == "make-spliced+unspliced":
make_spliceu_txome(
genome_path=args.genome_path,
gtf_path=args.gtf_path,
output_dir=args.output_dir,
filename_prefix=args.filename_prefix,
extra_spliced=args.extra_spliced,
extra_unspliced=args.extra_unspliced,
dedup_seqs=args.dedup_seqs,
no_bt=args.no_bt,
bt_path=args.bt_path,
)
elif args.command == "fetch-quant":
if args.command == "fetch-quant":
fetch_processed_quant(
dataset_ids=args.dataset_ids,
fetch_dir=args.fetch_dir,
Expand All @@ -299,8 +126,6 @@ if __name__ == "__main__":
)
elif args.command == "convert":
convert(args)
elif args.command == "id-to-name":
id_to_name(args)
else:
print(parser.print_help())
sys.exit(1)
8 changes: 4 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pyroe
version = 0.10.0
version = 0.11.0
author = Dongze He, Rob Patro
author_email = [email protected], [email protected]
description = utilities of alevin-fry
Expand All @@ -16,14 +16,14 @@ classifiers =
packages = find:
package_dir =
= src
# scripts =
# bin/pyroe
scripts =
bin/pyroe
python_requires = >=3.7
include_package_data = True
install_requires =
packaging >= 21.0
scanpy >= 1.8.2

pandas >= 1.3.0

[options.packages.find]
where = src
Expand Down
11 changes: 1 addition & 10 deletions src/pyroe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.10.0"
__version__ = "0.11.0"

from pyroe.load_fry import load_fry
from pyroe.fetch_processed_quant import fetch_processed_quant
Expand All @@ -7,13 +7,4 @@
from pyroe.convert import convert
from pyroe.pyroe_utils import output_formats


# try:
# from pyroe.make_txome import make_splici_txome, make_spliceu_txome
# from pyroe.id_to_name import id_to_name
# except ImportError:
# make_splici_txome = None
# make_spliceu_txome = None
# id_to_name = None

# flake8: noqa
57 changes: 0 additions & 57 deletions src/pyroe/id_to_name.py

This file was deleted.

Loading
Loading