Heat tree for QIIME OTU tables

49 views
Skip to first unread message

Richard Rodrigues

unread,
Dec 27, 2017, 7:52:56 PM12/27/17
to metacoder
Hi Zach

Based on your replies to previous similar question(s), I was able to parse the OTU table and view a heat tree. I was wondering if you can help me how to use the "sum" column from the OTU table. Secondly, I was wondering if we can use (average) relativised abundances for the heat tree.


library
(metacoder)
file
= 'cc_count_sum_abund.txt'
outfile
= 'genus-v1.pdf'

df
= read.table(file, header=T, check.names=F, sep='\t')
head
(df)
colnames
(df)[ncol(df)] = 'class'
colnames
(df)[1] = "obs_info"

data
= parse_taxonomy_table(df, taxon_col = c("class" = -1), other_col_type = "obs_info", class_sep = ";")

pdf
(outfile)
set.seed(1)
filter_taxa
(data, n_supertaxa < 6) %>%  
  heat_tree
(node_size = n_obs, node_color_range = c("white", "#DFDFDF", "gray75", "#c6e1f6", "#6db9f2"), node_label = name, node_color = n_obs)
dev
.off()




Thanks.

-Rich
cc_count_sum_abund.txt

Zachary Foster

unread,
Jan 4, 2018, 7:43:53 PM1/4/18
to metacoder
Hello Rich,

Sorry for the delay! The holidays slowed me down and I have a back log of emails to get to. Check out the attached and let me know if you have questions.

Best,

-Zach
2018_01_04--richard_rodrigues.zip
example.pdf

Richard Rodrigues

unread,
Jan 8, 2018, 12:42:43 PM1/8/18
to metacoder
No worries, this is fantastic!

Btw, I use following to save the plots
pdf(name.pdf)
heat_tree cmd
dev
.off()

 but it creates a two page pdf, first page is blank and the image shows on the second. Is this something that is specific to me (the method I try to save)?

Thanks.

-Rich

Zachary Foster

unread,
Jan 8, 2018, 12:55:20 PM1/8/18
to metacoder
Hi Rich,

Did you try the "output_file" option in "heat_tree"? That can save a PDF, but it will be the size of the plot, not a page size.

Best,

Zach

Richard Rodrigues

unread,
Jan 8, 2018, 12:59:30 PM1/8/18
to metacoder
Not yet, I'll try it. Thanks.
Reply all
Reply to author
Forward
0 new messages