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

optimisations

parent eac670d1
Branches
Tags
No related merge requests found
......@@ -73,8 +73,8 @@ public class VCFRecord
*/
protected static VCFRecord parse(String line)
{
VCFRecord rec = new VCFRecord();
String parts[] = line.split("\\t");
final VCFRecord rec = new VCFRecord();
final String parts[] = TAB_PATTERN.split(line);
rec.chrom = parts[0];
rec.pos = Integer.parseInt(parts[1]);
......@@ -97,15 +97,12 @@ public class VCFRecord
if(parts.length > 9)
{
rec.format = parts[8].trim();
int nsamples = parts.length-9;
int nfmt = rec.format.split(":").length;
final int nsamples = parts.length-9;
final int nfmt = rec.format.split(":").length;
rec.genotypeData = new String[nsamples][nfmt];
for(int i=0; i<nsamples; i++)
{
final String data[] = COLON_PATTERN.split(parts[9+i]);
rec.genotypeData[i] = data;
}
rec.genotypeData[i] = COLON_PATTERN.split(parts[9+i]);
}
return rec;
}
......
......@@ -1511,9 +1511,14 @@ public class VCFview extends JPanel
private int getYPostion(int vcfFileIndex)
{
int pos = 0;
if(hideVcfList.size() == 0)
pos = vcfFileIndex;
else
{
for(int i=0; i<vcfFileIndex; i++)
if(!hideVcfList.contains(i))
pos++;
}
return getHeight() - 15 - (pos*(LINE_HEIGHT+5));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment