rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
if (strand == StrandedFeature.NEGATIVE) { try { syms = DNATools.reverseComplement(syms); } catch (IllegalAlphabetException ex) { throw new BioRuntimeException(ex); } } | public SymbolList getSymbols() { SymbolList syms = componentLocation.symbols(getComponentSequence()); if (strand == StrandedFeature.NEGATIVE) { try { syms = DNATools.reverseComplement(syms); } catch (IllegalAlphabetException ex) { throw new BioRuntimeException(ex); } } return syms; } | |
throw new BioRuntimeException("FIXME"); | ComponentFeature.Template temp = new ComponentFeature.Template(); temp.type = getType(); temp.source = getSource(); temp.location = getLocation(); temp.annotation = getAnnotation(); temp.componentLocation = getComponentLocation(); temp.componentSequenceName = componentID; return temp; | public Feature.Template makeTemplate() { throw new BioRuntimeException("FIXME"); } |
for (int i = 0; i <= v.size(); ++i) { | for (int i = 0; i < v.size(); ++i) { | public static String vectorToString(SparseVector v) { StringBuffer sb = new StringBuffer(); boolean first = true; for (int i = 0; i <= v.size(); ++i) { double x = v.getValueAtIndex(i); if (first) { first = false; } else { sb.append(' '); } sb.... |
this.isNull = restrictions.getMethod("isNull", new Class[]{String.class}); | this.isNotNull = restrictions.getMethod("isNotNull", new Class[]{String.class}); | protected BioSQLAcceptAllFilter() { super(); try { // Lazy load the Restrictions class. Class restrictions = Class.forName("org.hibernate.criterion.Restrictions"); // Lookup the isNull method this.isNull = restrictions.getMethod("isNull", new Class[]{String.... |
resultAnnotation = makeAnnotation(resultPreAnnotation); | resultAnnotation = AnnotationFactory.makeAnnotation(resultPreAnnotation); | public void endSearch() { try { resultAnnotation = makeAnnotation(resultPreAnnotation); target.add(makeSearchResult()); } catch (BioException be) { System.err.println("Failed to build SeqSimilaritySearchResult:"); be.printStackTrace()... |
Strand bestQueryStrand = subs[subs.length - 1].getQueryStrand(); Strand bestSubjectStrand = subs[subs.length - 1].getSubjectStrand(); | boolean mixQueryStrand = false; boolean mixSubjectStrand = false; boolean nullQueryStrand = false; boolean nullSubjectStrand = false; | private SeqSimilaritySearchHit makeHit() { double sc = Double.NaN; double ev = Double.NaN; double pv = Double.NaN; subs = (SeqSimilaritySearchSubHit []) subHits .toArray(new SeqSimilaritySearchSubHit [subHits.size() - 1]); // Sort to get highest score Arrays.s... |
int qStart = 0; int qEnd = 0; int sStart = 0; int sEnd = 0; | Strand qStrand = subs[0].getQueryStrand(); Strand sStrand = subs[0].getSubjectStrand(); | private SeqSimilaritySearchHit makeHit() { double sc = Double.NaN; double ev = Double.NaN; double pv = Double.NaN; subs = (SeqSimilaritySearchSubHit []) subHits .toArray(new SeqSimilaritySearchSubHit [subHits.size() - 1]); // Sort to get highest score Arrays.s... |
for (int i = subs.length; --i >= 0;) | int qStart = subs[0].getQueryStart(); int qEnd = subs[0].getQueryEnd(); int sStart = subs[0].getSubjectStart(); int sEnd = subs[0].getSubjectEnd(); if (qStrand == null) nullQueryStrand = true; if (sStrand == null) nullSubjectStrand = true; for (int i = subs.length; --i > 0;) | private SeqSimilaritySearchHit makeHit() { double sc = Double.NaN; double ev = Double.NaN; double pv = Double.NaN; subs = (SeqSimilaritySearchSubHit []) subHits .toArray(new SeqSimilaritySearchSubHit [subHits.size() - 1]); // Sort to get highest score Arrays.s... |
if (subs[i].getSubjectStrand().equals(bestSubjectStrand)) { if (sStart == 0 || sStart > subs[i].getSubjectStart()) { sStart = subs[i].getSubjectStart(); qStart = subs[i].getQueryStart(); } | Strand qS = subs[i].getQueryStrand(); Strand sS = subs[i].getSubjectStrand(); | private SeqSimilaritySearchHit makeHit() { double sc = Double.NaN; double ev = Double.NaN; double pv = Double.NaN; subs = (SeqSimilaritySearchSubHit []) subHits .toArray(new SeqSimilaritySearchSubHit [subHits.size() - 1]); // Sort to get highest score Arrays.s... |
if (sEnd < subs[i].getSubjectEnd()) { sEnd = subs[i].getSubjectEnd(); qEnd = subs[i].getQueryEnd(); } } | if (qS == null) nullQueryStrand = true; if (sS == null) nullSubjectStrand = true; if (qS != qStrand) mixQueryStrand = true; if (sS != sStrand) mixSubjectStrand = true; qStart = Math.min(qStart, subs[i].getQueryStart()); qEnd = Math.max(qEnd, subs[i].getQueryEnd()); sStart = Math.min(sStart, subs[i].getSubjectSta... | private SeqSimilaritySearchHit makeHit() { double sc = Double.NaN; double ev = Double.NaN; double pv = Double.NaN; subs = (SeqSimilaritySearchSubHit []) subHits .toArray(new SeqSimilaritySearchSubHit [subHits.size() - 1]); // Sort to get highest score Arrays.s... |
bestQueryStrand, | qStrand, | private SeqSimilaritySearchHit makeHit() { double sc = Double.NaN; double ev = Double.NaN; double pv = Double.NaN; subs = (SeqSimilaritySearchSubHit []) subHits .toArray(new SeqSimilaritySearchSubHit [subHits.size() - 1]); // Sort to get highest score Arrays.s... |
bestSubjectStrand, | sStrand, | private SeqSimilaritySearchHit makeHit() { double sc = Double.NaN; double ev = Double.NaN; double pv = Double.NaN; subs = (SeqSimilaritySearchSubHit []) subHits .toArray(new SeqSimilaritySearchSubHit [subHits.size() - 1]); // Sort to get highest score Arrays.s... |
makeAnnotation(hitData), | AnnotationFactory.makeAnnotation(hitData), | private SeqSimilaritySearchHit makeHit() { double sc = Double.NaN; double ev = Double.NaN; double pv = Double.NaN; subs = (SeqSimilaritySearchSubHit []) subHits .toArray(new SeqSimilaritySearchSubHit [subHits.size() - 1]); // Sort to get highest score Arrays.s... |
Strand qStrand = StrandedFeature.POSITIVE; Strand sStrand = StrandedFeature.POSITIVE; | Strand qStrand = null; Strand sStrand = null; | private SeqSimilaritySearchSubHit makeSubHit() throws BioException { // Try to get a valid TokenParser if (tokenParser == null) { String identifier; // Try explicit sequence type first if (subHitData.containsKey("hitSequenceType")) identifier =... |
if (subHitData.containsKey("queryStrand") && subHitData.get("queryStrand").equals("minus")) qStrand = StrandedFeature.NEGATIVE; | if (subHitData.containsKey("queryStrand")) if (subHitData.get("queryStrand").equals("plus")) qStrand = StrandedFeature.POSITIVE; else qStrand = StrandedFeature.NEGATIVE; | private SeqSimilaritySearchSubHit makeSubHit() throws BioException { // Try to get a valid TokenParser if (tokenParser == null) { String identifier; // Try explicit sequence type first if (subHitData.containsKey("hitSequenceType")) identifier =... |
if (subHitData.containsKey("subjectStrand") && subHitData.get("subjectStrand").equals("minus")) sStrand = StrandedFeature.NEGATIVE; | if (subHitData.containsKey("subjectStrand")) if (subHitData.get("subjectStrand").equals("plus")) sStrand = StrandedFeature.POSITIVE; else sStrand = StrandedFeature.NEGATIVE; | private SeqSimilaritySearchSubHit makeSubHit() throws BioException { // Try to get a valid TokenParser if (tokenParser == null) { String identifier; // Try explicit sequence type first if (subHitData.containsKey("hitSequenceType")) identifier =... |
if (subHitData.containsKey("queryFrame") && ((String) subHitData.get("queryFrame")).startsWith("minus")) qStrand = StrandedFeature.NEGATIVE; | if (subHitData.containsKey("queryFrame")) if (((String) subHitData.get("queryFrame")).startsWith("plus")) qStrand = StrandedFeature.POSITIVE; else qStrand = StrandedFeature.NEGATIVE; | private SeqSimilaritySearchSubHit makeSubHit() throws BioException { // Try to get a valid TokenParser if (tokenParser == null) { String identifier; // Try explicit sequence type first if (subHitData.containsKey("hitSequenceType")) identifier =... |
if (subHitData.containsKey("subjectFrame") && ((String) subHitData.get("subjectFrame")).startsWith("minus")) sStrand = StrandedFeature.NEGATIVE; | if (subHitData.containsKey("subjectFrame")) if (((String) subHitData.get("subjectFrame")).startsWith("plus")) sStrand = StrandedFeature.POSITIVE; else sStrand = StrandedFeature.NEGATIVE; | private SeqSimilaritySearchSubHit makeSubHit() throws BioException { // Try to get a valid TokenParser if (tokenParser == null) { String identifier; // Try explicit sequence type first if (subHitData.containsKey("hitSequenceType")) identifier =... |
Object state = addStates.next(); if (state instanceof EmissionState) { | Object state = addStates.next(); if(state instanceof MagicalState) { emissionStates.add(0, state); } else if (state instanceof EmissionState) { | public static State[] stateList(MarkovModel mm) throws IllegalSymbolException, IllegalTransitionException, BioException { FiniteAlphabet alpha = mm.stateAlphabet(); List emissionStates = new ArrayList(); HMMOrderByTransition comp = new HMMOrderByTransition(mm); List dotStates = new LinkedList(); for... |
ClientUtils.setClientforThread(client); | boolean setClient = ClientUtils.getClientforThread() == null; if(setClient) ClientUtils.setClientforThread(client); | public void execute() { ClientUtils.setClientforThread(client); try { while (true) { Message msg = chanell.receiveFromRDBMS(client); logger.debug("message in the glue"); Message ans = executor.execute((CallRequest) msg); if (logger.isDebugEnabled()){ logger.debug("executed, ansver is " + ans); ... |
ClientUtils.setClientforThread(null); | if(setClient) ClientUtils.setClientforThread(null); | public void execute() { ClientUtils.setClientforThread(client); try { while (true) { Message msg = chanell.receiveFromRDBMS(client); logger.debug("message in the glue"); Message ans = executor.execute((CallRequest) msg); if (logger.isDebugEnabled()){ logger.debug("executed, ansver is " + ans); ... |
resList.addAll(resParser.parse(token).toList()); | if(st.hasMoreTokens()) { resList.addAll(resParser.parse(token).toList()); } else { char c = token.charAt(token.length()-1); if(!Character.isDigit(c)) { resList.addAll(resParser.parse(token).toList()); } } | public Sequence readSequence(StreamReader.Context context, ResidueParser resParser, SequenceFactory sf) throws IllegalResidueException, IOException { final BufferedReader in = context.getReader(); String accession; String line; while(true) { line = in.readLine(); if(line == null) { ... |
double[] sCol; | public void _calcCell(Cell [][] cells, boolean initializationHack) throws IllegalSymbolException, IllegalAlphabetException, IllegalTransitionException { Cell curCell = cells[0][0]; double[] curCol = curCell.scores; STATELOOP: for (int l = states.length - 1; l >= 0; --l) { //System.ou... | |
sCol = targetCell.scores; | public void _calcCell(Cell [][] cells, boolean initializationHack) throws IllegalSymbolException, IllegalAlphabetException, IllegalTransitionException { Cell curCell = cells[0][0]; double[] curCol = curCell.scores; STATELOOP: for (int l = states.length - 1; l >= 0; --l) { //System.ou... | |
int trc = tr[ci]; | public void _calcCell(Cell [][] cells, boolean initializationHack) throws IllegalSymbolException, IllegalAlphabetException, IllegalTransitionException { Cell curCell = cells[0][0]; double[] curCol = curCell.scores; STATELOOP: for (int l = states.length - 1; l >= 0; --l) { //System.ou... | |
for (int i = featureHandlers.size() - 1; i >= 0; ++i) { | for (int i = featureHandlers.size() - 1; i >= 0; --i) { | public void startElement(String nsURI, String localName, String qName, Attributes attrs, DelegationManager dm) throws SAXException { if (localName.equals("featureSet")) { inFeatureSet = true; return; } for (int i = featureHandlers.size() - 1; i >= 0; ++i) { Binding b = (B... |
boolean recurse = FilterUtils.areProperSubset(filter, new FeatureFilter.IsTopLevel()); | boolean recurse = FilterUtils.areProperSubset(filter, FeatureFilter.top_level); | public FeatureHolder filter(FeatureFilter filter) { boolean recurse = FilterUtils.areProperSubset(filter, new FeatureFilter.IsTopLevel()); return filter(filter, recurse); } |
System.err.println("MySQL"); | public BioSQLSequenceDB(String dbURL, String dbUser, String dbPass, String biodatabase, boolean create) throws BioException { String ourURL = dbURL; if (ourURL.startsWith("jdbc:")) { ourURL = ourURL.substring(5); } int colon = ourURL.indexOf(':'); if (colon > 0) { String protocol ... | |
System.err.println("PostgreSQL"); | public BioSQLSequenceDB(String dbURL, String dbUser, String dbPass, String biodatabase, boolean create) throws BioException { String ourURL = dbURL; if (ourURL.startsWith("jdbc:")) { ourURL = ourURL.substring(5); } int colon = ourURL.indexOf(':'); if (colon > 0) { String protocol ... | |
"where bioentry.accession = ?"); | "where bioentry.accession = ? and " + " bioentry.biodatabase_id = ?"); | public Sequence getSequence(String id) throws BioException, IllegalIDException { Sequence seq = (Sequence) outstandingSequences.get(id); if (seq != null) { return seq; } try { Connection conn = pool.takeConnection(); PreparedStatement get_bioentry = conn.prepareStatement("select bioentry.bioen... |
get_bioentry.setInt(2, dbid); | public Sequence getSequence(String id) throws BioException, IllegalIDException { Sequence seq = (Sequence) outstandingSequences.get(id); if (seq != null) { return seq; } try { Connection conn = pool.takeConnection(); PreparedStatement get_bioentry = conn.prepareStatement("select bioentry.bioen... | |
if (rule==4||rule==5) | if (rule==1||rule==4||rule==5) | private void addPreppedSequence(String seq){ int i, gammaStart; int j=0; SuffixNode oldNode=null, newNode; SuffixNode currentNode; boolean canLinkJump = false; //Puts i at the end of the previous sequences i = sequences.length(); j=i; sequences= sequences.toString()+seq.toString(); curre... |
if (rule==4||rule==5){ | if (rule==1||rule==4||rule==5){ | private void addPreppedSequence(String seq){ int i, gammaStart; int j=0; SuffixNode oldNode=null, newNode; SuffixNode currentNode; boolean canLinkJump = false; //Puts i at the end of the previous sequences i = sequences.length(); j=i; sequences= sequences.toString()+seq.toString(); curre... |
seqStr=seqStr==null?null:seqStr; | public void testDavidBug() throws Exception { SymbolTokenization dnaToke1 = DNATools.getDNA().getTokenization("token"); SymbolList symbolList = new SimpleSymbolList(dnaToke1, "ACTGGACCTAAGG"); Sequence sequence = new SimpleSequence(symbolList, "test", "test", null); SimpleGappedSequence gappedSequence = ... | |
if(assertion) { if(!isSane()) { throw new AssertionError("Data corrupted: " + blocks); } } | public void removeGap(int pos) throws IndexOutOfBoundsException, IllegalSymbolException { if(pos < 1 || pos > length()) { throw new IndexOutOfBoundsException( "Attempted to remove gap outside of this sequence (1.." + length() + ") at " + pos ); } int i = findViewGap(pos); if(i == -2) { ... | |
int gap = r.viewStart - l.viewEnd; if(gap < length) { throw new IllegalSymbolException( "Removing " + length + " gaps from + " + i + " but there are only " + gap + " gaps there: " + blocks); } | public void removeGaps(int pos, int length) throws IndexOutOfBoundsException, IllegalSymbolException { int end = pos + length - 1; if( pos < 1 || length < 1 || end > length() ) { throw new IndexOutOfBoundsException( "Attempted to remove gap outside of this sequence (1.." + length(... | |
int gap = r.viewStart - l.viewEnd; | public void removeGaps(int pos, int length) throws IndexOutOfBoundsException, IllegalSymbolException { int end = pos + length - 1; if( pos < 1 || length < 1 || end > length() ) { throw new IndexOutOfBoundsException( "Attempted to remove gap outside of this sequence (1.." + length(... | |
if(assertion) { if(!isSane()) { throw new AssertionError("Data corrupted: removeGaps(" + pos + "," + length + ") " + blocks); } } | public void removeGaps(int pos, int length) throws IndexOutOfBoundsException, IllegalSymbolException { int end = pos + length - 1; if( pos < 1 || length < 1 || end > length() ) { throw new IndexOutOfBoundsException( "Attempted to remove gap outside of this sequence (1.." + length(... | |
return new SymbolListCharSequence(syms.subList(start + 1, end + 1), | return new SymbolListCharSequence(syms.subList(start + 1, end), | public CharSequence subSequence(int start, int end) { return new SymbolListCharSequence(syms.subList(start + 1, end + 1), alphaTokens); } |
catch (BioException bex) | catch (BioException be) | public void writeSequence(Sequence seq, PrintStream os) throws IOException { String defaultFormat = getDefaultFormat(); try { SeqFileFormer former = SeqFileFormerFactory.makeFormer(defaultFormat); former.setPrintStream(os); SeqIOEventEmitter.getSeqIOEvents(seq, former); } catch (BioException bex) { ... |
throw new IOException(bex.getMessage()); | throw new IOException(be.getMessage()); | public void writeSequence(Sequence seq, PrintStream os) throws IOException { String defaultFormat = getDefaultFormat(); try { SeqFileFormer former = SeqFileFormerFactory.makeFormer(defaultFormat); former.setPrintStream(os); SeqIOEventEmitter.getSeqIOEvents(seq, former); } catch (BioException bex) { ... |
while (tileStart < length()) { | while (tileStart <= length()) { | protected SymbolList getSymbols() throws BioException { SymbolList sl = null; if (refSymbols != null) { sl = (SymbolList) refSymbols.get(); } if (sl == null) { FeatureHolder structure = getStructure(); if (structure.countFeatures() == 0) { if (length() > SYMBOL_TILE_THRESHOLD) { AssembledSy... |
if ((length() - tileEnd) < 1000) { tileEnd = length(); } | protected SymbolList getSymbols() throws BioException { SymbolList sl = null; if (refSymbols != null) { sl = (SymbolList) refSymbols.get(); } if (sl == null) { FeatureHolder structure = getStructure(); if (structure.countFeatures() == 0) { if (length() > SYMBOL_TILE_THRESHOLD) { AssembledSy... | |
i = i==null?null:i; | public void testIllegalIDFetch() throws BioException { try { Index i = emblCDIndexStore.fetch("xxxxx"); } catch (IllegalIDException iie) { return; } fail("Expected IllegalIDException"); } | |
seqIDs.add(st.sval.intern()); | if(! st.sval.startsWith("Length")) seqIDs.add(st.sval.intern()); | public Meme(InputStream is, SymbolTokenization symParser) throws IOException, IllegalSymbolException, IllegalAlphabetException { StreamTokenizer st = new StreamTokenizer( new BufferedReader(new InputStreamReader(is))); st.eolIsSignificant(true); st.wordChars('*', '*'); st.parseNumbers(); S... |
if(st.sval.startsWith("log")) { | if(st.sval.startsWith("letter")) { | public Meme(InputStream is, SymbolTokenization symParser) throws IOException, IllegalSymbolException, IllegalAlphabetException { StreamTokenizer st = new StreamTokenizer( new BufferedReader(new InputStreamReader(is))); st.eolIsSignificant(true); st.wordChars('*', '*'); st.parseNumbers(); S... |
DistributionTrainer dt = new SimpleDistributionTrainer(d); | public static void main(String[] args) { try{ File infile = new File(args[0]); Integer order = new Integer(args[1]); Double threshold = new Double(1.0 / Math.pow(4.0,(double)order.intValue())); FiniteAlphabet dna = DNATools.getDNA(); SequenceDB seqs = readSequenceDB(infile,dna); ... | |
try{ dt.addCount(context,(AtomicSymbol)nmer,1.0); }catch(ClassCastException cce){ continue; } | context.addCount(d,(AtomicSymbol)nmer,1.0); | public static void main(String[] args) { try{ File infile = new File(args[0]); Integer order = new Integer(args[1]); Double threshold = new Double(1.0 / Math.pow(4.0,(double)order.intValue())); FiniteAlphabet dna = DNATools.getDNA(); SequenceDB seqs = readSequenceDB(infile,dna); ... |
if (seqVersion==null) this.seqVersion=Persistent.NULL_DOUBLE; | if (seqVersion==null) this.seqVersion=0.0; | public void setSeqVersion(String seqVersion) throws ParseException { if (this.seqVersionSeen) throw new ParseException("Current BioEntry already has a sequence version"); if (seqVersion==null) this.seqVersion=Persistent.NULL_DOUBLE; else { try { this.seqVersion = Doubl... |
public SimpleDotState(char symbol, String name, Annotation annotation) { super(name, symbol, annotation); | public SimpleDotState(char token, String name, Annotation annotation) { super(name, annotation); | public SimpleDotState(char symbol, String name, Annotation annotation) { super(name, symbol, annotation); } |
public boolean contains(Object o) { if (! (o instanceof String)) return false; return seqSet.contains((String) o); } | public boolean contains(Object o) { if (! (o instanceof String)) { return false; } else { return seqSet.contains((String) o); } } | public Set ids() { return new AbstractSet() { public int size() { return seqSet.size(); } public Iterator iterator() { return seqSet.nameIterator(); } public boolean contains(Object o) { if (! (o instanceof String)) return false; return seqSet.contains((String) o); } }; } |
if (! (o instanceof String)) return false; return seqSet.contains((String) o); } | if (! (o instanceof String)) { return false; } else { return seqSet.contains((String) o); } } | public boolean contains(Object o) { if (! (o instanceof String)) return false; return seqSet.contains((String) o); } |
String date = ((String[])section.get(0))[1].trim().substring(0,11); | String value = ((String[])section.get(0))[1]; rlistener.addSequenceProperty(Terms.getDatesTerm(), value); String date = value.substring(0,11); | public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; boolea... |
target_id = attrs.getValue("ref"); | target_id = attrs.getValue("id"); if (target_id == null) { target_id = attrs.getValue("ref"); } | public void startElement(String nsURI, String localName, String qName, Attributes attrs, DelegationManager dm) throws SAXException { if ("GROUP".equals(localName)) { gid = attrs.getValue("id"); } else if ("NOTE".equals(localName)) { dm.delegate(new StringElementHandlerBase() { protec... |
location = new Location.EmptyLocation(); | public Template() { super(); regions = new ArrayList(); resolver = null; } | |
System.out.println("Input class list: " + classList); System.out.println("Output class list: " + this.classList); System.out.println("indx: " + indx); System.out.println("Method: " + method); | public FollowMethod(Method method, ClassList classList) { this.method = method; Class methodClass = method.getDeclaringClass(); Class[] paramTypes = method.getParameterTypes(); Class returnType = method.getReturnType(); this.indx = classList.size() - paramTypes.length; ... | |
for(int i = 0; i < classList.size(); i++) { | for(int i = 0; i < params.length; i++) { | public Queryable follow(Object item) throws OperationException { Tuple tup = (Tuple) item; Object[] params = new Object[method.getParameterTypes().length]; for(int i = 0; i < classList.size(); i++) { params[i] = tup.getObject(i+indx); } Object val; try { val = me... |
"\n\non tuple " + tup); | "\n\ton tuple " + tup + "\n\twith index " + indx); | public Queryable follow(Object item) throws OperationException { Tuple tup = (Tuple) item; Object[] params = new Object[method.getParameterTypes().length]; for(int i = 0; i < classList.size(); i++) { params[i] = tup.getObject(i+indx); } Object val; try { val = me... |
values[i] = (i == indx) ? follow.getOutputClass() : o; | values[i] = (i == indx) ? o : tup.getObject(i); | public Queryable follow(Object item) throws OperationException { Tuple tup = (Tuple) item; Queryable res = follow.follow(tup.getObject(indx)); Set items = new HashSet(); for(Iterator ri = res.iterator(); ri.hasNext(); ) { Object o = ri.next(); Object [] values = new Object... |
if(items.length != classList.size()) { throw new IllegalArgumentException( "Items and classList must be the same length: " + items.length + ":" + classList.size() ); } for(int i = 0; i < items.length; i++) { if(!classList.getClass(i).isInstance(items[i])) { throw new IllegalArgumentException( "Item " + i + " is not of ... | public SimpleTuple(Object[] items, Tuple.ClassList classList) { this.items = items; this.classList = classList; } | |
public PermutedTuple(Tuple source, int[] order) { | public PermutedTuple(Tuple source, int[] order) throws IllegalArgumentException { int size = source.getClassList().size(); for(int i = 0; i < order.length; i++) { if(order[i] >= size) { throw new IllegalArgumentException("Can't create perumutation: " + i + ":" + order[i] + " >= " + size); } } | public PermutedTuple(Tuple source, int[] order) { this.source = source; this.order = order; classList = new Tuple.ClassList() { public Class getClass(int indx) { return PermutedTuple.this.source.getClassList().getClass( PermutedTuple.this.order[indx] ); } public in... |
private void setEnd(int e) { this.e = e; } | void setEnd(int e) { this.e = e; } | private void setEnd(int e) { this.e = e; } |
private void setFuzzyEnd(boolean fe) { this.fe = fe; } | void setFuzzyEnd(boolean fe) { this.fe = fe; } | private void setFuzzyEnd(boolean fe) { this.fe = fe; } |
private void setFuzzyStart(boolean fs) { this.fs = fs; } | void setFuzzyStart(boolean fs) { this.fs = fs; } | private void setFuzzyStart(boolean fs) { this.fs = fs; } |
private void setStart(int s) { this.s = s; } | void setStart(int s) { this.s = s; } | private void setStart(int s) { this.s = s; } |
private void setType(String t) { this.t = t; } | void setType(String t) { this.t = t; } | private void setType(String t) { this.t = t; } |
System.out.println("oldNodes: " + oldNodes); System.out.println("newNode: " + newNode); | private void replaceNode(Set oldNodes, Node newNode) { System.out.println("oldNodes: " + oldNodes); System.out.println("newNode: " + newNode); // prepare to replace entire contents of transitions Transition [] transitionArray = new Transition[transitions.size()]; // loop thru'... | |
System.out.println(currTransition); | private void replaceNode(Set oldNodes, Node newNode) { System.out.println("oldNodes: " + oldNodes); System.out.println("newNode: " + newNode); // prepare to replace entire contents of transitions Transition [] transitionArray = new Transition[transitions.size()]; // loop thru'... | |
System.out.println("j is " + j); | private void replaceNode(Set oldNodes, Node newNode) { System.out.println("oldNodes: " + oldNodes); System.out.println("newNode: " + newNode); // prepare to replace entire contents of transitions Transition [] transitionArray = new Transition[transitions.size()]; // loop thru'... | |
System.out.println("removing oldNodes"); | private void replaceNode(Set oldNodes, Node newNode) { System.out.println("oldNodes: " + oldNodes); System.out.println("newNode: " + newNode); // prepare to replace entire contents of transitions Transition [] transitionArray = new Transition[transitions.size()]; // loop thru'... | |
cft.componentSequence = null; | public Feature projectFeature(Feature f) { if (f instanceof ComponentFeature && getParent() instanceof DistributedSequence) { ComponentFeature pcf = (ComponentFeature) componentFeatureCache.get(f); if (pcf == null) { ComponentFeature.Template cft = (ComponentFeature.Template... | |
cft.componentSequence = null; | public Feature projectFeature(Feature f) { if (f instanceof ComponentFeature && getParent() instanceof DistributedSequence) { ComponentFeature pcf = (ComponentFeature) componentFeatureCache.get(f); if (pcf == null) { ComponentFeature.Template cft = (ComponentFeature.Template... | |
if(!op.getInputClass().isAssignableFrom(arc.from.getOutputClass())) { throw new OperationException("Can't assign " + arc.from.getOutputClass() + " to " + op.getInputClass()); | if( !QueryTools.convertPrimatives(op.getInputClass()) .isAssignableFrom(QueryTools.convertPrimatives(arc.from.getOutputClass())) ) { throw new OperationException( "Invalid operation input: can't assign " + arc.from.getOutputClass() + " to " + op.getInputClass() + " in " + arc.from + " -> " + arc.to + " for operator " +... | public void addArc(Arc arc, Operation op) throws OperationException { if(!op.getInputClass().isAssignableFrom(arc.from.getOutputClass())) { throw new OperationException("Can't assign " + arc.from.getOutputClass() + " to " + op.getInputClass()); } if(!op.getOutputClass().isAssignableFrom(arc.to.get... |
if(!op.getOutputClass().isAssignableFrom(arc.to.getInputClass())) { throw new OperationException("Can't assign " + op.getOutputClass() + " to " + arc.to.getInputClass()); | if( !QueryTools.convertPrimatives(arc.to.getInputClass()) .isAssignableFrom(QueryTools.convertPrimatives(op.getOutputClass())) ) { throw new OperationException( "Invalid operation output: can't assign " + op.getOutputClass() + " to " + arc.to.getInputClass() + " in " + arc.from + " -> " + arc.to + " for operator " + op... | public void addArc(Arc arc, Operation op) throws OperationException { if(!op.getInputClass().isAssignableFrom(arc.from.getOutputClass())) { throw new OperationException("Can't assign " + arc.from.getOutputClass() + " to " + op.getInputClass()); } if(!op.getOutputClass().isAssignableFrom(arc.to.get... |
Operation op = (Operation) arcOp.getValue(); | Set opSet = (Set) arcOp.getValue(); | public void addQuery(Query query) { for( Iterator i = query.getArcsToOperators().entrySet().iterator(); i.hasNext(); ) { Map.Entry arcOp = (Map.Entry) i.next(); Arc arc = (Arc) arcOp.getKey(); Operation op = (Operation) arcOp.getValue(); try { addArc(arc, op); } catch (... |
addArc(arc, op); | for(Iterator oi = opSet.iterator(); oi.hasNext(); ) { Operation op = (Operation) oi.next(); addArc(arc, op); } | public void addQuery(Query query) { for( Iterator i = query.getArcsToOperators().entrySet().iterator(); i.hasNext(); ) { Map.Entry arcOp = (Map.Entry) i.next(); Arc arc = (Arc) arcOp.getKey(); Operation op = (Operation) arcOp.getValue(); try { addArc(arc, op); } catch (... |
for(Iterator i = getArcsFrom(node).iterator(); i.hasNext(); ) { | for(Iterator i = new HashSet(getArcsFrom(node)).iterator(); i.hasNext(); ) { Arc arc = (Arc) i.next(); removeArc(arc); } for(Iterator i = new HashSet(getArcsTo(node)).iterator(); i.hasNext(); ) { | public void removeNode(Node node) { nodes.remove(node); for(Iterator i = getArcsFrom(node).iterator(); i.hasNext(); ) { Arc arc = (Arc) i.next(); removeArc(arc); } } |
if(canonicallize(parent) == null) { throw new IllegalArgumentException("Parent taxa not owned by this TaxaFactory"); } WeakTaxa sparent = (WeakTaxa) parent; | WeakTaxa sparent = (WeakTaxa) importTaxa(parent); | public Taxa addChild(Taxa parent, Taxa child) { if(canonicallize(parent) == null) { throw new IllegalArgumentException("Parent taxa not owned by this TaxaFactory"); } WeakTaxa sparent = (WeakTaxa) parent; WeakTaxa schild = (WeakTaxa) importTaxa(child); Set children = sparent.getChildrenRaw... |
return getFeatures().filter(ff, recurse); } | if (recurse) { MergeFeatureHolder results = new MergeFeatureHolder(); try { results.addFeatureHolder(getFeatures().filter(new FeatureFilter.And(new FeatureFilter.Not(new FeatureFilter.ByAncestor(new FeatureFilter.ByClass(ComponentFeature.class))), ff), recurse)); if (components == null) { components = getFeatures().fil... | public FeatureHolder filter(FeatureFilter ff, boolean recurse) { return getFeatures().filter(ff, recurse); } |
StreamParser sparser = parser.parseStream(listener); | StreamParser sparser = null; if(! this.getElideSymbols()){ sparser = parser.parseStream(listener); } | private boolean readSequenceData( BufferedReader r, SymbolTokenization parser, SeqIOListener listener ) throws IOException, IllegalSymbolException { char[] cache = new char[512]; boolean reachedEnd = false, seenEOF = false; Strea... |
sparser.close(); | if(sparser != null) sparser.close(); | private boolean readSequenceData( BufferedReader r, SymbolTokenization parser, SeqIOListener listener ) throws IOException, IllegalSymbolException { char[] cache = new char[512]; boolean reachedEnd = false, seenEOF = false; Strea... |
for(int i = 0; i < dsi; i++) { | if(sym == AlphabetManager.getGapSymbol()) { em[0] = 0; } else { em[0] = Double.NEGATIVE_INFINITY; } for(int i = 1; i < dsi; i++) { | public double [] getEmission(Symbol sym, ScoreType scoreType) throws IllegalSymbolException { Map emissions; if(scoreType == ScoreType.PROBABILITY) { emissions = emissionsProb; } else if(scoreType == ScoreType.ODDS) { emissions = emissionsOdds; } else if(scoreType == ScoreType.NULL_MODEL) { ... |
} | } else { } | private int examineExample(int i2) { double y2 = target[i2]; double alpha2 = model.getAlpha(i2) / y2; double E2 = getError(i2); double r2 = E2 * y2; if ((r2 < -epsilon && alpha2 < C) || (r2 > epsilon && alpha2 > 0)) { int secondChoice = -1; double step = 0.0; for (int l = 0; l < model.size(); ++l) { if... |
return model.internalClassify(i) - target[i]; | double alpha = model.getAlpha(i) / target[i]; if (isBound(alpha)) { return E[i] = model.internalClassify(i) - target[i]; } return E[i]; | private double getError(int i) { // double alpha = model.getAlpha(i) / target[i]; // if (alpha==0 || alpha==C) return model.internalClassify(i) - target[i]; // return E[i]; // if (E[i] == Double.NEGATIVE_INFINITY || // isBound(model.getAlpha(i) * target[i])) // E[i] = model.internalClassi... |
if (L == H) return false; | if (L == H) { return false; } | private boolean takeStep(int i1, int i2) { // System.out.print("+"); if (i1 == i2) return false; double alpha1 = model.getAlpha(i1) / target[i1]; double alpha2 = model.getAlpha(i2) / target[i2]; double y1 = target[i1]; double y2 = target[i2]; double E1 = getError(i1); double E2 = getError(i2); double s = y1 * y... |
if (eta > 0 && eta < epsilon) { eta = 0.0; } | private boolean takeStep(int i1, int i2) { // System.out.print("+"); if (i1 == i2) return false; double alpha1 = model.getAlpha(i1) / target[i1]; double alpha2 = model.getAlpha(i2) / target[i2]; double y1 = target[i1]; double y2 = target[i2]; double E1 = getError(i1); double E2 = getError(i2); double s = y1 * y... | |
System.out.println("Positive eta!"); | private boolean takeStep(int i1, int i2) { // System.out.print("+"); if (i1 == i2) return false; double alpha1 = model.getAlpha(i1) / target[i1]; double alpha2 = model.getAlpha(i2) / target[i2]; double y1 = target[i1]; double y2 = target[i2]; double E1 = getError(i1); double E2 = getError(i2); double s = y1 * y... | |
if (Math.abs(a1 - alpha1) < epsilon * (a1 + alpha1+1 +epsilon)) return false; | if (Math.abs(a1 - alpha1) < epsilon * (a1 + alpha1+1 +epsilon)) { return false; } | private boolean takeStep(int i1, int i2) { // System.out.print("+"); if (i1 == i2) return false; double alpha1 = model.getAlpha(i1) / target[i1]; double alpha2 = model.getAlpha(i2) / target[i2]; double y1 = target[i1]; double y2 = target[i2]; double E1 = getError(i1); double E2 = getError(i2); double s = y1 * y... |
E[i1] = 0; E[i2] = 0; for (int l = 0; l < E.length; ++l) { if (l==i1 || l==i2) | E[i1] = model.internalClassify(i1) - target[i1]; E[i2] = model.internalClassify(i2) - target[i2]; for (int l = 0; l < E.length; ++l) { if (l==i1 || l==i2) { | private boolean takeStep(int i1, int i2) { // System.out.print("+"); if (i1 == i2) return false; double alpha1 = model.getAlpha(i1) / target[i1]; double alpha2 = model.getAlpha(i2) / target[i2]; double y1 = target[i1]; double y2 = target[i2]; double E1 = getError(i1); double E2 = getError(i2); double s = y1 * y... |
if (!(isBound(model.getAlpha(l)))) { E[l] += y1*(a1-alpha1)*model.getKernelValue(i1, l) + y2*(a2-alpha2)*model.getKernelValue(i2, l) + bOLD - b; } } model.setAlpha(i1, a1*y1); model.setAlpha(i2, a2*y2); | } if (!(isBound(model.getAlpha(l)))) { E[l] += y1*(a1-alpha1)*model.getKernelValue(i1, l) + y2*(a2-alpha2)*model.getKernelValue(i2, l) + bOLD - b; } } | private boolean takeStep(int i1, int i2) { // System.out.print("+"); if (i1 == i2) return false; double alpha1 = model.getAlpha(i1) / target[i1]; double alpha2 = model.getAlpha(i2) / target[i2]; double y1 = target[i1]; double y2 = target[i2]; double E1 = getError(i1); double E2 = getError(i2); double s = y1 * y... |
for (int i = 0; i < t.length; ++i) E[i] = -t[i]; | for (int i = 0; i < model.size(); ++i) { E[i] = model.internalClassify(i) - t[i]; } | public synchronized void trainModel(SVMModel m, double[] t, TrainingListener l) { model = m; target = t; kernel = m.getKernel(); listener = l; ourEvent = new TrainingEvent(this); cycle = 0; E = new double[model.size()]; for (int i = 0; i < t.length; ++i) E[i] = -t[i]; int numChanged = 0; boolean examin... |
double target = getTarget(i); | public double getError(int i) { double target = getTarget(i); double alpha = getAlpha(i); if (isBound(alpha)) { return E[i] = getModel().classify(getItem(i)) - getTarget(i); } return E[i]; } | |
String url = baseurl+db+"&id="+id; | String url = baseurl+db+"&id="+id+"&rettype=gb"; | protected URL getAddress (String id) throws MalformedURLException { String defaultReturnFormat="text"; FetchURL seqURL = new FetchURL(DBName, defaultReturnFormat); String baseurl = seqURL.getbaseURL(); String db = seqURL.getDB(); //String returnFormat = seqURL.getReturnFormat(); String url = baseurl+db+"&id="+id; ... |
public Sequence getSequence(String id) throws Exception { try { IOExceptionFound=false; ExceptionFound=false; URL queryURL = getAddress(id); SequenceFormat sFormat = getSequenceFormat(); SequenceBuilder sbuilder = new SimpleSequenceBuilder(); SequenceBuilderFactory sFact=new GenbankProcessor.Factory(SimpleSequenceBuil... | public Sequence getSequence(String id) throws Exception { try { IOExceptionFound = false; ExceptionFound = false; URL queryURL = getAddress(id); SequenceFormat sFormat = getSequenceFormat(); SequenceBuilder sbuilder = new SimpleSequenceBuilder(); SequenceBuilderFactory sFact = new GenbankProcessor.Factory( SimpleSeq... | public Sequence getSequence(String id) throws Exception { try { IOExceptionFound=false; ExceptionFound=false; URL queryURL = getAddress(id);//get URL based on ID // System.err.println("query is "+ queryURL.toString()); SequenceFormat sFormat = getSequenceFormat();//get incoming sequence format ... |
for (Iterator i = list.iterator(); i.hasNext();) { | boolean b = true; for (Iterator i = list.iterator(); b;) { | private String makeBatchRequest(URL url, Set list) { StringBuffer params = new StringBuffer(); params.append("db=nucleotide&rettype=gb&id="); for (Iterator i = list.iterator(); i.hasNext();) { String idSequence = (String) i.next(); params.append(idSequence); params.append(","); } StringB... |
params.append(","); | if(i.hasNext()){ params.append(","); }else{ b =false; } | private String makeBatchRequest(URL url, Set list) { StringBuffer params = new StringBuffer(); params.append("db=nucleotide&rettype=gb&id="); for (Iterator i = list.iterator(); i.hasNext();) { String idSequence = (String) i.next(); params.append(idSequence); params.append(","); } StringB... |
ann = new SmallAnnotation(); sym = createSymbol(ann); | Annotation initialAnno = new SmallAnnotation(); sym = createSymbol(initialAnno); ann = sym.getAnnotation(); | protected void setUp() throws Exception { ann = new SmallAnnotation(); sym = createSymbol(ann); } |
int count = 1; | public void addSequenceProperty(Object key, Object value) throws ParseException { if (key.equals("LOCUS")) { idb.setLength(0); idb.append("LOCUS " + (String) value); } else if (key.equals("TYPE")) { typeb.append(value); } else if (k... | |
FeatureFilter.IsTopLevel.class, | FeatureFilter.top_level, | public XMLFilterWriterConfig() { try { filterWritersByClass.put( FeatureFilter.all, new BlankFilterWriter(XML_FILTER_NS, "all") ); filterWritersByClass.put( FeatureFilter.none, new BlankFilterWriter(XML_FILTER_NS, "n... |
subSeqBox.setRect(seqBox.getX(), seqBox.getY() + offset, | subSeqBox.setRect(seqBox.getX(), seqBox.getY(), | public void paint(Graphics2D g, SequenceRenderContext ctx, Rectangle2D seqBox) { double offset = 0.0; Rectangle2D subSeqBox = new Rectangle2D.Double(); for (Iterator i = renderList.iterator(); i.hasNext(); ) { LabelAndRenderer lar = (LabelAndRenderer) i.next(); SequenceRenderContext subctx ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.