Skip to content
Snippets Groups Projects
Commit 99954024 authored by tjc's avatar tjc
Browse files

optimise passFilter()

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@15580 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent fdcd4842
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ import java.awt.GridBagConstraints; ...@@ -5,6 +5,7 @@ import java.awt.GridBagConstraints;
import java.awt.GridBagLayout; import java.awt.GridBagLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.regex.Pattern;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
...@@ -25,6 +26,8 @@ public class VCFFilter extends JFrame ...@@ -25,6 +26,8 @@ public class VCFFilter extends JFrame
private static float MIN_AF1 = 0; private static float MIN_AF1 = 0;
private static float MAX_CI95 = 10; private static float MAX_CI95 = 10;
private static Pattern COMMA_PATTERN = Pattern.compile(",");
/** /**
* Filter VCF records by the variant type and/or by different values in * Filter VCF records by the variant type and/or by different values in
* the record, QUAL, DP, MQ and AF1. * the record, QUAL, DP, MQ and AF1.
...@@ -260,7 +263,7 @@ public class VCFFilter extends JFrame ...@@ -260,7 +263,7 @@ public class VCFFilter extends JFrame
try try
{ {
String vals[] = record.getInfoValue("CI95").split(","); String vals[] = COMMA_PATTERN.split(record.getInfoValue("CI95"));
for(int i=0; i<vals.length; i++) for(int i=0; i<vals.length; i++)
{ {
if(VCFFilter.MAX_CI95 < 10 && Float.parseFloat(vals[i]) > VCFFilter.MAX_CI95) if(VCFFilter.MAX_CI95 < 10 && Float.parseFloat(vals[i]) > VCFFilter.MAX_CI95)
......
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