rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
cache.clear();
public void setDelegateRenderer(OptimizableFilter filter, BeadFeatureRenderer renderer) throws IllegalArgumentException { Set delegateFilters = delegates.keySet(); if (delegateFilters.size() == 0) { delegates.put(filter, renderer); ...
public static Shape getShape(List points) {
public static Shape getShape(List x, List y) {
public static Shape getShape(List points) { GeneralPath p = new GeneralPath(); for (int i = 0; i < points.size(); i++) { Point2D.Float p2f = ( Point2D.Float ) points.get(i); if (i == 0) { p.moveTo(p2f.x, p2f.y); } else { p.lineTo(p2f.x, p2...
for (int i = 0; i < points.size(); i++) { Point2D.Float p2f = ( Point2D.Float ) points.get(i);
for (int i = 0; i < Math.min(x.size(), y.size()); i++) { int ix = (( Integer ) x.get(0)).intValue(); int iy = (( Integer ) y.get(0)).intValue();
public static Shape getShape(List points) { GeneralPath p = new GeneralPath(); for (int i = 0; i < points.size(); i++) { Point2D.Float p2f = ( Point2D.Float ) points.get(i); if (i == 0) { p.moveTo(p2f.x, p2f.y); } else { p.lineTo(p2f.x, p2...
p.moveTo(p2f.x, p2f.y);
p.moveTo(ix, iy);
public static Shape getShape(List points) { GeneralPath p = new GeneralPath(); for (int i = 0; i < points.size(); i++) { Point2D.Float p2f = ( Point2D.Float ) points.get(i); if (i == 0) { p.moveTo(p2f.x, p2f.y); } else { p.lineTo(p2f.x, p2...
p.lineTo(p2f.x, p2f.y);
p.lineTo(ix, iy);
public static Shape getShape(List points) { GeneralPath p = new GeneralPath(); for (int i = 0; i < points.size(); i++) { Point2D.Float p2f = ( Point2D.Float ) points.get(i); if (i == 0) { p.moveTo(p2f.x, p2f.y); } else { p.lineTo(p2f.x, p2...
if (! (sl instanceof Sequence)) return FeatureHolder.EMPTY_FEATURE_HOLDER;
if (! (sl instanceof Sequence)) { return FeatureHolder.EMPTY_FEATURE_HOLDER; }
protected FeatureHolder getFeatures(SequenceRenderContext sp) { SymbolList sl = sp.getSequence(); if (! (sl instanceof Sequence)) return FeatureHolder.EMPTY_FEATURE_HOLDER; Sequence seq = (Sequence) sl; FeatureHolder fh = (FeatureHolder) featureCache.get(seq); if(fh == null) { featureCache.put(seq...
featureCache.put(seq, fh = seq.filter(filter, false));
fh = seq.filter(filter, false);
protected FeatureHolder getFeatures(SequenceRenderContext sp) { SymbolList sl = sp.getSequence(); if (! (sl instanceof Sequence)) return FeatureHolder.EMPTY_FEATURE_HOLDER; Sequence seq = (Sequence) sl; FeatureHolder fh = (FeatureHolder) featureCache.get(seq); if(fh == null) { featureCache.put(seq...
public Alignment getAlignment() { return this.alignment; }
public Alignment getAlignment() { return alignment; }
public Alignment getAlignment() { return this.alignment; }
public FeatureHolder getFeatures() { return this.features; }
public FeatureHolder getFeatures() { return features; }
public FeatureHolder getFeatures() { return this.features; }
throw new BioException("Couldn't propogate feature creation request.");
throw new BioException("Couldn't propagate feature creation request.");
public Feature realizeFeature(FeatureHolder fh, Feature.Template templ) throws BioException { try { RealizingFeatureHolder rfh = (RealizingFeatureHolder) getParent(); return rfh.realizeFeature(fh, templ); } catch (ClassCastException ex) { throw new BioException("Couldn't propogate feature crea...
if(temp.location == null) { throw new NullPointerException("Template has null location: " + temp); } if(temp.componentLocation == null) { throw new NullPointerException("Template has null component location: " + temp); }
public DistComponentFeature(DistributedSequence parent, ComponentFeature.Template temp) throws BioException { if (locationContent(temp.location) != locationContent(temp.componentLocation)) { throw new BioException("Component and container locations must contain an equal number of symbols."); }...
URL queryURL = getAddress(id); SequenceFormat sFormat = getSequenceFormat(); SequenceBuilder sbuilder = new SimpleSequenceBuilder(); SequenceBuilderFactory sFact=new SwissprotProcessor.Factory(SimpleSequenceBuilder.FACTORY); Alphabet alpha = getAlphabet(); SymbolTokenization rParser = alpha.getTokenization("token"); S...
URL queryURL = getAddress(id);
public Sequence getSequence(String id) throws BioException { try { IOExceptionFound=false; URL queryURL = getAddress(id);//achieve URL based on ID // System.err.println("query is "+ queryURL.toString()); SequenceFormat sFormat = getSequenceFormat();//get incoming sequence format Seque...
return (filt instanceof AcceptNoneFilter);
if (filt instanceof ContainedByLocation) { Location loc = ((ContainedByLocation) filt).getLocation(); return !getLocation().overlaps(loc); } return (filt instanceof AcceptNoneFilter);
public boolean isDisjoint(FeatureFilter filt) { return (filt instanceof AcceptNoneFilter); }
AtomicSymbol as = (AtomicSymbol) i.next();
Object obj = i.next(); if(!(obj instanceof AtomicSymbol)) { throw new BioError( "Assertion Failure: Not an instance of AtomicSymbol: " + obj ); } AtomicSymbol as = (AtomicSymbol) obj;
public final double getWeight(Symbol sym) throws IllegalSymbolException { if(sym instanceof AtomicSymbol) { return getWeightImpl((AtomicSymbol) sym); } else { Alphabet ambA = sym.getMatches(); if(ambA instanceof FiniteAlphabet) { FiniteAlphabet fa = (FiniteAlphabet) ambA; double ...
mergeSet.add(ann);
if(!hasListeners()) mergeSet.add(ann); else{ ChangeEvent ce = new ChangeEvent(this,MergeAnnotation.ANNOTATION_ADD,ann); ChangeSupport changeSupport = super.getChangeSupport(MergeAnnotation.ANNOTATION_ADD); synchronized(changeSupport) { changeSupport.firePreChangeEvent(ce); mergeSet.add(ann); changeSupport.firePostChang...
public void addAnnotation(Annotation ann) throws ChangeVetoException { mergeSet.add(ann); }
((changeType == null) || (changeType.isMatchingType(Annotation.PROPERTY))) &&
(changeType.isMatchingType(Annotatable.ANNOTATION) || Annotatable.ANNOTATION.isMatchingType(changeType)) &&
protected ChangeSupport getChangeSupport(ChangeType changeType) { ChangeSupport changeSupport = super.getChangeSupport(changeType); if( ((changeType == null) || (changeType.isMatchingType(Annotation.PROPERTY))) && (annotationForwarder == null) ) { annotationForwarder = new Annotatable.Annotati...
throw new IOException("Premature end of stream for EMBL");
if (sparser != null) sparser.close(); throw new IOException("Premature end of stream or missing end tag '
public boolean readSequence(BufferedReader reader, SymbolParser symParser, SeqIOListener listener) throws IllegalSymbolException, IOException, ParseException { String line; StreamParser sparser = null; boolean hasMoreSequence = true; boolean hasInternalWhitespace = false; liste...
(ct == null || ct == Annotatable.ANNOTATION)
(ct.isMatchingType(Annotatable.ANNOTATION) || Annotatable.ANNOTATION.isMatchingType(ct))
protected ChangeSupport getChangeSupport(ChangeType ct) { ChangeSupport cs = super.getChangeSupport(ct); if( (annotationForwarder == null) && (ct == null || ct == Annotatable.ANNOTATION) ) { annotationForwarder = new Annotatable.AnnotationForwarder( this, cs ); getA...
return new RangeLocation(getMin() + dist, getMax() + dist);
if (dist == 0) return this; return new RangeLocation(getMin() + dist, getMax() + dist);
public Location translate(int dist) { return new RangeLocation(getMin() + dist, getMax() + dist); }
System.out.println(getPrefix() + "query sequence: " + seqID);
setQueryID(seqID);
public void setQuerySeq(String seqID) { System.out.println(getPrefix() + "query sequence: " + seqID); }
System.out.println(getPrefix() + "subject db: " + dbID);
setDatabaseID(dbID);
public void setSubjectDB(String dbID) { System.out.println(getPrefix() + "subject db: " + dbID); }
Iterator ai = getAlphabets().iterator();
public final Symbol getSymbol(List syms) throws IllegalSymbolException { if (syms.size() == 1) { Symbol s = (Symbol) syms.get(0); validate(s); return s; } List alphas = getAlphabets(); if(alphas.size() != syms.size()) { throw new IllegalSymbolException( "Can't retrieve symbol a...
return ((StrandedFeature) getFeature()).getStrand();
if (getProjectingFeatureHolder().isOppositeStrand()) { StrandedFeature.Strand s = ((StrandedFeature) getFeature()).getStrand(); if (s == StrandedFeature.POSITIVE) { return StrandedFeature.NEGATIVE; } else if (s == StrandedFeature.NEGATIVE) { return StrandedFeature.POSITIVE; } else { return StrandedFeature.UNKNOWN; } } ...
public StrandedFeature.Strand getStrand() { return ((StrandedFeature) getFeature()).getStrand(); }
SymbolParser rParser = alpha.getParser("token");
SymbolTokenization rParser = alpha.getTokenization("token");
public Sequence getSequence(String id) throws BioException { if( id.equals("") ) { throw new BioException("did not specify a valid id for getSequence"); } URL queryURL = getAddress(id); Sequence seq = null; try { System.err.println("query is "+ queryURL.toString()); URLCon...
State[] states = matrix.States();
State[] states = matrix.states();
public BackMatrixPairDPCursor( SymbolList seq1, SymbolList seq2, PairDPMatrix matrix ) { State[] states = matrix.States(); numStates = states.length; zeroCol = new double[numStates]; // don't touch this, please... zeroECol = new double[getDotStatesIndex()]; for (int ...
numStates = matrix.States().length;
numStates = matrix.states().length;
public MatrixPairDPCursor( SymbolList seq1, SymbolList seq2, PairDPMatrix matrix ) { numStates = matrix.States().length; zeroCol = new double[numStates]; // don't touch this, please... for (int i = 0; i < zeroCol.length; ++i) { zeroCol[i] = Double.NEGATIVE_INFINITY; } sMa...
scorel.add(DoubleAlphabet.getSymbol(bp.score));
scorel.add(dAlpha.getSymbol(bp.score));
public StatePath runViterbi(SymbolList seq0, SymbolList seq1) throws IllegalSymbolException, IllegalAlphabetException, IllegalTransitionException { states = getStates(); cursor = new LightPairDPCursor(seq0, seq1, states.length, true); alpha = (CrossProductAlphabet) getModel().emissionAlphabet(); // Forwa...
new SimpleSymbolList(DoubleAlphabet.getInstance(),
new SimpleSymbolList(dAlpha,
public StatePath runViterbi(SymbolList seq0, SymbolList seq1) throws IllegalSymbolException, IllegalAlphabetException, IllegalTransitionException { states = getStates(); cursor = new LightPairDPCursor(seq0, seq1, states.length, true); alpha = (CrossProductAlphabet) getModel().emissionAlphabet(); // Forwa...
{ StringBuffer intString = new StringBuffer(); char thisChar = location.charAt(nextCharIndex);
{ intString.setLength(0); char thisChar = location.charAt(nextCharIndex);
private Integer followInteger() { StringBuffer intString = new StringBuffer(); char thisChar = location.charAt(nextCharIndex); while (Character.isDigit(thisChar)) { intString.append(thisChar); nextCharIndex++; if (nextCharIndex >= location.length()) break; thisChar = location.charAt(nextCharIn...
{ StringBuffer textString = new StringBuffer(""); char thisChar = location.charAt(nextCharIndex);
{ textString.setLength(0); char thisChar = location.charAt(nextCharIndex);
private String followText() { StringBuffer textString = new StringBuffer(""); char thisChar = location.charAt(nextCharIndex); // First character must be a letter if (! Character.isLetter(thisChar)) return ""; while (Character.isLetterOrDigit(thisChar) || thisChar == '.') { textString.appe...
private int countChar(final String s, final char c)
private int countChar(String s, char c)
private int countChar(final String s, final char c) { int cnt = 0; for (int i = 0; i < s.length(); ++i) if (s.charAt(i) == c) ++cnt; return cnt; }
theTemplate.annotation.setProperty("JoinType", joinType);
Map dat = new SmallMap(); dat.put("JoinType", joinType); theTemplate.annotation.setProperty(Feature.PROPERTY_DATA_KEY, dat);
public Feature.Template parseLocation(String location, Feature.Template theTemplate) throws BioException { this.location = location; if ((countChar(location, '(')) != (countChar(location, ')'))) throw new BioException("Unbalanced parentheses in location: " + location); next...
catch(org.biojava.utils.ChangeVetoException cve)
catch (ChangeVetoException cve)
public Feature.Template parseLocation(String location, Feature.Template theTemplate) throws BioException { this.location = location; if ((countChar(location, '(')) != (countChar(location, ')'))) throw new BioException("Unbalanced parentheses in location: " + location); next...
throw new org.biojava.bio.BioError(cve);
throw new BioError(cve);
public Feature.Template parseLocation(String location, Feature.Template theTemplate) throws BioException { this.location = location; if ((countChar(location, '(')) != (countChar(location, ')'))) throw new BioException("Unbalanced parentheses in location: " + location); next...
oVersion = poVersion;
DomainSectionSAXParser( BlastLikeVersionSupport poVersion, String poNamespacePrefix ) { oVersion = poVersion; this.setNamespacePrefix(poNamespacePrefix); //For XSLT Parser Compliance this.addPrefixMapping("biojava","http://www.biojava.org"); }
oVersion = poVersion;
HmmerAlignmentSAXParser( BlastLikeVersionSupport poVersion, String poNamespacePrefix ) { oVersion = poVersion; this.setNamespacePrefix(poNamespacePrefix); //For XSLT Parser Compliance this.addPrefixMapping("biojava","http://www.biojava.org"); }
String metaData = st.nextToken();
st.nextToken();
public String parse( BufferedReader poContents, String poLine ) throws SAXException { oContents = poContents; try { oLine = poLine; /* * skip till linestarts with * 'Alignments of top-scoring domains' * while not line starts with 'Histogram' or '//' * case state = 0 if line not start ...
if (! ann.containsProperty(key)) return false;
public boolean instanceOf(Annotation ann) { for (Iterator i = cons.entrySet().iterator(); i.hasNext();) { Map.Entry pair = (Map.Entry) i.next(); Object key = pair.getKey(); PropertyConstraint con = (PropertyConstraint) pair.getValue(); if (!...
public Structure parsePDBFile(BufferedReader buf) throws IOException
public Structure parsePDBFile(InputStream inStream) throws IOException
public Structure parsePDBFile(BufferedReader buf) throws IOException { // (re)set structure structure = new StructureImpl() ; current_model = new ArrayList(); current_chain = null ; current_group = null ; header ...
structure = new StructureImpl() ; current_model = new ArrayList(); current_chain = null ; current_group = null ; header = init_header(); connects = new ArrayList(); try { String line = buf.readLine (); String recordName = ""; if ( line == null ) { throw new IOException ("could n...
return parsePDBFile(buf);
public Structure parsePDBFile(BufferedReader buf) throws IOException { // (re)set structure structure = new StructureImpl() ; current_model = new ArrayList(); current_chain = null ; current_group = null ; header ...
IllegalTransitionException
IllegalTransitionException, BioException
public DP(MarkovModel model) throws IllegalResidueException, IllegalTransitionException { this.model = model; this.states = stateList(model); this.forwardTransitions = forwardTransitions(model, states); this.forwardTransitionScores = forwardTransitionScores(model, state...
throws IllegalResidueException, IllegalTransitionException
throws IllegalResidueException, IllegalTransitionException, BioException
public static State[] stateList(MarkovModel mm) throws IllegalResidueException, IllegalTransitionException { FiniteAlphabet alpha = mm.stateAlphabet(); List emissionStates = new ArrayList(); HMMOrderByTransition comp = new HMMOrderByTransition(mm); List dotStates = new LinkedList(); for (Iterator add...
if(ad.length != mm.heads()) { throw new BioException( "Advance (" + ad.length + ") is not the same size as the number of heads (" + mm.heads() + " for state " + ex.getName() + " in model " + mm.stateAlphabet().getName() ); }
public static State[] stateList(MarkovModel mm) throws IllegalResidueException, IllegalTransitionException { FiniteAlphabet alpha = mm.stateAlphabet(); List emissionStates = new ArrayList(); HMMOrderByTransition comp = new HMMOrderByTransition(mm); List dotStates = new LinkedList(); for (Iterator add...
for (Iterator si = alphabet.iterator(); si.hasNext();)
for (Iterator si = AlphabetManager.getAllSymbols(alphabet).iterator(); si.hasNext();)
public SymbolListCharSequence(SymbolList syms) { FiniteAlphabet alphabet = (FiniteAlphabet) syms.getAlphabet(); if (! (alphabet instanceof FiniteAlphabet)) throw new IllegalArgumentException("Only SymbolLists using a FiniteAlphabet are supported by SymbolListCharSequence"); Symbol...
if (src.getDirection() == src.HORIZONTAL) {
if (src.getDirection() == SequenceRenderContext.HORIZONTAL) {
public void drawLine( Graphics2D g, SequenceRenderContext src, int base, StrandedFeature.Strand strand) { Paint prevPaint = g.getPaint(); g.setPaint(lines); // compute the frame to use. int moduloFrame = base%3;// System.out.println("drawLine...
if (src.getDirection() == src.HORIZONTAL) {
if (src.getDirection() == SequenceRenderContext.HORIZONTAL) {
public void renderLocation( Graphics2D g, SequenceRenderContext src, Location loc) { int minS = loc.getMin(); int maxS = loc.getMax(); double minP = src.sequenceToGraphics(minS); double maxP = src.sequenceToGraphics(maxS); // handle the zig double midpointSeqCoord; d...
public static void main(String[] args) throws Exception { Symbol[] rolls=new Symbol[6]; SimpleAlphabet diceAlphabet=new SimpleAlphabet(); diceAlphabet.setName("DiceAlphabet"); for(int i=1;i<7;i++) { rolls[i-1]= new SimpleAtomicSymbol((char)('0'+i),""+i,Annotation.EMPTY_ANNOTATION); diceAlphabet.addSymbol(rolls[i-1])...
public static void main(String[] args) { try { MarkovModel casino = createCasino(); DP dp=DPFactory.DEFAULT.createDP(casino); StatePath obs_rolls = dp.generate(300);
public static void main(String[] args) throws Exception { Symbol[] rolls=new Symbol[6]; //set up the dice alphabet SimpleAlphabet diceAlphabet=new SimpleAlphabet(); diceAlphabet.setName("DiceAlphabet"); for(int i=1;i<7;i++) { rolls[i-1]= new SimpleAtomicSymbol((char)('0'+i),""+i,Annotation.EMP...
dist = casino.getWeights(fairS); dist.setWeight(loadedS, 0.04); dist.setWeight(fairS, 0.95); dist.setWeight(casino.magicalState(), 0.01); dist = casino.getWeights(loadedS); dist.setWeight(fairS, 0.09); dist.setWeight(loadedS, 0.90); dist.setWeight(casino.magi...
SymbolList roll_sequence = obs_rolls.symbolListForLabel(StatePath.SEQUENCE); SymbolList[] res_array = {roll_sequence}; StatePath v = dp.viterbi(res_array, ScoreType.PROBABILITY); for(int i = 1; i <= obs_rolls.length()/60; i++) { for(int j=i*60; j<Math.min((i+1)*60, obs_rolls.length()); j++) { System.out.print(obs_ro...
public static void main(String[] args) throws Exception { Symbol[] rolls=new Symbol[6]; //set up the dice alphabet SimpleAlphabet diceAlphabet=new SimpleAlphabet(); diceAlphabet.setName("DiceAlphabet"); for(int i=1;i<7;i++) { rolls[i-1]= new SimpleAtomicSymbol((char)('0'+i),""+i,Annotation.EMP...
System.out.print("\n"); for(int j=i*60; j<Math.min((i+1)*60, obs_rolls.length()); j++) { System.out.print(obs_rolls.symbolAt(StatePath.STATES, j+1).getToken()); } System.out.print("\n"); for(int j=i*60; j<Math.min((i+1)*60, obs_rolls.length()); j++) { System.out.print(v.symbolAt(StatePath.STATES, j+1).getToken()); } ...
} catch (Throwable t) { t.printStackTrace();
public static void main(String[] args) throws Exception { Symbol[] rolls=new Symbol[6]; //set up the dice alphabet SimpleAlphabet diceAlphabet=new SimpleAlphabet(); diceAlphabet.setName("DiceAlphabet"); for(int i=1;i<7;i++) { rolls[i-1]= new SimpleAtomicSymbol((char)('0'+i),""+i,Annotation.EMP...
URL dbURL = new URL(dasURLString);
URL dbURL = new URL(dbURLString);
public static void main(String[] args) throws Exception { if (args.length != 1) throw new Exception("java das.TestDAS <url>"); String dbURLString = args[0]; URL dbURL = new URL(dasURLString); DASSequenceDB dasDB = new DASSequenceDB(dbURL); System.out.println("Top-level entry points:"); Set ids = dasDB.ids(); f...
setLongValue(Long.parseLong(data.toString()));
setLongValue(Long.parseLong((data.toString()).trim()));
public void endElement( String nsURI, String localName, String qName, StAXContentHandler handler ) throws SAXException { level--; if (level == 0) { try { setLongValue(Long.parseLong(data.toString())); } catch (NumberFormatException nfe) { throw new SAXException(nfe); } ...
if(w < 0.0) { throw new IllegalArgumentException( "Can't set weight to negative score: " + s.getName() + " -> " + w ); }
public void setWeight(Symbol s, double w) throws IllegalSymbolException { alphabet.validate(s); if(!(s instanceof AtomicSymbol)) { throw new IllegalSymbolException( "Can't set the weight for an ambiguity symbol " + s.getName() ); } Double d = new Double(w); weight.put(s, d); }
return Math.exp(-Math.abs(k.evaluate(a, a) - k.evaluate(b, b)) / ( w * w ));
return Math.exp(-Math.abs(2.0 * k.evaluate(a, b) - k.evaluate(a, a) - k.evaluate(b, b) ) / ( w * w ));
public double evaluate(Object a, Object b) { SVMKernel k = getKernel(); double w = getWidth(); return Math.exp(-Math.abs(k.evaluate(a, a) - k.evaluate(b, b)) / ( w * w )); }
if (context.getDirection() == context.HORIZONTAL)
if (context.getDirection() == SequenceRenderContext.HORIZONTAL)
public void renderBead(Graphics2D g2, Feature f, SequenceRenderContext context) { Location loc = f.getLocation(); int min = loc.getMin(); int max = loc.getMax(); int dif = max - min; double posXW, posY...
return maxDepth;
return maxDepth + 1.0f;
public double getDepth(final SequenceRenderContext context) { Collection delegateRenderers = delegates.values(); double maxDepth = 0.0d; if (delegateRenderers.size() == 0) { return maxDepth; } else { for (Iterator ri = delegateRenderers.iterator(); ri.hasNext();) { maxDepth = Math.max(maxDepth, ((Ab...
"from bioentry, biodatabase " + "where bioentry.accession = ? and biodatabase.biodatabase_id = ?"
"from bioentry where accession = ? and biodatabase_id = ?"
private void _removeSequence(String id) throws BioException, ChangeVetoException { Sequence seq = (Sequence) sequencesByName.get(id); if (seq != null) { seq = null; // Don't want to be holding the reference ourselves! try { Thread.sleep(100L); ...
ArrayList generic_ids = null; PreparedStatement delete_locs; if (dstyle == DBHelper.DELETE_MYSQL4) { delete_locs = conn.prepareStatement("delete from location" + " using location, seqfeature" + " where location.seqfeature_id = seqfeature.seqfeature_id and" + " seqfeature.bioentry_id = ?"); delete_locs.setInt(1, bio...
ArrayList generic_ids = null; PreparedStatement delete_locs; if (dstyle == DBHelper.DELETE_POSTGRESQL) {
private void _removeSequence(String id) throws BioException, ChangeVetoException { Sequence seq = (Sequence) sequencesByName.get(id); if (seq != null) { seq = null; // Don't want to be holding the reference ourselves! try { Thread.sleep(100L); ...
PreparedStatement delete_fqv; if (dstyle == DBHelper.DELETE_MYSQL4) { delete_fqv = conn.prepareStatement("delete from seqfeature_qualifier_value" + " using seqfeature_qualifier_value, seqfeature" + " where seqfeature_qualifier_value.seqfeature_id = seqfeature.seqfeature_id" + " and seqfeature.bioentry_id = ?"); del...
PreparedStatement delete_fqv; if (dstyle == DBHelper.DELETE_POSTGRESQL) {
private void _removeSequence(String id) throws BioException, ChangeVetoException { Sequence seq = (Sequence) sequencesByName.get(id); if (seq != null) { seq = null; // Don't want to be holding the reference ourselves! try { Thread.sleep(100L); ...
PreparedStatement delete_rel; if (dstyle == DBHelper.DELETE_MYSQL4) { delete_rel = conn.prepareStatement("delete from seqfeature_relationship" + " using seqfeature_relationship, seqfeature" + " where object_seqfeature_id = seqfeature.seqfeature_id" + " and seqfeature.bioentry_id = ?"); delete_rel.setInt(1, bioentry...
PreparedStatement delete_rel; if (dstyle == DBHelper.DELETE_POSTGRESQL) {
private void _removeSequence(String id) throws BioException, ChangeVetoException { Sequence seq = (Sequence) sequencesByName.get(id); if (seq != null) { seq = null; // Don't want to be holding the reference ourselves! try { Thread.sleep(100L); ...
int paramcount = stream.ReceiveInteger(4);
int paramcount = stream.ReceiveIntegerR(4);
public Message getMessage(PGStream stream, Encoding encoding) throws IOException, MappingException { CallRequest request = new CallRequest(); request.setClassname(stream.ReceiveString(encoding)); request.setMethodname(stream.ReceiveString(encoding)); request.setExpect(stream.ReceiveString(encoding)); logger.deb...
int paramSize = stream.ReceiveInteger(4); byte[] paramData = stream.Receive(paramSize);
byte[] paramData = null; if(stream.ReceiveChar() == 'D'){ int paramSize = stream.ReceiveIntegerR(4); paramData = stream.Receive(paramSize); logger.debug("not null field param"); } else { logger.debug("null param"); }
public Message getMessage(PGStream stream, Encoding encoding) throws IOException, MappingException { CallRequest request = new CallRequest(); request.setClassname(stream.ReceiveString(encoding)); request.setMethodname(stream.ReceiveString(encoding)); request.setExpect(stream.ReceiveString(encoding)); logger.deb...
RestrictionEnzyme enzyme = createEnzyme(); register(enzyme, isoschizomers);
registerEnzyme(createEnzyme()); nameToIsoschizomers.put(name, isoschizomers);
public void endRecord() throws ParserException { if (! getRecordState()) return; if (unknownSite || site == null) return; int isoCount = isoBuffer.size(); if (isoCount < 30) { isoschizomers = new SmallSet(...
if (! (o instanceof String))
if (! (o instanceof RestrictionEnzyme))
public synchronized static void register(RestrictionEnzyme enzyme, Set isoschizomers) { for (Iterator ii = isoschizomers.iterator(); ii.hasNext();) { Object o = ii.next(); if (! (o instanceof String)) { ...
throw new IllegalArgumentException("Isoschizomers set may contain only String names. Found '"
throw new IllegalArgumentException("Isoschizomers set may contain only RestrictionEnzymes. Found '"
public synchronized static void register(RestrictionEnzyme enzyme, Set isoschizomers) { for (Iterator ii = isoschizomers.iterator(); ii.hasNext();) { Object o = ii.next(); if (! (o instanceof String)) { ...
nameToEnzyme.put(name, enzyme);
public synchronized static void register(RestrictionEnzyme enzyme, Set isoschizomers) { for (Iterator ii = isoschizomers.iterator(); ii.hasNext();) { Object o = ii.next(); if (! (o instanceof String)) { ...
Integer sizeKey = new Integer(enzyme.getRecognitionSite().length()); if (sizeToCutters.containsKey(sizeKey)) { Set s = (Set) sizeToCutters.get(sizeKey); s.add(enzyme); } else { Set s = new HashSet(); s.add(enzyme); sizeToCutters.put(sizeKey, s); } Pattern forward = Pattern.compile(enzyme.getForwardRegex()); Pattern re...
public synchronized static void register(RestrictionEnzyme enzyme, Set isoschizomers) { for (Iterator ii = isoschizomers.iterator(); ii.hasNext();) { Object o = ii.next(); if (! (o instanceof String)) { ...
super();
public HibernateRichObjectBuilder(Object session) { super(); // call the normal rich object builder first try { // Lazy load the Session class from Hibernate. Class hibernateSession = Class.forName("org.hibernate.Session"); // Test to see if our parameter is really a S...
Object o = super.buildObject(clazz, params);
public Object buildObject(Class clazz, Object[] params) { // Create a wrapper object to do the search with Object o = super.buildObject(clazz, params); // Create the Hibernate query to look it up with String queryText; String queryType; if (o instanceof SimpleNamespace) { ...
if (o instanceof SimpleNamespace) {
if (clazz==SimpleNamespace.class) {
public Object buildObject(Class clazz, Object[] params) { // Create a wrapper object to do the search with Object o = super.buildObject(clazz, params); // Create the Hibernate query to look it up with String queryText; String queryType; if (o instanceof SimpleNamespace) { ...
} else if (o instanceof SimpleComparableOntology) {
} else if (clazz==SimpleComparableOntology.class) {
public Object buildObject(Class clazz, Object[] params) { // Create a wrapper object to do the search with Object o = super.buildObject(clazz, params); // Create the Hibernate query to look it up with String queryText; String queryType; if (o instanceof SimpleNamespace) { ...
} else if (o instanceof SimpleNCBITaxon) {
} else if (clazz==SimpleNCBITaxon.class) {
public Object buildObject(Class clazz, Object[] params) { // Create a wrapper object to do the search with Object o = super.buildObject(clazz, params); // Create the Hibernate query to look it up with String queryText; String queryType; if (o instanceof SimpleNamespace) { ...
} else if (o instanceof SimpleCrossRef) {
} else if (clazz==SimpleCrossRef.class) {
public Object buildObject(Class clazz, Object[] params) { // Create a wrapper object to do the search with Object o = super.buildObject(clazz, params); // Create the Hibernate query to look it up with String queryText; String queryType; if (o instanceof SimpleNamespace) { ...
} else if (o instanceof SimpleDocRef) {
} else if (clazz==SimpleDocRef.class) {
public Object buildObject(Class clazz, Object[] params) { // Create a wrapper object to do the search with Object o = super.buildObject(clazz, params); // Create the Hibernate query to look it up with String queryText; String queryType; if (o instanceof SimpleNamespace) { ...
Class[] types = new Class[params.length]; for (int i = 0; i < params.length; i++) types[i] = params[i].getClass(); Constructor c = clazz.getConstructor(types); Object o = c.newInstance(params);
public Object buildObject(Class clazz, Object[] params) { // Create a wrapper object to do the search with Object o = super.buildObject(clazz, params); // Create the Hibernate query to look it up with String queryText; String queryType; if (o instanceof SimpleNamespace) { ...
throws IOException, BioException {
throws BioException {
public UnigeneDB createUnigene(URL unigeneLoc) throws IOException, BioException { if(!unigeneLoc.getProtocol().equals("file")) { throw new BioException( "Can't create unigene from non-file URL: " + unigeneLoc ); } File unigeneDir = new File(unigeneLoc.getPath()); if(!unigeneDi...
indexAll(unigeneDir); indexUnique(unigeneDir); indexData(unigeneDir); indexLibInfo(unigeneDir);
try { indexAll(unigeneDir); indexUnique(unigeneDir); indexData(unigeneDir); indexLibInfo(unigeneDir); } catch (IOException ioe) { throw new BioException(ioe, "Failed to index data"); }
public UnigeneDB createUnigene(URL unigeneLoc) throws IOException, BioException { if(!unigeneLoc.getProtocol().equals("file")) { throw new BioException( "Can't create unigene from non-file URL: " + unigeneLoc ); } File unigeneDir = new File(unigeneLoc.getPath()); if(!unigeneDi...
throws IOException, BioException {
throws BioException {
public UnigeneDB loadUnigene(URL unigeneLoc) throws IOException, BioException { if(!unigeneLoc.getProtocol().equals("file")) { throw new BioException( "Can't create unigene from non-file URL: " + unigeneLoc ); } File unigeneDir = new File(unigeneLoc.getPath()); if(!unigeneDir....
return new FlatFileUnigeneDB( new BioStore(new File(unigeneDir, DATA_INDEX), true), new BioStore(new File(unigeneDir, LIB_INFO_INDEX), true), new BioStore(new File(unigeneDir, UNIQUE_INDEX), true), new BioStore(new File(unigeneDir, ALL_INDEX), true) );
try { return new FlatFileUnigeneDB( new BioStore(new File(unigeneDir, DATA_INDEX), true), new BioStore(new File(unigeneDir, LIB_INFO_INDEX), true), new BioStore(new File(unigeneDir, UNIQUE_INDEX), true), new BioStore(new File(unigeneDir, ALL_INDEX), true) ); } catch (IOException ioe) { throw new BioException(ioe, "Coul...
public UnigeneDB loadUnigene(URL unigeneLoc) throws IOException, BioException { if(!unigeneLoc.getProtocol().equals("file")) { throw new BioException( "Can't create unigene from non-file URL: " + unigeneLoc ); } File unigeneDir = new File(unigeneLoc.getPath()); if(!unigeneDir....
public BufferedReader getReader() {
public CountedBufferedReader getReader() {
public BufferedReader getReader() { return reader; }
(ct == null || ct == Annotatable.ANNOTATION))
(ct.isMatchingType(Annotatable.ANNOTATION) || Annotatable.ANNOTATION.isMatchingType(ct)))
protected ChangeSupport getChangeSupport(ChangeType ct) { ChangeSupport cs = super.getChangeSupport(ct); if (annotationForwarder == null && (ct == null || ct == Annotatable.ANNOTATION)) { annotationForwarder = new Annotatable.AnnotationForwarder(this, cs)...
String oAfterHmmr = this.hmmerDomainSummaryReached(poLine);
private void interpret(String poLine) throws SAXException { if (iState == IN_HEADER) { //accumulate header information //things that can end header section //start of summmary section //start of detail section //start of trailer when there are no hits ...
"There are no keys in the Empty Annotaion object: " +
"There are no keys in the Empty Annotation object: " +
public Object getProperty(Object key) throws NoSuchElementException { throw new NoSuchElementException( "There are no keys in the Empty Annotaion object: " + key ); }
"You can not add propertys to the Empy Annotaion object: " +
"You can not add properties to the Empty Annotation object: " +
public void setProperty(Object key, Object value) throws ChangeVetoException { throw new ChangeVetoException( "You can not add propertys to the Empy Annotaion object: " + key + " -> " + value ); }
if (result.indexOf(" throw new AceException("Couldn't find object " + cacheName + " using query " + query + " - does it exist?"); }
String tag = " int indx = result.indexOf(tag) + tag.length(); int spc = result.indexOf(" ", indx); String bit = result.substring(indx, spc); try { int count = Integer.parseInt(result.substring(indx, spc)); if (count == 0) { throw new AceException("Couldn't find object " + cacheName + " using query " + query + " - does ...
public AceObject getObject(String clazz, String name) throws AceException { if(clazz == null) { throw new NullPointerException("Class name was null"); } String cacheName = clazz + ":" + name; AceObject o = (AceObject) getFromCache(cacheName); if (o != null) return o; // get objec...
if(!stateAlpha.contains(DP.MAGICAL_STATE))
if(!stateAlpha.contains(DP.MAGICAL_STATE) && !stateAlpha.contains(PairwiseDP.MAGICAL_STATE))
public SimpleMarkovModel(Alphabet queryAlpha, Alphabet stateAlpha) throws SeqException { this.queryAlpha = queryAlpha; this.stateAlpha = stateAlpha; if(!stateAlpha.contains(DP.MAGICAL_STATE)) throw new SeqException("Use new SimpleMarkovModel(queryAlpha, stateAlpha). " + "sta...
throw new IllegalTransitionException(from, to, "No transition from " + from.getName() + " to " + to.getName() + " defined");
public void setTransitionScore(State from, State to, double value) throws IllegalResidueException, IllegalTransitionException { stateAlphabet().validate(from); stateAlphabet().validate(to); _tran.from = from; _tran.to = to; if(transitionScores.containsKey(_tran)) { transitionScores.put(_tran, new...
return SeqIOConstants.EMBL;
return SeqIOConstants.EMBL_DNA;
public static int guessFileType(File seqFile) throws IOException, FileNotFoundException { //First tries by matching an extension String fileName = seqFile.getName(); try { if ((new RE(".*\\u002eem.*")).match(fileName)) { return SeqIOConstants.EMBL; } ...
return SeqIOConstants.GENBANK;
return SeqIOConstants.GENBANK_DNA;
public static int guessFileType(File seqFile) throws IOException, FileNotFoundException { //First tries by matching an extension String fileName = seqFile.getName(); try { if ((new RE(".*\\u002eem.*")).match(fileName)) { return SeqIOConstants.EMBL; } ...
return SeqIOConstants.GENBANK;
return SeqIOConstants.GENBANK_DNA;
private static int guessGenType(String fileName) throws IOException, FileNotFoundException { BufferedReader br = new BufferedReader(new FileReader(fileName)); String line = br.readLine(); while (line.indexOf("LOCUS") == -1) { line = br.readLine(); } br.close(); ...
patternList.add(new ArrayList());
public Pattern(String label, FiniteAlphabet alfa) { this.alfa = alfa; this.label = label; patternList = new ArrayList(); patternList.add(new ArrayList()); }
throw new NoSuchElementException( "There are no notes in the Empty RichAnnotation object" );
return null;
public Note getNote(Note note){ throw new NoSuchElementException( "There are no notes in the Empty RichAnnotation object" ); }
throw new NoSuchElementException( "There are no keys in the Empty RichAnnotation object: " + key );
return null;
public Object getProperty(Object key) throws NoSuchElementException { throw new NoSuchElementException( "There are no keys in the Empty RichAnnotation object: " + key ); }
if(endOfRecord != null && line.startsWith(endOfRecord)) { return null;
if (endOfRecord != null) { if (endOfRecord == TagValueParser.BLANK_LINE_EOR) { if (line.equals(TagValueParser.BLANK_LINE_EOR)) { return null; } } else { if (line.startsWith(endOfRecord)) { return null; } }
public TagValue parse(Object o) { String line = o.toString(); if(endOfRecord != null && line.startsWith(endOfRecord)) { return null; } Matcher matcher = pattern.matcher(line); matcher.find(); String tag = matcher.group(tagGroup); if(trimTag) { tag = tag.trim(); } Strin...
System.out.print("magic " + "lastCol[k]=" + lastCol[k] + " , "); System.out.println("t=" + t);
private void forward_recurse(DPCursor dpCursor, ScoreType scoreType) throws IllegalSymbolException { State [] states = getStates(); int stateCount = states.length; int [][] transitions = getForwardTransitions(); double [][] transitionScore = getForwardTransitionScores(scoreType); // int _index = 0; ...
System.out.println("currentCol[" + states[l].getName() + "]=" + currentCol[l]);
private void forward_recurse(DPCursor dpCursor, ScoreType scoreType) throws IllegalSymbolException { State [] states = getStates(); int stateCount = states.length; int [][] transitions = getForwardTransitions(); double [][] transitionScore = getForwardTransitionScores(scoreType); // int _index = 0; ...
System.out.print("magic\t"); System.out.print("Weight " + weight + "\t"); System.out.print(", score " + score + " = " + Math.log(score) + "\t"); System.out.println(", constant " + constant);
private void forward_recurse(DPCursor dpCursor, ScoreType scoreType) throws IllegalSymbolException { State [] states = getStates(); int stateCount = states.length; int [][] transitions = getForwardTransitions(); double [][] transitionScore = getForwardTransitionScores(scoreType); // int _index = 0; ...
while (parseEnd < cline.length && cline[parseEnd] != ' ')
while (parseEnd < cline.length && cline[parseEnd] != ' ') { if (cline[parseEnd] == '.' || cline[parseEnd] == '~') { cline[parseEnd] = '-'; }
protected void processSequenceLine(String line, StreamParser parser) throws IllegalSymbolException, ParseException { char[] cline = line.toCharArray(); int parseStart = 0; int parseEnd = 0; while (parseStart < cline.length) { while (parseStart < cline.length...
}
protected void processSequenceLine(String line, StreamParser parser) throws IllegalSymbolException, ParseException { char[] cline = line.toCharArray(); int parseStart = 0; int parseEnd = 0; while (parseStart < cline.length) { while (parseStart < cline.length...
System.err.println("evaluating: " + trip);
public static Set getTriples( Ontology ontology, Term subject, Term object, Term relation ) throws OntologyException { Set res = new HashSet(); for( Iterator tripI = ontology.getTriples(null, null, null).iterator(); tripI.hasNext(); ) { Triple trip = (Triple) tripI.next(); ...
System.err.println("accepted");
public static Set getTriples( Ontology ontology, Term subject, Term object, Term relation ) throws OntologyException { Set res = new HashSet(); for( Iterator tripI = ontology.getTriples(null, null, null).iterator(); tripI.hasNext(); ) { Triple trip = (Triple) tripI.next(); ...