rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
stream.println(sq); }
String count = Integer.toString((i * 60) + len); sq.replace((80 - count.length()), 80, count);
public void addSymbols(final Alphabet alpha, final Symbol [] syms, final int start, final int length) throws IllegalAlphabetException { try { int aCount = 0; int cCount = 0; int gCount = 0; int tCoun...
stream.println(" } catch (IllegalSymbolException ex) { throw new IllegalAlphabetException(ex, "DNA not tokenizing"); }
stream.println(sq); } stream.println(" } catch (IllegalSymbolException ex) { throw new IllegalAlphabetException(ex, "DNA not tokenizing"); }
public void addSymbols(final Alphabet alpha, final Symbol [] syms, final int start, final int length) throws IllegalAlphabetException { try { int aCount = 0; int cCount = 0; int gCount = 0; int tCoun...
return temp.toString();
return temp.substring(0);
private String sequenceBufferCreator(Object key, Object value) { StringBuffer temp = new StringBuffer(); if (value == null) { temp.append((String) key); } else if (value instanceof ArrayList) { Iterator iter = ((ArrayList) value).iterator(); while (iter.h...
public void setName(final String id) throws ParseException {
public void setName(String id) throws ParseException {
public void setName(final String id) throws ParseException { idb = new StringBuffer("ID " + id); }
public void setPrintStream(final PrintStream stream)
public void setPrintStream(PrintStream stream)
public void setPrintStream(final PrintStream stream) { this.stream = stream; }
public void setURI(final String uri) throws ParseException { }
public void setURI(String uri) throws ParseException { }
public void setURI(final String uri) throws ParseException { }
public void startFeature(final Feature.Template templ)
public void startFeature(Feature.Template templ)
public void startFeature(final Feature.Template templ) throws ParseException { // There are 19 spaces in the leader String leader = "FT "; int strand = 0; if (templ instanceof StrandedFeature.Template) strand = ((StrandedFeature.Template) templ)....
IllegalTransitionException
IllegalTransitionException, BioException
public PairwiseDP(MarkovModel mm) throws IllegalResidueException, IllegalTransitionException { super(mm); magicalState = mm.magicalState(); magicalResidue = MagicalState.MAGICAL_RESIDUE; }
throws IllegalAlphabetException
throws IllegalResidueException
private static Residue getResWrapper(CrossProductAlphabet a, List l) throws IllegalAlphabetException {// System.out.println(a.getName() + " getting:");// for (Iterator i = l.iterator(); i.hasNext(); ) {// Residue blah = (Residue) i.next();// System.out.println(blah.getName());...
UnigeneDB unigene = UnigeneTools.FLAT_FILE_FACTORY.createUnigene(url);
UnigeneDB unigene = UnigeneTools.createUnigene(url);
public static void main(String[] args) throws Exception { URL url = new URL(new URL("file:"), args[0]); UnigeneDB unigene = UnigeneTools.FLAT_FILE_FACTORY.createUnigene(url); }
templ.type = rs.getString(2); templ.source = rs.getString(3);
templ.type = rs.getString(2).trim(); templ.source = rs.getString(3).trim();
protected synchronized SimpleFeatureHolder getFeatures() { if (features == null) { try { Connection conn = seqDB.getPool().takeConnection(); Map fmap = new HashMap(); Map qmap = new HashMap(); Map lmap = new HashMap(); PreparedStatement get_features = conn.prepareStatement( "select s...
lqm.qualifier_name = rs.getString(2); lqm.qualifier_value = rs.getString(3);
lqm.qualifier_name = rs.getString(2).trim(); lqm.qualifier_value = rs.getString(3).trim();
protected synchronized SimpleFeatureHolder getFeatures() { if (features == null) { try { Connection conn = seqDB.getPool().takeConnection(); Map fmap = new HashMap(); Map qmap = new HashMap(); Map lmap = new HashMap(); PreparedStatement get_features = conn.prepareStatement( "select s...
tokenSeed++, ""+tokenSeed, Annotation.EMPTY_ANNOTATION, l, this
tokenSeed++, Annotation.EMPTY_ANNOTATION, l, this
protected AtomicSymbol getSymbolImpl(List sList) throws IllegalSymbolException { AtomicSymbol s; synchronized(gopher) { gopher.setList(sList); s = (AtomicSymbol) knownSymbols.get(gopher); } if(s == null) { List l = new ArrayList(sList); s = (AtomicSymbol) AlphabetManager.createSymbol(...
this.translation = temp.location.getMax() - temp.componentLocation.getMin();
this.translation = temp.location.getMax() + temp.componentLocation.getMin();
public SimpleComponentFeature(FeatureHolder 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."); } i...
public SimpleNCBITaxonName(String nameClass, String name) { if (nameClass==null) throw new IllegalArgumentException("Name class cannot be null"); if (name==null) throw new IllegalArgumentException("Name cannot be null"); this.nameClass = nameClass; this.name = name; }
protected SimpleNCBITaxonName() {}
public SimpleNCBITaxonName(String nameClass, String name) { if (nameClass==null) throw new IllegalArgumentException("Name class cannot be null"); if (name==null) throw new IllegalArgumentException("Name cannot be null"); this.nameClass = nameClass; this.name = name; }
featureTemplate = locParser.parseLocation(featureBuf.toString(), featureTemplate); listener.startFeature(featureTemplate); featureStatus = WITHIN; } break; case WITHIN: if (line.charAt(0) == '/') { if (countChar(line, '"') % 2 == 0) processAttribute(line); else { featureBuf.setLength(0); featureBuf.append(line); featu...
featureTemplate = locParser.parseLocation(featureBuf.toString(), featureTemplate); listener.startFeature(featureTemplate); featureStatus = WITHIN; } break; case WITHIN: if (line.charAt(0) == '/') { if (countChar(line, '"') % 2 == 0) processAttribute(line); else { featureBuf.setLength(0); featureBuf.append(line); feat...
public void featureData(String line) throws BioException { switch (featureStatus) { case LOCATION: featureBuf.append(line); if (countChar(featureBuf, '(') == countChar(featureBuf, ')')) { // Save the original location in the feature's // annotation bundle try { Map dat = new HashMap(); dat...
public void testSubList()
public void testSubList() throws Exception
public void testSubList() { assertTrue(symsEq(circ.subList(-2,2), circ.subList(8,12))); }
SymbolList s = DNATools.createDNA("agaatc"); assertTrue(s.equals(circ.subList(-2,3)));
public void testSubList() { assertTrue(symsEq(circ.subList(-2,2), circ.subList(8,12))); }
public CircularView(Sequence seq){ super(seq);
public CircularView(Sequence seq, FeatureRealizer fr){ super(seq, fr);
public CircularView(Sequence seq){ super(seq); }
SymbolList toEnd = super.subList(start,super.length()); SymbolList fromStart = super.subList(1,end); SimpleSymbolList sl = new SimpleSymbolList(toEnd); Edit edit = new Edit(sl.length() +1, 0, fromStart);
SimpleSymbolList fromStart = new SimpleSymbolList(super.subList(1,end)); SimpleSymbolList toEnd = new SimpleSymbolList(super.subList(start,length())); Edit edit = new Edit(toEnd.length() +1, 0, fromStart);
public SymbolList subList(int start, int end){ start = realValue(start); end = realValue(end); if(start <= end){ return super.subList(start, end); } else{ SymbolList toEnd = super.subList(start,super.length()); SymbolList fromStart = super.subList(1,end); SimpleSymbolList sl = new S...
sl.edit(edit);
toEnd.edit(edit);
public SymbolList subList(int start, int end){ start = realValue(start); end = realValue(end); if(start <= end){ return super.subList(start, end); } else{ SymbolList toEnd = super.subList(start,super.length()); SymbolList fromStart = super.subList(1,end); SimpleSymbolList sl = new S...
synchronized (target) { target.createFeature(t); }
target.createFeature(t);
public void run() { SymbolListCharSequence charSeq = new SymbolListCharSequence(target); try { Pattern [] patterns = RestrictionEnzymeManager.getPatterns(enzyme); int siteLen = enzyme.getRecognitionSite().length(); int seqLen = target.length(); in...
public SequenceDBSearchSubHit(double score, double eValue, double pValue, Alignment alignment)
public SequenceDBSearchSubHit(final double score, final double eValue, final double pValue, final Alignment alignment)
public SequenceDBSearchSubHit(double score, double eValue, double pValue, Alignment alignment) { this.score = score; this.pValue = eValue; this.eValue = pValue; this.alignment = alignment; // Lock alignment by vetoing all changes this.alignment.addChangeListener(ChangeListener.A...
public boolean equals(Object other)
public boolean equals(final Object other)
public boolean equals(Object other) { if (other == this) return true; if (other == null) return false; // Eliminate other if its class is not the same if (! other.getClass().equals(this.getClass())) return false; // Downcast and compare fields SequenceDBSearchSubHit that = (SequenceDBSearchSubHit) other; if ...
alphaResolver = new AlphabetResolver();
public SimilarityPairBuilder() { resultData = new HashMap(); hitData = new HashMap(); subHitData = new HashMap(); queryViewCache = new HashMap(); subjectViewCache = new HashMap(); alphaResolver = new AlphabetResolver(); tokenBuffer =...
String subjectID = (String) hitData.get("subjectId");
private void makeSimilarity() throws BioException { subHitData.putAll(resultData); subHitData.putAll(hitData); // Try to get a valid TokenParser if (tokenParser == null) { String identifier; // Try explicit sequence type first if (subHitData.con...
Sequence subjectView = makeSubjectViewSequence(subjectID);
private void makeSimilarity() throws BioException { subHitData.putAll(resultData); subHitData.putAll(hitData); // Try to get a valid TokenParser if (tokenParser == null) { String identifier; // Try explicit sequence type first if (subHitData.con...
if (identifier.endsWith("blastn")) return DNATools.getDNA(); else if (identifier.endsWith("blastp") || identifier.endsWith("blastx")) return ProteinTools.getTAlphabet(); else if (identifier.equalsIgnoreCase("dna")) return DNATools.getDNA(); else if (identifier.equalsIgnoreCase("protein")) return ProteinTools.getTAl...
int type = 0; identifier = identifier.toUpperCase(); if (identifier.indexOf("TBLASTN") != -1) type = PROTEIN; else if (identifier.indexOf("TBLASTX") != -1) type = PROTEIN; else if (identifier.indexOf("BLASTN") != -1) type = DNA; else if (identifier.indexOf("BLASTP") != -1) type = PROTEIN; else if (identifier.indexOf(...
FiniteAlphabet resolveAlphabet(String identifier) throws BioException { // For (T)BLASTN/P/X if (identifier.endsWith("blastn")) return DNATools.getDNA(); else if (identifier.endsWith("blastp") || identifier.endsWith("blastx")) // Use T(ermination)...
switch (type) { case DNA: return DNATools.getDNA(); case PROTEIN: return ProteinTools.getTAlphabet(); default: throw new BioError("Internal error in AlphabetResolver: failed to resolve to either DNA or protein alphabets"); }
FiniteAlphabet resolveAlphabet(String identifier) throws BioException { // For (T)BLASTN/P/X if (identifier.endsWith("blastn")) return DNATools.getDNA(); else if (identifier.endsWith("blastp") || identifier.endsWith("blastx")) // Use T(ermination)...
FeatureFilter dbFilter = FilterUtils.or(tsSchema, FilterUtils.or(exSchema, reSchema));
FeatureFilter dbFilter = FilterUtils.or( new FeatureFilter[] { tsSchema, exSchema, reSchema } );
public void testUseCases() { // schemas for our database features FeatureFilter transcript = FilterUtils.byType("transcript"); FeatureFilter exon = FilterUtils.byType("exon"); FeatureFilter repeat = FilterUtils.byType("repeat"); AnnotationType.Impl tsType = new AnnotationType.Impl(); ...
System.err.println(depth + ":" + "Optimizing " + filter);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "is AND");
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "as list: " + filters);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
filters.set(i, (FeatureFilter) filters.get(i));
filters.set(i, optimize((FeatureFilter) filters.get(i)));
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "i: " + i);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "j: " + j);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "Comparing " + a + ", " + b + " of " + filters);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "Disjoint. Returning none()");
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "a < b. Removing b");
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "a > b. Removing a");
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "Attempting to calculate intersection");
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "got intersection: " + intersect);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "no luck - moving on"); } } } } System.err.println(depth + ":" + "Reduced to: " + filters);
} } } }
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "empty filter set. Returning none()"); return none();
if(ors.isEmpty()) { return none(); } else { FeatureFilter andedOrs = FilterUtils.and((FeatureFilter[]) filters.toArray(new FeatureFilter[] {})); return andedOrs; }
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "No ors, just returning anded values: " + ands);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "Mixing in ors: " + ors); System.err.println(depth + ":" + "to: " + ands);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "Returning optimized or: " + res);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "is OR");
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "filters: " + filters); System.err.println(depth + ":" + "ands: " + ands);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "Found an all. Returning all()");
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "a < b. Removing a");
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "a > b. Removing b");
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "Trying to calculate union");
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "Got union: " + union);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
return optimize(and((FeatureFilter[]) ands.toArray(new FeatureFilter[] {})));
FeatureFilter oredAnds = or((FeatureFilter[]) ands.toArray(new FeatureFilter[] {})); return oredAnds;
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "no ands, returning ors: " + ors);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "Mixing in ands: " + ands); System.err.println(depth + ":" + "to: " + ors);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
System.err.println(depth + ":" + "returning anded values: " + val);
public final static FeatureFilter optimize(FeatureFilter filter) { System.err.println(depth + ":" + "Optimizing " + filter); depth++; try { if(filter instanceof FeatureFilter.And) { System.err.println(depth + ":" + "is AND"); List filters = new ArrayList(); expandAnd(filter, filters);...
Position endPos = null;
private static Position parsePosition(String position) throws ParseException { // First attempt to find the group enclosing everything we've been passed Matcher sm = sp.matcher(position); if (!sm.matches()) throw new ParseException("Could not understand position: "+position); String star...
String desc = m.group(3);
public boolean readSequence( BufferedReader reader, SymbolTokenization symParser, SeqIOListener siol ) throws IllegalSymbolException, IOException, ParseException { String line = reader.readLine(); if (line == null) { ...
System.err.println("Got hierarchy entry: " + parent + " : " + child);
protected synchronized SimpleFeatureHolder getFeatures() { if (features == null) { try { Connection conn = seqDB.getPool().takeConnection(); Map fmap = new HashMap(); Map lmap = new HashMap(); PreparedStatement get_features = conn.prepareStatement( "select seqfeature.seqfeature_id, " ...
System.err.println("ReRealizeFeature " + fid);
private Feature reRealizeFeature(Integer fid, Map fmap, Map featureHierarchy, FeatureHolder parent) throws BioException, ChangeVetoException { System.err.println("ReRealizeFeature " + fid); Feature.Template templ = (Feature.Template) fmap.get(fid); Feature f = realizeFeature(parent, templ); if (f instance...
System.err.println("Doing magical bits");
private Feature reRealizeFeature(Integer fid, Map fmap, Map featureHierarchy, FeatureHolder parent) throws BioException, ChangeVetoException { System.err.println("ReRealizeFeature " + fid); Feature.Template templ = (Feature.Template) fmap.get(fid); Feature f = realizeFeature(parent, templ); if (f instance...
Graphics2D g2 = lCtxt.getGraphics();
public void paintLogo(LogoContext lCtxt) { Graphics2D g2 = lCtxt.getGraphics(); Distribution dis = lCtxt.getDistribution(); SymbolStyle style = lCtxt.getStyle(); BlockPainter blockPainter = lCtxt.getBlockPainter(); Rectangle bounds = lCtxt.getBounds(); double width = bounds.getWidth(); double ste...
SymbolStyle style = lCtxt.getStyle();
public void paintLogo(LogoContext lCtxt) { Graphics2D g2 = lCtxt.getGraphics(); Distribution dis = lCtxt.getDistribution(); SymbolStyle style = lCtxt.getStyle(); BlockPainter blockPainter = lCtxt.getBlockPainter(); Rectangle bounds = lCtxt.getBounds(); double width = bounds.getWidth(); double ste...
this.endNode = endNode;
public FilterByQuery( Query query, Node startNode, Filter.CompareInteger.Comparison comparison, int value ) { this.query = query; this.startNode = startNode; this.comparison = comparison; this.value = value; }
endNode,
public boolean accept(Object object) throws OperationException { Queryable res = QueryTools.select( query, startNode, QueryTools.createQueryable(Collections.singleton(object), Object.class) ); return comparison.compare(res.size(), value); }
return Object.class;
return startNode.getInputClass();
public Class getInputClass() { return Object.class; }
return Object.class;
return startNode.getInputClass();
public Class getOutputClass() { return Object.class; }
public static Queryable select(Query query, Node currentNode, Queryable items) throws OperationException {
public static Queryable select( Query query, Node startNode, Node endNode, Queryable items ) throws OperationException { final boolean debug = false; if(debug) System.out.println("Executing at " + startNode + " with " + items); if(items.size() == 0) { if(debug) System.out.println("No items to process. Returning empty...
public static Queryable select(Query query, Node currentNode, Queryable items) throws OperationException { Queryable selected; if(currentNode instanceof ResultNode) { selected = items; } else { selected = new Queryable.Empty(items.getQueryClass()); } Iterator ai = query.getArcsFrom(curre...
if(currentNode instanceof ResultNode) {
if(startNode == endNode) { if(debug) System.out.println("reached end node - selecting current items");
public static Queryable select(Query query, Node currentNode, Queryable items) throws OperationException { Queryable selected; if(currentNode instanceof ResultNode) { selected = items; } else { selected = new Queryable.Empty(items.getQueryClass()); } Iterator ai = query.getArcsFrom(curre...
Iterator ai = query.getArcsFrom(currentNode).iterator();
if(debug) System.out.println("Following " + query.getArcsFrom(startNode).size() + " paths."); Iterator ai = query.getArcsFrom(startNode).iterator();
public static Queryable select(Query query, Node currentNode, Queryable items) throws OperationException { Queryable selected; if(currentNode instanceof ResultNode) { selected = items; } else { selected = new Queryable.Empty(items.getQueryClass()); } Iterator ai = query.getArcsFrom(curre...
selected = QueryTools.union(selected, select(query, arc.to, res));
if(res.size() != 0) { selected = QueryTools.union(selected, select( query, arc.to, endNode, res )); }
public static Queryable select(Query query, Node currentNode, Queryable items) throws OperationException { Queryable selected; if(currentNode instanceof ResultNode) { selected = items; } else { selected = new Queryable.Empty(items.getQueryClass()); } Iterator ai = query.getArcsFrom(curre...
if(debug) System.out.println("Selected " + startNode + " " + selected);
public static Queryable select(Query query, Node currentNode, Queryable items) throws OperationException { Queryable selected; if(currentNode instanceof ResultNode) { selected = items; } else { selected = new Queryable.Empty(items.getQueryClass()); } Iterator ai = query.getArcsFrom(curre...
throw new RegistryException("BioSQL databases require a `location' option");
throw new RegistryException("BioSQL provider requires" + " a 'location' parameter");
public SequenceDBLite getSequenceDB(Map config) throws RegistryException, BioException { String location = (String) config.get("location"); if (location == null) { throw new RegistryException("BioSQL databases require a `location' option"); } String userName = (String) config.get("userName"); if (user...
String userName = (String) config.get("userName"); if (userName == null) { throw new RegistryException("BioSQL databases require a `userName' option");
String dbName = (String) config.get("dbname"); if (dbName == null) { throw new RegistryException("BioSQL provider requires" + " a 'dbname' parameter");
public SequenceDBLite getSequenceDB(Map config) throws RegistryException, BioException { String location = (String) config.get("location"); if (location == null) { throw new RegistryException("BioSQL databases require a `location' option"); } String userName = (String) config.get("userName"); if (user...
String password = (String) config.get("password"); if (password == null) { password = "";
String biodatabase = (String) config.get("biodbname"); if (biodatabase == null) { throw new RegistryException("BioSQL provider requires" + " a 'biodbname' parameter");
public SequenceDBLite getSequenceDB(Map config) throws RegistryException, BioException { String location = (String) config.get("location"); if (location == null) { throw new RegistryException("BioSQL databases require a `location' option"); } String userName = (String) config.get("userName"); if (user...
String biodatabase = (String) config.get("biodatabase"); if (biodatabase == null) { throw new RegistryException("BioSQL database require a `biodatabase' option");
String userName = (String) config.get("user"); if (userName == null) { throw new RegistryException("BioSQL provider requires" + " a 'user' parameter"); } String password = (String) config.get("passwd"); if (password == null) { throw new RegistryException("BioSQL provider requires" + " a 'passwd' parameter"); } String...
public SequenceDBLite getSequenceDB(Map config) throws RegistryException, BioException { String location = (String) config.get("location"); if (location == null) { throw new RegistryException("BioSQL databases require a `location' option"); } String userName = (String) config.get("userName"); if (user...
super(symbol, name, annotation);
super(name, symbol, annotation);
public SimpleDotState(char symbol, String name, Annotation annotation) { super(symbol, name, annotation); }
(float) (getDepth(src) + 2.0)
(float) (getDepth(src) - 2.0)
public void renderFeature( Graphics2D g, Feature feat, SequenceRenderContext src ) { Location loc = feat.getLocation(); String label = labelMaker.makeLabel(feat); g.setPaint(Color.black); int min = Math.max(loc.getMin(), src.getRange().getMin()); int max = Math.min(loc.getMax(), src.getRange(...
f1 instanceof ByHierachy && f2 instanceof ByHierachy
f1 instanceof ByHierarchy && f2 instanceof ByHierarchy
private static FeatureFilter intersection(FeatureFilter f1, FeatureFilter f2) { if( f1 instanceof FeatureFilter.ContainedByLocation && f2 instanceof FeatureFilter.ContainedByLocation ) { Location loc = LocationTools.intersection( ((FeatureFilter.ContainedByLocation) f1).getLocation(), ...
ByHierachy f1h = (ByHierachy) f1; ByHierachy f2h = (ByHierachy) f2;
ByHierarchy f1h = (ByHierarchy) f1; ByHierarchy f2h = (ByHierarchy) f2;
private static FeatureFilter intersection(FeatureFilter f1, FeatureFilter f2) { if( f1 instanceof FeatureFilter.ContainedByLocation && f2 instanceof FeatureFilter.ContainedByLocation ) { Location loc = LocationTools.intersection( ((FeatureFilter.ContainedByLocation) f1).getLocation(), ...
f1 instanceof ByHierachy && f2 instanceof ByHierachy
f1 instanceof ByHierarchy && f2 instanceof ByHierarchy
private static FeatureFilter union(FeatureFilter f1, FeatureFilter f2) { if( f1 instanceof FeatureFilter.ContainedByLocation && f2 instanceof FeatureFilter.ContainedByLocation ) { return containedByLocation(LocationTools.union( ((FeatureFilter.ContainedByLocation) f1).getLocation(), ...
ByHierachy f1h = (ByHierachy) f1; ByHierachy f2h = (ByHierachy) f2;
ByHierarchy f1h = (ByHierarchy) f1; ByHierarchy f2h = (ByHierarchy) f2;
private static FeatureFilter union(FeatureFilter f1, FeatureFilter f2) { if( f1 instanceof FeatureFilter.ContainedByLocation && f2 instanceof FeatureFilter.ContainedByLocation ) { return containedByLocation(LocationTools.union( ((FeatureFilter.ContainedByLocation) f1).getLocation(), ...
FeatureHolder overlappingFeatures = seq.filter(new FeatureFilter.OverlapsLocation(new RangeLocation(start, end)), false); features = new ProjectedFeatureHolder(overlappingFeatures,
FeatureFilter overlapping = new FeatureFilter.OverlapsLocation(new RangeLocation(start, end)); features = new ProjectedFeatureHolder(seq, overlapping,
public SubSequence(Sequence seq, int start, int end) { symbols = seq.subList(start, end); FeatureHolder overlappingFeatures = seq.filter(new FeatureFilter.OverlapsLocation(new RangeLocation(start, end)), false); features = new ProjectedFeatureHolder(overlappingFeatures, this, start - 1, ...
start - 1,
1 - start,
public SubSequence(Sequence seq, int start, int end) { symbols = seq.subList(start, end); FeatureHolder overlappingFeatures = seq.filter(new FeatureFilter.OverlapsLocation(new RangeLocation(start, end)), false); features = new ProjectedFeatureHolder(overlappingFeatures, this, start - 1, ...
public void addChangeListener(ChangeListener cl) {}
public void addChangeListener(ChangeListener cl) { if (changeSupport == null) allocChangeSupport(); changeSupport.addChangeListener(cl); }
public void addChangeListener(ChangeListener cl) {}
public void removeChangeListener(ChangeListener cl) {}
public void removeChangeListener(ChangeListener cl) { if (changeSupport != null) { changeSupport.removeChangeListener(cl); } }
public void removeChangeListener(ChangeListener cl) {}
this.connPool = connPool;
public SQLUnigeneDB(JDBCConnectionPool connPool) { this.connPool = connPool; this.clusterCache = new WeakValueHashMap(); }
for(int j = wordLength + 2; j <= symList.length(); j++) {
for(int j = wordLength + 1; j <= symList.length(); j++) {
public void search( String seqID, SymbolList symList, SearchListener listener ) { try { int word = PackingFactory.primeWord(symList, wordLength, packing); listener.startSearch(seqID); fireHits(word, 1, listener); for(int j = wordLength + 2; j <= symList.length(); j++) { word = ...
fireHits(word, j - wordLength, listener);
fireHits(word, j - wordLength + 1, listener);
public void search( String seqID, SymbolList symList, SearchListener listener ) { try { int word = PackingFactory.primeWord(symList, wordLength, packing); listener.startSearch(seqID); fireHits(word, 1, listener); for(int j = wordLength + 2; j <= symList.length(); j++) { word = ...
assertEquals(LocationTools.intersection(r1, r3),
assertEquals(LocationTools.intersection(r1, r2),
public void testIntersection() { assertEquals(LocationTools.intersection(r1, r1), new PointLocation(1)); assertEquals(LocationTools.intersection(r1, r3), Location.empty); }
( (ct == null) || (ct == MarkovModel.PARAMETER) ) && (distForwarder == null)
MarkovModel.PARAMETER.isMatchingType(ChangeType.UNKNOWN) && distForwarder == null
protected ChangeSupport getChangeSupport(ChangeType ct) { ChangeSupport changeSupport = super.getChangeSupport(ct); if( ( (ct == null) || (ct == MarkovModel.PARAMETER) ) && (distForwarder == null) ) { distForwarder = new MarkovModel.DistributionForwarder( this, changeSupport );...
if (o == null) return false; if (! o.getClass().equals(this.getClass())) return false;
if (o == null) return false; if (! o.getClass().equals(this.getClass())) return false; SimpleSeqSimilaritySearchResult that = (SimpleSeqSimilaritySearchResult) o; if (! ObjectUtil.equals(this.querySequence, that.querySequence)) return false; if (! ObjectUtil.equals(this.sequenceDB, that.sequenceDB)) return false; if...
public boolean equals(Object o) { if (o == this) return true; // if this class is a direct sub-class of Object: if (o == null) return false; if (! o.getClass().equals(this.getClass())) return false; SimpleSeqSimilaritySearchResult that = (SimpleSeqSimilaritySearchResult) o; // only compare fields of ...
SimpleSeqSimilaritySearchResult that = (SimpleSeqSimilaritySearchResult) o; if (! ObjectUtil.equals(this.querySequence, that.querySequence)) return false; if (! ObjectUtil.equals(this.sequenceDB, that.sequenceDB)) return false; if (! ObjectUtil.equals(this.searchParameters, that.searchParameters)) return false; if (!...
return true;
public boolean equals(Object o) { if (o == this) return true; // if this class is a direct sub-class of Object: if (o == null) return false; if (! o.getClass().equals(this.getClass())) return false; SimpleSeqSimilaritySearchResult that = (SimpleSeqSimilaritySearchResult) o; // only compare fields of ...
getProperties().put(key, value);
getProperties().put(key, newValue);
public void setProperty(Object key, Object value) throws ChangeVetoException { if(changeSupport == null) { getProperties().put(key, value); } else { Map properties = getProperties(); ChangeEvent ce = new ChangeEvent( this, Annotation.PROPERTY, new Object[] { key, value }, ...
new Object[] { key, value }, new Object[] { key, properties.get(value)}
new Object[] { key, newValue }, new Object[] { key, properties.get(key)}
public void setProperty(Object key, Object value) throws ChangeVetoException { if(changeSupport == null) { getProperties().put(key, value); } else { Map properties = getProperties(); ChangeEvent ce = new ChangeEvent( this, Annotation.PROPERTY, new Object[] { key, value }, ...
properties.put(key, value);
properties.put(key, newValue);
public void setProperty(Object key, Object value) throws ChangeVetoException { if(changeSupport == null) { getProperties().put(key, value); } else { Map properties = getProperties(); ChangeEvent ce = new ChangeEvent( this, Annotation.PROPERTY, new Object[] { key, value }, ...
new FeatureFilter.Not(new FeatureFilter.IsTopLevel()));
new FeatureFilter.Not(FeatureFilter.top_level));
public FeatureHolder filter(FeatureFilter ff) { FeatureFilter childFilter = new FeatureFilter.And(new FeatureFilter.ContainedByLocation(getLocation()), new FeatureFilter.Not(new FeatureFilter.IsTopLevel())); ...
ChunkedSymbolListFactory symsf = new ChunkedSymbolListFactory(new PackedSymbolListFactory());
public String subStr(RichSequence seq, int start, int end) throws IndexOutOfBoundsException { if (seq instanceof SimpleRichSequence) return super.subStr(seq,start,end); if (seq.length()==0) return ""; // empty seq else if (seq.getCircular()) { StringBuffer result = new StringBuffer()...