Re: [R-sig-phylo] Randomly Resolved Polytomies

2017-06-21 Thread Liam J. Revell

Hi Laura.

I think multi2di also performs random resolutions, so if you wanted to 
generate, say, 100 random resolutions could you not do:


trees<-replicate(100,multi2di(tree),simplify=FALSE)
class(trees)<-"multiPhylo"

All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 6/21/2017 12:18 PM, Laura Jackson wrote:

Hi Liam,

I was trying to get this to work on my tree, but it seems that it
doesn't work for larger phylogenies (~1000 tips)? I get the following
error message,..."Error in allTrees(n, TRUE, dd) :
That would generate 7905853580625 trees, and take up more than
7905853581 MB of memory! "

I have attached my phylogeny here. I am trying to get even 10 different
randomly resolved trees. Is this possible with my phylogeny?

Thanks.
-Laura


On Wed, Jun 21, 2017 at 11:08 AM, Laura Jackson
> wrote:

Liam,

Thanks so much for your reply and for the blog post, I was able to
get it working.

-Laura

On Wed, Jun 21, 2017 at 10:35 AM, Liam J. Revell
> wrote:

Dear Laura.

I also just posted a possible solution to my blog here:

http://blog.phytools.org/2017/06/generating-set-of-random-resolutions-of.html

.

All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/

email: liam.rev...@umb.edu 
blog: http://blog.phytools.org

On 6/21/2017 11:02 AM, Liam J. Revell wrote:

[This sender failed our fraud detection checks and may not
be who they
appear to be. Learn about spoofing at
http://aka.ms/LearnAboutSpoofing
]


Hi Laura.

The phytools functions resolveNode and resolveAllNodes could
be used.
They resolve either a single node in all possible ways; or
all nodes in
all possible ways, returning a "multiPhylo" object. Note
that in the
latter case the number of trees can be quite large. From the
phytools
doc: "For resolveNode applied to a multifurcation with n
descendants,
the number of resolved trees will be equal to the number of
possible
rooted trees of n taxa. (For instance, three for a
trifurcation, 15 for
a quadrifurcation, and so on.) For resolveAllNodes the
number of fully
resolved trees will be equal to the product of numbers for
resolveNode
applied to each multifurcation separately. (For instance, 45
for a tree
containing one trifurcation and one quadrifurcation.)" To
get a random
set of resolved trees, rather than all possible trees
(because this
number can be high), you could start with one multifurcating
node in the
tree, resolve it in all ways using resolveNode, pick one of
those
resolutions, then move to the next node & so on. I will try
to post a
formal solution & then share it to the list.

All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/

email: liam.rev...@umb.edu 
blog: http://blog.phytools.org

On 6/21/2017 10:38 AM, Laura Jackson wrote:

Hi all,

I am using the ape package to randomly resolve
polytomies using
'multi2di'
and wondering if there is a way to use this function to
get a single
output
tree file that contains multiple different randomly
resolved trees using
some number of resamplings?

Thanks,
-Laura


___
R-sig-phylo mailing list - R-sig-phylo@r-project.org

https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

Searchable archive at
http://www.mail-archive.com/r-sig-phylo@r-project.org/





--

Re: [R-sig-phylo] Randomly Resolved Polytomies

2017-06-21 Thread Laura Jackson
Hi Liam,

I was trying to get this to work on my tree, but it seems that it doesn't
work for larger phylogenies (~1000 tips)? I get the following error
message,..."Error in allTrees(n, TRUE, dd) :
That would generate 7905853580625 trees, and take up more than 7905853581
MB of memory! "

I have attached my phylogeny here. I am trying to get even 10 different
randomly resolved trees. Is this possible with my phylogeny?

Thanks.
-Laura


On Wed, Jun 21, 2017 at 11:08 AM, Laura Jackson 
wrote:

> Liam,
>
> Thanks so much for your reply and for the blog post, I was able to get it
> working.
>
> -Laura
>
> On Wed, Jun 21, 2017 at 10:35 AM, Liam J. Revell 
> wrote:
>
>> Dear Laura.
>>
>> I also just posted a possible solution to my blog here:
>> http://blog.phytools.org/2017/06/generating-set-of-random-re
>> solutions-of.html.
>>
>> All the best, Liam
>>
>> Liam J. Revell, Associate Professor of Biology
>> University of Massachusetts Boston
>> web: http://faculty.umb.edu/liam.revell/
>> email: liam.rev...@umb.edu
>> blog: http://blog.phytools.org
>>
>> On 6/21/2017 11:02 AM, Liam J. Revell wrote:
>>
>>> [This sender failed our fraud detection checks and may not be who they
>>> appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing]
>>>
>>>
>>> Hi Laura.
>>>
>>> The phytools functions resolveNode and resolveAllNodes could be used.
>>> They resolve either a single node in all possible ways; or all nodes in
>>> all possible ways, returning a "multiPhylo" object. Note that in the
>>> latter case the number of trees can be quite large. From the phytools
>>> doc: "For resolveNode applied to a multifurcation with n descendants,
>>> the number of resolved trees will be equal to the number of possible
>>> rooted trees of n taxa. (For instance, three for a trifurcation, 15 for
>>> a quadrifurcation, and so on.) For resolveAllNodes the number of fully
>>> resolved trees will be equal to the product of numbers for resolveNode
>>> applied to each multifurcation separately. (For instance, 45 for a tree
>>> containing one trifurcation and one quadrifurcation.)" To get a random
>>> set of resolved trees, rather than all possible trees (because this
>>> number can be high), you could start with one multifurcating node in the
>>> tree, resolve it in all ways using resolveNode, pick one of those
>>> resolutions, then move to the next node & so on. I will try to post a
>>> formal solution & then share it to the list.
>>>
>>> All the best, Liam
>>>
>>> Liam J. Revell, Associate Professor of Biology
>>> University of Massachusetts Boston
>>> web: http://faculty.umb.edu/liam.revell/
>>> email: liam.rev...@umb.edu
>>> blog: http://blog.phytools.org
>>>
>>> On 6/21/2017 10:38 AM, Laura Jackson wrote:
>>>
 Hi all,

 I am using the ape package to randomly resolve polytomies using
 'multi2di'
 and wondering if there is a way to use this function to get a single
 output
 tree file that contains multiple different randomly resolved trees using
 some number of resamplings?

 Thanks,
 -Laura


>>> ___
>>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>>> Searchable archive at
>>> http://www.mail-archive.com/r-sig-phylo@r-project.org/
>>>
>>
>
>
> --
> *Laura M. Jackson*
> PhD Candidate
> Department of Biology
> 185 Churchill Haines
> University of South Dakota
> 414 E. Clark St.
> Vermillion SD 57069-1746
> Email: laura.jack...@usd.edu
>



-- 
*Laura M. Jackson*
PhD Candidate
Department of Biology
185 Churchill Haines
University of South Dakota
414 E. Clark St.
Vermillion SD 57069-1746
Email: laura.jack...@usd.edu


Eel_phylogeny.phy
Description: Binary data
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Randomly Resolved Polytomies

2017-06-21 Thread Laura Jackson
Liam,

Thanks so much for your reply and for the blog post, I was able to get it
working.

-Laura

On Wed, Jun 21, 2017 at 10:35 AM, Liam J. Revell 
wrote:

