Skip to content

Commit

Permalink
separate parser
Browse files Browse the repository at this point in the history
  • Loading branch information
jykr committed Apr 25, 2024
1 parent 96640e9 commit b4855c4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
21 changes: 21 additions & 0 deletions bean/annotate/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,27 @@ def get_splice_positions_from_gene_name(
return cds_chrom, np.array(splice_donor_pos), np.array(splice_acceptor_pos)


def get_splice_parser(parser=None):
if parser is None:
parser = argparse.ArgumentParser(
"Get splice site position",
usage="Get splice site position from exon fasta and target editing base.",
)

parser.add_argument(
"exon_fa_path", help="File path to fasta file with exon position information."
)
parser.add_argument(
"--gene-name",
action="store_true",
help="File path to fasta file with exon position information.",
)
parser.add_argument("edited_base", help="Edited base, either A or C.")
parser.add_argument("output_path", help="output path of the splice site csv file.")

return parser


def parse_args(parser=None):
if parser is None:
parser = argparse.ArgumentParser(
Expand Down
2 changes: 1 addition & 1 deletion bean/cli/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from bean.annotate.utils import parse_args as get_filter_parser
from bean.model.parser import parse_args as get_run_parser
from bean.framework.parser import get_input_parser as get_create_screen_parser
from bean.cli.get_splice_sites import get_parser as get_splice_site_parser
from bean.annotate.utils import get_splice_parser as get_splice_site_parser
from bean.cli.count import main as count
from bean.cli.count_samples import main as count_samples
from bean.cli.profile import main as profile
Expand Down
21 changes: 0 additions & 21 deletions bean/cli/get_splice_sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,6 @@
from bean.annotate.utils import get_splice_positions_from_gene_name


def get_parser(parser=None):
if parser is None:
parser = argparse.ArgumentParser(
"Get splice site position",
usage="Get splice site position from exon fasta and target editing base.",
)

parser.add_argument(
"exon_fa_path", help="File path to fasta file with exon position information."
)
parser.add_argument(
"--gene-name",
action="store_true",
help="File path to fasta file with exon position information.",
)
parser.add_argument("edited_base", help="Edited base, either A or C.")
parser.add_argument("output_path", help="output path of the splice site csv file.")

return parser


def get_splice_positions(exon_fa_path) -> Tuple[str, np.ndarray, np.ndarray]:
splice_donor_pos = []
splice_acceptor_pos = []
Expand Down
5 changes: 0 additions & 5 deletions docs/_filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,3 @@ bean filter my_sorting_screen.h5ad \
2. Feed `--translate-fastas-csv gene_exon_fas.csv` where `gene_exon_fas.csv` is the csv file with lines `gene_id,gene_exon_fasta_path` without header. Each FASTA file in `gene_exon_fasta_path` is formatted [as the single-gene FASTA file](https://github.com/pinellolab/crispr-bean/blob/main/docs/exon_fa_format.md).
* Translation will keep the variants outside the coding sequence as nucleotide-level variants, while aggregating variants leading to the same coding sequence variants.

# Getting splice sites
We provide the utility script to obtain the splice sites if you use the MANE transcript with gene symbol (`--translate-gene-name GENE_SYMBOL` or `--translate-genes-list path_to_gene_names_file.txt`).
```bash
bean get-splice-sites LDLR A LDLR_splice_sites.csv --gene-name
```
5 changes: 5 additions & 0 deletions docs/_get_splice_sites.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Getting splice sites
We provide the utility script to obtain the splice sites if you use the MANE transcript with gene symbol (`--translate-gene-name GENE_SYMBOL` or `--translate-genes-list path_to_gene_names_file.txt`).
```bash
bean get-splice-sites LDLR A LDLR_splice_sites.csv --gene-name
```

0 comments on commit b4855c4

Please sign in to comment.