Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Move functions to package (#2)
* feat: add an R package file structure * build: add chrombinarize R package to renv * feat: move the creation of bed files over to package * refactor: Force wrapper to handle processing of data for create_bins feat: add ability to specify which chromosomes to create blanks for docs: update documentation to accomodate changes * docs: update documentation to be actually correct * refactor: rename function to describe what it does better The main function here doesn't create files, it just creates the data that can be put into files. docs: update docs to reflect refactor * style: fix indentation * feat: add tests for creation of blank bed data * refactor: use a much smaller Rds file to test functionality * test: add test for processing of chromosomes length file * test: use chromosome Y for even smaller RDS file * fix: use new function name * fix: use bin_size * feat: add license for R package * refactor: move functions to package * refactor: set names upon file read * docs: add documentation for error rate estimation function * refactor: remove 'reverse_binomial' function This wasn't really needed. It can all just be done inside of the dplyr pipe * refactor: define column names on reading the file * refactor: prefer read depth over sample size * docs: update documentation * test: add tests for estimate_error_rate * feat: move assessment of dense methylation to package * test: add tests for incorrect file reading refactor: move file reading to separate function * test: Find errors with incorrect file specification feat: add extra checking of column classes * refactor: move verification of column classes to separate file * docs: add docs page for verify column class * feat: add a function that reads methylation data This functionality is used in lots of files. This should help massively with consistency in column names * docs: add documentation to function * feat: upgrade column verification to ensure name is m or h only * docs: add details on why errors are thrown. * refactor: rename name column to mark_name This is more indicative of what it holds * refactor: use read_methylation_data function * feat: add a read bedmethyl function * refactor: consistent function names the function reads in a bedmethyl file * refactor: use new read_comparison_bedmethyl function * refactor: More understandable way of combining "m" with "h" Also the previous way didn't add read depth or account for situations where the simple addition of percentages resulted in something above 100%. * docs: strand is not in comparison_bedmethyl data * feat: add comparison plotting functions to package docs: add Roxygen comments * refactor: Add filtering of data to all plotting functions * refactor: use match args to enforce mark input * fix: use correct column names * refactor: use chrombinarize functionality * fix: remove old filtering step * refactor: move combining 5hmC and 5mC signal to package * style: section naming * fix: update plot axes names to be general Can be BS, WGBS or oxBS. Easiest to just say BS as this encompasses all three * refactor: Make error estimating function more general Now takes methylation data and filters it for you. Instead of forcing the user to create a good reference set first. Obviously, they still have the ability to filter to CGIs, but I can't account for this easily in R. * docs: make return field nicer formatting * feat: add erroneous rate plotting to package * refactor: use chrombinarize functions refactor: remove percent script (no longer needed) * docs: make example output more believeable * feat: move cpg robustness to package feat: acutally find the surrounding methylation in a radius Previously this code just found the methylation of neighbouring CpGs, which ain't good enough. There may be a small performance increase as well (though I don't know how much by). * fix: further filter to chromosome Previously, if a CpG is close in position from `start` across two different chromosomes, they would be compared. This is obviously wrong. * docs: add documentation for CPG robustness functions * feat: add defaults defaults match those used in config file * refactor: use functions from package * docs: add return * test: add initial tests * test: fix tests for estimating error rate * feat: suppress warnings in favour of my own stopping Warnings are messing up tests * fix: R scripts expect "m" or "h" only It is easier this way than to allow "mh" as well. * feat: suppress warnings * test: add tests for reading in bedmethyl files * refactor: remove unnecessary c() calls * docs: update * feat: add default values to be consistent * test: add test for error rate plot data * fix: use or instead of and Previous conditional logic on the start column would always result in an empty data frame * test: add test for cpg robustness functions * test: add tests for adding absolute change columns * feat: add checks for nonsensicle rows Rows should have positive region sizes. No negative numbers should exist and percent methylation should be bounded above by 100 * fix: ensure only numerical columns are checked Certain strings can be less than 0 due to how the comparison works. This was a problem with strand for example as "." < 0 returns TRUE * test: add tests for bad methylation data files Negative values, negative regions and over 100% methylation * chore: add comments to explain why errors are expected * feat: move comments to info argument * refactor: use inheritParams more to reduce repetition * refactor: commit to bedmethyl over methylbed * docs: update docs to say what bedmethyl format is * refactor: read_bedmethyl ensures these columns are numeric These extra lines are therefore useless. * chore: update version * fix: person information given in wrong order * build: add new chrombinarize package to renv * docs: add proper example use case * chore: conform to linter's indentation * docs: convert title to title case * feat: add checks for column types * feat: add check for chromosome name being "chrxyz" * docs: make params consistent with others * docs: clear up inconsistencies and bad wording * feat: ensure max read depth isn't too high If max read depth is too high, you'll just end up with lots of NaN values. This ensures that doesn't happen * docs: clear up bad wording * docs: update man pages * build: add workflow for testing package * fix: workflow could not install devtools * build: update name of task * chore: extra plotting libraries not actually used * refactor: consistent naming * refactor: change shit up according to cmdcheck * build: try again with the workflow * build: try again
- Loading branch information