private static final String NOTE = "Note";
- protected static final String TAB = "\t";
-
protected static final String GFF_VERSION = "##gff-version";
private AlignmentI lastmatchedAl = null;
Map<String, FeatureColourI> colours, boolean removeHTML,
boolean relaxedIdmatching)
{
- Map<String, String> gffProps = new HashMap<String, String>();
+ Map<String, String> gffProps = new HashMap<>();
/*
* keep track of any sequences we try to create from the data
*/
- List<SequenceI> newseqs = new ArrayList<SequenceI>();
+ List<SequenceI> newseqs = new ArrayList<>();
String line = null;
try
* sort groups alphabetically, and ensure that features with a
* null or empty group are output after those in named groups
*/
- List<String> sortedGroups = new ArrayList<String>(visibleFeatureGroups);
+ List<String> sortedGroups = new ArrayList<>(visibleFeatureGroups);
sortedGroups.remove(null);
sortedGroups.remove("");
Collections.sort(sortedGroups);
for (int i = 0; i < sequences.length; i++)
{
String sequenceName = sequences[i].getName();
- List<SequenceFeature> features = new ArrayList<SequenceFeature>();
+ List<SequenceFeature> features = new ArrayList<>();
if (types.length > 0)
{
features.addAll(sequences[i].getFeatures().getFeaturesForGroup(
dataset = new Alignment(new SequenceI[] {});
}
- Map<String, FeatureColourI> featureColours = new HashMap<String, FeatureColourI>();
+ Map<String, FeatureColourI> featureColours = new HashMap<>();
boolean parseResult = parse(dataset, featureColours, false, true);
if (!parseResult)
{
for (SequenceI seq : sequences)
{
- List<SequenceFeature> features = new ArrayList<SequenceFeature>();
+ List<SequenceFeature> features = new ArrayList<>();
if (includeNonPositionalFeatures)
{
features.addAll(seq.getFeatures().getNonPositionalFeatures());
+ "FER_CAPAN/1-55 SYKVKLI 55\n"
+ "FER1_SOLLC/1-55 SYKVKLI 55\n"
+ "Q93XJ9_SOLTU/1-55 SYKVKLI 55\n"
- + "FER1_PEA/1-60 SYKVKLV 60\n";
+ + "FER1_PEA/1-60 SYKVKLV 60\n"
+ + " .* .:....*******..** ..........** ********...*:::* ...\n"
+ + "\t\t.:.::. *\n";
+ //@formatter:on
+ ClustalFile cf = new ClustalFile(data, DataSourceType.PASTE);
+ cf.parse();
+ SequenceI[] seqs = cf.getSeqsAsArray();
+ assertEquals(seqs.length, 5);
+ assertEquals(seqs[0].getName(), "FER_CAPAA");
+ assertEquals(seqs[0].getStart(), 1);
+ assertEquals(seqs[0].getEnd(), 8);
+ assertTrue(seqs[0].getSequenceAsString().endsWith("ASYKVKLI"));
+ }
+
+ @Test(groups="Functional")
+ public void testParse_noNumbering() throws IOException
+ {
+ //@formatter:off
+ String data = "CLUSTAL\n\n"
+ + "FER_CAPAA/1-8 -----------------------------------------------------------A\n"
+ + "FER_CAPAN/1-55 MA------SVSATMISTSFMPRKPAVTSL-KPIPNVGE--ALFGLKS-A--NGGKVTCMA\n"
+ + "FER1_SOLLC/1-55 MA------SISGTMISTSFLPRKPAVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA\n"
+ + "Q93XJ9_SOLTU/1-55 MA------SISGTMISTSFLPRKPVVTSL-KAISNVGE--ALFGLKS-G--RNGRITCMA\n"
+ + "FER1_PEA/1-60 MATT---PALYGTAVSTSFLRTQPMPMSV-TTTKAFSN--GFLGLKT-SLKRGDLAVAMA\n\n"
+ + "FER_CAPAA/1-8 SYKVKLI\n"
+ + "FER_CAPAN/1-55 SYKVKLI\n"
+ + "FER1_SOLLC/1-55 SYKVKLI\n"
+ + "Q93XJ9_SOLTU/1-55 SYKVKLI\n"
+ + "FER1_PEA/1-60 SYKVKLV\n";
//@formatter:on
ClustalFile cf = new ClustalFile(data, DataSourceType.PASTE);
cf.parse();