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
                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...
                Yesterday, 07:48 AM
              • 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...
                04-22-2024, 07:01 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, Yesterday, 07:17 AM
              0 responses
              11 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 05-02-2024, 08:06 AM
              0 responses
              19 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-30-2024, 12:17 PM
              0 responses
              20 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-29-2024, 10:49 AM
              0 responses
              29 views
              0 likes
              Last Post seqadmin  
              Working...
              X