Question: Converting Taxonomic Lineages Into A Common Tree
2
gravatar for Pawel Szczesny
6.0 years ago by
Pawel Szczesny3.2k
Poland
Pawel Szczesny3.2k wrote:

I have a number of lineages like this:

Bacteria;Chlamydiae;Chlamydiae;Chlamydiales;Chlamydiaceae;Chlamydophila;
Bacteria;Firmicutes;Bacilli;Lactobacillales;Lactobacillaceae;Lactobacillus;
Bacteria;Firmicutes;Bacilli;Lactobacillales;Streptococcaceae;Streptococcus;
... (the list continues)

Is there any tool capable of converting these lineages into common tree in Nexus or Newick format?

tree • 2.3k views
ADD COMMENTlink written 6.0 years ago by Pawel Szczesny3.2k

You may also want to take a look at this: http://www.biostars.org/post/show/13452/parsing-ncbi-taxonomic-tree/#13464

ADD REPLYlink written 6.0 years ago by jhc2.7k
8
gravatar for Pierre Lindenbaum
6.0 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum112k wrote:

The following java program should work:

compile & run:

javac Biostar52895.java

$ echo "Bacteria;Chlamydiae;Chlamydiae;Chlamydiales;Chlamydiaceae;Chlamydophila;
Bacteria;Firmicutes;Bacilli;Lactobacillales;Lactobacillaceae;Lactobacillus;
Bacteria;Firmicutes;Bacilli;Lactobacillales;Streptococcaceae;Streptococcus;" | java Biostar52895

((((((Chlamydophila)Chlamydiaceae)Chlamydiales)Chlamydiae)Chlamydiae,((((Lactobacillus)Lactobacillaceae,(Streptococcus)Streptococcaceae)Lactobacillales)Bacilli)Firmicutes)Bacteria);
ADD COMMENTlink modified 3.6 years ago • written 6.0 years ago by Pierre Lindenbaum112k
7

Biostars classic :) "Is there a tool that ...?" Pierre's answer: "Yes, there is. Let me write it for you." Thank you very, very much Pierre.

ADD REPLYlink written 6.0 years ago by Pawel Szczesny3.2k

hey pierre. thanks a lot for this solution. probably a stupid question but i'm a biochemist and this is my first java program ever. i've compiled your program on my mac os x 10.8 and want to run it now, but it just goes into an endless loop. how is the input (the list) specified. thx!

ADD REPLYlink modified 5.9 years ago • written 5.9 years ago by david10

@Pierre, I tried the javascript but somehow it didn't work. Did my miss some dependencies of java packages or something in my installed java program? ( I have no knowledge in java)

echo "Bacteria;Chlamydiae;Chlamydiae;Chlamydiales;Chlamydiaceae;Chlamydophila;
Bacteria;Firmicutes;Bacilli;Lactobacillales;Lactobacillaceae;Lactobacillus;
Bacteria;Firmicutes;Bacilli;Lactobacillales;Streptococcaceae;Streptococcus;" | java Biostar52895

 

error meaasge:
Exception in thread "main" java.lang.NoClassDefFoundError: Biostar52895
Caused by: java.lang.ClassNotFoundException: Biostar52895
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: Biostar52895. Program will exit.

 

ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by bioinfo680

it's not javascript, it's java

it's compiled compiled with

javac Biostar52895.java

 

and executed with

 

java Biostar52895
ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by Pierre Lindenbaum112k

Now I see javac didn't compile the Biostart52895.java and the expected .class file was missing. can you point me why?

javac Biostar52895.java
Output:
Biostar52895.java:13: > expected
        Map<String,Node> children=new TreeMap<String, Biostar52895.Node="">();
                                                                       ^
Biostar52895.java:13: ';' expected
        Map<String,Node> children=new TreeMap<String, Biostar52895.Node="">();
                                                                        ^
Biostar52895.java:13: illegal start of type
        Map<String,Node> children=new TreeMap<String, Biostar52895.Node="">();
                                                                          ^
Biostar52895.java:13: <identifier> expected
        Map<String,Node> children=new TreeMap<String, Biostar52895.Node="">();
                                                                           ^
Biostar52895.java:13: ';' expected
        Map<String,Node> children=new TreeMap<String, Biostar52895.Node="">();
                                                                            ^
Biostar52895.java:70: '(' or '[' expected
        app.parse(new BufferedReader(new InputStreamReaderSystem.in)));
                                                                   ^
Biostar52895.java:70: ';' expected
        app.parse(new BufferedReader(new InputStreamReaderSystem.in)));
                                                                     ^
7 errors
ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by bioinfo680

ah, I see, it's because  the code has been changed by the new version of biostars . It thinks it's HTML.

Give me a few minutes....

ADD REPLYlink written 3.6 years ago by Pierre Lindenbaum112k
it's now uploaded on github: ` https://gist.github.com/lindenb/58c90afee9ba73dd73f5 `

 

 

ADD REPLYlink modified 3.6 years ago • written 3.6 years ago by Pierre Lindenbaum112k

Thanks Pierre. Its working now..!! Excellent.

ADD REPLYlink written 3.6 years ago by bioinfo680
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1930 users visited in the last hour