private static final String DOUBLED_QUOTE = QUOTE + QUOTE;
/**
- * when true, interpret the mol_type 'source' feature attribute
- * and generate an RNA sequence from the DNA record
+ * when true, interpret the mol_type 'source' feature attribute and generate
+ * an RNA sequence from the DNA record
*/
- private boolean produceRna=true;
+ private boolean produceRna = true;
+
/**
* A data bean class to hold values parsed from one CDS Feature (FT)
*/
private List<DBRefEntry> dbrefs; // from DR
- private boolean sequenceStringIsRNA=false;
+ private boolean sequenceStringIsRNA = false;
+
private String sequenceString; // from SQ lines
/*
String parseFT(String line) throws IOException
{
String[] tokens = line.split(WHITESPACE);
- if (tokens.length < 3 || (!"CDS".equals(tokens[1]) && !"source".equals(tokens[1])))
+ if (tokens.length < 3
+ || (!"CDS".equals(tokens[1]) && !"source".equals(tokens[1])))
{
return nextLine();
}
-
+
if (tokens[1].equals("source"))
{
return parseSourceQualifiers(tokens);
}
/**
- * process attributes for 'source' until the next FT feature entry
- * only interested in 'mol_type'
+ * process attributes for 'source' until the next FT feature entry only
+ * interested in 'mol_type'
+ *
* @param tokens
* @return
* @throws IOException
int p = line.indexOf("\\mol_type");
int qs = line.indexOf("\"", p);
int qe = line.indexOf("\"", qs + 1);
- String qualifier=line.substring(qs,qe).toLowerCase();
+ String qualifier = line.substring(qs, qe).toLowerCase();
if (qualifier.indexOf("rna") > -1)
{
sequenceStringIsRNA = true;
{
sequenceStringIsRNA = false;
}
- line=parseFeatureQualifier(sb, "source");
+ line = parseFeatureQualifier(sb, "source");
}
return line;
}
*/
static String removeQuotes(String value)
{
- if (value == null)
+ if (value == null)
{
return null;
}
{
name = this.sourceDb + "|" + name;
}
-
+
if (produceRna && sequenceStringIsRNA)
{
sequenceString = sequenceString.replace('T', 'U').replace('t', 'u');
}
-
+
SequenceI seq = new Sequence(name, this.sequenceString);
seq.setDescription(this.description);
try
{
List<int[]> ranges = DnaUtils.parseLocation(location);
- return MappingUtils.listToArray(ranges);
+ return MappingUtils.rangeListToArray(ranges);
} catch (ParseException e)
{
Cache.log.warn(