SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
manipulate sequences in Fastq files lisann_5 Bioinformatics 4 10-25-2012 04:24 AM
Using Java to process BCF (binary VCF) lyz1030 Bioinformatics 0 04-20-2012 11:46 AM
Java libaray/API for VCF file golharam Bioinformatics 3 04-18-2012 02:45 PM
View and manipulate bigWig files francy Bioinformatics 7 01-24-2012 03:22 AM
vcflib, a C++ library for reading and writing VCF files ekg Bioinformatics 0 09-29-2010 01:12 PM

Reply
 
Thread Tools
Old 01-05-2016, 07:43 AM   #1
binfoUser
Member
 
Location: Portugal

Join Date: Jan 2016
Posts: 22
Default 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!
binfoUser is offline   Reply With Quote
Old 01-05-2016, 08:21 AM   #2
lindenb
Senior Member
 
Location: France

Join Date: Apr 2010
Posts: 143
Default https://github.com/samtools/htsjdk

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();
		}
	}
lindenb is offline   Reply With Quote
Old 01-05-2016, 08:40 AM   #3
binfoUser
Member
 
Location: Portugal

Join Date: Jan 2016
Posts: 22
Default

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.
binfoUser is offline   Reply With Quote
Old 01-05-2016, 08:42 AM   #4
lindenb
Senior Member
 
Location: France

Join Date: Apr 2010
Posts: 143
Default

as it is said: "see the compiler error output for details.".
So, what's the compiler output ?
lindenb is offline   Reply With Quote
Old 01-05-2016, 08:50 AM   #5
binfoUser
Member
 
Location: Portugal

Join Date: Jan 2016
Posts: 22
Default

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
binfoUser is offline   Reply With Quote
Old 01-05-2016, 08:55 AM   #6
lindenb
Senior Member
 
Location: France

Join Date: Apr 2010
Posts: 143
Default

you need to install java 1.8 :

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

and set JAVA_HOME if needed.
lindenb is offline   Reply With Quote
Old 01-05-2016, 12:32 PM   #7
binfoUser
Member
 
Location: Portugal

Join Date: Jan 2016
Posts: 22
Default

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!
binfoUser is offline   Reply With Quote
Reply

Tags
annotation, java, library, vcf

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 08:26 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO