-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from pinellolab/doc
Move documentation and add support for the survival screens
- Loading branch information
Showing
182 changed files
with
7,931 additions
and
1,376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: "Sphinx: Render docs" | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install Sphinx & Dependencies | ||
run: | | ||
pip install sphinx sphinx_markdown_builder sphinx_rtd_theme sphinx-argparse m2r pandas bio | ||
sudo apt-get install python3-distutils | ||
- name: Build Documentation | ||
working-directory: docs | ||
run: sphinx-build . _build | ||
- name: copy image files | ||
run: cp -r docs/assets docs/_build/ | ||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
name: github-pages | ||
path: docs/_build/ | ||
|
||
deploy: | ||
needs: build | ||
permissions: | ||
id-token: write | ||
pages: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.pyc | ||
*.fastq |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,90 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
"""Count guides, optionally with reporter and alleles of a single sequencing sample.""" | ||
|
||
import logging | ||
import os | ||
import sys | ||
|
||
import bean | ||
from bean.mapping.utils import ( | ||
_check_arguments, | ||
_get_input_parser, | ||
_check_file, | ||
_get_first_read_length, | ||
_check_read_length, | ||
) | ||
|
||
logging.basicConfig( | ||
level=logging.INFO, | ||
format="%(levelname)-5s @ %(asctime)s:\n\t %(message)s \n", | ||
datefmt="%a, %d %b %Y %H:%M:%S", | ||
stream=sys.stderr, | ||
filemode="w", | ||
) | ||
error = logging.critical | ||
warn = logging.warning | ||
debug = logging.debug | ||
info = logging.info | ||
|
||
|
||
_ROOT = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
|
||
def get_input_parser(): | ||
"""Get single-sample specific argument parser.""" | ||
parser = _get_input_parser() | ||
parser.add_argument( | ||
"--R1", | ||
type=str, | ||
help="fastq file for read 1", | ||
required=True, | ||
default="Fastq filename", | ||
) | ||
parser.add_argument( | ||
"--R2", | ||
type=str, | ||
help="fastq file for read 2, sorted as the same name order as in --R1 file.", | ||
required=True, | ||
default="Fastq filename", | ||
) | ||
return parser | ||
|
||
|
||
def check_arguments(args, info_logger, warn_logger, error_logger): | ||
args = _check_arguments( | ||
args, info_logger=info, warn_logger=warn, error_logger=error | ||
) | ||
_check_file(args.R1) | ||
_check_file(args.R2) | ||
read_length = _get_first_read_length(args.R1) | ||
_check_read_length(args, read_length, warn) | ||
return args | ||
|
||
|
||
def main(): | ||
parser = get_input_parser() | ||
args = parser.parse_args() | ||
|
||
args = check_arguments(args, info_logger=info, warn_logger=warn, error_logger=error) | ||
args_dict = vars(args) | ||
|
||
edited_from = args_dict["edited_base"] | ||
match_target_pos = args_dict["match_target_pos"] | ||
|
||
counter = bean.mp.GuideEditCounter(**args_dict) | ||
counter.check_filter_fastq() | ||
|
||
counter.get_counts() | ||
if counter.count_reporter_edits: | ||
counter.screen.uns["allele_counts"] = counter.screen.uns["allele_counts"].loc[ | ||
counter.screen.uns["allele_counts"].allele.map(str) != "", : | ||
] | ||
if match_target_pos: | ||
base_editing_map = {"A": "G", "C": "T"} | ||
edited_to = base_editing_map[edited_from] | ||
counter.screen.get_edit_mat_from_uns( | ||
edited_from, edited_to, match_target_pos | ||
) | ||
counter.screen.write(f"{counter.output_dir}.h5ad") | ||
counter.screen.to_Excel(f"{counter.output_dir}.xlsx") | ||
info(f"Output written at:\n {counter.output_dir}.h5ad,\n {counter.output_dir}.xlsx") | ||
info("All Done!") | ||
print( | ||
r""" | ||
_ _ | ||
/ \ '\ _ | ||
| \ \ __ ___ _ _ _ _| |_ | ||
\ \ | / _/ _ \ || | ' \ _| | ||
`.__|/ \__\___/\_,_|_||_\__| | ||
""" | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
"""Count guides, optionally with reporter and alleles of a single sequencing sample.""" | ||
|
||
import logging | ||
import os | ||
import sys | ||
|
||
import bean | ||
from bean.mapping.utils import ( | ||
_check_arguments, | ||
_check_file, | ||
_get_first_read_length, | ||
_check_read_length, | ||
) | ||
|
||
logging.basicConfig( | ||
level=logging.INFO, | ||
format="%(levelname)-5s @ %(asctime)s:\n\t %(message)s \n", | ||
datefmt="%a, %d %b %Y %H:%M:%S", | ||
stream=sys.stderr, | ||
filemode="w", | ||
) | ||
error = logging.critical | ||
warn = logging.warning | ||
debug = logging.debug | ||
info = logging.info | ||
|
||
|
||
_ROOT = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
|
||
|
||
|
||
|
||
def check_arguments(args, info_logger, warn_logger, error_logger): | ||
args = _check_arguments( | ||
args, info_logger=info, warn_logger=warn, error_logger=error | ||
) | ||
_check_file(args.R1) | ||
_check_file(args.R2) | ||
read_length = _get_first_read_length(args.R1) | ||
_check_read_length(args, read_length, warn) | ||
return args | ||
|
||
|
||
def main(args): | ||
"""Get the input data""" | ||
print( | ||
r""" | ||
_ _ | ||
/ \ '\ _ | ||
| \ \ __ ___ _ _ _ _| |_ | ||
\ \ | / _/ _ \ || | ' \ _| | ||
`.__|/ \__\___/\_,_|_||_\__| | ||
""" | ||
) | ||
args = check_arguments(args, info_logger=info, warn_logger=warn, error_logger=error) | ||
args_dict = vars(args) | ||
|
||
edited_from = args_dict["edited_base"] | ||
match_target_pos = args_dict["match_target_pos"] | ||
|
||
counter = bean.mp.GuideEditCounter(**args_dict) | ||
counter.check_filter_fastq() | ||
|
||
counter.get_counts() | ||
if counter.count_reporter_edits: | ||
counter.screen.uns["allele_counts"] = counter.screen.uns["allele_counts"].loc[ | ||
counter.screen.uns["allele_counts"].allele.map(str) != "", : | ||
] | ||
if match_target_pos: | ||
base_editing_map = {"A": "G", "C": "T"} | ||
edited_to = base_editing_map[edited_from] | ||
counter.screen.get_edit_mat_from_uns( | ||
edited_from, edited_to, match_target_pos | ||
) | ||
counter.screen.write(f"{counter.output_dir}.h5ad") | ||
counter.screen.to_Excel(f"{counter.output_dir}.xlsx") | ||
info(f"Output written at:\n {counter.output_dir}.h5ad,\n {counter.output_dir}.xlsx") | ||
info("All Done!") | ||
print( | ||
r""" | ||
_ _ | ||
/ \ '\ _ | ||
| \ \ __ ___ _ _ _ _| |_ | ||
\ \ | / _/ _ \ || | ' \ _| | ||
`.__|/ \__\___/\_,_|_||_\__| | ||
""" | ||
) |
Oops, something went wrong.