edit names in phylogenetic tree in newick format

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have a phylogenetic tree in newick format, and I would like to remove some fragments of the name of the taxa,



1_[genus_specie_1]_characters:0.2654682758,(((((((((((((((2_[genus_specie_2]_characters:0.0379334280,54_[genus_specie_2]_characters:0.0605802067)/1/100:0.0121248674,(3_[genus_specie_3]_characters:0.0206432295,4_[genus_specie_4]_characters:0.0141250479)/1/100:0.0647820408)/1/100:0.0235327264,30_[genus_specie_5]_characters


I would like to remove the fragments out of the square brackets, for example



genus_specie_1:0.2654682758,(((((((((((((((genus_specie_2:0.0379334280,genus_specie_2:0.0605802067)/1/100:0.0121248674,(genus_specie_3:0.0206432295,genus_specie_4:0.0141250479)/1/100:0.0647820408)/1/100:0.0235327264,genus_specie_5
perl -i -pe 'y///d' file.nwk



and I have also tried whit the next sed command



sed 's/[[:alnum:]_]*[([[:alnum:]_]*)][[:alnum:]_]*/1/g' 


but it doesn't work









share







New contributor




erick rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    I have a phylogenetic tree in newick format, and I would like to remove some fragments of the name of the taxa,



    1_[genus_specie_1]_characters:0.2654682758,(((((((((((((((2_[genus_specie_2]_characters:0.0379334280,54_[genus_specie_2]_characters:0.0605802067)/1/100:0.0121248674,(3_[genus_specie_3]_characters:0.0206432295,4_[genus_specie_4]_characters:0.0141250479)/1/100:0.0647820408)/1/100:0.0235327264,30_[genus_specie_5]_characters


    I would like to remove the fragments out of the square brackets, for example



    genus_specie_1:0.2654682758,(((((((((((((((genus_specie_2:0.0379334280,genus_specie_2:0.0605802067)/1/100:0.0121248674,(genus_specie_3:0.0206432295,genus_specie_4:0.0141250479)/1/100:0.0647820408)/1/100:0.0235327264,genus_specie_5
    perl -i -pe 'y///d' file.nwk



    and I have also tried whit the next sed command



    sed 's/[[:alnum:]_]*[([[:alnum:]_]*)][[:alnum:]_]*/1/g' 


    but it doesn't work









    share







    New contributor




    erick rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a phylogenetic tree in newick format, and I would like to remove some fragments of the name of the taxa,



      1_[genus_specie_1]_characters:0.2654682758,(((((((((((((((2_[genus_specie_2]_characters:0.0379334280,54_[genus_specie_2]_characters:0.0605802067)/1/100:0.0121248674,(3_[genus_specie_3]_characters:0.0206432295,4_[genus_specie_4]_characters:0.0141250479)/1/100:0.0647820408)/1/100:0.0235327264,30_[genus_specie_5]_characters


      I would like to remove the fragments out of the square brackets, for example



      genus_specie_1:0.2654682758,(((((((((((((((genus_specie_2:0.0379334280,genus_specie_2:0.0605802067)/1/100:0.0121248674,(genus_specie_3:0.0206432295,genus_specie_4:0.0141250479)/1/100:0.0647820408)/1/100:0.0235327264,genus_specie_5
      perl -i -pe 'y///d' file.nwk



      and I have also tried whit the next sed command



      sed 's/[[:alnum:]_]*[([[:alnum:]_]*)][[:alnum:]_]*/1/g' 


      but it doesn't work









      share







      New contributor




      erick rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I have a phylogenetic tree in newick format, and I would like to remove some fragments of the name of the taxa,



      1_[genus_specie_1]_characters:0.2654682758,(((((((((((((((2_[genus_specie_2]_characters:0.0379334280,54_[genus_specie_2]_characters:0.0605802067)/1/100:0.0121248674,(3_[genus_specie_3]_characters:0.0206432295,4_[genus_specie_4]_characters:0.0141250479)/1/100:0.0647820408)/1/100:0.0235327264,30_[genus_specie_5]_characters


      I would like to remove the fragments out of the square brackets, for example



      genus_specie_1:0.2654682758,(((((((((((((((genus_specie_2:0.0379334280,genus_specie_2:0.0605802067)/1/100:0.0121248674,(genus_specie_3:0.0206432295,genus_specie_4:0.0141250479)/1/100:0.0647820408)/1/100:0.0235327264,genus_specie_5
      perl -i -pe 'y///d' file.nwk



      and I have also tried whit the next sed command



      sed 's/[[:alnum:]_]*[([[:alnum:]_]*)][[:alnum:]_]*/1/g' 


      but it doesn't work







      linux shell sed perl





      share







      New contributor




      erick rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      erick rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      erick rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 min ago









      erick rodriguez

      61




      61




      New contributor




      erick rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      erick rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      erick rodriguez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          erick rodriguez is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474927%2fedit-names-in-phylogenetic-tree-in-newick-format%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          erick rodriguez is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          erick rodriguez is a new contributor. Be nice, and check out our Code of Conduct.












          erick rodriguez is a new contributor. Be nice, and check out our Code of Conduct.











          erick rodriguez is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f474927%2fedit-names-in-phylogenetic-tree-in-newick-format%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?