problem in reading data from a previous tool (Pathoscope)

63 views
Skip to first unread message

Osnat Limanovich

unread,
Dec 15, 2017, 11:19:01 AM12/15/17
to metacoder
Hi,

I'm trying to read in a relative abundance table from metagenomic data (txt file). I have a "Taxa" column (at least 4 levels, levels separated by ';') but I can't seem to get it read in.
I tried to use the parse_taxonomy_table() function but get an error - Error in parse_taxonomy_table(table) :  argument "taxon_col" is missing, with no default.

I'm attaching a sample of my data.

I'd appreciate any help with this, I am anxious to replace my barcharts with these tree heat maps!

thanks!
Osnat
sample_MG_for_metacoder.txt

Zachary Foster

unread,
Dec 15, 2017, 12:31:29 PM12/15/17
to metacoder
Hello Osnat,

No problem! Check out the attached example and let me know if you have any questions. Best,

-Zach
2017_12_15--osnat_parsing.zip
example.pdf

Osnat Limanovich

unread,
Dec 15, 2017, 3:01:19 PM12/15/17
to metacoder
thanks for your answer Zach. I tried your suggestion and it worked for the sample data I provided, but when I tried running this on my full output table (which is ~190 column and ~6700 rows), I get an error at the final command (of plotting). here is everything I run with the warnings and errors I get - 

> devtools::install_github("ropensci/taxa")
> devtools::install_github("grunwaldlab/metacoder")
> library(metacoder)
> table <- read.table("all_firstbaseline_samples_allkingdom_111917.txt", sep = "\t", header = TRUE)
> parsed <- parse_tax_data(table, class_cols = "taxa", class_sep = ";")
Warning message:
Naming table columns/vectors/lists the same name as functions can sometimes interfere with non-standard evaluation. The following data shares names with functions:
 data$tax_data$taxa

> parsed$data$taxon_counts <- calc_taxon_abund(parsed, "tax_data")
No `cols` specified, so using all numeric columns:
   MET1074_6007_moist_Ic_R_0_U ... MET2077_6025_moist_Ic_R_0_U, MET2080_6025_moist_Pc_R_0_A

Summing per-taxon counts from 188 columns for 6688 taxa

> parsed$data$taxon_counts$total <- rowSums(parsed$data$taxon_counts[, -1])

> set.seed(2)
> heat_tree(parsed,
+           node_size = n_obs,
+           node_color = total,
+           node_label = taxon_names)
Error in if (fmin > (sfactor * fave - fmax)/(sfactor - 1)) { : 
  missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In FUN(X[[i]], ...) :
  Could not apply layout 'reingold-tilford' to subgraph. Using 'fruchterman-reingold' instead.
2: In max(Fitness, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf
3: In min(f, na.rm = TRUE) :
  no non-missing arguments to min; returning Inf
4: In max(f, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf

In my data I have 3 taxonomic kingdoms - bacteria, viruses and eukaryotes (fungi), if that's relevant to the parameters that should be set...

If you have any suggestion on how to work this out I would be happy to hear.
Thanks so much for your help!
Osnat

Osnat Limanovich

unread,
Dec 15, 2017, 3:19:22 PM12/15/17
to metacoder
Just adding - when I tried running this with only a subset of my data (focusing just on one viral family) it did work. so are the errors due to my big data set (the complete one) or is there something else I'm doing wrong?

Thanks!
Osnat

Osnat Limanovich

unread,
Dec 27, 2017, 4:28:04 PM12/27/17
to metacoder
Hi Zach,

I re-trying some of my data with metacoder and ran into this error - when running the parse_tax_data function - 

> parsed <- parse_tax_data(table, class_cols = "taxa", class_sep = ";")
Error in get(obj) : 
  lazy-load database '/Users/tirosho/Library/R/3.3/library/metacoder/data/Rdata.rdb' is corrupt
In addition: Warning message:
In get(obj) : internal error -3 in R_decompress1

I tried removing the metacoder package from my library and re-installing (using (devtools::install_github(repo="grunwaldlab/metacoder", build_vignettes = TRUE) as specified in the github manual), but got the same error.

I would be happy to hear if you have any suggestions as how to fix this.

Thanks,
Osnat

Zachary Foster

unread,
Dec 27, 2017, 8:52:23 PM12/27/17
to metacoder
Hello Osnat,

That looks like an error I see occasionally when I have an old R session. Does closing and reopening RStudio/R fix it? If you are automatically reloading your environment, does clearing it fix it?

I just saw that you reported an error on Dec 15. I did not see that until now. Sorry for the delay! I will try to address that now.

I don't recognize that error and unfortunately its pretty vague, so I will need to reproduce it on my computer to fix it. Can you send me an input dataset that causes that error? The whole dataset might be too big to email. In that case, can you try to find a subset that causes the error? Thanks!

-Zach

Osnat Limanovich

unread,
Dec 28, 2017, 1:53:36 PM12/28/17
to metacoder
Thanks Zach!

Opening a new session did solve the problem I posted about yesterday, that's good to know!
About my second problem, I only get the error when I worked with a huge input dataset, and after some adjustments of that file I was able to subset it only to the data I really need, for which Metacoder worked just fine.
So thanks for your help!

Osnat
Reply all
Reply to author
Forward
0 new messages