microbiome / mia

Microbiome analysis
https://microbiome.github.io/mia/
Artistic License 2.0
48 stars 28 forks source link

Import data from text files #87

Closed antagomir closed 3 years ago

antagomir commented 3 years ago

We only have data import from QIIME2 format (from external files), and then we have converters (within R) from DADA2, Biom, phyloseq to TSE.

I suggest adding import function that could import data from text files straight to the TSE format, similar to microbiome::read_csv2phyloseq and written in the style of mia::loadFromQIIME2

FelixErnst commented 3 years ago

TL;DR: I don't think this will work.

Which restriction do you want to apply? Which format must the csv-file have for the import to work?

If this just about importing count data the examples here (step 3) are quite comprehensive.

If it is about importing taxonomic or sample data alongside the count data, the conclusion would be the implementation of another file format. I think we have enough of those

antagomir commented 3 years ago

Fair enough. Some users seem to have data as CSV files (abundances, sample data, tax tables). Obtained from external providers and with difficulties to get other formats. I am getting these questions from users through different routes.

Hence, reading from text (CSV) files is an option that should be supported at least the level of documentation.

Perhaps easiest solution would be to cite that SE reference in MiaBook.

FelixErnst commented 3 years ago

Thats probably the best way to start. The short version would be just 4 lines of code:

tax <- read.csv(tax_file)
samples <- read.csv(sample_file)
counts <- read.csv(count_file)
SummarizedExperiment(assays = list(counts = counts),
                     colData = samples,
                     rowData = tax)
antagomir commented 3 years ago

Made PR #19 in MiaBook.