Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Java library to manipulate VCF files

    I'm starting to work with VCF files and other types of files with genes annotation.
    I want to know if there is any Java libraries that I can use to manipulate vcf files.

    Thank you!

  • #2
    https://github.com/samtools/htsjdk



    example:

    Code:
    import htsjdk.variant.vcf.*;
    import htsjdk.variant.variantcontext.*;
    import htsjdk.tribble.readers.*;
    public class MinVcf
    	{
    	public static void main(String args[]) throws Exception
    		{
    		VCFCodec codec= new VCFCodec();
    		LineReader r= LineReaderUtil.fromBufferedStream(System.in);
    		LineIteratorImpl t= new LineIteratorImpl(r);
    		codec.readActualHeader(t);
    		while(t.hasNext())
    			{
    			VariantContext ctx = codec.decode(t.next());
    			}
    		r.close();
    		}
    	}

    Comment


    • #3
      I saw that library but I have to use Ant to build the jarfile. I installed Ant and when I run the code to buil the jar I get an error:

      Code:
      BUILD FAILED
      /home/usr/Documents/htsjdk-master/build.xml:96: The following error occurred while executing this line:
      /home/usr/Documents/htsjdk-master/build.xml:241: Compile failed; see the compiler error output for details.
      I tried but I always have this error.

      Comment


      • #4
        as it is said: "see the compiler error output for details.".
        So, what's the compiler output ?

        Comment


        • #5
          I think is this:

          [javac] /home/usr/Documents/htsjdk-master/build.xml:241: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
          [javac] Compiling 410 source files to /home/usr/Documents/htsjdk-master/classes
          [javac] javac: invalid target release: 1.8
          [javac] Usage: javac <options> <source files>
          [javac] use -help for a list of possible options

          Comment


          • #6
            you need to install java 1.8 :

            https://github.com/samtools/htsjdk " Java 8 is now required."

            and set JAVA_HOME if needed.

            Comment


            • #7
              It worked! But I was reading this page building htsjdk and it was talking about 1.6. I was confused because of that.

              Thank you!

              Comment

              Latest Articles

              Collapse

              • seqadmin
                Strategies for Sequencing Challenging Samples
                by seqadmin


                Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                03-22-2024, 06:39 AM
              • seqadmin
                Techniques and Challenges in Conservation Genomics
                by seqadmin



                The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                Avian Conservation
                Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                03-08-2024, 10:41 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, Yesterday, 06:37 PM
              0 responses
              7 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, Yesterday, 06:07 PM
              0 responses
              7 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 03-22-2024, 10:03 AM
              0 responses
              49 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 03-21-2024, 07:32 AM
              0 responses
              66 views
              0 likes
              Last Post seqadmin  
              Working...
              X