rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
else
else {
private void processCoords() throws BioException { int outerMin, innerMin, innerMax, outerMax; // This is expected where two calls to processCoords() are // made sequentially e.g. where two levels of parens are // closed. The second call will have no data to process. if (startCoords.isEmpty() && endCoords.isEmpt...
}
private void processCoords() throws BioException { int outerMin, innerMin, innerMax, outerMax; // This is expected where two calls to processCoords() are // made sequentially e.g. where two levels of parens are // closed. The second call will have no data to process. if (startCoords.isEmpty() && endCoords.isEmpt...
super(ns,name,accession,version,seqversion);
super(ns,name,accession,version,symList.getAlphabet(),seqversion);
public SimpleRichSequence(Namespace ns, String name, String accession, int version, SymbolList symList, Double seqversion) { super(ns,name,accession,version,seqversion); if (symList==null) this.symList = SymbolList.EMPTY_LIST; else this.symList = symList; }
double nm = getNullModel().getWeight(sym);
double nm = getNullModel().getWeight(as);
public final double getWeight(Symbol sym) throws IllegalSymbolException { if(sym instanceof AtomicSymbol) { return getWeightImpl((AtomicSymbol) sym); } else { Alphabet ambA = sym.getMatches(); if(ambA instanceof FiniteAlphabet) { FiniteAlphabet fa = (FiniteAlphabet) ambA; double ...
dataSourceString = dataSource.toString();
DASFeatureSet(DASSequenceI seq, URL ds, String id) throws BioException { refSequence = seq; dataSource = ds; sourceID = id; dataSourceString = dataSource.toString(); }
oAtts.clear(); oAttQName.setQName("id"); oAtts.addAttribute(oAttQName.getURI(), oAttQName.getLocalName(), oAttQName.getQName(), "CDATA", oQueryId); oAttQName.setQName("metaData"); oAtts.addAttribute(oAttQName.getURI(), oAttQName.getLocalName(), oAttQName.getQName(), "CDATA", "none"); this.startElement(new QName(this,...
this.emitHeaderIds();
private void interpret(String poLine) throws SAXException { if (iState == IN_HEADER) { //accumulate header information //things that can end header section //start of summmary section //start of detail section if (poLine.startsWith("Query=")) { ...
if (poLine.startsWith(" ***** No hits found ******")) { oAtts.clear(); this.startElement(new QName(this,this.prefix("Trailer")), (Attributes) oAtts); this.changeState(IN_TRAILER); oBuffer.clear(); return; }
private void interpret(String poLine) throws SAXException { if (iState == IN_HEADER) { //accumulate header information //things that can end header section //start of summmary section //start of detail section if (poLine.startsWith("Query=")) { ...
this.sequence = seq;
public void setSequence(Sequence seq) { this.sequence = seq; }
int max = Math.min(min + symbolsPerLine - 1, sequence.length()); RangeLocation pos = new RangeLocation(min, max);
public void paintComponent(Graphics g) { if(!isActive()) { return; } Graphics2D g2 = (Graphics2D) g; if(renderingHints != null){ g2.setRenderingHints(renderingHints); } Rectangle2D currentClip = g2.getClip().getBounds2D(); double minPos; double maxPos; if(direction == HORIZONTAL) ...
RangeLocation range = new RangeLocation(1, sequence.length());
public void resizeAndValidate() { //System.out.println("resizeAndValidate starting"); Dimension d = null; double acrossDim; if(!isActive()) { System.out.println("No sequence"); // no sequence - collapse down to no size at all alongDim = 0.0; acrossDim = 0.0; realLines = 0; le...
RangeLocation pos = new RangeLocation(min, max);
public void resizeAndValidate() { //System.out.println("resizeAndValidate starting"); Dimension d = null; double acrossDim; if(!isActive()) { System.out.println("No sequence"); // no sequence - collapse down to no size at all alongDim = 0.0; acrossDim = 0.0; realLines = 0; le...
Edit edit = new Edit(toEnd.length() +1, 0, fromStart);
SimpleSymbolList sl = new SimpleSymbolList(toEnd); Edit edit = new Edit(sl.length() +1, 0, fromStart);
public SymbolList subList(int start, int end){ start = realValue(start); end = realValue(end); if(start <= end){ return super.subList(start, end); } else{ SymbolList toEnd = super.subList(start,super.length()); SymbolList fromStart = super.subList(1,end); Edit edit = new Edit(toEnd....
toEnd.edit(edit);
sl.edit(edit);
public SymbolList subList(int start, int end){ start = realValue(start); end = realValue(end); if(start <= end){ return super.subList(start, end); } else{ SymbolList toEnd = super.subList(start,super.length()); SymbolList fromStart = super.subList(1,end); Edit edit = new Edit(toEnd....
int ref_start; int ref_end;
int ref_start = -999; int ref_end = -999;
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; boolean hasInternalWhitespace = fals...
String regex = "^(\\d+)\\s*(\\(bases\\s+(\\d+)\\s+to\\s+(\\d+)\\))?$";
String regex = "^(\\d+)\\s*(\\(bases\\s+(\\d+)\\s+to\\s+(\\d+)\\)|\\(sites\\))?";
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; boolean hasInternalWhitespace = fals...
ref_start = Integer.parseInt(m.group(3));
if (m.group(3)!= null) ref_start = Integer.parseInt(m.group(3)); if(m.group(4) != null)
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; boolean hasInternalWhitespace = fals...
}else{ ref_start = ref_end = -1;
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; boolean hasInternalWhitespace = fals...
(ref_start != -1 ? new Integer(ref_start) : null), (ref_end != -1 ? new Integer(ref_end) : null),
(ref_start != -999 ? new Integer(ref_start) : null), (ref_end != -999 ? new Integer(ref_end) : null),
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; boolean hasInternalWhitespace = fals...
cell.setColumnSpan(2);
private Layer getStatementMovements(IWContext iwc, String communeNumber, String personalId, PaymentItem item) throws RemoteException { NumberFormat currencyFormat = NumberFormat.getCurrencyInstance(iwc .getCurrentLocale()); currencyFormat.setGroupingUsed(true); currencyFormat.setMaximumFractionDigits(0); curr...
public SearchReader(BufferedReader reader, SearchBuilder handler, SearchParser parser)
public SearchReader(final BufferedReader reader, final SearchBuilder handler, final SearchParser parser)
public SearchReader(BufferedReader reader, SearchBuilder handler, SearchParser parser) { this.reader = reader; this.handler = handler; this.parser = parser; }
Location fLoc = f.getLocation(); if(!fLoc.isContiguous()) { fLoc = new RangeLocation(fLoc.getMin(), fLoc.getMax()); } Iterator li = layerLocs.iterator(); Iterator fhI = layers.iterator(); SimpleFeatureHolder fhLayer = null; List listLayer = null; LAYER: while(li.hasNext()) { List l = (List) li.next(); SimpleFeatureHold...
try { Location fLoc = f.getLocation(); if(!fLoc.isContiguous()) { fLoc = new RangeLocation(fLoc.getMin(), fLoc.getMax()); } Iterator li = layerLocs.iterator(); Iterator fhI = layers.iterator(); SimpleFeatureHolder fhLayer = null; List listLayer = null; LAYER: while(li.hasNext()) { List l = (List) li.next(); SimpleFeatu...
protected List doLayer(SequenceRenderContext src, FeatureFilter filt) { FeatureHolder features = src.getFeatures(); List layers = new ArrayList(); List layerLocs = new ArrayList(); for( Iterator fi = features.filter( filt, false ).features(); fi.hasNext(); ) { Feature f =...
listLayer = l; fhLayer = fh; break; } if(listLayer == null) { layerLocs.add(listLayer = new ArrayList()); layers.add(fhLayer = new SimpleFeatureHolder()); } listLayer.add(fLoc); try {
if(listLayer == null) { layerLocs.add(listLayer = new ArrayList()); layers.add(fhLayer = new SimpleFeatureHolder()); } listLayer.add(fLoc);
protected List doLayer(SequenceRenderContext src, FeatureFilter filt) { FeatureHolder features = src.getFeatures(); List layers = new ArrayList(); List layerLocs = new ArrayList(); for( Iterator fi = features.filter( filt, false ).features(); fi.hasNext(); ) { Feature f =...
} catch (Throwable t) { throw new NestedError(t, "Could not bump feature: " + f);
protected List doLayer(SequenceRenderContext src, FeatureFilter filt) { FeatureHolder features = src.getFeatures(); List layers = new ArrayList(); List layerLocs = new ArrayList(); for( Iterator fi = features.filter( filt, false ).features(); fi.hasNext(); ) { Feature f =...
String endpoint = "http: String endpoint2 = "http: String endpoint3 = "http:
public static void main(String[] args) { try { String endpoint = "http://213.167.155.148/WSFinanceDataGetTypes/WSFinanceDataGetTypes_GetTypes_SoapPort.asmx"; String endpoint2 = "http://213.167.155.148/WSFinanceDataGetState2/WSFinanceDataGetState2_GetState_SoapPort.asmx"; String endpoint3 = "http://213.167.155.1...
String endpoint = "http: String endpoint2 = "http: String endpoint3 = "http:
public static void main(String[] args) { try { String endpoint = "http://213.167.155.148/WSFinanceDataGetTypes/WSFinanceDataGetTypes_GetTypes_SoapPort.asmx"; String endpoint2 = "http://213.167.155.148/WSFinanceDataGetState2/WSFinanceDataGetState2_GetState_SoapPort.asmx"; String endpoint3 = "http://213.167.155.1...
uniform = new UniformDistribution(DNATools.getDNA());
protected void setUp() { // create distributions try { dist = DistributionFactory.DEFAULT.createDistribution(DNATools.getDNA()); uniform = new UniformDistribution(DNATools.getDNA()); gap = new GapDistribution(DNATools.getDNA()); pair = new PairDistribution(dist,gap); List l = Collectio...
searchStatus = NODATA;
if (searchStatus == INHEADER) { searchStatus = NODATA; continue LINE; } else searchStatus = NODATA;
public void parseSearch(final BufferedReader reader, final SearchContentHandler handler) throws IOException, BioException, ParserException { lineNumber = 0; boolean parsedQueryId = false; this.handler = handler; LINE: while ((line = reader.readLine()) != null) { lin...
qName.setQName("queryStrand"); attributes.addAttribute(qName.getURI(), qName.getLocalName(), qName.getQName(), "CDATA", "plus"); String strand; if (hitProperties.get("fa_frame").equals("f")) strand = "plus"; else strand = "minus"; qName.setQName("hitStrand"); attributes.addAttribute(qName.getURI(), qName.getLocalNam...
public void endSubHit() { attributes.clear(); // Query sequence length attribute qName.setQName("sequenceLength"); attributes.addAttribute(qName.getURI(), qName.getLocalName(), qName.getQName(), "CDATA", (String) hitProperties.get("query_sq_len")); try { // Start the Hit startElement(new QNam...
if (seqType.equals("dna")) { qName.setQName("queryStrand"); attributes.addAttribute(qName.getURI(), qName.getLocalName(), qName.getQName(), "CDATA", "plus"); String strand; if (hitProperties.get("fa_frame").equals("f")) strand = "plus"; else strand = "minus"; qName.setQName("hitStrand"); attributes.addAttribute(qNa...
public void endSubHit() { attributes.clear(); // Query sequence length attribute qName.setQName("sequenceLength"); attributes.addAttribute(qName.getURI(), qName.getLocalName(), qName.getQName(), "CDATA", (String) hitProperties.get("query_sq_len")); try { // Start the Hit startElement(new QNam...
public FilterSet(Set filters) { this.filters = filters;
public FilterSet() { filters = new HashSet();
public FilterSet(Set filters) { this.filters = filters; inputClass = Object.class; outputClass = Object.class; }
size = size+1-1;
public boolean hasSequence(String id) throws BioException { try { Sequence seq = db.allEntryPointsDB().getSequence(id); int size = seq.length(); } catch (IllegalIDException ex) { return false; } return true; }
throw new NoSuchElementException("No valid search result could be parsed from this stream. " + "Failed at line: "
throw new NoSuchElementException("No valid search result could be parsed from this stream: " + "parse failed at line "
public Object next() throws NoSuchElementException { if (! moreSearchesAvailable) throw new NoSuchElementException("Attempt to read search result from empty stream"); try { moreSearchesAvailable = parser.parseSearch(lnReader, handler); return handler.makeSearchResult(); } catch (ParserException pex) ...
throw new NoSuchElementException("No valid search foo result could be parsed from this stream");
throw new NoSuchElementException("No valid search result could be parsed from this stream");
public Object next() throws NoSuchElementException { if (! moreSearchesAvailable) throw new NoSuchElementException("Attempt to read search result from empty stream"); try { moreSearchesAvailable = parser.parseSearch(lnReader, handler); return handler.makeSearchResult(); } catch (ParserException pex) ...
throw new NoSuchElementException("No valid search bar result could be parsed from this stream");
throw new NoSuchElementException("No valid search result could be parsed from this stream: " + bex.getMessage());
public Object next() throws NoSuchElementException { if (! moreSearchesAvailable) throw new NoSuchElementException("Attempt to read search result from empty stream"); try { moreSearchesAvailable = parser.parseSearch(lnReader, handler); return handler.makeSearchResult(); } catch (ParserException pex) ...
ComponentFeature removedCF = ((TranslatedSymbolList) components.remove(loc)).getFeature();
public void removeComponent(ComponentFeature f) { // search thru current components to // remove the specified component for (int i=0; i< componentList.size(); i++) { Location loc = (Location) componentList.get(i); TranslatedSymbolList sl = (TranslatedSymbolList) component...
catch (BioException bex)
catch (BioException be)
public void endSubHit() { hitAnnotation = createAnnotation(hitData); try { SeqSimilaritySearchHit hit = createHit(hitData, hitAnnotation); searchHits.add(hit); } catch (BioException bex) { bex.printStackTrace(); } }
bex.printStackTrace();
be.printStackTrace();
public void endSubHit() { hitAnnotation = createAnnotation(hitData); try { SeqSimilaritySearchHit hit = createHit(hitData, hitAnnotation); searchHits.add(hit); } catch (BioException bex) { bex.printStackTrace(); } }
catch (BioException bex)
catch (BioException be)
public void setQuerySeq(final 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 seque...
throw new BioException(bex, "Failed to retrieve query sequence from holder using ID: "
throw new BioException(be, "Failed to retrieve query sequence from holder using ID: "
public void setQuerySeq(final 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 seque...
if(line.length() == 0) { continue; }
public boolean readSequence( BufferedReader reader, SymbolParser symParser, SeqIOListener listener) throws IllegalSymbolException, IOException, ParseException { GenbankContext ctx = new GenbankContext(symParser, listener); String line; StreamParser sParser = null; boolean hasAnotherSequence = true; listene...
DOMParser parser = new DOMParser();
DOMParser parser = DASSequence.nonvalidatingParser();
private boolean fetchAll(Ticket trigger) throws ParseException, BioException { try { boolean canFetchMulti = DASCapabilities.checkCapable(new URL(dataSourceURL, ".."), DASCapabilities.CAPABILITY_EXTENDED, DASCapabilities.CAPABILITY_EXTENDED_FEATURES); if (!canFetchMulti) { return...
public AnonymousSeqImpl(SymbolList resList) throws IllegalAlphabetException {
public AnonymousSeqImpl(SymbolList symList) throws IllegalAlphabetException {
public AnonymousSeqImpl(SymbolList resList) throws IllegalAlphabetException { String alphaName = symList.getAlphabet().getName(); seqType = null; if(alphaName.startsWith("DNA")) { seqType = SeqType.DNA; } else if(alphaName.startsWith("RNA")) { seqType = SeqType.RNA; } else if(alphaName.starts...
if (form.equals("quoted")) tb.append("=\"" + value + "\""); else if (form.equals("bare")) tb.append("=" + value); else if (! form.equals("empty")) throw new ParseException("Unrecognised qualifier format: " + form);
if (Collection.class.isInstance(value)) { for (Iterator vi = ((Collection) value).iterator(); vi.hasNext();) { tb.append(makeStringsByForm(vi.next(), form)); } } else { tb.append(makeStringsByForm(value, form)); }
public void addFeatureProperty(Object key, Object value) throws ParseException { // There are 21 spaces in the leader String leader = " "; // Default is to quote unknown qualifiers String form = "quoted"; StringBuffer tb = new StringBuffer("/" + key); if (qualifierData.containsKey...
String format = firstToken(r.readLine());
r.readLine();
public static SVMClassifierModel readModelFile(String fileName) throws IOException { BufferedReader r = new BufferedReader(new FileReader(fileName)); String format = firstToken(r.readLine()); String kType = firstToken(r.readLine()); String dParam = firstToken(r.readLine()); String gParam = firstToken(r.readLine(...
String sParam = firstToken(r.readLine()); String rParam = firstToken(r.readLine()); String uParam = r.readLine(); String numSV = firstToken(r.readLine());
r.readLine(); r.readLine(); r.readLine(); r.readLine();
public static SVMClassifierModel readModelFile(String fileName) throws IOException { BufferedReader r = new BufferedReader(new FileReader(fileName)); String format = firstToken(r.readLine()); String kType = firstToken(r.readLine()); String dParam = firstToken(r.readLine()); String gParam = firstToken(r.readLine(...
int size = Integer.parseInt(numSV);
public static SVMClassifierModel readModelFile(String fileName) throws IOException { BufferedReader r = new BufferedReader(new FileReader(fileName)); String format = firstToken(r.readLine()); String kType = firstToken(r.readLine()); String dParam = firstToken(r.readLine()); String gParam = firstToken(r.readLine(...
public CompoundLocation(List locations) { System.out.println(locations.toString());
public CompoundLocation(List locs) {
public CompoundLocation(List locations) { System.out.println(locations.toString()); List working = new ArrayList(); for(Iterator i = locations.iterator(); i.hasNext(); ) { for(Iterator bi = ((Location) i.next()).blockIterator(); bi.hasNext(); ) { Location bl = (Location) bi.next(); if(bl...
for(Iterator i = locations.iterator(); i.hasNext(); ) {
for(Iterator i = locs.iterator(); i.hasNext(); ) {
public CompoundLocation(List locations) { System.out.println(locations.toString()); List working = new ArrayList(); for(Iterator i = locations.iterator(); i.hasNext(); ) { for(Iterator bi = ((Location) i.next()).blockIterator(); bi.hasNext(); ) { Location bl = (Location) bi.next(); if(bl...
Collections.sort(this.locations, Location.naturalOrder);
Collections.sort(working, Location.naturalOrder);
public CompoundLocation(List locations) { System.out.println(locations.toString()); List working = new ArrayList(); for(Iterator i = locations.iterator(); i.hasNext(); ) { for(Iterator bi = ((Location) i.next()).blockIterator(); bi.hasNext(); ) { Location bl = (Location) bi.next(); if(bl...
System.out.println(this.locations.toString());
public CompoundLocation(List locations) { System.out.println(locations.toString()); List working = new ArrayList(); for(Iterator i = locations.iterator(); i.hasNext(); ) { for(Iterator bi = ((Location) i.next()).blockIterator(); bi.hasNext(); ) { Location bl = (Location) bi.next(); if(bl...
System.out.println("found "+numFound);
AceSet select(String clazz, String namePattern) throws AceException { AceSocket sock = null; try { sock = takeSocket(); String result = sock.transact("find " + clazz + " " + namePattern); int mpos = result.indexOf("// Found "); if (mpos < 0) return null; // FIXME? int...
setGraphicsOrigin(50.0-sequenceToGraphics(range.getMin()));
public void paintComponent(Graphics g) { if(!isActive()) { return; } Graphics2D g2 = (Graphics2D) g; AffineTransform oldTransform = g2.getTransform(); Rectangle2D currentClip = g2.getClip().getBounds2D(); // do a transform to offset drawing to the neighbourhood of zero. // the 50 here is...
System.out.println("No sequence");
public void resizeAndValidate() { //System.out.println("resizeAndValidate starting"); Dimension d = null; if(!isActive()) { System.out.println("No sequence"); // no sequence - collapse down to no size at all leadingBorder.setSize(0.0); trailingBorder.setSize(0.0); d = new Dimensi...
throw new BioRuntimeException(ex, "Error instantiating DistComponentFeature");
throw new BioRuntimeException(ex, "Error instantiating DistComponentFeature for: " + f);
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...
throws ChangeVetoException, BioException { String seqName = idmaker.calcID(seq); int version = 1;
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 BioException("Can't store sequences in BioSQL unless they can be sen...
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...
Alphabet seqAlpha = seq.getAlphabet(); SymbolTokenization seqToke; try { seqToke = seqAlpha.getTokenization("token"); } catch (Exception ex) { throw new BioException("Can't store sequences in BioSQL unless they can be sensibly tokenized/detokenized", ex); } Connection conn = null; try { conn = dataSource.getConnection...
Connection conn = null; try { conn = dataSource.getConnection(); conn.setAutoCommit(false); ResultSet rs;
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...
int version = 1;
int version = 1; Connection conn = null; try { conn = dataSource.getConnection(); conn.setAutoCommit(false); PreparedStatement create_bioentry = conn.prepareStatement( "insert into bioentry " + "(biodatabase_id, display_id, accession, entry_version, division) " + "values (?, ?, ?, ?, ?)"); create_bioentry.setInt(1, d...
private void _createDummySequence(String id, Alphabet seqAlpha, int length) throws ChangeVetoException, BioException { int version = 1; Connection conn = null; try { conn = dataSource.getConnection(); conn.setAutoCommit(false); PreparedStatement create_bioentry = conn.prepare...
Connection conn = null; try { conn = dataSource.getConnection(); conn.setAutoCommit(false);
PreparedStatement create_dummy = conn.prepareStatement("insert into biosequence " + " (bioentry_id, seq_version, molecule, seq_length) " + "values (?, ?, ?, ?)"); create_dummy.setInt(1, bioentry_id); create_dummy.setInt(2, version); create_dummy.setString(3, seqAlpha.getName()); create_dummy.setInt(4, length); cr...
private void _createDummySequence(String id, Alphabet seqAlpha, int length) throws ChangeVetoException, BioException { int version = 1; Connection conn = null; try { conn = dataSource.getConnection(); conn.setAutoCommit(false); PreparedStatement create_bioentry = conn.prepare...
PreparedStatement create_bioentry = conn.prepareStatement( "insert into bioentry " + "(biodatabase_id, display_id, accession, entry_version, division) " + "values (?, ?, ?, ?, ?)"); create_bioentry.setInt(1, dbid); create_bioentry.setString(2, id); create_bioentry.setString(3, id); create_bioentry.setInt(4, version); c...
conn.commit(); conn.close(); } catch (SQLException ex) { boolean rolledback = false; if (conn != null) { try { conn.rollback(); rolledback = true; } catch (SQLException ex2) {} } throw new BioRuntimeException("Error adding BioSQL tables" + (rolledback ? " (rolled back successfully)" : ""), ex); }
private void _createDummySequence(String id, Alphabet seqAlpha, int length) throws ChangeVetoException, BioException { int version = 1; Connection conn = null; try { conn = dataSource.getConnection(); conn.setAutoCommit(false); PreparedStatement create_bioentry = conn.prepare...
PreparedStatement delete_biosequence = conn.prepareStatement("delete from biosequence where bioentry_id = ?"); delete_biosequence.setInt(1, bioentry_id); delete_biosequence.executeUpdate(); delete_biosequence.close();
PreparedStatement delete_entry = conn.prepareStatement("delete from bioentry where bioentry_id = ?"); delete_entry.setInt(1, bioentry_id); delete_entry.executeUpdate(); delete_entry.close(); } rs.close(); get_sequence.close();
private void _removeSequence(String id) throws BioException, ChangeVetoException { Sequence seq = (Sequence) sequencesByName.get(id); if (seq != null) { seq = null; // Don't want to be holding the reference ourselves! try { Thread.sleep(100L); System.gc(); } catch (Exception ex) { ex.print...
PreparedStatement delete_entry = conn.prepareStatement("delete from bioentry where bioentry_id = ?"); delete_entry.setInt(1, bioentry_id); delete_entry.executeUpdate(); delete_entry.close(); } rs.close(); get_sequence.close();
conn.commit(); conn.close();
private void _removeSequence(String id) throws BioException, ChangeVetoException { Sequence seq = (Sequence) sequencesByName.get(id); if (seq != null) { seq = null; // Don't want to be holding the reference ourselves! try { Thread.sleep(100L); System.gc(); } catch (Exception ex) { ex.print...
conn.commit(); conn.close(); if (!exists) { throw new IllegalIDException("Sequence " + id + " didn't exist"); } } catch (SQLException ex) { boolean rolledback = false; if (conn != null) { try { conn.rollback(); rolledback = true; } catch (SQLException ex2) {} } throw new BioException("Error removing from BioSQL tables...
if (!exists) { throw new IllegalIDException("Sequence " + id + " didn't exist"); } } catch (SQLException ex) { boolean rolledback = false; if (conn != null) { try { conn.rollback(); rolledback = true; } catch (SQLException ex2) {} } throw new BioException("Error removing from BioSQL tables" + (rolledback ? " (rolled ba...
private void _removeSequence(String id) throws BioException, ChangeVetoException { Sequence seq = (Sequence) sequencesByName.get(id); if (seq != null) { seq = null; // Don't want to be holding the reference ourselves! try { Thread.sleep(100L); System.gc(); } catch (Exception ex) { ex.print...
helper = DBHelper.getDBHelper(conn);
helper = DBHelper.getDBHelper(conn); if (! isDbSchemaSupported()) { throw new BioException("This database appears to be an old (pre-Singapore) BioSQL." + " If you need to access it, try an older BioJava snapshot (1.3pre1 or earlier)"); } if (! isBioentryPropertySupported()) { throw new BioException("This database ap...
void initDb(String biodatabase, boolean create) throws BioException { // Create helpers entryChangeHub = new BioSQLEntryChangeHub(this); entryAnnotationChangeHub = new BioSQLEntryAnnotationChangeHub(this, entryChangeHub); featureChangeHub = new BioSQLFeatureChangeHub(this, entryChangeHub); ...
if (! isDbSchemaSupported()) { throw new BioException("This database appears to be an old (pre-Singapore) BioSQL." + " If you need to access it, try an older BioJava snapshot (1.3pre1 or earlier)"); } if (! isBioentryPropertySupported()) { throw new BioException("This database appears to be an old (pre-Cape-Town) BioS...
featuresSQL = new FeaturesSQL(this); try { ontologySQL = new OntologySQL(this); } catch (SQLException ex) { throw new BioException("Error accessing ontologies", ex); }
void initDb(String biodatabase, boolean create) throws BioException { // Create helpers entryChangeHub = new BioSQLEntryChangeHub(this); entryAnnotationChangeHub = new BioSQLEntryAnnotationChangeHub(this, entryChangeHub); featureChangeHub = new BioSQLFeatureChangeHub(this, entryChangeHub); ...
if (value != null) { PreparedStatement insert_new; if (isSPASupported()) { insert_new = conn.prepareStatement("insert into bioentry_qualifier_value " + " (bioentry_id, term_id, value, rank) " + "values (?, intern_ontology_term( ? ), ?, ?)"); if (value instanceof Collection) { int cnt = 0; for (Iterator i = ((Coll...
if (value != null) { PreparedStatement insert_new; if (isSPASupported()) { insert_new = conn.prepareStatement("insert into bioentry_qualifier_value " + " (bioentry_id, term_id, value, rank) " + "values (?, intern_ontology_term( ? ), ?, ?)"); if (value instanceof Collection) { int cnt = 0; for (Iterator i = ((Coll...
void persistBioentryProperty(Connection conn, int bioentry_id, Object key, Object value, boolean removeFirst, boolean silent) throws SQLException { String keyString = key.toString(); // Ought to check for special-case keys. (or just wait 'til the special case // tables get nuked :-) //...
insert_new.setInt(4, ++cnt); insert_new.setString(3, i.next().toString());
insert_new.setInt(3, 1); insert_new.setString(3, value.toString());
void persistBioentryProperty(Connection conn, int bioentry_id, Object key, Object value, boolean removeFirst, boolean silent) throws SQLException { String keyString = key.toString(); // Ought to check for special-case keys. (or just wait 'til the special case // tables get nuked :-) //...
insert_new.setInt(1, bioentry_id); insert_new.setString(2, keyString); insert_new.setInt(3, 1); insert_new.setString(3, value.toString()); insert_new.executeUpdate(); } } else { insert_new = conn.prepareStatement("insert into bioentry_qualifier_value " + " (bioentry_id, term_id, rank, value) " + "values (?, ?, ?,...
insert_new = conn.prepareStatement("insert into bioentry_qualifier_value " + " (bioentry_id, term_id, rank, value) " + "values (?, ?, ?, ?)"); int termID = intern_ontology_term(conn, keyString); if (value instanceof Collection) { int cnt = 0; for (Iterator i = ((Collection) value).iterator(); i.hasNext(); ) { ins...
void persistBioentryProperty(Connection conn, int bioentry_id, Object key, Object value, boolean removeFirst, boolean silent) throws SQLException { String keyString = key.toString(); // Ought to check for special-case keys. (or just wait 'til the special case // tables get nuked :-) //...
insert_new.setInt(3, ++cnt); insert_new.setString(4, i.next().toString());
insert_new.setInt(3, 1); insert_new.setString(4, value.toString());
void persistBioentryProperty(Connection conn, int bioentry_id, Object key, Object value, boolean removeFirst, boolean silent) throws SQLException { String keyString = key.toString(); // Ought to check for special-case keys. (or just wait 'til the special case // tables get nuked :-) //...
} else { insert_new.setInt(1, bioentry_id); insert_new.setInt(2, termID); insert_new.setInt(3, 1); insert_new.setString(4, value.toString()); insert_new.executeUpdate();
void persistBioentryProperty(Connection conn, int bioentry_id, Object key, Object value, boolean removeFirst, boolean silent) throws SQLException { String keyString = key.toString(); // Ought to check for special-case keys. (or just wait 'til the special case // tables get nuked :-) //...
insert_new.close();
void persistBioentryProperty(Connection conn, int bioentry_id, Object key, Object value, boolean removeFirst, boolean silent) throws SQLException { String keyString = key.toString(); // Ought to check for special-case keys. (or just wait 'til the special case // tables get nuked :-) //...
}
void persistBioentryProperty(Connection conn, int bioentry_id, Object key, Object value, boolean removeFirst, boolean silent) throws SQLException { String keyString = key.toString(); // Ought to check for special-case keys. (or just wait 'til the special case // tables get nuked :-) //...
if (title.length()>1) {
if (val.length()>1) {
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; //bool...
val = val.substring(0,val.length()-1);
if (val.charAt(val.length()-1)=='.') val = val.substring(0,val.length()-1);
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; //bool...
Set authSet = DocRefAuthor.Tools.parseAuthorString(authors);
List authSet = DocRefAuthor.Tools.parseAuthorString(authors);
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; //bool...
if(! (subAlpha instanceof FiniteAlphabet) ) {
if(! (sa instanceof FiniteAlphabet) ) {
public UniformMatchState(Alphabet a) throws IllegalAlphabetException { this.alpha = (CrossProductAlphabet) a; Iterator i = alpha.getAlphabets().iterator(); Alphabet sa = (Alphabet) i.next(); if(! (subAlpha instanceof FiniteAlphabet) ) { throw new IllegalAlphabetException( "Can't generate a UniformMatchStat...
Symbol gap = AlphabetManager.getGapSymbol();
public static String createRegex(SymbolList motif) { if (motif.length() == 0) throw new IllegalArgumentException("SymbolList was empty"); StringBuffer regex = new StringBuffer(); Stack stack = new Stack(); try { SymbolTokenization sToke = mo...
this.format = format;
public BioIndexSequenceDB(BioStore store, SequenceFormat format) { this.store = store; this.format = format; }
this.liStore = liStore; this.uniqueStore = uniqueStore;
public FlatFileUnigeneDB( BioStore dataStore, BioStore liStore, BioStore uniqueStore, BioStore allStore ) throws BioException { this.dataStore = dataStore; this.liStore = liStore; this.uniqueStore = uniqueStore; this.allStore = allStore; try { clusterCache = new WeakValueHashMap(); ...
String line;
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; //bool...
String organism = null;
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; //bool...
String status = null;
public boolean readRichSequence(BufferedReader reader, SymbolTokenization symParser, RichSeqIOListener rlistener, Namespace ns) throws IllegalSymbolException, IOException, ParseException { String line; boolean hasAnotherSequence = true; //bool...
String currKey = null; StringBuffer currVal = new StringBuffer();
private List readSection(BufferedReader br) throws ParseException { List section = new ArrayList(); String line; String currKey = null; StringBuffer currVal = new StringBuffer(); boolean done = false; int linecount = 0; // while not done try { ...
int linecount = 0;
private List readSection(BufferedReader br) throws ParseException { List section = new ArrayList(); String line; String currKey = null; StringBuffer currVal = new StringBuffer(); boolean done = false; int linecount = 0; // while not done try { ...
0)) { Matcher matcher = mtc.matcher(line); sequenceName = matcher.group(1).trim(); if (sequenceName == null) {
0)) { Matcher matcher = mtc.matcher(line); if (!matcher.find()) {
public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; String sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which seque...
e.printStackTrace();
public Alignment read (BufferedReader reader) { Vector sequenceNames = new Vector(); String sequenceName = null; String sequenceData[] = null; int startOfData = 0; //the start of the sequence data in the line int currSeqCount = 0; //which seque...
ortho.setTitle(title);
if (ortho != null) { ortho.setTitle(title); }
public void addTitle(int taxonID, String homologeneID, String title) { // retrieve the Orthologue Orthologue ortho = db.getOrthologue(homologeneID); ortho.setTitle(title); }
switch (trigger.getReason()) { case TriggerCallRequest.TRIGGER_REASON_UPDATE : paramClasses = new Class[2]; paramClasses[0] = pcl; paramClasses[1] = pcl; break; case TriggerCallRequest.TRIGGER_REASON_DELETE : case TriggerCallRequest.TRIGGER_REASON_INSERT : paramClasses = new Class[1]; paramClasses[0] = pcl; break;
if (trigger.getRowmode() == TriggerCallRequest.TRIGGER_ROWMODE_ROW) { switch (trigger.getReason()) { case TriggerCallRequest.TRIGGER_REASON_UPDATE : paramClasses = new Class[2]; paramClasses[0] = pcl; paramClasses[1] = pcl; break; case TriggerCallRequest.TRIGGER_REASON_DELETE : case TriggerCallRequest.TRIGGER_REASON_IN...
public Message executeTrigger(TriggerCallRequest trigger) { try { logger.debug("executing trigger --> "); Tuple tpl = trigger.getReason() == TriggerCallRequest.TRIGGER_REASON_DELETE ? trigger.getOld() : trigger.getNew(); Class pcl = tupleMapper.getMappedClass(tpl); logger.debug("class" + pcl); Class...
switch (trigger.getReason()) { case TriggerCallRequest.TRIGGER_REASON_UPDATE : paramObjects = new Object[2]; paramObjects[0] = tupleMapper.mapTuple(trigger.getNew()); paramObjects[1] = tupleMapper.mapTuple(trigger.getOld()); break; case TriggerCallRequest.TRIGGER_REASON_DELETE : paramObjects = new Object[1]; paramObjec...
if (trigger.getRowmode() == TriggerCallRequest.TRIGGER_ROWMODE_ROW) { switch (trigger.getReason()) { case TriggerCallRequest.TRIGGER_REASON_UPDATE : paramObjects = new Object[2]; paramObjects[0] = tupleMapper .mapTuple(trigger.getNew()); paramObjects[1] = tupleMapper .mapTuple(trigger.getOld()); break; case TriggerCall...
public Message executeTrigger(TriggerCallRequest trigger) { try { logger.debug("executing trigger --> "); Tuple tpl = trigger.getReason() == TriggerCallRequest.TRIGGER_REASON_DELETE ? trigger.getOld() : trigger.getNew(); Class pcl = tupleMapper.getMappedClass(tpl); logger.debug("class" + pcl); Class...
Result res = typemapper.createResult(retObj);
Tuple t = tupleMapper.backMap(retObj, typemapper); TupleResult res = new TupleResult(); res.setTuple(t); res.setClient(trigger.getClient());
public Message executeTrigger(TriggerCallRequest trigger) { try { logger.debug("executing trigger --> "); Tuple tpl = trigger.getReason() == TriggerCallRequest.TRIGGER_REASON_DELETE ? trigger.getOld() : trigger.getNew(); Class pcl = tupleMapper.getMappedClass(tpl); logger.debug("class" + pcl); Class...
stream.println(SeqFormatTools.formatQualifierBlock(SeqFormatTools.formatQualifier(key, vi.next()), leader, 80));
StringBuffer sb = formatQualifierBlock(new StringBuffer(), formatQualifier(key, vi.next()), leader, 80); stream.println(sb);
public void addFeatureProperty(final Object key, final Object value) throws ParseException { // There are 19 spaces in the leader String leader = "FT "; // Don't print internal data structures if (key.equals(Feature.PROPERTY_DATA_KEY)) return; // The value may be...
stream.println(SeqFormatTools.formatQualifierBlock(SeqFormatTools.formatQualifier(key, value), leader, 80));
StringBuffer sb =formatQualifierBlock(new StringBuffer(), formatQualifier(key, value), leader, 80); stream.println(sb);
public void addFeatureProperty(final Object key, final Object value) throws ParseException { // There are 19 spaces in the leader String leader = "FT "; // Don't print internal data structures if (key.equals(Feature.PROPERTY_DATA_KEY)) return; // The value may be...
StringBuffer sq = new StringBuffer("XX\nSQ Sequence ");
String nl = System.getProperty("line.separator"); StringBuffer sq = new StringBuffer("XX"); sq.append(nl); sq.append("SQ Sequence ");
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...
String blocks = (SeqFormatTools.formatTokenBlock(sa, 10)).toString();
String blocks = (formatTokenBlock(new StringBuffer(sa.length), sa, 10)).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...
StringBuffer lb = SeqFormatTools.formatLocationBlock(templ.location, strand, leader, 80);
StringBuffer lb = formatLocationBlock(new StringBuffer(leader), templ.location, strand, leader, 80);
public void startFeature(final Feature.Template templ) throws ParseException { // There are 19 spaces in the leader String leader = "FT "; int strand = 0; if (templ instanceof StrandedFeature.Template) strand = ((StrandedFeature.Template) templ)....
String key = rs.getString(1);
String key = rs.getString(1).trim();
private void initAnnotations() { try { Connection conn = seqDB.getPool().takeConnection(); PreparedStatement get_annotations = conn.prepareStatement("select ontology_term.term_name, seqfeature_qualifier_value.qualifier_value " + " from ontology_term, seqfeature_qualifier_value " + ...
this.sourceTerm = sourceTerm;
this.sourceTerm = t;
public void setSourceTerm(Term t) throws ChangeVetoException { if(hasListeners()) { ChangeSupport cs = getChangeSupport(TYPE); synchronized (cs) { ChangeEvent ce_term = new ChangeEvent(this, SOURCETERM, t, this.getSourceTerm()); ChangeEvent ce_nam...
this.typeTerm = typeTerm;
this.typeTerm = t;
public void setTypeTerm(Term t) throws ChangeVetoException { if(hasListeners()) { ChangeSupport cs = getChangeSupport(TYPE); synchronized (cs) { ChangeEvent ce_term = new ChangeEvent(this, TYPETERM, t, this.getTypeTerm()); ChangeEvent ce_name = ne...
this.assertEquals(expected, actual);
assertEquals(expected, actual);
public void testBoundedPointLocationGenbank() { String expected = ">12"; sb.delete(0, sb.length()); String actual = fileFormer.formatLocation(sb, mBoundedPointLocation, PLUS).toString(); this.assertEquals(expected, actual); }
this.assertEquals(expected, actual);
assertEquals(expected, actual);
public void testBoundedPointRangedPointRangedLocationGenbank() { String expected = "<94..(200.250)"; sb.delete(0, sb.length()); String actual = fileFormer.formatLocation(sb, mBoundedPointRangedPointRangedLocation, PLUS).toString(); this.assertEquals(expected, actual); }
this.assertEquals(expected, actual);
assertEquals(expected, actual);
public void testBoundedRangedLocationGenbank() { String expected = "<345..500"; sb.delete(0, sb.length()); String actual = fileFormer.formatLocation(sb, mBoundedRangedLocation, PLUS).toString(); this.assertEquals(expected, actual); }