Just starting with PhyloGenerator...

72 views
Skip to first unread message

Bec Harris

unread,
Apr 10, 2017, 5:55:30 AM4/10/17
to phyloGenerator Users
Hi Will,
I'm just starting with your programme, and I have a question that I hope isn't going to be too annoying....

I want to generate a plant phylogeny with ~261 taxa. I've tried to make a constraint tree using pez and the phylogeny from Zanne et al (2014), using the code you sent someone else on the list (below), but it seems that none of my species are in the tree, so I end up with a tree with nothing in it. My species list is attached - I tried to follow the format from the demo examples, but perhaps it's not correct?



#Load pez package
  require(pez)
  #Load phylogeny and species
  tree <- read.tree("Vascular_Plants_rooted.dated.tre")
  species <- read.delim("veg_names_final.csv", as.is=TRUE)[,1]
  #Make tree and drop unwanted species
  tree <- congeneric.merge(tree, species)
  tree <- drop.tip(tree, setdiff(tree$tip.label, species)) 



Any help you could give me would be great, 
Bec
veg_names_final.txt

Will

unread,
Apr 10, 2017, 10:42:10 AM4/10/17
to Bec Harris, phyloGenerator Users
Hello Bec,

Thanks for getting in touch. The format of names in your species list and the phylogeny have to be the same; the Zanne tree uses underscores ("_") and your species list uses spaces (" ") so congeneric.merge can't figure out what's a genus name and what's a species name. So you could either run:

library(pez)
tree <- read.tree("Vascular_Plants_rooted.dated.tre")
species <- read.delim("veg_names_final.csv", as.is=TRUE)[,1]
species <- gsub(" ", "_", species)
tree <- congeneric.merge(tree, species)
tree <- drop.tip(tree, setdiff(tree$tip.label, species)) 

...or...

library(pez)
tree <- read.tree("Vascular_Plants_rooted.dated.tre")
species <- read.delim("veg_names_final.csv", as.is=TRUE)[,1]
tree$tip.label <- gsub("_", " ", tree$tip.label)
tree <- congeneric.merge(tree, species)
tree <- drop.tip(tree, setdiff(tree$tip.label, species))

...and you would be fine. Does that make sense?

Cheers,

Will

---

Need a phylogeny? Try phyloGenerator: original or new version
Measuring phylogenetic structure? Try install.packages('pez')

Will Pearse
Assistant Professor of Biology, Utah State University
Skype: will.pearse

Bec Harris

unread,
Apr 11, 2017, 5:52:58 AM4/11/17
to phyloGenerator Users, R.M.B....@acecrc.org.au
Hi Will,
Thanks for getting back so quickly with a solution. It all makes perfect sense!
Cheers,
Bec

Bec Harris

unread,
Apr 11, 2017, 8:23:05 AM4/11/17
to phyloGenerator Users
Hi Will,
I've been going though the tutorials and guide for phyloGenerator, and I was wondering if you could answer a couple of questions:
1. What is the minimum number of sequence records required for a species to be included? I've got a few that come up as having 0 sequences available, but when I look them up on GenBank, there are some records there (although often not many <20);
2. Is it possible to save a run before finishing, and return to it later?
3. If I select the default plant gene at the beginning, which gene should I use to trim my sequences? When I use 10, I get a warning, DNA type changed!


Cheers,
Bec

Bec Harris

unread,
Apr 12, 2017, 8:50:13 AM4/12/17
to phyloGenerator Users
Sorry,
you can ignore this - I've sorted it out now.

Cheers,
Bec

Will

unread,
Apr 12, 2017, 10:58:54 AM4/12/17
to Bec Harris, phyloGenerator Users
Answering your questions anyway, in case they're useful to others:

