*
* @throws IOException
*/
+ @Override
public void parse() throws IOException
{
String line = nextLine();
return nextLine();
}
+ /*
+ * parse location - which may be over more than one line e.g. EAW51554
+ */
CdsData data = new CdsData();
- data.cdsLocation = tokens[2];
- // TODO location can be over >1 line e.g. EAW51554
+ StringBuilder sb = new StringBuilder().append(tokens[2]);
+ line = parseFeatureQualifier(sb, "CDS");
+ data.cdsLocation = sb.toString();
- line = nextLine();
while (line != null)
{
if (!line.startsWith("FT ")) // 4 spaces
String qualifier = line.substring(slashPos + 1, eqPos);
String value = line.substring(eqPos + 1);
value = removeQuotes(value);
- StringBuilder sb = new StringBuilder().append(value);
+ sb = new StringBuilder().append(value);
line = parseFeatureQualifier(sb, qualifier);
String featureValue = sb.toString();
*/
static String removeQuotes(String value)
{
- if (value == null)
+ if (value == null)
{
return null;
}
* heuristic rule: most multi-line value (e.g. /product) are text,
* so add a space for word boundary at a new line; not for translation
*/
- if (!"translation".equals(qualifierName))
+ if (!"translation".equals(qualifierName)
+ && !"CDS".equals(qualifierName))
{
sb.append(" ");
}
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNull;
import static org.testng.AssertJUnit.assertSame;
import static org.testng.AssertJUnit.fail;
-import static org.testng.AssertJUnit.assertNull;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Set;
+import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import jalview.bin.Cache;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.Mapping;
import jalview.datamodel.SequenceFeature;
public class EmblFlatFileTest
{
+ @BeforeClass(alwaysRun = true)
+ public void setUp()
+ {
+ Cache.initLogger();
+ }
+
/**
* A fairly tough test, using J03321 (circular DNA), which has 8 CDS features,
* one of them reverse strand
CC Draft entry and computer-readable sequence kindly submitted by
CC G.Ratti, 28-MAR-1990.
XX
+XX ! first CDS location below split across two lines for test purposes !
FH Key Location/Qualifiers
FH
FT source 1..7502
FT /mol_type="genomic DNA"
FT /isolation_source="trachoma"
FT /db_xref="taxon:813"
-FT CDS join(7022..7502,1..437)
+FT CDS join(7022..7502,
+FT 1..437)
FT /codon_start=1
FT /transl_table=11
FT /product="hypothetical protein"