Answers.Body: <p>It's a programming error that should look like this:</p>
  
  <pre><code>StringBuffer sb = (...)
  (...)
  String s = (String)sb;
  </code></pre>
  
  <p>while it should be</p>
  
  <pre><code>StringBuffer sb = (...)
  (...)
  String s = sb.toString();
  </code></pre>
  
  <p>( see also <a href="https://www.biostars.org/p/177992/" rel="nofollow noreferrer">https://www.biostars.org/p/177992/</a> ) . You cannot do anything about it but asking the authors of the software.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-11T11:15:28.097Z
Answers.Text: Sent an email to Cathy Riemer asking for help.
Answers.UserDisplayName: Biomagician
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-11T09:50:52.997Z
Answers.LastActivityDate: 2018-07-11T09:50:52.997Z
Answers.UserDisplayName: Pierre
Body: <p>I have installed <a href="http://globin.bx.psu.edu/dist/gmaj/gmaj_install.html" rel="nofollow noreferrer">GMAJ</a> using:</p>
  
  <pre><code>wget http://globin.bx.psu.edu/dist/gmaj/gmaj.zip  -O output/software/gmaj.zip
  unzip -u output/software/gmaj.zip -d output/software/gmaj/
  rm output/software/gmaj.zip
  </code></pre>
  
  <p>I ran <a href="http://www.bx.psu.edu/miller_lab/dist/README.lastz-1.02.00/README.lastz-1.02.00a.html" rel="nofollow noreferrer">lastz</a> on two chromosomes from two different assemblies of <em>C. elegans</em>:</p>
  
  <p><code>lastz c_elegans.PRJNA13758.WS263.genomicI.fa I.fa --format=maf &gt; MAF.maf</code></p>
  
  <p>and got a MAF file.</p>
  
  <p>Then, I tried to visualise the file using:</p>
  
  <p><code>java -jar output/software/gmaj/gmaj.jar MAF.maf</code></p>
  
  <p>but I got the following error:</p>
  
  <pre><code>Exception in thread "main" java.lang.ClassCastException: java.lang.StringBuffer cannot be cast to java.lang.String
      at edu.psu.bx.gmaj.MajGui.setDefaults(MajGui.java:272)
      at edu.psu.bx.gmaj.Maj.&lt;init&gt;(Maj.java:53)
      at edu.psu.bx.gmaj.MajMain.main(MajMain.java:86)
  </code></pre>
  
  <p>Can someone help me resolve this error or suggest an alternative way to visualise my alignment?</p>
  
  <p>I work on Mac OS X.</p>
  
  <p>Cheers.</p>
  
Tags: <phylogenetics><visualization><software-installation><maf>
Title: GMAJ error: Exception in thread "main" java.lang.ClassCastException: java.lang.StringBuffer cannot be cast to java.lang.String
ThreadText: # GMAJ error: Exception in thread "main" java.lang.ClassCastException: java.lang.StringBuffer cannot be cast to java.lang.String
  
  (Asked by: username_0 on 2018-07-10)
  
  I have installed [GMAJ](http://globin.bx.psu.edu/dist/gmaj/gmaj_install.html) using:
  
  ```
  wget http://globin.bx.psu.edu/dist/gmaj/gmaj.zip  -O output/software/gmaj.zip
  unzip -u output/software/gmaj.zip -d output/software/gmaj/
  rm output/software/gmaj.zip
  
  ```
  
  I ran [lastz](http://www.bx.psu.edu/miller_lab/dist/README.lastz-1.02.00/README.lastz-1.02.00a.html) on two chromosomes from two different assemblies of *C. elegans*:
  
  `lastz c_elegans.PRJNA13758.WS263.genomicI.fa I.fa --format=maf > MAF.maf`
  
  and got a MAF file.
  
  Then, I tried to visualise the file using:
  
  `java -jar output/software/gmaj/gmaj.jar MAF.maf`
  
  but I got the following error:
  
  ```
  Exception in thread "main" java.lang.ClassCastException: java.lang.StringBuffer cannot be cast to java.lang.String
      at edu.psu.bx.gmaj.MajGui.setDefaults(MajGui.java:272)
      at edu.psu.bx.gmaj.Maj.<init>(Maj.java:53)
      at edu.psu.bx.gmaj.MajMain.main(MajMain.java:86)
  
  ```
  
  Can someone help me resolve this error or suggest an alternative way to visualise my alignment?
  
  I work on Mac OS X.
  
  Cheers.
  
  **Tags:** phylogenetics, visualization, software-installation, maf
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-11. Score: 1
  
  It's a programming error that should look like this:
  
  ```
  StringBuffer sb = (...)
  (...)
  String s = (String)sb;
  
  ```
  
  while it should be
  
  ```
  StringBuffer sb = (...)
  (...)
  String s = sb.toString();
  
  ```
  
  ( see also <https://www.biostars.org/p/177992/> ) . You cannot do anything about it but asking the authors of the software.
  
  > **Comments:**
  > **username_0**: Sent an email to Cathy Riemer asking for help.  
  
  ---
  
  