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

changes to VCFRecord.parse()

parent 8c782d39
No related branches found
No related tags found
No related merge requests found
...@@ -94,7 +94,7 @@ public abstract class AbstractVCFReader ...@@ -94,7 +94,7 @@ public abstract class AbstractVCFReader
tabixIterator = null; tabixIterator = null;
return null; return null;
} }
record = VCFRecord.parse(s); record = VCFRecord.parse(s, getNumberOfSamples());
if(record == null) if(record == null)
tabixIterator = null; tabixIterator = null;
...@@ -173,6 +173,7 @@ public abstract class AbstractVCFReader ...@@ -173,6 +173,7 @@ public abstract class AbstractVCFReader
final TabixReader tr = new TabixReader(vcfFileName); final TabixReader tr = new TabixReader(vcfFileName);
String line; String line;
boolean headerEnd = true; boolean headerEnd = true;
final StringBuffer buffHeader = new StringBuffer();
while ((line = tr.readLine()) != null) while ((line = tr.readLine()) != null)
{ {
...@@ -180,6 +181,7 @@ public abstract class AbstractVCFReader ...@@ -180,6 +181,7 @@ public abstract class AbstractVCFReader
{ {
if(!line.startsWith("##FILTER")) if(!line.startsWith("##FILTER"))
writer.write(line+'\n'); writer.write(line+'\n');
buffHeader.append(line+'\n');
continue; continue;
} }
else if(headerEnd) else if(headerEnd)
...@@ -191,10 +193,12 @@ public abstract class AbstractVCFReader ...@@ -191,10 +193,12 @@ public abstract class AbstractVCFReader
if(line.startsWith("#")) if(line.startsWith("#"))
{ {
writer.write(line+'\n'); writer.write(line+'\n');
buffHeader.append(line+'\n');
tr.setHeader(buffHeader.toString());
continue; continue;
} }
VCFRecord record = VCFRecord.parse(line); VCFRecord record = VCFRecord.parse(line, tr.getNumberOfSamples());
int basePosition = record.getPos() + vcfView.getSequenceOffset(record.getChrom()); int basePosition = record.getPos() + vcfView.getSequenceOffset(record.getChrom());
VCFFilter.setFilterString(record, vcfView, basePosition, features, tr); VCFFilter.setFilterString(record, vcfView, basePosition, features, tr);
writer.write(record.toString()+'\n'); writer.write(record.toString()+'\n');
......
...@@ -213,7 +213,7 @@ public class GraphPanel extends JPanel ...@@ -213,7 +213,7 @@ public class GraphPanel extends JPanel
String s; String s;
while ((s = iter.next()) != null) while ((s = iter.next()) != null)
{ {
VCFRecord record = VCFRecord.parse(s); VCFRecord record = VCFRecord.parse(s, reader.getNumberOfSamples());
max = calc(record, features, reader, windowSize, nBins, snpCount, max); max = calc(record, features, reader, windowSize, nBins, snpCount, max);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment