Dear Lindsey.

Thanks for posting your code, but would you mind sending me (it can be 
off-list) an example in which I can also pull your data & tree and 
re-run it with the real data that is generating the error? This might be 
helpful in getting to the bottom of your issue. Thanks!

All the best, Liam

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


On 1/10/2023 4:20 PM, Lindsey Dehaan wrote:
> CAUTION: EXTERNAL SENDER
>
> Hi all,
>
> I have a question regarding the phytools function locate.fossil().
>
> I have had a lot of success with this function but there are two fossils of
> mine that the function does not like. I give the function my phylogeny, a
> max and min age for the fossil, and the edge for the fossil to be placed
> on. So I basically just want the function to estimate the branch length
> subtending the fossil and the position of where the node subtending the
> fossil attaches in the phylogeny.
>
> For two of my fossils I get the following error.
>
>
>
> *Error in bind.tree(tree, tip, where = where, position = pp) :   'position'
> is larger than the branch length*
>
> The function does not seem to like my edge constraint with these two
> fossils. When I remove my edge constraint it works and the fossil is placed
> in the correct time interval but just on a different edge estimated using
> ML. For one of my fossils, the edge I place my fossil on ranges from 42 mya
> to 4 mya and the age range for the fossil is between 33 and 28 mya. I am
> confused why the function does not like the edge constraints I am giving
> it. The error that I receive makes me believe that the position the
> function is estimating for my fossil may be older than the edge constraint
> I am giving it or I could just be missing something, most likely the
> latter...
>
> Below is my code. This code works for almost all my fossils except for two
> of them.
>
>
>
>
>
>
>
>
>
>
>
> *fossil_to_add<-fossil_trait_data[13,] locate_fossil_data<-rbind(extant_data,
> fossil_to_add) # used this data in
> locate.fossil()extant_sister_clade<-rownames(extant_data)[c(grep(fossil_info[13,7],
> rownames(extant_data)), grep(fossil_info[13,8],
> rownames(extant_data)))]mrca<-getMRCA(tree,
> extant_sister_clade)edge<-mrcamin_time<- depth - fossil_info[13,4] # depth
> is the root age of the phylogeny max_time<-depth - fossil_info[13,3] # the
> max and min ages are positive numbers time_constraints<-c(max_time,
> min_time)locate_fossil_tree<-locate.fossil(tree, locate_fossil_data,
> time.constraint=time_constraints,edge.constraint=edge, plot=TRUE)*
>
> Any help or advice, would be greatly appreciated!
>
> Best,
> Lindsey
> --
> Lindsey DeHaan
> Ph.D. Candidate
> Department of Earth and Environmental Sciences
> University of Michigan
>
>          [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-phylo mailing list -R-sig-phylo@r-project.org
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-phylo&data=05%7C01%7Cliam.revell%40umb.edu%7C27cb8a8eb3dc4651433008daf35090b6%7Cb97188711ee94425953c1ace1373eb38%7C0%7C0%7C638089824617167715%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=tYwyCJW%2BdLBEpy4Tn290%2BXqmQNkV6%2FdGGsJmgnBXUcU%3D&reserved=0
> Searchable archive 
> athttps://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.mail-archive.com%2Fr-sig-phylo%40r-project.org%2F&data=05%7C01%7Cliam.revell%40umb.edu%7C27cb8a8eb3dc4651433008daf35090b6%7Cb97188711ee94425953c1ace1373eb38%7C0%7C0%7C638089824617167715%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=AGbpdEbfZDhgeTNHnQsgzRkj2%2FngM5Ud%2FCDVEFDCvnw%3D&reserved=0
        [[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/

Reply via email to