Skip to content
Snippets Groups Projects
Commit 91a375b2 authored by tcarver's avatar tcarver
Browse files

add getter for sample names

parent e82a9fa8
Branches
Tags
No related merge requests found
......@@ -42,6 +42,8 @@ import uk.ac.sanger.artemis.components.variant.BCFReader.BCFReaderIterator;
public abstract class AbstractVCFReader
{
private boolean vcf_v4 = false;
protected String[] sampleNames;
protected abstract String[] getSeqNames();
protected abstract String getFileName();
protected int nsamples = -1;
......@@ -264,6 +266,7 @@ public abstract class AbstractVCFReader
{
if(nsamples < 1)
{
nsamples = 1;
BufferedReader reader = new BufferedReader(new StringReader(header));
try
{
......@@ -274,7 +277,10 @@ public abstract class AbstractVCFReader
{
int index = ln.indexOf("FORMAT");
if(index > -1)
nsamples = ln.substring(index+7).split(" ").length;
{
sampleNames = ln.substring(index+7).split(" ");
nsamples = sampleNames.length;
}
}
}
}
......@@ -286,6 +292,11 @@ public abstract class AbstractVCFReader
return nsamples;
}
protected String[] getSampleNames()
{
return sampleNames;
}
protected List<HeaderLine> getFORMAT()
{
return getListOfLines("FORMAT");
......
......@@ -46,7 +46,6 @@ class BCFReader extends AbstractVCFReader
// header information and names
private String[] seqNames;
private String[] sampleNames;
private String metaData;
private String fileName;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment