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
                Current Approaches to Protein Sequencing
                by seqadmin


                Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                04-04-2024, 04:25 PM
              • 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

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 04-11-2024, 12:08 PM
              0 responses
              18 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              22 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 09:21 AM
              0 responses
              16 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-04-2024, 09:00 AM
              0 responses
              47 views
              0 likes
              Last Post seqadmin  
              Working...
              X