-
Notifications
You must be signed in to change notification settings - Fork 4
Added thinSNP function #40
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
be4f2ab
Added thinSNP function
alex-sandercock 23fc569
Update DESCRIPTION
alex-sandercock 4d0fa76
update madc2gmat function
alex-sandercock 9118cd0
test update
alex-sandercock f606048
updated test
alex-sandercock 66dec47
added madc2gmat method
alex-sandercock 494e60a
update documentation
alex-sandercock 4436464
updated madc2gmat method
alex-sandercock deee40b
updated madc2gmat
alex-sandercock d732bc1
Update breedtools_functions.R
alex-sandercock 7a22ee3
RefAlt updog2vcf support added
alex-sandercock f04dce8
Merge pull request #43 from Breeding-Insight/development
alex-sandercock 4666a1f
updated docs
alex-sandercock 21472ab
fix botloci base
alex-sandercock 8e41b92
fixing test
alex-sandercock eaa1812
internalized Qsolve
alex-sandercock b98602e
version
alex-sandercock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,16 +3,17 @@ | |||||
| #' Scale and normalize MADC read count data and convert it to an additive genomic relationship matrix. | ||||||
| #' | ||||||
| #'@details | ||||||
| #' This function reads a MADC file, processes it to remove unnecessary columns, scales and normalizes the data, and | ||||||
| #' then converts it into an additive genomic relationship matrix using the `A.mat` function from the `rrBLUP` package. | ||||||
| #' This function reads a MADC file, processes it to remove unnecessary columns, and then | ||||||
| #' converts it into an additive genomic relationship matrix using the first method proposed by VanRaden (2008). | ||||||
| #' The resulting matrix can be used for genomic selection or other genetic analyses. | ||||||
| #' | ||||||
| #'@import dplyr | ||||||
| #'@importFrom utils read.csv write.csv | ||||||
| #'@importFrom rrBLUP A.mat | ||||||
| #'@import tibble stringr dplyr tidyr | ||||||
| #' | ||||||
| #'@param madc_file Path to the MADC file to be filtered | ||||||
| #'@param seed Optional seed for random number generation (default is NULL) | ||||||
| #'@param method Method to use for processing the MADC data. Options are "unique" or "collapsed". Default is "collapsed". | ||||||
| #'@param ploidy Numeric. Ploidy level of the samples (e.g., 2 for diploid, 4 for tetraploid) | ||||||
| #'@param output.file Path to save the filtered data (if NULL, data will not be saved) | ||||||
| #' | ||||||
| #'@return data.frame or saved csv file | ||||||
|
|
@@ -27,14 +28,17 @@ | |||||
| #' # Converting to additive relationship matrix | ||||||
| #' gmat <- madc2gmat(madc_file, | ||||||
| #' seed = 123, | ||||||
| #' ploidy=2, | ||||||
| #' output.file = NULL) | ||||||
| #' | ||||||
| #'@references | ||||||
| #'Endelman, J. B. (2011). Ridge regression and other kernels for genomic selection with R package rrBLUP. The Plant Genome, 4(3). | ||||||
| #'@references VanRaden, P. M. (2008). Efficient methods to compute genomic predictions. Journal of Dairy Science, 91(11), 4414-4423 | ||||||
| #'@author Alexander M. Sandercock | ||||||
| #' | ||||||
| #'@export | ||||||
| madc2gmat <- function(madc_file, | ||||||
| seed = NULL, | ||||||
| method = "collapsed", | ||||||
| ploidy, | ||||||
|
||||||
| ploidy, | |
| ploidy = 2, |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ploidy parameter lacks a default value, making it a required parameter. This is a breaking change for existing code. Consider providing a sensible default (e.g., ploidy = 2) or document this as a breaking change in the function documentation.