-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add a footprinting command and make improvements to pyft
- Loading branch information
Showing
26 changed files
with
1,628 additions
and
94 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
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,56 @@ | ||
# `ft-footprint` | ||
|
||
## Usage | ||
```bash | ||
ft footprint [OPTIONS] <BAM> <BED> <YAML> <OUT> | ||
``` | ||
The `BAM` file is an indexed fiber-seq bam file. | ||
|
||
The `BED` file is a bed file with the motifs you'd like to test for footprints. This should include the strand the motif is on. | ||
|
||
The `YAML` file is a file that describes the modules within the motif that can be footprinted. e.g. a CTCF `yaml` with its multiple binding sites might look like: | ||
```yaml | ||
modules: | ||
- [0, 8] | ||
- [8, 16] | ||
- [16, 23] | ||
- [23, 29] | ||
- [29, 35] | ||
``` | ||
Modules must start at zero, end at the length of the motif, be sorted, and be contiguous with one another. At most 15 modules are allowed, and the intervals are 0-based, half-open (like `BED`). | ||
|
||
## Description of output columns | ||
|
||
The footprinting output table is a tab-separated file with the same number of entries as the input BED file and the following columns: | ||
|
||
|
||
| Column | Description | | ||
| -------------------- | ------------------------------------------------------------------ | | ||
| chrom | Chromosome | | ||
| start | The start position of the motif | | ||
| end | The end position of the motif | | ||
| strand | The strand of the motif. | | ||
| n_spanning_fibers | The number of fibers that span the motif. | | ||
| n_spanning_msps | The number of msp that span the motif. | | ||
| n_overlapping_nucs | The number of fibers that have an intersecting nucleosome. | | ||
| module_X | The number of fibers that are footprinted in module X. The number of module columns is determined by the footprinting yaml. | | ||
| footprint_codes | Comma separated list of footprint codes for each fiber. See details below. | | ||
| fire_quals | Comma separated list of fire qualities for each fiber. -1 if the MSP is not spanning or present. Note all fire_quals will be 0 or -1 if FIRE has not been applied to the bam. | | ||
| fiber_names | Comma separated list of fiber names that span the motif. Names share the same index as the previous column, so they can be matched with footprint codes. | | ||
|
||
## Footprint codes | ||
The footprint codes are an encoded bit flag similar to how filtering is done with `samtools`. If the first bit is set (1) then there is an MSP that spans the footprint. For each following bit, the bit is set if that module is footprinted by that fiber. | ||
|
||
Here are some examples in python for how you could test a footprint code in a few ways: | ||
```python | ||
fp_code = 0b1001 # this is a value of 9, but in binary it is 1001 | ||
# test if the first bit is set, there is a spanning MSP, true in this example | ||
(fp_code & 1) > 0 | ||
# test if the first module is footprinted, false in this example | ||
(fp_code & (1 << 1)) > 0 | ||
# test if the third module is footprinted, true in this example | ||
(fp_code & (1 << 3)) > 0 | ||
``` |
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,16 @@ | ||
|
||
API Reference | ||
================= | ||
|
||
.. automodule:: pyft | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
:member-order: bysource | ||
|
||
.. automodule:: utils | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
:member-order: bysource | ||
|
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
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,7 +1,10 @@ | ||
m2r2 | ||
sphinx_bootstrap_theme | ||
sphinx<7.0.0 | ||
sphinx-autodoc-typehints | ||
sphinx-autodoc-typehints==1.23.0 | ||
sphinx-rtd-theme==1.2.2 | ||
docutils | ||
docutils==0.18.1 | ||
setuptools==69.1.1 | ||
nbsphinx | ||
pypandoc_binary | ||
#sphinxawesome-theme |
Oops, something went wrong.