Skip to content
Permalink
Browse files

Fixed issue #10

Proposed fix is not as flexible as the one implemented here.
Problem was caused by non *nix like line breaks like '\r'.
Now using regex (\r|\n)+ to split String into lines.
  • Loading branch information...
asishallab committed Sep 2, 2016
1 parent 6f4494e commit 68c35046a3d5e3498df4fbbb04987a556c957e71
Showing with 4 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +1 −0 src/ahrd/controller/Settings.java
  3. +2 −1 src/ahrd/model/Protein.java
@@ -36,3 +36,4 @@ ahrd_output.csv
trainer_batch_ymls
.externalToolBuilders/
.project
/classes/
@@ -98,6 +98,7 @@ public static void setSettings(Settings s) {
.compile("^UniProtKB\\s+(?<shortAccession>\\S+)\\s+\\S+\\s+(?<goTerm>GO:\\d{7})");
public static final String PREFER_REFERENCE_WITH_GO_ANNOS_KEY = "prefer_reference_with_go_annos";
public static final String EVALUATE_VALID_TAKENS_KEY = "evaluate_valid_tokens";
public static final String DEFAULT_LINE_SEP = "(\r|\n)+";

/**
* Fields:
@@ -1,5 +1,6 @@
package ahrd.model;

import static ahrd.controller.Settings.DEFAULT_LINE_SEP;
import static ahrd.controller.Settings.getSettings;

import java.util.ArrayList;
@@ -68,7 +69,7 @@ public Protein(String accession, String aaSequence) {

public static Protein constructFromFastaEntry(String fastaEntry)
throws MissingAccessionException {
String[] fasta_data = fastaEntry.split("\n");
String[] fasta_data = fastaEntry.split(DEFAULT_LINE_SEP);
String accession = fasta_data[0].split(" ")[0];
if (accession == null || accession.equals("")) {
throw new MissingAccessionException(

0 comments on commit 68c3504

Please sign in to comment.
You can’t perform that action at this time.