rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth)
public static StringBuffer formatLocationBlock(final Location loc, final int strand, final String leader, final int wrapWidth)
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
Location [] la = (Location[]) locs.toArray(new Location [0]);
Collections.sort(locs, Location.naturalOrder);
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
sb.append("complement("); position += 11;
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
for (int i = 0; i < la.length; i++)
for (Iterator li = locs.iterator(); li.hasNext();)
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
boolean point = (PointLocation.class.isInstance(la[i])) ? true : false; boolean fuzzy = (FuzzyLocation.class.isInstance(la[i])) ? true : false; boolean fuzzyPoint = (FuzzyPointLocation.class.isInstance(la[i])) ? true : false;
if (PointLocation.class.isInstance(thisLoc)) locType = POINT; else if (FuzzyLocation.class.isInstance(thisLoc)) locType = FUZZY_RANGE; else if (FuzzyPointLocation.class.isInstance(thisLoc)) locType = FUZZY_POINT; else locType = RANGE;
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
if (point) { sb.append(la[i].getMin()); } else if (fuzzy)
switch (locType)
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
FuzzyLocation fl = (FuzzyLocation) la[i];
case POINT: PointLocation pl = (PointLocation) thisLoc;
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
if (! fl.hasBoundedMin()) { sb.append("<"); sb.append(fl.getMin()); } else if (fl.getOuterMin() != fl.getInnerMin()) { sb.append("(" + fl.getOuterMin()); sb.append("."); sb.append(fl.getInnerMin() + ")"); } else sb.append(fl.getMin());
sb.append(complement ? toComplement(formatPoint(pl)) : formatPoint(pl)); break;
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
sb.append("..");
case FUZZY_RANGE: FuzzyLocation fl = (FuzzyLocation) thisLoc;
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
if (! fl.hasBoundedMax()) { sb.append(">"); sb.append(la[i].getMax()); } else if (fl.getInnerMax() != fl.getOuterMax()) { sb.append("(" + fl.getInnerMax()); sb.append("."); sb.append(fl.getOuterMax() + ")"); } else sb.append(fl.getMax()); } else if (fuzzyPoint) { FuzzyPointLocation fpl = (FuzzyPointLocation) la[i];
sb.append(complement ? toComplement(formatFuzzyRange(fl)) : formatFuzzyRange(fl)); break;
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
if (! fpl.hasBoundedMin()) { sb.append("<"); sb.append(fpl.getMax()); } else if (! fpl.hasBoundedMax()) { sb.append(">"); sb.append(fpl.getMin()); } else { sb.append("(" + fpl.getMin()); sb.append("."); sb.append(fpl.getMax() + ")"); } } else { sb.append(la[i].getMin()); sb.append(".."); sb.append(la[i].getMax());
case FUZZY_POINT: FuzzyPointLocation fpl = (FuzzyPointLocation) thisLoc; sb.append(complement ? toComplement(formatFuzzyPoint(fpl)) : formatFuzzyPoint(fpl)); break; case RANGE: RangeLocation rl = (RangeLocation) thisLoc; sb.append(complement ? toComplement(formatRange(rl))...
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
if (i + 1 < la.length)
if ((locs.indexOf(thisLoc) + 1) < locs.size())
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
if (complement) { sb.append(")"); if ((position + 1) > wrapWidth) { sb.insert((sb.length() - diff), "\n" + leader); } }
public static StringBuffer formatLocationBlock(Location loc, int strand, String leader, int wrapWidth) { // Indicates how many characters have been added to the // current line int position = leader.length(); boolean join = false; boolean complement = false; List l...
public static StringBuffer formatQualifierBlock(String text, String leader, int wrapWidth)
public static StringBuffer formatQualifierBlock(final String text, final String leader, final int wrapWidth)
public static StringBuffer formatQualifierBlock(String text, String leader, int wrapWidth) { int tokenType = FIRST; int position = leader.length(); StringBuffer output = new StringBuffer(text.length()); output.append(leader); StringTokenizer t = new StringTokenizer(text); TOKEN: while (t...
public static StringBuffer formatTokenBlock(Symbol [] syms, int blockSize)
public static StringBuffer formatTokenBlock(final Symbol [] syms, final int blockSize)
public static StringBuffer formatTokenBlock(Symbol [] syms, int blockSize) { StringBuffer sb = new StringBuffer(syms.length); for (int i = 0; i < syms.length; i++) { sb.append(syms[i].getToken()); if ((i > 0) && ((i + 1) % blockSize == 0)) sb.append(' '); } return sb; }
public static void loadFeatureData(String featureDataFile, Map featureData, Map qualifierData)
public static void loadFeatureData(final String featureDataFile, final Map featureData, final Map qualifierData)
public static void loadFeatureData(String featureDataFile, Map featureData, Map qualifierData) { try { InputStream featureDataStream = EmblFileFormer.class.getClassLoader().getResourceAsStream(featureDataFile); if (featureDataStream == null) throw new BioError("Unable to find...
public FastaSearchBuilder(SequenceDBInstallation subjectDBs, SequenceDB querySeqHolder)
public FastaSearchBuilder(final SequenceDBInstallation subjectDBs, final SequenceDB querySeqHolder)
public FastaSearchBuilder(SequenceDBInstallation subjectDBs, SequenceDB querySeqHolder) { this.subjectDBs = subjectDBs; this.querySeqHolder = querySeqHolder; }
private Alignment createAlignment(String subjectSeqID, Map dataMap)
private Alignment createAlignment(final String subjectSeqID, final Map dataMap)
private Alignment createAlignment(String subjectSeqID, Map dataMap) throws IllegalSymbolException { String seqType = (String) dataMap.get("query"); FiniteAlphabet alpha; // What happens if Fasta is given an RNA sequence? if (seqType.equals("dna")) alpha = DNATools.getDNA(); else alpha = ProteinT...
private Annotation createAnnotation(Map preAnnotation)
private Annotation createAnnotation(final Map preAnnotation)
private Annotation createAnnotation(Map preAnnotation) { Annotation annotation = new SimpleAnnotation(); Set annotationKeySet = preAnnotation.keySet(); for (Iterator ksi = annotationKeySet.iterator(); ksi.hasNext();) { Object annotationKey = ksi.next(); Object annotationValue = preAnnotation.get(annot...
private SeqSimilaritySearchHit createHit(Map dataMap, Annotation hitAnnotation)
private SeqSimilaritySearchHit createHit(final Map dataMap, final Annotation hitAnnotation)
private SeqSimilaritySearchHit createHit(Map dataMap, Annotation hitAnnotation) throws BioException { String subjectSeqID = (String) dataMap.get("id"); Double score = (Double) dataMap.get("fa_z-score"); Double eValue = (Double) dataMap.get("fa_expect"); Double pValue = (Dou...
private String prepSeqTokens(String name, Map dataMap)
private String prepSeqTokens(final String name, final Map dataMap)
private String prepSeqTokens(String name, Map dataMap) { // System.out.println("dataMap: " + dataMap); Integer alDispStart = (Integer) dataMap.get(name + "AlDispStart"); Integer alStart = (Integer) dataMap.get(name + "AlStart"); Integer alStop = (Integer) dataMap.get(name + "AlStop"); StringBuffer s...
void setHitAnnotationData(Map hitPreAnnotation)
void setHitAnnotationData(final Map hitPreAnnotation)
void setHitAnnotationData(Map hitPreAnnotation) { this.hitPreAnnotation = hitPreAnnotation; }
void setHitData(Map hitData)
void setHitData(final Map hitData)
void setHitData(Map hitData) { this.hitData = hitData; }
void setQuerySeq(String querySeqID)
void setQuerySeq(final String querySeqID)
void setQuerySeq(String querySeqID) throws BioException { try { // System.out.println("Setting Query sequence with ID: " + querySeqID); querySeq = (SymbolList) querySeqHolder.getSequence(querySeqID); } catch (BioException bex) { throw new BioException(bex, "Failed to retrieve query sequence from hold...
void setSearchAnnotationData(Map resultPreAnnotation)
void setSearchAnnotationData(final Map resultPreAnnotation)
void setSearchAnnotationData(Map resultPreAnnotation) { this.resultPreAnnotation = resultPreAnnotation; }
void setSearchResultData(Map resultData)
void setSearchResultData(final Map resultData)
void setSearchResultData(Map resultData) { searchParameters = resultData; }
void setSubjectDB(String subjectDBFileName)
void setSubjectDB(final String subjectDBFileName)
void setSubjectDB(String subjectDBFileName) throws BioException { // System.out.println("Setting subject DB with filename/ID: " + subjectDBFileName); subjectDB = subjectDBs.getSequenceDB(subjectDBFileName); if (subjectDB == null) throw new BioException("Failed to retrieve database from installation using ID:...
assertEquals("g", charSeq.subSequence(0, 1)); assertEquals("t", charSeq.subSequence(3, 4)); assertEquals("gc", charSeq.subSequence(0, 2)); assertEquals("ca", charSeq.subSequence(1, 3)); assertEquals("at", charSeq.subSequence(2, 4));
assertEquals("g", charSeq.subSequence(0, 1).toString()); assertEquals("t", charSeq.subSequence(3, 4).toString()); assertEquals("gc", charSeq.subSequence(0, 2).toString()); assertEquals("ca", charSeq.subSequence(1, 3).toString()); assertEquals("at", charSeq.subSequence(2, 4).toString());
public void testSubSequence() throws Exception { CharSequence charSeq = new SymbolListCharSequence(DNATools.createDNA("GCAT")); assertEquals("g", charSeq.subSequence(0, 1)); assertEquals("t", charSeq.subSequence(3, 4)); assertEquals("gc", charSeq.subSequence(0, 2)); ...
return new OPH(getIdentifier());
return new WellKnownAtomicSymbol.OPH(getIdentifier());
private Object writeReplace() { return new OPH(getIdentifier()); }
throws NoSuchMethodException { this.templateClass = templateClass; this.featureClass = featureClass; this.con = featureClass.getConstructor(conTypes); }
throws NoSuchMethodException { Class[] conTypes = new Class[2]; conTypes[0] = Sequence.class; conTypes[1] = templateClass; this.templateClass = templateClass; this.featureClass = featureClass; this.con = featureClass.getConstructor(conTypes); }
public TemplateFeature(Class templateClass, Class featureClass) throws NoSuchMethodException { this.templateClass = templateClass; this.featureClass = featureClass; this.con = featureClass.getConstructor(conTypes); }
if(template.getClass().isInstance(tf.templateClass)) {
if(tf.templateClass.isInstance(template)) {
protected static Feature createFeatureFromTemplate(Sequence parent, Feature.Template template) throws SeqException { for(Iterator i = templateClassToFeatureClass.iterator(); i.hasNext(); ) { TemplateFeature tf = (TemplateFeature) i.next(); if(template.getClass().isInstance(tf.templateClass)) { tr...
syncDelegate(); delegateUpdate = new ChangeListener() { public void preChange(ChangeEvent ce) {} public void postChange(ChangeEvent ce) { ChangeType ct = ce.getType(); Object change = ce.getChange(); if(ct == Distribution.WEIGHTS) { boolean synced = false; if((change != null) && (change instanceof Object[]) ) { Object...
public TranslatedDistribution( ReversibleTranslationTable table, Distribution other, DistributionFactory distFact ) throws IllegalAlphabetException { if(!table.getTargetAlphabet().equals(other.getAlphabet())) { throw new IllegalAlphabetException( "Table target alphabet and distribution alphab...
delegate.addChangeListener(forwarder, Distribution.WEIGHTS);
other.addChangeListener(forwarder, Distribution.WEIGHTS);
protected ChangeSupport getChangeSupport(ChangeType ct) { ChangeSupport cs = super.getChangeSupport(ct); if(forwarder == null && (Distribution.WEIGHTS.isMatchingType(ct) || ct.isMatchingType(Distribution.WEIGHTS))) { forwarder = new Forwarder(this, cs); delegate.addChangeListener(forwarder, D...
throws ChangeVetoException { DistributionTrainerContext subCtxt = new SimpleDistributionTrainerContext(); subCtxt.setNullModelWeight(weight); subCtxt.registerDistribution(delegate); for( Iterator i = ((FiniteAlphabet) other.getAlphabet()).iterator(); i.hasNext(); ) { AtomicSymbol sym = (AtomicSymbol) i.next(); try { s...
throws ChangeVetoException {
public void registerWithTrainer(DistributionTrainerContext dtc) { dtc.registerDistribution(other); dtc.registerTrainer(this, new DistributionTrainer() { public void addCount( DistributionTrainerContext dtc, AtomicSymbol s, double count ) throws IllegalSymbolException { dtc....
throws IllegalSymbolException, ChangeVetoException { delegate.setWeight(sym, weight);
throws IllegalSymbolException, ChangeVetoException { throw new ChangeVetoException("Can't directly edit a TranslatedDistribution");
public void setWeight(Symbol sym, double weight) throws IllegalSymbolException, ChangeVetoException { delegate.setWeight(sym, weight); }
+ ((sym == null)?999:alfaIdx.indexForSymbol(sym));
+ alphaIndex(sym);
public int hashCode() { try { return (source.getID() << 20) + (dest.getID() << 10) + ((sym == null)?999:alfaIdx.indexForSymbol(sym)); } catch (IllegalSymbolException ise) { throw new BioError("Fatal error: Unexpected Il...
for (Iterator j = ((Set)this.namesMap.get(nameClass)).iterator(); j.hasNext(); ) {
if (items!=null) for (Iterator j = items.iterator(); j.hasNext(); ) {
public Set getNames(String nameClass) throws IllegalArgumentException { if (nameClass==null) throw new IllegalArgumentException("Name class cannot be null"); Set n = new TreeSet(); for (Iterator j = ((Set)this.namesMap.get(nameClass)).iterator(); j.hasNext(); ) { SimpleNCBITaxonName ...
public static Distribution[] distOverAlignment(Alignment a, boolean countGaps){
public static Distribution[] distOverAlignment(Alignment a, boolean countGaps, double nullWeight){
public static Distribution[] distOverAlignment(Alignment a, boolean countGaps){ List seqs = a.getLabels(); Distribution[] pos = new Distribution[a.length()]; FiniteAlphabet dna = DNATools.getDNA(); try{ for(int i = 0; i < a.length(); i++){// For each position pos[i] = DistributionFactory.DEFAU...
FiniteAlphabet dna = DNATools.getDNA();
public static Distribution[] distOverAlignment(Alignment a, boolean countGaps){ List seqs = a.getLabels(); Distribution[] pos = new Distribution[a.length()]; FiniteAlphabet dna = DNATools.getDNA(); try{ for(int i = 0; i < a.length(); i++){// For each position pos[i] = DistributionFactory.DEFAU...
pos[i] = DistributionFactory.DEFAULT.createDistribution(dna);
pos[i] = DistributionFactory.DEFAULT.createDistribution(alpha);
public static Distribution[] distOverAlignment(Alignment a, boolean countGaps){ List seqs = a.getLabels(); Distribution[] pos = new Distribution[a.length()]; FiniteAlphabet dna = DNATools.getDNA(); try{ for(int i = 0; i < a.length(); i++){// For each position pos[i] = DistributionFactory.DEFAU...
dtc.setNullModelWeight(nullWeight);
public static Distribution[] distOverAlignment(Alignment a, boolean countGaps){ List seqs = a.getLabels(); Distribution[] pos = new Distribution[a.length()]; FiniteAlphabet dna = DNATools.getDNA(); try{ for(int i = 0; i < a.length(); i++){// For each position pos[i] = DistributionFactory.DEFAU...
pc.setKernel(pc.polyKernel);
pc.setKernel(PointClassifier.polyKernel);
public static void main(String args[]) { JFrame f = new JFrame(); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { System.exit(0); } }); f.getContentPane().setLayout(new BorderLayout()); final PointClassifier pc = new PointClassifier(); f.getCont...
pc.setKernel(pc.rbfKernel);
pc.setKernel(PointClassifier.rbfKernel);
public static void main(String args[]) { JFrame f = new JFrame(); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { System.exit(0); } }); f.getContentPane().setLayout(new BorderLayout()); final PointClassifier pc = new PointClassifier(); f.getCont...
pc.setKernel(pc.polyKernel);
pc.setKernel(PointClassifier.polyKernel);
public void itemStateChanged(ItemEvent e) { if(e.getStateChange() == ItemEvent.SELECTED) { Object o = e.getItem(); if(o.equals("polynomeal")) { pc.setKernel(pc.polyKernel); } else if(o.equals("rbf")) { pc.setKernel(pc.rbfKernel); } } }
pc.setKernel(pc.rbfKernel);
pc.setKernel(PointClassifier.rbfKernel);
public void itemStateChanged(ItemEvent e) { if(e.getStateChange() == ItemEvent.SELECTED) { Object o = e.getItem(); if(o.equals("polynomeal")) { pc.setKernel(pc.polyKernel); } else if(o.equals("rbf")) { pc.setKernel(pc.rbfKernel); } } }
stackTop.getAnnotation().setProperty(key, value);
Annotation ann = stackTop.getAnnotation(); if (ann.containsProperty(key)) { Object o = ann.getProperty(key); Collection col; if (o instanceof Collection) { col = (Collection) o; } else { col = new ArrayList(); col.add(o); ann.setProperty(key, col); } col.add(value); } else { stackTop.getAnnotation().setProperty(key, v...
public void addFeatureProperty(Object key, Object value) throws ParseException { if (stackTop == null) { // Feature we're skipping return; } try { if (key.equals(XFFFeatureSetHandler.PROPERTY_XFF_ID)) { stackTop.getAnnotation().setProperty(DASSequence.PROPERTY_FEATUREID, value); } else { ...
private void setObject(ComparableTerm object) { this.object = object; }
void setObject(ComparableTerm object) { this.object = object; }
private void setObject(ComparableTerm object) { this.object = object; }
private void setOntology(ComparableOntology ontology) { this.ontology = ontology; }
void setOntology(ComparableOntology ontology) { this.ontology = ontology; }
private void setOntology(ComparableOntology ontology) { this.ontology = ontology; }
private void setPredicate(ComparableTerm predicate) { this.predicate = predicate; }
void setPredicate(ComparableTerm predicate) { this.predicate = predicate; }
private void setPredicate(ComparableTerm predicate) { this.predicate = predicate; }
private void setSubject(ComparableTerm subject) { this.subject = subject; }
void setSubject(ComparableTerm subject) { this.subject = subject; }
private void setSubject(ComparableTerm subject) { this.subject = subject; }
public Collection getPaymentItems(String communeNumber, String personalId) throws java.rmi.RemoteException;
public Collection getPaymentItems(String communeNumber, String personalId, String endpoint) throws java.rmi.RemoteException;
public Collection getPaymentItems(String communeNumber, String personalId) throws java.rmi.RemoteException;
IWTimestamp toStamp) throws java.rmi.RemoteException;
IWTimestamp toStamp, String endpoint) throws java.rmi.RemoteException;
public Collection getStatementItems(String communeNumber, String personalId, PaymentItem pType, IWTimestamp fromStamp, IWTimestamp toStamp) throws java.rmi.RemoteException;
String modelFile = args[1];
public static void main(String[] args) throws Throwable { if (args.length < 2) { throw new Exception("usage: stats.svm.tools.TrainRegression <train_examples> <model_file>"); } String trainFile = args[0]; String modelFile = args[1]; List examples = new ArrayList(); BufferedReader r = new Buffered...
dbAttrs.addAttribute(biojavaUri, "id", "id", CDATA, queryId);
dbAttrs.addAttribute(biojavaUri, "id", "id", CDATA, databaseId);
private void initDelegation() { // delegate handling of <BlastOutput_param>// super.addHandler(new ElementRecognizer.ByLocalName("BlastOutput_param"),// BlastOutputParamHandler.BLAST_OUTPUT_PARAM_HANDLER_FACTORY); // delegate handling of <BlastOutput_program> super.addHandl...
dbAttrs.addAttribute(biojavaUri, "id", "id", CDATA, queryId);
dbAttrs.addAttribute(biojavaUri, "id", "id", CDATA, databaseId);
public StAXContentHandler getHandler(StAXFeatureHandler staxenv) { return new BlastOutputIterationsHandler(staxenv) { public void startElementHandler( String nsURI, String localName, ...
dbAttrs.addAttribute(biojavaUri, "id", "id", CDATA, queryId);
dbAttrs.addAttribute(biojavaUri, "id", "id", CDATA, databaseId);
public void startElementHandler( String nsURI, String localName, String qName, Attributes attrs) throws SAXException { ...
if (context.getDirection() == context.HORIZONTAL)
if (context.getDirection() == SequenceRenderContext.HORIZONTAL)
public void renderBead(Graphics2D g2, Feature f, SequenceRenderContext context) { Location loc = f.getLocation(); int min = loc.getMin(); int max = loc.getMax(); int dif = max - min; if (context.getDir...
Node cnode2 = (Node) children.item(j);
Node cnode2 = (Node) proteaseNodes.item(j);
public static Protease getProteaseByName(String proteaseName){ Protease protease = null; NodeList children = doc.getDocumentElement().getChildNodes(); for(int i = 0; i < children.getLength(); i++) { Node cnode = (Node) children.item(i); if(! (cnode instanc...
if (sequences == null) {
if (!gotAllIDs) {
public Set ids() { if (sequences == null) { try { URL epURL = new URL(dataSourceURL, "entry_points"); HttpURLConnection huc = (HttpURLConnection) epURL.openConnection(); try { huc.connect(); } catch (Exception e) { throw new BioException(e, "Can't connect to " + epURL); } int status = huc.getHea...
sequences.put(el.getAttribute("id"), null);
String id = el.getAttribute("id"); if (! sequences.containsKey(id)) sequences.put(id, null);
public Set ids() { if (sequences == null) { try { URL epURL = new URL(dataSourceURL, "entry_points"); HttpURLConnection huc = (HttpURLConnection) epURL.openConnection(); try { huc.connect(); } catch (Exception e) { throw new BioException(e, "Can't connect to " + epURL); } int status = huc.getHea...
xw.openTag("biojava:prop");
xw.openTag(XFFTools.XFF_BIOJAVA_NS, "prop");
public void writeDetails(XMLWriter xw, Feature f) throws IOException { Annotation a = f.getAnnotation(); for (Iterator ai = a.keys().iterator(); ai.hasNext(); ) { Object key = ai.next(); if (! (key instanceof String)) continue; Object value = a.getPr...
xw.closeTag("biojava:prop");
xw.closeTag(XFFTools.XFF_BIOJAVA_NS, "prop");
public void writeDetails(XMLWriter xw, Feature f) throws IOException { Annotation a = f.getAnnotation(); for (Iterator ai = a.keys().iterator(); ai.hasNext(); ) { Object key = ai.next(); if (! (key instanceof String)) continue; Object value = a.getPr...
AlphabetManager.getGapSymbol(Collections.singletonList(DNATools.getDNA())));
DNATools.getDNA().getGapSymbol());
public void testNormalGap() throws Exception{ doSymbolTest( AlphabetManager.getGapSymbol(Collections.singletonList(DNATools.getDNA()))); }
if(forwarder == null && ct.isMatchingType(Distribution.WEIGHTS)) {
if(forwarder == null && (Distribution.WEIGHTS.isMatchingType(ct) || ct.isMatchingType(Distribution.WEIGHTS))) {
protected ChangeSupport getChangeSupport(ChangeType ct) { ChangeSupport cs = super.getChangeSupport(ct); if(forwarder == null && ct.isMatchingType(Distribution.WEIGHTS)) { forwarder = new Forwarder(this, cs); delegate.addChangeListener(forwarder, Distribution.WEIGHTS); } return cs; }
throw new BioRuntimeException("Error adding BioSQL tables" + (rolledback ? " (rolled back successfully)" : ""), ex);
throw new BioRuntimeException( "Error adding sequence: " + seq.getName() + (rolledback ? " (rolled back successfully)" : ""), ex);
private void _addSequence(Sequence seq) throws ChangeVetoException, BioException { String seqName = idmaker.calcID(seq); int version = 1; Alphabet seqAlpha = seq.getAlphabet(); SymbolTokenization seqToke; try { seqToke = seqAlpha.getTokenization("token"); } catch (Exception ex) { throw new BioExce...
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) { String lengthString = String.valueOf(src.getSymbols().length()); Font f = src.getFont(); FontRenderContext frc = new FontRenderContext(null, true, true); GlyphVector gv = f.createGlyphVector(frc, lengthString); return gv.getVisualBounds().getWidth(); }
public double getMinimumTrailer(SequenceRenderContext context) { return 0.0; }
public double getMinimumTrailer(SequenceRenderContext src) { String lengthString = String.valueOf(src.getSymbols().length()); Font f = src.getFont(); FontRenderContext frc = new FontRenderContext(null, true, true); GlyphVector gv = f.createGlyphVector(frc, lengthString); return gv.getVisualBounds().get...
public void paint( Graphics2D g, SequenceRenderContext src ) { g.setPaint(Color.black); int min = src.getRange().getMin(); int max = src.getRange().getMax(); double minX = src.sequenceToGraphics(min); double maxX = src.sequenceToGraphics(max); double scale = src.getScale(); double halfScale = scale * 0.5; Line2D line;...
public void paint(final Graphics2D g2, final SequenceRenderContext context) { AffineTransform prevTransform = g2.getTransform();
public void paint( Graphics2D g, SequenceRenderContext src ) { g.setPaint(Color.black); int min = src.getRange().getMin(); int max = src.getRange().getMax(); double minX = src.sequenceToGraphics(min); double maxX = src.sequenceToGraphics(max); double scale = src.getScale(); double halfSca...
if(src.getDirection() == src.HORIZONTAL) { line = new Line2D.Double(minX - halfScale, 0.0, maxX + halfScale, 0.0); } else { line = new Line2D.Double(0.0, minX - halfScale, 0.0, maxX + halfScale);
g2.setPaint(Color.black); int min = context.getRange().getMin(); int max = context.getRange().getMax(); double minX = context.sequenceToGraphics(min); double maxX = context.sequenceToGraphics(max); double scale = context.getScale(); double halfScale = scale * 0.5; if (context.getDirection() == SequenceRenderContext....
public void paint( Graphics2D g, SequenceRenderContext src ) { g.setPaint(Color.black); int min = src.getRange().getMin(); int max = src.getRange().getMax(); double minX = src.sequenceToGraphics(min); double maxX = src.sequenceToGraphics(max); double scale = src.getScale(); double halfSca...
g.draw(line); double ten = Math.log(10); FontMetrics myFontMetrics = g.getFontMetrics(); int coordWidth = myFontMetrics.stringWidth(Integer.toString(max)); double minGap = (double) Math.max(coordWidth, 40); int realSymsPerGap = (int) Math.ceil(((minGap + 5.0) / src.getScale())); double exponent = Math.floor(M...
public void paint( Graphics2D g, SequenceRenderContext src ) { g.setPaint(Color.black); int min = src.getRange().getMin(); int max = src.getRange().getMax(); double minX = src.sequenceToGraphics(min); double maxX = src.sequenceToGraphics(max); double scale = src.getScale(); double halfSca...
public SequenceViewerEvent processMouseEvent( SequenceRenderContext src, MouseEvent me, List path ) { path.add(this); int sPos = src.graphicsToSequence(me.getPoint()); return new SequenceViewerEvent(this, null, sPos, me, path); }
public SequenceViewerEvent processMouseEvent(final SequenceRenderContext context, final MouseEvent me, final List path) { path.add(this); int sPos = context.graphicsToSequence(me.getPoint()); return new SequenceViewerEvent(this, null, sPos, me, path); }
public SequenceViewerEvent processMouseEvent( SequenceRenderContext src, MouseEvent me, List path ) { path.add(this); int sPos = src.graphicsToSequence(me.getPoint()); return new SequenceViewerEvent(this, null, sPos, me, path); }
public boolean equals(final Object other)
public boolean equals(Object other)
public boolean equals(final 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 SequenceDBSearchH...
private void fireHits(
public void fireHits(
private void fireHits( int word, int offset, SearchListener listener ) { int hitOffset = hashTable.get(word); if(hitOffset >= 0) { try { hitTable.position(hitOffset); } catch (IllegalArgumentException e) { System.out.println("word:\t" + word); System.out.println("offset:...
System.err.println("Foo");
public void search( String seqID, SymbolList symList, SearchListener listener ) { try { int word = PackingFactory.primeWord(symList, wordLength, packing); listener.startSearch(seqID); fireHits(word, 1, listener); System.err.println("Foo"); for(int j = wordLength + 1; j <= symList...
dp.setFeature("http:
static SAXParser nonvalidatingSAXParser() { SAXParser dp = new SAXParser(); try { dp.setFeature("http://xml.org/sax/features/validation", false); // dp.setFeature("http://xml.org/sax/features/external-parameter-entities", false); dp.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-gramm...
public WeakTaxa(String scientificName, String commonName) { this.scientificName = scientificName; this.commonName = commonName;
public WeakTaxa() { super();
public WeakTaxa(String scientificName, String commonName) { this.scientificName = scientificName; this.commonName = commonName; }
this.advance,
WMAsMM.advance,
public WMAsMM(WeightMatrix wm) throws IllegalSymbolException { try { ChangeSupport changeSupport = getChangeSupport(ChangeType.UNKNOWN); distForwarder = new MarkovModel.DistributionForwarder(this, changeSupport); transFrom = new HashMap(); transTo = new HashMap(); transWeights = new HashMa...
Character c = (Character) symbolsToCharacters.get(s); if (c == null) { throw new IllegalSymbolException("No mapping for symbol " + s.getName()); } return "" + c.charValue();
return "" + _tokenizeSymbol(s).charValue();
public String tokenizeSymbol(Symbol s) throws IllegalSymbolException { Character c = (Character) symbolsToCharacters.get(s); if (c == null) { throw new IllegalSymbolException("No mapping for symbol " + s.getName()); } return "" + c.charValue(); }
Character c = (Character) symbolsToCharacters.get(sym); if (c == null) { throw new IllegalAlphabetException("No mapping for symbol " + sym.getName());
try { Character c = _tokenizeSymbol(sym); sb.append(c.charValue()); } catch (IllegalSymbolException ex) { throw new IllegalAlphabetException(ex, "Couldn't tokenize");
public String tokenizeSymbolList(SymbolList sl) throws IllegalAlphabetException { if (sl.getAlphabet() != getAlphabet()) { throw new IllegalAlphabetException("Alphabet " + sl.getAlphabet().getName() + " does not match " + getAlphabet().getName()); } StringBuffer sb = new StringBuffer(); for (Iterator ...
sb.append(c.charValue());
public String tokenizeSymbolList(SymbolList sl) throws IllegalAlphabetException { if (sl.getAlphabet() != getAlphabet()) { throw new IllegalAlphabetException("Alphabet " + sl.getAlphabet().getName() + " does not match " + getAlphabet().getName()); } StringBuffer sb = new StringBuffer(); for (Iterator ...
List auths = DocRefAuthor.Tools.parseAuthorString(authors); if (consortium!=null) auths.add(new SimpleDocRefAuthor(consortium,true,false));
List auths = null; if(authors != null) auths = DocRefAuthor.Tools.parseAuthorString(authors); if (consortium!=null){ if(auths == null) auths = new ArrayList(); auths.add(new SimpleDocRefAuthor(consortium,true,false)); }
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; //bool...
desc = m.group(3);
if(m.group(4) != null){ desc = m.group(3)+m.group(4); }else{ desc = m.group(3); }
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; //bool...
val = val.trim().replaceAll("\"","");
val = val.replaceAll("\"","").trim();
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; boolean hasInternalWhitespace = fals...
try {
public static void getSeqIOEvents(Sequence seq, SeqIOListener listener) throws BioException { try { // Inform listener of sequence start listener.startSequence(); // Pass name to listener listener.setName(seq.getName()); // Pass URN to listener listener.setURI(seq.getURN()); // Pass s...
for (Iterator fi = subs.iterator(); fi.hasNext();) { Feature.Template t = ((Feature) fi.next()).makeTemplate();
for (Iterator fi = subs.iterator(); fi.hasNext();) { Feature.Template t = ((Feature) fi.next()).makeTemplate(); try { listener.startFeature(t); } catch (ParseException pe) { pe.printStackTrace(); }
public static void getSeqIOEvents(Sequence seq, SeqIOListener listener) throws BioException { try { // Inform listener of sequence start listener.startSequence(); // Pass name to listener listener.setName(seq.getName()); // Pass URN to listener listener.setURI(seq.getURN()); // Pass s...
listener.startFeature(t);
try {
public static void getSeqIOEvents(Sequence seq, SeqIOListener listener) throws BioException { try { // Inform listener of sequence start listener.startSequence(); // Pass name to listener listener.setName(seq.getName()); // Pass URN to listener listener.setURI(seq.getURN()); // Pass s...
listener.endSequence(); } catch (ParseException pe) { throw new BioException("An internal error occurred processing " + seq.toString() + " into SeqIO events");
public static void getSeqIOEvents(Sequence seq, SeqIOListener listener) throws BioException { try { // Inform listener of sequence start listener.startSequence(); // Pass name to listener listener.setName(seq.getName()); // Pass URN to listener listener.setURI(seq.getURN()); // Pass s...
throw new BioException("An internal error occurred processing "
throw new BioException("An internal error occurred processing symbols of "
public static void getSeqIOEvents(Sequence seq, SeqIOListener listener) throws BioException { try { // Inform listener of sequence start listener.startSequence(); // Pass name to listener listener.setName(seq.getName()); // Pass URN to listener listener.setURI(seq.getURN()); // Pass s...
listener.endSequence();
public static void getSeqIOEvents(Sequence seq, SeqIOListener listener) throws BioException { try { // Inform listener of sequence start listener.startSequence(); // Pass name to listener listener.setName(seq.getName()); // Pass URN to listener listener.setURI(seq.getURN()); // Pass s...
try { String id = (String) i.next(); Sequence seq = sdb.getSequence(id); if(annotate(seq)) { hitDB.addSequence(id, seq); } } catch (SeqException se){
String id = (String) i.next(); Sequence seq = sdb.getSequence(id); if(annotate(seq)) { hitDB.addSequence(id, seq);
public SequenceDB annotate(SequenceDB sdb) throws IllegalResidueException, SeqException { HashSequenceDB hitDB = new HashSequenceDB(null); for(Iterator i = sdb.ids().iterator(); i.hasNext(); ) { try { String id = (String) i.next(); Sequence seq = sdb.getSequence(id); if(annotate...
throws IOException, BioException { this.location = location; metaData = new ConfigFile(BioStoreFactory.makeConfigFile(location)); idToList = new SmallMap(); primaryKey = (String) metaData.getProperty(BioStoreFactory.PRIMARY_KEY_NAME); String keyList = (String) metaData.getProperty(BioStoreFactory.KEYS); File plFile =...
throws IOException, BioException { this(location, cache, false);
public BioStore(File location, boolean cache) throws IOException, BioException { this.location = location; metaData = new ConfigFile(BioStoreFactory.makeConfigFile(location)); idToList = new SmallMap(); primaryKey = (String) metaData.getProperty(BioStoreFactory.PRIMARY_KEY_NAME); ...
RAF[] tmpr = new RAF[indx];
RAF[] tmpr = new RAF[indx+1];
private void readFileIDs() throws IOException, BioException { fileIDToRAF = new RAF[5]; fileCount = 0; for (Iterator i = metaData.keys().iterator(); i.hasNext(); ) { String key = (String) i.next(); if (key.startsWith("fileid_")) { ...
String name = enzyme.getName();
public void run() { SymbolListCharSequence charSeq = new SymbolListCharSequence(target); try { Pattern [] patterns = RestrictionEnzymeManager.getPatterns(enzyme); String name = enzyme.getName(); int siteLen = enzyme.getRecognitionSite().length(); i...
listener.addSequenceProperty(key, a.getProperty(key));
if ( key.equals(ReferenceAnnotation.class)) { ArrayList references = null; if (a.getProperty(key) instanceof ArrayList) { references = ((ArrayList)a.getProperty(key)); } if (references != null) { for ( int i = 0; i < references.size(); i++ ) { ReferenceAnnotation refAnnot = (ReferenceAnnotation)references.get(i); ...
void getSeqIOEvents(Sequence seq, SeqIOListener listener) { try { // Inform listener of sequence start listener.startSequence(); // Pass name to listener listener.setName(seq.getName()); // Pass URN to listener listener.setURI(seq.ge...
URL mapURL = new URL(((Text) mapmaster.getFirstChild()).getData().trim());
String mapURLString = ((Text) mapmaster.getFirstChild()).getData().trim(); if (! (mapURLString.charAt(mapURLString.length() - 1) == '/')) { mapURLString = mapURLString + '/'; } URL mapURL = new URL(mapURLString);
private void addDasURLImpl(URL dasURL) throws BioException, ChangeVetoException { try { URL dsnURL = new URL(dasURL, "dsn"); HttpURLConnection huc = (HttpURLConnection) dsnURL.openConnection(); huc.connect(); int status = DASSequenceDB.tolerantIntHeader(huc, "X-DAS-Status"); // int status...
public String startElement(String string, Attributes attributes)
public String startElement(String string)
public String startElement(String string, Attributes attributes) { oElementStack.push(string); oStr.setLength(0); if (!tLastWritePCData) oStr.append(nl()); oStr.append(indent()); oStr.append("<"); oStr.append(string); int i = 0; oSpaceStore.setLe...
int i = 0; oSpaceStore.setLength(0); oSpaceStore.append(indent()); for (i = 0; i <= string.length(); i++) oSpaceStore.append(" "); for (i = 0; i < attributes.getLength() - 1; i++) { oAttName = attributes.getLocalName(i); oAttValue = attributes.getValue(i); oStr.append(" "); if (i > 0) oStr.append(oSpaceStore.toString()...
public String startElement(String string, Attributes attributes) { oElementStack.push(string); oStr.setLength(0); if (!tLastWritePCData) oStr.append(nl()); oStr.append(indent()); oStr.append("<"); oStr.append(string); int i = 0; oSpaceStore.setLe...
List chains = getChains(modelnr);
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...
Iterator iter = chains.iterator(); while (iter.hasNext()){ Chain c = (Chain)iter.next(); boolean foundChain = false; if (c.getName().equals(chainId)) { foundChain = true; Chain newchain = new ChainImpl(); newchain.setName(c.getName());
Chain c = findChain(chainId,modelnr);
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...
Iterator giter = groups.iterator(); while (giter.hasNext()){ Group g = (Group) giter.next(); String rnum = g.getPDBCode();
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...