> Dear Laura.
>
> I also just posted a possible solution to my blog here:
> http://blog.phytools.org/2017/06/generating-set-of-random-re
> solutions-of.html.
>
> All the best, Liam
>
> Liam J. Revell, Associate Professor of Biology
> University of Massachusetts Boston
> web: http://faculty.umb.edu/liam.revell/
> email: liam.rev...@umb.edu
> blog: http://blog.phytools.org
>
> On 6/21/2017 11:02 AM, Liam J. Revell wrote:
>
>> [This sender failed our fraud detection checks and may not be who they
>> appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing]
>>
>>
>> Hi Laura.
>>
>> The phytools functions resolveNode and resolveAllNodes could be used.
>> They resolve either a single node in all possible ways; or all nodes in
>> all possible ways, returning a "multiPhylo" object. Note that in the
>> latter case the number of trees can be quite large. From the phytools
>> doc: "For resolveNode applied to a multifurcation with n descendants,
>> the number of resolved trees will be equal to the number of possible
>> rooted trees of n taxa. (For instance, three for a trifurcation, 15 for
>> a quadrifurcation, and so on.) For resolveAllNodes the number of fully
>> resolved trees will be equal to the product of numbers for resolveNode
>> applied to each multifurcation separately. (For instance, 45 for a tree
>> containing one trifurcation and one quadrifurcation.)" To get a random
>> set of resolved trees, rather than all possible trees (because this
>> number can be high), you could start with one multifurcating node in the
>> tree, resolve it in all ways using resolveNode, pick one of those
>> resolutions, then move to the next node & so on. I will try to post a
>> formal solution & then share it to the list.
>>
>> All the best, Liam
>>
>> Liam J. Revell, Associate Professor of Biology
>> University of Massachusetts Boston
>> web: http://faculty.umb.edu/liam.revell/
>> email: liam.rev...@umb.edu
>> blog: http://blog.phytools.org
>>
>> On 6/21/2017 10:38 AM, Laura Jackson wrote:
>>
>>> Hi all,
>>>
>>> I am using the ape package to randomly resolve polytomies using
>>> 'multi2di'
>>> and wondering if there is a way to use this function to get a single
>>> output
>>> tree file that contains multiple different randomly resolved trees using
>>> some number of resamplings?
>>>
>>> Thanks,
>>> -Laura
>>>
>>>
>> ___
>> R-sig-phylo mailing list - R-sig-phylo@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>> Searchable archive at
>> http://www.mail-archive.com/r-sig-phylo@r-project.org/
>>
>


-- 
*Laura M. Jackson*
PhD Candidate
Department of Biology
185 Churchill Haines
University of South Dakota
414 E. Clark St.
Vermillion SD 57069-1746
Email: laura.jack...@usd.edu

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Randomly Resolved Polytomies

2017-06-21 Thread Liam J. Revell

Dear Laura.

I also just posted a possible solution to my blog here: 
http://blog.phytools.org/2017/06/generating-set-of-random-resolutions-of.html.


All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 6/21/2017 11:02 AM, Liam J. Revell wrote:

[This sender failed our fraud detection checks and may not be who they
appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing]

Hi Laura.

The phytools functions resolveNode and resolveAllNodes could be used.
They resolve either a single node in all possible ways; or all nodes in
all possible ways, returning a "multiPhylo" object. Note that in the
latter case the number of trees can be quite large. From the phytools
doc: "For resolveNode applied to a multifurcation with n descendants,
the number of resolved trees will be equal to the number of possible
rooted trees of n taxa. (For instance, three for a trifurcation, 15 for
a quadrifurcation, and so on.) For resolveAllNodes the number of fully
resolved trees will be equal to the product of numbers for resolveNode
applied to each multifurcation separately. (For instance, 45 for a tree
containing one trifurcation and one quadrifurcation.)" To get a random
set of resolved trees, rather than all possible trees (because this
number can be high), you could start with one multifurcating node in the
tree, resolve it in all ways using resolveNode, pick one of those
resolutions, then move to the next node & so on. I will try to post a
formal solution & then share it to the list.

All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 6/21/2017 10:38 AM, Laura Jackson wrote:

Hi all,

I am using the ape package to randomly resolve polytomies using
'multi2di'
and wondering if there is a way to use this function to get a single
output
tree file that contains multiple different randomly resolved trees using
some number of resamplings?

Thanks,
-Laura



___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at
http://www.mail-archive.com/r-sig-phylo@r-project.org/


___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


[R-sig-phylo] Randomly Resolved Polytomies

2017-06-21 Thread Laura Jackson
Hi all,

I am using the ape package to randomly resolve polytomies using 'multi2di'
and wondering if there is a way to use this function to get a single output
tree file that contains multiple different randomly resolved trees using
some number of resamplings?

Thanks,
-Laura

-- 
*Laura M. Jackson*
PhD Candidate
Department of Biology
185 Churchill Haines
University of South Dakota
414 E. Clark St.
Vermillion SD 57069-1746
Email: laura.jack...@usd.edu

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/