Commit dfd4144d authored by Jasper Koehorst's avatar Jasper Koehorst
Browse files

removes logicalPath from metadata due to conflicts and print statements for...

removes logicalPath from metadata due to conflicts and print statements for the biom command improved
parent 9b4958f9
......@@ -31,6 +31,7 @@ met_file = paste0(PREFIX, "_metadata.tsv")
# Load metadata
metadata <- fread(input = met_file, header = FALSE)
metadata = metadata[!grep("logicalPath",metadata$V2),]
metadata = unique(metadata)
metadata <- dcast(metadata, V1 ~ V2, value.var = "V3")
names = colnames(metadata)
......@@ -64,7 +65,7 @@ taxmat = taxmat[, -1]
# Table format renamed
if (dim(taxmat)[2] == 6)
taxonomy = as.data.frame(paste0("k__",taxmat[,1],";p__",taxmat[,2], ";c__",taxmat[,3], ";o__",taxmat[,4],";f__",taxmat[,5],";g__",taxmat[,6]))
if (dim(taxmat)[2] == 6)
if (dim(taxmat)[2] == 7)
taxonomy = as.data.frame(paste0("k__",taxmat[,1],";p__",taxmat[,2], ";c__",taxmat[,3], ";o__",taxmat[,4],";f__",taxmat[,5],";g__",taxmat[,6],";s__", taxmat[,7]))
colnames(taxonomy) = "taxonomy"
......@@ -90,5 +91,6 @@ biom_tsv = paste0(PREFIX, "_biom.tsv")
write.table(merged, file = biom_tsv, sep = "\t", quote = FALSE)
# biom convert -i PREFIX_biom.tsv -o PREFIX.biom --to-hdf5
# biom add-metadata -i PREFIX.biom -o PREFIX.biom -m PREFIX_metadata_table.tsv
\ No newline at end of file
print(paste0("biom convert -i ",PREFIX,"_biom.tsv -o ",PREFIX,".biom --to-hdf5"))
print(paste0("biom add-metadata -i ",PREFIX,".biom -o ",PREFIX,".biom -m ",PREFIX,"_metadata_table.tsv"))
print(paste0("biom convert -i ",PREFIX,".biom -o ",PREFIX,".json --to-json"))
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment