Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to write to a newick tree with root? #248

Open
teng-gao opened this issue Sep 9, 2024 · 1 comment
Open

How to write to a newick tree with root? #248

teng-gao opened this issue Sep 9, 2024 · 1 comment

Comments

@teng-gao
Copy link

teng-gao commented Sep 9, 2024

Currently, using cas_tree.get_newick() I get a tree that, when read into R as a phylo object, is unrooted (example below).

Is there a way to add a root in the written newick tree?

'((((((((((GCTAGTGTCCTCATCA,(GCTAGCTCAGTCTAAT,TGTCAATCAGAGGCTA)),TGGTGATTCTGGCATG,TCGCGAGGTGTGTGGT),(GCGATTTAGCCTCTGT,GTACTAATCCGGTATG)),(((ATCACAATCCATCAGG,GTTTCAGCACAAGCCT),GGTGTGACAAACGGGC),GGATATTGTCATGCAA,(TGCATCCTCAAGCGCC,TTATAGCCAGAGAGCC),(ATCTTTGGTCTTGCAT,TCGTTATTCGACAAAG),AACTGTTCACTAGCGT,GGTTCTTGTATGTGGC,(CGGTGAACATGTTGGC,GCCCAAATCAATTACG)),CAGGCTATCCTAAGTA,(AATAACCGTAGTTACG,TGTTGGCCACGGTACT),(((ACGGTTTAGACACCGC,AAACCGAAGTTTGAGC),(TCCATATTCGCCTAAG,(GTCATTAAGTTAGCTA,CGGCCATAGACAGGTA))),(TCAAGACTCTGCAAAC,CAGGAAGGTAAAGCAA),CCTAAGTAGTAGAGGC,((AATACCGGTTCCTGTG,TTTGCGGAGCTCCCTG),((GTCCGTAAGAAAGGAA,(GTGCGGTTCACGTTAA,GGGTTTGTCACTCGCT)),(CGCTTAACACGAATCC,TACGTTAAGGGTCCAC))))),(AACTTAGTCGTGCCTT,TAGCAGGCAGATTCAT)),(AGCAATACAGGTTCAC,(CAATGTCAGTTAGACC,AGGACTAAGGCGTAAA))),(AATCCTAAGGAACACA,ATTACTGAGTCACCTC)),(AATAGAGGTTCGGGAT,CCATAATCATGGCCCA),(GGCATGGAGCAGCTAT,GCACGAACATTGTGGC)),(((ACAGTATGTCATCATC,TACAGCTAGTGAACCT),AGCCTAAGTTGGTTAG),((GGTTACCCACCACAAC,GCCACTAAGAATGACG),CGTGTTACAGGAAGCC))),(((((((TACTCAAAGAGCAAGC,ACTTATGAGTCATTAG),(AGTGTTTCAGCACGTT,TCGTTACGTGTCCAGG),((CTTCAAGCAAGCCACT,CTAATCCGTTGCGTAA),(CATAGCTAGCCTGGTA,CTCCGGACATTGTGTG),(TTTCACCCAGGAAGCC,GAGGTTAAGCAAGGGT,CGTGGTTCAAGGTACG,TGTCCTGGTGTTGCAA,GAGTCATTCACTTCAT,(AATACCGGTTTCGCGC,(CCAAGTTAGCTGGCTA,TGCGCGAGTTCCGGGA)),GGAGCAAGTTCCTCCT,CGCATATAGCACTAGT,(AGTATAGCACTTAACG,CAAACTGGTTAGGCGT,CTGACATAGTGCACGC,GTAGGTGCATCCAGGT,GTTCGCGCAATTGACT))),(TTTAACCTCTATCGCC,TGCAGGCTCATTGACA)),(CTACGAAGTCATTACC,TTGCAATCAGTACCGT)),(GAGGAGGCAGTTATCG,(GGTATTTCAACGTGCT,CTTCAGGAGTAGCGGG))),TACGCACCAACTAGAA),((GCATGAAAGATGGAGC,GACCTGATCCCGTTGT),(AGCCTGGGTTTGAGGC,(GCTGCAATCGCTTCTA,(GTGAATCTCGTTAAGC,(GTGCACGGTTAAGCCA,GTAGGAGGTTCCGCAC)))))),(((((((((CGAATATGTAATTAGC,TGCTCCGTCGGGCCAT),GGTGCTGGTTGCGCGA),(AGTGCCGGTATTGTCC,CAGGACCTCGCTAGCA)),((TTGTCCCAGGAATAAC,CGTCCTAGTCTTACTA),(GTGATGAAGGGCCACT,AGTAACGAGTCCTGAG))),GGTCAAGCAACACTTG),(((CGCAATGTCTATTGTC,GCCTTAACAGCCAGTT),TACATCAAGTGCACGC),TTTAGCTTCATGTGGT)),((AGCAAATAGGTTTGAC,TAGTCAATCAGAAACG),(TGTAACTCACATAACT,GGTTGCTCAGTTATCG))),(GATTGATGTCCGTGAG,CATCCTCAGTTATGTG)),CTCTAGCTCCTTCAAT),(CCTATATTCTTGCTAT,(TTAGCGGTCCGCAAAT,AAGCTCCCAAGGTGCA)),AATGAAGGTTAGTTGG,(TGGAACAAGTGAGGTA,(TGGACGGAGGAACCGG,(GCTAAGTTCAATCTCT,ATCTTTGGTAATGGAA)))),((((((((CTTACCGGTCCACAAA,TGAAGTGAGCTATGAC,GAGAAACGTGGACATC),((GCTAACAGTTGCACGG,ACTTGAATCTTTAGGA),(CCTAATAAGGCAGGTG,TGAGAACCAAGGTACG,TTTGTCCCATCCCGCT))),(((GAGGCTACAACCTGGT,(AATTGGGAGTAACCCG,CCGATGCAGTATCGCG)),(GACCTCAAGGAGGACT,(GCGGAACCAGGTCCTG,GAAAGCCAGGGCTTTG,ACTTACAAGGCGCACT,CATCCTGGTGATCAGC,CTGGCTAAGACACCGC,CTGTTGGAGGTTACAC,GACCTTTGTGTGTGGT,GCTTTGTGTAGGTTAT,TCTCACCAGTTTGGGT,TCTCCTCGTCAAAGGG,TGACTTCGTTGCTTCG,TGGTCAAGTAGTAAGA,TTTATGGAGGACACTT))),(TGGCCTGCAGCTACGT,(GGTTAGCGTCCTTTAA,ATGGCTTAGCATGACT)))),(ATATGGTGTAACGAGG,TTGCACACAATGCCTA)),(CGTTGCAAGGCTAAGA,GGGTATTTCGATATTG)),TTGGGCCAGCTAAGTC),AGTTGTCAGCTTAGCG),(GGAGCAAGTGCGCGTA,ATTACGTCAAACTGCC)),((((GTAGGTGCACCCTCAC,GGAATCTTCGGGACCT),TAGTTGTCACGTGCTG,TGCGCAGGTTAGCAGC),(GCTGATCCAGTAATAG,(CAGCTATAGCTCGCTT,TAGCGCGGTTTCCTCC)),((TATGGTCAGGTCCTGA,ATTACTGAGCAGGCCT),(GGGCAATAGCGCATTG,TGTTTGTTCTAATCCT))),((TTGCGAGTCGGTTAGT,CATGCATAGAGGGACT),(TGCTTCCAGGGACGCA,GGTATTGGTTTCAGGA)),((GTGCTGATCACTCGCT,(CGTGCTGCAGCATGAG,GCACCTAAGGCATTAC)),GCAATGAAGCCTGACA)),((((((GCTTCGCGTTTAGTCC,GCCAATAGTTAAGTGT),((GGTCATTAGTTAGCTA,GTTAGGCGTTCGCTCA),GGCCTTCGTACAAAGA,(GGAAGCTAGCGAGTAA,GCAGGCTTCATGGTTA,TTAATCGAGCTCGCTT,(GCCTATTGTTAGGCGT,GCGGTTGGTTCCTGAT)))),(GTTCGCTTCCGGCTAA,CGGTAACGTGAGCGAA)),TGGCTTTGTCACGAAC),GTCAAACTCATAATCG),CCTAAGTAGAAGGTGC),((((((GGCTATGTCATTTGCT,TGCCTGTTCGGGCCAT),(AAAGGACGTAGCTAGC,TACGTTAAGCTGAGGG)),(GCTGAGGAGTAACGGA,AGCTCATAGCTTACTT)),(TGCTTAAAGCATCCAG,GCCAATTAGCTCGCTT)),((ATGTTCAAGTAACAGG,GCGATTAGTCATCATC),GTGTCCAAGCATTATG)),CATAACGGTAGGTTTG),((TAATCACCAACAACAA,(CAGCTATAGGCCAATT,TTCGTGCTCATGCAAC)),(GACTATTCATTAGCGC,ATTGCGCCAACTCGCG)),(((TGGCCAATCATGTGGT,GCTTAACAGGATTGAG),GCGCCTTGTTGAGCCG),(TAGCTAATCAGCTAAC,AGTTACATCGTTACTT)));'
@mattjones315
Copy link
Collaborator

Hey @teng-gao,

Can you give me a bit more information on this tree? Is it rooted in Cassiopeia, just not when you write out to newick? What happens if you add a "dummy" node to the very front of the newick string? What package are you using to read into R?

Hope to get this solved for you soon,
Matt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants