Skip to content

Commit

Permalink
fix import to TREESUMMARIZEDEXPERIMENT
Browse files Browse the repository at this point in the history
  • Loading branch information
d4straub committed Nov 26, 2024
1 parent e24f4f5 commit cf4eeba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/local/treesummarizedexperiment.nf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ process TREESUMMARIZEDEXPERIMENT {
taxonomy_table <- DataFrame(taxonomy_table)
# Match rownames between taxonomy table and abundance matrix.
taxonomy_table <- taxonomy_table[rownames(taxonomy_table) %in% rownames(otu_mat), ]
taxonomy_table <- taxonomy_table[match(rownames(otu_mat), rownames(taxonomy_table)), ]
# Create TreeSE object.
tse <- TreeSummarizedExperiment(
Expand All @@ -52,6 +52,7 @@ process TREESUMMARIZEDEXPERIMENT {
# sample metadata must match with colnames of abundance matrix.
if (file.exists($sam_tsv)) {
sample_meta <- read.table($sam_tsv, sep="\\t", header=TRUE, row.names=1)
sample_meta <- sample_meta[match(colnames(tse), rownames(sample_meta)), ]
sample_meta <- DataFrame(sample_meta)
colData(tse) <- sample_meta
}
Expand Down

0 comments on commit cf4eeba

Please sign in to comment.