1. There is no minimum number of sequences. pG checks on the basis of sequence "quality" and annotations: if there are a thousand sequences but none of them pass the test, then it won't download them. You can play with download options to make it more/less fussy at the DNA download prompt.
2. pG1: On Linux, press control+z to send the task to the background, and then type 'fg' to bring it back and start it up again. I think the same key commands work on a Mac. On a PC I don't know, but I imagine there's a comparable command. You can't, however, 'checkpoint' your run such that you can turn off your computer and start again.
pG2: the above applies for pG2 too, but you can also use the cache function to resume a search you've already started. So you can turn off and restart using pG2.
3. I'm not quite sure what your question is, because I'm not quite sure what you mean by '10'. It sounds like you're using the default plant search options (rbcL and matK); if so, then make sure you're trimming on the basis of plant plastid codons (could be number 10, I can't remember and the numbers can change as they're not  hard-coded in pG). I would say that a warning doesn't necessarily mean you've got a problem - I'm just telling you that you've changed gene type, that's all :D

Cheers,

Will

---

Need a phylogeny? Try phyloGenerator: original or new version
Measuring phylogenetic structure? Try install.packages('pez')

Will Pearse
Assistant Professor of Biology, Utah State University
Office: +1-435-797-0831; Room BR-139
Skype: will.pearse

Bec Harris

unread,
Apr 18, 2017, 9:01:00 AM4/18/17
to phyloGenerator Users

Thanks for that, Will.

I made a constraint tree from Zanne et al (2014), but now I realise that it is a rooted tree, which you warn against in phyloGenerator. Can you recommend another, unrooted, phylogeny I could use as a constraint tree for vascular plants? 


Thanks,

Bec






On Monday, 10 April 2017 11:55:30 UTC+2, Bec Harris wrote:

Will

unread,
Apr 19, 2017, 3:33:22 AM4/19/17
to Bec Harris, phyloGenerator Users
Hello Bec,

No worries. You can unroot any rooted tree; in R, you would type something like:

library(ape)
tree <- read.tree("file.tre")
tree <- unroot(tree)

...and you're away! :D


Cheers,

Will

---

Need a phylogeny? Try phyloGenerator: original or new version
Measuring phylogenetic structure? Try install.packages('pez')

Will Pearse
Assistant Professor of Biology, Utah State University
Office: +1-435-797-0831; Room BR-139
Skype: will.pearse

madsenm...@appstate.edu

unread,
Nov 14, 2017, 4:54:26 PM11/14/17
to phyloGenerator Users
On Wednesday, April 19, 2017 at 3:33:22 AM UTC-4, Will Pearse wrote:
> Hello Bec,
>
>
> No worries. You can unroot any rooted tree; in R, you would type something like:
>
>
> library(ape)
> tree <- read.tree("file.tre")
> tree <- unroot(tree)
>


> ...and you're away! :D
>
> Hi Will,

As a response to the previous comment on unrooting trees in R, could you explain how to import the newick format as a dataset in R studio? The read.tree command gives me this error:
Error in scan(file = file, what = "", sep = "\n", quiet = TRUE, skip = skip, : 'file' must be a character string or connection

Any response is helpful!

Many thanks,

Tesa

P.s. PhyloGenerator is solving all of my problems (If I get it to work)- thanks!!

Will

unread,
Nov 15, 2017, 1:11:27 PM11/15/17
to madsenm...@appstate.edu, phyloGenerator Users
Hello Tesa,

Thanks for this. As you say, this is a bit off-topic as the problem you describe is related to the function read.tree in the R package ape.

Anyway, it sounds like you're giving the function the wrong kind of argument. You should give it the location of a phylogeny, in Newick format, to be read - something like tree <- read.tree("~/a/valid/location/given/in/double_quotes.txt"). If that doesn't work then you could email me, but not the list (as I don't want to clutter people's inboxes with the file), with the file you're trying to load and I'll see what's going on.


Cheers,

Will

---

Need a phylogeny? Try phyloGenerator: original or new version
Measuring phylogenetic structure? Try install.packages('pez')

Will Pearse
Assistant Professor of Biology, Utah State University
Office: +1-435-797-0831; Room BR-139
Skype: will.pearse
Reply all
Reply to author
Forward
0 new messages