git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
fc9edfc
)
JAL-2808 remove duplicated code, tidy case-insensitive regexes
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Tue, 5 Jun 2018 10:25:01 +0000
(11:25 +0100)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Tue, 5 Jun 2018 10:25:01 +0000
(11:25 +0100)
src/jalview/io/vcf/VCFLoader.java
patch
|
blob
|
history
diff --git
a/src/jalview/io/vcf/VCFLoader.java
b/src/jalview/io/vcf/VCFLoader.java
index
de2f18a
..
9438ba9
100644
(file)
--- a/
src/jalview/io/vcf/VCFLoader.java
+++ b/
src/jalview/io/vcf/VCFLoader.java
@@
-421,8
+421,7
@@
public class VCFLoader
/**
* Answers true if the field id is matched by any of the filter patterns, else
/**
* Answers true if the field id is matched by any of the filter patterns, else
- * false. Matching is against regular expression patterns, and is not
- * case-sensitive.
+ * false. Matching is against non-case-sensitive regular expression patterns.
*
* @param id
* @param filters
*
* @param id
* @param filters
@@
-432,7
+431,7
@@
public class VCFLoader
{
for (Pattern p : filters)
{
{
for (Pattern p : filters)
{
- if (p.matcher(id.toUpperCase()).matches())
+ if (p.matcher(id).matches())
{
return true;
}
{
return true;
}
@@
-506,8
+505,7
@@
public class VCFLoader
* Reads the Preference value for the given key, with default specified if no
* preference set. The value is interpreted as a comma-separated list of
* regular expressions, and converted into a list of compiled patterns ready
* Reads the Preference value for the given key, with default specified if no
* preference set. The value is interpreted as a comma-separated list of
* regular expressions, and converted into a list of compiled patterns ready
- * for matching. Patterns are forced to upper-case for non-case-sensitive
- * matching.
+ * for matching. Patterns are set to non-case-sensitive matching.
* <p>
* This supports user-defined filters for fields of interest to capture while
* processing data. For example, VCF_FIELDS = AF,AC* would mean that VCF INFO
* <p>
* This supports user-defined filters for fields of interest to capture while
* processing data. For example, VCF_FIELDS = AF,AC* would mean that VCF INFO
@@
-526,7
+524,7
@@
public class VCFLoader
{
try
{
{
try
{
- patterns.add(Pattern.compile(token.toUpperCase()));
+ patterns.add(Pattern.compile(token, Pattern.CASE_INSENSITIVE));
} catch (PatternSyntaxException e)
{
System.err.println("Invalid pattern ignored: " + token);
} catch (PatternSyntaxException e)
{
System.err.println("Invalid pattern ignored: " + token);
@@
-1190,14
+1188,6
@@
public class VCFLoader
}
/*
}
/*
- * filter out fields we don't want to capture
- */
- if (!vcfFieldsOfInterest.contains(key))
- {
- continue;
- }
-
- /*
* we extract values for other data which are allele-specific;
* these may be per alternate allele (INFO[key].Number = 'A')
* or per allele including reference (INFO[key].Number = 'R')
* we extract values for other data which are allele-specific;
* these may be per alternate allele (INFO[key].Number = 'A')
* or per allele including reference (INFO[key].Number = 'R')