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

optimisations

parent eac670d1
No related branches found
No related tags found
No related merge requests found
...@@ -73,8 +73,8 @@ public class VCFRecord ...@@ -73,8 +73,8 @@ public class VCFRecord
*/ */
protected static VCFRecord parse(String line) protected static VCFRecord parse(String line)
{ {
VCFRecord rec = new VCFRecord(); final VCFRecord rec = new VCFRecord();
String parts[] = line.split("\\t"); final String parts[] = TAB_PATTERN.split(line);
rec.chrom = parts[0]; rec.chrom = parts[0];
rec.pos = Integer.parseInt(parts[1]); rec.pos = Integer.parseInt(parts[1]);
...@@ -97,15 +97,12 @@ public class VCFRecord ...@@ -97,15 +97,12 @@ public class VCFRecord
if(parts.length > 9) if(parts.length > 9)
{ {
rec.format = parts[8].trim(); rec.format = parts[8].trim();
int nsamples = parts.length-9; final int nsamples = parts.length-9;
int nfmt = rec.format.split(":").length; final int nfmt = rec.format.split(":").length;
rec.genotypeData = new String[nsamples][nfmt]; rec.genotypeData = new String[nsamples][nfmt];
for(int i=0; i<nsamples; i++) for(int i=0; i<nsamples; i++)
{ rec.genotypeData[i] = COLON_PATTERN.split(parts[9+i]);
final String data[] = COLON_PATTERN.split(parts[9+i]);
rec.genotypeData[i] = data;
}
} }
return rec; return rec;
} }
......
...@@ -1511,9 +1511,14 @@ public class VCFview extends JPanel ...@@ -1511,9 +1511,14 @@ public class VCFview extends JPanel
private int getYPostion(int vcfFileIndex) private int getYPostion(int vcfFileIndex)
{ {
int pos = 0; int pos = 0;
if(hideVcfList.size() == 0)
pos = vcfFileIndex;
else
{
for(int i=0; i<vcfFileIndex; i++) for(int i=0; i<vcfFileIndex; i++)
if(!hideVcfList.contains(i)) if(!hideVcfList.contains(i))
pos++; pos++;
}
return getHeight() - 15 - (pos*(LINE_HEIGHT+5)); 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