Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Qploidy2
Title: Estimation of Large-Scale Copy Number Variation Using Genotyping Data
Version: 1.9.0
Version: 1.9.1
Authors@R: c(person(given='Cristiane',
family='Taniguti',
email = 'ctaniguti@ufl.edu',
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Qploidy2 1.9.1

* Add `GenoBrew` links

# Qploidy2 1.9.0

* Fork from Cristianetaniguti/Qploidy@development
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ devtools::install_github("Breeding-Insight/Qploidy2")

* [Tutorial](https://Breeding-Insight.github.io/Qploidy2/Qploidy_alfalfa_tutorial.html) - large-scale copy number estimation in alfalfa mapping population using DArTag sequencing data

## Interactive visualization and curation of results

The resulted files from Qploidy2 `write_hmm_CN` function can be uploaded on `GenoBrew` Shiny interface.
The tab `CNV profiles` allow you to interactively inspect the BAF, z-score and CN calls plots,
re-run the HMM adjusting parameters for specific samples and update the results.

Visit `GenoBrew` GitHub [repository](https://github.com/Breeding-Insight/GenoBrew)
and [tutorial](https://scribehow.com/viewer/GenoBrew_Interactive_Marker_Panel_Evaluation_CNV_Visualization_and_Curation__4uWloBuPT1WlnCvW2UWiTg)
for more information.

![GenoBrew Demo](inst/app/www/GenoBrew_demo.gif)

## Contributing

Contributions are welcome! If you'd like to contribute, please fork the repository and submit a pull request to the development branch. For major changes, open an issue first to discuss your ideas.
Expand Down
7 changes: 0 additions & 7 deletions app.R

This file was deleted.

74 changes: 65 additions & 9 deletions docs/Qploidy_alfalfa_tutorial.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,26 @@ p$cn
p$baf_dist
```

See the results in a `data.frame` format:

```{r}
head(res$by_window)
head(res$by_marker)
head(res$params)
```

Summarize results:

```{r}
# By chromosome
summ_hmm_chr <- summarize_cn_mode(res, level = "chromosome")
summ_hmm_chr

# By sample
summ_hmm_sample <- summarize_cn_mode(res, level = "sample")
summ_hmm_sample
```


# HMM Copy Number Estimation (Multiple Samples)

Run HMM for all samples in parallel. The model will be selected internally using `select_best_baf_model`; you just need to define the grids (`bw`, `add_uniform_grid`, and `uniform_weight_grid`) according to what you observed when running it on a single sample.
Expand All @@ -428,12 +440,12 @@ Run HMM for all samples in parallel. The model will be selected internally using

```{r}
multi_esti_raw <- hmm_estimate_CN_multi(data = data,
geno.pos = geno.pos,
use_values = c("ratio","R"),
sample_ids = "all",
n_cores = 2,
cn_grid = c(2,3,4,5,6),
bw = c(0.02, 0.04,0.1))
geno.pos = geno.pos,
use_values = c("ratio","R"),
sample_ids = "all",
n_cores = 2,
cn_grid = c(2,3,4,5,6),
bw = c(0.02, 0.04,0.1))
```

Visualize CNV tracks for multiple samples:
Expand Down Expand Up @@ -569,6 +581,8 @@ p$arranged

Explore more parameters consulting `?hmm_estimate_CN`.

# Refine results for a single sample

Once you get to a conclusion with results better explain the patterns, you can update your multi-sample
HMM object by using the functions:

Expand All @@ -581,6 +595,48 @@ final_res <- update_hmm_CN_multi(multi_esti,
If you decide that the results for this sample is inconclusive,
you can set the `rm_sample` parameter to `TRUE` to remove it from your final results.

# Export HMM results

The resulted objects from function `update_hmm_CN_multi`,
`hmm_estimate_CN`, and `hmm_estimate_CN_multi` are all classified as

```{r}
class(res_tweak) # result from hmm_estimate_CN
class(multi_esti) # result from hmm_estimate_CN_multi
class(re_multi_esti) # result from hmm_estimate_CN_multi after re-standardization
class(final_res) # result from update_hmm_CN_multi
```

Therefore, all of them can be exported by the function:

```{r}
write_hmm_CN(final_res, prefix = "alfalfa_example")
```

You will see three generated files:

- "[prefix]_by_marker.csv.gz"
- "[prefix]_by_window.csv.gz"
- "[prefix]_params.rds"

You can read them back to R using the `read_hmm_CN` function:

```{r, eval=FALSE}
final_res <- read_hmm_CN(by_window_file = "alfalfa_example_by_window.csv.gz",
by_marker_file = "alfalfa_example_by_marker.csv.gz",
params_file = "alfalfa_example_params.rds")
```

# Interactive curation of results

The resulted files from `write_hmm_CN` can be uploaded on `GenoBrew` Shiny interface.
The tab `CNV profiles` allow you to interactively inspect the BAF, z-score and CN calls plots,
re-run the HMM adjusting parameters for specific samples and update the results.

Visit `GenoBrew` GitHub [repository](https://github.com/Breeding-Insight/GenoBrew)
and [tutorial](https://scribehow.com/viewer/GenoBrew_Interactive_Marker_Panel_Evaluation_CNV_Visualization_and_Curation__4uWloBuPT1WlnCvW2UWiTg)
for more information.

# Call dosages

**Warning**: Beta version - Dosage call requires more testing and review.
Expand Down Expand Up @@ -658,11 +714,11 @@ Klein, P. E., & Riera-Lizarazu, O. (2025). Exploring chromosomal variations in g
from high-density SNP array data and a new tool, Qploidy. The Plant Genome, e70044.
https://doi.org/10.1002/tpg2.70044

### Qploidy2 - HMM and BAF model selection
### Qploidy2 - HMM and grid approach BAF model selection

Manuscript in preparation. Please contact the author for more information.

### nQuack - BAF model selection
### nQuack - EM approach BAF model selection

Gaynor, M., Landis, J., O'Connor, T., Laport, R., Doyle, J., Soltis, D., Ponciano, J., & Soltis, P. (2024).
"nQuack: An R package for predicting ploidal level from sequence data using site-based heterozygosity."
Expand Down
390 changes: 246 additions & 144 deletions docs/Qploidy_alfalfa_tutorial.html

Large diffs are not rendered by default.

Binary file added inst/app/www/GenoBrew_demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified inst/app/www/Qploidy2_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading