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
                Latest Developments in Precision Medicine
                by seqadmin



                Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

                Somatic Genomics
                “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
                05-24-2024, 01:16 PM
              • seqadmin
                Recent Advances in Sequencing Analysis Tools
                by seqadmin


                The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
                05-06-2024, 07:48 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 05-30-2024, 03:16 PM
              0 responses
              18 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 05-29-2024, 01:32 PM
              0 responses
              20 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 05-24-2024, 07:15 AM
              0 responses
              210 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 05-23-2024, 10:28 AM
              0 responses
              226 views
              0 likes
              Last Post seqadmin  
              Working...
              X