Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add summaries #105

Merged
merged 23 commits into from
Apr 27, 2022
Merged

Add summaries #105

merged 23 commits into from
Apr 27, 2022

Conversation

Phlya
Copy link
Member

@Phlya Phlya commented Jun 15, 2021

Adding first support for summary statistics: for now just fraction of cis reads (at all currently calculated minimal separations) and library complexity estimate.

@Phlya Phlya requested a review from golobor June 15, 2021 11:53
@agalitsyna agalitsyna mentioned this pull request Apr 6, 2022
31 tasks
@Phlya
Copy link
Member Author

Phlya commented Apr 8, 2022

What would make sense to do with complexity estimates after merging?.. I think it depends on whether the merged files are separate "lanes" from the same library (then it should be just recalculated from merged duplicates/total mapped reads), or whether the pairs come from different replicates (then they should be summer up, perhaps?). So do we need an argument for that?

@Phlya Phlya requested a review from agalitsyna April 8, 2022 11:34
assert stats['summary/frac_cis_4kb+'] == 0
assert stats['summary/frac_cis_10kb+'] == 0
assert stats['summary/frac_cis_20kb+'] == 0
assert stats['summary/frac_cis_40kb+'] == 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, these are great tests! Is it possible also to test the deduplication stats?
It's not my idea, though, I found it in #5

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's why I didn't notice the recent error in stats with the new dataframe method, because the test file doesn't have an duplicated pairs... SHould be easy to fix

@agalitsyna
Copy link
Member

@Phlya How about throwing a warning if "merge" command is in the header?

Copy link
Member

@agalitsyna agalitsyna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Ilya! This is cool and important. I only suggest some minor improvements and warning to introduce; also suggest to merge into pre 1.0.0 branch and not into master. I still test 1.0.0, thus I will additionally test these options while preparing the release of new version.

pairtools/pairtools_stats.py Outdated Show resolved Hide resolved
pairtools/pairtools_stats.py Outdated Show resolved Hide resolved
pairtools/pairtools_stats.py Outdated Show resolved Hide resolved
pairtools/pairtools_stats.py Outdated Show resolved Hide resolved
pairtools/pairtools_stats.py Outdated Show resolved Hide resolved
tests/data/mock.4stats.pairs Show resolved Hide resolved
pairtools/pairtools_stats.py Outdated Show resolved Hide resolved
pairtools/pairtools_stats.py Outdated Show resolved Hide resolved
@Phlya Phlya changed the base branch from master to pre0.4.0 April 26, 2022 19:21
@Phlya Phlya changed the title [WIP] Add summaries Add summaries Apr 27, 2022
@Phlya Phlya removed the request for review from golobor April 27, 2022 13:13
@agalitsyna agalitsyna merged commit 2bdac9a into pre0.4.0 Apr 27, 2022
@agalitsyna agalitsyna mentioned this pull request Apr 27, 2022
agalitsyna added a commit that referenced this pull request Jun 1, 2022
* Separate cli and lib

* pairtools flip fix for unannotated chromosomes, resolving #91

* handle empty chromosomes, resolved
#76

* fixed rfrags indexing and first rfrag omission, resolved
#73

* resolved or deprecated suggestions in #16

* merge improvements, header merge fixed

- resolved merge without arguments: #61

- option to add only the first header in merge, resolved
#18

* in merge, added option to concatenate instead of merge sorted inputs,
resolving: #23

* merge now checks that columns of inputs are the same

* I/O improvements

- auto_open defaults to stdin/stdout when path evaluates to False.
resolved #48

- auto_open defaults to stdin/stdout when the path is "-"

- if the stream is optional, it's controlled by the module itself

* Parse2 update (#99) (#109)

Improved version of parse2 with resolved comments from the previous PR: #96

- Separation of parse and parse2 modules. Parse has an option --walks-policy all, which parses long walks, but always reporting pair orientation and outer positions of 5'-ends, as if each pair was read in paired-end mode independently. Parse2 is specifically designed for long walks, and has options --report-position and --report-orientation, which might be used to report junctions, or reads, or walks.

- Parse2 has an option to parse single-end reads, --single-end option, tested on minimap2 output for MC-3C.

- Parse2 has the max_fragment_size instead instead of parse's max_molecule_size, which help to determine the overlapping ends of forward and reverse reads.

- Recent update simplifies the code: single _parse library used by both parse and parse2,

- a number of functions that reduce repetitive code, e.g. push_pair function,

- dosctrings and documented structure of _parse library.

- Both parse and parse2 have the options to report 5' or 3' ends; to flip alignments according to chromosome coordinate.

- Both parse and parse2 have the pysam backend

- Improvements of the tests for parse and parse2

- Documentation includes description of various --report-orientation and --report-position cases.

* Merge pairlib into pairtools.lib.

* CLI for scalings added.

* stats output in yaml format

* Header CLI (#121)

- new module called by `pairtools header`
- submodules: 
  - generate : Generate the header
  - set-columns : Add the columns to the .pairs/pairsam file
  - transfer : Transfer the header from one pairs file to another
  - validate-columns : Validate the columns of the .pairs/pairsam file
- resolves #119 
- option remove-columns for `pairtools select`: Remove the columns from .pairs/pairsam file

* pairtools phase critical update (#114)

* imporant fixes: - cython dedup with no-parent id forgotten counter reset; - sphinx doc update (added pysam); - header warning if empty and error if try to add a field to empy one

* Add summaries (#105)

* Add functions for duplication tile and complexity

* Make dedup stats!

* Benchmarks finalization

* [WIP] Stats split by filters (#132)

* Markasdup lib removed; markasdup CLI explanation improved

* dedup filter stats added and tested

Co-authored-by: Aleksandra Galitsyna <agalitzina@gmail.com>
Co-authored-by: Ilya Flyamer <flyamer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants