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
                Essential Discoveries and Tools in Epitranscriptomics
                by seqadmin


                The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist on Modified Bases...
                Yesterday, 07:01 AM
              • 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

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 04-11-2024, 12:08 PM
              0 responses
              49 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              50 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 09:21 AM
              0 responses
              43 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-04-2024, 09:00 AM
              0 responses
              55 views
              0 likes
              Last Post seqadmin  
              Working...
              X