rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
Iterator giter = groups.iterator(); while (giter.hasNext()){ Group g = (Group) giter.next(); String rnum = g.getPDBCode(); if (rnum.equals(pdbResnum)) return g; } throw new StructureException("could not find group " + pdbResnum + " in chain " + chainId); } if ( ! foundChain) throw new StructureException("could not f... | if (rnum.equals(pdbResnum)) return g; } | public Group findGroup(String chainId, String pdbResnum, int modelnr) throws StructureException { // if structure is xray there will be only one "model". if ( modelnr > models.size()) throw new StructureException(" no model nr " + modelnr + " in this structu... |
String resseq = alignRight(""+pdbcode,4); | String resseq = "" ; if ( hasInsertionCode(pdbcode) ) resseq = alignRight(""+pdbcode,5); else resseq = alignRight(""+pdbcode,4)+" "; | public String toPDB() { StringBuffer str = new StringBuffer(); int i = 0 ; DecimalFormat d3 = new DecimalFormat("0.000"); DecimalFormat d2 = new DecimalFormat("0.00"); // do for all models int nrModels = structure.nrModels() ; if ( structure.isNmr()) { str.append("EXPDTA NMR, "+ nrModels+" STRUCTURES\n") ;... |
if ( current_atom_pos < group.size()-1 ) { return true ; } else { if (groupiter != null) { GroupIterator tmp = (GroupIterator) groupiter.clone() ; while (tmp.hasNext()) { Group tmpg = (Group) tmp.next() ; if ( tmpg.size() > 0 ) { return true ; } } } else { return false ; } } return false ; | if ( group == null) return false; if ( current_atom_pos < group.size()-1 ) { return true ; } else { if (groupiter != null) { GroupIterator tmp = (GroupIterator) groupiter.clone() ; while (tmp.hasNext()) { Group tmpg = (Group) tmp.next() ; if ( tmpg.size() > 0 ) { return true ; } } } else { return false ; } } retu... | public boolean hasNext() { // if there is another group ... if ( current_atom_pos < group.size()-1 ) { return true ; } else { // search through the next groups if they contain an atom if (groupiter != null) { GroupIterator tmp = (GroupIterator) groupiter.clone() ; while (tmp.hasNext()) { G... |
simCombiFilter), false); | spf), false); | public void paint(final Graphics2D g2, final PairwiseRenderContext context) { FeatureHolder fh; if (context.getDirection() == context.HORIZONTAL) { fh = context.getFeatures().filter(new FeatureFilter.And(new FeatureFilter.OverlapsLocation(context.getRange()), ... |
RangeLocation(priMin, priMax)), simCombiFilter), false); | RangeLocation(priMin, priMax)), spf), false); | public SequenceViewerEvent processMouseEvent(final PairwiseRenderContext context, final MouseEvent me, final List path) { path.add(this); double gPos; if (context.getDi... |
PreparedStatement delete_locs = conn.prepareStatement("delete from seqfeature_location " + " where seqfeature_location.seqfeature_id = seqfeature.seqfeature_id and " + " seqfeature.bioentry_id = ?"); | DBHelper.DeleteStyle dstyle = getDBHelper().getDeleteStyle(); PreparedStatement delete_locs; if (dstyle == DBHelper.DELETE_POSTGRESQL) { delete_locs = conn.prepareStatement("delete from seqfeature_location " + " where seqfeature_location.seqfeature_id = seqfeature.seqfeature_id and " + " seqfeature.bioentry_id ... | private void _removeSequence(String id) throws BioException, IllegalIDException, ChangeVetoException { Sequence seq = (Sequence) outstandingSequences.get(id); if (seq != null) { seq = null; // Don't want to be holding the reference ourselves! try { Thread.sleep(100L); System.gc(); } catch (... |
PreparedStatement delete_fqv = conn.prepareStatement("delete from seqfeature_qualifier_value " + " where seqfeature_qualifier_value.seqfeature_id = seqfeature.seqfeature_id " + " and seqfeature.bioentry_id = ?"); | PreparedStatement delete_fqv; if (dstyle == DBHelper.DELETE_POSTGRESQL) { delete_fqv = conn.prepareStatement("delete from seqfeature_qualifier_value " + " where seqfeature_qualifier_value.seqfeature_id = seqfeature.seqfeature_id " + " and seqfeature.bioentry_id = ?"); } else { delete_fqv = conn.prepareStatement("del... | private void _removeSequence(String id) throws BioException, IllegalIDException, ChangeVetoException { Sequence seq = (Sequence) outstandingSequences.get(id); if (seq != null) { seq = null; // Don't want to be holding the reference ourselves! try { Thread.sleep(100L); System.gc(); } catch (... |
PreparedStatement delete_rel = conn.prepareStatement("delete from seqfeature_relationship " + " where parent_seqfeature_id = seqfeature.seqfeature_id " + " and seqfeature.bioentry_id = ?"); | PreparedStatement delete_rel; if (dstyle == DBHelper.DELETE_POSTGRESQL) { delete_rel = conn.prepareStatement("delete from seqfeature_relationship " + " where parent_seqfeature_id = seqfeature.seqfeature_id " + " and seqfeature.bioentry_id = ?"); } else { delete_rel = conn.prepareStatement("delete from seqfeature_rel... | private void _removeSequence(String id) throws BioException, IllegalIDException, ChangeVetoException { Sequence seq = (Sequence) outstandingSequences.get(id); if (seq != null) { seq = null; // Don't want to be holding the reference ourselves! try { Thread.sleep(100L); System.gc(); } catch (... |
if (this.getClass().getName().equals("org.biojava.bio.program.ssbind.SSBindCase")) return; | protected void setBotHitValues(double score, String id, int qStart, int qEnd, Strand qStrand, int sStart, int sEnd, Strand sStrand) { botHitScore = score; botHitSeqID = id; botHitQStart = qStart; botHitQEnd = ... | |
if (this.getClass().getName().equals("org.biojava.bio.program.ssbind.SSBindCase")) return; | protected void setTopHitValues(double score, String id, int qStart, int qEnd, Strand qStrand, int sStart, int sEnd, Strand sStrand) { topHitScore = score; topHitSeqID = id; topHitQStart = qStart; topHitQEnd = ... | |
if (this.getClass().getName().equals("org.biojava.bio.program.ssbind.SSBindCase")) return; | protected void setUp() throws Exception { queryDB = new DummySequenceDB("query"); dbInstallation = new DummySequenceDBInstallation(); searchResults = new ArrayList(); // Set builder to build into a List BlastLikeSearchBuilder builder = new BlastLikeSearchBuil... | |
if (this.getClass().getName().equals("org.biojava.bio.program.ssbind.SSBindCase")) return; | protected void tearDown() throws Exception { searchStream.close(); searchStream = null; queryDB = null; dbInstallation = null; adapter = null; searchResults = null; topHitSeqID = null; botHitSeqID = null; } | |
if (this.getClass().getName().equals("org.biojava.bio.program.ssbind.SSBindCase")) return; | public void testBotHit() { SeqSimilaritySearchResult result = (SeqSimilaritySearchResult) searchResults.get(0); List hits = result.getHits(); SeqSimilaritySearchHit hit = (SeqSimilaritySearchHit) hits.get(hits.size() - 1); assertEquals(botHitScore, hit.getScore()... | |
if (this.getClass().getName().equals("org.biojava.bio.program.ssbind.SSBindCase")) return; | public void testResultCount() { assertEquals(1, searchResults.size()); } | |
if (this.getClass().getName().equals("org.biojava.bio.program.ssbind.SSBindCase")) return; | public void testResultGetAnnotation() { SeqSimilaritySearchResult result = (SeqSimilaritySearchResult) searchResults.get(0); assertEquals(4, result.getAnnotation().keys().size()); } | |
if (this.getClass().getName().equals("org.biojava.bio.program.ssbind.SSBindCase")) return; | public void testResultGetQuerySequence() throws Exception { SeqSimilaritySearchResult result = (SeqSimilaritySearchResult) searchResults.get(0); assertEquals(queryDB.getSequence(""), result.getQuerySequence()); } | |
if (this.getClass().getName().equals("org.biojava.bio.program.ssbind.SSBindCase")) return; | public void testResultGetSequenceDB() { SeqSimilaritySearchResult result = (SeqSimilaritySearchResult) searchResults.get(0); assertEquals(dbInstallation.getSequenceDB(""), result.getSequenceDB()); } | |
if (this.getClass().getName().equals("org.biojava.bio.program.ssbind.SSBindCase")) return; | public void testTopHit() { SeqSimilaritySearchResult result = (SeqSimilaritySearchResult) searchResults.get(0); SeqSimilaritySearchHit hit = (SeqSimilaritySearchHit) result.getHits().get(0); assertEquals(topHitScore, hit.getScore(), 0.0); assertEquals(topHitSeqID... | |
nameToResidue.put(res.getName(), res); | nameToResidue.put(res.getName().toLowerCase(), res); | public NameParser(FiniteAlphabet alpha) { this.alphabet = alpha; for(Iterator i = alpha.iterator(); i.hasNext(); ) { Residue res = (Residue) i.next(); nameToResidue.put(res.getName(), res); } } |
Residue res = (Residue) nameToResidue.get(token); | Residue res = (Residue) nameToResidue.get(token.toLowerCase()); | public Residue parseToken(String token) throws IllegalResidueException { Residue res = (Residue) nameToResidue.get(token); if(res == null) { throw new IllegalResidueException( "No residue for token '" + token + "' found in name parser for " + alphabet().getName() ); } return res;... |
System.out.print("Forward... "); | protected double singleSequenceIteration( ModelTrainer trainer, SymbolList symList ) throws IllegalSymbolException, IllegalTransitionException, IllegalAlphabetException { ScoreType scoreType = ScoreType.PROBABILITY; SingleDP dp = (SingleDP) getDP(); State [] states = dp.getStates(); int [][] forwar... | |
System.out.println("Score = " + fs); | protected double singleSequenceIteration( ModelTrainer trainer, SymbolList symList ) throws IllegalSymbolException, IllegalTransitionException, IllegalAlphabetException { ScoreType scoreType = ScoreType.PROBABILITY; SingleDP dp = (SingleDP) getDP(); State [] states = dp.getStates(); int [][] forwar... | |
System.out.print("Backward... "); | protected double singleSequenceIteration( ModelTrainer trainer, SymbolList symList ) throws IllegalSymbolException, IllegalTransitionException, IllegalAlphabetException { ScoreType scoreType = ScoreType.PROBABILITY; SingleDP dp = (SingleDP) getDP(); State [] states = dp.getStates(); int [][] forwar... | |
System.out.println("Score = " + bs); | protected double singleSequenceIteration( ModelTrainer trainer, SymbolList symList ) throws IllegalSymbolException, IllegalTransitionException, IllegalAlphabetException { ScoreType scoreType = ScoreType.PROBABILITY; SingleDP dp = (SingleDP) getDP(); State [] states = dp.getStates(); int [][] forwar... | |
try { Map dat = new HashMap(); dat.put("location", featureBuf.substring(0)); featureTemplate.annotation.setProperty(Feature.PROPERTY_DATA_KEY, dat); } catch (ChangeVetoException cve) { throw new BioException("Unable to add location string to feature annotation: " + featureBuf); } | 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 ... | |
String tagName = e.getTagName(); | String tagName = e.getLocalName(); | public void parseDetails(Element el, Feature.Template templ) throws ParseException { Node chld = el.getFirstChild(); while (chld != null) { if (chld instanceof Element) { Element e = (Element) chld; String tagName = e.getTagName(); if (tagName.equals("prop")) { String key = e.getAttribute("key... |
private int getID() { return nodeID; } | int getID() { return nodeID; } | private int getID() { return nodeID; } |
if ((o instanceof NodeSet)) | if (!(o instanceof NodeSet)) | public boolean equals(Object o) { // only NodeSets can be compared. if ((o instanceof NodeSet)) return false; // Contents of NodeSets must be from same model. NodeSet other = (NodeSet) o; if (parent() != other.parent()) ... |
sum += hashCode(); | sum += setI.next().hashCode(); | public int hashCode() { int sum = 0; for (Iterator setI = iterator(); setI.hasNext(); ) { sum += hashCode(); } return sum; } |
public SimpleDocRef(Set authors, String location) { | public SimpleDocRef(List authors, String location) { | public SimpleDocRef(Set authors, String location) { if (authors==null || authors.isEmpty()) throw new IllegalArgumentException("Authors cannot be null or empty"); if (location==null) throw new IllegalArgumentException("Location cannot be null"); this.crossref = null; this.authors = new H... |
this.authors = new HashSet(); | this.authors = new ArrayList(); | public SimpleDocRef(Set authors, String location) { if (authors==null || authors.isEmpty()) throw new IllegalArgumentException("Authors cannot be null or empty"); if (location==null) throw new IllegalArgumentException("Location cannot be null"); this.crossref = null; this.authors = new H... |
public void characters(char[] ch, int start, int end) | public void characters(char[] ch, int start, int length) | public void characters(char[] ch, int start, int end) throws SAXException { data.append(ch, start, end); } |
data.append(ch, start, end); | data.append(ch, start, length); | public void characters(char[] ch, int start, int end) throws SAXException { data.append(ch, start, end); } |
private void setAccession(String acc) { this.accession = acc; } | void setAccession(String acc) { this.accession = acc; } | private void setAccession(String acc) { this.accession = acc; } |
private void setComments(Set comments) { this.comments = comments; } | void setComments(Set comments) { this.comments = comments; } | private void setComments(Set comments) { this.comments = comments; } // must be original for Hibernate |
private void setNamespace(Namespace ns) { this.ns = ns; } | void setNamespace(Namespace ns) { this.ns = ns; } | private void setNamespace(Namespace ns) { this.ns = ns; } |
private void setRankedDocRefs(Set docrefs) { this.rankeddocrefs = docrefs; } | void setRankedDocRefs(Set docrefs) { this.rankeddocrefs = docrefs; } | private void setRankedDocRefs(Set docrefs) { this.rankeddocrefs = docrefs; } // must be original for Hibernate |
private void setRelationships(Set relationships) { this.relationships = relationships; } | void setRelationships(Set relationships) { this.relationships = relationships; } | private void setRelationships(Set relationships) { this.relationships = relationships; } // must be original for Hibernate |
private void setVersion(int v) { this.version = v; } | void setVersion(int v) { this.version = v; } | private void setVersion(int v) { this.version = v; } |
if(s instanceof BasisSymbol) { | if(s instanceof AtomicSymbol) { | private static Set expandBasis(Alphabet alpha, List symList, List built) { int indx = built.size(); if(indx < symList.size()) { Symbol s = (Symbol) symList.get(indx); if(s instanceof BasisSymbol) { built.add(s); return expandBasis(alpha, symList, built); } else { Set res = ne... |
built2.add((BasisSymbol) i.next()); | built2.add((AtomicSymbol) i.next()); | private static Set expandMatches(Alphabet parent, List symList, List built) { int indx = built.size(); if(indx < symList.size()) { BasisSymbol bs = (BasisSymbol) symList.get(indx); if(bs instanceof AtomicSymbol) { built.add(bs); return expandMatches(parent, symList, built); } else {... |
return Collections.singleton(parent.getSymbol(built)); | Symbol s = parent.getSymbol(built); if(s instanceof AtomicSymbol) { return Collections.singleton((AtomicSymbol) s); } else { Set syms = new HashSet(); for(Iterator i = ((FiniteAlphabet) s.getMatches()).iterator(); i.hasNext(); ) { syms.add((AtomicSymbol) i.next()); } return syms; } | private static Set expandMatches(Alphabet parent, List symList, List built) { int indx = built.size(); if(indx < symList.size()) { BasisSymbol bs = (BasisSymbol) symList.get(indx); if(bs instanceof AtomicSymbol) { built.add(bs); return expandMatches(parent, symList, built); } else {... |
if (contents.containsKey(paramsList)) return contents.get(paramsList); | if (contents.containsKey(ourParamsList)) return contents.get(ourParamsList); | public Object buildObject(Class clazz, List paramsList) { // put the class into the hashmap if not there already if (!objects.containsKey(clazz)) objects.put(clazz,new HashMap()); Map contents = (Map)objects.get(clazz); // return the constructed object from the hashmap if there already ... |
Class[] types = new Class[paramsList.size()]; | Class[] types = new Class[ourParamsList.size()]; | public Object buildObject(Class clazz, List paramsList) { // put the class into the hashmap if not there already if (!objects.containsKey(clazz)) objects.put(clazz,new HashMap()); Map contents = (Map)objects.get(clazz); // return the constructed object from the hashmap if there already ... |
for (int i = 0; i < paramsList.size(); i++) { if (paramsList.get(i) instanceof Set) types[i] = Set.class; else if (paramsList.get(i) instanceof List) types[i] = List.class; else types[i] = paramsList.get(i).getClass(); | for (int i = 0; i < ourParamsList.size(); i++) { if (ourParamsList.get(i) instanceof Set) types[i] = Set.class; else if (ourParamsList.get(i) instanceof Map) types[i] = Map.class; else if (ourParamsList.get(i) instanceof List) types[i] = List.class; else types[i] = ourParamsList.get(i).getClass(); | public Object buildObject(Class clazz, List paramsList) { // put the class into the hashmap if not there already if (!objects.containsKey(clazz)) objects.put(clazz,new HashMap()); Map contents = (Map)objects.get(clazz); // return the constructed object from the hashmap if there already ... |
Object o = c.newInstance(paramsList.toArray()); | Object o = c.newInstance(ourParamsList.toArray()); | public Object buildObject(Class clazz, List paramsList) { // put the class into the hashmap if not there already if (!objects.containsKey(clazz)) objects.put(clazz,new HashMap()); Map contents = (Map)objects.get(clazz); // return the constructed object from the hashmap if there already ... |
contents.put(paramsList, o); | contents.put(ourParamsList, o); | public Object buildObject(Class clazz, List paramsList) { // put the class into the hashmap if not there already if (!objects.containsKey(clazz)) objects.put(clazz,new HashMap()); Map contents = (Map)objects.get(clazz); // return the constructed object from the hashmap if there already ... |
for (int i = 0; i < paramsList.size(); i++) { if (paramsList.get(i)==null) paramsstuff.append("null"); else paramsstuff.append(paramsList.get(i).getClass()); if (i<(paramsList.size()-1)) paramsstuff.append(","); | for (int i = 0; i < ourParamsList.size(); i++) { if (i>0) paramsstuff.append(","); paramsstuff.append(ourParamsList.get(i).getClass()); | public Object buildObject(Class clazz, List paramsList) { // put the class into the hashmap if not there already if (!objects.containsKey(clazz)) objects.put(clazz,new HashMap()); Map contents = (Map)objects.get(clazz); // return the constructed object from the hashmap if there already ... |
if (!hasListeners()) { _setProperty(key, value); } else { ChangeSupport changeSupport = getChangeSupport(Annotation.PROPERTY); synchronized (changeSupport) { ChangeEvent cev = new ChangeEvent(this, Annotation.PROPERTY, key); changeSupport.firePreChangeEvent(cev); _setProperty(key, value); changeSupport.firePostChangeEv... | BioSQLChangeHub hub = seqDB.getChangeHub(); synchronized (hub) { ChangeEvent cev = new ChangeEvent(this, Annotation.PROPERTY, key); hub.fireEntryAnnotationPreChange(cev); _setProperty(key, value); hub.fireEntryAnnotationPostChange(cev); | public void setProperty(Object key, Object value) throws ChangeVetoException { if (!hasListeners()) { _setProperty(key, value); } else { ChangeSupport changeSupport = getChangeSupport(Annotation.PROPERTY); synchronized (changeSupport) { ChangeEvent cev = new ChangeE... |
} | public void setProperty(Object key, Object value) throws ChangeVetoException { if (!hasListeners()) { _setProperty(key, value); } else { ChangeSupport changeSupport = getChangeSupport(Annotation.PROPERTY); synchronized (changeSupport) { ChangeEvent cev = new ChangeE... | |
switch (c) { case 'a': case 'A': aCount++; break; case 'c': case 'C': cCount++; break; case 'g': case 'G': gCount++; break; case 't': case 'T': tCount++; break; | switch (c) { case 'a': case 'A': aCount++; break; case 'c': case 'C': cCount++; break; case 'g': case 'G': gCount++; break; case 't': case 'T': tCount++; break; default: oCount++; } } | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
default: oCount++; } } | StringBuffer sq = new StringBuffer("XX\nSQ Sequence "); sq.append(length + " BP; "); sq.append(aCount + " A; "); sq.append(cCount + " C; "); sq.append(gCount + " G; "); sq.append(tCount + " T; "); sq.append(oCount + " other;"); | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
StringBuffer sq = new StringBuffer("XX\nSQ Sequence "); sq.append(length + " BP; "); sq.append(aCount + " A; "); sq.append(cCount + " C; "); sq.append(gCount + " G; "); sq.append(tCount + " T; "); sq.append(oCount + " other;"); | stream.println(sq.toString()); | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
stream.println(sq.toString()); | int fullLine = syms.length / 60; int partLine = syms.length % 60; | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
int fullLine = syms.length / 60; int partLine = syms.length % 60; | int lineCount = fullLine; if (partLine > 0) lineCount++; | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
int lineCount = fullLine; if (partLine > 0) lineCount++; | int lineLens [] = new int [lineCount]; | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
int lineLens [] = new int [lineCount]; | Arrays.fill(lineLens, 60); lineLens[lineCount - 1] = partLine; | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
Arrays.fill(lineLens, 60); lineLens[lineCount - 1] = partLine; | for (int i = 0; i < lineLens.length; i++) { int len = lineLens[i]; | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
for (int i = 0; i < lineLens.length; i++) { int len = lineLens[i]; | StringBuffer sb = new StringBuffer(80); char [] emptyLine = new char [80]; Arrays.fill(emptyLine, ' '); sb.append(emptyLine); | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
StringBuffer sb = new StringBuffer(80); char [] emptyLine = new char [80]; Arrays.fill(emptyLine, ' '); sb.append(emptyLine); | Symbol [] sa = new Symbol [len]; | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
Symbol [] sa = new Symbol [len]; | System.arraycopy(syms, (i * 60), sa, 0, len); | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
System.arraycopy(syms, (i * 60), sa, 0, len); | String blocks = (SeqFormatTools.formatTokenBlock(sa, 10)).toString(); sb.replace(5, blocks.length() + 5, blocks); | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
String blocks = (SeqFormatTools.formatTokenBlock(sa, 10)).toString(); sb.replace(5, blocks.length() + 5, blocks); | String count = Integer.toString((i * 60) + len); sb.replace((80 - count.length()), 80, count); | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
String count = Integer.toString((i * 60) + len); sb.replace((80 - count.length()), 80, count); | stream.println(sb); } | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
stream.println(sb); } stream.println(" | stream.println(" | public void addSymbols(final Alphabet alpha, final Symbol[] syms, final int start, final int length) throws IllegalAlphabetException { int aCount = 0; int cCount = 0; int gCount = 0; int tCount = 0; int oCount = 0; for (int i = 0; i < syms.length; i++) { char c = syms[i].getToken(); ... |
this.translation = temp.location.getMin() - temp.componentLocation.getMin(); this.projectedFeatures = new ProjectedFeatureHolder(componentSequence, this, translation); | if (temp.strand == StrandedFeature.NEGATIVE) { this.translation = temp.location.getMax() - temp.componentLocation.getMin() + 1; this.projectedFeatures = new ProjectedFeatureHolder(componentSequence, this, translation, true); } else if (temp.strand == StrandedFeature.POSITIVE) { this.translation = temp.location.getMin(... | public DASComponentFeature(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."); } ... |
if (projectedFeatures == null) { projectedFeatures = new ProjectedFeatureHolder(componentSequence, this, translation); } | protected FeatureHolder getProjectedFeatures() { if (projectedFeatures == null) { projectedFeatures = new ProjectedFeatureHolder(componentSequence, this, translation); } return projectedFeatures; } | |
String s; | writeContig(Annotatable seq ) throws IOException { /** <!ELEMENT contig (db_id , view? , note? , fragment_order* , unordered_fragments? , assembly? , sequence? , sequence_map* , map_location* )> <!ATTLIST contig length NMTOKEN #REQUIRED > */ String s; mIndent.indent(... | |
if(!hasListeners()) { | if(!hasListeners(RichSequenceDB.SEQUENCES)) { | public void addRichSequence(RichSequence seq) throws IllegalIDException, BioException, ChangeVetoException { if(!hasListeners()) { this._addRichSequence(seq); } else { ChangeSupport changeSupport = getChangeSupport(RichSequenceDB.SEQUENCES); synchronized(changeSupport)... |
if(!hasListeners()) { | if(!hasListeners(RichSequenceDB.SEQUENCES)) { | public void removeRichSequence(String id) throws IllegalIDException, BioException, ChangeVetoException { if(!hasListeners()) { this._removeRichSequence(id); } else { ChangeSupport changeSupport = getChangeSupport(RichSequenceDB.SEQUENCES); synchronized(changeSupport) {... |
SymbolList symbollistRet = func.mutate(seq); | func.mutate(seq); | public void testMutate() { SimpleMutationFunction func = new SimpleMutationFunction(); try { SymbolList seq= DNATools.createDNA("aaaaaaaaa"); SymbolList symbollistRet = func.mutate(seq); func.setMutationProbs(new double[]{0.0, 0.0, 1.0, 0.0}); func.setMutationSpectrum( GATools.stan... |
this, holder.getTranslation()); | this, holder.getTranslation(), holder.isOppositeStrand()); | protected FeatureHolder getProjectedFeatures() { if (projectedFeatures == null) { projectedFeatures = new ProjectedFeatureHolder(feature, this, holder.getTranslation()); } return projectedFeatures; } |
compound = compound.union(new RangeLocation(translate - oldLoc.getMax(), translate - oldLoc.getMin())); | compound = compound.union(new RangeLocation(translate - oldBlock.getMax(), translate - oldBlock.getMin())); | public Location getProjectedLocation(Location oldLoc) { if (oppositeStrand) { if (oldLoc.isContiguous()) { return new RangeLocation(translate - oldLoc.getMax(), translate - oldLoc.getMin()); } else { Location compound = Location.empty; for (Iterator i = oldLoc.blockIterator(); i.hasNext(); ) { ... |
Feature f = realizeFeature(this, ft); if (changeSupport == null) { persistFeature(f, -1); getFeatures().addFeature(f); } else { synchronized (changeSupport) { ChangeEvent cev = new ChangeEvent(this, FeatureHolder.FEATURES, f); changeSupport.firePreChangeEvent(cev); persistFeature(f, -1); getFeatures().addFeature(f); ch... | return getFeatures().createFeature(ft); | public Feature createFeature(Feature.Template ft) throws ChangeVetoException, BioException { Feature f = realizeFeature(this, ft); if (changeSupport == null) { persistFeature(f, -1); getFeatures().addFeature(f); } else { synchronized (changeSupport) { ChangeEvent cev = new ChangeEvent(this, F... |
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, " + "seqfeature_key.key_name, " + "s... | private BioEntryFeatureSet getFeatures() { | 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, " ... |
Connection conn = null; try { conn = seqDB.getPool().takeConnection(); conn.setAutoCommit(false); int f_id = seqDB.persistFeature(conn, bioentry_id, f, parent_id); if (f instanceof BioSQLFeatureI) { ((BioSQLFeatureI) f)._setInternalID(f_id); ((BioSQLFeatureI) f)._setAnnotation(new BioSQLFeatureAnnotation(seqDB, f_id));... | getFeatures().persistFeature(f, parent_id); | void persistFeature(Feature f, int parent_id) throws BioException { Connection conn = null; try { conn = seqDB.getPool().takeConnection(); conn.setAutoCommit(false); int f_id = seqDB.persistFeature(conn, bioentry_id, f, parent_id); if (f instanceof BioSQLFeatureI) { ((BioSQLFeatureI) f)._... |
if (parent != this && !seqDB.isHierarchySupported()) { throw new BioException("This database doesn't support feature hierarchy. Please create a seqfeature_hierarchy table"); } if (templ instanceof StrandedFeature.Template && getAlphabet() == DNATools.getDNA()) { return new BioSQLStrandedFeature(this, parent, (Strande... | return getFeatures().realizeFeature(parent, templ); | public Feature realizeFeature(FeatureHolder parent, Feature.Template templ) throws BioException { if (parent != this && !seqDB.isHierarchySupported()) { throw new BioException("This database doesn't support feature hierarchy. Please create a seqfeature_hierarchy table"); } if (templ instanceof Strand... |
throw new ChangeVetoException("Don't (yet) support feature removal"); | getFeatures().removeFeature(f); | public void removeFeature(Feature f) throws ChangeVetoException { throw new ChangeVetoException("Don't (yet) support feature removal"); } |
int length = seq.length(); for(int i = 1; i <= length; i++) { os.write(seq.symbolAt(i).getToken()); if( (i % lineWidth) == 0) os.println(); } if( (length % lineWidth) != 0) os.println(); | for(int pos = 1; pos <= seq.length() + 1; pos += lineWidth) { int end = Math.min(pos + lineWidth - 1, seq.length()); os.println(seq.subStr(pos, end)); } | public void writeSequence(Sequence seq, PrintStream os) { os.print(">"); os.println(describeSequence(seq)); int length = seq.length(); for(int i = 1; i <= length; i++) { os.write(seq.symbolAt(i).getToken()); if( (i % lineWidth) == 0) os.println(); } if( (length % lineWidth) != 0) os.print... |
SymbolTokenization p = getDNA().getTokenization("token"); return new SimpleSymbolList(p, dna); } catch (BioException se) { throw new BioError( "Something has gone badly wrong with DNA", se); | p = getDNA().getTokenization("token"); } catch (BioException e) { throw new BioError("Something has gone badly wrong with DNA", e); | public static SymbolList createDNA(String dna) throws IllegalSymbolException { try { SymbolTokenization p = getDNA().getTokenization("token"); return new SimpleSymbolList(p, dna); } catch (BioException se) { throw new BioError( "Something has gone badly wrong with DNA", se); } } |
return new SimpleSymbolList(p, dna); | public static SymbolList createDNA(String dna) throws IllegalSymbolException { try { SymbolTokenization p = getDNA().getTokenization("token"); return new SimpleSymbolList(p, dna); } catch (BioException se) { throw new BioError( "Something has gone badly wrong with DNA", se); } } | |
int depth = labels.size(); | public static Distribution[] phredAlignmentToDistArray(Alignment a){ List labels = a.getLabels(); int depth = labels.size(); Distribution [] average = new Distribution[a.length()]; Distribution[][] matrix = new Distribution[labels.size()][]; for(int y = 0; y < a.length(); y++){// for eaxh p... | |
public ViewSequence(Sequence seq) { | public ViewSequence(Sequence seq, String name) { this.name = name; | public ViewSequence(Sequence seq) { seqDelegate = seq; addedFeatures = new SimpleFeatureHolder(); exposedFeatures = new MergeFeatureHolder(); try { exposedFeatures.addFeatureHolder(new ProjectedFeatureHolder(seqDelegate, this, 0, false)); exposedFeatures.addFeatureHolder(addedFeatures); } catch (ChangeVetoE... |
name = seqDelegate.getName(); | public ViewSequence(Sequence seq) { seqDelegate = seq; addedFeatures = new SimpleFeatureHolder(); exposedFeatures = new MergeFeatureHolder(); try { exposedFeatures.addFeatureHolder(new ProjectedFeatureHolder(seqDelegate, this, 0, false)); exposedFeatures.addFeatureHolder(addedFeatures); } catch (ChangeVetoE... | |
throw new BioException( "Can't create a feature that is outside this sequence: " + loc ); | throw new BioException("Failed to create a feature with a location " + loc + " outside the sequence: name '" + getName() + "', URN '" + getURN() + "' length " + length()); | public Feature createFeature(Feature.Template template) throws BioException, ChangeVetoException { Location loc = template.location; if(loc.getMin() < 1 || loc.getMax() > this.length()) { throw new BioException( "Can't create a feature that is outside this sequence: " + loc ... |
String prefix = (String) config.get("location"); if (prefix == null) { throw new RegistryException("BioFetch requires prefix"); } | String location = (String) config.get("location"); if (location == null) { throw new RegistryException("BioFetch provider requires" + " a location parameter"); } | public SequenceDBLite getSequenceDB(Map config) throws RegistryException, BioException { String prefix = (String) config.get("location"); if (prefix == null) { throw new RegistryException("BioFetch requires prefix"); } String type = (String) config.get("format"); if (type == null) { throw new Regi... |
String type = (String) config.get("format"); if (type == null) { throw new RegistryException("BioFetch requires type"); } | String dbName = (String) config.get("dbname"); if (dbName == null) { throw new RegistryException("BioFetch provider requires" + " a dbname parameter"); } | public SequenceDBLite getSequenceDB(Map config) throws RegistryException, BioException { String prefix = (String) config.get("location"); if (prefix == null) { throw new RegistryException("BioFetch requires prefix"); } String type = (String) config.get("format"); if (type == null) { throw new Regi... |
String db = (String) config.get("biodatabase"); if (db == null) { throw new RegistryException("BioFetch requires biodatabase paramter"); } return new BioFetchSequenceDB(prefix, type, db); | return new BioFetchSequenceDB(location, dbName); | public SequenceDBLite getSequenceDB(Map config) throws RegistryException, BioException { String prefix = (String) config.get("location"); if (prefix == null) { throw new RegistryException("BioFetch requires prefix"); } String type = (String) config.get("format"); if (type == null) { throw new Regi... |
alphabet().validate(r); | try { alphabet().validate(r); } catch (IllegalResidueException ire) { throw new IllegalResidueException( ire, "Couldn't retrieve weight for " + r.getName() + " in state " + getName() ); } | public double getWeight(Residue r) throws IllegalResidueException { if(r == MagicalState.MAGICAL_RESIDUE) { return Double.NEGATIVE_INFINITY; } alphabet().validate(r); Double d = (Double) residueToProb.get(r); if(d == null) { return Double.NEGATIVE_INFINITY; } else { return d.doubleVal... |
super(message); | this(null, message); | public BioError(String message) { super(message); } |
ssContext.getSearchContentHandler().addHitProperty("queryDescription", s); | ssContext.getSearchContentHandler().addSearchProperty("queryDescription", s); | protected void setStringValue(String s) { ssContext.getSearchContentHandler().addHitProperty("queryDescription", s); } |
public double getDepth(SequenceRenderContext src) { return depth + 1.0; | public double getDepth(SequenceRenderContext context) { return depth + 1.0; | public double getDepth(SequenceRenderContext src) { return depth + 1.0; } |
public double getMinimumLeader(SequenceRenderContext src) { return 0.0; | public double getMinimumLeader(SequenceRenderContext context) { return 0.0; | public double getMinimumLeader(SequenceRenderContext src) { return 0.0; } |
public double getMinimumTrailer(SequenceRenderContext src) { return 0.0; | public double getMinimumTrailer(SequenceRenderContext context) { return 0.0; | public double getMinimumTrailer(SequenceRenderContext src) { return 0.0; } |
public void paint( Graphics2D g, SequenceRenderContext src ) { SymbolList seq = src.getSymbols(); int direction = src.getDirection(); g.setFont(src.getFont()); Rectangle2D oldClip = g.getClipBounds(); g.setColor(Color.black); double scale = src.getScale(); Rectangle2D maxBounds = g.getFont().getMaxCharBounds(g.getF... | public void paint(final Graphics2D g2, final SequenceRenderContext context) { Rectangle2D prevClip = g2.getClipBounds(); AffineTransform prevTransform = g2.getTransform(); g2.setPaint(outline); Font font = context.getFont(); Rectangle2D maxCharBounds = font.getMaxCharBounds(g2.getFontRenderContext()); double scale ... | public void paint( Graphics2D g, SequenceRenderContext src ) { SymbolList seq = src.getSymbols(); int direction = src.getDirection(); g.setFont(src.getFont()); Rectangle2D oldClip = g.getClipBounds(); // AffineTransform oldTrans = g.getTransform(); g.setColor(C... |
int leading; int trailing; int symOffset = src.getRange().getMin(); double graphOffset = src.sequenceToGraphics(symOffset); if(src.getDirection() == src.HORIZONTAL) { leading = src.graphicsToSequence(oldClip.getMinX()); trailing = src.graphicsToSequence(oldClip.getMaxX()); | public void paint( Graphics2D g, SequenceRenderContext src ) { SymbolList seq = src.getSymbols(); int direction = src.getDirection(); g.setFont(src.getFont()); Rectangle2D oldClip = g.getClipBounds(); // AffineTransform oldTrans = g.getTransform(); g.setColor(C... | |
} else { leading = src.graphicsToSequence(oldClip.getMinY()); trailing = src.graphicsToSequence(oldClip.getMaxY()); } int min = Math.max(src.getRange().getMin(), leading); int max = Math.min(src.getRange().getMax(), trailing+1); for (int sPos = min; sPos <= max; ++sPos) { double gPos = src.sequenceToGraphics... | g2.setClip(prevClip); g2.setTransform(prevTransform); | public void paint( Graphics2D g, SequenceRenderContext src ) { SymbolList seq = src.getSymbols(); int direction = src.getDirection(); g.setFont(src.getFont()); Rectangle2D oldClip = g.getClipBounds(); // AffineTransform oldTrans = g.getTransform(); g.setColor(C... |
System.err.println("Adding " + tf.templateClass.getName()); | public static void addFeatureImplementation(TemplateFeature tf) { System.err.println("Adding " + tf.templateClass.getName()); templateClassToFeatureClass.add(0, tf); } | |
public TagRenamer(TagValueListener delegate, TagMapper mapper) { | public TagRenamer(TagValueListener delegate, PropertyChanger mapper) { | public TagRenamer(TagValueListener delegate, TagMapper mapper) { super(delegate); this.mapper = mapper; } |
if (! proteinSeq.getAlphabet().getName().equals("PROTEIN")) { throw new IllegalSymbolException("The SymbolList was not using the protein alphabet"); } | public static final double getMass(SymbolList proteinSeq, String isotopicType, boolean MH_PLUS) throws IllegalSymbolException { if (! proteinSeq.getAlphabet().getName().equals("PROTEIN")) { throw new IllegalSymbo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.