Skip to content

Commit

Permalink
update citation; crash on empty bed file
Browse files Browse the repository at this point in the history
  • Loading branch information
LKremer committed Jul 31, 2024
1 parent cbd884d commit c966025
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 30 deletions.
14 changes: 8 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![PyPIDownloads](https://pepy.tech/badge/scbs)](https://pepy.tech/project/methscan)
[![GitHub](https://img.shields.io/github/v/tag/anders-biostat/MethSCAn?logo=github)](https://github.com/anders-biostat/MethSCAn)

a command line tool for **S**ingle-**C**ell **An**alysis of **Meth**ylation data
a command line tool for **S**ingle-**C**ell **An**alysis of **Meth**ylation data.

## Installation

Expand Down Expand Up @@ -48,15 +48,17 @@ Lastly, you can also select two cell populations and identify differentially met
You can find a list of the available `methscan` commands [here](commands.html).


## bioRxiv preprint
## Publication / Citation

For a detailed explanation of the methods implemented in *MethSCAn*, please check our bioRxiv preprint.
Note that this package was formerly known as ['scbs'](https://github.com/LKremer/scbs) and later renamed to *MethSCAn*.
For a detailed explanation of the methods implemented in *MethSCAn*, please check out our open access article in Nature Methods:

*Analyzing single-cell bisulfite sequencing data with MethSCAn*
Lukas PM Kremer, Martina Braun, Svetlana Ovchinnikova, Leonie Kuechenhoff, Santiago Cerrizuela, Ana Martin-Villalba, Simon Anders
bioRxiv 2022.06.15.496318; doi: [https://doi.org/10.1101/2022.06.15.496318](https://doi.org/10.1101/2022.06.15.496318)
Lukas PM Kremer, Martina Braun, Svetlana Ovchinnikova, Leonie Kuechenhoff, Santiago Cerrizuela, Ana Martin-Villalba, Simon Anders.
Nature Methods, 2024
doi: [https://doi.org/10.1038/s41592-024-02347-x](https://doi.org/10.1038/s41592-024-02347-x)

Please cite this article if you used MethSCAn in your research.
Note that this package was formerly known as ['scbs'](https://github.com/LKremer/scbs) and later renamed to *MethSCAn*.

## Hardware requirements

Expand Down
46 changes: 22 additions & 24 deletions methscan/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,50 +86,48 @@ def _set_n_threads(ctx, param, value):
help_options_color="green",
help=f"""
\b
__ __ _ _ ____ ____ _ \b
| \/ | ___| |_| |__ / ___| / ___| / \ _ __
| |\/| |/ _ \ __| '_ \\\\___ \| | / _ \ | '_ \ \b
| | | | __/ |_| | | |___) | |___ / ___ \| | | |
|_| |_|\___|\__|_| |_|____/ \____/_/ \_\_| |_| {VERSION_STR}
__ __ _ _ ____ ____ _ \b
| \\/ | ___| |_| |__ / ___| / ___| / \\ _ __
| |\\/| |/ _ \\ __| '_ \\\\___ \\| | / _ \\ | '_ \\ \b
| | | | __/ |_| | | |___) | |___ / ___ \\| | | |
|_| |_|\\___|\\__|_| |_|____/ \\____/_/ \\_\\_| |_| {VERSION_STR}
Below you find a list of all available commands.
Below you find a list of all available commands.
To find out what they do and how to use them, check their help like this:
{style("methscan [command] --help", fg="blue")}
{style("methscan [command] --help", fg="blue")}
To use stdin or stdout, use the dash character
{style("-", fg="blue")} instead of a file path.
""",
\b
For documentation and a usage tutorial, go to
{style("https://anders-biostat.github.io/MethSCAn/", fg="blue")}.""",
)
@click.version_option(version=__version__)
@click.version_option(
"cite",
"--cite",
help="Show publication reference and exit.",
message=(
"""If you used MethSCAn in your research, please cite:
f"""If you used MethSCAn in your research, please cite:
Analyzing single-cell bisulfite sequencing data with MethSCAn
{style("Analyzing single-cell bisulfite sequencing data with MethSCAn",
fg="bright_white", bold=True)}
Lukas PM Kremer, Martina M Braun, Svetlana Ovchinnikova, Leonie Küchenhoff, """
"""Santiago Cerrizuela, Ana Martin-Villalba, Simon Anders
bioRxiv, 2022
doi / link: https://doi.org/10.1101/2022.06.15.496318
f"""Santiago Cerrizuela, Ana Martin-Villalba, Simon Anders
Nature Methods, 2024
doi: {style("https://doi.org/10.1038/s41592-024-02347-x", fg="blue")}
"""
"""
BibTeX entry:
@article{kremer2024,
title={Analyzing single-cell bisulfite sequencing data with {MethSCAn}},
author={Kremer, Lukas PM and Braun, Martina M and Ovchinnikova, Svetlana and """
"""K{\"u}chenhoff, Leonie and Cerrizuela, Santiago and """
"""Martin-Villalba, Ana and Anders, Simon},
journal={bioRxiv},
year={2022},
doi = {10.1101/2022.06.15.496318},
publisher={Cold Spring Harbor Laboratory}
}
"""
journal={Nature Methods},
year={2024},
doi={10.1038/s41592-024-02347-x}
}"""
),
)
def cli():
Expand Down
4 changes: 4 additions & 0 deletions methscan/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ def _get_filepath(f):
def _iter_bed(file_obj, strand_col_i=None, keep_cols=False):
is_rev_strand = False
other_columns = False
is_empty = True
if strand_col_i is not None:
strand_col_i -= 1 # CLI is 1-indexed
for line in file_obj:
if line.startswith("#") or not line.strip():
continue # skip comments
is_empty = False
values = line.strip().split("\t")
if strand_col_i is not None:
strand_val = values[strand_col_i]
Expand All @@ -53,6 +55,8 @@ def _iter_bed(file_obj, strand_col_i=None, keep_cols=False):
other_columns = values[3:]
# yield chrom, start, end, and whether the feature is on the minus strand
yield values[0], int(values[1]), int(values[2]), is_rev_strand, other_columns
if is_empty:
raise Exception("The BED file you have provided is empty.")


def _parse_cell_names(data_dir):
Expand Down

0 comments on commit c966025

Please sign in to comment.