rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
if ((dfaNode = (DfaNode) closureSets.get(nfaNodes)) == null) { return (DfaNode) closureSets.put(nfaNodes, new DfaNode(nfaNodes));
if (dfaNode == null) { dfaNode = new DfaNode(nfaNodes); closureSets.put(nfaNodes, dfaNode);
private DfaNode getDfaNode(FiniteAutomaton.NodeSet nfaNodes) { DfaNode dfaNode; if ((dfaNode = (DfaNode) closureSets.get(nfaNodes)) == null) { return (DfaNode) closureSets.put(nfaNodes, new DfaNode(nfaNodes)); } else return dfaNode; }
else return dfaNode;
return dfaNode;
private DfaNode getDfaNode(FiniteAutomaton.NodeSet nfaNodes) { DfaNode dfaNode; if ((dfaNode = (DfaNode) closureSets.get(nfaNodes)) == null) { return (DfaNode) closureSets.put(nfaNodes, new DfaNode(nfaNodes)); } else return dfaNode; }
super.startTag(tag);
if(parser == null && listener != null) { listener.startTag(tag); } else { super.startTag(tag); }
public void startTag(Object tag) throws ParserException { parser = (TagValueParser) parsers.get(tag); listener = (TagValueListener) listeners.get(tag); super.startTag(tag); }
handler.invalidStrand(strand);
protected GFFRecord createRecord(GFFDocumentHandler handler, ArrayList aList, String rest, String comment) throws BioException { SimpleGFFRecord record = new SimpleGFFRecord(); record.setSeqName((String) aList.get(0)); record.setSource((String) aList.get(1)); record.setFeature((String) aList.get(2));...
try { record.setFrame(Integer.parseInt( (String) aList.get(7))); } catch (NumberFormatException nfe) { handler.invalidFrame((String) aList.get(7), nfe);
String frame = (String) aList.get(7); if(frame.equals(".")) { record.setFrame(GFFRecord.NO_FRAME); } else { try { record.setFrame(Integer.parseInt(frame)); } catch (NumberFormatException nfe) { handler.invalidFrame((String) aList.get(7), nfe); }
protected GFFRecord createRecord(GFFDocumentHandler handler, ArrayList aList, String rest, String comment) throws BioException { SimpleGFFRecord record = new SimpleGFFRecord(); record.setSeqName((String) aList.get(0)); record.setSource((String) aList.get(1)); record.setFeature((String) aList.get(2));...
aList.clear();
public void parse(BufferedReader bReader, GFFDocumentHandler handler) throws IOException, BioException { handler.startDocument(); ArrayList aList = new ArrayList(); for(String line = bReader.readLine(); line != null; line = bReader.readLine()) { if(line.startsWith("#")) { handler.commentLine(lin...
DBHelper.DeleteStyle del = helper.getDeleteStyle();
public static void removeGeneticCodeID(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException { DBHelper.DeleteStyle del = helper.getDeleteStyle(); PreparedStatement ps = null; try { ps = conn.prepareStatement("UPDATE taxon SET genetic_code = NULL WHERE taxon_id = ?"); ps.setInt(1...
DBHelper.DeleteStyle del = helper.getDeleteStyle();
public static void removeLeftValue(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException { DBHelper.DeleteStyle del = helper.getDeleteStyle(); PreparedStatement ps = null; try { ps = conn.prepareStatement("UPDATE taxon SEQ left_value = NULL WHERE taxon_id = ?"); ps.setInt(1, getT...
DBHelper.DeleteStyle del = helper.getDeleteStyle();
public static void removeMitochondrialGeneticCodeID(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException { DBHelper.DeleteStyle del = helper.getDeleteStyle(); PreparedStatement ps = null; try { ps = conn.prepareStatement("UPDATE taxon SET mito_genetic_code = NULL WHERE taxon_id = ?")...
DBHelper.DeleteStyle del = helper.getDeleteStyle();
public static void removeRank(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException { DBHelper.DeleteStyle del = helper.getDeleteStyle(); PreparedStatement ps = null; try { ps = conn.prepareStatement("UPDATE taxon SET node_rank = NULL WHERE taxon_id = ?"); ps.setInt(1, getTaxonID...
DBHelper.DeleteStyle del = helper.getDeleteStyle();
public static void removeRightValue(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException { DBHelper.DeleteStyle del = helper.getDeleteStyle(); PreparedStatement ps = null; try { ps = conn.prepareStatement("UPDATE taxon SEQ right_value = NULL WHERE taxon_id = ?"); ps.setInt(1, ge...
tagOrder.add(EmblLikeFormat.REFERENCE_TAG);
tagOrder.add(ReferenceAnnotation.class); tagOrder.add(EmblLikeFormat.DR_TAG);
private GenEmblPropertyComparator() { tagOrder = new ArrayList(); tagOrder.add(EmblLikeFormat.ID_TAG); tagOrder.add(EmblLikeFormat.ACCESSION_TAG); tagOrder.add(EmblLikeFormat.VERSION_TAG); tagOrder.add(EmblLikeFormat.DATE_TAG); tagOrder.add(EmblLikeFormat.DEFINITION_TAG)...
if (isOpaque()) { g2.setPaint(getBackground()); g2.fillRect(0, 0, getWidth(), getHeight()); }
public void paintComponent(Graphics g) { if (! isActive()) return; super.paintComponent(g); // Set hints Graphics2D g2 = (Graphics2D) g; g2.addRenderingHints(hints); // Save current transform and clip AffineTransform prevTransform = g2.getTransform(); ...
firePropertyChange("direction", prevDirection, direction);
public void setDirection(int direction) throws IllegalArgumentException { if (direction != HORIZONTAL && direction != VERTICAL) throw new IllegalArgumentException("Direction must be either HORIZONTAL or VERTICAL"); int prevDirection = this.direction; this.direction = direction; ...
firePropertyChange("scale", prevScale, scale);
public void setScale(double scale) { double prevScale = this.scale; this.scale = scale; resizeAndValidate(); firePropertyChange("scale", prevScale, scale); }
firePropertyChange("sequence", prevSequence, sequence);
public void setSequence(Sequence sequence) { Sequence prevSequence = this.sequence; // Remove out listener from the sequence, if necessary if (prevSequence != null) prevSequence.removeChangeListener(layoutListener); this.sequence = sequence; // Add our listener to th...
firePropertyChange("translation", prevTranslation, translation);
public void setSymbolTranslation(int translation) throws IndexOutOfBoundsException { if (translation >= sequence.length()) throw new IndexOutOfBoundsException("Tried to set symbol translation offset equal to or greater than SymbolList length"); int prevTranslation = this.translati...
this.seq = seq;
public void setSequence(Sequence seq) { this.seq = seq; }
private void setObject(BioEntry object) { this.object = object; }
void setObject(BioEntry object) { this.object = object; }
private void setObject(BioEntry object) { this.object = object; }
private void setSubject(BioEntry subject) { this.subject = subject; }
void setSubject(BioEntry subject) { this.subject = subject; }
private void setSubject(BioEntry subject) { this.subject = subject; }
private void setTerm(ComparableTerm term) { this.term = term; }
void setTerm(ComparableTerm term) { this.term = term; }
private void setTerm(ComparableTerm term) { this.term = term; }
return remoteTerm.getName();
return getOntology().getName() + ":" + remoteTerm.getName();
public String getName() { return remoteTerm.getName(); }
Connection conn = pool.takeConnection();
conn = pool.takeConnection();
private void _addSequence(Sequence seq) throws IllegalIDException, ChangeVetoException, BioException { String seqName = idmaker.calcID(seq); int version = 1; Alphabet seqAlpha = seq.getAlphabet(); SymbolTokenization seqToke; try { seqToke = seqAlpha.getTokenization("token"); } catch (Exception ex) { ...
throw new BioException(ex, "Error inserting data into BioSQL tables: " + seq.getName());
boolean rolledback = false; if (conn != null) { try { conn.rollback(); rolledback = true; } catch (SQLException ex2) {} } throw new BioRuntimeException(ex, "Error adding BioSQL tables" + (rolledback ? " (rolled back successfully)" : ""));
private void _addSequence(Sequence seq) throws IllegalIDException, ChangeVetoException, BioException { String seqName = idmaker.calcID(seq); int version = 1; Alphabet seqAlpha = seq.getAlphabet(); SymbolTokenization seqToke; try { seqToke = seqAlpha.getTokenization("token"); } catch (Exception ex) { ...
String description = null; try { description = seq.getAnnotation().getProperty(PROPERTY_DESCRIPTIONLINE).toString(); } catch (NoSuchElementException ex) { description = seq.getName(); } return description;
String description = null; try { description = seq.getAnnotation().getProperty(PROPERTY_DESCRIPTIONLINE).toString(); } catch (NoSuchElementException ex) { description = seq.getName();
protected String describeSequence(Sequence seq) { String description = null; try { description = seq.getAnnotation().getProperty(PROPERTY_DESCRIPTIONLINE).toString(); } catch (NoSuchElementException ex) { description = seq.getName(); } return description; ...
return description; }
protected String describeSequence(Sequence seq) { String description = null; try { description = seq.getAnnotation().getProperty(PROPERTY_DESCRIPTIONLINE).toString(); } catch (NoSuchElementException ex) { description = seq.getName(); } return description; ...
while(reachedEnd == false){ br.mark(buffer.length); int bytesRead = br.read(buffer,0,buffer.length); while(Character.isDigit(buffer[buffer.length -1])){ br.reset(); buffer = new char[buffer.length+64]; br.mark(buffer.length); bytesRead = br.read(buffer,0,buffer.length); } if(bytesRead < 0){ seenEOF = reachedEnd = true;...
while(reachedEnd == false){ br.mark(buffer.length); int bytesRead = br.read(buffer,0,buffer.length); while(Character.isDigit(buffer[buffer.length -1])){ br.reset(); buffer = new char[buffer.length+64]; br.mark(buffer.length); bytesRead = br.read(buffer,0,buffer.length); } if(bytesRead < 0){ seenEOF = reachedEnd = true;...
private boolean readSequenceData(BufferedReader br, SymbolTokenization parser, SeqIOListener listener) throws IOException, IllegalSymbolException { char[] buffer = new char[256]; StreamParser sparser = parser.parseStream(l...
while(!reachedEnd && parseStart < bytesRead && buffer[parseStart] != '>'){ parseEnd = parseStart; while(parseEnd < bytesRead && Character.isWhitespace(buffer[parseEnd]) == false){ ++parseEnd; }
int parseEnd = 0;
private boolean readSequenceData(BufferedReader br, SymbolTokenization parser, SeqIOListener listener) throws IOException, IllegalSymbolException { char[] buffer = new char[256]; StreamParser sparser = parser.parseStream(l...
sparser.characters(buffer,parseStart,parseEnd-parseStart); parseStart = parseEnd+1; while(parseStart < bytesRead && Character.isDigit(buffer[parseStart]) == false && buffer[parseStart] != '>'){ ++parseStart; } }
while(!reachedEnd && parseEnd < bytesRead && buffer[parseEnd] != '>'){ ++parseEnd; } sparser.characters(buffer,0,parseEnd);
private boolean readSequenceData(BufferedReader br, SymbolTokenization parser, SeqIOListener listener) throws IOException, IllegalSymbolException { char[] buffer = new char[256]; StreamParser sparser = parser.parseStream(l...
if(parseStart < bytesRead && buffer[parseStart] == '>'){ br.reset(); if(br.skip(parseStart) != parseStart) throw new IOException("Couldn't reset to start of next sequence"); reachedEnd = true; } } }
if(parseEnd < bytesRead && buffer[parseEnd] == '>'){ br.reset(); if(br.skip(parseEnd) != parseEnd) throw new IOException("Couldn't reset to start of next sequence"); reachedEnd = true; } } }
private boolean readSequenceData(BufferedReader br, SymbolTokenization parser, SeqIOListener listener) throws IOException, IllegalSymbolException { char[] buffer = new char[256]; StreamParser sparser = parser.parseStream(l...
for (int i = 1, linesPrinted = 1; i <= seqLen; i++) { int val = ((IntegerAlphabet.IntegerSymbol)seq.symbolAt(i)).intValue(); String s = Integer.toString(val); if ((line.length() + s.length()) > lineWidth) { os.println(line.substring(0)); line = new StringBuffer(); } line.append(s + " "); }
for (int i = 1, linesPrinted = 1; i <= seqLen; i++) { int val = ((IntegerAlphabet.IntegerSymbol)seq.symbolAt(i)).intValue(); String s = Integer.toString(val); if ((line.length() + s.length()) > lineWidth) { os.println(line.substring(0)); line = new StringBuffer(); } line.append(s + " ");
public void writeSequence(Sequence seq, PrintStream os) throws IOException { os.print(">"); os.println(describeSequence(seq)); StringBuffer line = new StringBuffer(); int seqLen = seq.length(); for (int i = 1, linesPrinted = 1; i <= seqLen; i++) { int val = ((...
}
public void writeSequence(Sequence seq, PrintStream os) throws IOException { os.print(">"); os.println(describeSequence(seq)); StringBuffer line = new StringBuffer(); int seqLen = seq.length(); for (int i = 1, linesPrinted = 1; i <= seqLen; i++) { int val = ((...
this.interpret(poContents,oLine);
oStoredLine = oLine; return;
private void onNewDataSet(BufferedReader poContents, String poLine) throws SAXException { //choose according to version... oBlast = new BlastSAXParser(oVersion,this.getNamespacePrefix()); String oLine; //Parse Contents stream up to end of a single BlastDataSet. oBlast.setCo...
oStoredLine = null;
private void onNewDataSet(BufferedReader poContents, String poLine) throws SAXException { //choose according to version... oBlast = new BlastSAXParser(oVersion,this.getNamespacePrefix()); String oLine; //Parse Contents stream up to end of a single BlastDataSet. oBlast.setCo...
oLine = oContents.readLine();
if (iState == INSIDE_FILE) { oLine = oStoredLine; if (oStoredLine != null) { this.interpret(oContents,oLine); } } else { oLine = oContents.readLine(); }
public void parse(InputSource poSource ) throws IOException, SAXException { BufferedReader oContents; String oLine; this.changeState(STARTUP); //Use method form superclass oContents = this.getContentStream(poSource); //This sets content...
public BioFetchSequenceDB(String prefix, String type, String db) { this.prefix = prefix; this.type = type; this.db = db;
public BioFetchSequenceDB(String location, String dbName) { this.location = location; this.dbName = dbName;
public BioFetchSequenceDB(String prefix, String type, String db) { this.prefix = prefix; this.type = type; this.db = db; }
tempSet.add(nameToEnzyme.get(isoName));
Object re = nameToEnzyme.get(isoName); if(re!=null) tempSet.add(re);
private static void loadData(InputStream is) { nameToEnzyme = new HashMap(); nameToIsoschizomers = new HashMap(); sizeToCutters = new HashMap(); enzymeToPattern = new HashMap(); enzymeToAnnotation = new HashMap(); try { BufferedReader ...
List queryParamsList = paramsList;
List queryParamsList = new ArrayList(paramsList);
public Object buildObject(Class clazz, List paramsList) { // Create the Hibernate query to look it up with String queryText; String queryType; List queryParamsList = paramsList; if (clazz==SimpleNamespace.class) { queryText = "from Namespace as ns where ns.name = ?"; ...
if (queryParamsList.get(0) instanceof Set) queryParamsList.set(0, DocRefAuthor.Tools.generateAuthorString((Set)queryParamsList.get(0)));
queryParamsList.set(0, DocRefAuthor.Tools.generateAuthorString((List)queryParamsList.get(0)));
public Object buildObject(Class clazz, List paramsList) { // Create the Hibernate query to look it up with String queryText; String queryType; List queryParamsList = paramsList; if (clazz==SimpleNamespace.class) { queryText = "from Namespace as ns where ns.name = ?"; ...
for (int i = 0; i < paramsList.size(); i++) types[i] = paramsList.get(i).getClass();
for (int i = 0; i < paramsList.size(); i++) { if (paramsList.get(i) instanceof Set) types[i] = Set.class; else if (paramsList.get(i) instanceof List) types[i] = List.class; else types[i] = paramsList.get(i).getClass(); }
public Object buildObject(Class clazz, List paramsList) { // Create the Hibernate query to look it up with String queryText; String queryType; List queryParamsList = paramsList; if (clazz==SimpleNamespace.class) { queryText = "from Namespace as ns where ns.name = ?"; ...
else paramsstuff.append(paramsList.get(i).toString());
else paramsstuff.append(paramsList.get(i).getClass());
public Object buildObject(Class clazz, List paramsList) { // Create the Hibernate query to look it up with String queryText; String queryType; List queryParamsList = paramsList; if (clazz==SimpleNamespace.class) { queryText = "from Namespace as ns where ns.name = ?"; ...
}else if (rec.getFrame()== GFFRecord.NO_FRAME){
} else if (rec.getFrame() == GFFTools.NO_FRAME) {
public Sequence annotate(Sequence seq) throws BioException, ChangeVetoException { Feature.Template plain = new Feature.Template(); StrandedFeature.Template stranded = new StrandedFeature.Template(); FramedFeature.Template framed = new FramedFeature.Template(); plain.annotation = Annota...
thisTemplate.annotation = new SmallAnnotation(); if (rec.getScore() != GFFRecord.NO_SCORE) { thisTemplate.annotation.setProperty(PROPERTY_GFF_SCORE, new Double(rec.getScore())); } seq.createFeature(thisTemplate);
thisTemplate.annotation = new SmallAnnotation(); if (rec.getScore() != GFFTools.NO_SCORE) { thisTemplate.annotation.setProperty(PROPERTY_GFF_SCORE, new Double(rec.getScore())); } Map attributes = rec.getGroupAttributes(); Iterator it = attributes.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next...
public Sequence annotate(Sequence seq) throws BioException, ChangeVetoException { Feature.Template plain = new Feature.Template(); StrandedFeature.Template stranded = new StrandedFeature.Template(); FramedFeature.Template framed = new FramedFeature.Template(); plain.annotation = Annota...
handler.startDocument(""); for(Iterator i = lineIterator(); i.hasNext(); ) { Object line = i.next(); if(line instanceof String) { handler.commentLine((String) line); } else { handler.recordLine((GFFRecord) line); }
handler.startDocument(""); for (Iterator i = lineIterator(); i.hasNext();) { Object line = i.next(); if (line instanceof String) { handler.commentLine((String) line); } else { handler.recordLine((GFFRecord) line);
public void streamRecords(GFFDocumentHandler handler) { handler.startDocument(""); for(Iterator i = lineIterator(); i.hasNext(); ) { Object line = i.next(); if(line instanceof String) { handler.commentLine((String) line); } else { handler.recordLine...
handler.endDocument();
} handler.endDocument();
public void streamRecords(GFFDocumentHandler handler) { handler.startDocument(""); for(Iterator i = lineIterator(); i.hasNext(); ) { Object line = i.next(); if(line instanceof String) { handler.commentLine((String) line); } else { handler.recordLine...
private void setObject(RichFeature object) { this.object = object; }
void setObject(RichFeature object) { this.object = object; }
private void setObject(RichFeature object) { this.object = object; }
private void setSubject(RichFeature subject) { this.subject = subject; }
void setSubject(RichFeature subject) { this.subject = subject; }
private void setSubject(RichFeature subject) { this.subject = subject; }
public SVMRegressionModel(int capacity) { vectors = new Object[capacity]; alphas = new double[capacity]; alphaStars = new double[capacity]; size = 0;
public SVMRegressionModel() { this(100);
public SVMRegressionModel(int capacity) { vectors = new Object[capacity]; alphas = new double[capacity]; alphaStars = new double[capacity]; size = 0; }
public void addVector(Object v) { addVector(v, 0.0, 0.0);
public void addVector(Object v, double alpha, double alphaStar) { if ((size + 1) >= vectors.length) { Object [] nVectors = new Object[vectors.length * 2]; System.arraycopy(vectors, 0, nVectors, 0, size); vectors = nVectors; double [] nAlphas = new double[alphas.length * 2]; System.arraycopy(alphas, 0, nAlphas, 0, size)...
public void addVector(Object v) { addVector(v, 0.0, 0.0); }
kernel = m.getKernel();
public synchronized void trainModel(SVMRegressionModel m, double[] t) { model = m; target = t; kernel = m.getKernel(); E = new double[model.size()]; for (int i = 0; i < t.length; ++i) { E[i] = Double.NEGATIVE_INFINITY; } int numChanged = 0; boolean examineAll = true; //int SigFig = -100...
if (name == null) throw new IllegalArgumentException("Name must not be null");
if (name == null || name.equals("")) throw new IllegalArgumentException("Name must not be null or empty");
public SimpleComparableTerm(ComparableOntology ontology, String name, Object[] synonyms) { if (name == null) throw new IllegalArgumentException("Name must not be null"); if (ontology == null) throw new IllegalArgumentException("Ontology must not be null"); this.name = name; this....
Position endPos = null;
private static Position parsePosition(String position) throws ParseException { Matcher pm = pp.matcher(position); if (!pm.matches()) throw new ParseException("Could not understand position: "+position); String startfuzz = pm.group(1); String endfuzz = pm.group(6); boolean endStart...
if (input.charAt(start)=='\n') start++;
while (input.charAt(start)=='\n') start++;
public static String[] writeWordWrap(String input, String sepRegex, int width) { List lines = new ArrayList(); Pattern p = Pattern.compile(sepRegex); int start = 0; while (start < input.length()) { if (input.charAt(start)=='\n') start++; //go from start+width ...
int newline = input.indexOf('\n',start); if (newline>start && newline<splitPoint) { splitPoint = newline;
while (splitPoint>start) { char c = input.charAt(splitPoint); Matcher m = p.matcher(""+c); if (m.matches()) break; splitPoint--;
public static String[] writeWordWrap(String input, String sepRegex, int width) { List lines = new ArrayList(); Pattern p = Pattern.compile(sepRegex); int start = 0; while (start < input.length()) { if (input.charAt(start)=='\n') start++; //go from start+width ...
else { while (splitPoint>start) { char c = input.charAt(splitPoint); Matcher m = p.matcher(""+c); if (m.matches()) break; splitPoint--; } if (splitPoint==start) splitPoint = start+width; }
if (splitPoint==start) splitPoint = start+width;
public static String[] writeWordWrap(String input, String sepRegex, int width) { List lines = new ArrayList(); Pattern p = Pattern.compile(sepRegex); int start = 0; while (start < input.length()) { if (input.charAt(start)=='\n') start++; //go from start+width ...
String oLine = null;
public void convert() throws java.io.IOException, org.xml.sax.SAXException { //Access functionality of biojava classes through //standard org.xml.sax interfaces... /** * Create a SAX Parser that takes the native output * from blast-like bioinformatics software. *...
assertNull(ns.getDescription());
public void testGetDescription() { System.out.println("testGetDescription"); //should be null at startup assertNull(ns.getDescription()); try{ ns.setDescription(desc); }catch(Exception ex){ fail("Was not expecting "+ex.getClass().getName()); } ...
booring3 = new FeatureFilter.BySequenceName("unrepeatable");
protected void setUp() { booring1 = new FeatureFilter.OverlapsLocation(new RangeLocation(20, 50)); booring2 = new FeatureFilter.ByClass(StrandedFeature.class); booring3 = new FeatureFilter.BySequenceName("unrepeatable"); booring4 = new FeatureFilter.ByClass(ComponentFeature.class); and = new FeatureFil...
or = new FeatureFilter.Or(booring3, booring4);
protected void setUp() { booring1 = new FeatureFilter.OverlapsLocation(new RangeLocation(20, 50)); booring2 = new FeatureFilter.ByClass(StrandedFeature.class); booring3 = new FeatureFilter.BySequenceName("unrepeatable"); booring4 = new FeatureFilter.ByClass(ComponentFeature.class); and = new FeatureFil...
public synchronized static WalkerFactory getInstance() { return getInstance(FeatureFilter.class);
public synchronized static WalkerFactory getInstance(Class typeClazz) { WalkerFactory instance; String typeName = typeClazz.getName(); if ((instance = (WalkerFactory) factories.get(typeName)) == null) { instance = new WalkerFactory(typeClazz); factories.put(typeName, instance); } return instance;
public synchronized static WalkerFactory getInstance() { return getInstance(FeatureFilter.class); }
return "!";
return "!-" + advance.length;
public String getName() { return "!"; }
return ((String) a).compareTo(b);
return ((Comparable) a).compareTo(b);
public int compare(Object a, Object b) { return ((String) a).compareTo(b); }
double minAcross = sequenceToGraphics(range.getMin()) - renderer.getMinimumLeader(this); int [] dist = new int[2]; if(direction == HORIZONTAL) { dist[0] = (int) minAcross; dist[1] = 0; } else { dist[0] = 0; dist[1] = (int) minAcross;
double minAcross = sequenceToGraphics(range.getMin()) - renderer.getMinimumLeader(this); Insets insets = getInsets(); int [] dist = new int[2]; if(direction == HORIZONTAL) { dist[0] = (int) minAcross - insets.left; dist[1] = -insets.top; } else { dist[0] = -insets.left; dist[1] = (int) minAcross - insets.top; } retur...
protected int [] calcDist() { double minAcross = sequenceToGraphics(range.getMin()) - renderer.getMinimumLeader(this); int [] dist = new int[2]; if(direction == HORIZONTAL) { dist[0] = (int) minAcross; dist[1] = 0; } else { dist[0] = 0; dist[1] = (int) minAcross; ...
return dist; }
protected int [] calcDist() { double minAcross = sequenceToGraphics(range.getMin()) - renderer.getMinimumLeader(this); int [] dist = new int[2]; if(direction == HORIZONTAL) { dist[0] = (int) minAcross; dist[1] = 0; } else { dist[0] = 0; dist[1] = (int) minAcross; ...
throws ParseException
public void addFeatureProperty(Object key, Object value) throws ParseException { // Don't print internal data structures if (key.equals(Feature.PROPERTY_DATA_KEY)) return; StringBuffer fb; StringBuffer sb; // The value may be a collection if several qualifiers...
if (key.equals(EmblLikeFormat.SEPARATOR_TAG)) return;
public void addSequenceProperty(Object key, Object value) throws ParseException { StringBuffer sb = new StringBuffer(); // Ignore separators if they are sent to us. The parser should // be ignoring these really if (key.equals(EmblLikeFormat.SEPARATOR_TAG)) return; ...
int wrapWidth = 80 - leader.length();
int wrapWidth = 85 - leader.length();
public void addSequenceProperty(Object key, Object value) throws ParseException { StringBuffer sb = new StringBuffer(); // Ignore separators if they are sent to us. The parser should // be ignoring these really if (key.equals(EmblLikeFormat.SEPARATOR_TAG)) return; ...
if (c.size() == maxTimes) throw new ChangeVetoException("Maximum elements (" + maxTimes + ") reached");
public void setProperty(Annotation ann, Object property, Object value) throws ChangeVetoException { if (getElementType().accept(value)) { Collection c; if (ann.containsProperty(property)) { c = (Collection) ann.getProperty(property); ...
Triple t = new Triple.Impl(subject, object, predicate);
Triple t = new Triple.Impl(subject, object, predicate, name, description);
public Triple createTriple(Term subject, Term object, Term predicate, String name, String description) throws AlreadyExistsException, IllegalArgumentException, ...
public boolean contains(Location l) { return false; }
public boolean contains(int p) { return false; }
public boolean contains(Location l) { return false; }
throws RegexException, IllegalAlphabetException
public void addPattern(String patternString, boolean overlap) { Pattern pattern = factory.compile(patternString); PatternInfo info = new PatternInfo(); info.patternString = patternString; info.pattern = pattern; info.overlap = overlap; patterns.add(info); }
public DASStructureCall(String url){ serverurl = url;
public DASStructureCall() { serverurl = "" ;
public DASStructureCall(String url){ serverurl = url; }
incCount();
private void addListener() { alphabet.addChangeListener(ChangeListener.ALWAYS_VETO, Alphabet.SYMBOLS); }
GFFRecord record = (GFFRecord)i.next(); if(! names.contains(record.getSeqName())){ names.add(record.getSeqName());
Object o = i.next(); if(o instanceof GFFRecord){ GFFRecord record = (GFFRecord)o; if(! names.contains(record.getSeqName())){ names.add(record.getSeqName()); }
public static SequenceDB annotateSequences(SequenceDB seqs, GFFEntrySet ents) throws IllegalIDException, BioException{ Set names = new HashSet(); //get the list of names for each sequence for (Iterator i = ents.lineIterator(); i.hasNext(); ) { GFFRecord record = (GFFRecord)i.next(); if(! names.c...
public void parse(BufferedReader bReader, GFFDocumentHandler handler)
public void parse(BufferedReader bReader, GFFDocumentHandler handler, GFFRecordFilter filter)
public void parse(BufferedReader bReader, GFFDocumentHandler handler) throws IOException, BioException { handler.startDocument(); ArrayList aList = new ArrayList(); for(String line = bReader.readLine(); line != null; line = bReader.readLine()) { aList.clear(); if(line.startsWith("#")) { han...
handler.recordLine(createRecord(handler, aList, rest, comment));
GFFRecord record = createRecord(handler, aList, rest, comment); if(filter.accept(record)) { handler.recordLine(record); }
public void parse(BufferedReader bReader, GFFDocumentHandler handler) throws IOException, BioException { handler.startDocument(); ArrayList aList = new ArrayList(); for(String line = bReader.readLine(); line != null; line = bReader.readLine()) { aList.clear(); if(line.startsWith("#")) { han...
String alpha = null;
static public Alphabet generateCrossProductAlphaFromName( String name ) { if(!name.startsWith("(") || !name.endsWith(")")) { throw new BioError( "Can't parse " + name + " into a cross-product alphabet as it is not bracketed" ); } name = name.substring(1, name.length()-1).trim(); ...
return AlphabetManager.createSymbol( tokenSeed++, "?", Annotation.EMPTY_ANNOTATION, sList, this );
return AlphabetManager.createSymbol('?', Annotation.EMPTY_ANNOTATION, sList, this);
public Symbol getSymbol(List sList) throws IllegalSymbolException { if(sList.size() != alphas.size()) { throw new IllegalSymbolException( "List of symbols is the wrong length (" + alphas.size() + ":" + sList.size() + ")" ); } Iterator ai = alphas.iterator(); Iterator si = sLis...
CrossRef crossRef = new SimpleCrossRef(parts[0].trim(),parts[1].trim(),0);
CrossRef crossRef = (CrossRef)RichObjectFactory.getObject(SimpleCrossRef.class,new Object[]{parts[0].trim(),parts[1].trim()});
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; boolea...
int strand = rs.getInt(7);
protected synchronized SimpleFeatureHolder getComponentFeatures() { if (componentFeatures == null) { componentFeatures = new SimpleFeatureHolder(); Connection conn = null; try { conn = seqDB.getDataSource().getConnection(); PreparedStatement get_assembly = conn.prepareStatement("select assembly...
int agct = 0;
public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; StringBuffer sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which...
Symbol sym = null;
public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; StringBuffer sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which...
HashMap rankType = new HashMap();
if (parent < 0) { rankType = new HashMap(); }
void persistFeatures(Connection conn, int bioentry_id, FeatureHolder features, int parent) throws BioException, SQLException { // HashMap to track rank for each feature_type // This allows the unique key constraint in seqfeature to be valid as // bioentries can have multiple features of same type/sourc...
r.mark(cache.length);
r.mark(cache.length + 1);
private boolean readSequenceData( BufferedReader r, SymbolTokenization parser, SeqIOListener listener ) throws IOException, IllegalSymbolException { char[] cache = new char[512]; boolean reachedEnd = false, seenEOF = false; StreamParser sparser = parser.parseStream(listener); while (!...
cache[parseStart] == '\n' && cache[parseStart] == '\r')
(cache[parseStart] == '\n' || cache[parseStart] == '\r') )
private boolean readSequenceData( BufferedReader r, SymbolTokenization parser, SeqIOListener listener ) throws IOException, IllegalSymbolException { char[] cache = new char[512]; boolean reachedEnd = false, seenEOF = false; StreamParser sparser = parser.parseStream(listener); while (!...
if (context.getDirection() == context.HORIZONTAL)
if (context.getDirection() == SequenceRenderContext.HORIZONTAL)
public void renderImageMap(Graphics2D g2, Feature f, SequenceRenderContext context) { Rectangle bounds = g2.getDeviceConfiguration().getBounds(); // Safe to cast as bounds come from raster int ma...
for(Iterator i = model.stateAlphabet().symbols().iterator(); i.hasNext(); ) {
for(Iterator i = model.stateAlphabet().iterator(); i.hasNext(); ) {
private static void randomize(MarkovModel model) throws Exception { ModelTrainer mt = new SimpleModelTrainer(); mt.registerModel(model); mt.setNullModelWeight(5.0); for(Iterator i = model.stateAlphabet().symbols().iterator(); i.hasNext(); ) { State s = (State) i.next(); if(s instanceof Emiss...
FileInputStream oInputFileStream;
protected BufferedReader getContentStream(InputSource poSource) { InputSource oSource; BufferedReader oContents; FileInputStream oInputFileStream; int iBuffSize = 8192; oSource = poSource; //Check contents InputSource in order of pr...
Sequence assembly = new SimpleAssembly(nameBuff.substring(0), "");
public Feature resolve(RemoteFeature rFeat) throws BioException { FeatureFilter remoteFilter = new FeatureFilter.ByClass(RemoteFeature.class); Set seqs = new HashSet(); LinkedList ids = new LinkedList(); Set feats = new HashSet(); Sequence parent = rFeat.getSequence(); ids.add(p...
public SimpleAssembly(String name, String uri) {
public SimpleAssembly(int length, String name, String uri) {
public SimpleAssembly(String name, String uri) { this.name = name; this.uri = uri; }
assembly.setLength(length);
public SimpleAssembly(String name, String uri) { this.name = name; this.uri = uri; }
new SocketClazzSet(dbURL.relativeURL(name + '/'), set)
new SocketClazzSet(name, dbURL.relativeURL(name + '/'), set, this)
private AceSet allClasses() throws AceException { if (allClassesSet == null) { AceSocket sock = null; try { sock = takeSocket(); String result = sock.transact("classes"); StaticAceSet set = new StaticAceSet(null, dbURL); for(StringTokenizer toke = new StringTokenizer(result, "\r\n"); toke.has...
private AceSet select(String clazz, String namePattern)
AceSet select(String clazz, String namePattern)
private AceSet select(String clazz, String namePattern) throws AceException { AceSocket sock = null; try { sock = takeSocket(); String result = sock.transact("find " + clazz + " " + namePattern); int mpos = result.indexOf("// Found "); if (mpos < 0) return null; // FIXME?...
this.name = name;
public SocketClazzSet(String name, AceURL url, AceSet parent, SocketDatabase ourDB) { this.url = url; this.parent = parent; this.ourDB = ourDB; }
public void testGapInCrossProductAlphabet() throws Exception{ Alphabet alph = AlphabetManager.alphabetForName("(PROTEIN x PROTEIN)"); List s = new ArrayList(); s.add(AlphabetManager.getGapSymbol()); s.add(ProteinTools.createProtein("V").symbolAt(1)); Symbol sym = alph.getSymbol(s); List l = ((BasisSymbol)sym ).getSymb...
public void testGapInCrossProductAlphabet() throws Exception { Alphabet protein = ProteinTools.getAlphabet(); Alphabet alph = AlphabetManager.getCrossProductAlphabet(Collections.nCopies(2, protein)); List s = new ArrayList(); s.add(protein.getGapSymbol()); s.add(ProteinTools.createProtein("V").symbolAt(1)); Symbol sym ...
public void testGapInCrossProductAlphabet() throws Exception{ Alphabet alph = AlphabetManager.alphabetForName("(PROTEIN x PROTEIN)"); List s = new ArrayList(); s.add(AlphabetManager.getGapSymbol()); s.add(ProteinTools.createProtein("V").symbolAt(1)); Symbol sym = alph.getSymbol(s); List l = ((BasisSymbol)sym ).ge...
public SimpleGeneticAlgorithm(Population pop, MutationFunction mutFunc, CrossOverFunction xFunc, SelectionFunction selFunc){
public SimpleGeneticAlgorithm() {
public SimpleGeneticAlgorithm(Population pop, MutationFunction mutFunc, CrossOverFunction xFunc, SelectionFunction selFunc){ crossResults = new LinkedList(); try { setPopulation(pop); setCrossOverFunction(xFun...
try { setPopulation(pop); setCrossOverFunction(xFunc); setMutationFunction(mutFunc); setSelectionFunction(selFunc); } catch (ChangeVetoException ex) { }
public SimpleGeneticAlgorithm(Population pop, MutationFunction mutFunc, CrossOverFunction xFunc, SelectionFunction selFunc){ crossResults = new LinkedList(); try { setPopulation(pop); setCrossOverFunction(xFun...
return new SimpleSymbol(Annotation.EMPTY_ANNOTATION);
return new SimpleSymbol(ann);
protected Symbol createSymbol(Annotation ann) throws Exception { return new SimpleSymbol(Annotation.EMPTY_ANNOTATION); }
reader.mark(2); if (reader.read() == -1) hasMoreSequence = false; else reader.reset();
char [] cbuf = new char [1]; while (true) { reader.mark(1); if (reader.read() == -1) { hasMoreSequence = false; break; } reader.read(cbuf, 0, 1); if (Character.isWhitespace(cbuf[0])) { hasWhitespace = true; continue; } else { if (hasWhitespace) System.err.println("Warning: whitespace found between sequence entries"...
public boolean readSequence(BufferedReader reader, SymbolParser symParser, SeqIOListener listener) throws IllegalSymbolException, IOException, ParseException { String line; StreamParser sparser = null; boolean hasMoreSequence = true; listener.startSequence(); while ((line = reader.readLine...
this.name = name;
public LazySearchedAnnotationDB(String name, AnnotationDB source, AnnotationType schema) { this.name = name; this.source = source; this.schema = schema; }