nclark-lab / RERconverge

Analysis of convergence between organismal traits and DNA/protein sequences
GNU General Public License v3.0
43 stars 26 forks source link

Trouble calculating RER by getAllResiduals, all NA generated #61

Open Frank1219 opened 3 years ago

Frank1219 commented 3 years ago

Hi, I got all NA after I used getAllResiduals function, my tree file is like this: ((((Scr: 0.09432, PtrR: 0.25619): 0.53261, (Mku: 0.12212, Bpl: 0.11323): 0.39060): 0.13721, (Llu: 0.52161, Cte: 0.51477): 0.11940): 0.13313, Nge: 0.14091); Is there something error with my tree file ? Could you give me some suggestions ?

Frank1219 commented 3 years ago

@sorrywm

Frank1219 commented 3 years ago

@wgmao @raghavendranpartha @mchikina It's urgent, and please give me some ideas if possible, thanks so much.

nclark-lab commented 3 years ago

Dear Frank, Could you send us your tree file, so we could take a look at it? That’s the best way for us to help. Did the readTrees function seem to work?

Best, -Nathan

On Apr 1, 2021, at 8:26 PM, Frank @.**@.>> wrote:

Hi, I got all NA after I used getAllResiduals function, my tree file is like this: ((((Scr: 0.09432, PtrR: 0.25619): 0.53261, (Mku: 0.12212, Bpl: 0.11323): 0.39060): 0.13721, (Llu: 0.52161, Cte: 0.51477): 0.11940): 0.13313, Nge: 0.14091); Is there something error with my tree file ? Could you give me some suggestions ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/nclark-lab/RERconverge/issues/61, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHP5F5AIASJRV56AFO7UL33TGUTOTANCNFSM42ID3UJQ.

Frank1219 commented 3 years ago

Yes,tree file can be read by readTrees function, but all NA was generated by getAllResiduals function with these parameters: 'useSpecies=toyTrees$masterTree$tip.label, transform = "sqrt", weighted = T, scale = T'. GeneTrees.txt

sorrywm commented 3 years ago

Dear Frank,

The species in your tree do not have the same names as those in the toyTrees master tree, so if you use useSpecies in the way you describe, that will exclude all species in your tree. You should see the following message indicating this: Species from master tree not present in useSpecies: Scr,PtrR,Mku,Bpl,Llu,Cte,Nge

If you want to use useSpecies with your dataset, you should provide a vector of species names that are present in your trees.

I hope this is helpful.

Sincerely, Wynn

Frank1219 commented 3 years ago

@sorrywm Hi, the species name used for useSpecies parameter are like this, how to provide a correct data to it ? image

Sincerely, Frank

sorrywm commented 3 years ago

Hi Frank,

I think the issue is that the default for getAllResiduals is to use min.sp=10. Since you have fewer than 10 species in your tree, all residual calculations will be excluded. Try using a smaller value for min.sp, and you should get results.

Thank you for using RERconverge!

Sincerely, Wynn

Frank1219 commented 3 years ago

Hi, I added min.sp and it worked, thanks so much.
Now, I have another problem now : the tree of species-labeled phenotype values was set like this, but I do not know how to set the value of ancestor of Scr and PtrR, ancestor of Mku and Bpl, and ancestor of Llu and Cte. phenotype tree: ((((Scr: 1, PtrR: 0): 1, (Mku: 0, Bpl: 1): 1): 1, (Llu: 1, Cte: 0): 1): 1, Nge: NA);

Sincerely, Frank

Frank1219 commented 3 years ago

@sorrywm Hi, Can you give me some suggestions ? thanks so much.

Sincerely, Frank

sorrywm commented 3 years ago

I don't understand the problem. In the tree you provided, the ancestral branches you referenced have branch lengths set to 1, which means they will be considered foreground branches. If you would prefer them to be background branches, set their branch lengths to 0. For more details on the expected format of binary trait trees, and ways to specify them or infer them from terminal trait values, please see the "Binary Trait Analysis" section of the walkthrough.

Frank1219 commented 3 years ago

Hi, I will try it again, thanks. @sorrywm

Sincerely, Frank