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

Error when trying to write as a CSV the marker_table #116

Open
mdtorohernando opened this issue May 15, 2024 · 1 comment
Open

Error when trying to write as a CSV the marker_table #116

mdtorohernando opened this issue May 15, 2024 · 1 comment

Comments

@mdtorohernando
Copy link

mdtorohernando commented May 15, 2024

Hi! I was using microbiomeMarker for a long time, but I've recently update the package and I find a problem.

I usually make the analysis in this way...

mm_lefse_Phylum <- run_lefse(
  ps, 
  norm = "CPM",
  taxa_rank = "Phylum",
  wilcoxon_cutoff = 0.05, 
  group = "Group", 
  kw_cutoff = 0.05, 
  multigrp_strat = TRUE, 
  lda_cutoff = 3
)

mm_lefse_Phylum

# microbiomeMarker-class inherited from phyloseq-class
# normalization method:              [ CPM ]
# microbiome marker identity method: [ lefse ]
# marker_table() Marker Table:       [ 1 microbiome markers with 5 variables ]
# otu_table()    OTU Table:          [ 10 taxa and  28 samples ]
# sample_data()  Sample Data:        [ 28 samples by  6 sample variables ]
# tax_table()    Taxonomy Table:     [ 10 taxa by 1 taxonomic ranks ]

marker_table(mm_lefse_Phylum)
write.csv(marker_table(mm_lefse_Phylum), file = 'mm_lefse_Phylum.csv', row.names = F)

pdf("mm_lefse_phylum.pdf")
plot_abundance(mm_lefse_Phylum, group = "Group")
plot_ef_bar(mm_lefse_Phylum)
plot_ef_dot(mm_lefse_Phylum)
dev.off()

So now... all is OK (pdf graphs are OK), but, when I'm trying to write as CSV I find this error:

> write.csv(marker_table(mm_lefse_Phylum), file = 'mm_lefse_Phylum.csv', row.names = F)
Error en validObject(.Object): 
  invalid class “marker_table” object: marker table must have non-zero dimensions

When I visualize the mm_lefse_Phylum it is not empty

> marker_table(mm_lefse_Phylum)
Object of class "marker_table"
               feature enrich_group   ef_lda     pvalue       padj
marker1 Proteobacteria           WT 4.189638 0.02068083 0.02068083

It seems that now marker_table is not treated as a data frame... I really don't know what to do, as I've tried to convert into a data frame but it seems not to work.

Thanks!

María

@mdtorohernando mdtorohernando changed the title Error when trying to write.csv a marker_table Error when trying to write as a CSV the marker_table May 15, 2024
@mdtorohernando
Copy link
Author

sorry, my version of microbiomeMarker is v1.10.0

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

No branches or pull requests

1 participant