rarefaction for first quartile?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
Research direction
Start by reproducing the reported workflow with mp_cal_rarecurve(), as.MPSE(), and mp_plot_rarecurve() using the supplied Abundance and Observe arguments. Trace where the plotting entry point selects the assay column, then confirm that first-quartile rarefaction and the downstream rarefaction curve work without the reported missing-column error.
Written by the indexing model from the issue text.
Description
I want to rarefy my samples to the first quartile.
i don't understand how mp_cal_rarecurve() works with this?
mouse.time.mpse %<>%
mp_cal_rarecurve(
.abundance = RareAbundance,
chunks = 400
)
I tried to do the rarefaction before converting my phyloseq to mpse but I could not go futher the downstream analysis from there as I get an error
summary(sample_sums(ps.prev))
ps.prev.rare <- rarefy_even_depth(ps.prev, sample.size = 3501, rngseed = 50)
Min. 1st Qu. Median Mean 3rd Qu. Max.
641 3501 20304 52969 68311 321517
`set.seed(50)` was used to initialize repeatable random subsampling.
Please record this for your records so others can reproduce.
Try `set.seed(50); .Random.seed` for the full vector
...
32 samples removedbecause they contained fewer reads than `sample.size`.
Up to first five removed samples are:
M-T1-Rep4M-T5-Rep2M-T5-Rep3M-T5-Rep4M-T5-Rep6
...
2025OTUs were removed because they are no longer
present in any sample after random subsampling
mpse.rare <- ps.prev.rare %>% as.MPSE()
mpse.rare %>% print(width=180)
# A MPSE-tibble (MPSE object) abstraction: 286,732 × 20
# OTU=2956 | Samples=97 | Assays=Abundance | Taxonomy=Kingdom, Phylum, Class, Order,
# Family, Genus, Species
OTU Sample Abundance sample.name sample.no Sample.x Phase Region Regime
<chr> <chr> <dbl> <chr> <int> <fct> <fct> <fct> <fct>
1 ASV1 feed-M-Rep1 6 M1 170 feed feed feed M
2 ASV3 feed-M-Rep1 424 M1 170 feed feed feed M
3 ASV5 feed-M-Rep1 0 M1 170 feed feed feed M
4 ASV6 feed-M-Rep1 0 M1 170 feed feed feed M
5 ASV7 feed-M-Rep1 0 M1 170 feed feed feed M
6 ASV8 feed-M-Rep1 0 M1 170 feed feed feed M
7 ASV9 feed-M-Rep1 0 M1 170 feed feed feed M
8 ASV10 feed-M-Rep1 0 M1 170 feed feed feed M
9 ASV11 feed-M-Rep1 0 M1 170 feed feed feed M
10 ASV12 feed-M-Rep1 0 M1 170 feed feed feed M
Sample_Regime sample_regime sample sample_or_control Kingdom
<fct> <chr> <chr> <chr> <chr>
1 feed.M feed.M feed sample k__Bacteria
2 feed.M feed.M feed sample k__Bacteria
3 feed.M feed.M feed sample k__Bacteria
4 feed.M feed.M feed sample k__Bacteria
5 feed.M feed.M feed sample k__Bacteria
6 feed.M feed.M feed sample k__Bacteria
7 feed.M feed.M feed sample k__Bacteria
8 feed.M feed.M feed sample k__Bacteria
9 feed.M feed.M feed sample k__Bacteria
10 feed.M feed.M feed sample k__Bacteria
Phylum Class Order Family Genus Species
<chr> <chr> <chr> <chr> <chr> <chr>
1 p__Firmicutes c__Clostridia o__Oscillospirales f__Ru… g__u… s__un_…
2 p__Firmicutes c__Bacilli o__Lactobacillales f__La… g__L… s__un_…
3 p__Proteobacteria c__Alphaproteobacteria o__Rhodobacterales f__Rh… g__P… s__un_…
4 p__Proteobacteria c__Gammaproteobacteria o__Aeromonadales f__Ae… g__A… s__un_…
5 p__Bacteroidota c__Bacteroidia o__Cytophagales f__Sp… g__A… s__un_…
6 p__Proteobacteria c__Gammaproteobacteria o__Burkholderiales f__Co… g__P… s__un_…
7 p__Verrucomicrobiota c__Verrucomicrobiae o__Verrucomicrobia… f__Ru… g__L… s__un_…
8 p__Proteobacteria c__Alphaproteobacteria o__Rhodobacterales f__Rh… g__R… s__un_…
9 p__Proteobacteria c__Gammaproteobacteria o__Enterobacterales f__En… g__E… s__un_…
10 p__Proteobacteria c__Gammaproteobacteria o__Burkholderiales f__Su… g__A… s__un_…
# … with 286,722 more rows
# ℹ Use `print(n = ...)` to see more rows
mpse.rare %>%
mp_plot_rarecurve(
.rare = Abundance,
.alpha = Observe,
)
Error in `dplyr::select()`:
! Can't subset columns that don't exist.
✖ Column `Abundance` doesn't exist.
Backtrace:
1. mpse.rare %>% ...
8. dplyr:::select.data.frame(., !!rlang::sym("Sample"), !!.rare)
Error in dplyr::select(., !!rlang::sym("Sample"), !!.rare) :
- Dominant language
- R
- Stars
- 195
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from YuLab-SMU/MicrobiotaProcess
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
YuLab-SMU/MicrobiotaProcess#136 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 25/100
YuLab-SMU/MicrobiotaProcess#134 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
YuLab-SMU/MicrobiotaProcess#133 ·
-
Bracken to MPSEOpen
Difficulty 5/5 Over a week Newbie friendliness 25/100
YuLab-SMU/MicrobiotaProcess#132 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
YuLab-SMU/MicrobiotaProcess#131 ·
All issues in YuLab-SMU/MicrobiotaProcess
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rstudio/reticulate#1933 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lrberge/fixest#686 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100