From c966025f8c95d935e9b0a4b5c6e2b0dd395f7a35 Mon Sep 17 00:00:00 2001 From: Lukas Kremer Date: Wed, 31 Jul 2024 12:22:30 +0200 Subject: [PATCH] update citation; crash on empty bed file --- docs/index.md | 14 ++++++++------ methscan/cli.py | 46 ++++++++++++++++++++++------------------------ methscan/utils.py | 4 ++++ 3 files changed, 34 insertions(+), 30 deletions(-) diff --git a/docs/index.md b/docs/index.md index 06de345..0d357db 100755 --- a/docs/index.md +++ b/docs/index.md @@ -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 @@ -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 diff --git a/methscan/cli.py b/methscan/cli.py index 593a75b..af0ac65 100755 --- a/methscan/cli.py +++ b/methscan/cli.py @@ -86,21 +86,21 @@ 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( @@ -108,28 +108,26 @@ def _set_n_threads(ctx, param, value): "--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(): diff --git a/methscan/utils.py b/methscan/utils.py index 2e1a912..118bc75 100644 --- a/methscan/utils.py +++ b/methscan/utils.py @@ -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] @@ -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):