diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index e46cd42..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -.classpath merge=ours diff --git a/.gitignore b/.gitignore index 2ff2ffd..457417d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ TEST-* hs_err_pid* /genomeview-*.zip /save.bed +/target/ +/.settings/ +/.project diff --git a/.project b/.project deleted file mode 100644 index 67304da..0000000 --- a/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - GenomeView - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/README.md b/README.md index 99ff333..9d6f7de 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,12 @@ # genomeview +Documentation, manuals, video, sample files, etc are available [here](https://github.com/GenomeView/genomeviewweb). + - -Import in Eclipse: -- Make sure you have the EGit plugin or similar installed in Eclipse -- Clone the repository: https://github.com/GenomeView/genomeview.git -- Add all libraries in lib/ to the classpath - -- Add 'src' and 'resources' as source folders. - -- If you want to run the Unit tests: - * Add a JUnit 4 library - * Add the 'junit' folder as a source folder - -# Jannot -Old documentation from before Jannot was integrated within GenomeView - -API docs are part of the download - -- Add all libraries in lib/ to the classpath - -- Add 'src' as a source folder. - - -- If you want to run the Unit tests: - * Add a JUnit 4 library to your Eclipse class path, there is a version included in the 'test/lib' folder - * Add the 'test/src' folder as a source folder \ No newline at end of file diff --git a/build.xml b/build.xml deleted file mode 100644 index 965d5c9..0000000 --- a/build.xml +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/junit/lib/junit-4.8.2.jar b/junit/lib/junit-4.8.2.jar deleted file mode 100644 index 5b4bb84..0000000 Binary files a/junit/lib/junit-4.8.2.jar and /dev/null differ diff --git a/junit/resource/.gitignore b/junit/resource/.gitignore deleted file mode 100644 index 4ca3393..0000000 --- a/junit/resource/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.gz -*.tbi \ No newline at end of file diff --git a/junit/resource/ItemRGBDemo.txt b/junit/resource/ItemRGBDemo.txt deleted file mode 100644 index b3cb680..0000000 --- a/junit/resource/ItemRGBDemo.txt +++ /dev/null @@ -1,14 +0,0 @@ -browser position chr7:127471196-127495720 -browser hide all -track name="ItemRGBDemo" description="Item RGB demonstration" visibility=2 itemRgb="On" -chr7 127471196 127472363 Pos1 0 + 127471196 127472363 255,0,0 -chr7 127472363 127473530 Pos2 0 + 127472363 127473530 255,0,0 -chr7 127473530 127474697 Pos3 0 + 127473530 127474697 255,0,0 -chr7 127474697 127475864 Pos4 0 + 127474697 127475864 255,0,0 -chr7 127475864 127477031 Neg1 0 - 127475864 127477031 0,0,255 -chr7 127477031 127478198 Neg2 0 - 127477031 127478198 0,0,255 -chr7 127478198 127479365 Neg3 0 - 127478198 127479365 0,0,255 -chr7 127479365 127480532 Pos5 0 + 127479365 127480532 255,0,0 -chr7 127480532 127481699 Neg4 0 - 127480532 127481699 0,0,255 - - diff --git a/junit/resource/brokensession1.gvs b/junit/resource/brokensession1.gvs deleted file mode 100644 index 2806d4c..0000000 --- a/junit/resource/brokensession1.gvs +++ /dev/null @@ -1,2 +0,0 @@ -#genomeview session -broken_session \ No newline at end of file diff --git a/junit/resource/junit.txt b/junit/resource/junit.txt deleted file mode 100644 index 0d07c78..0000000 --- a/junit/resource/junit.txt +++ /dev/null @@ -1 +0,0 @@ -This is a test file for GenomeView and JAnnot \ No newline at end of file diff --git a/junit/resource/readme.txt b/junit/resource/readme.txt deleted file mode 100644 index 6c61da3..0000000 --- a/junit/resource/readme.txt +++ /dev/null @@ -1,4 +0,0 @@ -Download to files in this directory: - -ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/trio/snps/CEU.trio.2010_03.genotypes.vcf.gz -ftp://ftp-trace.ncbi.nih.gov/1000genomes/ftp/pilot_data/release/2010_07/trio/snps/CEU.trio.2010_03.genotypes.vcf.gz.tbi \ No newline at end of file diff --git a/junit/resource/testsession.gvs b/junit/resource/testsession.gvs deleted file mode 100644 index 9fbbd46..0000000 --- a/junit/resource/testsession.gvs +++ /dev/null @@ -1,2 +0,0 @@ -##GENOMEVIEW SESSION## -alias: genome=Display name \ No newline at end of file diff --git a/junit/resource/tiny.vcf b/junit/resource/tiny.vcf deleted file mode 100644 index 5bd3224..0000000 --- a/junit/resource/tiny.vcf +++ /dev/null @@ -1,23 +0,0 @@ -##fileformat=VCFv4.0 -##fileDate=20090805 -##source=myImputationProgramV3.1 -##reference=1000GenomesPilot-NCBI36 -##phasing=partial -##INFO= -##INFO= -##INFO= -##INFO= -##INFO= -##INFO= -##FILTER= -##FILTER= -##FORMAT= -##FORMAT= -##FORMAT= -##FORMAT= -#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA00001 NA00002 NA00003 -20 14370 rs6054257 G A 29 PASS NS=3;DP=14;AF=0.5;DB;H2 GT:GQ:DP:HQ 0|0:48:1:51,51 1|0:48:8:51,51 1/1:43:5:.,. -20 17330 . T A 3 q10 NS=3;DP=11;AF=0.017 GT:GQ:DP:HQ 0|0:49:3:58,50 0|1:3:5:65,3 0/0:41:3 -20 1110696 rs6040355 A G,T 67 PASS NS=2;DP=10;AF=0.333,0.667;AA=T;DB GT:GQ:DP:HQ 1|2:21:6:23,27 2|1:2:0:18,2 2/2:35:4 -20 1230237 . T . 47 PASS NS=3;DP=13;AA=T GT:GQ:DP:HQ 0|0:54:7:56,60 0|0:48:4:51,51 0/0:61:2 -20 1234567 microsat1 GTCT G,GTACT 50 PASS NS=3;DP=9;AA=G GT:GQ:DP 0/1:35:4 0/2:17:2 1/1:40:3 \ No newline at end of file diff --git a/junit/src/interactive/InteractiveTestIndex.java b/junit/src/interactive/InteractiveTestIndex.java deleted file mode 100644 index 4241c26..0000000 --- a/junit/src/interactive/InteractiveTestIndex.java +++ /dev/null @@ -1,43 +0,0 @@ -package interactive; - -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; - -import javax.swing.JFrame; - -import net.sf.genomeview.data.DataSourceHelper; -import net.sf.genomeview.data.Model; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.source.Locator; - -import org.junit.Test; - -import support.DataManager; - -public class InteractiveTestIndex { - - @Test - public void testAutoIndex(){ - File f= DataManager.file("tworead.bam"); - try { - JFrame frame=new JFrame("dummy"); - frame.pack(); - frame.setVisible(true); - Model model=new Model("test"); - model.getGUIManager().registerMainWindow(frame); - DataSourceHelper.load(model, new Locator(f)); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ReadFailedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - - } -} diff --git a/junit/src/interactive/InteractiveTestSaveDialog.java b/junit/src/interactive/InteractiveTestSaveDialog.java deleted file mode 100644 index 5f1e14c..0000000 --- a/junit/src/interactive/InteractiveTestSaveDialog.java +++ /dev/null @@ -1,48 +0,0 @@ -package interactive; - -import java.io.IOException; - -import junit.framework.Assert; -import net.sf.genomeview.core.Configuration; -import net.sf.genomeview.data.Model; -import net.sf.genomeview.data.Session; -import net.sf.genomeview.gui.dialog.SaveDialog; - -import org.junit.Test; - -public class InteractiveTestSaveDialog { - - @Test - public void testSaveDialog1(){ - - Model model=new Model("test"); - try { - Session.loadSession(model, Configuration.getDirectory()+"/previous.gvs"); - } catch (IOException e) { - Assert.fail(); - e.printStackTrace(); - } - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - SaveDialog sd=new SaveDialog(model); - - Configuration.set("save:defaultLocation", "c:/test.bam"); - - sd=new SaveDialog(model); - - - Configuration.set("save:defaultLocation", "c:/test2.bam"); - Configuration.set("save:defaultParser","EMBL"); - Configuration.set("save:enableIncludeSequence","false"); - Configuration.set("save:enableEntrySelection", "false"); - Configuration.set("save:enableTypeSelection", "false"); - sd=new SaveDialog(model); - - - } - -} diff --git a/junit/src/interactive/InteractiveTestSession.java b/junit/src/interactive/InteractiveTestSession.java deleted file mode 100644 index cb87c51..0000000 --- a/junit/src/interactive/InteractiveTestSession.java +++ /dev/null @@ -1,26 +0,0 @@ -package interactive; - -import java.io.File; -import java.io.FileNotFoundException; - -import net.sf.genomeview.data.Model; -import net.sf.genomeview.data.Session; - -import org.junit.Assert; -import org.junit.Test; - -public class InteractiveTestSession { - @Test - public void testSessionParser() throws FileNotFoundException { - Model model = new Model("TestModel"); - Thread t = Session.loadSession(model, new File("junit/resource/brokensession1.gvs")); - try { - t.join(); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Assert.fail(); - } - - } -} diff --git a/junit/src/interactive/InteractiveTestTryAgainHandler.java b/junit/src/interactive/InteractiveTestTryAgainHandler.java deleted file mode 100644 index fa5e860..0000000 --- a/junit/src/interactive/InteractiveTestTryAgainHandler.java +++ /dev/null @@ -1,27 +0,0 @@ -package interactive; - -import net.sf.genomeview.data.DataSourceHelper; -import net.sf.genomeview.data.Model; -import net.sf.genomeview.gui.dialog.TryAgainHandler; -import net.sf.jannot.source.Locator; - -public class InteractiveTestTryAgainHandler { - - /** - * @param args - */ - public static void main(String[] args) { - final Model model=new Model(null); - TryAgainHandler.ask(model, "Let's try again", new Runnable() { - public void run() { - try { - DataSourceHelper.load(model, new Locator("http://www.broadinstitute.org/software/genomeview/demo/c_elegans//IV.gff.gz")); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - }); - - } - -} diff --git a/junit/src/interactive/VisualTestConfiguration.java b/junit/src/interactive/VisualTestConfiguration.java deleted file mode 100644 index 51b1477..0000000 --- a/junit/src/interactive/VisualTestConfiguration.java +++ /dev/null @@ -1,33 +0,0 @@ -package interactive; - -import java.util.List; - -import net.sf.genomeview.core.Configuration; - -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * - * @author Thomas Abeel - * - */ - -public class VisualTestConfiguration { - - @BeforeClass - static public void start() { - Configuration.set("track:feature:labelIdentifiers", "protein_id,Name,ID,gene,label,note"); - } - - @Test - public void testGetList() { - List list = Configuration.getStringList("track:feature:labelIdentifiers"); - Assert.assertEquals(6,list.size()); - Assert.assertTrue(list.contains("protein_id")); - Assert.assertTrue(list.contains("ID")); - Assert.assertTrue(list.contains("note")); - - } -} diff --git a/junit/src/interactive/VisualTestFeatureUtils.java b/junit/src/interactive/VisualTestFeatureUtils.java deleted file mode 100644 index 57a58a2..0000000 --- a/junit/src/interactive/VisualTestFeatureUtils.java +++ /dev/null @@ -1,33 +0,0 @@ -package interactive; - -import junit.framework.Assert; -import net.sf.genomeview.core.Configuration; -import net.sf.genomeview.gui.viztracks.annotation.FeatureUtils; -import net.sf.jannot.Feature; - -import org.junit.Test; -/** - * - * @author Thomas Abeel - * - */ -public class VisualTestFeatureUtils { - - @Test - public void testDisplayName(){ - Configuration.set("track:feature:labelIdentifiers","protein_id,Name,ID,gene,label,note"); - Feature f=new Feature(); - f.addQualifier("protein_id", "protein"); - f.addQualifier("ID", "ID-display"); - f.addQualifier("note", "note-display"); - - Assert.assertEquals("protein",FeatureUtils.displayName(f)); - f.removeQualifier("protein_id"); - Assert.assertEquals("ID-display",FeatureUtils.displayName(f)); - f.removeQualifier("ID"); - Assert.assertEquals("note-display",FeatureUtils.displayName(f)); - - - } - -} diff --git a/junit/src/interactive/readme.txt b/junit/src/interactive/readme.txt deleted file mode 100644 index 3cb7bcc..0000000 --- a/junit/src/interactive/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Tests that require user interaction because they involve GUI components. diff --git a/junit/src/intermittent/InteractiveTestSessionURL.java b/junit/src/intermittent/InteractiveTestSessionURL.java deleted file mode 100644 index 9027b99..0000000 --- a/junit/src/intermittent/InteractiveTestSessionURL.java +++ /dev/null @@ -1,80 +0,0 @@ -package intermittent; - -import java.io.File; -import java.io.FileNotFoundException; - -import junit.framework.Assert; -import net.sf.genomeview.data.Model; -import net.sf.genomeview.data.Session; - -import org.junit.Test; - -import support.DataManager; - -/** - * - * Hunting for - * - * Aug 28, 2013 6:54:33 PM net.sf.genomeview.data.Session$1 run SEVERE: - * Something went wrong while loading line: U - * http://www.broadinstitute.org/software /genomeview/demo/c_elegans//IV.gff.gz - * from the session file. To recover GenomeView skipped this file. - * - * java.lang.RuntimeException: java.io.EOFException: Unexpected end of ZLIB - * input stream at be.abeel.io.LineIterator.(LineIterator.java:118) at - * be.abeel.io.LineIterator.(LineIterator.java:133) at - * be.abeel.io.LineIterator.(LineIterator.java:90) at - * net.sf.jannot.parser.Parser.findParser(Parser.java:111) at - * net.sf.jannot.parser.Parser.detectParser(Parser.java:96) at - * net.sf.jannot.source.URLSource.init(URLSource.java:35) at - * net.sf.jannot.source.URLSource.(URLSource.java:44) at - * net.sf.jannot.source.DataSourceFactory.create(DataSourceFactory.java:69) at - * net.sf.genomeview.data.DataSourceHelper.load(DataSourceHelper.java:143) at - * net.sf.genomeview.data.DataSourceHelper.load(DataSourceHelper.java:46) at - * net.sf.genomeview.data.Session$1.run(Session.java:124) at - * java.lang.Thread.run(Thread.java:724) - * - * Caused by: java.io.EOFException: Unexpected end of ZLIB input stream at - * java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240) at - * java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) at - * java.util.zip.GZIPInputStream.read(GZIPInputStream.java:116) at - * sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283) at - * sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325) at - * sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177) at - * java.io.InputStreamReader.read(InputStreamReader.java:184) at - * java.io.BufferedReader.fill(BufferedReader.java:154) at - * java.io.BufferedReader.readLine(BufferedReader.java:317) at - * java.io.BufferedReader.readLine(BufferedReader.java:382) at - * be.abeel.io.LineIterator.(LineIterator.java:114) - */ -public class InteractiveTestSessionURL { - - @Test - public void testSessionURL() { - File f = DataManager.file("singlegff.gvs"); - Model model = new Model(null); - try { - Thread t=Session.loadSession(model, f); - try { - t.join(); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Assert.fail(); - } - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Assert.fail(); - } - System.out.println(model.entries().firstEntry()); - Assert.assertEquals("IV", ""+model.entries().firstEntry()); - } catch (FileNotFoundException e) { - Assert.fail(); - e.printStackTrace(); - } - } - -} diff --git a/junit/src/intermittent/readme.txt b/junit/src/intermittent/readme.txt deleted file mode 100644 index b03b217..0000000 --- a/junit/src/intermittent/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -Tests that aim to find bugs that we currently cannot reproduce. - -These tests are our best guess where a reported issue may be an tries to target a reproducible way to find the bug. \ No newline at end of file diff --git a/junit/src/net/sf/genomeview/data/InteractiveTestModel.java b/junit/src/net/sf/genomeview/data/InteractiveTestModel.java deleted file mode 100644 index d72bc59..0000000 --- a/junit/src/net/sf/genomeview/data/InteractiveTestModel.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.genomeview.data; - - -import java.util.concurrent.ExecutionException; - -import net.sf.genomeview.core.Configuration; - -import org.junit.Assert; -import org.junit.Test; - -/** - * - * @author Thomas Abeel - * - */ -public class InteractiveTestModel { - - String v=Configuration.get("version"); - -// static class TModel extends Model{ -// public TModel(String id) { -// super(id); -// -// } -// } -// - - - @Test - public void testClearEntries() { - Model model = new Model(null); - try { - TDataSource ds = new TDataSource(); - ReadWorker rw = new ReadWorker(ds, model); - rw.execute(); - rw.get(); - } catch (InterruptedException e) { - Assert.fail(); - e.printStackTrace(); - } catch (ExecutionException e) { - Assert.fail(); - e.printStackTrace(); - } - Assert.assertEquals(5, model.noEntries()); - model.clearEntries(); - Assert.assertEquals(0, model.noEntries()); - - } - - -} diff --git a/junit/src/net/sf/genomeview/data/InteractiveTestSession.java b/junit/src/net/sf/genomeview/data/InteractiveTestSession.java deleted file mode 100644 index 8a30f9f..0000000 --- a/junit/src/net/sf/genomeview/data/InteractiveTestSession.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.sf.genomeview.data; - -import java.io.File; -import java.io.FileNotFoundException; - -import net.sf.nameservice.NameService; - -import org.junit.Assert; -import org.junit.Test; - -/** - * - * @author Thomas Abeel - * - */ -public class InteractiveTestSession { - - - - @Test - public void testAlias() throws FileNotFoundException{ - Model model=new Model("TestModel"); - Thread t=Session.loadSession(model, new File("junit/resource/testsession.gvs")); - try { - t.join(); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Assert.fail(); - } - Assert.assertEquals("Display name",NameService.getPrimaryName("genome")); - } -} diff --git a/junit/src/net/sf/genomeview/data/TDataSource.java b/junit/src/net/sf/genomeview/data/TDataSource.java deleted file mode 100644 index 912a8f4..0000000 --- a/junit/src/net/sf/genomeview/data/TDataSource.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.sf.genomeview.data; - -import net.sf.jannot.EntrySet; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.source.DataSource; -/** - * - * @author Thomas Abeel - * - */ -class TDataSource extends DataSource { - - protected TDataSource() { - super(null); - // TODO Auto-generated constructor stub - } - - @Override - public EntrySet read(EntrySet add) throws ReadFailedException { - for (int i = 0; i < 5; i++) - add.getOrCreateEntry("entry" + i); - return add; - } - - @Override - public void finalize() { - // TODO Auto-generated method stub - - } - - @Override - public boolean isIndexed() { - // TODO Auto-generated method stub - return false; - } - - @Override - public long size() { - // TODO Auto-generated method stub - return 0; - } - - - - } \ No newline at end of file diff --git a/junit/src/net/sf/jannot/TestAAMapping.java b/junit/src/net/sf/jannot/TestAAMapping.java deleted file mode 100644 index d9a44c5..0000000 --- a/junit/src/net/sf/jannot/TestAAMapping.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import junit.framework.Assert; -import net.sf.jannot.AminoAcidMapping; - -import org.junit.Test; -/** - * - * @author Thomas Abeel - * - */ -public class TestAAMapping { - - @Test - public void testAAmapping(){ - AminoAcidMapping aa=AminoAcidMapping.STANDARDCODE; - AminoAcidMapping ab=AminoAcidMapping.YEASTMITOCHONDRIAL; - AminoAcidMapping ac=AminoAcidMapping.INVERTEBRATEMITOCHONDRIAL; - Assert.assertTrue(true); - } -} diff --git a/junit/src/net/sf/jannot/TestEntrySet.java b/junit/src/net/sf/jannot/TestEntrySet.java deleted file mode 100644 index 2f0464b..0000000 --- a/junit/src/net/sf/jannot/TestEntrySet.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.sf.jannot; - -import junit.framework.Assert; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; - -import org.junit.Test; -/** - * - * @author Thomas Abeel - * - */ -public class TestEntrySet { - @Test - public void testGet() { - EntrySet es=new EntrySet(); - Entry x=es.getOrCreateEntry("chr1"); - Entry y=es.getOrCreateEntry("2"); - Assert.assertNotNull(x); - Assert.assertNotNull(y); - System.out.println(es.getEntry("1")); - Assert.assertNotNull(es.getEntry("1")); - Assert.assertNotNull(es.getEntry("CHR1")); - Assert.assertNotNull(es.getEntry("chr1")); - - System.out.println(es.getEntry("chr2")); - Assert.assertNotNull(es.getEntry("chr2")); - Assert.assertNotNull(es.getEntry("Chr2")); - Assert.assertNotNull(es.getEntry("chR2")); - - - } -} \ No newline at end of file diff --git a/junit/src/net/sf/jannot/TestFeature.java b/junit/src/net/sf/jannot/TestFeature.java deleted file mode 100644 index 7682879..0000000 --- a/junit/src/net/sf/jannot/TestFeature.java +++ /dev/null @@ -1,95 +0,0 @@ -package net.sf.jannot; - -import java.util.ArrayList; -import java.util.List; - - - -import org.junit.Assert; -import org.junit.Test; -import static org.junit.Assert.*; - -/** - * - * @author Thomas Abeel - * - */ -public class TestFeature { - - - @Test - public void testEmptyCopy(){ - Feature f=new Feature(); - Feature g=f.copy(); - } - @Test - public void testFeatures() { - - Feature f=new Feature(); - f.addLocation(new Location(1,100)); - f.copy(); - - } - - @Test - public void testFeatureSetLocation(){ - Feature f=new Feature(); - f.setLocation(new Location(1,10)); - Assert.assertEquals(1, f.start()); - Assert.assertEquals(10, f.end()); - - f.setLocation(new Location(5,15)); - Assert.assertEquals(5, f.start()); - Assert.assertEquals(15, f.end()); - - f.setLocation(new Location[]{new Location(3,13)}); - Assert.assertEquals(3, f.start()); - Assert.assertEquals(13, f.end()); - - f.setLocation(new Location[]{new Location(4,8),new Location(12,16)}); - Assert.assertEquals(4, f.start()); - Assert.assertEquals(16, f.end()); - - f.addLocation(new Location(17,22)); - Assert.assertEquals(4, f.start()); - Assert.assertEquals(22, f.end()); - - List list=new ArrayList(); - list.add(new Location(5,7)); - list.add(new Location(8,11)); - f.setLocation(list); - - Assert.assertEquals(5, f.start()); - Assert.assertEquals(11, f.end()); - - list=new ArrayList(); - list.add(new Location(17,31)); - f.setLocation(list); - - Assert.assertEquals(17, f.start()); - Assert.assertEquals(31, f.end()); - - - } - - @Test - public void testQualifier() { - Feature f=new Feature(); - - assertTrue(f.getQualifiersKeys().size()==0); - - f.addQualifier("protein", "test"); - assertTrue(f.getQualifiersKeys().size()==1); - assertEquals("test", f.qualifier("protein")); - - f.addQualifier("protein", "more"); - assertTrue(f.getQualifiersKeys().size()==1); - assertEquals("test,more", f.qualifier("protein")); - - f.removeQualifier("protein"); - assertTrue(f.getQualifiersKeys().size()==0); - assertEquals(null, f.qualifier("protein")); - - } - -} diff --git a/junit/src/net/sf/jannot/TestLocator.java b/junit/src/net/sf/jannot/TestLocator.java deleted file mode 100644 index 0854046..0000000 --- a/junit/src/net/sf/jannot/TestLocator.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * This file is part of JAnnot. - * - * JAnnot is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * JAnnot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with JAnnot. If not, see . - */ -package net.sf.jannot; - -import java.io.IOException; -import java.net.URISyntaxException; - -import net.sf.jannot.source.Locator; - -import org.junit.Test; - -import be.abeel.io.LineIterator; - -/** - * - * @author Thomas Abeel - * - */ -public class TestLocator { - - @Test - public void testLocalRelativeFile() throws URISyntaxException, IOException { - - Locator l = new Locator("junit/resource/junit.txt"); - for (String line : new LineIterator(l.stream())) { - System.out.println(line); - } - - } - - @Test - public void testLocalAbsoluteFile() throws URISyntaxException, IOException { - String path = new java.io.File(".").getCanonicalPath() + "/junit/resource/junit.txt"; - Locator l = new Locator(path); - for (String line : new LineIterator(l.stream())) { - System.out.println(line); - } - - } - - @Test - public void testURLLocalAbsoluteFile() throws URISyntaxException, IOException { - String path = "file://" + new java.io.File(".").getCanonicalPath() + "/junit/resource/junit.txt"; - Locator l = new Locator(path); - for (String line : new LineIterator(l.stream())) { - System.out.println(line); - } - - } - - @Test - public void testURLLocalFile() throws URISyntaxException, IOException { - - Locator l = new Locator("file://junit/resource/junit.txt"); - for (String line : new LineIterator(l.stream())) { - System.out.println(line); - } - - } - - @Test - public void testURL() throws URISyntaxException, IOException { - Locator l = new Locator("http://genomeview.org/junit.php"); - for (String line : new LineIterator(l.stream())) { - System.out.println(line); - } - - } - -} diff --git a/junit/src/net/sf/jannot/hts/TestMiniBAM.java b/junit/src/net/sf/jannot/hts/TestMiniBAM.java deleted file mode 100644 index 6e656b0..0000000 --- a/junit/src/net/sf/jannot/hts/TestMiniBAM.java +++ /dev/null @@ -1,50 +0,0 @@ -package net.sf.jannot.hts; - -import junit.framework.Assert; -import net.sf.jannot.Data; -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.source.DataSource; -import net.sf.jannot.source.DataSourceFactory; -import net.sf.jannot.source.Locator; - -import org.junit.Test; - -import support.DataManager; - -/** - * - * @author Thomas Abeel - * - */ -public class TestMiniBAM { - @Test - public void testShortRead() { - - Locator fData = new Locator(DataManager.file("tworead.bam")); - Locator fIndex = new Locator(DataManager.file("tworead.bam.bai")); - - try { - DataSource ds = DataSourceFactory.create(fData, fIndex); - Assert.assertNotNull(ds); - EntrySet entries = ds.read(); - Entry e=entries.getEntry("chr4"); - int dkCount=0; - int readCount=0; - for(DataKey dk:e){ - dkCount++; - Data d=e.get(dk); - for(Object o:d.get(73151000, 73152000)){ - readCount++; - System.out.println(o); - } - } - Assert.assertEquals(1, dkCount); - Assert.assertEquals(2, readCount); - } catch (Exception e) { - e.printStackTrace(); - Assert.fail(); - } - } -} diff --git a/junit/src/net/sf/jannot/hts/TestShortRead.java b/junit/src/net/sf/jannot/hts/TestShortRead.java deleted file mode 100644 index d4b55bc..0000000 --- a/junit/src/net/sf/jannot/hts/TestShortRead.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.hts; - -import junit.framework.Assert; -import net.sf.jannot.shortread.BasicShortRead; -import net.sf.jannot.shortread.ShortRead; - -import org.junit.Test; -/** - * - * @author Thomas Abeel - * - */ -public class TestShortRead { - - @Test - public void testShortRead(){ - String seq="TGGGTTTGGCTGGTGCTAGCTCGGCGCCGTATGCGG"; - ShortRead sr=new BasicShortRead(seq.toCharArray(),16,true); - for(int i=1;i<=seq.length();i++){ - char c=sr.getNucleotide(i); - System.out.println(i+"\t"+seq.charAt(i-1)+"\t" +c); - Assert.assertEquals(seq.charAt(i-1), c); - - } - } - -} diff --git a/junit/src/net/sf/jannot/parser/TestBEDParser.java b/junit/src/net/sf/jannot/parser/TestBEDParser.java deleted file mode 100644 index a15413c..0000000 --- a/junit/src/net/sf/jannot/parser/TestBEDParser.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * This file is part of JAnnot. - * - * JAnnot is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * JAnnot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with JAnnot. If not, see . - */ -package net.sf.jannot.parser; - -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.logging.Logger; - -import net.sf.jannot.Data; -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.StringKey; -import net.sf.jannot.Type; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.source.DataSource; -import net.sf.jannot.source.DataSourceFactory; -import net.sf.jannot.source.Locator; - -import org.junit.Assert; -import org.junit.Test; - -import be.abeel.io.LineIterator; - -import support.DataManager; - -/** - * - * @author Thomas Abeel - * - */ -public class TestBEDParser { - private static Logger log = Logger.getLogger(TestBEDParser.class.toString()); - - @Test - public void testParserMini() { - File f = DataManager.file("minibed.bed"); - try { - DataSource ds = DataSourceFactory.create(new Locator(f)); - EntrySet es = ds.read(); - // System.out.println(es.firstEntry()); - Assert.assertEquals("chr7", es.firstEntry().getID()); - int count = 0; - for (Entry e : es) - count++; - Assert.assertEquals(1, count); - Data d = es.firstEntry().get(Type.get("ItemRGBDemo")); - for (DataKey dk : es.firstEntry()) { - System.out.println("Datakey=" + dk); - } - Assert.assertNotNull(d); - - } catch (URISyntaxException e) { - e.printStackTrace(); - Assert.fail(); - } catch (IOException e) { - e.printStackTrace(); - Assert.fail(); - } catch (ReadFailedException e) { - - e.printStackTrace(); - Assert.fail(); - } - } - - @Test - public void testParserBare() { - File f = DataManager.file("barebed.bed"); - try { - DataSource ds = DataSourceFactory.create(new Locator(f)); - EntrySet es = ds.read(); - // System.out.println(es.firstEntry()); - Assert.assertEquals("chr7", es.firstEntry().getID()); - int count = 0; - for (Entry e : es) - count++; - Assert.assertEquals(1, count); - Data d = es.firstEntry().get(Type.get("barebed.bed")); - for (DataKey dk : es.firstEntry()) { - System.out.println("Datakey=" + dk); - } - Assert.assertNotNull(d); - - } catch (URISyntaxException e) { - e.printStackTrace(); - Assert.fail(); - } catch (IOException e) { - e.printStackTrace(); - Assert.fail(); - } catch (ReadFailedException e) { - - e.printStackTrace(); - Assert.fail(); - } - } - - @Test - public void testSave() { - File f = DataManager.file("barebed.bed"); - try{ - DataSource ds = DataSourceFactory.create(new Locator(f)); - EntrySet es = ds.read(); - BEDParser output=new BEDParser("save.bed"); - FileOutputStream fos = new FileOutputStream("save.bed"); - for(Entry e:es){ - output.write(fos, e); - } - fos.close(); - LineIterator it=new LineIterator(new File("save.bed")); - Assert.assertEquals("track name=\"barebed.bed\"", it.next()); - LineIterator expected=new LineIterator(f); - for(String line:it){ - Assert.assertEquals(expected.next(),line.replaceAll("0\\.0", "0")); - } - it.close(); - expected.close(); - }catch(Exception e){ - e.printStackTrace(); - Assert.fail(); - } - } - - @Test - public void test_loadEntries() { - log.info("BEGIN test_loadEntries"); - try { - File fileData = DataManager.file("ItemRGBDemo.txt"); - InputStream is = new FileInputStream(fileData); - - EntrySet entries = new EntrySet(); - BEDParser parser = new BEDParser(fileData.getName()); - log.info(" > fileData: " + fileData + "( " + fileData.length() + " KB)"); - try { - // We parse the sample file - entries = parser.parse(is, null); - log.info(" > Number of entries: " + entries.size()); - // assertTrue(entries.size() > 0); - // We build an ArrayList to access randonmly to a entry - List list = new ArrayList(); - for (Entry entry : entries) { - list.add(entry); - } - int selectedIndex = Math.max(0, (int) Math.round(Math.random() * list.size()) - 1); - Entry selectedEntry = list.get(selectedIndex); - - Iterator it = selectedEntry.iterator(); - List list2 = new ArrayList(); - while (it.hasNext()) { - list2.add(it.next()); - } - int keyIndex = Math.max(0, (int) Math.round(Math.random() * list2.size()) - 1); - - /* retrieve some data from some entry */ - long t3 = System.currentTimeMillis(); - DataKey dataKey = list2.get(keyIndex); - Data data = selectedEntry.get(dataKey); - System.out.println("DD: " + data); - - long t4 = System.currentTimeMillis(); - log.info(" > Time consumed fetching data: " + Math.abs(t4 - t3)); - - } catch (Exception e) { - e.printStackTrace(); - assertTrue(false); - } - } catch (Exception e) { - e.printStackTrace(); - assertTrue(false); - } - log.info("END test_loadEntries"); - } - -} diff --git a/junit/src/net/sf/jannot/parser/TestFastaParser.java b/junit/src/net/sf/jannot/parser/TestFastaParser.java deleted file mode 100644 index bc416ca..0000000 --- a/junit/src/net/sf/jannot/parser/TestFastaParser.java +++ /dev/null @@ -1,96 +0,0 @@ -package net.sf.jannot.parser; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.URISyntaxException; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.refseq.Sequence; -import net.sf.jannot.source.DataSource; -import net.sf.jannot.source.DataSourceFactory; -import net.sf.jannot.source.Locator; - -import org.junit.Assert; -import org.junit.Test; - -import support.DataManager; - -/** - * - * @author Thomas Abeel - * - */ -public class TestFastaParser { - - private void testFile(File file) { - try { - - DataSource ds = DataSourceFactory.create(new Locator(file)); - EntrySet es = ds.read(); - // System.out.println(es.firstEntry()); - Assert.assertEquals("TestFasta", es.firstEntry().getID()); - int count = 0; - for (Entry e : es) - count++; - Assert.assertEquals(1, count); - - Sequence d = es.firstEntry().sequence(); - Assert.assertEquals(38, d.size()); - - Assert.assertEquals("ACGTACGTAACCGGTTTTGGCCAATGCATGCAAGTTGA", d.stringRepresentation()); - - } catch (URISyntaxException e) { - e.printStackTrace(); - Assert.fail(); - } catch (IOException e) { - e.printStackTrace(); - Assert.fail(); - } catch (ReadFailedException e) { - - e.printStackTrace(); - Assert.fail(); - } - } - - @Test - public void testMiniFasta() { - File f = DataManager.file("mini.fasta"); - testFile(f); - } - - @Test - public void testWrite() { - File f = DataManager.file("mini.fasta"); - try { - DataSource ds = DataSourceFactory.create(new Locator(f)); - EntrySet es = ds.read(); - - File out = File.createTempFile("unittesting.", ".fasta"); - out.deleteOnExit(); - - FileOutputStream fos = new FileOutputStream(out); - for (Entry e : es) - new FastaParser().write(fos, e); - fos.close(); - - testFile(out); - - - - } catch (URISyntaxException e) { - e.printStackTrace(); - Assert.fail(); - } catch (IOException e) { - e.printStackTrace(); - Assert.fail(); - } catch (ReadFailedException e) { - - e.printStackTrace(); - Assert.fail(); - } - } - -} diff --git a/junit/src/net/sf/jannot/parser/TestGFFParser.java b/junit/src/net/sf/jannot/parser/TestGFFParser.java deleted file mode 100644 index 2e3a936..0000000 --- a/junit/src/net/sf/jannot/parser/TestGFFParser.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * This file is part of JAnnot. - * - * JAnnot is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * JAnnot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with JAnnot. If not, see . - */ -package net.sf.jannot.parser; - -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.logging.Logger; - -import net.sf.jannot.Data; -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.StringKey; -import net.sf.jannot.Type; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.source.DataSource; -import net.sf.jannot.source.DataSourceFactory; -import net.sf.jannot.source.Locator; - -import org.junit.Assert; -import org.junit.Test; - -import be.abeel.io.LineIterator; - -import support.DataManager; - -/** - * - * @author Thomas Abeel - * - */ -public class TestGFFParser { - private static Logger log = Logger.getLogger(TestGFFParser.class.toString()); - - @Test - public void testParserMini() { - File f = DataManager.file("doubleScore.gff3"); - try { - DataSource ds = DataSourceFactory.create(new Locator(f)); - EntrySet es = ds.read(); - double score=es.firstEntry().getMemoryAnnotation(Type.get("gene")).get(0).getScore(); - Assert.assertEquals(0, score,0.0001); - - - } catch (URISyntaxException e) { - e.printStackTrace(); - Assert.fail(); - } catch (IOException e) { - e.printStackTrace(); - Assert.fail(); - } catch (Exception e) { - - e.printStackTrace(); - Assert.fail(); - } - } - - - -} diff --git a/junit/src/net/sf/jannot/parser/TestGTFParser.java b/junit/src/net/sf/jannot/parser/TestGTFParser.java deleted file mode 100644 index 1fe95ab..0000000 --- a/junit/src/net/sf/jannot/parser/TestGTFParser.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * This file is part of JAnnot. - * - * JAnnot is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * JAnnot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with JAnnot. If not, see . - */ -package net.sf.jannot.parser; - -import static org.junit.Assert.assertTrue; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.logging.Logger; - -import net.sf.jannot.Data; -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.StringKey; -import net.sf.jannot.Type; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.source.DataSource; -import net.sf.jannot.source.DataSourceFactory; -import net.sf.jannot.source.Locator; - -import org.junit.Assert; -import org.junit.Test; - -import be.abeel.io.LineIterator; - -import support.DataManager; - -/** - * - * @author Thomas Abeel - * - */ -public class TestGTFParser { - private static Logger log = Logger.getLogger(TestGTFParser.class.toString()); - - @Test - public void testParserMini() { - File f = DataManager.file("doubleScore.gtf"); - try { - DataSource ds = DataSourceFactory.create(new Locator(f)); - EntrySet es = ds.read(); - double score=es.firstEntry().getMemoryAnnotation(Type.get("gene")).get(0).getScore(); - Assert.assertEquals(0, score,0.0001); - - - } catch (URISyntaxException e) { - e.printStackTrace(); - Assert.fail(); - } catch (IOException e) { - e.printStackTrace(); - Assert.fail(); - } catch (ReadFailedException e) { - - e.printStackTrace(); - Assert.fail(); - } - } - - - -} diff --git a/junit/src/net/sf/jannot/parser/TestParserDetection.java b/junit/src/net/sf/jannot/parser/TestParserDetection.java deleted file mode 100644 index a1999db..0000000 --- a/junit/src/net/sf/jannot/parser/TestParserDetection.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * This file is part of JAnnot. - * - * JAnnot is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * JAnnot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with JAnnot. If not, see . - */ -package net.sf.jannot.parser; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; - -import org.junit.Assert; -import org.junit.Test; - -import support.DataManager; - -/** - * - * @author Thomas Abeel - * - */ -public class TestParserDetection { - - @Test - public void testBED() { - File f = DataManager.file("minibed.bed"); - try { - Parser p = Parser.detectParser(new FileInputStream(f), "file"); - Assert.assertTrue("Wrong parser: "+p.getClass(),p instanceof BEDParser); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Assert.fail(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Assert.fail(); - } - - } - - @Test - public void testVCF() { - File f = DataManager.file("tiny.vcf"); - try { - Parser p = Parser.detectParser(new FileInputStream(f), "file"); - Assert.assertTrue("Wrong parser: "+p.getClass(),p instanceof VCFParser); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Assert.fail(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - Assert.fail(); - } - - } - -} diff --git a/junit/src/net/sf/jannot/parser/TestParserList.java b/junit/src/net/sf/jannot/parser/TestParserList.java deleted file mode 100644 index 95b92e5..0000000 --- a/junit/src/net/sf/jannot/parser/TestParserList.java +++ /dev/null @@ -1,33 +0,0 @@ -package net.sf.jannot.parser; - -import org.junit.Assert; -import org.junit.Test; - -public class TestParserList { - - - @Test - public void testGFF() { - Parser[]arr=Parser.parsers("test"); - boolean contains=false; - for(Parser p:arr) - if(p instanceof GFF3Parser) - contains=true; - - Assert.assertTrue(contains); - - } - - - @Test - public void testVCF() { - Parser[]arr=Parser.parsers("test"); - boolean contains=false; - for(Parser p:arr) - if(p instanceof VCFParser) - contains=true; - - Assert.assertTrue(contains); - - } -} diff --git a/junit/src/net/sf/jannot/parser/TestVCFParser.java b/junit/src/net/sf/jannot/parser/TestVCFParser.java deleted file mode 100644 index e0e27b1..0000000 --- a/junit/src/net/sf/jannot/parser/TestVCFParser.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This file is part of JAnnot. - * - * JAnnot is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * JAnnot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with JAnnot. If not, see . - */ -package net.sf.jannot.parser; - -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; - -import net.sf.jannot.Data; -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Type; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.source.DataSource; -import net.sf.jannot.source.DataSourceFactory; -import net.sf.jannot.source.Locator; - -import org.junit.Assert; -import org.junit.Test; - -import support.DataManager; - -/** - * - * @author Thomas Abeel - * - */ -public class TestVCFParser { - - @Test - public void testTinySize() { - - File f = DataManager.file("tiny.vcf"); - try { - DataSource ds = DataSourceFactory.create(new Locator(f)); - EntrySet es = ds.read(); - // System.out.println(es.firstEntry()); - Assert.assertEquals("20", es.firstEntry().getID()); - int count = 0; - for (Entry e : es) - count++; - Assert.assertEquals(1, count); - Data d = es.firstEntry().get(Type.get("tiny.vcf")); - for (DataKey dk : es.firstEntry()) { - System.out.println("Datakey=" + dk); - - } - Assert.assertTrue(d instanceof MemoryFeatureAnnotation); - MemoryFeatureAnnotation mfa=(MemoryFeatureAnnotation)d; - - for(Feature feat: mfa.get()){ - System.out.println(feat); - } - - Assert.assertNotNull(d); - - } catch (URISyntaxException e) { - e.printStackTrace(); - Assert.fail(); - } catch (IOException e) { - e.printStackTrace(); - Assert.fail(); - } catch (ReadFailedException e) { - - e.printStackTrace(); - Assert.fail(); - } - } - @Test - public void testRegularSize() { - - File f = DataManager.file("regular.vcf"); - try { - DataSource ds = DataSourceFactory.create(new Locator(f)); - EntrySet es = ds.read(); - // System.out.println(es.firstEntry()); - Assert.assertEquals("gi|395136682|gb|CP003248.1|", es.firstEntry().getID()); - int count = 0; - for (Entry e : es) - count++; - Assert.assertEquals(1, count); - Data d = es.firstEntry().get(Type.get("regular.vcf")); - for (DataKey dk : es.firstEntry()) { - System.out.println("Datakey=" + dk); - - } - Assert.assertTrue(d instanceof MemoryFeatureAnnotation); - MemoryFeatureAnnotation mfa=(MemoryFeatureAnnotation)d; - - for(Feature feat: mfa.get()){ - System.out.println(feat+"\t"+feat.type()); - } - - Assert.assertNotNull(d); - - } catch (URISyntaxException e) { - e.printStackTrace(); - Assert.fail(); - } catch (IOException e) { - e.printStackTrace(); - Assert.fail(); - } catch (ReadFailedException e) { - - e.printStackTrace(); - Assert.fail(); - } - } -} diff --git a/junit/src/net/sf/jannot/refseq/TestFirstNucleotide.java b/junit/src/net/sf/jannot/refseq/TestFirstNucleotide.java deleted file mode 100644 index d2177dd..0000000 --- a/junit/src/net/sf/jannot/refseq/TestFirstNucleotide.java +++ /dev/null @@ -1,59 +0,0 @@ -package net.sf.jannot.refseq; - -import java.io.FileInputStream; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.logging.LogManager; -import java.util.logging.Logger; - -import org.junit.Test; - -import net.sf.jannot.Cleaner; -import net.sf.jannot.EntrySet; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.source.IndexedFastaDataSource; -import net.sf.jannot.source.Locator; - -/** - * - * @author Thomas Abeel - * - */ -public class TestFirstNucleotide { - - @Test - public void testNucleotide() throws MalformedURLException, - IOException, ReadFailedException, URISyntaxException { - - Logger log = Logger.getLogger(TestFirstNucleotide.class - .getCanonicalName()); - log.info("Loading source"); - Locator l = new Locator( - "http://genomeview.org/frigg/genome.fasta"); - Locator i = new Locator( - "http://genomeview.org/frigg/genome.fasta.fai"); - - IndexedFastaDataSource ifd = new IndexedFastaDataSource(l, i); - System.out.println("Reading entries"); - EntrySet es = ifd.read(); - - System.out.println("Query"); - for (Character c : es.getEntry("chr1").sequence().get(1, 1000)) { - System.out.print(c); - } - System.out.println(); - System.out.println(); - - System.out.println("Query"); - for (Character c : es.getEntry("chr1").sequence().get(-10, 1000)) { - System.out.print(c); - } - - Cleaner.exit(); - - - - } -} diff --git a/junit/src/net/sf/jannot/refseq/TestMemorySequence.java b/junit/src/net/sf/jannot/refseq/TestMemorySequence.java deleted file mode 100644 index 9862e8d..0000000 --- a/junit/src/net/sf/jannot/refseq/TestMemorySequence.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.refseq; - - - -import static org.junit.Assert.assertEquals; -import net.sf.jannot.Entry; -import net.sf.jannot.refseq.MemorySequence; - -import org.junit.Test; -/** - * - * @author Thomas Abeel - * - */ -public class TestMemorySequence { - - /** - * When adding a String to an empty sequence, the sequence should - * be extended with this String. - * - */ - - @Test - public void addSequenceTest(){ - Entry entry = new Entry("test"); - MemorySequence seq =(MemorySequence) entry.sequence(); - String seqString = "actgactg"; - seq.addSequence(seqString); - assertEquals(seqString.toUpperCase(), entry.sequence().toString()); - } -} diff --git a/junit/src/net/sf/jannot/refseq/TestSequence.java b/junit/src/net/sf/jannot/refseq/TestSequence.java deleted file mode 100644 index 6d2c094..0000000 --- a/junit/src/net/sf/jannot/refseq/TestSequence.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.refseq; - -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; - -import junit.framework.Assert; -import net.sf.jannot.EntrySet; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.refseq.MemorySequence; -import net.sf.jannot.refseq.Sequence; -import net.sf.jannot.source.IndexedFastaDataSource; -import net.sf.jannot.source.Locator; - -import org.junit.Test; - -public class TestSequence { - - @Test - public void testFaidx() throws URISyntaxException{ - try { - Locator l = new Locator( - "http://bioinformatics.psb.ugent.be/downloads/genomeview/genomes/hg19/genome.fasta"); - Locator i = new Locator( - "http://bioinformatics.psb.ugent.be/downloads/genomeview/genomes/hg19/genome.fasta.fai"); - - - EntrySet es= new IndexedFastaDataSource(l, i).read(); - Sequence seq=es.firstEntry().sequence(); - String tmp = ""; - for (Character c : seq.get(1, 4)) { - tmp += c; - } - Assert.assertEquals(3, tmp.length()); - - - } catch (ReadFailedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @Test - public void testSubSequence() { - MemorySequence a = new MemorySequence("AGTCG"); - - Assert.assertEquals("GT", a.subsequence(2, 4).stringRepresentation()); - Assert.assertEquals("AGTCG", a.subsequence(1, 6).stringRepresentation()); - String tmp = ""; - for (Character c : a.get(2, 4)) { - tmp += c; - } - Assert.assertEquals("GT", tmp); - tmp = ""; - for (Character c : a.get(1, 6)) { - tmp += c; - } - Assert.assertEquals("AGTCG", tmp); - - } - -} diff --git a/junit/src/net/sf/jannot/utils/TestSequenceTools.java b/junit/src/net/sf/jannot/utils/TestSequenceTools.java deleted file mode 100644 index 720a1f1..0000000 --- a/junit/src/net/sf/jannot/utils/TestSequenceTools.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.utils; - -import junit.framework.Assert; -import net.sf.jannot.refseq.MemorySequence; -import net.sf.jannot.refseq.Sequence; -import net.sf.jannot.utils.SequenceTools; - -import org.junit.Test; -/** - * - * @author Thomas Abeel - * - */ -public class TestSequenceTools { - - - - @Test - public void testReverseComplementSmall() { - MemorySequence a = new MemorySequence(); - a.setSequence("AACCGGTTACTGACTG"); - MemorySequence b = (MemorySequence)SequenceTools.reverseComplement(a); - for (int i = 1; i <= 16; i++) { - Assert.assertEquals(a.getNucleotide(i), b - .getReverseNucleotide(17 - i)); - } - System.out.println(a); - System.out.println(b); - } - @Test - public void testReverseComplementOdd() { - MemorySequence a = new MemorySequence(); - a.setSequence("AACCGGTTACTGACT"); - MemorySequence b = (MemorySequence)SequenceTools.reverseComplement(a); - for (int i = 1; i <= 15; i++) { - Assert.assertEquals(a.getNucleotide(i), b - .getReverseNucleotide(16 - i)); - } - System.out.println(a); - System.out.println(b); - } -} diff --git a/junit/src/net/sf/jannot/vcf/TestVCF.java b/junit/src/net/sf/jannot/vcf/TestVCF.java deleted file mode 100644 index 24d1dce..0000000 --- a/junit/src/net/sf/jannot/vcf/TestVCF.java +++ /dev/null @@ -1,129 +0,0 @@ -package net.sf.jannot.vcf; - -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.logging.Logger; - -import net.sf.jannot.Data; -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.source.DataSource; -import net.sf.jannot.source.DataSourceFactory; -import net.sf.jannot.source.Locator; -import net.sf.jannot.variation.Variation; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import support.DataManager; - -import java.io.File; - -/** - * IMPORTANT!!!: This test requires the data in test/resource to be prepared. - * - * See the readme.txt file in test/resource/ to see download instructions. - * - * - * @author Thomas Abeel - * @author David Roldan Martinez - * - */ -public class TestVCF { - - // private String[] files =DataManager.vcfFiles(); - - private static Logger log = Logger.getLogger(TestVCF.class.toString()); - - @Before - public void init() { - } - - @After - public void destroy() { - - } - - @Test - public void test_dummyTest() { - log.info("BEGIN test_dummyTest"); - assertTrue(true); - log.info("END test_dummyTest"); - } - - @Test - public void test_loadEntries() { - log.info("BEGIN test_loadEntries"); - try { - int i = 0; - - String dataIdentifier = "CEU.trio.2010_03.genotypes.vcf.gz"; - String indexIdentifier = dataIdentifier + ".tbi"; - - EntrySet entries = new EntrySet(); - Locator fIndex = new Locator(DataManager.file(indexIdentifier)); - Locator fData = new Locator(DataManager.file(dataIdentifier)); - DataSource ds = DataSourceFactory.create(fData, fIndex); - - // File fileData = new File(dataFile); - // File indexData = new File(indexFile); - - log.info("------ Sample # " + i + " ---------"); - log.info(" > fileData: " + fData.file() + "( " + fData.file().length() + " KB)"); - log.info(" > indexData: " + fIndex.file() + "( " + fIndex.file().length() + " KB)"); - i++; - log.info(" > Reading source:" + ds); - try { - long t1 = System.currentTimeMillis(); - ds.read(entries); - long t2 = System.currentTimeMillis(); - log.info(" > Time consumed loading files: " + Math.abs(t2 - t1)); - log.info(" > Number of entries: " + entries.size()); - // assertTrue(entries.size() > 0); - // We build an ArrayList to access randonmly to a entry - List list = new ArrayList(); - for (Entry entry : entries) { - list.add(entry); - } - int selectedIndex = Math.max(0, (int) Math.round(Math.random() * list.size()) - 1); - Entry selectedEntry = list.get(selectedIndex); - - Iterator it = selectedEntry.iterator(); - List list2 = new ArrayList(); - while (it.hasNext()) { - list2.add(it.next()); - } - int keyIndex = Math.max(0, (int) Math.round(Math.random() * list2.size()) - 1); - - /* retrieve some data from some entry */ - long t3 = System.currentTimeMillis(); - DataKey dataKey = list2.get(keyIndex); - Data data = selectedEntry.get(dataKey); - // System.out.println("DD: " + data); - Iterable resultSet = data.get(500000, 2000000); - long t4 = System.currentTimeMillis(); - log.info(" > Time consumed fetching data: " + Math.abs(t4 - t3)); - for (Object o : resultSet) { - // System.out.println(o); - Variation v = (Variation) o; - // System.out.println(o+"\t"+v.start()+"\t"+v.alleles()); - } - } catch (Exception e) { - e.printStackTrace(); - assertTrue(false); - } - // } - // } - } catch (Exception e) { - e.printStackTrace(); - assertTrue(false); - } - log.info("END test_loadEntries"); - } - -} \ No newline at end of file diff --git a/junit/src/net/sf/nameservice/TestNameService.java b/junit/src/net/sf/nameservice/TestNameService.java deleted file mode 100644 index bd325d5..0000000 --- a/junit/src/net/sf/nameservice/TestNameService.java +++ /dev/null @@ -1,36 +0,0 @@ -package net.sf.nameservice; - -import org.junit.Assert; -import org.junit.Test; -/** - * - * @author Thomas Abeel - * - */ -public class TestNameService { - - - @Test - public void testDefaultSynonyms(){ - String primary="Acaryochloris marina MBIC11017 chromosome, complete genome. (NC_009925)"; - String alt1="NC_009925"; - String alt2="NC_009925.1"; - - Assert.assertEquals(primary, NameService.getPrimaryName(alt1)); - Assert.assertEquals(primary, NameService.getPrimaryName(alt2)); - Assert.assertEquals(primary, NameService.getPrimaryName(primary.replace(' ', '_'))); - } - - - @Test - public void testAddSynonym(){ - String primary="Acaryochloris marina MBIC11017 chromosome, complete genome. (NC_009925)"; - - - NameService.addSynonym(primary, "test alternative"); - - Assert.assertEquals(primary, NameService.getPrimaryName("test alternative")); - Assert.assertEquals(primary, NameService.getPrimaryName("test ALTERNAtive")); - - } -} diff --git a/junit/src/support/DataManager.java b/junit/src/support/DataManager.java deleted file mode 100644 index 05b7737..0000000 --- a/junit/src/support/DataManager.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * This file is part of JAnnot. - * - * JAnnot is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * JAnnot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with JAnnot. If not, see . - */ -package support; - -import java.io.File; -import java.io.FileOutputStream; -import java.net.HttpURLConnection; -import java.net.URL; - -import org.apache.commons.io.IOUtils; -import org.junit.Assert; - -/** - * - * @author Thomas Abeel - * - */ -public class DataManager { - - public static File file(String identifier) { - try { - File folder = new File(".sf-testing-cache"); - if (!folder.exists()) { - folder.mkdirs(); - } - File file = new File(folder, identifier); - if (!file.exists() || file.length() == 0) { - retrieveSF(identifier, file); - } - return file; - } catch (Exception e) { - e.printStackTrace(); - Assert.fail(); - return null; - } - - } - - private static void retrieveSF(String identifier, File out) throws Exception { - URL url = new URL("http://genomeview.org/junit/" + identifier); - System.out.println("Trying: "+url); - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - int response = conn.getResponseCode(); - if (response == 302) { - String location = conn.getHeaderField("Location"); - conn = (HttpURLConnection) new URL(location).openConnection(); - FileOutputStream fof=new FileOutputStream(out); - IOUtils.copy(conn.getInputStream(),fof ); - fof.close(); - - }else if (response==200){ - FileOutputStream fof=new FileOutputStream(out); - IOUtils.copy(conn.getInputStream(),fof ); - fof.close(); - } - - } - -// public static String[] vcfFiles() { -// -// /* -// * TODO -// * -// * Before returning this list of files, make sure that those files and -// * their indices have been downloaded to the correct folder. -// * -// * - Check internet connection - Check available disk-space - Check if -// * files are present -// * -// * if not: Download files (with progress indication) -// * -// * return list of files -// */ -// String[] out = new String[] { "test/resource/CEU.SRP000031.2010_03.genotypes.vcf.gz", "test/resource/CEU.SRP000032.2010_03.genotypes.vcf.gz", -// "test/resource/CEU.SRP000033.2010_03.genotypes.vcf.gz", "test/resource/CEU.trio.2010_03.genotypes.vcf.gz", -// "test/resource/CHB.SRP000033.2010_03.genotypes.vcf.gz", "test/resource/CHB+JPT.SRP000031.2010_03.genotypes.vcf.gz", -// "test/resource/CHD.SRP000033.2010_03.genotypes.vcf.gz", -// "test/resource/JPT.SRP000033.2010_03.genotypes.vcf.gz", -// "test/resource/LWK.SRP000033.2010_03.genotypes.vcf.gz", -// // "test/resource/trio.2010_06.ychr.genotypes.vcf.gz", -// "test/resource/TSI.SRP000033.2010_03.genotypes.vcf.gz", "test/resource/YRI.SRP000031.2010_03.genotypes.vcf.gz", -// "test/resource/YRI.SRP000032.2010_03.genotypes.vcf.gz", "test/resource/YRI.SRP000033.2010_03.genotypes.vcf.gz", -// "test/resource/YRI.trio.2010_03.genotypes.vcf.gz" }; -// return out; -// } -} diff --git a/junit/src/support/TestDirectSFDownload.java b/junit/src/support/TestDirectSFDownload.java deleted file mode 100644 index 654d8c9..0000000 --- a/junit/src/support/TestDirectSFDownload.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This file is part of JAnnot. - * - * JAnnot is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * JAnnot is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with JAnnot. If not, see . - */ -package support; - -import java.io.File; - -import org.junit.Assert; -import org.junit.Test; - - -/** - * - * @author Thomas Abeel - * - */ -public class TestDirectSFDownload { - - @Test - public void testDownload(){ - String id="minibed.bed"; - DataManager.file(id); - Assert.assertTrue(new File(".sf-testing-cache").exists()); - Assert.assertTrue(new File(".sf-testing-cache/minibed.bed").exists()); - Assert.assertTrue(new File(".sf-testing-cache/minibed.bed").length()>0); - - } - - @Test - public void testLargeDownload(){ - String id="CEU.trio.2010_03.genotypes.vcf.gz"; - DataManager.file(id); - Assert.assertTrue(new File(".sf-testing-cache").exists()); - Assert.assertTrue(new File(".sf-testing-cache/"+id).exists()); - Assert.assertTrue(new File(".sf-testing-cache/"+id).length()>0); - - } -} diff --git a/lib/atk-110.jar b/lib/atk-110.jar deleted file mode 100644 index 0b09df6..0000000 Binary files a/lib/atk-110.jar and /dev/null differ diff --git a/lib/collections-1.0.jar b/lib/collections-1.0.jar deleted file mode 100644 index 678cac5..0000000 Binary files a/lib/collections-1.0.jar and /dev/null differ diff --git a/lib/commons-io-2.4.jar b/lib/commons-io-2.4.jar deleted file mode 100644 index 90035a4..0000000 Binary files a/lib/commons-io-2.4.jar and /dev/null differ diff --git a/lib/jargs.jar b/lib/jargs.jar deleted file mode 100644 index cdbc80b..0000000 Binary files a/lib/jargs.jar and /dev/null differ diff --git a/lib/jcl-over-slf4j-1.7.5.jar b/lib/jcl-over-slf4j-1.7.5.jar deleted file mode 100644 index a80e4f1..0000000 Binary files a/lib/jcl-over-slf4j-1.7.5.jar and /dev/null differ diff --git a/lib/log4j-over-slf4j-1.7.5.jar b/lib/log4j-over-slf4j-1.7.5.jar deleted file mode 100644 index 7caf772..0000000 Binary files a/lib/log4j-over-slf4j-1.7.5.jar and /dev/null differ diff --git a/lib/sam-1.112.jar b/lib/m2/net/sf/samtools/1.107/samtools-1.107.jar similarity index 100% rename from lib/sam-1.112.jar rename to lib/m2/net/sf/samtools/1.107/samtools-1.107.jar diff --git a/lib/m2/net/sf/samtools/1.107/samtools-1.107.pom b/lib/m2/net/sf/samtools/1.107/samtools-1.107.pom new file mode 100644 index 0000000..112551d --- /dev/null +++ b/lib/m2/net/sf/samtools/1.107/samtools-1.107.pom @@ -0,0 +1,9 @@ + + + 4.0.0 + net.sf + samtools + 1.107 + POM was created from install:install-file + diff --git a/lib/m2/net/sf/samtools/maven-metadata-local.xml b/lib/m2/net/sf/samtools/maven-metadata-local.xml new file mode 100644 index 0000000..ac86e4f --- /dev/null +++ b/lib/m2/net/sf/samtools/maven-metadata-local.xml @@ -0,0 +1,12 @@ + + + net.sf + samtools + + 1.107 + + 1.107 + + 20260112094100 + + diff --git a/lib/slf4j-api-1.7.5.jar b/lib/slf4j-api-1.7.5.jar deleted file mode 100644 index 8766455..0000000 Binary files a/lib/slf4j-api-1.7.5.jar and /dev/null differ diff --git a/lib/slf4j-jdk14-1.7.5.jar b/lib/slf4j-jdk14-1.7.5.jar deleted file mode 100644 index 184c8c4..0000000 Binary files a/lib/slf4j-jdk14-1.7.5.jar and /dev/null differ diff --git a/lib_compile/hamcrest-core-1.3.jar b/lib_compile/hamcrest-core-1.3.jar deleted file mode 100644 index 9d5fe16..0000000 Binary files a/lib_compile/hamcrest-core-1.3.jar and /dev/null differ diff --git a/lib_compile/junit-4.11.jar b/lib_compile/junit-4.11.jar deleted file mode 100644 index aaf7444..0000000 Binary files a/lib_compile/junit-4.11.jar and /dev/null differ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..c97d217 --- /dev/null +++ b/pom.xml @@ -0,0 +1,254 @@ + + 4.0.0 + net.sf + genomeview + 23.0.0 + + + + 1.17 + 1.17 + UTF-8 + ${pom.basedir}/lib/m2 + ${env.ARTIFACTORY_PASS} + + + + + central + maven central + https://repo1.maven.org/maven2/ + + + + jboss + jboss + https://repository.jboss.org + + + + local-maven-repository + file://${local.repository.folder} + + true + + + true + + + + + artifactory.ewi.tudelft.nl + https://artifactory.ewi.tudelft.nl/artifactory/libs-release + + false + + + + + + + + + + + net.sf + jannot + 2.0.0 + + + + net.sf + jargs + 1.0 + + + + org.slf4j + jcl-over-slf4j + 1.7.34 + + + + org.slf4j + log4j-over-slf4j + 1.7.34 + + + + commons-io + commons-io + 2.4 + + + + org.slf4j + slf4j-api + 1.7.34 + + + + + org.slf4j + slf4j-jdk14 + 1.7.34 + test + + + + junit + junit + 4.11 + test + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 1.8 + 1.8 + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.1.0 + + + attach-sources + + jar + + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.4.1 + + + + jar-with-dependencies + + + + net.sf.genomeview.gui.GenomeView + true + true + + + + + + make-assembly + + package + + single + + + + + + org.jfrog.buildinfo + artifactory-maven-plugin + 3.2.3 + + + build-info + + publish + + + + http://artifactory.ewi.tudelft.nl/artifactory + libs-release + wouter + ${passwd} + + + + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + org.jfrog.buildinfo + artifactory-maven-plugin + [1.0.0,) + + publish + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/gnu/trove/TDoubleCollection.java b/src/gnu/trove/TDoubleCollection.java deleted file mode 100644 index be59da1..0000000 --- a/src/gnu/trove/TDoubleCollection.java +++ /dev/null @@ -1,316 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - -import gnu.trove.iterator.TDoubleIterator; -import gnu.trove.procedure.TDoubleProcedure; - -import java.util.Collection; -import java.io.Serializable; - -/** - * An interface that mimics the Collection interface. - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: _E_Collection.template,v 1.1.2.2 2009/09/15 02:38:30 upholderoftruth Exp $ - */ - -public interface TDoubleCollection extends Serializable { - - /** - * Returns the value that is used to represent null. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - double getNoEntryValue(); - - - /** - * Returns the number of elements in this collection (its cardinality). If this - * collection contains more than Integer.MAX_VALUE elements, returns - * Integer.MAX_VALUE. - * - * @return the number of elements in this collection (its cardinality) - */ - int size(); - - - /** - * Returns true if this collection contains no elements. - * - * @return true if this collection contains no elements - */ - boolean isEmpty(); - - - /** - * Returns true if this collection contains the specified element. - * - * @param entry an double value - * @return true if the collection contains the specified element. - */ - boolean contains( double entry ); - - - /** - * Creates an iterator over the values of the collection. The iterator - * supports element deletion. - * - * @return an TDoubleIterator value - */ - TDoubleIterator iterator(); - - - /** - * Returns an array containing all of the elements in this collection. - * If this collection makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the - * elements in the same order. - * - *

The returned array will be "safe" in that no references to it - * are maintained by this collection. (In other words, this method must - * allocate a new array even if this collection is backed by an array). - * The caller is thus free to modify the returned array. - * - *

This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this collection - */ - double[] toArray(); - - - /** - * Returns an array containing elements in this collection. - * - *

If this collection fits in the specified array with room to spare - * (i.e., the array has more elements than this collection), the element in - * the array immediately following the end of the collection is collection to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this collection only if the caller knows that this - * collection does not contain any elements representing null.) - * - *

If the native array is smaller than the collection size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *

If this collection makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the elements - * in the same order. - * - * @param dest the array into which the elements of this collection are to be - * stored. - * @return an double[] containing all the elements in this collection - * @throws NullPointerException if the specified array is null - */ - double[] toArray( double[] dest ); - - - /** - * Inserts a value into the collection. - * - * @param entry a double value - * @return true if the collection was modified by the add operation - */ - boolean add( double entry ); - - - /** - * Removes entry from the collection. - * - * @param entry an double value - * @return true if the collection was modified by the remove operation. - */ - boolean remove( double entry ); - - - /** - * Tests the collection to determine if all of the elements in - * collection are present. - * - * @param collection a Collection value - * @return true if all elements were present in the collection. - */ - boolean containsAll( Collection collection ); - - - /** - * Tests the collection to determine if all of the elements in - * TDoubleCollection are present. - * - * @param collection a TDoubleCollection value - * @return true if all elements were present in the collection. - */ - boolean containsAll( TDoubleCollection collection ); - - - /** - * Tests the collection to determine if all of the elements in - * array are present. - * - * @param array as array of double primitives. - * @return true if all elements were present in the collection. - */ - boolean containsAll( double[] array ); - - - /** - * Adds all of the elements in collection to the collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( Collection collection ); - - - /** - * Adds all of the elements in the TDoubleCollection to the collection. - * - * @param collection a TDoubleCollection value - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( TDoubleCollection collection ); - - - /** - * Adds all of the elements in the array to the collection. - * - * @param array a array of double primitives. - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( double[] array ); - - - /** - * Removes any values in the collection which are not contained in - * collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( Collection collection ); - - - /** - * Removes any values in the collection which are not contained in - * TDoubleCollection. - * - * @param collection a TDoubleCollection value - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( TDoubleCollection collection ); - - - /** - * Removes any values in the collection which are not contained in - * array. - * - * @param array an array of double primitives. - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( double[] array ); - - - /** - * Removes all of the elements in collection from the collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( Collection collection ); - - - /** - * Removes all of the elements in TDoubleCollection from the collection. - * - * @param collection a TDoubleCollection value - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( TDoubleCollection collection ); - - - /** - * Removes all of the elements in array from the collection. - * - * @param array an array of double primitives. - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( double[] array ); - - - /** - * Empties the collection. - */ - void clear(); - - - /** - * Executes procedure for each element in the collection. - * - * @param procedure a TDoubleProcedure value - * @return false if the loop over the collection terminated because - * the procedure returned false for some value. - */ - boolean forEach( TDoubleProcedure procedure ); - - - // Comparison and hashing - - /** - * Compares the specified object with this collection for equality. Returns - * true if the specified object is also a collection, the two collection - * have the same size, and every member of the specified collection is - * contained in this collection (or equivalently, every member of this collection is - * contained in the specified collection). This definition ensures that the - * equals method works properly across different implementations of the - * collection interface. - * - * @param o object to be compared for equality with this collection - * @return true if the specified object is equal to this collection - */ - boolean equals( Object o ); - - - /** - * Returns the hash code value for this collection. The hash code of a collection is - * defined to be the sum of the hash codes of the elements in the collection. - * This ensures that s1.equals(s2) implies that - * s1.hashCode()==s2.hashCode() for any two collection s1 - * and s2, as required by the general contract of - * {@link Object#hashCode}. - * - * @return the hash code value for this collection - * @see Object#equals(Object) - * @see Collection#equals(Object) - */ - int hashCode(); - - -} // TDoubleCollection diff --git a/src/gnu/trove/TFloatCollection.java b/src/gnu/trove/TFloatCollection.java deleted file mode 100644 index 7117d06..0000000 --- a/src/gnu/trove/TFloatCollection.java +++ /dev/null @@ -1,316 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - -import gnu.trove.iterator.TFloatIterator; -import gnu.trove.procedure.TFloatProcedure; - -import java.util.Collection; -import java.io.Serializable; - -/** - * An interface that mimics the Collection interface. - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: _E_Collection.template,v 1.1.2.2 2009/09/15 02:38:30 upholderoftruth Exp $ - */ - -public interface TFloatCollection extends Serializable { - - /** - * Returns the value that is used to represent null. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - float getNoEntryValue(); - - - /** - * Returns the number of elements in this collection (its cardinality). If this - * collection contains more than Integer.MAX_VALUE elements, returns - * Integer.MAX_VALUE. - * - * @return the number of elements in this collection (its cardinality) - */ - int size(); - - - /** - * Returns true if this collection contains no elements. - * - * @return true if this collection contains no elements - */ - boolean isEmpty(); - - - /** - * Returns true if this collection contains the specified element. - * - * @param entry an float value - * @return true if the collection contains the specified element. - */ - boolean contains( float entry ); - - - /** - * Creates an iterator over the values of the collection. The iterator - * supports element deletion. - * - * @return an TFloatIterator value - */ - TFloatIterator iterator(); - - - /** - * Returns an array containing all of the elements in this collection. - * If this collection makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the - * elements in the same order. - * - *

The returned array will be "safe" in that no references to it - * are maintained by this collection. (In other words, this method must - * allocate a new array even if this collection is backed by an array). - * The caller is thus free to modify the returned array. - * - *

This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this collection - */ - float[] toArray(); - - - /** - * Returns an array containing elements in this collection. - * - *

If this collection fits in the specified array with room to spare - * (i.e., the array has more elements than this collection), the element in - * the array immediately following the end of the collection is collection to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this collection only if the caller knows that this - * collection does not contain any elements representing null.) - * - *

If the native array is smaller than the collection size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *

If this collection makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the elements - * in the same order. - * - * @param dest the array into which the elements of this collection are to be - * stored. - * @return an float[] containing all the elements in this collection - * @throws NullPointerException if the specified array is null - */ - float[] toArray( float[] dest ); - - - /** - * Inserts a value into the collection. - * - * @param entry a float value - * @return true if the collection was modified by the add operation - */ - boolean add( float entry ); - - - /** - * Removes entry from the collection. - * - * @param entry an float value - * @return true if the collection was modified by the remove operation. - */ - boolean remove( float entry ); - - - /** - * Tests the collection to determine if all of the elements in - * collection are present. - * - * @param collection a Collection value - * @return true if all elements were present in the collection. - */ - boolean containsAll( Collection collection ); - - - /** - * Tests the collection to determine if all of the elements in - * TFloatCollection are present. - * - * @param collection a TFloatCollection value - * @return true if all elements were present in the collection. - */ - boolean containsAll( TFloatCollection collection ); - - - /** - * Tests the collection to determine if all of the elements in - * array are present. - * - * @param array as array of float primitives. - * @return true if all elements were present in the collection. - */ - boolean containsAll( float[] array ); - - - /** - * Adds all of the elements in collection to the collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( Collection collection ); - - - /** - * Adds all of the elements in the TFloatCollection to the collection. - * - * @param collection a TFloatCollection value - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( TFloatCollection collection ); - - - /** - * Adds all of the elements in the array to the collection. - * - * @param array a array of float primitives. - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( float[] array ); - - - /** - * Removes any values in the collection which are not contained in - * collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( Collection collection ); - - - /** - * Removes any values in the collection which are not contained in - * TFloatCollection. - * - * @param collection a TFloatCollection value - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( TFloatCollection collection ); - - - /** - * Removes any values in the collection which are not contained in - * array. - * - * @param array an array of float primitives. - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( float[] array ); - - - /** - * Removes all of the elements in collection from the collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( Collection collection ); - - - /** - * Removes all of the elements in TFloatCollection from the collection. - * - * @param collection a TFloatCollection value - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( TFloatCollection collection ); - - - /** - * Removes all of the elements in array from the collection. - * - * @param array an array of float primitives. - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( float[] array ); - - - /** - * Empties the collection. - */ - void clear(); - - - /** - * Executes procedure for each element in the collection. - * - * @param procedure a TFloatProcedure value - * @return false if the loop over the collection terminated because - * the procedure returned false for some value. - */ - boolean forEach( TFloatProcedure procedure ); - - - // Comparison and hashing - - /** - * Compares the specified object with this collection for equality. Returns - * true if the specified object is also a collection, the two collection - * have the same size, and every member of the specified collection is - * contained in this collection (or equivalently, every member of this collection is - * contained in the specified collection). This definition ensures that the - * equals method works properly across different implementations of the - * collection interface. - * - * @param o object to be compared for equality with this collection - * @return true if the specified object is equal to this collection - */ - boolean equals( Object o ); - - - /** - * Returns the hash code value for this collection. The hash code of a collection is - * defined to be the sum of the hash codes of the elements in the collection. - * This ensures that s1.equals(s2) implies that - * s1.hashCode()==s2.hashCode() for any two collection s1 - * and s2, as required by the general contract of - * {@link Object#hashCode}. - * - * @return the hash code value for this collection - * @see Object#equals(Object) - * @see Collection#equals(Object) - */ - int hashCode(); - - -} // TFloatCollection diff --git a/src/gnu/trove/TIntCollection.java b/src/gnu/trove/TIntCollection.java deleted file mode 100644 index 4b71cc2..0000000 --- a/src/gnu/trove/TIntCollection.java +++ /dev/null @@ -1,316 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - -import gnu.trove.iterator.TIntIterator; -import gnu.trove.procedure.TIntProcedure; - -import java.util.Collection; -import java.io.Serializable; - -/** - * An interface that mimics the Collection interface. - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: _E_Collection.template,v 1.1.2.2 2009/09/15 02:38:30 upholderoftruth Exp $ - */ - -public interface TIntCollection extends Serializable { - - /** - * Returns the value that is used to represent null. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - int getNoEntryValue(); - - - /** - * Returns the number of elements in this collection (its cardinality). If this - * collection contains more than Integer.MAX_VALUE elements, returns - * Integer.MAX_VALUE. - * - * @return the number of elements in this collection (its cardinality) - */ - int size(); - - - /** - * Returns true if this collection contains no elements. - * - * @return true if this collection contains no elements - */ - boolean isEmpty(); - - - /** - * Returns true if this collection contains the specified element. - * - * @param entry an int value - * @return true if the collection contains the specified element. - */ - boolean contains( int entry ); - - - /** - * Creates an iterator over the values of the collection. The iterator - * supports element deletion. - * - * @return an TIntIterator value - */ - TIntIterator iterator(); - - - /** - * Returns an array containing all of the elements in this collection. - * If this collection makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the - * elements in the same order. - * - *

The returned array will be "safe" in that no references to it - * are maintained by this collection. (In other words, this method must - * allocate a new array even if this collection is backed by an array). - * The caller is thus free to modify the returned array. - * - *

This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this collection - */ - int[] toArray(); - - - /** - * Returns an array containing elements in this collection. - * - *

If this collection fits in the specified array with room to spare - * (i.e., the array has more elements than this collection), the element in - * the array immediately following the end of the collection is collection to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this collection only if the caller knows that this - * collection does not contain any elements representing null.) - * - *

If the native array is smaller than the collection size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *

If this collection makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the elements - * in the same order. - * - * @param dest the array into which the elements of this collection are to be - * stored. - * @return an int[] containing all the elements in this collection - * @throws NullPointerException if the specified array is null - */ - int[] toArray( int[] dest ); - - - /** - * Inserts a value into the collection. - * - * @param entry a int value - * @return true if the collection was modified by the add operation - */ - boolean add( int entry ); - - - /** - * Removes entry from the collection. - * - * @param entry an int value - * @return true if the collection was modified by the remove operation. - */ - boolean remove( int entry ); - - - /** - * Tests the collection to determine if all of the elements in - * collection are present. - * - * @param collection a Collection value - * @return true if all elements were present in the collection. - */ - boolean containsAll( Collection collection ); - - - /** - * Tests the collection to determine if all of the elements in - * TIntCollection are present. - * - * @param collection a TIntCollection value - * @return true if all elements were present in the collection. - */ - boolean containsAll( TIntCollection collection ); - - - /** - * Tests the collection to determine if all of the elements in - * array are present. - * - * @param array as array of int primitives. - * @return true if all elements were present in the collection. - */ - boolean containsAll( int[] array ); - - - /** - * Adds all of the elements in collection to the collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( Collection collection ); - - - /** - * Adds all of the elements in the TIntCollection to the collection. - * - * @param collection a TIntCollection value - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( TIntCollection collection ); - - - /** - * Adds all of the elements in the array to the collection. - * - * @param array a array of int primitives. - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( int[] array ); - - - /** - * Removes any values in the collection which are not contained in - * collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( Collection collection ); - - - /** - * Removes any values in the collection which are not contained in - * TIntCollection. - * - * @param collection a TIntCollection value - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( TIntCollection collection ); - - - /** - * Removes any values in the collection which are not contained in - * array. - * - * @param array an array of int primitives. - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( int[] array ); - - - /** - * Removes all of the elements in collection from the collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( Collection collection ); - - - /** - * Removes all of the elements in TIntCollection from the collection. - * - * @param collection a TIntCollection value - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( TIntCollection collection ); - - - /** - * Removes all of the elements in array from the collection. - * - * @param array an array of int primitives. - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( int[] array ); - - - /** - * Empties the collection. - */ - void clear(); - - - /** - * Executes procedure for each element in the collection. - * - * @param procedure a TIntProcedure value - * @return false if the loop over the collection terminated because - * the procedure returned false for some value. - */ - boolean forEach( TIntProcedure procedure ); - - - // Comparison and hashing - - /** - * Compares the specified object with this collection for equality. Returns - * true if the specified object is also a collection, the two collection - * have the same size, and every member of the specified collection is - * contained in this collection (or equivalently, every member of this collection is - * contained in the specified collection). This definition ensures that the - * equals method works properly across different implementations of the - * collection interface. - * - * @param o object to be compared for equality with this collection - * @return true if the specified object is equal to this collection - */ - boolean equals( Object o ); - - - /** - * Returns the hash code value for this collection. The hash code of a collection is - * defined to be the sum of the hash codes of the elements in the collection. - * This ensures that s1.equals(s2) implies that - * s1.hashCode()==s2.hashCode() for any two collection s1 - * and s2, as required by the general contract of - * {@link Object#hashCode}. - * - * @return the hash code value for this collection - * @see Object#equals(Object) - * @see Collection#equals(Object) - */ - int hashCode(); - - -} // TIntCollection diff --git a/src/gnu/trove/TLongCollection.java b/src/gnu/trove/TLongCollection.java deleted file mode 100644 index d169391..0000000 --- a/src/gnu/trove/TLongCollection.java +++ /dev/null @@ -1,316 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - -import gnu.trove.iterator.TLongIterator; -import gnu.trove.procedure.TLongProcedure; - -import java.util.Collection; -import java.io.Serializable; - -/** - * An interface that mimics the Collection interface. - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: _E_Collection.template,v 1.1.2.2 2009/09/15 02:38:30 upholderoftruth Exp $ - */ - -public interface TLongCollection extends Serializable { - - /** - * Returns the value that is used to represent null. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - long getNoEntryValue(); - - - /** - * Returns the number of elements in this collection (its cardinality). If this - * collection contains more than Integer.MAX_VALUE elements, returns - * Integer.MAX_VALUE. - * - * @return the number of elements in this collection (its cardinality) - */ - int size(); - - - /** - * Returns true if this collection contains no elements. - * - * @return true if this collection contains no elements - */ - boolean isEmpty(); - - - /** - * Returns true if this collection contains the specified element. - * - * @param entry an long value - * @return true if the collection contains the specified element. - */ - boolean contains( long entry ); - - - /** - * Creates an iterator over the values of the collection. The iterator - * supports element deletion. - * - * @return an TLongIterator value - */ - TLongIterator iterator(); - - - /** - * Returns an array containing all of the elements in this collection. - * If this collection makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the - * elements in the same order. - * - *

The returned array will be "safe" in that no references to it - * are maintained by this collection. (In other words, this method must - * allocate a new array even if this collection is backed by an array). - * The caller is thus free to modify the returned array. - * - *

This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this collection - */ - long[] toArray(); - - - /** - * Returns an array containing elements in this collection. - * - *

If this collection fits in the specified array with room to spare - * (i.e., the array has more elements than this collection), the element in - * the array immediately following the end of the collection is collection to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this collection only if the caller knows that this - * collection does not contain any elements representing null.) - * - *

If the native array is smaller than the collection size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *

If this collection makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the elements - * in the same order. - * - * @param dest the array into which the elements of this collection are to be - * stored. - * @return an long[] containing all the elements in this collection - * @throws NullPointerException if the specified array is null - */ - long[] toArray( long[] dest ); - - - /** - * Inserts a value into the collection. - * - * @param entry a long value - * @return true if the collection was modified by the add operation - */ - boolean add( long entry ); - - - /** - * Removes entry from the collection. - * - * @param entry an long value - * @return true if the collection was modified by the remove operation. - */ - boolean remove( long entry ); - - - /** - * Tests the collection to determine if all of the elements in - * collection are present. - * - * @param collection a Collection value - * @return true if all elements were present in the collection. - */ - boolean containsAll( Collection collection ); - - - /** - * Tests the collection to determine if all of the elements in - * TLongCollection are present. - * - * @param collection a TLongCollection value - * @return true if all elements were present in the collection. - */ - boolean containsAll( TLongCollection collection ); - - - /** - * Tests the collection to determine if all of the elements in - * array are present. - * - * @param array as array of long primitives. - * @return true if all elements were present in the collection. - */ - boolean containsAll( long[] array ); - - - /** - * Adds all of the elements in collection to the collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( Collection collection ); - - - /** - * Adds all of the elements in the TLongCollection to the collection. - * - * @param collection a TLongCollection value - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( TLongCollection collection ); - - - /** - * Adds all of the elements in the array to the collection. - * - * @param array a array of long primitives. - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( long[] array ); - - - /** - * Removes any values in the collection which are not contained in - * collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( Collection collection ); - - - /** - * Removes any values in the collection which are not contained in - * TLongCollection. - * - * @param collection a TLongCollection value - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( TLongCollection collection ); - - - /** - * Removes any values in the collection which are not contained in - * array. - * - * @param array an array of long primitives. - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( long[] array ); - - - /** - * Removes all of the elements in collection from the collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( Collection collection ); - - - /** - * Removes all of the elements in TLongCollection from the collection. - * - * @param collection a TLongCollection value - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( TLongCollection collection ); - - - /** - * Removes all of the elements in array from the collection. - * - * @param array an array of long primitives. - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( long[] array ); - - - /** - * Empties the collection. - */ - void clear(); - - - /** - * Executes procedure for each element in the collection. - * - * @param procedure a TLongProcedure value - * @return false if the loop over the collection terminated because - * the procedure returned false for some value. - */ - boolean forEach( TLongProcedure procedure ); - - - // Comparison and hashing - - /** - * Compares the specified object with this collection for equality. Returns - * true if the specified object is also a collection, the two collection - * have the same size, and every member of the specified collection is - * contained in this collection (or equivalently, every member of this collection is - * contained in the specified collection). This definition ensures that the - * equals method works properly across different implementations of the - * collection interface. - * - * @param o object to be compared for equality with this collection - * @return true if the specified object is equal to this collection - */ - boolean equals( Object o ); - - - /** - * Returns the hash code value for this collection. The hash code of a collection is - * defined to be the sum of the hash codes of the elements in the collection. - * This ensures that s1.equals(s2) implies that - * s1.hashCode()==s2.hashCode() for any two collection s1 - * and s2, as required by the general contract of - * {@link Object#hashCode}. - * - * @return the hash code value for this collection - * @see Object#equals(Object) - * @see Collection#equals(Object) - */ - int hashCode(); - - -} // TLongCollection diff --git a/src/gnu/trove/TShortCollection.java b/src/gnu/trove/TShortCollection.java deleted file mode 100644 index b19506c..0000000 --- a/src/gnu/trove/TShortCollection.java +++ /dev/null @@ -1,316 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - -import gnu.trove.iterator.TShortIterator; -import gnu.trove.procedure.TShortProcedure; - -import java.util.Collection; -import java.io.Serializable; - -/** - * An interface that mimics the Collection interface. - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: _E_Collection.template,v 1.1.2.2 2009/09/15 02:38:30 upholderoftruth Exp $ - */ - -public interface TShortCollection extends Serializable { - - /** - * Returns the value that is used to represent null. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - short getNoEntryValue(); - - - /** - * Returns the number of elements in this collection (its cardinality). If this - * collection contains more than Integer.MAX_VALUE elements, returns - * Integer.MAX_VALUE. - * - * @return the number of elements in this collection (its cardinality) - */ - int size(); - - - /** - * Returns true if this collection contains no elements. - * - * @return true if this collection contains no elements - */ - boolean isEmpty(); - - - /** - * Returns true if this collection contains the specified element. - * - * @param entry an short value - * @return true if the collection contains the specified element. - */ - boolean contains( short entry ); - - - /** - * Creates an iterator over the values of the collection. The iterator - * supports element deletion. - * - * @return an TShortIterator value - */ - TShortIterator iterator(); - - - /** - * Returns an array containing all of the elements in this collection. - * If this collection makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the - * elements in the same order. - * - *

The returned array will be "safe" in that no references to it - * are maintained by this collection. (In other words, this method must - * allocate a new array even if this collection is backed by an array). - * The caller is thus free to modify the returned array. - * - *

This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this collection - */ - short[] toArray(); - - - /** - * Returns an array containing elements in this collection. - * - *

If this collection fits in the specified array with room to spare - * (i.e., the array has more elements than this collection), the element in - * the array immediately following the end of the collection is collection to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this collection only if the caller knows that this - * collection does not contain any elements representing null.) - * - *

If the native array is smaller than the collection size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *

If this collection makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the elements - * in the same order. - * - * @param dest the array into which the elements of this collection are to be - * stored. - * @return an short[] containing all the elements in this collection - * @throws NullPointerException if the specified array is null - */ - short[] toArray( short[] dest ); - - - /** - * Inserts a value into the collection. - * - * @param entry a short value - * @return true if the collection was modified by the add operation - */ - boolean add( short entry ); - - - /** - * Removes entry from the collection. - * - * @param entry an short value - * @return true if the collection was modified by the remove operation. - */ - boolean remove( short entry ); - - - /** - * Tests the collection to determine if all of the elements in - * collection are present. - * - * @param collection a Collection value - * @return true if all elements were present in the collection. - */ - boolean containsAll( Collection collection ); - - - /** - * Tests the collection to determine if all of the elements in - * TShortCollection are present. - * - * @param collection a TShortCollection value - * @return true if all elements were present in the collection. - */ - boolean containsAll( TShortCollection collection ); - - - /** - * Tests the collection to determine if all of the elements in - * array are present. - * - * @param array as array of short primitives. - * @return true if all elements were present in the collection. - */ - boolean containsAll( short[] array ); - - - /** - * Adds all of the elements in collection to the collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( Collection collection ); - - - /** - * Adds all of the elements in the TShortCollection to the collection. - * - * @param collection a TShortCollection value - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( TShortCollection collection ); - - - /** - * Adds all of the elements in the array to the collection. - * - * @param array a array of short primitives. - * @return true if the collection was modified by the add all operation. - */ - boolean addAll( short[] array ); - - - /** - * Removes any values in the collection which are not contained in - * collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( Collection collection ); - - - /** - * Removes any values in the collection which are not contained in - * TShortCollection. - * - * @param collection a TShortCollection value - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( TShortCollection collection ); - - - /** - * Removes any values in the collection which are not contained in - * array. - * - * @param array an array of short primitives. - * @return true if the collection was modified by the retain all operation - */ - boolean retainAll( short[] array ); - - - /** - * Removes all of the elements in collection from the collection. - * - * @param collection a Collection value - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( Collection collection ); - - - /** - * Removes all of the elements in TShortCollection from the collection. - * - * @param collection a TShortCollection value - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( TShortCollection collection ); - - - /** - * Removes all of the elements in array from the collection. - * - * @param array an array of short primitives. - * @return true if the collection was modified by the remove all operation. - */ - boolean removeAll( short[] array ); - - - /** - * Empties the collection. - */ - void clear(); - - - /** - * Executes procedure for each element in the collection. - * - * @param procedure a TShortProcedure value - * @return false if the loop over the collection terminated because - * the procedure returned false for some value. - */ - boolean forEach( TShortProcedure procedure ); - - - // Comparison and hashing - - /** - * Compares the specified object with this collection for equality. Returns - * true if the specified object is also a collection, the two collection - * have the same size, and every member of the specified collection is - * contained in this collection (or equivalently, every member of this collection is - * contained in the specified collection). This definition ensures that the - * equals method works properly across different implementations of the - * collection interface. - * - * @param o object to be compared for equality with this collection - * @return true if the specified object is equal to this collection - */ - boolean equals( Object o ); - - - /** - * Returns the hash code value for this collection. The hash code of a collection is - * defined to be the sum of the hash codes of the elements in the collection. - * This ensures that s1.equals(s2) implies that - * s1.hashCode()==s2.hashCode() for any two collection s1 - * and s2, as required by the general contract of - * {@link Object#hashCode}. - * - * @return the hash code value for this collection - * @see Object#equals(Object) - * @see Collection#equals(Object) - */ - int hashCode(); - - -} // TShortCollection diff --git a/src/gnu/trove/function/TByteFunction.java b/src/gnu/trove/function/TByteFunction.java deleted file mode 100644 index 1fa50ba..0000000 --- a/src/gnu/trove/function/TByteFunction.java +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.function; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for functions that accept and return one byte primitive. - */ -public interface TByteFunction { - /** - * Execute this function with value - * - * @param value a byte input - * @return a byte result - */ - public byte execute( byte value ); -} diff --git a/src/gnu/trove/function/TCharFunction.java b/src/gnu/trove/function/TCharFunction.java deleted file mode 100644 index 8f57b66..0000000 --- a/src/gnu/trove/function/TCharFunction.java +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.function; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for functions that accept and return one char primitive. - */ -public interface TCharFunction { - /** - * Execute this function with value - * - * @param value a char input - * @return a char result - */ - public char execute( char value ); -} diff --git a/src/gnu/trove/function/TDoubleFunction.java b/src/gnu/trove/function/TDoubleFunction.java deleted file mode 100644 index d46f5ae..0000000 --- a/src/gnu/trove/function/TDoubleFunction.java +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.function; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for functions that accept and return one double primitive. - */ -public interface TDoubleFunction { - /** - * Execute this function with value - * - * @param value a double input - * @return a double result - */ - public double execute( double value ); -} diff --git a/src/gnu/trove/function/TFloatFunction.java b/src/gnu/trove/function/TFloatFunction.java deleted file mode 100644 index 2b72646..0000000 --- a/src/gnu/trove/function/TFloatFunction.java +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.function; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for functions that accept and return one float primitive. - */ -public interface TFloatFunction { - /** - * Execute this function with value - * - * @param value a float input - * @return a float result - */ - public float execute( float value ); -} diff --git a/src/gnu/trove/function/TIntFunction.java b/src/gnu/trove/function/TIntFunction.java deleted file mode 100644 index 642eabd..0000000 --- a/src/gnu/trove/function/TIntFunction.java +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.function; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for functions that accept and return one int primitive. - */ -public interface TIntFunction { - /** - * Execute this function with value - * - * @param value a int input - * @return a int result - */ - public int execute( int value ); -} diff --git a/src/gnu/trove/function/TLongFunction.java b/src/gnu/trove/function/TLongFunction.java deleted file mode 100644 index 64219cb..0000000 --- a/src/gnu/trove/function/TLongFunction.java +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.function; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for functions that accept and return one long primitive. - */ -public interface TLongFunction { - /** - * Execute this function with value - * - * @param value a long input - * @return a long result - */ - public long execute( long value ); -} diff --git a/src/gnu/trove/function/TObjectFunction.java b/src/gnu/trove/function/TObjectFunction.java deleted file mode 100644 index e8873b7..0000000 --- a/src/gnu/trove/function/TObjectFunction.java +++ /dev/null @@ -1,39 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.function; - -/** - * Interface for functions that accept and return one Object reference. - *

- * Created: Mon Nov 5 22:19:36 2001 - * - * @author Eric D. Friedman - * @version $Id: TObjectFunction.java,v 1.1.2.1 2009/09/06 17:02:19 upholderoftruth Exp $ - */ - -public interface TObjectFunction { - - /** - * Execute this function with value - * - * @param value an Object input - * @return an Object result - */ - public R execute( T value ); -}// TObjectFunction diff --git a/src/gnu/trove/function/TShortFunction.java b/src/gnu/trove/function/TShortFunction.java deleted file mode 100644 index ea3c8de..0000000 --- a/src/gnu/trove/function/TShortFunction.java +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.function; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for functions that accept and return one short primitive. - */ -public interface TShortFunction { - /** - * Execute this function with value - * - * @param value a short input - * @return a short result - */ - public short execute( short value ); -} diff --git a/src/gnu/trove/impl/Constants.java b/src/gnu/trove/impl/Constants.java deleted file mode 100644 index 09237a2..0000000 --- a/src/gnu/trove/impl/Constants.java +++ /dev/null @@ -1,165 +0,0 @@ -// //////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// //////////////////////////////////////////////////////////////////////////// -package gnu.trove.impl; - -/** - * Central location for constants needed by various implementations. - */ -public class Constants { - - private static final boolean VERBOSE = - System.getProperty( "gnu.trove.verbose", null ) != null; - - /** the default capacity for new collections */ - public static final int DEFAULT_CAPACITY = 10; - - /** the load above which rehashing occurs. */ - public static final float DEFAULT_LOAD_FACTOR = 0.5f; - - - /** the default value that represents for byte types. */ - public static final byte DEFAULT_BYTE_NO_ENTRY_VALUE; - static { - byte value; - String property = System.getProperty( "gnu.trove.no_entry.byte", "0" ); - if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Byte.MAX_VALUE; - else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Byte.MIN_VALUE; - else value = Byte.valueOf( property ); - - if ( value > Byte.MAX_VALUE ) value = Byte.MAX_VALUE; - else if ( value < Byte.MIN_VALUE ) value = Byte.MIN_VALUE; - DEFAULT_BYTE_NO_ENTRY_VALUE = value; - if ( VERBOSE ) { - System.out.println( "DEFAULT_BYTE_NO_ENTRY_VALUE: " + - DEFAULT_BYTE_NO_ENTRY_VALUE ); - } - } - - - /** the default value that represents for short types. */ - public static final short DEFAULT_SHORT_NO_ENTRY_VALUE; - static { - short value; - String property = System.getProperty( "gnu.trove.no_entry.short", "0" ); - if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Short.MAX_VALUE; - else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Short.MIN_VALUE; - else value = Short.valueOf( property ); - - if ( value > Short.MAX_VALUE ) value = Short.MAX_VALUE; - else if ( value < Short.MIN_VALUE ) value = Short.MIN_VALUE; - DEFAULT_SHORT_NO_ENTRY_VALUE = value; - if ( VERBOSE ) { - System.out.println( "DEFAULT_SHORT_NO_ENTRY_VALUE: " + - DEFAULT_SHORT_NO_ENTRY_VALUE ); - } - } - - - /** the default value that represents for char types. */ - public static final char DEFAULT_CHAR_NO_ENTRY_VALUE; - static { - char value; - String property = System.getProperty( "gnu.trove.no_entry.char", "\0" ); - if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Character.MAX_VALUE; - else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Character.MIN_VALUE; - else value = property.toCharArray()[0]; - - if ( value > Character.MAX_VALUE ) value = Character.MAX_VALUE; - else if ( value < Character.MIN_VALUE ) value = Character.MIN_VALUE; - DEFAULT_CHAR_NO_ENTRY_VALUE = value; - if ( VERBOSE ) { - System.out.println( "DEFAULT_CHAR_NO_ENTRY_VALUE: " + - Integer.valueOf( value ) ); - } - } - - - /** the default value that represents for int types. */ - public static final int DEFAULT_INT_NO_ENTRY_VALUE; - static { - int value; - String property = System.getProperty( "gnu.trove.no_entry.int", "0" ); - if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Integer.MAX_VALUE; - else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Integer.MIN_VALUE; - else value = Integer.valueOf( property ); - DEFAULT_INT_NO_ENTRY_VALUE = value; - if ( VERBOSE ) { - System.out.println( "DEFAULT_INT_NO_ENTRY_VALUE: " + - DEFAULT_INT_NO_ENTRY_VALUE ); - } - } - - - /** the default value that represents for long types. */ - public static final long DEFAULT_LONG_NO_ENTRY_VALUE; - static { - long value; - String property = System.getProperty( "gnu.trove.no_entry.long", "0" ); - if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Long.MAX_VALUE; - else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Long.MIN_VALUE; - else value = Long.valueOf( property ); - DEFAULT_LONG_NO_ENTRY_VALUE = value; - if ( VERBOSE ) { - System.out.println( "DEFAULT_LONG_NO_ENTRY_VALUE: " + - DEFAULT_LONG_NO_ENTRY_VALUE ); - } - } - - - /** the default value that represents for float types. */ - public static final float DEFAULT_FLOAT_NO_ENTRY_VALUE; - static { - float value; - String property = System.getProperty( "gnu.trove.no_entry.float", "0" ); - if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Float.MAX_VALUE; - else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Float.MIN_VALUE; - // Value from Float.MIN_NORMAL (introduced in 1.6) - else if ( "MIN_NORMAL".equalsIgnoreCase( property ) ) value = 0x1.0p-126f; - else if ( "NEGATIVE_INFINITY".equalsIgnoreCase( property ) ) value = Float.NEGATIVE_INFINITY; - else if ( "POSITIVE_INFINITY".equalsIgnoreCase( property ) ) value = Float.POSITIVE_INFINITY; -// else if ( "NaN".equalsIgnoreCase( property ) ) value = Float.NaN; - else value = Float.valueOf( property ); - DEFAULT_FLOAT_NO_ENTRY_VALUE = value; - if ( VERBOSE ) { - System.out.println( "DEFAULT_FLOAT_NO_ENTRY_VALUE: " + - DEFAULT_FLOAT_NO_ENTRY_VALUE ); - } - } - - - /** the default value that represents for double types. */ - public static final double DEFAULT_DOUBLE_NO_ENTRY_VALUE; - static { - double value; - String property = System.getProperty( "gnu.trove.no_entry.double", "0" ); - if ( "MAX_VALUE".equalsIgnoreCase( property ) ) value = Double.MAX_VALUE; - else if ( "MIN_VALUE".equalsIgnoreCase( property ) ) value = Double.MIN_VALUE; - // Value from Double.MIN_NORMAL (introduced in 1.6) - else if ( "MIN_NORMAL".equalsIgnoreCase( property ) ) value = 0x1.0p-1022; - else if ( "NEGATIVE_INFINITY".equalsIgnoreCase( property ) ) value = Double.NEGATIVE_INFINITY; - else if ( "POSITIVE_INFINITY".equalsIgnoreCase( property ) ) value = Double.POSITIVE_INFINITY; -// else if ( "NaN".equalsIgnoreCase( property ) ) value = Double.NaN; - else value = Double.valueOf( property ); - DEFAULT_DOUBLE_NO_ENTRY_VALUE = value; - if ( VERBOSE ) { - System.out.println( "DEFAULT_DOUBLE_NO_ENTRY_VALUE: " + - DEFAULT_DOUBLE_NO_ENTRY_VALUE ); - } - } -} diff --git a/src/gnu/trove/impl/DualPivotQuicksort.java b/src/gnu/trove/impl/DualPivotQuicksort.java deleted file mode 100644 index b0345a4..0000000 --- a/src/gnu/trove/impl/DualPivotQuicksort.java +++ /dev/null @@ -1,124 +0,0 @@ -package gnu.trove.impl; - -/* - * @author Vladimir Yaroslavskiy - * @version 2009.09.10 m765 - */ -public class DualPivotQuicksort { - - public static void sort(int[] a) { - sort(a, 0, a.length); - } - - public static void sort(int[] a, int fromIndex, int toIndex) { - rangeCheck(a.length, fromIndex, toIndex); - dualPivotQuicksort(a, fromIndex, toIndex - 1, 3); - } - - private static void rangeCheck(int length, int fromIndex, int toIndex) { - if (fromIndex > toIndex) { - throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")"); - } - if (fromIndex < 0) { - throw new ArrayIndexOutOfBoundsException(fromIndex); - } - if (toIndex > length) { - throw new ArrayIndexOutOfBoundsException(toIndex); - } - } - - private static void swap(int[] a, int i, int j) { - int temp = a[i]; - a[i] = a[j]; - a[j] = temp; - } - - private static void dualPivotQuicksort(int[] a, int left, int right, int div) { - int len = right - left; - - if (len < 27) { // insertion sort for tiny array - for (int i = left + 1; i <= right; i++) { - for (int j = i; j > left && a[j] < a[j - 1]; j--) { - swap(a, j, j - 1); - } - } - return; - } - int third = len / div; - - // "medians" - int m1 = left + third; - int m2 = right - third; - - if (m1 <= left) { - m1 = left + 1; - } - if (m2 >= right) { - m2 = right - 1; - } - if (a[m1] < a[m2]) { - swap(a, m1, left); - swap(a, m2, right); - } - else { - swap(a, m1, right); - swap(a, m2, left); - } - // pivots - int pivot1 = a[left]; - int pivot2 = a[right]; - - // pointers - int less = left + 1; - int great = right - 1; - - // sorting - for (int k = less; k <= great; k++) { - if (a[k] < pivot1) { - swap(a, k, less++); - } - else if (a[k] > pivot2) { - while (k < great && a[great] > pivot2) { - great--; - } - swap(a, k, great--); - - if (a[k] < pivot1) { - swap(a, k, less++); - } - } - } - // swaps - int dist = great - less; - - if (dist < 13) { - div++; - } - swap(a, less - 1, left); - swap(a, great + 1, right); - - // subarrays - dualPivotQuicksort(a, left, less - 2, div); - dualPivotQuicksort(a, great + 2, right, div); - - // equal elements - if (dist > len - 13 && pivot1 != pivot2) { - for (int k = less; k <= great; k++) { - if (a[k] == pivot1) { - swap(a, k, less++); - } - else if (a[k] == pivot2) { - swap(a, k, great--); - - if (a[k] == pivot1) { - swap(a, k, less++); - } - } - } - } - // subarray - if (pivot1 < pivot2) { - dualPivotQuicksort(a, less, great, div); - } - } -} diff --git a/src/gnu/trove/impl/HashFunctions.java b/src/gnu/trove/impl/HashFunctions.java deleted file mode 100644 index a7be443..0000000 --- a/src/gnu/trove/impl/HashFunctions.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 1999 CERN - European Organization for Nuclear Research. - -// Permission to use, copy, modify, distribute and sell this software and -// its documentation for any purpose is hereby granted without fee, -// provided that the above copyright notice appear in all copies and that -// both that copyright notice and this permission notice appear in -// supporting documentation. CERN makes no representations about the -// suitability of this software for any purpose. It is provided "as is" -// without expressed or implied warranty. - -package gnu.trove.impl; - -/** - * Provides various hash functions. - * - * @author wolfgang.hoschek@cern.ch - * @version 1.0, 09/24/99 - */ -public final class HashFunctions { - /** - * Returns a hashcode for the specified value. - * - * @return a hash code value for the specified value. - */ - public static int hash(double value) { - assert !Double.isNaN(value) : "Values of NaN are not supported."; - - long bits = Double.doubleToLongBits(value); - return (int)(bits ^ (bits >>> 32)); - //return (int) Double.doubleToLongBits(value*663608941.737); - //this avoids excessive hashCollisions in the case values are - //of the form (1.0, 2.0, 3.0, ...) - } - - /** - * Returns a hashcode for the specified value. - * - * @return a hash code value for the specified value. - */ - public static int hash(float value) { - assert !Float.isNaN(value) : "Values of NaN are not supported."; - - return Float.floatToIntBits(value*663608941.737f); - // this avoids excessive hashCollisions in the case values are - // of the form (1.0, 2.0, 3.0, ...) - } - - /** - * Returns a hashcode for the specified value. - * - * @return a hash code value for the specified value. - */ - public static int hash(int value) { - return value; - } - - /** - * Returns a hashcode for the specified value. - * - * @return a hash code value for the specified value. - */ - public static int hash(long value) { - return ((int)(value ^ (value >>> 32))); - } - - /** - * Returns a hashcode for the specified object. - * - * @return a hash code value for the specified object. - */ - public static int hash(Object object) { - return object==null ? 0 : object.hashCode(); - } - - - /** - * In profiling, it has been found to be faster to have our own local implementation - * of "ceil" rather than to call to {@link Math#ceil(double)}. - */ - public static int fastCeil( float v ) { - int possible_result = ( int ) v; - if ( v - possible_result > 0 ) possible_result++; - return possible_result; - } -} diff --git a/src/gnu/trove/impl/PrimeFinder.java b/src/gnu/trove/impl/PrimeFinder.java deleted file mode 100644 index 11abe57..0000000 --- a/src/gnu/trove/impl/PrimeFinder.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) 1999 CERN - European Organization for Nuclear Research. - -// Permission to use, copy, modify, distribute and sell this software -// and its documentation for any purpose is hereby granted without fee, -// provided that the above copyright notice appear in all copies and -// that both that copyright notice and this permission notice appear in -// supporting documentation. CERN makes no representations about the -// suitability of this software for any purpose. It is provided "as is" -// without expressed or implied warranty. -package gnu.trove.impl; - -import java.util.Arrays; - -/* - * Modified for Trove to use the java.util.Arrays sort/search - * algorithms instead of those provided with colt. - */ - -/** - * Used to keep hash table capacities prime numbers. - * Not of interest for users; only for implementors of hashtables. - * - *

Choosing prime numbers as hash table capacities is a good idea - * to keep them working fast, particularly under hash table - * expansions. - * - *

However, JDK 1.2, JGL 3.1 and many other toolkits do nothing to - * keep capacities prime. This class provides efficient means to - * choose prime capacities. - * - *

Choosing a prime is O(log 300) (binary search in a list - * of 300 ints). Memory requirements: 1 KB static memory. - * - * @author wolfgang.hoschek@cern.ch - * @version 1.0, 09/24/99 - */ -public final class PrimeFinder { - /** - * The largest prime this class can generate; currently equal to - * Integer.MAX_VALUE. - */ - public static final int largestPrime = Integer.MAX_VALUE; //yes, it is prime. - - /** - * The prime number list consists of 11 chunks. - * - * Each chunk contains prime numbers. - * - * A chunk starts with a prime P1. The next element is a prime - * P2. P2 is the smallest prime for which holds: P2 >= 2*P1. - * - * The next element is P3, for which the same holds with respect - * to P2, and so on. - * - * Chunks are chosen such that for any desired capacity >= 1000 - * the list includes a prime number <= desired capacity * 1.11. - * - * Therefore, primes can be retrieved which are quite close to any - * desired capacity, which in turn avoids wasting memory. - * - * For example, the list includes - * 1039,1117,1201,1277,1361,1439,1523,1597,1759,1907,2081. - * - * So if you need a prime >= 1040, you will find a prime <= - * 1040*1.11=1154. - * - * Chunks are chosen such that they are optimized for a hashtable - * growthfactor of 2.0; - * - * If your hashtable has such a growthfactor then, after initially - * "rounding to a prime" upon hashtable construction, it will - * later expand to prime capacities such that there exist no - * better primes. - * - * In total these are about 32*10=320 numbers -> 1 KB of static - * memory needed. - * - * If you are stingy, then delete every second or fourth chunk. - */ - - private static final int[] primeCapacities = { - //chunk #0 - largestPrime, - - //chunk #1 - 5,11,23,47,97,197,397,797,1597,3203,6421,12853,25717,51437,102877,205759, - 411527,823117,1646237,3292489,6584983,13169977,26339969,52679969,105359939, - 210719881,421439783,842879579,1685759167, - - //chunk #2 - 433,877,1759,3527,7057,14143,28289,56591,113189,226379,452759,905551,1811107, - 3622219,7244441,14488931,28977863,57955739,115911563,231823147,463646329,927292699, - 1854585413, - - //chunk #3 - 953,1907,3821,7643,15287,30577,61169,122347,244703,489407,978821,1957651,3915341, - 7830701,15661423,31322867,62645741,125291483,250582987,501165979,1002331963, - 2004663929, - - //chunk #4 - 1039,2081,4177,8363,16729,33461,66923,133853,267713,535481,1070981,2141977,4283963, - 8567929,17135863,34271747,68543509,137087021,274174111,548348231,1096696463, - - //chunk #5 - 31,67,137,277,557,1117,2237,4481,8963,17929,35863,71741,143483,286973,573953, - 1147921,2295859,4591721,9183457,18366923,36733847,73467739,146935499,293871013, - 587742049,1175484103, - - //chunk #6 - 599,1201,2411,4831,9677,19373,38747,77509,155027,310081,620171,1240361,2480729, - 4961459,9922933,19845871,39691759,79383533,158767069,317534141,635068283,1270136683, - - //chunk #7 - 311,631,1277,2557,5119,10243,20507,41017,82037,164089,328213,656429,1312867, - 2625761,5251529,10503061,21006137,42012281,84024581,168049163,336098327,672196673, - 1344393353, - - //chunk #8 - 3,7,17,37,79,163,331,673,1361,2729,5471,10949,21911,43853,87719,175447,350899, - 701819,1403641,2807303,5614657,11229331,22458671,44917381,89834777,179669557, - 359339171,718678369,1437356741, - - //chunk #9 - 43,89,179,359,719,1439,2879,5779,11579,23159,46327,92657,185323,370661,741337, - 1482707,2965421,5930887,11861791,23723597,47447201,94894427,189788857,379577741, - 759155483,1518310967, - - //chunk #10 - 379,761,1523,3049,6101,12203,24407,48817,97649,195311,390647,781301,1562611, - 3125257,6250537,12501169,25002389,50004791,100009607,200019221,400038451,800076929, - 1600153859 - }; - - static { //initializer - // The above prime numbers are formatted for human readability. - // To find numbers fast, we sort them once and for all. - - Arrays.sort(primeCapacities); - } - - /** - * Returns a prime number which is >= desiredCapacity - * and very close to desiredCapacity (within 11% if - * desiredCapacity >= 1000). - * - * @param desiredCapacity the capacity desired by the user. - * @return the capacity which should be used for a hashtable. - */ - public static final int nextPrime(int desiredCapacity) { - int i = Arrays.binarySearch(primeCapacities, desiredCapacity); - if (i<0) { - // desired capacity not found, choose next prime greater - // than desired capacity - i = -i -1; // remember the semantics of binarySearch... - } - return primeCapacities[i]; - } -} diff --git a/src/gnu/trove/impl/hash/THash.java b/src/gnu/trove/impl/hash/THash.java deleted file mode 100644 index 5625ebc..0000000 --- a/src/gnu/trove/impl/hash/THash.java +++ /dev/null @@ -1,428 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.impl.hash; - -import gnu.trove.impl.Constants; -import gnu.trove.impl.HashFunctions; -import gnu.trove.impl.PrimeFinder; - -import java.io.Externalizable; -import java.io.ObjectOutput; -import java.io.IOException; -import java.io.ObjectInput; - - - -/** - * Base class for hashtables that use open addressing to resolve - * collisions. - * - * Created: Wed Nov 28 21:11:16 2001 - * - * @author Eric D. Friedman - * @author Rob Eden (auto-compaction) - * @author Jeff Randall - * - * @version $Id: THash.java,v 1.1.2.4 2010/03/02 00:55:34 robeden Exp $ - */ -abstract public class THash implements Externalizable { - - static final long serialVersionUID = -1792948471915530295L; - - /** the load above which rehashing occurs. */ - protected static final float DEFAULT_LOAD_FACTOR = Constants.DEFAULT_LOAD_FACTOR; - - /** - * the default initial capacity for the hash table. This is one - * less than a prime value because one is added to it when - * searching for a prime capacity to account for the free slot - * required by open addressing. Thus, the real default capacity is - * 11. - */ - protected static final int DEFAULT_CAPACITY = Constants.DEFAULT_CAPACITY; - - - /** the current number of occupied slots in the hash. */ - protected transient int _size; - - /** the current number of free slots in the hash. */ - protected transient int _free; - - /** - * Determines how full the internal table can become before - * rehashing is required. This must be a value in the range: 0.0 < - * loadFactor < 1.0. The default value is 0.5, which is about as - * large as you can get in open addressing without hurting - * performance. Cf. Knuth, Volume 3., Chapter 6. - */ - protected float _loadFactor; - - /** - * The maximum number of elements allowed without allocating more - * space. - */ - protected int _maxSize; - - - /** The number of removes that should be performed before an auto-compaction occurs. */ - protected int _autoCompactRemovesRemaining; - - /** - * The auto-compaction factor for the table. - * - * @see #setAutoCompactionFactor - */ - protected float _autoCompactionFactor; - - /** @see #tempDisableAutoCompaction */ - protected transient boolean _autoCompactTemporaryDisable = false; - - - /** - * Creates a new THash instance with the default - * capacity and load factor. - */ - public THash() { - this( DEFAULT_CAPACITY, DEFAULT_LOAD_FACTOR ); - } - - - /** - * Creates a new THash instance with a prime capacity - * at or near the specified capacity and with the default load - * factor. - * - * @param initialCapacity an int value - */ - public THash( int initialCapacity ) { - this( initialCapacity, DEFAULT_LOAD_FACTOR ); - } - - - /** - * Creates a new THash instance with a prime capacity - * at or near the minimum needed to hold initialCapacity - * elements with load factor loadFactor without triggering - * a rehash. - * - * @param initialCapacity an int value - * @param loadFactor a float value - */ - public THash( int initialCapacity, float loadFactor ) { - super(); - _loadFactor = loadFactor; - - // Through testing, the load factor (especially the default load factor) has been - // found to be a pretty good starting auto-compaction factor. - _autoCompactionFactor = loadFactor; - - setUp( HashFunctions.fastCeil( initialCapacity / loadFactor ) ); - } - - - /** - * Tells whether this set is currently holding any elements. - * - * @return a boolean value - */ - public boolean isEmpty() { - return 0 == _size; - } - - - /** - * Returns the number of distinct elements in this collection. - * - * @return an int value - */ - public int size() { - return _size; - } - - - /** @return the current physical capacity of the hash table. */ - abstract public int capacity(); - - - /** - * Ensure that this hashtable has sufficient capacity to hold - * desiredCapacity additional elements without - * requiring a rehash. This is a tuning method you can call - * before doing a large insert. - * - * @param desiredCapacity an int value - */ - public void ensureCapacity( int desiredCapacity ) { - if ( desiredCapacity > ( _maxSize - size() ) ) { - rehash( PrimeFinder.nextPrime( HashFunctions.fastCeil( - ( desiredCapacity + size() ) / _loadFactor ) + 1 ) ); - computeMaxSize( capacity() ); - } - } - - - /** - * Compresses the hashtable to the minimum prime size (as defined - * by PrimeFinder) that will hold all of the elements currently in - * the table. If you have done a lot of remove - * operations and plan to do a lot of queries or insertions or - * iteration, it is a good idea to invoke this method. Doing so - * will accomplish two things: - *

- *

    - *
  1. You'll free memory allocated to the table but no - * longer needed because of the remove()s.
  2. - *

    - *

  3. You'll get better query/insert/iterator performance - * because there won't be any REMOVED slots to skip - * over when probing for indices in the table.
  4. - *
- */ - public void compact() { - // need at least one free spot for open addressing - rehash( PrimeFinder.nextPrime( HashFunctions.fastCeil( size() / _loadFactor ) + 1 ) ); - computeMaxSize( capacity() ); - - // If auto-compaction is enabled, re-determine the compaction interval - if ( _autoCompactionFactor != 0 ) { - computeNextAutoCompactionAmount( size() ); - } - } - - - /** - * The auto-compaction factor controls whether and when a table performs a - * {@link #compact} automatically after a certain number of remove operations. - * If the value is non-zero, the number of removes that need to occur for - * auto-compaction is the size of table at the time of the previous compaction - * (or the initial capacity) multiplied by this factor. - *

- * Setting this value to zero will disable auto-compaction. - * - * @param factor a float that indicates the auto-compaction factor - */ - public void setAutoCompactionFactor( float factor ) { - if ( factor < 0 ) { - throw new IllegalArgumentException( "Factor must be >= 0: " + factor ); - } - - _autoCompactionFactor = factor; - } - - - /** - * @see #setAutoCompactionFactor - * - * @return a <float that represents the auto-compaction factor. - */ - public float getAutoCompactionFactor() { - return _autoCompactionFactor; - } - - - /** - * This simply calls {@link #compact compact}. It is included for - * symmetry with other collection classes. Note that the name of this - * method is somewhat misleading (which is why we prefer - * compact) as the load factor may require capacity above - * and beyond the size of this collection. - * - * @see #compact - */ - public final void trimToSize() { - compact(); - } - - - /** - * Delete the record at index. Reduces the size of the - * collection by one. - * - * @param index an int value - */ - protected void removeAt( int index ) { - _size--; - - // If auto-compaction is enabled, see if we need to compact - if ( _autoCompactionFactor != 0 ) { - _autoCompactRemovesRemaining--; - - if ( !_autoCompactTemporaryDisable && _autoCompactRemovesRemaining <= 0 ) { - // Do the compact - // NOTE: this will cause the next compaction interval to be calculated - compact(); - } - } - } - - - /** Empties the collection. */ - public void clear() { - _size = 0; - _free = capacity(); - } - - - /** - * initializes the hashtable to a prime capacity which is at least - * initialCapacity + 1. - * - * @param initialCapacity an int value - * @return the actual capacity chosen - */ - protected int setUp( int initialCapacity ) { - int capacity; - - capacity = PrimeFinder.nextPrime( initialCapacity ); - computeMaxSize( capacity ); - computeNextAutoCompactionAmount( initialCapacity ); - - return capacity; - } - - - /** - * Rehashes the set. - * - * @param newCapacity an int value - */ - protected abstract void rehash( int newCapacity ); - - - /** - * Temporarily disables auto-compaction. MUST be followed by calling - * {@link #reenableAutoCompaction}. - */ - public void tempDisableAutoCompaction() { - _autoCompactTemporaryDisable = true; - } - - - /** - * Re-enable auto-compaction after it was disabled via - * {@link #tempDisableAutoCompaction()}. - * - * @param check_for_compaction True if compaction should be performed if needed - * before returning. If false, no compaction will be - * performed. - */ - public void reenableAutoCompaction( boolean check_for_compaction ) { - _autoCompactTemporaryDisable = false; - - if ( check_for_compaction && _autoCompactRemovesRemaining <= 0 && - _autoCompactionFactor != 0 ) { - - // Do the compact - // NOTE: this will cause the next compaction interval to be calculated - compact(); - } - } - - - /** - * Computes the values of maxSize. There will always be at least - * one free slot required. - * - * @param capacity an int value - */ - protected void computeMaxSize( int capacity ) { - // need at least one free slot for open addressing - _maxSize = Math.min( capacity - 1, (int) ( capacity * _loadFactor ) ); - _free = capacity - _size; // reset the free element count - } - - - /** - * Computes the number of removes that need to happen before the next auto-compaction - * will occur. - * - * @param size an int that sets the auto-compaction limit. - */ - protected void computeNextAutoCompactionAmount( int size ) { - if ( _autoCompactionFactor != 0 ) { - // NOTE: doing the round ourselves has been found to be faster than using - // Math.round. - _autoCompactRemovesRemaining = - (int) ( ( size * _autoCompactionFactor ) + 0.5f ); - } - } - - - /** - * After an insert, this hook is called to adjust the size/free - * values of the set and to perform rehashing if necessary. - * - * @param usedFreeSlot the slot - */ - protected final void postInsertHook( boolean usedFreeSlot ) { - if ( usedFreeSlot ) { - _free--; - } - - // rehash whenever we exhaust the available space in the table - if ( ++_size > _maxSize || _free == 0 ) { - // choose a new capacity suited to the new state of the table - // if we've grown beyond our maximum size, double capacity; - // if we've exhausted the free spots, rehash to the same capacity, - // which will free up any stale removed slots for reuse. - int newCapacity = _size > _maxSize ? PrimeFinder.nextPrime( capacity() << 1 ) : capacity(); - rehash( newCapacity ); - computeMaxSize( capacity() ); - } - } - - - protected int calculateGrownCapacity() { - return capacity() << 1; - } - - - public void writeExternal( ObjectOutput out ) throws IOException { - // VERSION - out.writeByte( 0 ); - - // LOAD FACTOR - out.writeFloat( _loadFactor ); - - // AUTO COMPACTION LOAD FACTOR - out.writeFloat( _autoCompactionFactor ); - } - - - public void readExternal( ObjectInput in ) - throws IOException, ClassNotFoundException { - - // VERSION - in.readByte(); - - // LOAD FACTOR - float old_factor = _loadFactor; - _loadFactor = in.readFloat(); - - // AUTO COMPACTION LOAD FACTOR - _autoCompactionFactor = in.readFloat(); - - // If we change the laod factor from the default, re-setup - if ( old_factor != _loadFactor ) { - setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) ); - } - } -}// THash \ No newline at end of file diff --git a/src/gnu/trove/impl/hash/THashIterator.java b/src/gnu/trove/impl/hash/THashIterator.java deleted file mode 100644 index 4898620..0000000 --- a/src/gnu/trove/impl/hash/THashIterator.java +++ /dev/null @@ -1,177 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.impl.hash; - -import gnu.trove.iterator.TIterator; - -import java.util.ConcurrentModificationException; -import java.util.Iterator; -import java.util.NoSuchElementException; - - - -/** - * Implements all iterator functions for the hashed object set. - * Subclasses may override objectAtIndex to vary the object - * returned by calls to next() (e.g. for values, and Map.Entry - * objects). - *

- *

Note that iteration is fastest if you forego the calls to - * hasNext in favor of checking the size of the structure - * yourself and then call next() that many times: - *

- *

- * Iterator i = collection.iterator();
- * for (int size = collection.size(); size-- > 0;) {
- *   Object o = i.next();
- * }
- * 
- *

- *

You may, of course, use the hasNext(), next() idiom too if - * you aren't in a performance critical spot.

- */ -public abstract class THashIterator implements TIterator, Iterator { - - - private final TObjectHash _object_hash; - - /** the data structure this iterator traverses */ - protected final THash _hash; - - /** - * the number of elements this iterator believes are in the - * data structure it accesses. - */ - protected int _expectedSize; - - /** the index used for iteration. */ - protected int _index; - - - /** - * Create an instance of THashIterator over the values of the TObjectHash - * - * @param hash the object - */ - protected THashIterator( TObjectHash hash ) { - _hash = hash; - _expectedSize = _hash.size(); - _index = _hash.capacity(); - _object_hash = hash; - } - - - /** - * Moves the iterator to the next Object and returns it. - * - * @return an Object value - * @throws ConcurrentModificationException - * if the structure - * was changed using a method that isn't on this iterator. - * @throws NoSuchElementException if this is called on an - * exhausted iterator. - */ - public V next() { - moveToNextIndex(); - return objectAtIndex( _index ); - } - - - /** - * Returns true if the iterator can be advanced past its current - * location. - * - * @return a boolean value - */ - public boolean hasNext() { - return nextIndex() >= 0; - } - - - /** - * Removes the last entry returned by the iterator. - * Invoking this method more than once for a single entry - * will leave the underlying data structure in a confused - * state. - */ - public void remove() { - if ( _expectedSize != _hash.size() ) { - throw new ConcurrentModificationException(); - } - - // Disable auto compaction during the remove. This is a workaround for bug 1642768. - try { - _hash.tempDisableAutoCompaction(); - _hash.removeAt( _index ); - } - finally { - _hash.reenableAutoCompaction( false ); - } - - _expectedSize--; - } - - - /** - * Sets the internal index so that the `next' object - * can be returned. - */ - protected final void moveToNextIndex() { - // doing the assignment && < 0 in one line shaves - // 3 opcodes... - if ( ( _index = nextIndex() ) < 0 ) { - throw new NoSuchElementException(); - } - } - - - /** - * Returns the index of the next value in the data structure - * or a negative value if the iterator is exhausted. - * - * @return an int value - * @throws ConcurrentModificationException - * if the underlying - * collection's size has been modified since the iterator was - * created. - */ - protected final int nextIndex() { - if ( _expectedSize != _hash.size() ) { - throw new ConcurrentModificationException(); - } - - Object[] set = _object_hash._set; - int i = _index; - while ( i-- > 0 && ( set[i] == TObjectHash.FREE || set[i] == TObjectHash.REMOVED ) ) { - ; - } - return i; - } - - - /** - * Returns the object at the specified index. Subclasses should - * implement this to return the appropriate object for the given - * index. - * - * @param index the index of the value to return. - * @return an Object value - */ - abstract protected V objectAtIndex( int index ); -} // THashIterator diff --git a/src/gnu/trove/impl/hash/THashPrimitiveIterator.java b/src/gnu/trove/impl/hash/THashPrimitiveIterator.java deleted file mode 100644 index 9e7ecb2..0000000 --- a/src/gnu/trove/impl/hash/THashPrimitiveIterator.java +++ /dev/null @@ -1,143 +0,0 @@ -// //////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// //////////////////////////////////////////////////////////////////////////// - -package gnu.trove.impl.hash; - -import gnu.trove.iterator.TPrimitiveIterator; - -import java.util.ConcurrentModificationException; -import java.util.NoSuchElementException; - - -/** - * Implements all iterator functions for the hashed object set. - * Subclasses may override objectAtIndex to vary the object - * returned by calls to next() (e.g. for values, and Map.Entry - * objects). - *

- *

Note that iteration is fastest if you forego the calls to - * hasNext in favor of checking the size of the structure - * yourself and then call next() that many times: - *

- *

- * Iterator i = collection.iterator();
- * for (int size = collection.size(); size-- > 0;) {
- *   Object o = i.next();
- * }
- * 
- *

- *

You may, of course, use the hasNext(), next() idiom too if - * you aren't in a performance critical spot.

- */ -public abstract class THashPrimitiveIterator implements TPrimitiveIterator { - - /** the data structure this iterator traverses */ - protected final TPrimitiveHash _hash; - /** - * the number of elements this iterator believes are in the - * data structure it accesses. - */ - protected int _expectedSize; - /** the index used for iteration. */ - protected int _index; - - - /** - * Creates a TPrimitiveIterator for the specified collection. - * - * @param hash the TPrimitiveHash we want to iterate over. - */ - public THashPrimitiveIterator( TPrimitiveHash hash ) { - _hash = hash; - _expectedSize = _hash.size(); - _index = _hash.capacity(); - } - - - /** - * Returns the index of the next value in the data structure - * or a negative value if the iterator is exhausted. - * - * @return an int value - * @throws java.util.ConcurrentModificationException - * if the underlying collection's - * size has been modified since the iterator was created. - */ - protected final int nextIndex() { - if ( _expectedSize != _hash.size() ) { - throw new ConcurrentModificationException(); - } - - byte[] states = _hash._states; - int i = _index; - while ( i-- > 0 && ( states[i] != TPrimitiveHash.FULL ) ) { - ; - } - return i; - } - - - /** - * Returns true if the iterator can be advanced past its current - * location. - * - * @return a boolean value - */ - public boolean hasNext() { - return nextIndex() >= 0; - } - - - /** - * Removes the last entry returned by the iterator. - * Invoking this method more than once for a single entry - * will leave the underlying data structure in a confused - * state. - */ - public void remove() { - if (_expectedSize != _hash.size()) { - throw new ConcurrentModificationException(); - } - - // Disable auto compaction during the remove. This is a workaround for bug 1642768. - try { - _hash.tempDisableAutoCompaction(); - _hash.removeAt(_index); - } - finally { - _hash.reenableAutoCompaction( false ); - } - - _expectedSize--; - } - - - /** - * Sets the internal index so that the `next' object - * can be returned. - */ - protected final void moveToNextIndex() { - // doing the assignment && < 0 in one line shaves - // 3 opcodes... - if ( ( _index = nextIndex() ) < 0 ) { - throw new NoSuchElementException(); - } - } - - -} // TPrimitiveIterator \ No newline at end of file diff --git a/src/gnu/trove/impl/hash/TIntFloatHash.java b/src/gnu/trove/impl/hash/TIntFloatHash.java deleted file mode 100644 index ed22965..0000000 --- a/src/gnu/trove/impl/hash/TIntFloatHash.java +++ /dev/null @@ -1,341 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.impl.hash; - -import gnu.trove.procedure.*; -import gnu.trove.impl.HashFunctions; - -import java.io.ObjectOutput; -import java.io.ObjectInput; -import java.io.IOException; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * An open addressed hashing implementation for int/float primitive entries. - * - * Created: Sun Nov 4 08:56:06 2001 - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: _K__V_Hash.template,v 1.1.2.6 2009/11/07 03:36:44 robeden Exp $ - */ -abstract public class TIntFloatHash extends TPrimitiveHash { - - /** the set of ints */ - public transient int[] _set; - - - /** - * key that represents null - * - * NOTE: should not be modified after the Hash is created, but is - * not final because of Externalization - * - */ - protected int no_entry_key; - - - /** - * value that represents null - * - * NOTE: should not be modified after the Hash is created, but is - * not final because of Externalization - * - */ - protected float no_entry_value; - - - /** - * Creates a new T#E#Hash instance with the default - * capacity and load factor. - */ - public TIntFloatHash() { - super(); - no_entry_key = ( int ) 0; - no_entry_value = ( float ) 0; - } - - - /** - * Creates a new T#E#Hash instance whose capacity - * is the next highest prime above initialCapacity + 1 - * unless that value is already prime. - * - * @param initialCapacity an int value - */ - public TIntFloatHash( int initialCapacity ) { - super( initialCapacity ); - no_entry_key = ( int ) 0; - no_entry_value = ( float ) 0; - } - - - /** - * Creates a new TIntFloatHash instance with a prime - * value at or near the specified capacity and load factor. - * - * @param initialCapacity used to find a prime capacity for the table. - * @param loadFactor used to calculate the threshold over which - * rehashing takes place. - */ - public TIntFloatHash( int initialCapacity, float loadFactor ) { - super(initialCapacity, loadFactor); - no_entry_key = ( int ) 0; - no_entry_value = ( float ) 0; - } - - - /** - * Creates a new TIntFloatHash instance with a prime - * value at or near the specified capacity and load factor. - * - * @param initialCapacity used to find a prime capacity for the table. - * @param loadFactor used to calculate the threshold over which - * rehashing takes place. - * @param no_entry_value value that represents null - */ - public TIntFloatHash( int initialCapacity, float loadFactor, - int no_entry_key, float no_entry_value ) { - super(initialCapacity, loadFactor); - this.no_entry_key = no_entry_key; - this.no_entry_value = no_entry_value; - } - - - /** - * Returns the value that is used to represent null as a key. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - public int getNoEntryKey() { - return no_entry_key; - } - - - /** - * Returns the value that is used to represent null. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - public float getNoEntryValue() { - return no_entry_value; - } - - - /** - * initializes the hashtable to a prime capacity which is at least - * initialCapacity + 1. - * - * @param initialCapacity an int value - * @return the actual capacity chosen - */ - protected int setUp( int initialCapacity ) { - int capacity; - - capacity = super.setUp( initialCapacity ); - _set = new int[capacity]; - return capacity; - } - - - /** - * Searches the set for val - * - * @param val an int value - * @return a boolean value - */ - public boolean contains( int val ) { - return index(val) >= 0; - } - - - /** - * Executes procedure for each key in the map. - * - * @param procedure a TIntProcedure value - * @return false if the loop over the set terminated because - * the procedure returned false for some value. - */ - public boolean forEach( TIntProcedure procedure ) { - byte[] states = _states; - int[] set = _set; - for ( int i = set.length; i-- > 0; ) { - if ( states[i] == FULL && ! procedure.execute( set[i] ) ) { - return false; - } - } - return true; - } - - - /** - * Releases the element currently stored at index. - * - * @param index an int value - */ - protected void removeAt( int index ) { - _set[index] = no_entry_key; - super.removeAt( index ); - } - - - /** - * Locates the index of val. - * - * @param key an int value - * @return the index of val or -1 if it isn't in the set. - */ - protected int index( int key ) { - int hash, probe, index, length; - - final byte[] states = _states; - final int[] set = _set; - length = states.length; - hash = HashFunctions.hash( key ) & 0x7fffffff; - index = hash % length; - - if ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != key ) ) { - // see Knuth, p. 529 - probe = 1 + ( hash % ( length - 2 ) ); - - do { - index -= probe; - if ( index < 0 ) { - index += length; - } - } while ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != key ) ); - } - - return states[index] == FREE ? -1 : index; - } - - - /** - * Locates the index at which val can be inserted. if - * there is already a value equal()ing val in the set, - * returns that value as a negative integer. - * - * @param key an int value - * @return an int value - */ - protected int insertionIndex( int key ) { - int hash, probe, index, length; - - final byte[] states = _states; - final int[] set = _set; - length = states.length; - hash = HashFunctions.hash( key ) & 0x7fffffff; - index = hash % length; - - if ( states[index] == FREE ) { - return index; // empty, all done - } else if ( states[index] == FULL && set[index] == key ) { - return -index -1; // already stored - } else { // already FULL or REMOVED, must probe - // compute the double hash - probe = 1 + ( hash % ( length - 2 ) ); - - // if the slot we landed on is FULL (but not removed), probe - // until we find an empty slot, a REMOVED slot, or an element - // equal to the one we are trying to insert. - // finding an empty slot means that the value is not present - // and that we should use that slot as the insertion point; - // finding a REMOVED slot means that we need to keep searching, - // however we want to remember the offset of that REMOVED slot - // so we can reuse it in case a "new" insertion (i.e. not an update) - // is possible. - // finding a matching value means that we've found that our desired - // key is already in the table - - if ( states[index] != REMOVED ) { - // starting at the natural offset, probe until we find an - // offset that isn't full. - do { - index -= probe; - if (index < 0) { - index += length; - } - } while ( states[index] == FULL && set[index] != key ); - } - - // if the index we found was removed: continue probing until we - // locate a free location or an element which equal()s the - // one we have. - if ( states[index] == REMOVED) { - int firstRemoved = index; - while ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != key ) ) { - index -= probe; - if (index < 0) { - index += length; - } - } - return states[index] == FULL ? -index -1 : firstRemoved; - } - // if it's full, the key is already stored - return states[index] == FULL ? -index -1 : index; - } - } - - - /** {@inheritDoc} */ - public void writeExternal( ObjectOutput out ) throws IOException { - // VERSION - out.writeByte( 0 ); - - // SUPER - super.writeExternal( out ); - - // NO_ENTRY_KEY - out.writeInt( no_entry_key ); - - // NO_ENTRY_VALUE - out.writeFloat( no_entry_value ); - } - - - /** {@inheritDoc} */ - public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { - // VERSION - in.readByte(); - - // SUPER - super.readExternal( in ); - - // NO_ENTRY_KEY - no_entry_key = in.readInt(); - - // NO_ENTRY_VALUE - no_entry_value = in.readFloat(); - } -} // TIntFloatHash diff --git a/src/gnu/trove/impl/hash/TIntHash.java b/src/gnu/trove/impl/hash/TIntHash.java deleted file mode 100644 index 04c8df7..0000000 --- a/src/gnu/trove/impl/hash/TIntHash.java +++ /dev/null @@ -1,293 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.impl.hash; - -import gnu.trove.procedure.TIntProcedure; -import gnu.trove.impl.HashFunctions; -import gnu.trove.impl.Constants; - -import java.util.Arrays; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * An open addressed hashing implementation for int primitives. - * - * Created: Sun Nov 4 08:56:06 2001 - * - * @author Eric D. Friedman, Rob Eden, Jeff Randall - * @version $Id: _E_Hash.template,v 1.1.2.6 2009/11/07 03:36:44 robeden Exp $ - */ -abstract public class TIntHash extends TPrimitiveHash { - - /** the set of ints */ - public transient int[] _set; - - /** - * value that represents null - * - * NOTE: should not be modified after the Hash is created, but is - * not final because of Externalization - * - */ - protected int no_entry_value; - - - /** - * Creates a new TIntHash instance with the default - * capacity and load factor. - */ - public TIntHash() { - super(); - no_entry_value = Constants.DEFAULT_INT_NO_ENTRY_VALUE; - //noinspection RedundantCast - if ( no_entry_value != ( int ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - - /** - * Creates a new TIntHash instance whose capacity - * is the next highest prime above initialCapacity + 1 - * unless that value is already prime. - * - * @param initialCapacity an int value - */ - public TIntHash( int initialCapacity ) { - super( initialCapacity ); - no_entry_value = Constants.DEFAULT_INT_NO_ENTRY_VALUE; - //noinspection RedundantCast - if ( no_entry_value != ( int ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - - /** - * Creates a new TIntHash instance with a prime - * value at or near the specified capacity and load factor. - * - * @param initialCapacity used to find a prime capacity for the table. - * @param loadFactor used to calculate the threshold over which - * rehashing takes place. - */ - public TIntHash( int initialCapacity, float loadFactor ) { - super(initialCapacity, loadFactor); - no_entry_value = Constants.DEFAULT_INT_NO_ENTRY_VALUE; - //noinspection RedundantCast - if ( no_entry_value != ( int ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - - /** - * Creates a new TIntHash instance with a prime - * value at or near the specified capacity and load factor. - * - * @param initialCapacity used to find a prime capacity for the table. - * @param loadFactor used to calculate the threshold over which - * rehashing takes place. - * @param no_entry_value value that represents null - */ - public TIntHash( int initialCapacity, float loadFactor, int no_entry_value ) { - super(initialCapacity, loadFactor); - this.no_entry_value = no_entry_value; - //noinspection RedundantCast - if ( no_entry_value != ( int ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - - /** - * Returns the value that is used to represent null. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - public int getNoEntryValue() { - return no_entry_value; - } - - - /** - * initializes the hashtable to a prime capacity which is at least - * initialCapacity + 1. - * - * @param initialCapacity an int value - * @return the actual capacity chosen - */ - protected int setUp( int initialCapacity ) { - int capacity; - - capacity = super.setUp( initialCapacity ); - _set = new int[capacity]; - return capacity; - } - - - /** - * Searches the set for val - * - * @param val an int value - * @return a boolean value - */ - public boolean contains( int val ) { - return index(val) >= 0; - } - - - /** - * Executes procedure for each element in the set. - * - * @param procedure a TObjectProcedure value - * @return false if the loop over the set terminated because - * the procedure returned false for some value. - */ - public boolean forEach( TIntProcedure procedure ) { - byte[] states = _states; - int[] set = _set; - for ( int i = set.length; i-- > 0; ) { - if ( states[i] == FULL && ! procedure.execute( set[i] ) ) { - return false; - } - } - return true; - } - - - /** - * Releases the element currently stored at index. - * - * @param index an int value - */ - protected void removeAt( int index ) { - _set[index] = no_entry_value; - super.removeAt( index ); - } - - - /** - * Locates the index of val. - * - * @param val an int value - * @return the index of val or -1 if it isn't in the set. - */ - protected int index( int val ) { - int hash, probe, index, length; - - final byte[] states = _states; - final int[] set = _set; - length = states.length; - hash = HashFunctions.hash( val ) & 0x7fffffff; - index = hash % length; - - if ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != val ) ) { - // see Knuth, p. 529 - probe = 1 + ( hash % ( length - 2 ) ); - - do { - index -= probe; - if ( index < 0 ) { - index += length; - } - } while ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != val ) ); - } - - return states[index] == FREE ? -1 : index; - } - - - /** - * Locates the index at which val can be inserted. if - * there is already a value equal()ing val in the set, - * returns that value as a negative integer. - * - * @param val an int value - * @return an int value - */ - protected int insertionIndex( int val ) { - int hash, probe, index, length; - - final byte[] states = _states; - final int[] set = _set; - length = states.length; - hash = HashFunctions.hash( val ) & 0x7fffffff; - index = hash % length; - - if ( states[index] == FREE ) { - return index; // empty, all done - } else if ( states[index] == FULL && set[index] == val ) { - return -index -1; // already stored - } else { // already FULL or REMOVED, must probe - // compute the double hash - probe = 1 + ( hash % ( length - 2 ) ); - - // if the slot we landed on is FULL (but not removed), probe - // until we find an empty slot, a REMOVED slot, or an element - // equal to the one we are trying to insert. - // finding an empty slot means that the value is not present - // and that we should use that slot as the insertion point; - // finding a REMOVED slot means that we need to keep searching, - // however we want to remember the offset of that REMOVED slot - // so we can reuse it in case a "new" insertion (i.e. not an update) - // is possible. - // finding a matching value means that we've found that our desired - // key is already in the table - - if ( states[index] != REMOVED ) { - // starting at the natural offset, probe until we find an - // offset that isn't full. - do { - index -= probe; - if (index < 0) { - index += length; - } - } while ( states[index] == FULL && set[index] != val ); - } - - // if the index we found was removed: continue probing until we - // locate a free location or an element which equal()s the - // one we have. - if ( states[index] == REMOVED) { - int firstRemoved = index; - while ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != val ) ) { - index -= probe; - if (index < 0) { - index += length; - } - } - return states[index] == FULL ? -index -1 : firstRemoved; - } - // if it's full, the key is already stored - return states[index] == FULL ? -index -1 : index; - } - } -} // TIntHash diff --git a/src/gnu/trove/impl/hash/TLongDoubleHash.java b/src/gnu/trove/impl/hash/TLongDoubleHash.java deleted file mode 100644 index b1b77a6..0000000 --- a/src/gnu/trove/impl/hash/TLongDoubleHash.java +++ /dev/null @@ -1,341 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.impl.hash; - -import gnu.trove.procedure.*; -import gnu.trove.impl.HashFunctions; - -import java.io.ObjectOutput; -import java.io.ObjectInput; -import java.io.IOException; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * An open addressed hashing implementation for long/double primitive entries. - * - * Created: Sun Nov 4 08:56:06 2001 - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: _K__V_Hash.template,v 1.1.2.6 2009/11/07 03:36:44 robeden Exp $ - */ -abstract public class TLongDoubleHash extends TPrimitiveHash { - - /** the set of longs */ - public transient long[] _set; - - - /** - * key that represents null - * - * NOTE: should not be modified after the Hash is created, but is - * not final because of Externalization - * - */ - protected long no_entry_key; - - - /** - * value that represents null - * - * NOTE: should not be modified after the Hash is created, but is - * not final because of Externalization - * - */ - protected double no_entry_value; - - - /** - * Creates a new T#E#Hash instance with the default - * capacity and load factor. - */ - public TLongDoubleHash() { - super(); - no_entry_key = ( long ) 0; - no_entry_value = ( double ) 0; - } - - - /** - * Creates a new T#E#Hash instance whose capacity - * is the next highest prime above initialCapacity + 1 - * unless that value is already prime. - * - * @param initialCapacity an int value - */ - public TLongDoubleHash( int initialCapacity ) { - super( initialCapacity ); - no_entry_key = ( long ) 0; - no_entry_value = ( double ) 0; - } - - - /** - * Creates a new TLongDoubleHash instance with a prime - * value at or near the specified capacity and load factor. - * - * @param initialCapacity used to find a prime capacity for the table. - * @param loadFactor used to calculate the threshold over which - * rehashing takes place. - */ - public TLongDoubleHash( int initialCapacity, float loadFactor ) { - super(initialCapacity, loadFactor); - no_entry_key = ( long ) 0; - no_entry_value = ( double ) 0; - } - - - /** - * Creates a new TLongDoubleHash instance with a prime - * value at or near the specified capacity and load factor. - * - * @param initialCapacity used to find a prime capacity for the table. - * @param loadFactor used to calculate the threshold over which - * rehashing takes place. - * @param no_entry_value value that represents null - */ - public TLongDoubleHash( int initialCapacity, float loadFactor, - long no_entry_key, double no_entry_value ) { - super(initialCapacity, loadFactor); - this.no_entry_key = no_entry_key; - this.no_entry_value = no_entry_value; - } - - - /** - * Returns the value that is used to represent null as a key. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - public long getNoEntryKey() { - return no_entry_key; - } - - - /** - * Returns the value that is used to represent null. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - public double getNoEntryValue() { - return no_entry_value; - } - - - /** - * initializes the hashtable to a prime capacity which is at least - * initialCapacity + 1. - * - * @param initialCapacity an int value - * @return the actual capacity chosen - */ - protected int setUp( int initialCapacity ) { - int capacity; - - capacity = super.setUp( initialCapacity ); - _set = new long[capacity]; - return capacity; - } - - - /** - * Searches the set for val - * - * @param val an long value - * @return a boolean value - */ - public boolean contains( long val ) { - return index(val) >= 0; - } - - - /** - * Executes procedure for each key in the map. - * - * @param procedure a TLongProcedure value - * @return false if the loop over the set terminated because - * the procedure returned false for some value. - */ - public boolean forEach( TLongProcedure procedure ) { - byte[] states = _states; - long[] set = _set; - for ( int i = set.length; i-- > 0; ) { - if ( states[i] == FULL && ! procedure.execute( set[i] ) ) { - return false; - } - } - return true; - } - - - /** - * Releases the element currently stored at index. - * - * @param index an int value - */ - protected void removeAt( int index ) { - _set[index] = no_entry_key; - super.removeAt( index ); - } - - - /** - * Locates the index of val. - * - * @param key an long value - * @return the index of val or -1 if it isn't in the set. - */ - protected int index( long key ) { - int hash, probe, index, length; - - final byte[] states = _states; - final long[] set = _set; - length = states.length; - hash = HashFunctions.hash( key ) & 0x7fffffff; - index = hash % length; - - if ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != key ) ) { - // see Knuth, p. 529 - probe = 1 + ( hash % ( length - 2 ) ); - - do { - index -= probe; - if ( index < 0 ) { - index += length; - } - } while ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != key ) ); - } - - return states[index] == FREE ? -1 : index; - } - - - /** - * Locates the index at which val can be inserted. if - * there is already a value equal()ing val in the set, - * returns that value as a negative integer. - * - * @param key an long value - * @return an int value - */ - protected int insertionIndex( long key ) { - int hash, probe, index, length; - - final byte[] states = _states; - final long[] set = _set; - length = states.length; - hash = HashFunctions.hash( key ) & 0x7fffffff; - index = hash % length; - - if ( states[index] == FREE ) { - return index; // empty, all done - } else if ( states[index] == FULL && set[index] == key ) { - return -index -1; // already stored - } else { // already FULL or REMOVED, must probe - // compute the double hash - probe = 1 + ( hash % ( length - 2 ) ); - - // if the slot we landed on is FULL (but not removed), probe - // until we find an empty slot, a REMOVED slot, or an element - // equal to the one we are trying to insert. - // finding an empty slot means that the value is not present - // and that we should use that slot as the insertion point; - // finding a REMOVED slot means that we need to keep searching, - // however we want to remember the offset of that REMOVED slot - // so we can reuse it in case a "new" insertion (i.e. not an update) - // is possible. - // finding a matching value means that we've found that our desired - // key is already in the table - - if ( states[index] != REMOVED ) { - // starting at the natural offset, probe until we find an - // offset that isn't full. - do { - index -= probe; - if (index < 0) { - index += length; - } - } while ( states[index] == FULL && set[index] != key ); - } - - // if the index we found was removed: continue probing until we - // locate a free location or an element which equal()s the - // one we have. - if ( states[index] == REMOVED) { - int firstRemoved = index; - while ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != key ) ) { - index -= probe; - if (index < 0) { - index += length; - } - } - return states[index] == FULL ? -index -1 : firstRemoved; - } - // if it's full, the key is already stored - return states[index] == FULL ? -index -1 : index; - } - } - - - /** {@inheritDoc} */ - public void writeExternal( ObjectOutput out ) throws IOException { - // VERSION - out.writeByte( 0 ); - - // SUPER - super.writeExternal( out ); - - // NO_ENTRY_KEY - out.writeLong( no_entry_key ); - - // NO_ENTRY_VALUE - out.writeDouble( no_entry_value ); - } - - - /** {@inheritDoc} */ - public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException { - // VERSION - in.readByte(); - - // SUPER - super.readExternal( in ); - - // NO_ENTRY_KEY - no_entry_key = in.readLong(); - - // NO_ENTRY_VALUE - no_entry_value = in.readDouble(); - } -} // TLongDoubleHash diff --git a/src/gnu/trove/impl/hash/TLongHash.java b/src/gnu/trove/impl/hash/TLongHash.java deleted file mode 100644 index ce94453..0000000 --- a/src/gnu/trove/impl/hash/TLongHash.java +++ /dev/null @@ -1,293 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.impl.hash; - -import gnu.trove.procedure.TLongProcedure; -import gnu.trove.impl.HashFunctions; -import gnu.trove.impl.Constants; - -import java.util.Arrays; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * An open addressed hashing implementation for long primitives. - * - * Created: Sun Nov 4 08:56:06 2001 - * - * @author Eric D. Friedman, Rob Eden, Jeff Randall - * @version $Id: _E_Hash.template,v 1.1.2.6 2009/11/07 03:36:44 robeden Exp $ - */ -abstract public class TLongHash extends TPrimitiveHash { - - /** the set of longs */ - public transient long[] _set; - - /** - * value that represents null - * - * NOTE: should not be modified after the Hash is created, but is - * not final because of Externalization - * - */ - protected long no_entry_value; - - - /** - * Creates a new TLongHash instance with the default - * capacity and load factor. - */ - public TLongHash() { - super(); - no_entry_value = Constants.DEFAULT_LONG_NO_ENTRY_VALUE; - //noinspection RedundantCast - if ( no_entry_value != ( long ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - - /** - * Creates a new TLongHash instance whose capacity - * is the next highest prime above initialCapacity + 1 - * unless that value is already prime. - * - * @param initialCapacity an int value - */ - public TLongHash( int initialCapacity ) { - super( initialCapacity ); - no_entry_value = Constants.DEFAULT_LONG_NO_ENTRY_VALUE; - //noinspection RedundantCast - if ( no_entry_value != ( long ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - - /** - * Creates a new TLongHash instance with a prime - * value at or near the specified capacity and load factor. - * - * @param initialCapacity used to find a prime capacity for the table. - * @param loadFactor used to calculate the threshold over which - * rehashing takes place. - */ - public TLongHash( int initialCapacity, float loadFactor ) { - super(initialCapacity, loadFactor); - no_entry_value = Constants.DEFAULT_LONG_NO_ENTRY_VALUE; - //noinspection RedundantCast - if ( no_entry_value != ( long ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - - /** - * Creates a new TLongHash instance with a prime - * value at or near the specified capacity and load factor. - * - * @param initialCapacity used to find a prime capacity for the table. - * @param loadFactor used to calculate the threshold over which - * rehashing takes place. - * @param no_entry_value value that represents null - */ - public TLongHash( int initialCapacity, float loadFactor, long no_entry_value ) { - super(initialCapacity, loadFactor); - this.no_entry_value = no_entry_value; - //noinspection RedundantCast - if ( no_entry_value != ( long ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - - /** - * Returns the value that is used to represent null. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - public long getNoEntryValue() { - return no_entry_value; - } - - - /** - * initializes the hashtable to a prime capacity which is at least - * initialCapacity + 1. - * - * @param initialCapacity an int value - * @return the actual capacity chosen - */ - protected int setUp( int initialCapacity ) { - int capacity; - - capacity = super.setUp( initialCapacity ); - _set = new long[capacity]; - return capacity; - } - - - /** - * Searches the set for val - * - * @param val an long value - * @return a boolean value - */ - public boolean contains( long val ) { - return index(val) >= 0; - } - - - /** - * Executes procedure for each element in the set. - * - * @param procedure a TObjectProcedure value - * @return false if the loop over the set terminated because - * the procedure returned false for some value. - */ - public boolean forEach( TLongProcedure procedure ) { - byte[] states = _states; - long[] set = _set; - for ( int i = set.length; i-- > 0; ) { - if ( states[i] == FULL && ! procedure.execute( set[i] ) ) { - return false; - } - } - return true; - } - - - /** - * Releases the element currently stored at index. - * - * @param index an int value - */ - protected void removeAt( int index ) { - _set[index] = no_entry_value; - super.removeAt( index ); - } - - - /** - * Locates the index of val. - * - * @param val an long value - * @return the index of val or -1 if it isn't in the set. - */ - protected int index( long val ) { - int hash, probe, index, length; - - final byte[] states = _states; - final long[] set = _set; - length = states.length; - hash = HashFunctions.hash( val ) & 0x7fffffff; - index = hash % length; - - if ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != val ) ) { - // see Knuth, p. 529 - probe = 1 + ( hash % ( length - 2 ) ); - - do { - index -= probe; - if ( index < 0 ) { - index += length; - } - } while ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != val ) ); - } - - return states[index] == FREE ? -1 : index; - } - - - /** - * Locates the index at which val can be inserted. if - * there is already a value equal()ing val in the set, - * returns that value as a negative integer. - * - * @param val an long value - * @return an int value - */ - protected int insertionIndex( long val ) { - int hash, probe, index, length; - - final byte[] states = _states; - final long[] set = _set; - length = states.length; - hash = HashFunctions.hash( val ) & 0x7fffffff; - index = hash % length; - - if ( states[index] == FREE ) { - return index; // empty, all done - } else if ( states[index] == FULL && set[index] == val ) { - return -index -1; // already stored - } else { // already FULL or REMOVED, must probe - // compute the double hash - probe = 1 + ( hash % ( length - 2 ) ); - - // if the slot we landed on is FULL (but not removed), probe - // until we find an empty slot, a REMOVED slot, or an element - // equal to the one we are trying to insert. - // finding an empty slot means that the value is not present - // and that we should use that slot as the insertion point; - // finding a REMOVED slot means that we need to keep searching, - // however we want to remember the offset of that REMOVED slot - // so we can reuse it in case a "new" insertion (i.e. not an update) - // is possible. - // finding a matching value means that we've found that our desired - // key is already in the table - - if ( states[index] != REMOVED ) { - // starting at the natural offset, probe until we find an - // offset that isn't full. - do { - index -= probe; - if (index < 0) { - index += length; - } - } while ( states[index] == FULL && set[index] != val ); - } - - // if the index we found was removed: continue probing until we - // locate a free location or an element which equal()s the - // one we have. - if ( states[index] == REMOVED) { - int firstRemoved = index; - while ( states[index] != FREE && - ( states[index] == REMOVED || set[index] != val ) ) { - index -= probe; - if (index < 0) { - index += length; - } - } - return states[index] == FULL ? -index -1 : firstRemoved; - } - // if it's full, the key is already stored - return states[index] == FULL ? -index -1 : index; - } - } -} // TLongHash diff --git a/src/gnu/trove/impl/hash/TObjectHash.java b/src/gnu/trove/impl/hash/TObjectHash.java deleted file mode 100644 index 814a0e0..0000000 --- a/src/gnu/trove/impl/hash/TObjectHash.java +++ /dev/null @@ -1,312 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.impl.hash; - -import gnu.trove.impl.HashFunctions; -import gnu.trove.procedure.TObjectProcedure; - -import java.util.Arrays; -import java.io.ObjectOutput; -import java.io.IOException; -import java.io.ObjectInput; - - - -/** - * An open addressed hashing implementation for Object types. - *

- * Created: Sun Nov 4 08:56:06 2001 - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: TObjectHash.java,v 1.1.2.6 2009/11/07 03:36:44 robeden Exp $ - */ -abstract public class TObjectHash extends THash { - - static final long serialVersionUID = -3461112548087185871L; - - - /** the set of Objects */ - public transient Object[] _set; - - public static final Object REMOVED = new Object(), FREE = new Object(); - - - /** - * Creates a new TObjectHash instance with the - * default capacity and load factor. - */ - public TObjectHash() { - super(); - } - - - /** - * Creates a new TObjectHash instance whose capacity - * is the next highest prime above initialCapacity + 1 - * unless that value is already prime. - * - * @param initialCapacity an int value - */ - public TObjectHash( int initialCapacity ) { - super( initialCapacity ); - } - - - /** - * Creates a new TObjectHash instance with a prime - * value at or near the specified capacity and load factor. - * - * @param initialCapacity used to find a prime capacity for the table. - * @param loadFactor used to calculate the threshold over which - * rehashing takes place. - */ - public TObjectHash( int initialCapacity, float loadFactor ) { - super( initialCapacity, loadFactor ); - } - - - public int capacity() { - return _set.length; - } - - - protected void removeAt( int index ) { - _set[index] = REMOVED; - super.removeAt( index ); - } - - - /** - * initializes the Object set of this hash table. - * - * @param initialCapacity an int value - * @return an int value - */ - public int setUp( int initialCapacity ) { - int capacity; - - capacity = super.setUp( initialCapacity ); - _set = new Object[capacity]; - Arrays.fill( _set, FREE ); - return capacity; - } - - - /** - * Executes procedure for each element in the set. - * - * @param procedure a TObjectProcedure value - * @return false if the loop over the set terminated because - * the procedure returned false for some value. - */ - @SuppressWarnings({"unchecked"}) - public boolean forEach( TObjectProcedure procedure ) { - Object[] set = _set; - for ( int i = set.length; i-- > 0; ) { - if ( set[i] != FREE - && set[i] != REMOVED - && !procedure.execute( (T) set[i] ) ) { - return false; - } - } - return true; - } - - - /** - * Searches the set for obj - * - * @param obj an Object value - * @return a boolean value - */ - @SuppressWarnings({"unchecked"}) - public boolean contains( Object obj ) { - return index( obj ) >= 0; - } - - - /** - * Locates the index of obj. - * - * @param obj an Object value - * @return the index of obj or -1 if it isn't in the set. - */ - protected int index( Object obj ) { - - final Object[] set = _set; - final int length = set.length; - final int hash = HashFunctions.hash( obj ) & 0x7fffffff; - int index = hash % length; - Object cur = set[index]; - - if ( cur == obj ) { - return index; - } - - if ( cur == FREE ) { - return -1; - } - - // NOTE: here it has to be REMOVED or FULL (some user-given value) - if ( cur == REMOVED || !cur.equals( obj ) ) { - // see Knuth, p. 529 - final int probe = 1 + ( hash % ( length - 2 ) ); - - do { - index -= probe; - if ( index < 0 ) { - index += length; - } - cur = set[index]; - } while ( cur != FREE - && ( cur == REMOVED || !cur.equals( obj ) ) ); - } - - return cur == FREE ? -1 : index; - } - - - /** - * Locates the index at which obj can be inserted. if - * there is already a value equal()ing obj in the set, - * returns that value's index as -index - 1. - * - * @param obj an Object value - * @return the index of a FREE slot at which obj can be inserted - * or, if obj is already stored in the hash, the negative value of - * that index, minus 1: -index -1. - */ - protected int insertionIndex( T obj ) { - - final Object[] set = _set; - final int length = set.length; - final int hash = HashFunctions.hash( obj ) & 0x7fffffff; - int index = hash % length; - Object cur = set[index]; - - if ( cur == FREE ) { - return index; // empty, all done - } else if ( cur == obj || ( cur != REMOVED && cur.equals( obj ) ) ) { - return -index - 1; // already stored - } else { // already FULL or REMOVED, must probe - // compute the double hash - final int probe = 1 + ( hash % ( length - 2 ) ); - - // if the slot we landed on is FULL (but not removed), probe - // until we find an empty slot, a REMOVED slot, or an element - // equal to the one we are trying to insert. - // finding an empty slot means that the value is not present - // and that we should use that slot as the insertion point; - // finding a REMOVED slot means that we need to keep searching, - // however we want to remember the offset of that REMOVED slot - // so we can reuse it in case a "new" insertion (i.e. not an update) - // is possible. - // finding a matching value means that we've found that our desired - // key is already in the table - if ( cur != REMOVED ) { - // starting at the natural offset, probe until we find an - // offset that isn't full. - do { - index -= probe; - if ( index < 0 ) { - index += length; - } - cur = set[index]; - } while ( cur != FREE - && cur != REMOVED - && cur != obj - && !cur.equals( obj ) ); - } - - // if the index we found was removed: continue probing until we - // locate a free location or an element which equal()s the - // one we have. - if ( cur == REMOVED ) { - int firstRemoved = index; - while ( cur != FREE - && ( cur == REMOVED || cur != obj || !cur.equals( obj ) ) ) { - index -= probe; - if ( index < 0 ) { - index += length; - } - cur = set[index]; - } - // NOTE: cur cannot == REMOVED in this block - return ( cur != FREE ) ? -index - 1 : firstRemoved; - } - // if it's full, the key is already stored - // NOTE: cur cannot equal REMOVE here (would have retuned already (see above) - return ( cur != FREE ) ? -index - 1 : index; - } - } - - - /** - * Convenience methods for subclasses to use in throwing exceptions about - * badly behaved user objects employed as keys. We have to throw an - * IllegalArgumentException with a rather verbose message telling the - * user that they need to fix their object implementation to conform - * to the general contract for java.lang.Object. - * - * @param o1 the first of the equal elements with unequal hash codes. - * @param o2 the second of the equal elements with unequal hash codes. - * @throws IllegalArgumentException the whole point of this method. - */ - protected final void throwObjectContractViolation( Object o1, Object o2 ) - throws IllegalArgumentException { - throw new IllegalArgumentException( "Equal objects must have equal hashcodes. " - + "During rehashing, Trove discovered that " - + "the following two objects claim to be " - + "equal (as in java.lang.Object.equals()) " - + "but their hashCodes (or those calculated by " - + "your TObjectHashingStrategy) are not equal." - + "This violates the general contract of " - + "java.lang.Object.hashCode(). See bullet point two " - + "in that method's documentation. " - + "object #1 =" + o1 - + "; object #2 =" + o2 ); - } - - - @Override - public void writeExternal( ObjectOutput out ) throws IOException { - - // VERSION - out.writeByte( 0 ); - - // SUPER - super.writeExternal( out ); - } - - - @Override - public void readExternal( ObjectInput in ) - throws IOException, ClassNotFoundException { - - // VERSION - in.readByte(); - - // SUPER - super.readExternal( in ); - } -} // TObjectHash diff --git a/src/gnu/trove/impl/hash/TPrimitiveHash.java b/src/gnu/trove/impl/hash/TPrimitiveHash.java deleted file mode 100644 index d76fb3e..0000000 --- a/src/gnu/trove/impl/hash/TPrimitiveHash.java +++ /dev/null @@ -1,135 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.impl.hash; - -import gnu.trove.impl.HashFunctions; - - - -/** - * The base class for hashtables of primitive values. Since there is - * no notion of object equality for primitives, it isn't possible to - * use a `REMOVED' object to track deletions in an open-addressed table. - * So, we have to resort to using a parallel `bookkeeping' array of bytes, - * in which flags can be set to indicate that a particular slot in the - * hash table is FREE, FULL, or REMOVED. - * - * @author Eric D. Friedman, Rob Eden, Jeff Randall - * @version $Id: TPrimitiveHash.java,v 1.1.2.6 2010/03/01 23:39:07 robeden Exp $ - */ -abstract public class TPrimitiveHash extends THash { - - /** - * flags indicating whether each position in the hash is - * FREE, FULL, or REMOVED - */ - public transient byte[] _states; - - /* constants used for state flags */ - - /** flag indicating that a slot in the hashtable is available */ - public static final byte FREE = 0; - - /** flag indicating that a slot in the hashtable is occupied */ - public static final byte FULL = 1; - - /** - * flag indicating that the value of a slot in the hashtable - * was deleted - */ - public static final byte REMOVED = 2; - - - /** - * Creates a new THash instance with the default - * capacity and load factor. - */ - public TPrimitiveHash() { - super(); - } - - - /** - * Creates a new TPrimitiveHash instance with a prime - * capacity at or near the specified capacity and with the default - * load factor. - * - * @param initialCapacity an int value - */ - public TPrimitiveHash( int initialCapacity ) { - this( initialCapacity, DEFAULT_LOAD_FACTOR ); - } - - - /** - * Creates a new TPrimitiveHash instance with a prime - * capacity at or near the minimum needed to hold - * initialCapacity elements with load factor - * loadFactor without triggering a rehash. - * - * @param initialCapacity an int value - * @param loadFactor a float value - */ - public TPrimitiveHash( int initialCapacity, float loadFactor ) { - super(); - initialCapacity = Math.max( 1, initialCapacity ); - _loadFactor = loadFactor; - setUp( HashFunctions.fastCeil( initialCapacity / loadFactor ) ); - } - - - /** - * Returns the capacity of the hash table. This is the true - * physical capacity, without adjusting for the load factor. - * - * @return the physical capacity of the hash table. - */ - public int capacity() { - return _states.length; - } - - - /** - * Delete the record at index. - * - * @param index an int value - */ - protected void removeAt( int index ) { - _states[index] = REMOVED; - super.removeAt( index ); - } - - - /** - * initializes the hashtable to a prime capacity which is at least - * initialCapacity + 1. - * - * @param initialCapacity an int value - * @return the actual capacity chosen - */ - protected int setUp( int initialCapacity ) { - int capacity; - - capacity = super.setUp( initialCapacity ); - _states = new byte[capacity]; - return capacity; - } -} // TPrimitiveHash \ No newline at end of file diff --git a/src/gnu/trove/impl/package.html b/src/gnu/trove/impl/package.html deleted file mode 100644 index c803363..0000000 --- a/src/gnu/trove/impl/package.html +++ /dev/null @@ -1,24 +0,0 @@ - - -This package (and its sub-packages) contain internal implementations used in Trove. These -classes should not be accessed directly (treat them like com.sun -classes. - \ No newline at end of file diff --git a/src/gnu/trove/iterator/TAdvancingIterator.java b/src/gnu/trove/iterator/TAdvancingIterator.java deleted file mode 100644 index 86db71d..0000000 --- a/src/gnu/trove/iterator/TAdvancingIterator.java +++ /dev/null @@ -1,31 +0,0 @@ -// //////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// //////////////////////////////////////////////////////////////////////////// -package gnu.trove.iterator; - -/** - * Common interface for iterators that operate via the "advance" method for moving the - * cursor to the next element. - */ -public interface TAdvancingIterator extends TIterator { - /** - * Moves the iterator forward to the next entry. - * - * @throws java.util.NoSuchElementException if the iterator is already exhausted - */ - public void advance(); -} diff --git a/src/gnu/trove/iterator/TDoubleIterator.java b/src/gnu/trove/iterator/TDoubleIterator.java deleted file mode 100644 index 9c079f5..0000000 --- a/src/gnu/trove/iterator/TDoubleIterator.java +++ /dev/null @@ -1,38 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.iterator; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Iterator for double collections. - */ -public interface TDoubleIterator extends TIterator { - /** - * Advances the iterator to the next element in the underlying collection - * and returns it. - * - * @return the next double in the collection - * @exception NoSuchElementException if the iterator is already exhausted - */ - public double next(); -} diff --git a/src/gnu/trove/iterator/TFloatIterator.java b/src/gnu/trove/iterator/TFloatIterator.java deleted file mode 100644 index 79acefc..0000000 --- a/src/gnu/trove/iterator/TFloatIterator.java +++ /dev/null @@ -1,38 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.iterator; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Iterator for float collections. - */ -public interface TFloatIterator extends TIterator { - /** - * Advances the iterator to the next element in the underlying collection - * and returns it. - * - * @return the next float in the collection - * @exception NoSuchElementException if the iterator is already exhausted - */ - public float next(); -} diff --git a/src/gnu/trove/iterator/TIntFloatIterator.java b/src/gnu/trove/iterator/TIntFloatIterator.java deleted file mode 100644 index a28e498..0000000 --- a/src/gnu/trove/iterator/TIntFloatIterator.java +++ /dev/null @@ -1,115 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.iterator; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Iterator for maps of type int and float. - * - *

The iterator semantics for Trove's primitive maps is slightly different - * from those defined in java.util.Iterator, but still well within - * the scope of the pattern, as defined by Gamma, et al.

- * - *

This iterator does not implicitly advance to the next entry when - * the value at the current position is retrieved. Rather, you must explicitly - * ask the iterator to advance() and then retrieve either the key(), - * the value() or both. This is done so that you have the option, but not - * the obligation, to retrieve keys and/or values as your application requires, and - * without introducing wrapper objects that would carry both. As the iteration is - * stateful, access to the key/value parts of the current map entry happens in - * constant time.

- * - *

In practice, the iterator is akin to a "search finger" that you move from - * position to position. Read or write operations affect the current entry only and - * do not assume responsibility for moving the finger.

- * - *

Here are some sample scenarios for this class of iterator:

- * - *
- * // accessing keys/values through an iterator:
- * for ( TIntFloatIterator it = map.iterator(); it.hasNext(); ) {
- *   it.advance();
- *   if ( satisfiesCondition( it.key() ) {
- *     doSomethingWithValue( it.value() );
- *   }
- * }
- * 
- * - *
- * // modifying values in-place through iteration:
- * for ( TIntFloatIterator it = map.iterator(); it.hasNext(); ) {
- *   it.advance();
- *   if ( satisfiesCondition( it.key() ) {
- *     it.setValue( newValueForKey( it.key() ) );
- *   }
- * }
- * 
- * - *
- * // deleting entries during iteration:
- * for ( TIntFloatIterator it = map.iterator(); it.hasNext(); ) {
- *   it.advance();
- *   if ( satisfiesCondition( it.key() ) {
- *     it.remove();
- *   }
- * }
- * 
- * - *
- * // faster iteration by avoiding hasNext():
- * TIntFloatIterator iterator = map.iterator();
- * for ( int i = map.size(); i-- > 0; ) {
- *   iterator.advance();
- *   doSomethingWithKeyAndValue( iterator.key(), iterator.value() );
- * }
- * 
- */ -public interface TIntFloatIterator extends TAdvancingIterator { - /** - * Provides access to the key of the mapping at the iterator's position. - * Note that you must advance() the iterator at least once - * before invoking this method. - * - * @return the key of the entry at the iterator's current position. - */ - public int key(); - - /** - * Provides access to the value of the mapping at the iterator's position. - * Note that you must advance() the iterator at least once - * before invoking this method. - * - * @return the value of the entry at the iterator's current position. - */ - public float value(); - - /** - * Replace the value of the mapping at the iterator's position with the - * specified value. Note that you must advance() the iterator at - * least once before invoking this method. - * - * @param val the value to set in the current entry - * @return the old value of the entry. - */ - public float setValue( float val ); -} diff --git a/src/gnu/trove/iterator/TIntIterator.java b/src/gnu/trove/iterator/TIntIterator.java deleted file mode 100644 index 3e1fdd2..0000000 --- a/src/gnu/trove/iterator/TIntIterator.java +++ /dev/null @@ -1,38 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.iterator; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Iterator for int collections. - */ -public interface TIntIterator extends TIterator { - /** - * Advances the iterator to the next element in the underlying collection - * and returns it. - * - * @return the next int in the collection - * @exception NoSuchElementException if the iterator is already exhausted - */ - public int next(); -} diff --git a/src/gnu/trove/iterator/TIterator.java b/src/gnu/trove/iterator/TIterator.java deleted file mode 100644 index efdf22e..0000000 --- a/src/gnu/trove/iterator/TIterator.java +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// -package gnu.trove.iterator; - -/** - * Common interface for all iterators used in Trove. - */ -public interface TIterator { - /** - * Returns true if the iterator can be advanced past its current location. - * - * @return a boolean value - */ - public boolean hasNext(); - - /** - * Removes the last entry returned by the iterator. The result of invoking this method - * more than once for a single entry is undefined and can leave the underlying data - * structure in a confused state. - */ - public void remove(); -} diff --git a/src/gnu/trove/iterator/TLongDoubleIterator.java b/src/gnu/trove/iterator/TLongDoubleIterator.java deleted file mode 100644 index 2d3487a..0000000 --- a/src/gnu/trove/iterator/TLongDoubleIterator.java +++ /dev/null @@ -1,115 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.iterator; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Iterator for maps of type long and double. - * - *

The iterator semantics for Trove's primitive maps is slightly different - * from those defined in java.util.Iterator, but still well within - * the scope of the pattern, as defined by Gamma, et al.

- * - *

This iterator does not implicitly advance to the next entry when - * the value at the current position is retrieved. Rather, you must explicitly - * ask the iterator to advance() and then retrieve either the key(), - * the value() or both. This is done so that you have the option, but not - * the obligation, to retrieve keys and/or values as your application requires, and - * without introducing wrapper objects that would carry both. As the iteration is - * stateful, access to the key/value parts of the current map entry happens in - * constant time.

- * - *

In practice, the iterator is akin to a "search finger" that you move from - * position to position. Read or write operations affect the current entry only and - * do not assume responsibility for moving the finger.

- * - *

Here are some sample scenarios for this class of iterator:

- * - *
- * // accessing keys/values through an iterator:
- * for ( TLongDoubleIterator it = map.iterator(); it.hasNext(); ) {
- *   it.advance();
- *   if ( satisfiesCondition( it.key() ) {
- *     doSomethingWithValue( it.value() );
- *   }
- * }
- * 
- * - *
- * // modifying values in-place through iteration:
- * for ( TLongDoubleIterator it = map.iterator(); it.hasNext(); ) {
- *   it.advance();
- *   if ( satisfiesCondition( it.key() ) {
- *     it.setValue( newValueForKey( it.key() ) );
- *   }
- * }
- * 
- * - *
- * // deleting entries during iteration:
- * for ( TLongDoubleIterator it = map.iterator(); it.hasNext(); ) {
- *   it.advance();
- *   if ( satisfiesCondition( it.key() ) {
- *     it.remove();
- *   }
- * }
- * 
- * - *
- * // faster iteration by avoiding hasNext():
- * TLongDoubleIterator iterator = map.iterator();
- * for ( int i = map.size(); i-- > 0; ) {
- *   iterator.advance();
- *   doSomethingWithKeyAndValue( iterator.key(), iterator.value() );
- * }
- * 
- */ -public interface TLongDoubleIterator extends TAdvancingIterator { - /** - * Provides access to the key of the mapping at the iterator's position. - * Note that you must advance() the iterator at least once - * before invoking this method. - * - * @return the key of the entry at the iterator's current position. - */ - public long key(); - - /** - * Provides access to the value of the mapping at the iterator's position. - * Note that you must advance() the iterator at least once - * before invoking this method. - * - * @return the value of the entry at the iterator's current position. - */ - public double value(); - - /** - * Replace the value of the mapping at the iterator's position with the - * specified value. Note that you must advance() the iterator at - * least once before invoking this method. - * - * @param val the value to set in the current entry - * @return the old value of the entry. - */ - public double setValue( double val ); -} diff --git a/src/gnu/trove/iterator/TLongIterator.java b/src/gnu/trove/iterator/TLongIterator.java deleted file mode 100644 index 2798501..0000000 --- a/src/gnu/trove/iterator/TLongIterator.java +++ /dev/null @@ -1,38 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.iterator; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Iterator for long collections. - */ -public interface TLongIterator extends TIterator { - /** - * Advances the iterator to the next element in the underlying collection - * and returns it. - * - * @return the next long in the collection - * @exception NoSuchElementException if the iterator is already exhausted - */ - public long next(); -} diff --git a/src/gnu/trove/iterator/TPrimitiveIterator.java b/src/gnu/trove/iterator/TPrimitiveIterator.java deleted file mode 100644 index 5693c3a..0000000 --- a/src/gnu/trove/iterator/TPrimitiveIterator.java +++ /dev/null @@ -1,61 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.iterator; - -/** - * Implements all iterator functions for the hashed object set. - * Subclasses may override objectAtIndex to vary the object - * returned by calls to next() (e.g. for values, and Map.Entry - * objects). - *

- *

Note that iteration is fastest if you forego the calls to - * hasNext in favor of checking the size of the structure - * yourself and then call next() that many times: - *

- *

- * Iterator i = collection.iterator();
- * for (int size = collection.size(); size-- > 0;) {
- *   Object o = i.next();
- * }
- * 
- *

- *

You may, of course, use the hasNext(), next() idiom too if - * you aren't in a performance critical spot.

- */ -public interface TPrimitiveIterator extends TIterator { - /** - * Returns true if the iterator can be advanced past its current - * location. - * - * @return a boolean value - */ - public boolean hasNext(); - - - /** - * Removes the last entry returned by the iterator. - * Invoking this method more than once for a single entry - * will leave the underlying data structure in a confused - * state. - */ - public void remove(); - -} // TPrimitiveIterator diff --git a/src/gnu/trove/iterator/TShortIterator.java b/src/gnu/trove/iterator/TShortIterator.java deleted file mode 100644 index 63724c2..0000000 --- a/src/gnu/trove/iterator/TShortIterator.java +++ /dev/null @@ -1,38 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.iterator; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Iterator for short collections. - */ -public interface TShortIterator extends TIterator { - /** - * Advances the iterator to the next element in the underlying collection - * and returns it. - * - * @return the next short in the collection - * @exception NoSuchElementException if the iterator is already exhausted - */ - public short next(); -} diff --git a/src/gnu/trove/iterator/hash/TObjectHashIterator.java b/src/gnu/trove/iterator/hash/TObjectHashIterator.java deleted file mode 100644 index 3f47c55..0000000 --- a/src/gnu/trove/iterator/hash/TObjectHashIterator.java +++ /dev/null @@ -1,57 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - - -package gnu.trove.iterator.hash; - -import gnu.trove.impl.hash.TObjectHash; -import gnu.trove.impl.hash.THashIterator; - - -/** - * Iterator for hashtables that use open addressing to resolve collisions. - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: TObjectHashIterator.java,v 1.1.2.4 2009/10/09 01:44:34 robeden Exp $ - */ - -public class TObjectHashIterator extends THashIterator { - - protected final TObjectHash _objectHash; - - - public TObjectHashIterator( TObjectHash hash ) { - super( hash ); - _objectHash = hash; - } - - - @SuppressWarnings("unchecked") - protected E objectAtIndex( int index ) { - Object obj = _objectHash._set[index]; - if ( obj == TObjectHash.FREE || obj == TObjectHash.REMOVED ) { - return null; - } - return (E) obj; - } - -} // TObjectHashIterator diff --git a/src/gnu/trove/map/TIntFloatMap.java b/src/gnu/trove/map/TIntFloatMap.java deleted file mode 100644 index c856c14..0000000 --- a/src/gnu/trove/map/TIntFloatMap.java +++ /dev/null @@ -1,303 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.map; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - -import gnu.trove.function.*; -import gnu.trove.iterator.*; -import gnu.trove.procedure.*; -import gnu.trove.set.*; -import gnu.trove.TFloatCollection; - -import java.util.Map; -import java.io.Serializable; - - -/** - * Interface for a primitive map of int keys and float values. - */ -public interface TIntFloatMap extends Serializable { - - /** - * Returns the value that will be returned from {@link #get} or {@link #put} if no - * entry exists for a given key. The default value is generally zero, but can be - * changed during construction of the collection. - * - * @return the value that represents a null key in this collection. - */ - public int getNoEntryKey(); - - - /** - * Returns the value that will be returned from {@link #get} or {@link #put} if no - * entry exists for a given key. The default value is generally zero, but can be - * changed during construction of the collection. - * - * @return the value that represents a null value in this collection. - */ - public float getNoEntryValue(); - - - /** - * Inserts a key/value pair into the map. - * - * @param key an int value - * @param value an float value - * - * @return the previous value associated with key, or the "no entry" value - * if none was found (see {@link #getNoEntryValue}). - */ - public float put( int key, float value ); - - - /** - * Inserts a key/value pair into the map if the specified key is not already - * associated with a value. - * - * @param key an int value - * @param value an float value - * - * @return the previous value associated with key, or the "no entry" value - * if none was found (see {@link #getNoEntryValue}). - */ - public float putIfAbsent( int key, float value ); - - - /** - * Put all the entries from the given Map into this map. - * - * @param map The Map from which entries will be obtained to put into this map. - */ - public void putAll( Map map ); - - - /** - * Put all the entries from the given map into this map. - * - * @param map The map from which entries will be obtained to put into this map. - */ - public void putAll( TIntFloatMap map ); - - - /** - * Retrieves the value for key - * - * @param key an int value - * - * @return the previous value associated with key, or the "no entry" value - * if none was found (see {@link #getNoEntryValue}). - */ - public float get( int key ); - - - /** - * Empties the map. - */ - public void clear(); - - - /** - * Returns true if this map contains no key-value mappings. - * - * @return true if this map contains no key-value mappings - */ - public boolean isEmpty(); - - - /** - * Deletes a key/value pair from the map. - * - * @param key an int value - * - * @return the previous value associated with key, or the "no entry" value - * if none was found (see {@link #getNoEntryValue}). - */ - public float remove( int key ); - - - /** - * Returns an int value that is the number of elements in the map. - * - * @return an int value that is the number of elements in the map. - */ - public int size(); - - - /** - * Returns the keys of the map as a TIntSet - * - * @return the keys of the map as a TIntSet - */ - public TIntSet keySet(); - - - /** - * Returns the keys of the map as an array of int values. - * - * @return the keys of the map as an array of int values. - */ - public int[] keys(); - - - /** - * Returns the keys of the map. - * - * @param array the array into which the elements of the list are to be stored, - * if it is big enough; otherwise, a new array of the same type is - * allocated for this purpose. - * @return the keys of the map as an array. - */ - public int[] keys( int[] array ); - - - /** - * Returns the values of the map as a TFloatCollection - * - * @return the values of the map as a TFloatCollection - */ - public TFloatCollection valueCollection(); - - - /** - * Returns the values of the map as an array of #e# values. - * - * @return the values of the map as an array of #e# values. - */ - public float[] values(); - - - /** - * Returns the values of the map using an existing array. - * - * @param array the array into which the elements of the list are to be stored, - * if it is big enough; otherwise, a new array of the same type is - * allocated for this purpose. - * @return the values of the map as an array of #e# values. - */ - public float[] values( float[] array ); - - - /** - * Checks for the presence of val in the values of the map. - * - * @param val an float value - * @return a boolean value - */ - public boolean containsValue( float val ); - - - /** - * Checks for the present of key in the keys of the map. - * - * @param key an int value - * @return a boolean value - */ - public boolean containsKey( int key ); - - - /** - * @return a TIntFloatIterator with access to this map's keys and values - */ - public TIntFloatIterator iterator(); - - - /** - * Executes procedure for each key in the map. - * - * @param procedure a TIntProcedure value - * @return false if the loop over the keys terminated because - * the procedure returned false for some key. - */ - public boolean forEachKey( TIntProcedure procedure ); - - - /** - * Executes procedure for each value in the map. - * - * @param procedure a T#F#Procedure value - * @return false if the loop over the values terminated because - * the procedure returned false for some value. - */ - public boolean forEachValue( TFloatProcedure procedure ); - - - /** - * Executes procedure for each key/value entry in the - * map. - * - * @param procedure a TOIntFloatProcedure value - * @return false if the loop over the entries terminated because - * the procedure returned false for some entry. - */ - public boolean forEachEntry( TIntFloatProcedure procedure ); - - - /** - * Transform the values in this map using function. - * - * @param function a TFloatFunction value - */ - public void transformValues( TFloatFunction function ); - - - /** - * Retains only those entries in the map for which the procedure - * returns a true value. - * - * @param procedure determines which entries to keep - * @return true if the map was modified. - */ - public boolean retainEntries( TIntFloatProcedure procedure ); - - - /** - * Increments the primitive value mapped to key by 1 - * - * @param key the key of the value to increment - * @return true if a mapping was found and modified. - */ - public boolean increment( int key ); - - - /** - * Adjusts the primitive value mapped to key. - * - * @param key the key of the value to increment - * @param amount the amount to adjust the value by. - * @return true if a mapping was found and modified. - */ - public boolean adjustValue( int key, float amount ); - - - /** - * Adjusts the primitive value mapped to the key if the key is present in the map. - * Otherwise, the initial_value is put in the map. - * - * @param key the key of the value to increment - * @param adjust_amount the amount to adjust the value by - * @param put_amount the value put into the map if the key is not initial present - * - * @return the value present in the map after the adjustment or put operation - */ - public float adjustOrPutValue( int key, float adjust_amount, float put_amount ); -} diff --git a/src/gnu/trove/map/TLongDoubleMap.java b/src/gnu/trove/map/TLongDoubleMap.java deleted file mode 100644 index db4760a..0000000 --- a/src/gnu/trove/map/TLongDoubleMap.java +++ /dev/null @@ -1,303 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.map; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - -import gnu.trove.function.*; -import gnu.trove.iterator.*; -import gnu.trove.procedure.*; -import gnu.trove.set.*; -import gnu.trove.TDoubleCollection; - -import java.util.Map; -import java.io.Serializable; - - -/** - * Interface for a primitive map of long keys and double values. - */ -public interface TLongDoubleMap extends Serializable { - - /** - * Returns the value that will be returned from {@link #get} or {@link #put} if no - * entry exists for a given key. The default value is generally zero, but can be - * changed during construction of the collection. - * - * @return the value that represents a null key in this collection. - */ - public long getNoEntryKey(); - - - /** - * Returns the value that will be returned from {@link #get} or {@link #put} if no - * entry exists for a given key. The default value is generally zero, but can be - * changed during construction of the collection. - * - * @return the value that represents a null value in this collection. - */ - public double getNoEntryValue(); - - - /** - * Inserts a key/value pair into the map. - * - * @param key an long value - * @param value an double value - * - * @return the previous value associated with key, or the "no entry" value - * if none was found (see {@link #getNoEntryValue}). - */ - public double put( long key, double value ); - - - /** - * Inserts a key/value pair into the map if the specified key is not already - * associated with a value. - * - * @param key an long value - * @param value an double value - * - * @return the previous value associated with key, or the "no entry" value - * if none was found (see {@link #getNoEntryValue}). - */ - public double putIfAbsent( long key, double value ); - - - /** - * Put all the entries from the given Map into this map. - * - * @param map The Map from which entries will be obtained to put into this map. - */ - public void putAll( Map map ); - - - /** - * Put all the entries from the given map into this map. - * - * @param map The map from which entries will be obtained to put into this map. - */ - public void putAll( TLongDoubleMap map ); - - - /** - * Retrieves the value for key - * - * @param key an long value - * - * @return the previous value associated with key, or the "no entry" value - * if none was found (see {@link #getNoEntryValue}). - */ - public double get( long key ); - - - /** - * Empties the map. - */ - public void clear(); - - - /** - * Returns true if this map contains no key-value mappings. - * - * @return true if this map contains no key-value mappings - */ - public boolean isEmpty(); - - - /** - * Deletes a key/value pair from the map. - * - * @param key an long value - * - * @return the previous value associated with key, or the "no entry" value - * if none was found (see {@link #getNoEntryValue}). - */ - public double remove( long key ); - - - /** - * Returns an int value that is the number of elements in the map. - * - * @return an int value that is the number of elements in the map. - */ - public int size(); - - - /** - * Returns the keys of the map as a TLongSet - * - * @return the keys of the map as a TLongSet - */ - public TLongSet keySet(); - - - /** - * Returns the keys of the map as an array of long values. - * - * @return the keys of the map as an array of long values. - */ - public long[] keys(); - - - /** - * Returns the keys of the map. - * - * @param array the array into which the elements of the list are to be stored, - * if it is big enough; otherwise, a new array of the same type is - * allocated for this purpose. - * @return the keys of the map as an array. - */ - public long[] keys( long[] array ); - - - /** - * Returns the values of the map as a TDoubleCollection - * - * @return the values of the map as a TDoubleCollection - */ - public TDoubleCollection valueCollection(); - - - /** - * Returns the values of the map as an array of #e# values. - * - * @return the values of the map as an array of #e# values. - */ - public double[] values(); - - - /** - * Returns the values of the map using an existing array. - * - * @param array the array into which the elements of the list are to be stored, - * if it is big enough; otherwise, a new array of the same type is - * allocated for this purpose. - * @return the values of the map as an array of #e# values. - */ - public double[] values( double[] array ); - - - /** - * Checks for the presence of val in the values of the map. - * - * @param val an double value - * @return a boolean value - */ - public boolean containsValue( double val ); - - - /** - * Checks for the present of key in the keys of the map. - * - * @param key an long value - * @return a boolean value - */ - public boolean containsKey( long key ); - - - /** - * @return a TLongDoubleIterator with access to this map's keys and values - */ - public TLongDoubleIterator iterator(); - - - /** - * Executes procedure for each key in the map. - * - * @param procedure a TLongProcedure value - * @return false if the loop over the keys terminated because - * the procedure returned false for some key. - */ - public boolean forEachKey( TLongProcedure procedure ); - - - /** - * Executes procedure for each value in the map. - * - * @param procedure a T#F#Procedure value - * @return false if the loop over the values terminated because - * the procedure returned false for some value. - */ - public boolean forEachValue( TDoubleProcedure procedure ); - - - /** - * Executes procedure for each key/value entry in the - * map. - * - * @param procedure a TOLongDoubleProcedure value - * @return false if the loop over the entries terminated because - * the procedure returned false for some entry. - */ - public boolean forEachEntry( TLongDoubleProcedure procedure ); - - - /** - * Transform the values in this map using function. - * - * @param function a TDoubleFunction value - */ - public void transformValues( TDoubleFunction function ); - - - /** - * Retains only those entries in the map for which the procedure - * returns a true value. - * - * @param procedure determines which entries to keep - * @return true if the map was modified. - */ - public boolean retainEntries( TLongDoubleProcedure procedure ); - - - /** - * Increments the primitive value mapped to key by 1 - * - * @param key the key of the value to increment - * @return true if a mapping was found and modified. - */ - public boolean increment( long key ); - - - /** - * Adjusts the primitive value mapped to key. - * - * @param key the key of the value to increment - * @param amount the amount to adjust the value by. - * @return true if a mapping was found and modified. - */ - public boolean adjustValue( long key, double amount ); - - - /** - * Adjusts the primitive value mapped to the key if the key is present in the map. - * Otherwise, the initial_value is put in the map. - * - * @param key the key of the value to increment - * @param adjust_amount the amount to adjust the value by - * @param put_amount the value put into the map if the key is not initial present - * - * @return the value present in the map after the adjustment or put operation - */ - public double adjustOrPutValue( long key, double adjust_amount, double put_amount ); -} diff --git a/src/gnu/trove/map/hash/THashMap.java b/src/gnu/trove/map/hash/THashMap.java deleted file mode 100644 index 3400eff..0000000 --- a/src/gnu/trove/map/hash/THashMap.java +++ /dev/null @@ -1,898 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.map.hash; - -import gnu.trove.impl.hash.TObjectHash; -import gnu.trove.impl.HashFunctions; -import gnu.trove.procedure.TObjectProcedure; -import gnu.trove.procedure.TObjectObjectProcedure; -import gnu.trove.function.TObjectFunction; -import gnu.trove.iterator.hash.TObjectHashIterator; - -import java.io.*; -import java.util.*; - - - -/** - * An implementation of the Map interface which uses an open addressed - * hash table to store its contents. - *

- * Created: Sun Nov 4 08:52:45 2001 - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: THashMap.java,v 1.1.2.8 2010/03/02 04:09:50 robeden Exp $ - */ - -public class THashMap extends TObjectHash implements Map, Externalizable { - - static final long serialVersionUID = 1L; - - /** the values of the map */ - protected transient V[] _values; - - - /** - * Creates a new THashMap instance with the default - * capacity and load factor. - */ - public THashMap() { - super(); - } - - - /** - * Creates a new THashMap instance with a prime - * capacity equal to or greater than initialCapacity and - * with the default load factor. - * - * @param initialCapacity an int value - */ - public THashMap( int initialCapacity ) { - super( initialCapacity ); - } - - - /** - * Creates a new THashMap instance with a prime - * capacity equal to or greater than initialCapacity and - * with the specified load factor. - * - * @param initialCapacity an int value - * @param loadFactor a float value - */ - public THashMap( int initialCapacity, float loadFactor ) { - super( initialCapacity, loadFactor ); - } - - - /** - * Creates a new THashMap instance which contains the - * key/value pairs in map. - * - * @param map a Map value - */ - public THashMap( Map map ) { - this( map.size() ); - putAll( map ); - } - - - /** - * Creates a new THashMap instance which contains the - * key/value pairs in map. - * - * @param map a Map value - */ - public THashMap( THashMap map ) { - this( map.size() ); - putAll( map ); - } - - - /** - * initialize the value array of the map. - * - * @param initialCapacity an int value - * @return an int value - */ - public int setUp( int initialCapacity ) { - int capacity; - - capacity = super.setUp( initialCapacity ); - //noinspection unchecked - _values = (V[]) new Object[capacity]; - return capacity; - } - - - /** - * Inserts a key/value pair into the map. - * - * @param key an Object value - * @param value an Object value - * @return the previous value associated with key, - * or {@code null} if none was found. - */ - public V put( K key, V value ) { - int index = insertionIndex( key ); - return doPut( key, value, index ); - } - - - /** - * Inserts a key/value pair into the map if the specified key is not already - * associated with a value. - * - * @param key an Object value - * @param value an Object value - * @return the previous value associated with key, - * or {@code null} if none was found. - */ - public V putIfAbsent( K key, V value ) { - int index = insertionIndex( key ); - if ( index < 0 ) { - return _values[-index - 1]; - } - return doPut( key, value, index ); - } - - - private V doPut( K key, V value, int index ) { - V previous = null; - Object oldKey; - boolean isNewMapping = true; - if ( index < 0 ) { - index = -index - 1; - previous = _values[index]; - isNewMapping = false; - } - oldKey = _set[index]; - _set[index] = key; - _values[index] = value; - if ( isNewMapping ) { - postInsertHook( oldKey == FREE ); - } - - return previous; - } - - - /** - * Compares this map with another map for equality of their stored - * entries. - * - * @param other an Object value - * @return a boolean value - */ - @SuppressWarnings({"unchecked", "SimplifiableIfStatement"}) - public boolean equals( Object other ) { - if ( !( other instanceof Map ) ) { - return false; - } - Map that = (Map) other; - if ( that.size() != this.size() ) { - return false; - } - return forEachEntry( new EqProcedure( that ) ); - } - - - public int hashCode() { - HashProcedure p = new HashProcedure(); - forEachEntry( p ); - return p.getHashCode(); - } - - - public String toString() { - final StringBuilder buf = new StringBuilder( "{" ); - forEachEntry( new TObjectObjectProcedure() { - private boolean first = true; - - - public boolean execute( K key, V value ) { - if ( first ) { - first = false; - } else { - buf.append( ", " ); - } - - buf.append( key ); - buf.append( "=" ); - buf.append( value ); - return true; - } - } ); - buf.append( "}" ); - return buf.toString(); - } - - - private final class HashProcedure implements TObjectObjectProcedure { - - private int h = 0; - - - public int getHashCode() { - return h; - } - - - public final boolean execute( K key, V value ) { - h += HashFunctions.hash( key ) ^ ( value == null ? 0 : value.hashCode() ); - return true; - } - } - - private static final class EqProcedure implements TObjectObjectProcedure { - - private final Map _otherMap; - - - EqProcedure( Map otherMap ) { - _otherMap = otherMap; - } - - - public final boolean execute( K key, V value ) { - // Check to make sure the key is there. This avoids problems that come up with - // null values. Since it is only caused in that cause, only do this when the - // value is null (to avoid extra work). - if ( value == null && !_otherMap.containsKey( key ) ) { - return false; - } - - V oValue = _otherMap.get( key ); - return oValue == value || ( oValue != null && oValue.equals( value ) ); - } - } - - - /** - * Executes procedure for each key in the map. - * - * @param procedure a TObjectProcedure value - * @return false if the loop over the keys terminated because - * the procedure returned false for some key. - */ - public boolean forEachKey( TObjectProcedure procedure ) { - return forEach( procedure ); - } - - - /** - * Executes procedure for each value in the map. - * - * @param procedure a TObjectProcedure value - * @return false if the loop over the values terminated because - * the procedure returned false for some value. - */ - public boolean forEachValue( TObjectProcedure procedure ) { - V[] values = _values; - Object[] set = _set; - for ( int i = values.length; i-- > 0; ) { - if ( set[i] != FREE - && set[i] != REMOVED - && !procedure.execute( values[i] ) ) { - return false; - } - } - return true; - } - - - /** - * Executes procedure for each key/value entry in the - * map. - * - * @param procedure a TObjectObjectProcedure value - * @return false if the loop over the entries terminated because - * the procedure returned false for some entry. - */ - @SuppressWarnings({"unchecked"}) - public boolean forEachEntry( TObjectObjectProcedure procedure ) { - Object[] keys = _set; - V[] values = _values; - for ( int i = keys.length; i-- > 0; ) { - if ( keys[i] != FREE - && keys[i] != REMOVED - && !procedure.execute( (K) keys[i], values[i] ) ) { - return false; - } - } - return true; - } - - - /** - * Retains only those entries in the map for which the procedure - * returns a true value. - * - * @param procedure determines which entries to keep - * @return true if the map was modified. - */ - @SuppressWarnings({"unchecked"}) - public boolean retainEntries( TObjectObjectProcedure procedure ) { - boolean modified = false; - Object[] keys = _set; - V[] values = _values; - - // Temporarily disable compaction. This is a fix for bug #1738760 - tempDisableAutoCompaction(); - try { - for ( int i = keys.length; i-- > 0; ) { - if ( keys[i] != FREE - && keys[i] != REMOVED - && !procedure.execute( (K) keys[i], values[i] ) ) { - removeAt( i ); - modified = true; - } - } - } - finally { - reenableAutoCompaction( true ); - } - - return modified; - } - - - /** - * Transform the values in this map using function. - * - * @param function a TObjectFunction value - */ - public void transformValues( TObjectFunction function ) { - V[] values = _values; - Object[] set = _set; - for ( int i = values.length; i-- > 0; ) { - if ( set[i] != FREE && set[i] != REMOVED ) { - values[i] = function.execute( values[i] ); - } - } - } - - - /** - * rehashes the map to the new capacity. - * - * @param newCapacity an int value - */ - @SuppressWarnings({"unchecked"}) - protected void rehash( int newCapacity ) { - int oldCapacity = _set.length; - - Object oldKeys[] = _set; - V oldVals[] = _values; - - _set = new Object[ newCapacity ]; - Arrays.fill( _set, FREE ); - _values = ( V[] ) new Object[ newCapacity ]; - - // Process entries from the old array, skipping free and removed slots. Put the - // values into the appropriate place in the new array. - for ( int i = oldCapacity; i-- > 0; ) { - if ( oldKeys[ i ] == FREE || oldKeys[ i ] == REMOVED ) continue; - - Object o = oldKeys[ i ]; - int index = insertionIndex( ( K ) o ); - if ( index < 0 ) { - throwObjectContractViolation( _set[ ( -index - 1 ) ], o ); - } - _set[ index ] = o; - _values[ index ] = oldVals[ i ]; - } - } - - - /** - * retrieves the value for key - * - * @param key an Object value - * @return the value of key or null if no such mapping exists. - */ - @SuppressWarnings({"unchecked"}) - public V get( Object key ) { - int index = index( key ); - if ( index < 0 || ! _set[index].equals( key ) ) { - return null; - } - return _values[index]; - } - - - /** Empties the map. */ - public void clear() { - if ( size() == 0 ) { - return; // optimization - } - - super.clear(); - - Arrays.fill( _set, 0, _set.length, FREE ); - Arrays.fill( _values, 0, _values.length, null ); - } - - - /** - * Deletes a key/value pair from the map. - * - * @param key an Object value - * @return an Object value - */ - @SuppressWarnings({"unchecked"}) - public V remove( Object key ) { - V prev = null; - int index = index( key ); - if ( index >= 0 ) { - prev = _values[index]; - removeAt( index ); // clear key,state; adjust size - } - return prev; - } - - - /** - * removes the mapping at index from the map. - * - * @param index an int value - */ - public void removeAt( int index ) { - _values[index] = null; - super.removeAt( index ); // clear key, state; adjust size - } - - - /** - * Returns a view on the values of the map. - * - * @return a Collection value - */ - public Collection values() { - return new ValueView(); - } - - - /** - * returns a Set view on the keys of the map. - * - * @return a Set value - */ - public Set keySet() { - return new KeyView(); - } - - - /** - * Returns a Set view on the entries of the map. - * - * @return a Set value - */ - public Set> entrySet() { - return new EntryView(); - } - - - /** - * checks for the presence of val in the values of the map. - * - * @param val an Object value - * @return a boolean value - */ - public boolean containsValue( Object val ) { - Object[] set = _set; - V[] vals = _values; - - // special case null values so that we don't have to - // perform null checks before every call to equals() - if ( null == val ) { - for ( int i = vals.length; i-- > 0; ) { - if ( ( set[i] != FREE && set[i] != REMOVED ) && - val == vals[i] ) { - return true; - } - } - } else { - for ( int i = vals.length; i-- > 0; ) { - if ( ( set[i] != FREE && set[i] != REMOVED ) && - ( val == vals[i] || val.equals( vals[i] ) ) ) { - return true; - } - } - } // end of else - return false; - } - - - /** - * checks for the present of key in the keys of the map. - * - * @param key an Object value - * @return a boolean value - */ - public boolean containsKey( Object key ) { - return contains( key ); - } - - - /** - * copies the key/value mappings in map into this map. - * - * @param map a Map value - */ - public void putAll( Map map ) { - ensureCapacity( map.size() ); - // could optimize this for cases when map instanceof THashMap - for ( Map.Entry e : map.entrySet() ) { - put( e.getKey(), e.getValue() ); - } - } - - - /** a view onto the values of the map. */ - protected class ValueView extends MapBackedView { - - @SuppressWarnings({"unchecked"}) - public Iterator iterator() { - return new TObjectHashIterator( THashMap.this ) { - protected V objectAtIndex( int index ) { - return _values[index]; - } - }; - } - - - public boolean containsElement( V value ) { - return containsValue( value ); - } - - - public boolean removeElement( V value ) { - Object[] values = _values; - Object[] set = _set; - - for ( int i = values.length; i-- > 0; ) { - if ( ( set[i] != FREE && set[i] != REMOVED ) && - value == values[i] || - ( null != values[i] && values[i].equals( value ) ) ) { - - removeAt( i ); - return true; - } - } - - return false; - } - } - - /** a view onto the entries of the map. */ - protected class EntryView extends MapBackedView> { - - private final class EntryIterator extends TObjectHashIterator { - - EntryIterator( THashMap map ) { - super( map ); - } - - - @SuppressWarnings({"unchecked"}) - public Entry objectAtIndex( final int index ) { - return new Entry( (K) _set[index], _values[index], index ); - } - } - - - @SuppressWarnings({"unchecked"}) - public Iterator> iterator() { - return new EntryIterator( THashMap.this ); - } - - - public boolean removeElement( Map.Entry entry ) { - // have to effectively reimplement Map.remove here - // because we need to return true/false depending on - // whether the removal took place. Since the Entry's - // value can be null, this means that we can't rely - // on the value of the object returned by Map.remove() - // to determine whether a deletion actually happened. - // - // Note also that the deletion is only legal if - // both the key and the value match. - Object val; - int index; - - K key = keyForEntry( entry ); - index = index( key ); - if ( index >= 0 ) { - val = valueForEntry( entry ); - if ( val == _values[index] || - ( null != val && val.equals( _values[index] ) ) ) { - removeAt( index ); // clear key,state; adjust size - return true; - } - } - return false; - } - - - public boolean containsElement( Map.Entry entry ) { - Object val = get( keyForEntry( entry ) ); - Object entryValue = entry.getValue(); - return entryValue == val || - ( null != val && val.equals( entryValue ) ); - } - - - protected V valueForEntry( Map.Entry entry ) { - return entry.getValue(); - } - - - protected K keyForEntry( Map.Entry entry ) { - return entry.getKey(); - } - } - - private abstract class MapBackedView extends AbstractSet - implements Set, Iterable { - - public abstract Iterator iterator(); - - - public abstract boolean removeElement( E key ); - - - public abstract boolean containsElement( E key ); - - - @SuppressWarnings({"unchecked"}) - public boolean contains( Object key ) { - return containsElement( (E) key ); - } - - - @SuppressWarnings({"unchecked"}) - public boolean remove( Object o ) { - return removeElement( (E) o ); - } - - -// public boolean containsAll( Collection collection ) { -// for ( Object element : collection ) { -// if ( !contains( element ) ) { -// return false; -// } -// } -// return true; -// } - - - public void clear() { - THashMap.this.clear(); - } - - - public boolean add( E obj ) { - throw new UnsupportedOperationException(); - } - - - public int size() { - return THashMap.this.size(); - } - - - public Object[] toArray() { - Object[] result = new Object[size()]; - Iterator e = iterator(); - for ( int i = 0; e.hasNext(); i++ ) { - result[i] = e.next(); - } - return result; - } - - - @SuppressWarnings({"unchecked"}) - public T[] toArray( T[] a ) { - int size = size(); - if ( a.length < size ) { - a = (T[]) java.lang.reflect.Array.newInstance( a.getClass().getComponentType(), size ); - } - - Iterator it = iterator(); - Object[] result = a; - for ( int i = 0; i < size; i++ ) { - result[i] = it.next(); - } - - if ( a.length > size ) { - a[size] = null; - } - - return a; - } - - - public boolean isEmpty() { - return THashMap.this.isEmpty(); - } - - - public boolean addAll( Collection collection ) { - throw new UnsupportedOperationException(); - } - - - @SuppressWarnings({"SuspiciousMethodCalls"}) - public boolean retainAll( Collection collection ) { - boolean changed = false; - Iterator i = iterator(); - while ( i.hasNext() ) { - if ( !collection.contains( i.next() ) ) { - i.remove(); - changed = true; - } - } - return changed; - } - - public String toString() { - Iterator i = iterator(); - if ( !i.hasNext() ) return "{}"; - - StringBuilder sb = new StringBuilder(); - sb.append( '{' ); - for (; ; ) { - E e = i.next(); - sb.append( e == this ? "(this Collection)" : e ); - if ( !i.hasNext() ) return sb.append( '}' ).toString(); - sb.append( ", " ); - } - } - } - - /** a view onto the keys of the map. */ - protected class KeyView extends MapBackedView { - - @SuppressWarnings({"unchecked"}) - public Iterator iterator() { - return new TObjectHashIterator( THashMap.this ); - } - - - public boolean removeElement( K key ) { - return null != THashMap.this.remove( key ); - } - - - public boolean containsElement( K key ) { - return THashMap.this.contains( key ); - } - } - - final class Entry implements Map.Entry { - - private K key; - private V val; - private final int index; - - - Entry( final K key, V value, final int index ) { - this.key = key; - this.val = value; - this.index = index; - } - - - public K getKey() { - return key; - } - - - public V getValue() { - return val; - } - - - public V setValue( V o ) { - if ( _values[index] != val ) { - throw new ConcurrentModificationException(); - } - // need to return previous value - V retval = val; - // update this entry's value, in case setValue is called again - _values[index] = o; - val = o; - return retval; - } - - - public boolean equals( Object o ) { - if ( o instanceof Map.Entry ) { - Map.Entry e1 = this; - Map.Entry e2 = (Map.Entry) o; - return ( e1.getKey() == null ? e2.getKey() == null : e1.getKey().equals( e2.getKey() ) ) - && ( e1.getValue() == null ? e2.getValue() == null : e1.getValue().equals( e2.getValue() ) ); - } - return false; - } - - - public int hashCode() { - return ( getKey() == null ? 0 : getKey().hashCode() ) ^ ( getValue() == null ? 0 : getValue().hashCode() ); - } - - - @Override - public String toString() { - return key + "=" + val; - } - } - - - public void writeExternal( ObjectOutput out ) throws IOException { - // VERSION - out.writeByte( 1 ); - - // NOTE: Super was not written in version 0 - super.writeExternal( out ); - - // NUMBER OF ENTRIES - out.writeInt( _size ); - - // ENTRIES - for ( int i = _set.length; i-- > 0; ) { - if ( _set[i] != REMOVED && _set[i] != FREE ) { - out.writeObject( _set[i] ); - out.writeObject( _values[i] ); - } - } - } - - - public void readExternal( ObjectInput in ) - throws IOException, ClassNotFoundException { - - // VERSION - byte version = in.readByte(); - - // NOTE: super was not written in version 0 - if ( version != 0 ) { - super.readExternal( in ); - } - - // NUMBER OF ENTRIES - int size = in.readInt(); - setUp( size ); - - // ENTRIES - while ( size-- > 0 ) { - //noinspection unchecked - K key = (K) in.readObject(); - //noinspection unchecked - V val = (V) in.readObject(); - put( key, val ); - } - } -} // THashMap diff --git a/src/gnu/trove/map/hash/TIntFloatHashMap.java b/src/gnu/trove/map/hash/TIntFloatHashMap.java deleted file mode 100644 index becddc1..0000000 --- a/src/gnu/trove/map/hash/TIntFloatHashMap.java +++ /dev/null @@ -1,1294 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.map.hash; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - -import gnu.trove.map.TIntFloatMap; -import gnu.trove.function.TFloatFunction; -import gnu.trove.procedure.*; -import gnu.trove.set.*; -import gnu.trove.iterator.*; -import gnu.trove.iterator.hash.*; -import gnu.trove.impl.hash.*; -import gnu.trove.impl.HashFunctions; -import gnu.trove.*; - -import java.io.*; -import java.util.*; - -/** - * An open addressed Map implementation for int keys and float values. - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: _K__V_HashMap.template,v 1.1.2.16 2010/03/02 04:09:50 robeden Exp $ - */ -public class TIntFloatHashMap extends TIntFloatHash implements TIntFloatMap, Externalizable { - static final long serialVersionUID = 1L; - - /** the values of the map */ - protected transient float[] _values; - - - /** - * Creates a new TIntFloatHashMap instance with the default - * capacity and load factor. - */ - public TIntFloatHashMap() { - super(); - } - - - /** - * Creates a new TIntFloatHashMap instance with a prime - * capacity equal to or greater than initialCapacity and - * with the default load factor. - * - * @param initialCapacity an int value - */ - public TIntFloatHashMap( int initialCapacity ) { - super( initialCapacity ); - } - - - /** - * Creates a new TIntFloatHashMap instance with a prime - * capacity equal to or greater than initialCapacity and - * with the specified load factor. - * - * @param initialCapacity an int value - * @param loadFactor a float value - */ - public TIntFloatHashMap( int initialCapacity, float loadFactor ) { - super( initialCapacity, loadFactor ); - } - - - /** - * Creates a new TIntFloatHashMap instance with a prime - * capacity equal to or greater than initialCapacity and - * with the specified load factor. - * - * @param initialCapacity an int value - * @param loadFactor a float value - * @param noEntryKey a int value that represents - * null for the Key set. - * @param noEntryValue a float value that represents - * null for the Value set. - */ - public TIntFloatHashMap( int initialCapacity, float loadFactor, - int noEntryKey, float noEntryValue ) { - super( initialCapacity, loadFactor, noEntryKey, noEntryValue ); - } - - - /** - * Creates a new TIntFloatHashMap instance containing - * all of the entries in the map passed in. - * - * @param keys a int array containing the keys for the matching values. - * @param values a float array containing the values. - */ - public TIntFloatHashMap( int[] keys, float[] values ) { - super( Math.max( keys.length, values.length ) ); - - int size = Math.min( keys.length, values.length ); - for ( int i = 0; i < size; i++ ) { - this.put( keys[i], values[i] ); - } - } - - - /** - * Creates a new TIntFloatHashMap instance containing - * all of the entries in the map passed in. - * - * @param map a TIntFloatMap that will be duplicated. - */ - public TIntFloatHashMap( TIntFloatMap map ) { - super( map.size() ); - if ( map instanceof TIntFloatHashMap ) { - TIntFloatHashMap hashmap = ( TIntFloatHashMap ) map; - this._loadFactor = hashmap._loadFactor; - this.no_entry_key = hashmap.no_entry_key; - this.no_entry_value = hashmap.no_entry_value; - //noinspection RedundantCast - if ( this.no_entry_key != ( int ) 0 ) { - Arrays.fill( _set, this.no_entry_key ); - } - //noinspection RedundantCast - if ( this.no_entry_value != ( float ) 0 ) { - Arrays.fill( _values, this.no_entry_value ); - } - setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) ); - } - putAll( map ); - } - - - /** - * initializes the hashtable to a prime capacity which is at least - * initialCapacity + 1. - * - * @param initialCapacity an int value - * @return the actual capacity chosen - */ - protected int setUp( int initialCapacity ) { - int capacity; - - capacity = super.setUp( initialCapacity ); - _values = new float[capacity]; - return capacity; - } - - - /** - * rehashes the map to the new capacity. - * - * @param newCapacity an int value - */ - /** {@inheritDoc} */ - protected void rehash( int newCapacity ) { - int oldCapacity = _set.length; - - int oldKeys[] = _set; - float oldVals[] = _values; - byte oldStates[] = _states; - - _set = new int[newCapacity]; - _values = new float[newCapacity]; - _states = new byte[newCapacity]; - - for ( int i = oldCapacity; i-- > 0; ) { - if( oldStates[i] == FULL ) { - int o = oldKeys[i]; - int index = insertionIndex( o ); - _set[index] = o; - _values[index] = oldVals[i]; - _states[index] = FULL; - } - } - } - - - /** {@inheritDoc} */ - public float put( int key, float value ) { - int index = insertionIndex( key ); - return doPut( key, value, index ); - } - - - /** {@inheritDoc} */ - public float putIfAbsent( int key, float value ) { - int index = insertionIndex( key ); - if (index < 0) - return _values[-index - 1]; - return doPut( key, value, index ); - } - - - private float doPut( int key, float value, int index ) { - byte previousState; - float previous = no_entry_value; - boolean isNewMapping = true; - if ( index < 0 ) { - index = -index -1; - previous = _values[index]; - isNewMapping = false; - } - previousState = _states[index]; - _set[index] = key; - _states[index] = FULL; - _values[index] = value; - if (isNewMapping) { - postInsertHook( previousState == FREE ); - } - - return previous; - } - - - /** {@inheritDoc} */ - public void putAll( Map map ) { - ensureCapacity( map.size() ); - // could optimize this for cases when map instanceof THashMap - for ( Map.Entry entry : map.entrySet() ) { - this.put( entry.getKey().intValue(), entry.getValue().floatValue() ); - } - } - - - /** {@inheritDoc} */ - public void putAll( TIntFloatMap map ) { - ensureCapacity( map.size() ); - TIntFloatIterator iter = map.iterator(); - while ( iter.hasNext() ) { - iter.advance(); - this.put( iter.key(), iter.value() ); - } - } - - - /** {@inheritDoc} */ - public float get( int key ) { - int index = index( key ); - return index < 0 ? no_entry_value : _values[index]; - } - - - /** {@inheritDoc} */ - public void clear() { - super.clear(); - Arrays.fill( _set, 0, _set.length, no_entry_key ); - Arrays.fill( _values, 0, _values.length, no_entry_value ); - Arrays.fill( _states, 0, _states.length, FREE ); - } - - - /** {@inheritDoc} */ - public boolean isEmpty() { - return 0 == _size; - } - - - /** {@inheritDoc} */ - public float remove( int key ) { - float prev = no_entry_value; - int index = index( key ); - if ( index >= 0 ) { - prev = _values[index]; - removeAt( index ); // clear key,state; adjust size - } - return prev; - } - - - /** {@inheritDoc} */ - protected void removeAt( int index ) { - _values[index] = no_entry_value; - super.removeAt( index ); // clear key, state; adjust size - } - - - /** {@inheritDoc} */ - public TIntSet keySet() { - return new TKeyView(); - } - - - /** {@inheritDoc} */ - public int[] keys() { - int[] keys = new int[size()]; - int[] k = _set; - byte[] states = _states; - - for ( int i = k.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - keys[j++] = k[i]; - } - } - return keys; - } - - - /** {@inheritDoc} */ - public int[] keys( int[] array ) { - int size = size(); - if ( array.length < size ) { - array = new int[size]; - } - - int[] keys = _set; - byte[] states = _states; - - for ( int i = keys.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - array[j++] = keys[i]; - } - } - return array; - } - - - /** {@inheritDoc} */ - public TFloatCollection valueCollection() { - return new TValueView(); - } - - - /** {@inheritDoc} */ - public float[] values() { - float[] vals = new float[size()]; - float[] v = _values; - byte[] states = _states; - - for ( int i = v.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - vals[j++] = v[i]; - } - } - return vals; - } - - - /** {@inheritDoc} */ - public float[] values( float[] array ) { - int size = size(); - if ( array.length < size ) { - array = new float[size]; - } - - float[] v = _values; - byte[] states = _states; - - for ( int i = v.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - array[j++] = v[i]; - } - } - return array; - } - - - /** {@inheritDoc} */ - public boolean containsValue( float val ) { - byte[] states = _states; - float[] vals = _values; - - for ( int i = vals.length; i-- > 0; ) { - if ( states[i] == FULL && val == vals[i] ) { - return true; - } - } - return false; - } - - - /** {@inheritDoc} */ - public boolean containsKey( int key ) { - return contains( key ); - } - - - /** {@inheritDoc} */ - public TIntFloatIterator iterator() { - return new TIntFloatHashIterator( this ); - } - - - /** {@inheritDoc} */ - public boolean forEachKey( TIntProcedure procedure ) { - return forEach( procedure ); - } - - - /** {@inheritDoc} */ - public boolean forEachValue( TFloatProcedure procedure ) { - byte[] states = _states; - float[] values = _values; - for ( int i = values.length; i-- > 0; ) { - if ( states[i] == FULL && ! procedure.execute( values[i] ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean forEachEntry( TIntFloatProcedure procedure ) { - byte[] states = _states; - int[] keys = _set; - float[] values = _values; - for ( int i = keys.length; i-- > 0; ) { - if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public void transformValues( TFloatFunction function ) { - byte[] states = _states; - float[] values = _values; - for ( int i = values.length; i-- > 0; ) { - if ( states[i] == FULL ) { - values[i] = function.execute( values[i] ); - } - } - } - - - /** {@inheritDoc} */ - public boolean retainEntries( TIntFloatProcedure procedure ) { - boolean modified = false; - byte[] states = _states; - int[] keys = _set; - float[] values = _values; - - - // Temporarily disable compaction. This is a fix for bug #1738760 - tempDisableAutoCompaction(); - try { - for ( int i = keys.length; i-- > 0; ) { - if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) { - removeAt( i ); - modified = true; - } - } - } - finally { - reenableAutoCompaction( true ); - } - - return modified; - } - - - /** {@inheritDoc} */ - public boolean increment( int key ) { - return adjustValue( key, ( float ) 1 ); - } - - - /** {@inheritDoc} */ - public boolean adjustValue( int key, float amount ) { - int index = index( key ); - if (index < 0) { - return false; - } else { - _values[index] += amount; - return true; - } - } - - - /** {@inheritDoc} */ - public float adjustOrPutValue( int key, float adjust_amount, float put_amount ) { - int index = insertionIndex( key ); - final boolean isNewMapping; - final float newValue; - if ( index < 0 ) { - index = -index -1; - newValue = ( _values[index] += adjust_amount ); - isNewMapping = false; - } else { - newValue = ( _values[index] = put_amount ); - isNewMapping = true; - } - - byte previousState = _states[index]; - _set[index] = key; - _states[index] = FULL; - - if ( isNewMapping ) { - postInsertHook(previousState == FREE); - } - - return newValue; - } - - - /** a view onto the keys of the map. */ - protected class TKeyView implements TIntSet { - - /** {@inheritDoc} */ - public TIntIterator iterator() { - return new TIntFloatKeyHashIterator( TIntFloatHashMap.this ); - } - - - /** {@inheritDoc} */ - public int getNoEntryValue() { - return no_entry_key; - } - - - /** {@inheritDoc} */ - public int size() { - return _size; - } - - - /** {@inheritDoc} */ - public boolean isEmpty() { - return 0 == _size; - } - - - /** {@inheritDoc} */ - public boolean contains( int entry ) { - return TIntFloatHashMap.this.contains( entry ); - } - - - /** {@inheritDoc} */ - public int[] toArray() { - return TIntFloatHashMap.this.keys(); - } - - - /** {@inheritDoc} */ - public int[] toArray( int[] dest ) { - return TIntFloatHashMap.this.keys( dest ); - } - - - /** - * Unsupported when operating upon a Key Set view of a TIntFloatMap - *

- * {@inheritDoc} - */ - public boolean add( int entry ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - public boolean remove( int entry ) { - return no_entry_value != TIntFloatHashMap.this.remove( entry ); - } - - - /** {@inheritDoc} */ - public boolean containsAll( Collection collection ) { - for ( Object element : collection ) { - if ( element instanceof Integer ) { - int ele = ( ( Integer ) element ).intValue(); - if ( ! TIntFloatHashMap.this.containsKey( ele ) ) { - return false; - } - } else { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( TIntCollection collection ) { - TIntIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - if ( ! TIntFloatHashMap.this.containsKey( iter.next() ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( int[] array ) { - for ( int element : array ) { - if ( ! TIntFloatHashMap.this.contains( element ) ) { - return false; - } - } - return true; - } - - - /** - * Unsupported when operating upon a Key Set view of a TIntFloatMap - *

- * {@inheritDoc} - */ - public boolean addAll( Collection collection ) { - throw new UnsupportedOperationException(); - } - - - /** - * Unsupported when operating upon a Key Set view of a TIntFloatMap - *

- * {@inheritDoc} - */ - public boolean addAll( TIntCollection collection ) { - throw new UnsupportedOperationException(); - } - - - /** - * Unsupported when operating upon a Key Set view of a TIntFloatMap - *

- * {@inheritDoc} - */ - public boolean addAll( int[] array ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - @SuppressWarnings({"SuspiciousMethodCalls"}) - public boolean retainAll( Collection collection ) { - boolean modified = false; - TIntIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( Integer.valueOf ( iter.next() ) ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( TIntCollection collection ) { - if ( this == collection ) { - return false; - } - boolean modified = false; - TIntIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( iter.next() ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( int[] array ) { - boolean changed = false; - Arrays.sort( array ); - int[] set = _set; - byte[] states = _states; - - for ( int i = set.length; i-- > 0; ) { - if ( states[i] == FULL && ( Arrays.binarySearch( array, set[i] ) < 0) ) { - removeAt( i ); - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( Collection collection ) { - boolean changed = false; - for ( Object element : collection ) { - if ( element instanceof Integer ) { - int c = ( ( Integer ) element ).intValue(); - if ( remove( c ) ) { - changed = true; - } - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( TIntCollection collection ) { - if ( this == collection ) { - clear(); - return true; - } - boolean changed = false; - TIntIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - int element = iter.next(); - if ( remove( element ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( int[] array ) { - boolean changed = false; - for ( int i = array.length; i-- > 0; ) { - if ( remove( array[i] ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public void clear() { - TIntFloatHashMap.this.clear(); - } - - - /** {@inheritDoc} */ - public boolean forEach( TIntProcedure procedure ) { - return TIntFloatHashMap.this.forEachKey( procedure ); - } - - - @Override - public boolean equals( Object other ) { - if (! (other instanceof TIntSet)) { - return false; - } - final TIntSet that = ( TIntSet ) other; - if ( that.size() != this.size() ) { - return false; - } - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - if ( ! that.contains( _set[i] ) ) { - return false; - } - } - } - return true; - } - - - @Override - public int hashCode() { - int hashcode = 0; - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - hashcode += HashFunctions.hash( _set[i] ); - } - } - return hashcode; - } - - - @Override - public String toString() { - final StringBuilder buf = new StringBuilder( "{" ); - forEachKey( new TIntProcedure() { - private boolean first = true; - - - public boolean execute( int key ) { - if ( first ) { - first = false; - } else { - buf.append( ", " ); - } - - buf.append( key ); - return true; - } - } ); - buf.append( "}" ); - return buf.toString(); - } - } - - - /** a view onto the values of the map. */ - protected class TValueView implements TFloatCollection { - - /** {@inheritDoc} */ - public TFloatIterator iterator() { - return new TIntFloatValueHashIterator( TIntFloatHashMap.this ); - } - - - /** {@inheritDoc} */ - public float getNoEntryValue() { - return no_entry_value; - } - - - /** {@inheritDoc} */ - public int size() { - return _size; - } - - - /** {@inheritDoc} */ - public boolean isEmpty() { - return 0 == _size; - } - - - /** {@inheritDoc} */ - public boolean contains( float entry ) { - return TIntFloatHashMap.this.containsValue( entry ); - } - - - /** {@inheritDoc} */ - public float[] toArray() { - return TIntFloatHashMap.this.values(); - } - - - /** {@inheritDoc} */ - public float[] toArray( float[] dest ) { - return TIntFloatHashMap.this.values( dest ); - } - - - - public boolean add( float entry ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - public boolean remove( float entry ) { - float[] values = _values; - int[] set = _set; - - for ( int i = values.length; i-- > 0; ) { - if ( ( set[i] != FREE && set[i] != REMOVED ) && entry == values[i] ) { - removeAt( i ); - return true; - } - } - return false; - } - - - /** {@inheritDoc} */ - public boolean containsAll( Collection collection ) { - for ( Object element : collection ) { - if ( element instanceof Float ) { - float ele = ( ( Float ) element ).floatValue(); - if ( ! TIntFloatHashMap.this.containsValue( ele ) ) { - return false; - } - } else { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( TFloatCollection collection ) { - TFloatIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - if ( ! TIntFloatHashMap.this.containsValue( iter.next() ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( float[] array ) { - for ( float element : array ) { - if ( ! TIntFloatHashMap.this.containsValue( element ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean addAll( Collection collection ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - public boolean addAll( TFloatCollection collection ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - public boolean addAll( float[] array ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - @SuppressWarnings({"SuspiciousMethodCalls"}) - public boolean retainAll( Collection collection ) { - boolean modified = false; - TFloatIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( Float.valueOf ( iter.next() ) ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( TFloatCollection collection ) { - if ( this == collection ) { - return false; - } - boolean modified = false; - TFloatIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( iter.next() ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( float[] array ) { - boolean changed = false; - Arrays.sort( array ); - float[] values = _values; - byte[] states = _states; - - for ( int i = values.length; i-- > 0; ) { - if ( states[i] == FULL && ( Arrays.binarySearch( array, values[i] ) < 0) ) { - removeAt( i ); - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( Collection collection ) { - boolean changed = false; - for ( Object element : collection ) { - if ( element instanceof Float ) { - float c = ( ( Float ) element ).floatValue(); - if ( remove( c ) ) { - changed = true; - } - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( TFloatCollection collection ) { - if ( this == collection ) { - clear(); - return true; - } - boolean changed = false; - TFloatIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - float element = iter.next(); - if ( remove( element ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( float[] array ) { - boolean changed = false; - for ( int i = array.length; i-- > 0; ) { - if ( remove( array[i] ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public void clear() { - TIntFloatHashMap.this.clear(); - } - - - /** {@inheritDoc} */ - public boolean forEach( TFloatProcedure procedure ) { - return TIntFloatHashMap.this.forEachValue( procedure ); - } - - - /** {@inheritDoc} */ - @Override - public String toString() { - final StringBuilder buf = new StringBuilder( "{" ); - forEachValue( new TFloatProcedure() { - private boolean first = true; - - public boolean execute( float value ) { - if ( first ) { - first = false; - } else { - buf.append( ", " ); - } - - buf.append( value ); - return true; - } - } ); - buf.append( "}" ); - return buf.toString(); - } - } - - - class TIntFloatKeyHashIterator extends THashPrimitiveIterator implements TIntIterator { - - /** - * Creates an iterator over the specified map - * - * @param hash the TPrimitiveHash we will be iterating over. - */ - TIntFloatKeyHashIterator( TPrimitiveHash hash ) { - super( hash ); - } - - /** {@inheritDoc} */ - public int next() { - moveToNextIndex(); - return _set[_index]; - } - - /** @{inheritDoc} */ - public void remove() { - if ( _expectedSize != _hash.size() ) { - throw new ConcurrentModificationException(); - } - - // Disable auto compaction during the remove. This is a workaround for bug 1642768. - try { - _hash.tempDisableAutoCompaction(); - TIntFloatHashMap.this.removeAt( _index ); - } - finally { - _hash.reenableAutoCompaction( false ); - } - - _expectedSize--; - } - } - - - - class TIntFloatValueHashIterator extends THashPrimitiveIterator implements TFloatIterator { - - /** - * Creates an iterator over the specified map - * - * @param hash the TPrimitiveHash we will be iterating over. - */ - TIntFloatValueHashIterator( TPrimitiveHash hash ) { - super( hash ); - } - - /** {@inheritDoc} */ - public float next() { - moveToNextIndex(); - return _values[_index]; - } - - /** @{inheritDoc} */ - public void remove() { - if ( _expectedSize != _hash.size() ) { - throw new ConcurrentModificationException(); - } - - // Disable auto compaction during the remove. This is a workaround for bug 1642768. - try { - _hash.tempDisableAutoCompaction(); - TIntFloatHashMap.this.removeAt( _index ); - } - finally { - _hash.reenableAutoCompaction( false ); - } - - _expectedSize--; - } - } - - - class TIntFloatHashIterator extends THashPrimitiveIterator implements TIntFloatIterator { - - /** - * Creates an iterator over the specified map - * - * @param map the TIntFloatHashMap we will be iterating over. - */ - TIntFloatHashIterator( TIntFloatHashMap map ) { - super( map ); - } - - /** {@inheritDoc} */ - public void advance() { - moveToNextIndex(); - } - - /** {@inheritDoc} */ - public int key() { - return _set[_index]; - } - - /** {@inheritDoc} */ - public float value() { - return _values[_index]; - } - - /** {@inheritDoc} */ - public float setValue( float val ) { - float old = value(); - _values[_index] = val; - return old; - } - - /** @{inheritDoc} */ - public void remove() { - if ( _expectedSize != _hash.size() ) { - throw new ConcurrentModificationException(); - } - // Disable auto compaction during the remove. This is a workaround for bug 1642768. - try { - _hash.tempDisableAutoCompaction(); - TIntFloatHashMap.this.removeAt( _index ); - } - finally { - _hash.reenableAutoCompaction( false ); - } - _expectedSize--; - } - } - - - /** {@inheritDoc} */ - @Override - public boolean equals( Object other ) { - if ( ! ( other instanceof TIntFloatMap ) ) { - return false; - } - TIntFloatMap that = ( TIntFloatMap ) other; - if ( that.size() != this.size() ) { - return false; - } - float[] values = _values; - byte[] states = _states; - float this_no_entry_value = getNoEntryValue(); - float that_no_entry_value = that.getNoEntryValue(); - for ( int i = values.length; i-- > 0; ) { - if ( states[i] == FULL ) { - int key = _set[i]; - float that_value = that.get( key ); - float this_value = values[i]; - if ( ( this_value != that_value ) && - ( this_value != this_no_entry_value ) && - ( that_value != that_no_entry_value ) ) { - return false; - } - } - } - return true; - } - - - /** {@inheritDoc} */ - @Override - public int hashCode() { - int hashcode = 0; - byte[] states = _states; - for ( int i = _values.length; i-- > 0; ) { - if ( states[i] == FULL ) { - hashcode += HashFunctions.hash( _set[i] ) ^ - HashFunctions.hash( _values[i] ); - } - } - return hashcode; - } - - - /** {@inheritDoc} */ - @Override - public String toString() { - final StringBuilder buf = new StringBuilder( "{" ); - forEachEntry( new TIntFloatProcedure() { - private boolean first = true; - public boolean execute( int key, float value ) { - if ( first ) first = false; - else buf.append( ", " ); - - buf.append(key); - buf.append("="); - buf.append(value); - return true; - } - }); - buf.append( "}" ); - return buf.toString(); - } - - - /** {@inheritDoc} */ - public void writeExternal(ObjectOutput out) throws IOException { - // VERSION - out.writeByte( 0 ); - - // SUPER - super.writeExternal( out ); - - // NUMBER OF ENTRIES - out.writeInt( _size ); - - // ENTRIES - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - out.writeInt( _set[i] ); - out.writeFloat( _values[i] ); - } - } - } - - - /** {@inheritDoc} */ - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - // VERSION - in.readByte(); - - // SUPER - super.readExternal( in ); - - // NUMBER OF ENTRIES - int size = in.readInt(); - setUp( size ); - - // ENTRIES - while (size-- > 0) { - int key = in.readInt(); - float val = in.readFloat(); - put(key, val); - } - } -} // TIntFloatHashMap diff --git a/src/gnu/trove/map/hash/TLongDoubleHashMap.java b/src/gnu/trove/map/hash/TLongDoubleHashMap.java deleted file mode 100644 index edc7a9d..0000000 --- a/src/gnu/trove/map/hash/TLongDoubleHashMap.java +++ /dev/null @@ -1,1294 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.map.hash; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - -import gnu.trove.map.TLongDoubleMap; -import gnu.trove.function.TDoubleFunction; -import gnu.trove.procedure.*; -import gnu.trove.set.*; -import gnu.trove.iterator.*; -import gnu.trove.iterator.hash.*; -import gnu.trove.impl.hash.*; -import gnu.trove.impl.HashFunctions; -import gnu.trove.*; - -import java.io.*; -import java.util.*; - -/** - * An open addressed Map implementation for long keys and double values. - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: _K__V_HashMap.template,v 1.1.2.16 2010/03/02 04:09:50 robeden Exp $ - */ -public class TLongDoubleHashMap extends TLongDoubleHash implements TLongDoubleMap, Externalizable { - static final long serialVersionUID = 1L; - - /** the values of the map */ - protected transient double[] _values; - - - /** - * Creates a new TLongDoubleHashMap instance with the default - * capacity and load factor. - */ - public TLongDoubleHashMap() { - super(); - } - - - /** - * Creates a new TLongDoubleHashMap instance with a prime - * capacity equal to or greater than initialCapacity and - * with the default load factor. - * - * @param initialCapacity an int value - */ - public TLongDoubleHashMap( int initialCapacity ) { - super( initialCapacity ); - } - - - /** - * Creates a new TLongDoubleHashMap instance with a prime - * capacity equal to or greater than initialCapacity and - * with the specified load factor. - * - * @param initialCapacity an int value - * @param loadFactor a float value - */ - public TLongDoubleHashMap( int initialCapacity, float loadFactor ) { - super( initialCapacity, loadFactor ); - } - - - /** - * Creates a new TLongDoubleHashMap instance with a prime - * capacity equal to or greater than initialCapacity and - * with the specified load factor. - * - * @param initialCapacity an int value - * @param loadFactor a float value - * @param noEntryKey a long value that represents - * null for the Key set. - * @param noEntryValue a double value that represents - * null for the Value set. - */ - public TLongDoubleHashMap( int initialCapacity, float loadFactor, - long noEntryKey, double noEntryValue ) { - super( initialCapacity, loadFactor, noEntryKey, noEntryValue ); - } - - - /** - * Creates a new TLongDoubleHashMap instance containing - * all of the entries in the map passed in. - * - * @param keys a long array containing the keys for the matching values. - * @param values a double array containing the values. - */ - public TLongDoubleHashMap( long[] keys, double[] values ) { - super( Math.max( keys.length, values.length ) ); - - int size = Math.min( keys.length, values.length ); - for ( int i = 0; i < size; i++ ) { - this.put( keys[i], values[i] ); - } - } - - - /** - * Creates a new TLongDoubleHashMap instance containing - * all of the entries in the map passed in. - * - * @param map a TLongDoubleMap that will be duplicated. - */ - public TLongDoubleHashMap( TLongDoubleMap map ) { - super( map.size() ); - if ( map instanceof TLongDoubleHashMap ) { - TLongDoubleHashMap hashmap = ( TLongDoubleHashMap ) map; - this._loadFactor = hashmap._loadFactor; - this.no_entry_key = hashmap.no_entry_key; - this.no_entry_value = hashmap.no_entry_value; - //noinspection RedundantCast - if ( this.no_entry_key != ( long ) 0 ) { - Arrays.fill( _set, this.no_entry_key ); - } - //noinspection RedundantCast - if ( this.no_entry_value != ( double ) 0 ) { - Arrays.fill( _values, this.no_entry_value ); - } - setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) ); - } - putAll( map ); - } - - - /** - * initializes the hashtable to a prime capacity which is at least - * initialCapacity + 1. - * - * @param initialCapacity an int value - * @return the actual capacity chosen - */ - protected int setUp( int initialCapacity ) { - int capacity; - - capacity = super.setUp( initialCapacity ); - _values = new double[capacity]; - return capacity; - } - - - /** - * rehashes the map to the new capacity. - * - * @param newCapacity an int value - */ - /** {@inheritDoc} */ - protected void rehash( int newCapacity ) { - int oldCapacity = _set.length; - - long oldKeys[] = _set; - double oldVals[] = _values; - byte oldStates[] = _states; - - _set = new long[newCapacity]; - _values = new double[newCapacity]; - _states = new byte[newCapacity]; - - for ( int i = oldCapacity; i-- > 0; ) { - if( oldStates[i] == FULL ) { - long o = oldKeys[i]; - int index = insertionIndex( o ); - _set[index] = o; - _values[index] = oldVals[i]; - _states[index] = FULL; - } - } - } - - - /** {@inheritDoc} */ - public double put( long key, double value ) { - int index = insertionIndex( key ); - return doPut( key, value, index ); - } - - - /** {@inheritDoc} */ - public double putIfAbsent( long key, double value ) { - int index = insertionIndex( key ); - if (index < 0) - return _values[-index - 1]; - return doPut( key, value, index ); - } - - - private double doPut( long key, double value, int index ) { - byte previousState; - double previous = no_entry_value; - boolean isNewMapping = true; - if ( index < 0 ) { - index = -index -1; - previous = _values[index]; - isNewMapping = false; - } - previousState = _states[index]; - _set[index] = key; - _states[index] = FULL; - _values[index] = value; - if (isNewMapping) { - postInsertHook( previousState == FREE ); - } - - return previous; - } - - - /** {@inheritDoc} */ - public void putAll( Map map ) { - ensureCapacity( map.size() ); - // could optimize this for cases when map instanceof THashMap - for ( Map.Entry entry : map.entrySet() ) { - this.put( entry.getKey().longValue(), entry.getValue().doubleValue() ); - } - } - - - /** {@inheritDoc} */ - public void putAll( TLongDoubleMap map ) { - ensureCapacity( map.size() ); - TLongDoubleIterator iter = map.iterator(); - while ( iter.hasNext() ) { - iter.advance(); - this.put( iter.key(), iter.value() ); - } - } - - - /** {@inheritDoc} */ - public double get( long key ) { - int index = index( key ); - return index < 0 ? no_entry_value : _values[index]; - } - - - /** {@inheritDoc} */ - public void clear() { - super.clear(); - Arrays.fill( _set, 0, _set.length, no_entry_key ); - Arrays.fill( _values, 0, _values.length, no_entry_value ); - Arrays.fill( _states, 0, _states.length, FREE ); - } - - - /** {@inheritDoc} */ - public boolean isEmpty() { - return 0 == _size; - } - - - /** {@inheritDoc} */ - public double remove( long key ) { - double prev = no_entry_value; - int index = index( key ); - if ( index >= 0 ) { - prev = _values[index]; - removeAt( index ); // clear key,state; adjust size - } - return prev; - } - - - /** {@inheritDoc} */ - protected void removeAt( int index ) { - _values[index] = no_entry_value; - super.removeAt( index ); // clear key, state; adjust size - } - - - /** {@inheritDoc} */ - public TLongSet keySet() { - return new TKeyView(); - } - - - /** {@inheritDoc} */ - public long[] keys() { - long[] keys = new long[size()]; - long[] k = _set; - byte[] states = _states; - - for ( int i = k.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - keys[j++] = k[i]; - } - } - return keys; - } - - - /** {@inheritDoc} */ - public long[] keys( long[] array ) { - int size = size(); - if ( array.length < size ) { - array = new long[size]; - } - - long[] keys = _set; - byte[] states = _states; - - for ( int i = keys.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - array[j++] = keys[i]; - } - } - return array; - } - - - /** {@inheritDoc} */ - public TDoubleCollection valueCollection() { - return new TValueView(); - } - - - /** {@inheritDoc} */ - public double[] values() { - double[] vals = new double[size()]; - double[] v = _values; - byte[] states = _states; - - for ( int i = v.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - vals[j++] = v[i]; - } - } - return vals; - } - - - /** {@inheritDoc} */ - public double[] values( double[] array ) { - int size = size(); - if ( array.length < size ) { - array = new double[size]; - } - - double[] v = _values; - byte[] states = _states; - - for ( int i = v.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - array[j++] = v[i]; - } - } - return array; - } - - - /** {@inheritDoc} */ - public boolean containsValue( double val ) { - byte[] states = _states; - double[] vals = _values; - - for ( int i = vals.length; i-- > 0; ) { - if ( states[i] == FULL && val == vals[i] ) { - return true; - } - } - return false; - } - - - /** {@inheritDoc} */ - public boolean containsKey( long key ) { - return contains( key ); - } - - - /** {@inheritDoc} */ - public TLongDoubleIterator iterator() { - return new TLongDoubleHashIterator( this ); - } - - - /** {@inheritDoc} */ - public boolean forEachKey( TLongProcedure procedure ) { - return forEach( procedure ); - } - - - /** {@inheritDoc} */ - public boolean forEachValue( TDoubleProcedure procedure ) { - byte[] states = _states; - double[] values = _values; - for ( int i = values.length; i-- > 0; ) { - if ( states[i] == FULL && ! procedure.execute( values[i] ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean forEachEntry( TLongDoubleProcedure procedure ) { - byte[] states = _states; - long[] keys = _set; - double[] values = _values; - for ( int i = keys.length; i-- > 0; ) { - if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public void transformValues( TDoubleFunction function ) { - byte[] states = _states; - double[] values = _values; - for ( int i = values.length; i-- > 0; ) { - if ( states[i] == FULL ) { - values[i] = function.execute( values[i] ); - } - } - } - - - /** {@inheritDoc} */ - public boolean retainEntries( TLongDoubleProcedure procedure ) { - boolean modified = false; - byte[] states = _states; - long[] keys = _set; - double[] values = _values; - - - // Temporarily disable compaction. This is a fix for bug #1738760 - tempDisableAutoCompaction(); - try { - for ( int i = keys.length; i-- > 0; ) { - if ( states[i] == FULL && ! procedure.execute( keys[i], values[i] ) ) { - removeAt( i ); - modified = true; - } - } - } - finally { - reenableAutoCompaction( true ); - } - - return modified; - } - - - /** {@inheritDoc} */ - public boolean increment( long key ) { - return adjustValue( key, ( double ) 1 ); - } - - - /** {@inheritDoc} */ - public boolean adjustValue( long key, double amount ) { - int index = index( key ); - if (index < 0) { - return false; - } else { - _values[index] += amount; - return true; - } - } - - - /** {@inheritDoc} */ - public double adjustOrPutValue( long key, double adjust_amount, double put_amount ) { - int index = insertionIndex( key ); - final boolean isNewMapping; - final double newValue; - if ( index < 0 ) { - index = -index -1; - newValue = ( _values[index] += adjust_amount ); - isNewMapping = false; - } else { - newValue = ( _values[index] = put_amount ); - isNewMapping = true; - } - - byte previousState = _states[index]; - _set[index] = key; - _states[index] = FULL; - - if ( isNewMapping ) { - postInsertHook(previousState == FREE); - } - - return newValue; - } - - - /** a view onto the keys of the map. */ - protected class TKeyView implements TLongSet { - - /** {@inheritDoc} */ - public TLongIterator iterator() { - return new TLongDoubleKeyHashIterator( TLongDoubleHashMap.this ); - } - - - /** {@inheritDoc} */ - public long getNoEntryValue() { - return no_entry_key; - } - - - /** {@inheritDoc} */ - public int size() { - return _size; - } - - - /** {@inheritDoc} */ - public boolean isEmpty() { - return 0 == _size; - } - - - /** {@inheritDoc} */ - public boolean contains( long entry ) { - return TLongDoubleHashMap.this.contains( entry ); - } - - - /** {@inheritDoc} */ - public long[] toArray() { - return TLongDoubleHashMap.this.keys(); - } - - - /** {@inheritDoc} */ - public long[] toArray( long[] dest ) { - return TLongDoubleHashMap.this.keys( dest ); - } - - - /** - * Unsupported when operating upon a Key Set view of a TLongDoubleMap - *

- * {@inheritDoc} - */ - public boolean add( long entry ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - public boolean remove( long entry ) { - return no_entry_value != TLongDoubleHashMap.this.remove( entry ); - } - - - /** {@inheritDoc} */ - public boolean containsAll( Collection collection ) { - for ( Object element : collection ) { - if ( element instanceof Long ) { - long ele = ( ( Long ) element ).longValue(); - if ( ! TLongDoubleHashMap.this.containsKey( ele ) ) { - return false; - } - } else { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( TLongCollection collection ) { - TLongIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - if ( ! TLongDoubleHashMap.this.containsKey( iter.next() ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( long[] array ) { - for ( long element : array ) { - if ( ! TLongDoubleHashMap.this.contains( element ) ) { - return false; - } - } - return true; - } - - - /** - * Unsupported when operating upon a Key Set view of a TLongDoubleMap - *

- * {@inheritDoc} - */ - public boolean addAll( Collection collection ) { - throw new UnsupportedOperationException(); - } - - - /** - * Unsupported when operating upon a Key Set view of a TLongDoubleMap - *

- * {@inheritDoc} - */ - public boolean addAll( TLongCollection collection ) { - throw new UnsupportedOperationException(); - } - - - /** - * Unsupported when operating upon a Key Set view of a TLongDoubleMap - *

- * {@inheritDoc} - */ - public boolean addAll( long[] array ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - @SuppressWarnings({"SuspiciousMethodCalls"}) - public boolean retainAll( Collection collection ) { - boolean modified = false; - TLongIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( Long.valueOf ( iter.next() ) ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( TLongCollection collection ) { - if ( this == collection ) { - return false; - } - boolean modified = false; - TLongIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( iter.next() ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( long[] array ) { - boolean changed = false; - Arrays.sort( array ); - long[] set = _set; - byte[] states = _states; - - for ( int i = set.length; i-- > 0; ) { - if ( states[i] == FULL && ( Arrays.binarySearch( array, set[i] ) < 0) ) { - removeAt( i ); - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( Collection collection ) { - boolean changed = false; - for ( Object element : collection ) { - if ( element instanceof Long ) { - long c = ( ( Long ) element ).longValue(); - if ( remove( c ) ) { - changed = true; - } - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( TLongCollection collection ) { - if ( this == collection ) { - clear(); - return true; - } - boolean changed = false; - TLongIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - long element = iter.next(); - if ( remove( element ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( long[] array ) { - boolean changed = false; - for ( int i = array.length; i-- > 0; ) { - if ( remove( array[i] ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public void clear() { - TLongDoubleHashMap.this.clear(); - } - - - /** {@inheritDoc} */ - public boolean forEach( TLongProcedure procedure ) { - return TLongDoubleHashMap.this.forEachKey( procedure ); - } - - - @Override - public boolean equals( Object other ) { - if (! (other instanceof TLongSet)) { - return false; - } - final TLongSet that = ( TLongSet ) other; - if ( that.size() != this.size() ) { - return false; - } - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - if ( ! that.contains( _set[i] ) ) { - return false; - } - } - } - return true; - } - - - @Override - public int hashCode() { - int hashcode = 0; - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - hashcode += HashFunctions.hash( _set[i] ); - } - } - return hashcode; - } - - - @Override - public String toString() { - final StringBuilder buf = new StringBuilder( "{" ); - forEachKey( new TLongProcedure() { - private boolean first = true; - - - public boolean execute( long key ) { - if ( first ) { - first = false; - } else { - buf.append( ", " ); - } - - buf.append( key ); - return true; - } - } ); - buf.append( "}" ); - return buf.toString(); - } - } - - - /** a view onto the values of the map. */ - protected class TValueView implements TDoubleCollection { - - /** {@inheritDoc} */ - public TDoubleIterator iterator() { - return new TLongDoubleValueHashIterator( TLongDoubleHashMap.this ); - } - - - /** {@inheritDoc} */ - public double getNoEntryValue() { - return no_entry_value; - } - - - /** {@inheritDoc} */ - public int size() { - return _size; - } - - - /** {@inheritDoc} */ - public boolean isEmpty() { - return 0 == _size; - } - - - /** {@inheritDoc} */ - public boolean contains( double entry ) { - return TLongDoubleHashMap.this.containsValue( entry ); - } - - - /** {@inheritDoc} */ - public double[] toArray() { - return TLongDoubleHashMap.this.values(); - } - - - /** {@inheritDoc} */ - public double[] toArray( double[] dest ) { - return TLongDoubleHashMap.this.values( dest ); - } - - - - public boolean add( double entry ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - public boolean remove( double entry ) { - double[] values = _values; - long[] set = _set; - - for ( int i = values.length; i-- > 0; ) { - if ( ( set[i] != FREE && set[i] != REMOVED ) && entry == values[i] ) { - removeAt( i ); - return true; - } - } - return false; - } - - - /** {@inheritDoc} */ - public boolean containsAll( Collection collection ) { - for ( Object element : collection ) { - if ( element instanceof Double ) { - double ele = ( ( Double ) element ).doubleValue(); - if ( ! TLongDoubleHashMap.this.containsValue( ele ) ) { - return false; - } - } else { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( TDoubleCollection collection ) { - TDoubleIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - if ( ! TLongDoubleHashMap.this.containsValue( iter.next() ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( double[] array ) { - for ( double element : array ) { - if ( ! TLongDoubleHashMap.this.containsValue( element ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean addAll( Collection collection ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - public boolean addAll( TDoubleCollection collection ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - public boolean addAll( double[] array ) { - throw new UnsupportedOperationException(); - } - - - /** {@inheritDoc} */ - @SuppressWarnings({"SuspiciousMethodCalls"}) - public boolean retainAll( Collection collection ) { - boolean modified = false; - TDoubleIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( Double.valueOf ( iter.next() ) ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( TDoubleCollection collection ) { - if ( this == collection ) { - return false; - } - boolean modified = false; - TDoubleIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( iter.next() ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( double[] array ) { - boolean changed = false; - Arrays.sort( array ); - double[] values = _values; - byte[] states = _states; - - for ( int i = values.length; i-- > 0; ) { - if ( states[i] == FULL && ( Arrays.binarySearch( array, values[i] ) < 0) ) { - removeAt( i ); - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( Collection collection ) { - boolean changed = false; - for ( Object element : collection ) { - if ( element instanceof Double ) { - double c = ( ( Double ) element ).doubleValue(); - if ( remove( c ) ) { - changed = true; - } - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( TDoubleCollection collection ) { - if ( this == collection ) { - clear(); - return true; - } - boolean changed = false; - TDoubleIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - double element = iter.next(); - if ( remove( element ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( double[] array ) { - boolean changed = false; - for ( int i = array.length; i-- > 0; ) { - if ( remove( array[i] ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public void clear() { - TLongDoubleHashMap.this.clear(); - } - - - /** {@inheritDoc} */ - public boolean forEach( TDoubleProcedure procedure ) { - return TLongDoubleHashMap.this.forEachValue( procedure ); - } - - - /** {@inheritDoc} */ - @Override - public String toString() { - final StringBuilder buf = new StringBuilder( "{" ); - forEachValue( new TDoubleProcedure() { - private boolean first = true; - - public boolean execute( double value ) { - if ( first ) { - first = false; - } else { - buf.append( ", " ); - } - - buf.append( value ); - return true; - } - } ); - buf.append( "}" ); - return buf.toString(); - } - } - - - class TLongDoubleKeyHashIterator extends THashPrimitiveIterator implements TLongIterator { - - /** - * Creates an iterator over the specified map - * - * @param hash the TPrimitiveHash we will be iterating over. - */ - TLongDoubleKeyHashIterator( TPrimitiveHash hash ) { - super( hash ); - } - - /** {@inheritDoc} */ - public long next() { - moveToNextIndex(); - return _set[_index]; - } - - /** @{inheritDoc} */ - public void remove() { - if ( _expectedSize != _hash.size() ) { - throw new ConcurrentModificationException(); - } - - // Disable auto compaction during the remove. This is a workaround for bug 1642768. - try { - _hash.tempDisableAutoCompaction(); - TLongDoubleHashMap.this.removeAt( _index ); - } - finally { - _hash.reenableAutoCompaction( false ); - } - - _expectedSize--; - } - } - - - - class TLongDoubleValueHashIterator extends THashPrimitiveIterator implements TDoubleIterator { - - /** - * Creates an iterator over the specified map - * - * @param hash the TPrimitiveHash we will be iterating over. - */ - TLongDoubleValueHashIterator( TPrimitiveHash hash ) { - super( hash ); - } - - /** {@inheritDoc} */ - public double next() { - moveToNextIndex(); - return _values[_index]; - } - - /** @{inheritDoc} */ - public void remove() { - if ( _expectedSize != _hash.size() ) { - throw new ConcurrentModificationException(); - } - - // Disable auto compaction during the remove. This is a workaround for bug 1642768. - try { - _hash.tempDisableAutoCompaction(); - TLongDoubleHashMap.this.removeAt( _index ); - } - finally { - _hash.reenableAutoCompaction( false ); - } - - _expectedSize--; - } - } - - - class TLongDoubleHashIterator extends THashPrimitiveIterator implements TLongDoubleIterator { - - /** - * Creates an iterator over the specified map - * - * @param map the TLongDoubleHashMap we will be iterating over. - */ - TLongDoubleHashIterator( TLongDoubleHashMap map ) { - super( map ); - } - - /** {@inheritDoc} */ - public void advance() { - moveToNextIndex(); - } - - /** {@inheritDoc} */ - public long key() { - return _set[_index]; - } - - /** {@inheritDoc} */ - public double value() { - return _values[_index]; - } - - /** {@inheritDoc} */ - public double setValue( double val ) { - double old = value(); - _values[_index] = val; - return old; - } - - /** @{inheritDoc} */ - public void remove() { - if ( _expectedSize != _hash.size() ) { - throw new ConcurrentModificationException(); - } - // Disable auto compaction during the remove. This is a workaround for bug 1642768. - try { - _hash.tempDisableAutoCompaction(); - TLongDoubleHashMap.this.removeAt( _index ); - } - finally { - _hash.reenableAutoCompaction( false ); - } - _expectedSize--; - } - } - - - /** {@inheritDoc} */ - @Override - public boolean equals( Object other ) { - if ( ! ( other instanceof TLongDoubleMap ) ) { - return false; - } - TLongDoubleMap that = ( TLongDoubleMap ) other; - if ( that.size() != this.size() ) { - return false; - } - double[] values = _values; - byte[] states = _states; - double this_no_entry_value = getNoEntryValue(); - double that_no_entry_value = that.getNoEntryValue(); - for ( int i = values.length; i-- > 0; ) { - if ( states[i] == FULL ) { - long key = _set[i]; - double that_value = that.get( key ); - double this_value = values[i]; - if ( ( this_value != that_value ) && - ( this_value != this_no_entry_value ) && - ( that_value != that_no_entry_value ) ) { - return false; - } - } - } - return true; - } - - - /** {@inheritDoc} */ - @Override - public int hashCode() { - int hashcode = 0; - byte[] states = _states; - for ( int i = _values.length; i-- > 0; ) { - if ( states[i] == FULL ) { - hashcode += HashFunctions.hash( _set[i] ) ^ - HashFunctions.hash( _values[i] ); - } - } - return hashcode; - } - - - /** {@inheritDoc} */ - @Override - public String toString() { - final StringBuilder buf = new StringBuilder( "{" ); - forEachEntry( new TLongDoubleProcedure() { - private boolean first = true; - public boolean execute( long key, double value ) { - if ( first ) first = false; - else buf.append( ", " ); - - buf.append(key); - buf.append("="); - buf.append(value); - return true; - } - }); - buf.append( "}" ); - return buf.toString(); - } - - - /** {@inheritDoc} */ - public void writeExternal(ObjectOutput out) throws IOException { - // VERSION - out.writeByte( 0 ); - - // SUPER - super.writeExternal( out ); - - // NUMBER OF ENTRIES - out.writeInt( _size ); - - // ENTRIES - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - out.writeLong( _set[i] ); - out.writeDouble( _values[i] ); - } - } - } - - - /** {@inheritDoc} */ - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - // VERSION - in.readByte(); - - // SUPER - super.readExternal( in ); - - // NUMBER OF ENTRIES - int size = in.readInt(); - setUp( size ); - - // ENTRIES - while (size-- > 0) { - long key = in.readLong(); - double val = in.readDouble(); - put(key, val); - } - } -} // TLongDoubleHashMap diff --git a/src/gnu/trove/procedure/TByteProcedure.java b/src/gnu/trove/procedure/TByteProcedure.java deleted file mode 100644 index 6684ea1..0000000 --- a/src/gnu/trove/procedure/TByteProcedure.java +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.procedure; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for procedures with one byte parameter. - */ -public interface TByteProcedure { - /** - * Executes this procedure. A false return value indicates that - * the application executing this procedure should not invoke this - * procedure again. - * - * @param value a value of type byte - * @return true if additional invocations of the procedure are - * allowed. - */ - public boolean execute( byte value ); -} diff --git a/src/gnu/trove/procedure/TCharProcedure.java b/src/gnu/trove/procedure/TCharProcedure.java deleted file mode 100644 index 21f4fe4..0000000 --- a/src/gnu/trove/procedure/TCharProcedure.java +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.procedure; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for procedures with one char parameter. - */ -public interface TCharProcedure { - /** - * Executes this procedure. A false return value indicates that - * the application executing this procedure should not invoke this - * procedure again. - * - * @param value a value of type char - * @return true if additional invocations of the procedure are - * allowed. - */ - public boolean execute( char value ); -} diff --git a/src/gnu/trove/procedure/TDoubleProcedure.java b/src/gnu/trove/procedure/TDoubleProcedure.java deleted file mode 100644 index 28f0b5a..0000000 --- a/src/gnu/trove/procedure/TDoubleProcedure.java +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.procedure; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for procedures with one double parameter. - */ -public interface TDoubleProcedure { - /** - * Executes this procedure. A false return value indicates that - * the application executing this procedure should not invoke this - * procedure again. - * - * @param value a value of type double - * @return true if additional invocations of the procedure are - * allowed. - */ - public boolean execute( double value ); -} diff --git a/src/gnu/trove/procedure/TFloatProcedure.java b/src/gnu/trove/procedure/TFloatProcedure.java deleted file mode 100644 index 8bcdd82..0000000 --- a/src/gnu/trove/procedure/TFloatProcedure.java +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.procedure; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for procedures with one float parameter. - */ -public interface TFloatProcedure { - /** - * Executes this procedure. A false return value indicates that - * the application executing this procedure should not invoke this - * procedure again. - * - * @param value a value of type float - * @return true if additional invocations of the procedure are - * allowed. - */ - public boolean execute( float value ); -} diff --git a/src/gnu/trove/procedure/TIntFloatProcedure.java b/src/gnu/trove/procedure/TIntFloatProcedure.java deleted file mode 100644 index cb3235c..0000000 --- a/src/gnu/trove/procedure/TIntFloatProcedure.java +++ /dev/null @@ -1,42 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.procedure; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for procedures that take two parameters of type int and float. - */ -public interface TIntFloatProcedure { - - /** - * Executes this procedure. A false return value indicates that - * the application executing this procedure should not invoke this - * procedure again. - * - * @param a a int value - * @param b a float value - * @return true if additional invocations of the procedure are - * allowed. - */ - public boolean execute( int a, float b ); -} diff --git a/src/gnu/trove/procedure/TIntProcedure.java b/src/gnu/trove/procedure/TIntProcedure.java deleted file mode 100644 index 5b1a644..0000000 --- a/src/gnu/trove/procedure/TIntProcedure.java +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.procedure; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for procedures with one int parameter. - */ -public interface TIntProcedure { - /** - * Executes this procedure. A false return value indicates that - * the application executing this procedure should not invoke this - * procedure again. - * - * @param value a value of type int - * @return true if additional invocations of the procedure are - * allowed. - */ - public boolean execute( int value ); -} diff --git a/src/gnu/trove/procedure/TLongDoubleProcedure.java b/src/gnu/trove/procedure/TLongDoubleProcedure.java deleted file mode 100644 index c2ba2a7..0000000 --- a/src/gnu/trove/procedure/TLongDoubleProcedure.java +++ /dev/null @@ -1,42 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.procedure; - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for procedures that take two parameters of type long and double. - */ -public interface TLongDoubleProcedure { - - /** - * Executes this procedure. A false return value indicates that - * the application executing this procedure should not invoke this - * procedure again. - * - * @param a a long value - * @param b a double value - * @return true if additional invocations of the procedure are - * allowed. - */ - public boolean execute( long a, double b ); -} diff --git a/src/gnu/trove/procedure/TLongProcedure.java b/src/gnu/trove/procedure/TLongProcedure.java deleted file mode 100644 index 6b169f0..0000000 --- a/src/gnu/trove/procedure/TLongProcedure.java +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.procedure; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for procedures with one long parameter. - */ -public interface TLongProcedure { - /** - * Executes this procedure. A false return value indicates that - * the application executing this procedure should not invoke this - * procedure again. - * - * @param value a value of type long - * @return true if additional invocations of the procedure are - * allowed. - */ - public boolean execute( long value ); -} diff --git a/src/gnu/trove/procedure/TObjectObjectProcedure.java b/src/gnu/trove/procedure/TObjectObjectProcedure.java deleted file mode 100644 index 946a623..0000000 --- a/src/gnu/trove/procedure/TObjectObjectProcedure.java +++ /dev/null @@ -1,43 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.procedure; - -/** - * Interface for procedures that take two Object parameters. - *

- * Created: Mon Nov 5 22:03:30 2001 - * - * @author Eric D. Friedman - * @version $Id: TObjectObjectProcedure.java,v 1.1.2.1 2009/09/06 17:02:20 upholderoftruth Exp $ - */ - -public interface TObjectObjectProcedure { - - /** - * Executes this procedure. A false return value indicates that - * the application executing this procedure should not invoke this - * procedure again. - * - * @param a an Object value - * @param b an Object value - * @return true if additional invocations of the procedure are - * allowed. - */ - public boolean execute( K a, V b ); -}// TObjectObjectProcedure diff --git a/src/gnu/trove/procedure/TObjectProcedure.java b/src/gnu/trove/procedure/TObjectProcedure.java deleted file mode 100644 index 71cf0e2..0000000 --- a/src/gnu/trove/procedure/TObjectProcedure.java +++ /dev/null @@ -1,42 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - - -package gnu.trove.procedure; - -/** - * Interface for procedures with one Object parameter. - * - * Created: Mon Nov 5 21:45:49 2001 - * - * @author Eric D. Friedman - * @version $Id: TObjectProcedure.java,v 1.1.2.1 2009/09/02 21:52:33 upholderoftruth Exp $ - */ - -public interface TObjectProcedure { - /** - * Executes this procedure. A false return value indicates that - * the application executing this procedure should not invoke this - * procedure again. - * - * @param object an Object value - * @return true if additional invocations of the procedure are - * allowed. - */ - public boolean execute(T object); -}// TObjectProcedure diff --git a/src/gnu/trove/procedure/TShortProcedure.java b/src/gnu/trove/procedure/TShortProcedure.java deleted file mode 100644 index ebac66c..0000000 --- a/src/gnu/trove/procedure/TShortProcedure.java +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.procedure; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * Interface for procedures with one short parameter. - */ -public interface TShortProcedure { - /** - * Executes this procedure. A false return value indicates that - * the application executing this procedure should not invoke this - * procedure again. - * - * @param value a value of type short - * @return true if additional invocations of the procedure are - * allowed. - */ - public boolean execute( short value ); -} diff --git a/src/gnu/trove/procedure/array/ToObjectArrayProceedure.java b/src/gnu/trove/procedure/array/ToObjectArrayProceedure.java deleted file mode 100644 index 122d23d..0000000 --- a/src/gnu/trove/procedure/array/ToObjectArrayProceedure.java +++ /dev/null @@ -1,49 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.procedure.array; - -import gnu.trove.procedure.TObjectProcedure; - - - -/** - * A procedure which stores each value it receives into a target array. - *

- * Created: Sat Jan 12 10:13:42 2002 - * - * @author Eric D. Friedman - * @version $Id: ToObjectArrayProceedure.java,v 1.1.2.1 2009/09/02 21:52:33 upholderoftruth Exp $ - */ - -public final class ToObjectArrayProceedure implements TObjectProcedure { - - private final T[] target; - private int pos = 0; - - - public ToObjectArrayProceedure( final T[] target ) { - this.target = target; - } - - - public final boolean execute( T value ) { - target[pos++] = value; - return true; - } -} // ToObjectArrayProcedure \ No newline at end of file diff --git a/src/gnu/trove/set/TIntSet.java b/src/gnu/trove/set/TIntSet.java deleted file mode 100644 index 64645d0..0000000 --- a/src/gnu/trove/set/TIntSet.java +++ /dev/null @@ -1,320 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.set; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - -import gnu.trove.iterator.TIntIterator; -import gnu.trove.procedure.TIntProcedure; -import gnu.trove.TIntCollection; - -import java.util.Collection; -import java.util.Set; -import java.io.Serializable; - -/** - * An implementation of the Set interface that uses an - * open-addressed hash table to store its contents. - * - * Created: Sat Nov 3 10:38:17 2001 - * - * @author Eric D. Friedman, Rob Eden, Jeff Randall - * @version $Id: _E_Set.template,v 1.1.2.5 2009/09/15 02:38:31 upholderoftruth Exp $ - */ - -public interface TIntSet extends TIntCollection, Serializable { - - - /** - * Returns the value that is used to represent null. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - int getNoEntryValue(); - - - /** - * Returns the number of elements in this set (its cardinality). If this - * set contains more than Integer.MAX_VALUE elements, returns - * Integer.MAX_VALUE. - * - * @return the number of elements in this set (its cardinality) - */ - int size(); - - - /** - * Returns true if this set contains no elements. - * - * @return true if this set contains no elements - */ - boolean isEmpty(); - - - /** - * Returns true if this set contains the specified element. - * - * @param entry an int value - * @return true if the set contains the specified element. - */ - boolean contains( int entry ); - - - /** - * Creates an iterator over the values of the set. The iterator - * supports element deletion. - * - * @return an TIntIterator value - */ - TIntIterator iterator(); - - - /** - * Returns an array containing all of the elements in this set. - * If this set makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the - * elements in the same order. - * - *

The returned array will be "safe" in that no references to it - * are maintained by this set. (In other words, this method must - * allocate a new array even if this set is backed by an array). - * The caller is thus free to modify the returned array. - * - *

This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this set - */ - int[] toArray(); - - - /** - * Returns an array containing elements in this set. - * - *

If this set fits in the specified array with room to spare - * (i.e., the array has more elements than this set), the element in - * the array immediately following the end of the set is set to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this set only if the caller knows that this - * set does not contain any elements representing null.) - * - *

If the native array is smaller than the set size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *

If this set makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the elements - * in the same order. - * - * @param dest the array into which the elements of this set are to be - * stored. - * @return an int[] containing all the elements in this set - * @throws NullPointerException if the specified array is null - */ - int[] toArray( int[] dest ); - - - /** - * Inserts a value into the set. - * - * @param entry a int value - * @return true if the set was modified by the add operation - */ - boolean add( int entry ); - - - /** - * Removes entry from the set. - * - * @param entry an int value - * @return true if the set was modified by the remove operation. - */ - boolean remove( int entry ); - - - /** - * Tests the set to determine if all of the elements in - * collection are present. - * - * @param collection a Collection value - * @return true if all elements were present in the set. - */ - boolean containsAll( Collection collection ); - - - /** - * Tests the set to determine if all of the elements in - * TIntCollection are present. - * - * @param collection a TIntCollection value - * @return true if all elements were present in the set. - */ - boolean containsAll( TIntCollection collection ); - - - /** - * Tests the set to determine if all of the elements in - * array are present. - * - * @param array as array of int primitives. - * @return true if all elements were present in the set. - */ - boolean containsAll( int[] array ); - - - /** - * Adds all of the elements in collection to the set. - * - * @param collection a Collection value - * @return true if the set was modified by the add all operation. - */ - boolean addAll( Collection collection ); - - - /** - * Adds all of the elements in the TIntCollection to the set. - * - * @param collection a TIntCollection value - * @return true if the set was modified by the add all operation. - */ - boolean addAll( TIntCollection collection ); - - - /** - * Adds all of the elements in the array to the set. - * - * @param array a array of int primitives. - * @return true if the set was modified by the add all operation. - */ - boolean addAll( int[] array ); - - - /** - * Removes any values in the set which are not contained in - * collection. - * - * @param collection a Collection value - * @return true if the set was modified by the retain all operation - */ - boolean retainAll( Collection collection ); - - - /** - * Removes any values in the set which are not contained in - * TIntCollection. - * - * @param collection a TIntCollection value - * @return true if the set was modified by the retain all operation - */ - boolean retainAll( TIntCollection collection ); - - - /** - * Removes any values in the set which are not contained in - * array. - * - * @param array an array of int primitives. - * @return true if the set was modified by the retain all operation - */ - boolean retainAll( int[] array ); - - - /** - * Removes all of the elements in collection from the set. - * - * @param collection a Collection value - * @return true if the set was modified by the remove all operation. - */ - boolean removeAll( Collection collection ); - - - /** - * Removes all of the elements in TIntCollection from the set. - * - * @param collection a TIntCollection value - * @return true if the set was modified by the remove all operation. - */ - boolean removeAll( TIntCollection collection ); - - - /** - * Removes all of the elements in array from the set. - * - * @param array an array of int primitives. - * @return true if the set was modified by the remove all operation. - */ - public boolean removeAll( int[] array ); - - - /** - * Empties the set. - */ - void clear(); - - - /** - * Executes procedure for each element in the set. - * - * @param procedure a TIntProcedure value - * @return false if the loop over the set terminated because - * the procedure returned false for some value. - */ - boolean forEach( TIntProcedure procedure ); - - - // Comparison and hashing - - /** - * Compares the specified object with this set for equality. Returns - * true if the specified object is also a set, the two sets - * have the same size, and every member of the specified set is - * contained in this set (or equivalently, every member of this set is - * contained in the specified set). This definition ensures that the - * equals method works properly across different implementations of the - * set interface. - * - * @param o object to be compared for equality with this set - * @return true if the specified object is equal to this set - */ - boolean equals( Object o ); - - - /** - * Returns the hash code value for this set. The hash code of a set is - * defined to be the sum of the hash codes of the elements in the set. - * This ensures that s1.equals(s2) implies that - * s1.hashCode()==s2.hashCode() for any two sets s1 - * and s2, as required by the general contract of - * {@link Object#hashCode}. - * - * @return the hash code value for this set - * @see Object#equals(Object) - * @see Set#equals(Object) - */ - int hashCode(); - - -} // THashSet diff --git a/src/gnu/trove/set/TLongSet.java b/src/gnu/trove/set/TLongSet.java deleted file mode 100644 index fa62253..0000000 --- a/src/gnu/trove/set/TLongSet.java +++ /dev/null @@ -1,320 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.set; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - -import gnu.trove.iterator.TLongIterator; -import gnu.trove.procedure.TLongProcedure; -import gnu.trove.TLongCollection; - -import java.util.Collection; -import java.util.Set; -import java.io.Serializable; - -/** - * An implementation of the Set interface that uses an - * open-addressed hash table to store its contents. - * - * Created: Sat Nov 3 10:38:17 2001 - * - * @author Eric D. Friedman, Rob Eden, Jeff Randall - * @version $Id: _E_Set.template,v 1.1.2.5 2009/09/15 02:38:31 upholderoftruth Exp $ - */ - -public interface TLongSet extends TLongCollection, Serializable { - - - /** - * Returns the value that is used to represent null. The default - * value is generally zero, but can be changed during construction - * of the collection. - * - * @return the value that represents null - */ - long getNoEntryValue(); - - - /** - * Returns the number of elements in this set (its cardinality). If this - * set contains more than Integer.MAX_VALUE elements, returns - * Integer.MAX_VALUE. - * - * @return the number of elements in this set (its cardinality) - */ - int size(); - - - /** - * Returns true if this set contains no elements. - * - * @return true if this set contains no elements - */ - boolean isEmpty(); - - - /** - * Returns true if this set contains the specified element. - * - * @param entry an long value - * @return true if the set contains the specified element. - */ - boolean contains( long entry ); - - - /** - * Creates an iterator over the values of the set. The iterator - * supports element deletion. - * - * @return an TLongIterator value - */ - TLongIterator iterator(); - - - /** - * Returns an array containing all of the elements in this set. - * If this set makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the - * elements in the same order. - * - *

The returned array will be "safe" in that no references to it - * are maintained by this set. (In other words, this method must - * allocate a new array even if this set is backed by an array). - * The caller is thus free to modify the returned array. - * - *

This method acts as bridge between array-based and collection-based - * APIs. - * - * @return an array containing all the elements in this set - */ - long[] toArray(); - - - /** - * Returns an array containing elements in this set. - * - *

If this set fits in the specified array with room to spare - * (i.e., the array has more elements than this set), the element in - * the array immediately following the end of the set is set to - * {@link #getNoEntryValue()}. (This is useful in determining - * the length of this set only if the caller knows that this - * set does not contain any elements representing null.) - * - *

If the native array is smaller than the set size, - * the array will be filled with elements in Iterator order - * until it is full and exclude the remainder. - * - *

If this set makes any guarantees as to what order its elements - * are returned by its iterator, this method must return the elements - * in the same order. - * - * @param dest the array into which the elements of this set are to be - * stored. - * @return an long[] containing all the elements in this set - * @throws NullPointerException if the specified array is null - */ - long[] toArray( long[] dest ); - - - /** - * Inserts a value into the set. - * - * @param entry a long value - * @return true if the set was modified by the add operation - */ - boolean add( long entry ); - - - /** - * Removes entry from the set. - * - * @param entry an long value - * @return true if the set was modified by the remove operation. - */ - boolean remove( long entry ); - - - /** - * Tests the set to determine if all of the elements in - * collection are present. - * - * @param collection a Collection value - * @return true if all elements were present in the set. - */ - boolean containsAll( Collection collection ); - - - /** - * Tests the set to determine if all of the elements in - * TLongCollection are present. - * - * @param collection a TLongCollection value - * @return true if all elements were present in the set. - */ - boolean containsAll( TLongCollection collection ); - - - /** - * Tests the set to determine if all of the elements in - * array are present. - * - * @param array as array of long primitives. - * @return true if all elements were present in the set. - */ - boolean containsAll( long[] array ); - - - /** - * Adds all of the elements in collection to the set. - * - * @param collection a Collection value - * @return true if the set was modified by the add all operation. - */ - boolean addAll( Collection collection ); - - - /** - * Adds all of the elements in the TLongCollection to the set. - * - * @param collection a TLongCollection value - * @return true if the set was modified by the add all operation. - */ - boolean addAll( TLongCollection collection ); - - - /** - * Adds all of the elements in the array to the set. - * - * @param array a array of long primitives. - * @return true if the set was modified by the add all operation. - */ - boolean addAll( long[] array ); - - - /** - * Removes any values in the set which are not contained in - * collection. - * - * @param collection a Collection value - * @return true if the set was modified by the retain all operation - */ - boolean retainAll( Collection collection ); - - - /** - * Removes any values in the set which are not contained in - * TLongCollection. - * - * @param collection a TLongCollection value - * @return true if the set was modified by the retain all operation - */ - boolean retainAll( TLongCollection collection ); - - - /** - * Removes any values in the set which are not contained in - * array. - * - * @param array an array of long primitives. - * @return true if the set was modified by the retain all operation - */ - boolean retainAll( long[] array ); - - - /** - * Removes all of the elements in collection from the set. - * - * @param collection a Collection value - * @return true if the set was modified by the remove all operation. - */ - boolean removeAll( Collection collection ); - - - /** - * Removes all of the elements in TLongCollection from the set. - * - * @param collection a TLongCollection value - * @return true if the set was modified by the remove all operation. - */ - boolean removeAll( TLongCollection collection ); - - - /** - * Removes all of the elements in array from the set. - * - * @param array an array of long primitives. - * @return true if the set was modified by the remove all operation. - */ - public boolean removeAll( long[] array ); - - - /** - * Empties the set. - */ - void clear(); - - - /** - * Executes procedure for each element in the set. - * - * @param procedure a TLongProcedure value - * @return false if the loop over the set terminated because - * the procedure returned false for some value. - */ - boolean forEach( TLongProcedure procedure ); - - - // Comparison and hashing - - /** - * Compares the specified object with this set for equality. Returns - * true if the specified object is also a set, the two sets - * have the same size, and every member of the specified set is - * contained in this set (or equivalently, every member of this set is - * contained in the specified set). This definition ensures that the - * equals method works properly across different implementations of the - * set interface. - * - * @param o object to be compared for equality with this set - * @return true if the specified object is equal to this set - */ - boolean equals( Object o ); - - - /** - * Returns the hash code value for this set. The hash code of a set is - * defined to be the sum of the hash codes of the elements in the set. - * This ensures that s1.equals(s2) implies that - * s1.hashCode()==s2.hashCode() for any two sets s1 - * and s2, as required by the general contract of - * {@link Object#hashCode}. - * - * @return the hash code value for this set - * @see Object#equals(Object) - * @see Set#equals(Object) - */ - int hashCode(); - - -} // THashSet diff --git a/src/gnu/trove/set/hash/THashSet.java b/src/gnu/trove/set/hash/THashSet.java deleted file mode 100644 index 51b2eb5..0000000 --- a/src/gnu/trove/set/hash/THashSet.java +++ /dev/null @@ -1,411 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.set.hash; - -import gnu.trove.impl.hash.TObjectHash; -import gnu.trove.impl.HashFunctions; -import gnu.trove.procedure.TObjectProcedure; -import gnu.trove.procedure.array.ToObjectArrayProceedure; -import gnu.trove.iterator.hash.TObjectHashIterator; - -import java.io.*; -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; -import java.util.Arrays; -import java.lang.reflect.Array; - - - -/** - * An implementation of the Set interface that uses an - * open-addressed hash table to store its contents. - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - * @version $Id: THashSet.java,v 1.1.2.8 2010/03/02 04:09:50 robeden Exp $ - */ - -public class THashSet extends TObjectHash - implements Set, Iterable, Externalizable { - - static final long serialVersionUID = 1L; - - - /** - * Creates a new THashSet instance with the default - * capacity and load factor. - */ - public THashSet() { - super(); - } - - - /** - * Creates a new THashSet instance with a prime - * capacity equal to or greater than initialCapacity and - * with the default load factor. - * - * @param initialCapacity an int value - */ - public THashSet( int initialCapacity ) { - super( initialCapacity ); - } - - - /** - * Creates a new THashSet instance with a prime - * capacity equal to or greater than initialCapacity and - * with the specified load factor. - * - * @param initialCapacity an int value - * @param loadFactor a float value - */ - public THashSet( int initialCapacity, float loadFactor ) { - super( initialCapacity, loadFactor ); - } - - - /** - * Creates a new THashSet instance containing the - * elements of collection. - * - * @param collection a Collection value - */ - public THashSet( Collection collection ) { - this( collection.size() ); - addAll( collection ); - } - - - /** - * Inserts a value into the set. - * - * @param obj an Object value - * @return true if the set was modified by the add operation - */ - public boolean add( E obj ) { - int index = insertionIndex( obj ); - - if ( index < 0 ) { - return false; // already present in set, nothing to add - } - - Object old = _set[index]; - _set[index] = obj; - - postInsertHook( old == FREE ); - return true; // yes, we added something - } - - - @SuppressWarnings({"SimplifiableIfStatement"}) - public boolean equals( Object other ) { - if ( !( other instanceof Set ) ) { - return false; - } - Set that = (Set) other; - if ( that.size() != this.size() ) { - return false; - } - return containsAll( that ); - } - - - public int hashCode() { - HashProcedure p = new HashProcedure(); - forEach( p ); - return p.getHashCode(); - } - - - private final class HashProcedure implements TObjectProcedure { - - private int h = 0; - - - public int getHashCode() { - return h; - } - - - public final boolean execute( E key ) { - h += HashFunctions.hash( key ); - return true; - } - } - - - /** - * Expands the set to accommodate new values. - * - * @param newCapacity an int value - */ - @SuppressWarnings({"unchecked"}) - protected void rehash( int newCapacity ) { - int oldCapacity = _set.length; - - Object oldSet[] = _set; - - _set = new Object[newCapacity]; - Arrays.fill( _set, FREE ); - - for ( int i = oldCapacity; i-- > 0; ) { - if ( oldSet[i] != FREE && oldSet[i] != REMOVED ) { - E o = (E) oldSet[i]; - int index = insertionIndex( o ); - if ( index < 0 ) { // everyone pays for this because some people can't RTFM - throwObjectContractViolation( _set[( -index - 1 )], o ); - } - _set[index] = o; - } - } - } - - - /** - * Returns a new array containing the objects in the set. - * - * @return an Object[] value - */ - @SuppressWarnings({"unchecked"}) - public Object[] toArray() { - Object[] result = new Object[size()]; - forEach( new ToObjectArrayProceedure( result ) ); - return result; - } - - - /** - * Returns a typed array of the objects in the set. - * - * @param a an Object[] value - * @return an Object[] value - */ - @SuppressWarnings({"unchecked"}) - public T[] toArray( T[] a ) { - int size = size(); - if ( a.length < size ) { - a = (T[]) Array.newInstance( a.getClass().getComponentType(), size ); - } - - forEach( new ToObjectArrayProceedure( a ) ); - - // If this collection fits in the specified array with room to - // spare (i.e., the array has more elements than this - // collection), the element in the array immediately following - // the end of the collection is set to null. This is useful in - // determining the length of this collection only if the - // caller knows that this collection does not contain any null - // elements.) - - if ( a.length > size ) { - a[size] = null; - } - - return a; - } - - - /** Empties the set. */ - public void clear() { - super.clear(); - - Arrays.fill( _set, 0, _set.length, FREE ); - } - - - /** - * Removes obj from the set. - * - * @param obj an Object value - * @return true if the set was modified by the remove operation. - */ - @SuppressWarnings({"unchecked"}) - public boolean remove( Object obj ) { - int index = index( obj ); - if ( index >= 0 ) { - removeAt( index ); - return true; - } - return false; - } - - - /** - * Creates an iterator over the values of the set. The iterator - * supports element deletion. - * - * @return an Iterator value - */ - @SuppressWarnings({"unchecked"}) - public TObjectHashIterator iterator() { - return new TObjectHashIterator( this ); - } - - - /** - * Tests the set to determine if all of the elements in - * collection are present. - * - * @param collection a Collection value - * @return true if all elements were present in the set. - */ - @SuppressWarnings("ForLoopReplaceableByForEach") - public boolean containsAll( Collection collection ) { - for ( Iterator i = collection.iterator(); i.hasNext(); ) { - if ( !contains( i.next() ) ) { - return false; - } - } - return true; - } - - - /** - * Adds all of the elements in collection to the set. - * - * @param collection a Collection value - * @return true if the set was modified by the add all operation. - */ - public boolean addAll( Collection collection ) { - boolean changed = false; - int size = collection.size(); - - ensureCapacity( size ); - Iterator it = collection.iterator(); - while ( size-- > 0 ) { - if ( add( it.next() ) ) { - changed = true; - } - } - return changed; - } - - - /** - * Removes all of the elements in collection from the set. - * - * @param collection a Collection value - * @return true if the set was modified by the remove all operation. - */ - public boolean removeAll( Collection collection ) { - boolean changed = false; - int size = collection.size(); - Iterator it; - - it = collection.iterator(); - while ( size-- > 0 ) { - if ( remove( it.next() ) ) { - changed = true; - } - } - return changed; - } - - - /** - * Removes any values in the set which are not contained in - * collection. - * - * @param collection a Collection value - * @return true if the set was modified by the retain all operation - */ - @SuppressWarnings({"SuspiciousMethodCalls"}) - public boolean retainAll( Collection collection ) { - boolean changed = false; - int size = size(); - Iterator it = iterator(); - while ( size-- > 0 ) { - if ( !collection.contains( it.next() ) ) { - it.remove(); - changed = true; - } - } - return changed; - } - - - public String toString() { - final StringBuilder buf = new StringBuilder( "{" ); - forEach( new TObjectProcedure() { - private boolean first = true; - - - public boolean execute( Object value ) { - if ( first ) { - first = false; - } else { - buf.append( ", " ); - } - - buf.append( value ); - return true; - } - } ); - buf.append( "}" ); - return buf.toString(); - } - - - public void writeExternal( ObjectOutput out ) throws IOException { - // VERSION - out.writeByte( 1 ); - - // NOTE: Super was not written in version 0 - super.writeExternal( out ); - - // NUMBER OF ENTRIES - out.writeInt( _size ); - - // ENTRIES - for ( int i = _set.length; i-- > 0; ) { - if ( _set[i] != REMOVED && _set[i] != FREE ) { - out.writeObject( _set[i] ); - } - } - } - - - @SuppressWarnings({"unchecked"}) - public void readExternal( ObjectInput in ) - throws IOException, ClassNotFoundException { - - // VERSION - byte version = in.readByte(); - - // NOTE: super was not written in version 0 - if ( version != 0 ) { - super.readExternal( in ); - } - - // NUMBER OF ENTRIES - int size = in.readInt(); - setUp( size ); - - // ENTRIES - while ( size-- > 0 ) { - E val = (E) in.readObject(); - add( val ); - } - } -} // THashSet diff --git a/src/gnu/trove/set/hash/TIntHashSet.java b/src/gnu/trove/set/hash/TIntHashSet.java deleted file mode 100644 index 4346b62..0000000 --- a/src/gnu/trove/set/hash/TIntHashSet.java +++ /dev/null @@ -1,551 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.set.hash; - -import gnu.trove.set.TIntSet; -import gnu.trove.iterator.TIntIterator; -import gnu.trove.impl.*; -import gnu.trove.impl.hash.*; -import gnu.trove.TIntCollection; - -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.io.Externalizable; -import java.util.Arrays; -import java.util.Collection; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * An open addressed set implementation for int primitives. - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - */ - -public class TIntHashSet extends TIntHash implements TIntSet, Externalizable { - static final long serialVersionUID = 1L; - - - /** - * Creates a new TIntHashSet instance with the default - * capacity and load factor. - */ - public TIntHashSet() { - super(); - } - - - /** - * Creates a new TIntHashSet instance with a prime - * capacity equal to or greater than initialCapacity and - * with the default load factor. - * - * @param initialCapacity an int value - */ - public TIntHashSet( int initialCapacity ) { - super( initialCapacity ); - } - - - /** - * Creates a new TIntHash instance with a prime - * value at or near the specified capacity and load factor. - * - * @param initialCapacity used to find a prime capacity for the table. - * @param load_factor used to calculate the threshold over which - * rehashing takes place. - */ - public TIntHashSet( int initialCapacity, float load_factor ) { - super( initialCapacity, load_factor ); - } - - - /** - * Creates a new TIntHashSet instance with a prime - * capacity equal to or greater than initial_capacity and - * with the specified load factor. - * - * @param initial_capacity an int value - * @param load_factor a float value - * @param no_entry_value a int value that represents null. - */ - public TIntHashSet( int initial_capacity, float load_factor, - int no_entry_value ) { - super( initial_capacity, load_factor, no_entry_value ); - //noinspection RedundantCast - if ( no_entry_value != ( int ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - - /** - * Creates a new TIntHashSet instance that is a copy - * of the existing Collection. - * - * @param collection a Collection that will be duplicated. - */ - public TIntHashSet( Collection collection ) { - this( Math.max( collection.size(), DEFAULT_CAPACITY ) ); - addAll( collection ); - } - - - /** - * Creates a new TIntHashSet instance that is a copy - * of the existing set. - * - * @param collection a TIntSet that will be duplicated. - */ - public TIntHashSet( TIntCollection collection ) { - this( Math.max( collection.size(), DEFAULT_CAPACITY ) ); - if ( collection instanceof TIntHashSet ) { - TIntHashSet hashset = ( TIntHashSet ) collection; - this._loadFactor = hashset._loadFactor; - this.no_entry_value = hashset.no_entry_value; - //noinspection RedundantCast - if ( this.no_entry_value != ( int ) 0 ) { - Arrays.fill( _set, this.no_entry_value ); - } - setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) ); - } - addAll( collection ); - } - - - /** - * Creates a new TIntHashSet instance containing the - * elements of array. - * - * @param array an array of int primitives - */ - public TIntHashSet( int[] array ) { - this( Math.max( array.length, DEFAULT_CAPACITY ) ); - addAll( array ); - } - - - /** {@inheritDoc} */ - public TIntIterator iterator() { - return new TIntHashIterator( this ); - } - - - /** {@inheritDoc} */ - public int[] toArray() { - int[] result = new int[ size() ]; - int[] set = _set; - byte[] states = _states; - - for ( int i = states.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - result[j++] = set[i]; - } - } - return result; - } - - - /** {@inheritDoc} */ - public int[] toArray( int[] dest ) { - int[] set = _set; - byte[] states = _states; - - for ( int i = states.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - dest[j++] = set[i]; - } - } - - if ( dest.length > _size ) { - dest[_size] = no_entry_value; - } - return dest; - } - - - /** {@inheritDoc} */ - public boolean add( int val ) { - int index = insertionIndex(val); - - if ( index < 0 ) { - return false; // already present in set, nothing to add - } - - byte previousState = _states[index]; - _set[index] = val; - _states[index] = FULL; - postInsertHook( previousState == FREE ); - - return true; // yes, we added something - } - - - /** {@inheritDoc} */ - public boolean remove( int val ) { - int index = index(val); - if ( index >= 0 ) { - removeAt( index ); - return true; - } - return false; - } - - - /** {@inheritDoc} */ - public boolean containsAll( Collection collection ) { - for ( Object element : collection ) { - if ( element instanceof Integer ) { - int c = ( ( Integer ) element ).intValue(); - if ( ! contains( c ) ) { - return false; - } - } else { - return false; - } - - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( TIntCollection collection ) { - TIntIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - int element = iter.next(); - if ( ! contains( element ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( int[] array ) { - for ( int i = array.length; i-- > 0; ) { - if ( ! contains( array[i] ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean addAll( Collection collection ) { - boolean changed = false; - for ( Integer element : collection ) { - int e = element.intValue(); - if ( add( e ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean addAll( TIntCollection collection ) { - boolean changed = false; - TIntIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - int element = iter.next(); - if ( add( element ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean addAll( int[] array ) { - boolean changed = false; - for ( int i = array.length; i-- > 0; ) { - if ( add( array[i] ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - @SuppressWarnings({"SuspiciousMethodCalls"}) - public boolean retainAll( Collection collection ) { - boolean modified = false; - TIntIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( Integer.valueOf ( iter.next() ) ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( TIntCollection collection ) { - if ( this == collection ) { - return false; - } - boolean modified = false; - TIntIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( iter.next() ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( int[] array ) { - boolean changed = false; - Arrays.sort( array ); - int[] set = _set; - byte[] states = _states; - - for ( int i = set.length; i-- > 0; ) { - if ( states[i] == FULL && ( Arrays.binarySearch( array, set[i] ) < 0) ) { - removeAt( i ); - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( Collection collection ) { - boolean changed = false; - for ( Object element : collection ) { - if ( element instanceof Integer ) { - int c = ( ( Integer ) element ).intValue(); - if ( remove( c ) ) { - changed = true; - } - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( TIntCollection collection ) { - boolean changed = false; - TIntIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - int element = iter.next(); - if ( remove( element ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( int[] array ) { - boolean changed = false; - for ( int i = array.length; i-- > 0; ) { - if ( remove(array[i]) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public void clear() { - super.clear(); - int[] set = _set; - byte[] states = _states; - - for ( int i = set.length; i-- > 0; ) { - set[i] = no_entry_value; - states[i] = FREE; - } - } - - - /** {@inheritDoc} */ - protected void rehash( int newCapacity ) { - int oldCapacity = _set.length; - - int oldSet[] = _set; - byte oldStates[] = _states; - - _set = new int[newCapacity]; - _states = new byte[newCapacity]; - - for ( int i = oldCapacity; i-- > 0; ) { - if( oldStates[i] == FULL ) { - int o = oldSet[i]; - int index = insertionIndex(o); - _set[index] = o; - _states[index] = FULL; - } - } - } - - - /** {@inheritDoc} */ - public boolean equals( Object other ) { - if ( ! ( other instanceof TIntSet ) ) { - return false; - } - TIntSet that = ( TIntSet ) other; - if ( that.size() != this.size() ) { - return false; - } - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - if ( ! that.contains( _set[i] ) ) { - return false; - } - } - } - return true; - } - - - /** {@inheritDoc} */ - public int hashCode() { - int hashcode = 0; - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - hashcode += HashFunctions.hash( _set[i] ); - } - } - return hashcode; - } - - - /** {@inheritDoc} */ - public String toString() { - StringBuilder buffy = new StringBuilder( _size * 2 + 2 ); - buffy.append("{"); - for ( int i = _states.length, j = 1; i-- > 0; ) { - if ( _states[i] == FULL ) { - buffy.append( _set[i] ); - if ( j++ < _size ) { - buffy.append( "," ); - } - } - } - buffy.append("}"); - return buffy.toString(); - } - - - class TIntHashIterator extends THashPrimitiveIterator implements TIntIterator { - - /** the collection on which the iterator operates */ - private final TIntHash _hash; - - /** {@inheritDoc} */ - public TIntHashIterator( TIntHash hash ) { - super( hash ); - this._hash = hash; - } - - /** {@inheritDoc} */ - public int next() { - moveToNextIndex(); - return _hash._set[_index]; - } - } - - - /** {@inheritDoc} */ - public void writeExternal( ObjectOutput out ) throws IOException { - - // VERSION - out.writeByte( 1 ); - - // SUPER - super.writeExternal( out ); - - // NUMBER OF ENTRIES - out.writeInt( _size ); - - // LOAD FACTOR -- Added version 1 - out.writeFloat( _loadFactor ); - - // NO ENTRY VALUE -- Added version 1 - out.writeInt( no_entry_value ); - - // ENTRIES - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - out.writeInt( _set[i] ); - } - } - } - - - /** {@inheritDoc} */ - public void readExternal( ObjectInput in ) - throws IOException, ClassNotFoundException { - - // VERSION - int version = in.readByte(); - - // SUPER - super.readExternal( in ); - - // NUMBER OF ENTRIES - int size = in.readInt(); - - if ( version >= 1 ) { - // LOAD FACTOR - _loadFactor = in.readFloat(); - - // NO ENTRY VALUE - no_entry_value = in.readInt(); - //noinspection RedundantCast - if ( no_entry_value != ( int ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - // ENTRIES - setUp( size ); - while ( size-- > 0 ) { - int val = in.readInt(); - add( val ); - } - } -} // TIntHashSet diff --git a/src/gnu/trove/set/hash/TLongHashSet.java b/src/gnu/trove/set/hash/TLongHashSet.java deleted file mode 100644 index ea5d953..0000000 --- a/src/gnu/trove/set/hash/TLongHashSet.java +++ /dev/null @@ -1,551 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2001, Eric D. Friedman All Rights Reserved. -// Copyright (c) 2009, Rob Eden All Rights Reserved. -// Copyright (c) 2009, Jeff Randall All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.set.hash; - -import gnu.trove.set.TLongSet; -import gnu.trove.iterator.TLongIterator; -import gnu.trove.impl.*; -import gnu.trove.impl.hash.*; -import gnu.trove.TLongCollection; - -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.io.Externalizable; -import java.util.Arrays; -import java.util.Collection; - - -////////////////////////////////////////////////// -// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! // -////////////////////////////////////////////////// - - -/** - * An open addressed set implementation for long primitives. - * - * @author Eric D. Friedman - * @author Rob Eden - * @author Jeff Randall - */ - -public class TLongHashSet extends TLongHash implements TLongSet, Externalizable { - static final long serialVersionUID = 1L; - - - /** - * Creates a new TLongHashSet instance with the default - * capacity and load factor. - */ - public TLongHashSet() { - super(); - } - - - /** - * Creates a new TLongHashSet instance with a prime - * capacity equal to or greater than initialCapacity and - * with the default load factor. - * - * @param initialCapacity an int value - */ - public TLongHashSet( int initialCapacity ) { - super( initialCapacity ); - } - - - /** - * Creates a new TIntHash instance with a prime - * value at or near the specified capacity and load factor. - * - * @param initialCapacity used to find a prime capacity for the table. - * @param load_factor used to calculate the threshold over which - * rehashing takes place. - */ - public TLongHashSet( int initialCapacity, float load_factor ) { - super( initialCapacity, load_factor ); - } - - - /** - * Creates a new TLongHashSet instance with a prime - * capacity equal to or greater than initial_capacity and - * with the specified load factor. - * - * @param initial_capacity an int value - * @param load_factor a float value - * @param no_entry_value a long value that represents null. - */ - public TLongHashSet( int initial_capacity, float load_factor, - long no_entry_value ) { - super( initial_capacity, load_factor, no_entry_value ); - //noinspection RedundantCast - if ( no_entry_value != ( long ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - - /** - * Creates a new TLongHashSet instance that is a copy - * of the existing Collection. - * - * @param collection a Collection that will be duplicated. - */ - public TLongHashSet( Collection collection ) { - this( Math.max( collection.size(), DEFAULT_CAPACITY ) ); - addAll( collection ); - } - - - /** - * Creates a new TLongHashSet instance that is a copy - * of the existing set. - * - * @param collection a TLongSet that will be duplicated. - */ - public TLongHashSet( TLongCollection collection ) { - this( Math.max( collection.size(), DEFAULT_CAPACITY ) ); - if ( collection instanceof TLongHashSet ) { - TLongHashSet hashset = ( TLongHashSet ) collection; - this._loadFactor = hashset._loadFactor; - this.no_entry_value = hashset.no_entry_value; - //noinspection RedundantCast - if ( this.no_entry_value != ( long ) 0 ) { - Arrays.fill( _set, this.no_entry_value ); - } - setUp( (int) Math.ceil( DEFAULT_CAPACITY / _loadFactor ) ); - } - addAll( collection ); - } - - - /** - * Creates a new TLongHashSet instance containing the - * elements of array. - * - * @param array an array of long primitives - */ - public TLongHashSet( long[] array ) { - this( Math.max( array.length, DEFAULT_CAPACITY ) ); - addAll( array ); - } - - - /** {@inheritDoc} */ - public TLongIterator iterator() { - return new TLongHashIterator( this ); - } - - - /** {@inheritDoc} */ - public long[] toArray() { - long[] result = new long[ size() ]; - long[] set = _set; - byte[] states = _states; - - for ( int i = states.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - result[j++] = set[i]; - } - } - return result; - } - - - /** {@inheritDoc} */ - public long[] toArray( long[] dest ) { - long[] set = _set; - byte[] states = _states; - - for ( int i = states.length, j = 0; i-- > 0; ) { - if ( states[i] == FULL ) { - dest[j++] = set[i]; - } - } - - if ( dest.length > _size ) { - dest[_size] = no_entry_value; - } - return dest; - } - - - /** {@inheritDoc} */ - public boolean add( long val ) { - int index = insertionIndex(val); - - if ( index < 0 ) { - return false; // already present in set, nothing to add - } - - byte previousState = _states[index]; - _set[index] = val; - _states[index] = FULL; - postInsertHook( previousState == FREE ); - - return true; // yes, we added something - } - - - /** {@inheritDoc} */ - public boolean remove( long val ) { - int index = index(val); - if ( index >= 0 ) { - removeAt( index ); - return true; - } - return false; - } - - - /** {@inheritDoc} */ - public boolean containsAll( Collection collection ) { - for ( Object element : collection ) { - if ( element instanceof Long ) { - long c = ( ( Long ) element ).longValue(); - if ( ! contains( c ) ) { - return false; - } - } else { - return false; - } - - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( TLongCollection collection ) { - TLongIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - long element = iter.next(); - if ( ! contains( element ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean containsAll( long[] array ) { - for ( int i = array.length; i-- > 0; ) { - if ( ! contains( array[i] ) ) { - return false; - } - } - return true; - } - - - /** {@inheritDoc} */ - public boolean addAll( Collection collection ) { - boolean changed = false; - for ( Long element : collection ) { - long e = element.longValue(); - if ( add( e ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean addAll( TLongCollection collection ) { - boolean changed = false; - TLongIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - long element = iter.next(); - if ( add( element ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean addAll( long[] array ) { - boolean changed = false; - for ( int i = array.length; i-- > 0; ) { - if ( add( array[i] ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - @SuppressWarnings({"SuspiciousMethodCalls"}) - public boolean retainAll( Collection collection ) { - boolean modified = false; - TLongIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( Long.valueOf ( iter.next() ) ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( TLongCollection collection ) { - if ( this == collection ) { - return false; - } - boolean modified = false; - TLongIterator iter = iterator(); - while ( iter.hasNext() ) { - if ( ! collection.contains( iter.next() ) ) { - iter.remove(); - modified = true; - } - } - return modified; - } - - - /** {@inheritDoc} */ - public boolean retainAll( long[] array ) { - boolean changed = false; - Arrays.sort( array ); - long[] set = _set; - byte[] states = _states; - - for ( int i = set.length; i-- > 0; ) { - if ( states[i] == FULL && ( Arrays.binarySearch( array, set[i] ) < 0) ) { - removeAt( i ); - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( Collection collection ) { - boolean changed = false; - for ( Object element : collection ) { - if ( element instanceof Long ) { - long c = ( ( Long ) element ).longValue(); - if ( remove( c ) ) { - changed = true; - } - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( TLongCollection collection ) { - boolean changed = false; - TLongIterator iter = collection.iterator(); - while ( iter.hasNext() ) { - long element = iter.next(); - if ( remove( element ) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public boolean removeAll( long[] array ) { - boolean changed = false; - for ( int i = array.length; i-- > 0; ) { - if ( remove(array[i]) ) { - changed = true; - } - } - return changed; - } - - - /** {@inheritDoc} */ - public void clear() { - super.clear(); - long[] set = _set; - byte[] states = _states; - - for ( int i = set.length; i-- > 0; ) { - set[i] = no_entry_value; - states[i] = FREE; - } - } - - - /** {@inheritDoc} */ - protected void rehash( int newCapacity ) { - int oldCapacity = _set.length; - - long oldSet[] = _set; - byte oldStates[] = _states; - - _set = new long[newCapacity]; - _states = new byte[newCapacity]; - - for ( int i = oldCapacity; i-- > 0; ) { - if( oldStates[i] == FULL ) { - long o = oldSet[i]; - int index = insertionIndex(o); - _set[index] = o; - _states[index] = FULL; - } - } - } - - - /** {@inheritDoc} */ - public boolean equals( Object other ) { - if ( ! ( other instanceof TLongSet ) ) { - return false; - } - TLongSet that = ( TLongSet ) other; - if ( that.size() != this.size() ) { - return false; - } - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - if ( ! that.contains( _set[i] ) ) { - return false; - } - } - } - return true; - } - - - /** {@inheritDoc} */ - public int hashCode() { - int hashcode = 0; - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - hashcode += HashFunctions.hash( _set[i] ); - } - } - return hashcode; - } - - - /** {@inheritDoc} */ - public String toString() { - StringBuilder buffy = new StringBuilder( _size * 2 + 2 ); - buffy.append("{"); - for ( int i = _states.length, j = 1; i-- > 0; ) { - if ( _states[i] == FULL ) { - buffy.append( _set[i] ); - if ( j++ < _size ) { - buffy.append( "," ); - } - } - } - buffy.append("}"); - return buffy.toString(); - } - - - class TLongHashIterator extends THashPrimitiveIterator implements TLongIterator { - - /** the collection on which the iterator operates */ - private final TLongHash _hash; - - /** {@inheritDoc} */ - public TLongHashIterator( TLongHash hash ) { - super( hash ); - this._hash = hash; - } - - /** {@inheritDoc} */ - public long next() { - moveToNextIndex(); - return _hash._set[_index]; - } - } - - - /** {@inheritDoc} */ - public void writeExternal( ObjectOutput out ) throws IOException { - - // VERSION - out.writeByte( 1 ); - - // SUPER - super.writeExternal( out ); - - // NUMBER OF ENTRIES - out.writeInt( _size ); - - // LOAD FACTOR -- Added version 1 - out.writeFloat( _loadFactor ); - - // NO ENTRY VALUE -- Added version 1 - out.writeLong( no_entry_value ); - - // ENTRIES - for ( int i = _states.length; i-- > 0; ) { - if ( _states[i] == FULL ) { - out.writeLong( _set[i] ); - } - } - } - - - /** {@inheritDoc} */ - public void readExternal( ObjectInput in ) - throws IOException, ClassNotFoundException { - - // VERSION - int version = in.readByte(); - - // SUPER - super.readExternal( in ); - - // NUMBER OF ENTRIES - int size = in.readInt(); - - if ( version >= 1 ) { - // LOAD FACTOR - _loadFactor = in.readFloat(); - - // NO ENTRY VALUE - no_entry_value = in.readLong(); - //noinspection RedundantCast - if ( no_entry_value != ( long ) 0 ) { - Arrays.fill( _set, no_entry_value ); - } - } - - // ENTRIES - setUp( size ); - while ( size-- > 0 ) { - long val = in.readLong(); - add( val ); - } - } -} // TIntHashSet diff --git a/src/gnu/trove/strategy/HashingStrategy.java b/src/gnu/trove/strategy/HashingStrategy.java deleted file mode 100644 index aa0f2f7..0000000 --- a/src/gnu/trove/strategy/HashingStrategy.java +++ /dev/null @@ -1,55 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2002, Eric D. Friedman All Rights Reserved. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -/////////////////////////////////////////////////////////////////////////////// - -package gnu.trove.strategy; - -import java.io.Serializable; - - -/** - * Interface to support pluggable hashing strategies in maps and sets. - * Implementers can use this interface to make the trove hashing - * algorithms use object values, values provided by the java runtime, - * or a custom strategy when computing hashcodes. - * - * @author Eric Friedman - * @author Rob Eden - */ - -public interface HashingStrategy extends Serializable { - /** - * Computes a hash code for the specified object. Implementers - * can use the object's own hashCode method, the Java - * runtime's identityHashCode, or a custom scheme. - * - * @param object for which the hashcode is to be computed - * @return the hashCode - */ - int computeHashCode( T object ); - - /** - * Compares o1 and o2 for equality. Strategy implementers may use - * the objects' own equals() methods, compare object references, - * or implement some custom scheme. - * - * @param o1 an Object value - * @param o2 an Object value - * @return true if the objects are equal according to this strategy. - */ - boolean equals( T o1, T o2 ); -} diff --git a/src/gnu/trove/strategy/IdentityHashingStrategy.java b/src/gnu/trove/strategy/IdentityHashingStrategy.java deleted file mode 100644 index b61118d..0000000 --- a/src/gnu/trove/strategy/IdentityHashingStrategy.java +++ /dev/null @@ -1,15 +0,0 @@ -package gnu.trove.strategy; - -/** - * A {@link gnu.trove.strategy.HashingStrategy} that does identity comparisons - * (==) and uses {@link System#identityHashCode(Object)} for hashCode generation. - */ -public class IdentityHashingStrategy implements HashingStrategy { - public int computeHashCode( K object ) { - return System.identityHashCode( object ); - } - - public boolean equals( K o1, K o2 ) { - return o1 == o2; - } -} diff --git a/src/be/abeel/jargs/AutoHelpCmdLineParser.java b/src/main/java/be/abeel/jargs/AutoHelpCmdLineParser.java similarity index 100% rename from src/be/abeel/jargs/AutoHelpCmdLineParser.java rename to src/main/java/be/abeel/jargs/AutoHelpCmdLineParser.java diff --git a/src/com/eaio/stringsearch/BNDM.java b/src/main/java/com/eaio/stringsearch/BNDM.java similarity index 100% rename from src/com/eaio/stringsearch/BNDM.java rename to src/main/java/com/eaio/stringsearch/BNDM.java diff --git a/src/com/eaio/stringsearch/BNDMWildcards.java b/src/main/java/com/eaio/stringsearch/BNDMWildcards.java similarity index 100% rename from src/com/eaio/stringsearch/BNDMWildcards.java rename to src/main/java/com/eaio/stringsearch/BNDMWildcards.java diff --git a/src/com/eaio/stringsearch/BoyerMooreHorspool.java b/src/main/java/com/eaio/stringsearch/BoyerMooreHorspool.java similarity index 100% rename from src/com/eaio/stringsearch/BoyerMooreHorspool.java rename to src/main/java/com/eaio/stringsearch/BoyerMooreHorspool.java diff --git a/src/com/eaio/stringsearch/BoyerMooreHorspoolRaita.java b/src/main/java/com/eaio/stringsearch/BoyerMooreHorspoolRaita.java similarity index 100% rename from src/com/eaio/stringsearch/BoyerMooreHorspoolRaita.java rename to src/main/java/com/eaio/stringsearch/BoyerMooreHorspoolRaita.java diff --git a/src/com/eaio/stringsearch/BoyerMooreSunday.java b/src/main/java/com/eaio/stringsearch/BoyerMooreSunday.java similarity index 100% rename from src/com/eaio/stringsearch/BoyerMooreSunday.java rename to src/main/java/com/eaio/stringsearch/BoyerMooreSunday.java diff --git a/src/com/eaio/stringsearch/CharIntMap.java b/src/main/java/com/eaio/stringsearch/CharIntMap.java similarity index 100% rename from src/com/eaio/stringsearch/CharIntMap.java rename to src/main/java/com/eaio/stringsearch/CharIntMap.java diff --git a/src/com/eaio/stringsearch/MismatchSearch.java b/src/main/java/com/eaio/stringsearch/MismatchSearch.java similarity index 100% rename from src/com/eaio/stringsearch/MismatchSearch.java rename to src/main/java/com/eaio/stringsearch/MismatchSearch.java diff --git a/src/com/eaio/stringsearch/ShiftOr.java b/src/main/java/com/eaio/stringsearch/ShiftOr.java similarity index 100% rename from src/com/eaio/stringsearch/ShiftOr.java rename to src/main/java/com/eaio/stringsearch/ShiftOr.java diff --git a/src/com/eaio/stringsearch/ShiftOrClasses.java b/src/main/java/com/eaio/stringsearch/ShiftOrClasses.java similarity index 100% rename from src/com/eaio/stringsearch/ShiftOrClasses.java rename to src/main/java/com/eaio/stringsearch/ShiftOrClasses.java diff --git a/src/com/eaio/stringsearch/ShiftOrMismatches.java b/src/main/java/com/eaio/stringsearch/ShiftOrMismatches.java similarity index 100% rename from src/com/eaio/stringsearch/ShiftOrMismatches.java rename to src/main/java/com/eaio/stringsearch/ShiftOrMismatches.java diff --git a/src/com/eaio/stringsearch/ShiftOrWildcards.java b/src/main/java/com/eaio/stringsearch/ShiftOrWildcards.java similarity index 100% rename from src/com/eaio/stringsearch/ShiftOrWildcards.java rename to src/main/java/com/eaio/stringsearch/ShiftOrWildcards.java diff --git a/src/com/eaio/stringsearch/StringSearch.java b/src/main/java/com/eaio/stringsearch/StringSearch.java similarity index 100% rename from src/com/eaio/stringsearch/StringSearch.java rename to src/main/java/com/eaio/stringsearch/StringSearch.java diff --git a/src/com/eaio/stringsearch/package.html b/src/main/java/com/eaio/stringsearch/package.html similarity index 100% rename from src/com/eaio/stringsearch/package.html rename to src/main/java/com/eaio/stringsearch/package.html diff --git a/src/net/miginfocom/layout/AC.java b/src/main/java/net/miginfocom/layout/AC.java similarity index 100% rename from src/net/miginfocom/layout/AC.java rename to src/main/java/net/miginfocom/layout/AC.java diff --git a/src/net/miginfocom/layout/BoundSize.java b/src/main/java/net/miginfocom/layout/BoundSize.java similarity index 100% rename from src/net/miginfocom/layout/BoundSize.java rename to src/main/java/net/miginfocom/layout/BoundSize.java diff --git a/src/net/miginfocom/layout/CC.java b/src/main/java/net/miginfocom/layout/CC.java similarity index 100% rename from src/net/miginfocom/layout/CC.java rename to src/main/java/net/miginfocom/layout/CC.java diff --git a/src/net/miginfocom/layout/ComponentWrapper.java b/src/main/java/net/miginfocom/layout/ComponentWrapper.java similarity index 100% rename from src/net/miginfocom/layout/ComponentWrapper.java rename to src/main/java/net/miginfocom/layout/ComponentWrapper.java diff --git a/src/net/miginfocom/layout/ConstraintParser.java b/src/main/java/net/miginfocom/layout/ConstraintParser.java similarity index 100% rename from src/net/miginfocom/layout/ConstraintParser.java rename to src/main/java/net/miginfocom/layout/ConstraintParser.java diff --git a/src/net/miginfocom/layout/ContainerWrapper.java b/src/main/java/net/miginfocom/layout/ContainerWrapper.java similarity index 100% rename from src/net/miginfocom/layout/ContainerWrapper.java rename to src/main/java/net/miginfocom/layout/ContainerWrapper.java diff --git a/src/net/miginfocom/layout/DimConstraint.java b/src/main/java/net/miginfocom/layout/DimConstraint.java similarity index 100% rename from src/net/miginfocom/layout/DimConstraint.java rename to src/main/java/net/miginfocom/layout/DimConstraint.java diff --git a/src/net/miginfocom/layout/Grid.java b/src/main/java/net/miginfocom/layout/Grid.java similarity index 100% rename from src/net/miginfocom/layout/Grid.java rename to src/main/java/net/miginfocom/layout/Grid.java diff --git a/src/net/miginfocom/layout/IDEUtil.java b/src/main/java/net/miginfocom/layout/IDEUtil.java similarity index 100% rename from src/net/miginfocom/layout/IDEUtil.java rename to src/main/java/net/miginfocom/layout/IDEUtil.java diff --git a/src/net/miginfocom/layout/InCellGapProvider.java b/src/main/java/net/miginfocom/layout/InCellGapProvider.java similarity index 100% rename from src/net/miginfocom/layout/InCellGapProvider.java rename to src/main/java/net/miginfocom/layout/InCellGapProvider.java diff --git a/src/net/miginfocom/layout/LC.java b/src/main/java/net/miginfocom/layout/LC.java similarity index 100% rename from src/net/miginfocom/layout/LC.java rename to src/main/java/net/miginfocom/layout/LC.java diff --git a/src/net/miginfocom/layout/LayoutCallback.java b/src/main/java/net/miginfocom/layout/LayoutCallback.java similarity index 100% rename from src/net/miginfocom/layout/LayoutCallback.java rename to src/main/java/net/miginfocom/layout/LayoutCallback.java diff --git a/src/net/miginfocom/layout/LayoutUtil.java b/src/main/java/net/miginfocom/layout/LayoutUtil.java similarity index 100% rename from src/net/miginfocom/layout/LayoutUtil.java rename to src/main/java/net/miginfocom/layout/LayoutUtil.java diff --git a/src/net/miginfocom/layout/LinkHandler.java b/src/main/java/net/miginfocom/layout/LinkHandler.java similarity index 100% rename from src/net/miginfocom/layout/LinkHandler.java rename to src/main/java/net/miginfocom/layout/LinkHandler.java diff --git a/src/net/miginfocom/layout/PlatformDefaults.java b/src/main/java/net/miginfocom/layout/PlatformDefaults.java similarity index 100% rename from src/net/miginfocom/layout/PlatformDefaults.java rename to src/main/java/net/miginfocom/layout/PlatformDefaults.java diff --git a/src/net/miginfocom/layout/ResizeConstraint.java b/src/main/java/net/miginfocom/layout/ResizeConstraint.java similarity index 100% rename from src/net/miginfocom/layout/ResizeConstraint.java rename to src/main/java/net/miginfocom/layout/ResizeConstraint.java diff --git a/src/net/miginfocom/layout/UnitConverter.java b/src/main/java/net/miginfocom/layout/UnitConverter.java similarity index 100% rename from src/net/miginfocom/layout/UnitConverter.java rename to src/main/java/net/miginfocom/layout/UnitConverter.java diff --git a/src/net/miginfocom/layout/UnitValue.java b/src/main/java/net/miginfocom/layout/UnitValue.java similarity index 100% rename from src/net/miginfocom/layout/UnitValue.java rename to src/main/java/net/miginfocom/layout/UnitValue.java diff --git a/src/net/miginfocom/swing/MigLayout.java b/src/main/java/net/miginfocom/swing/MigLayout.java similarity index 100% rename from src/net/miginfocom/swing/MigLayout.java rename to src/main/java/net/miginfocom/swing/MigLayout.java diff --git a/src/net/miginfocom/swing/SwingComponentWrapper.java b/src/main/java/net/miginfocom/swing/SwingComponentWrapper.java similarity index 100% rename from src/net/miginfocom/swing/SwingComponentWrapper.java rename to src/main/java/net/miginfocom/swing/SwingComponentWrapper.java diff --git a/src/net/miginfocom/swing/SwingContainerWrapper.java b/src/main/java/net/miginfocom/swing/SwingContainerWrapper.java similarity index 100% rename from src/net/miginfocom/swing/SwingContainerWrapper.java rename to src/main/java/net/miginfocom/swing/SwingContainerWrapper.java diff --git a/src/net/sf/genomeview/BufferSeq.java b/src/main/java/net/sf/genomeview/BufferSeq.java similarity index 100% rename from src/net/sf/genomeview/BufferSeq.java rename to src/main/java/net/sf/genomeview/BufferSeq.java diff --git a/devtools/ascomponent/GenomeViewAsComponent.java b/src/main/java/net/sf/genomeview/ascomponent/GenomeViewAsComponent.java similarity index 97% rename from devtools/ascomponent/GenomeViewAsComponent.java rename to src/main/java/net/sf/genomeview/ascomponent/GenomeViewAsComponent.java index c03cc4b..c6fad50 100644 --- a/devtools/ascomponent/GenomeViewAsComponent.java +++ b/src/main/java/net/sf/genomeview/ascomponent/GenomeViewAsComponent.java @@ -1,4 +1,4 @@ -package devtools.ascomponent; +package net.sf.genomeview.ascomponent; import java.io.IOException; import java.net.MalformedURLException; diff --git a/src/net/sf/genomeview/core/AnalyzedFeature.java b/src/main/java/net/sf/genomeview/core/AnalyzedFeature.java similarity index 100% rename from src/net/sf/genomeview/core/AnalyzedFeature.java rename to src/main/java/net/sf/genomeview/core/AnalyzedFeature.java diff --git a/src/net/sf/genomeview/core/BiMap.java b/src/main/java/net/sf/genomeview/core/BiMap.java similarity index 100% rename from src/net/sf/genomeview/core/BiMap.java rename to src/main/java/net/sf/genomeview/core/BiMap.java diff --git a/src/net/sf/genomeview/core/ColorGradient.java b/src/main/java/net/sf/genomeview/core/ColorGradient.java similarity index 100% rename from src/net/sf/genomeview/core/ColorGradient.java rename to src/main/java/net/sf/genomeview/core/ColorGradient.java diff --git a/src/net/sf/genomeview/core/ColorIcon.java b/src/main/java/net/sf/genomeview/core/ColorIcon.java similarity index 100% rename from src/net/sf/genomeview/core/ColorIcon.java rename to src/main/java/net/sf/genomeview/core/ColorIcon.java diff --git a/src/net/sf/genomeview/core/Colors.java b/src/main/java/net/sf/genomeview/core/Colors.java similarity index 100% rename from src/net/sf/genomeview/core/Colors.java rename to src/main/java/net/sf/genomeview/core/Colors.java diff --git a/src/net/sf/genomeview/core/Configuration.java b/src/main/java/net/sf/genomeview/core/Configuration.java similarity index 100% rename from src/net/sf/genomeview/core/Configuration.java rename to src/main/java/net/sf/genomeview/core/Configuration.java diff --git a/src/net/sf/genomeview/core/Dbxref.java b/src/main/java/net/sf/genomeview/core/Dbxref.java similarity index 100% rename from src/net/sf/genomeview/core/Dbxref.java rename to src/main/java/net/sf/genomeview/core/Dbxref.java diff --git a/src/net/sf/genomeview/core/DisplayType.java b/src/main/java/net/sf/genomeview/core/DisplayType.java similarity index 100% rename from src/net/sf/genomeview/core/DisplayType.java rename to src/main/java/net/sf/genomeview/core/DisplayType.java diff --git a/src/net/sf/genomeview/core/Icons.java b/src/main/java/net/sf/genomeview/core/Icons.java similarity index 100% rename from src/net/sf/genomeview/core/Icons.java rename to src/main/java/net/sf/genomeview/core/Icons.java diff --git a/src/net/sf/genomeview/core/LRUSet.java b/src/main/java/net/sf/genomeview/core/LRUSet.java similarity index 100% rename from src/net/sf/genomeview/core/LRUSet.java rename to src/main/java/net/sf/genomeview/core/LRUSet.java diff --git a/src/net/sf/genomeview/core/NoFailIterable.java b/src/main/java/net/sf/genomeview/core/NoFailIterable.java similarity index 100% rename from src/net/sf/genomeview/core/NoFailIterable.java rename to src/main/java/net/sf/genomeview/core/NoFailIterable.java diff --git a/src/net/sf/genomeview/data/AnnotationModel.java b/src/main/java/net/sf/genomeview/data/AnnotationModel.java similarity index 100% rename from src/net/sf/genomeview/data/AnnotationModel.java rename to src/main/java/net/sf/genomeview/data/AnnotationModel.java diff --git a/src/net/sf/genomeview/data/Blast.java b/src/main/java/net/sf/genomeview/data/Blast.java similarity index 100% rename from src/net/sf/genomeview/data/Blast.java rename to src/main/java/net/sf/genomeview/data/Blast.java diff --git a/src/net/sf/genomeview/data/ClientHttpRequest.java b/src/main/java/net/sf/genomeview/data/ClientHttpRequest.java similarity index 100% rename from src/net/sf/genomeview/data/ClientHttpRequest.java rename to src/main/java/net/sf/genomeview/data/ClientHttpRequest.java diff --git a/src/net/sf/genomeview/data/ClientHttpUpload.java b/src/main/java/net/sf/genomeview/data/ClientHttpUpload.java similarity index 100% rename from src/net/sf/genomeview/data/ClientHttpUpload.java rename to src/main/java/net/sf/genomeview/data/ClientHttpUpload.java diff --git a/src/net/sf/genomeview/data/ConvertWig2TDF.java b/src/main/java/net/sf/genomeview/data/ConvertWig2TDF.java similarity index 100% rename from src/net/sf/genomeview/data/ConvertWig2TDF.java rename to src/main/java/net/sf/genomeview/data/ConvertWig2TDF.java diff --git a/src/net/sf/genomeview/data/DataSourceHelper.java b/src/main/java/net/sf/genomeview/data/DataSourceHelper.java similarity index 100% rename from src/net/sf/genomeview/data/DataSourceHelper.java rename to src/main/java/net/sf/genomeview/data/DataSourceHelper.java diff --git a/src/net/sf/genomeview/data/DataSourceWorker.java b/src/main/java/net/sf/genomeview/data/DataSourceWorker.java similarity index 100% rename from src/net/sf/genomeview/data/DataSourceWorker.java rename to src/main/java/net/sf/genomeview/data/DataSourceWorker.java diff --git a/src/net/sf/genomeview/data/DummyEntry.java b/src/main/java/net/sf/genomeview/data/DummyEntry.java similarity index 100% rename from src/net/sf/genomeview/data/DummyEntry.java rename to src/main/java/net/sf/genomeview/data/DummyEntry.java diff --git a/src/net/sf/genomeview/data/GenomeViewScheduler.java b/src/main/java/net/sf/genomeview/data/GenomeViewScheduler.java similarity index 100% rename from src/net/sf/genomeview/data/GenomeViewScheduler.java rename to src/main/java/net/sf/genomeview/data/GenomeViewScheduler.java diff --git a/src/net/sf/genomeview/data/LocationTools.java b/src/main/java/net/sf/genomeview/data/LocationTools.java similarity index 100% rename from src/net/sf/genomeview/data/LocationTools.java rename to src/main/java/net/sf/genomeview/data/LocationTools.java diff --git a/src/net/sf/genomeview/data/MessageModel.java b/src/main/java/net/sf/genomeview/data/MessageModel.java similarity index 100% rename from src/net/sf/genomeview/data/MessageModel.java rename to src/main/java/net/sf/genomeview/data/MessageModel.java diff --git a/src/net/sf/genomeview/data/Model.java b/src/main/java/net/sf/genomeview/data/Model.java similarity index 100% rename from src/net/sf/genomeview/data/Model.java rename to src/main/java/net/sf/genomeview/data/Model.java diff --git a/src/net/sf/genomeview/data/MouseModel.java b/src/main/java/net/sf/genomeview/data/MouseModel.java similarity index 100% rename from src/net/sf/genomeview/data/MouseModel.java rename to src/main/java/net/sf/genomeview/data/MouseModel.java diff --git a/src/net/sf/genomeview/data/NotificationTypes.java b/src/main/java/net/sf/genomeview/data/NotificationTypes.java similarity index 100% rename from src/net/sf/genomeview/data/NotificationTypes.java rename to src/main/java/net/sf/genomeview/data/NotificationTypes.java diff --git a/src/net/sf/genomeview/data/ReadWorker.java b/src/main/java/net/sf/genomeview/data/ReadWorker.java similarity index 100% rename from src/net/sf/genomeview/data/ReadWorker.java rename to src/main/java/net/sf/genomeview/data/ReadWorker.java diff --git a/src/net/sf/genomeview/data/SeekableProgressStream.java b/src/main/java/net/sf/genomeview/data/SeekableProgressStream.java similarity index 100% rename from src/net/sf/genomeview/data/SeekableProgressStream.java rename to src/main/java/net/sf/genomeview/data/SeekableProgressStream.java diff --git a/src/net/sf/genomeview/data/SelectionModel.java b/src/main/java/net/sf/genomeview/data/SelectionModel.java similarity index 100% rename from src/net/sf/genomeview/data/SelectionModel.java rename to src/main/java/net/sf/genomeview/data/SelectionModel.java diff --git a/src/net/sf/genomeview/data/Session.java b/src/main/java/net/sf/genomeview/data/Session.java similarity index 100% rename from src/net/sf/genomeview/data/Session.java rename to src/main/java/net/sf/genomeview/data/Session.java diff --git a/src/net/sf/genomeview/data/Task.java b/src/main/java/net/sf/genomeview/data/Task.java similarity index 100% rename from src/net/sf/genomeview/data/Task.java rename to src/main/java/net/sf/genomeview/data/Task.java diff --git a/src/net/sf/genomeview/data/TrackList.java b/src/main/java/net/sf/genomeview/data/TrackList.java similarity index 100% rename from src/net/sf/genomeview/data/TrackList.java rename to src/main/java/net/sf/genomeview/data/TrackList.java diff --git a/src/net/sf/genomeview/data/VisualLocationModel.java b/src/main/java/net/sf/genomeview/data/VisualLocationModel.java similarity index 100% rename from src/net/sf/genomeview/data/VisualLocationModel.java rename to src/main/java/net/sf/genomeview/data/VisualLocationModel.java diff --git a/src/net/sf/genomeview/data/WorkerManager.java b/src/main/java/net/sf/genomeview/data/WorkerManager.java similarity index 100% rename from src/net/sf/genomeview/data/WorkerManager.java rename to src/main/java/net/sf/genomeview/data/WorkerManager.java diff --git a/src/net/sf/genomeview/data/WriteEntriesWorker.java b/src/main/java/net/sf/genomeview/data/WriteEntriesWorker.java similarity index 100% rename from src/net/sf/genomeview/data/WriteEntriesWorker.java rename to src/main/java/net/sf/genomeview/data/WriteEntriesWorker.java diff --git a/src/net/sf/genomeview/data/provider/BigWigProvider.java b/src/main/java/net/sf/genomeview/data/provider/BigWigProvider.java similarity index 100% rename from src/net/sf/genomeview/data/provider/BigWigProvider.java rename to src/main/java/net/sf/genomeview/data/provider/BigWigProvider.java diff --git a/src/net/sf/genomeview/data/provider/DataCallback.java b/src/main/java/net/sf/genomeview/data/provider/DataCallback.java similarity index 100% rename from src/net/sf/genomeview/data/provider/DataCallback.java rename to src/main/java/net/sf/genomeview/data/provider/DataCallback.java diff --git a/src/net/sf/genomeview/data/provider/DataProvider.java b/src/main/java/net/sf/genomeview/data/provider/DataProvider.java similarity index 100% rename from src/net/sf/genomeview/data/provider/DataProvider.java rename to src/main/java/net/sf/genomeview/data/provider/DataProvider.java diff --git a/src/net/sf/genomeview/data/provider/PileProvider.java b/src/main/java/net/sf/genomeview/data/provider/PileProvider.java similarity index 100% rename from src/net/sf/genomeview/data/provider/PileProvider.java rename to src/main/java/net/sf/genomeview/data/provider/PileProvider.java diff --git a/src/net/sf/genomeview/data/provider/PileupSummary.java b/src/main/java/net/sf/genomeview/data/provider/PileupSummary.java similarity index 100% rename from src/net/sf/genomeview/data/provider/PileupSummary.java rename to src/main/java/net/sf/genomeview/data/provider/PileupSummary.java diff --git a/src/net/sf/genomeview/data/provider/PileupTask.java b/src/main/java/net/sf/genomeview/data/provider/PileupTask.java similarity index 100% rename from src/net/sf/genomeview/data/provider/PileupTask.java rename to src/main/java/net/sf/genomeview/data/provider/PileupTask.java diff --git a/src/net/sf/genomeview/data/provider/ShortReadProvider.java b/src/main/java/net/sf/genomeview/data/provider/ShortReadProvider.java similarity index 100% rename from src/net/sf/genomeview/data/provider/ShortReadProvider.java rename to src/main/java/net/sf/genomeview/data/provider/ShortReadProvider.java diff --git a/src/net/sf/genomeview/data/provider/Status.java b/src/main/java/net/sf/genomeview/data/provider/Status.java similarity index 100% rename from src/net/sf/genomeview/data/provider/Status.java rename to src/main/java/net/sf/genomeview/data/provider/Status.java diff --git a/src/net/sf/genomeview/data/provider/TDFProvider.java b/src/main/java/net/sf/genomeview/data/provider/TDFProvider.java similarity index 100% rename from src/net/sf/genomeview/data/provider/TDFProvider.java rename to src/main/java/net/sf/genomeview/data/provider/TDFProvider.java diff --git a/src/net/sf/genomeview/data/provider/WiggleProvider.java b/src/main/java/net/sf/genomeview/data/provider/WiggleProvider.java similarity index 100% rename from src/net/sf/genomeview/data/provider/WiggleProvider.java rename to src/main/java/net/sf/genomeview/data/provider/WiggleProvider.java diff --git a/src/net/sf/genomeview/gui/ApplicationInstanceManager.java b/src/main/java/net/sf/genomeview/gui/ApplicationInstanceManager.java similarity index 100% rename from src/net/sf/genomeview/gui/ApplicationInstanceManager.java rename to src/main/java/net/sf/genomeview/gui/ApplicationInstanceManager.java diff --git a/src/net/sf/genomeview/gui/CommandLineOptions.java b/src/main/java/net/sf/genomeview/gui/CommandLineOptions.java similarity index 100% rename from src/net/sf/genomeview/gui/CommandLineOptions.java rename to src/main/java/net/sf/genomeview/gui/CommandLineOptions.java diff --git a/src/net/sf/genomeview/gui/Convert.java b/src/main/java/net/sf/genomeview/gui/Convert.java similarity index 100% rename from src/net/sf/genomeview/gui/Convert.java rename to src/main/java/net/sf/genomeview/gui/Convert.java diff --git a/src/net/sf/genomeview/gui/CrashHandler.java b/src/main/java/net/sf/genomeview/gui/CrashHandler.java similarity index 100% rename from src/net/sf/genomeview/gui/CrashHandler.java rename to src/main/java/net/sf/genomeview/gui/CrashHandler.java diff --git a/src/net/sf/genomeview/gui/DropTransferHandler.java b/src/main/java/net/sf/genomeview/gui/DropTransferHandler.java similarity index 100% rename from src/net/sf/genomeview/gui/DropTransferHandler.java rename to src/main/java/net/sf/genomeview/gui/DropTransferHandler.java diff --git a/src/net/sf/genomeview/gui/EntryListModel.java b/src/main/java/net/sf/genomeview/gui/EntryListModel.java similarity index 100% rename from src/net/sf/genomeview/gui/EntryListModel.java rename to src/main/java/net/sf/genomeview/gui/EntryListModel.java diff --git a/src/net/sf/genomeview/gui/FileUtils.java b/src/main/java/net/sf/genomeview/gui/FileUtils.java similarity index 100% rename from src/net/sf/genomeview/gui/FileUtils.java rename to src/main/java/net/sf/genomeview/gui/FileUtils.java diff --git a/src/net/sf/genomeview/gui/GenomeView.java b/src/main/java/net/sf/genomeview/gui/GenomeView.java similarity index 100% rename from src/net/sf/genomeview/gui/GenomeView.java rename to src/main/java/net/sf/genomeview/gui/GenomeView.java diff --git a/src/net/sf/genomeview/gui/GenomeViewWindow.java b/src/main/java/net/sf/genomeview/gui/GenomeViewWindow.java similarity index 100% rename from src/net/sf/genomeview/gui/GenomeViewWindow.java rename to src/main/java/net/sf/genomeview/gui/GenomeViewWindow.java diff --git a/src/net/sf/genomeview/gui/Hotkeys.java b/src/main/java/net/sf/genomeview/gui/Hotkeys.java similarity index 100% rename from src/net/sf/genomeview/gui/Hotkeys.java rename to src/main/java/net/sf/genomeview/gui/Hotkeys.java diff --git a/src/net/sf/genomeview/gui/InitDataLoader.java b/src/main/java/net/sf/genomeview/gui/InitDataLoader.java similarity index 100% rename from src/net/sf/genomeview/gui/InitDataLoader.java rename to src/main/java/net/sf/genomeview/gui/InitDataLoader.java diff --git a/src/net/sf/genomeview/gui/LogConfigurator.java b/src/main/java/net/sf/genomeview/gui/LogConfigurator.java similarity index 100% rename from src/net/sf/genomeview/gui/LogConfigurator.java rename to src/main/java/net/sf/genomeview/gui/LogConfigurator.java diff --git a/src/net/sf/genomeview/gui/MainContent.java b/src/main/java/net/sf/genomeview/gui/MainContent.java similarity index 100% rename from src/net/sf/genomeview/gui/MainContent.java rename to src/main/java/net/sf/genomeview/gui/MainContent.java diff --git a/src/net/sf/genomeview/gui/MessageManager.java b/src/main/java/net/sf/genomeview/gui/MessageManager.java similarity index 100% rename from src/net/sf/genomeview/gui/MessageManager.java rename to src/main/java/net/sf/genomeview/gui/MessageManager.java diff --git a/src/net/sf/genomeview/gui/Mouse.java b/src/main/java/net/sf/genomeview/gui/Mouse.java similarity index 100% rename from src/net/sf/genomeview/gui/Mouse.java rename to src/main/java/net/sf/genomeview/gui/Mouse.java diff --git a/src/net/sf/genomeview/gui/MyAuthenticator.java b/src/main/java/net/sf/genomeview/gui/MyAuthenticator.java similarity index 100% rename from src/net/sf/genomeview/gui/MyAuthenticator.java rename to src/main/java/net/sf/genomeview/gui/MyAuthenticator.java diff --git a/src/net/sf/genomeview/gui/ReferenceMissingMonitor.java b/src/main/java/net/sf/genomeview/gui/ReferenceMissingMonitor.java similarity index 100% rename from src/net/sf/genomeview/gui/ReferenceMissingMonitor.java rename to src/main/java/net/sf/genomeview/gui/ReferenceMissingMonitor.java diff --git a/src/net/sf/genomeview/gui/Splash.java b/src/main/java/net/sf/genomeview/gui/Splash.java similarity index 100% rename from src/net/sf/genomeview/gui/Splash.java rename to src/main/java/net/sf/genomeview/gui/Splash.java diff --git a/src/net/sf/genomeview/gui/StaticUtils.java b/src/main/java/net/sf/genomeview/gui/StaticUtils.java similarity index 100% rename from src/net/sf/genomeview/gui/StaticUtils.java rename to src/main/java/net/sf/genomeview/gui/StaticUtils.java diff --git a/src/net/sf/genomeview/gui/StatusBar.java b/src/main/java/net/sf/genomeview/gui/StatusBar.java similarity index 100% rename from src/net/sf/genomeview/gui/StatusBar.java rename to src/main/java/net/sf/genomeview/gui/StatusBar.java diff --git a/src/net/sf/genomeview/gui/Toolbar.java b/src/main/java/net/sf/genomeview/gui/Toolbar.java similarity index 100% rename from src/net/sf/genomeview/gui/Toolbar.java rename to src/main/java/net/sf/genomeview/gui/Toolbar.java diff --git a/src/net/sf/genomeview/gui/WindowManager.java b/src/main/java/net/sf/genomeview/gui/WindowManager.java similarity index 100% rename from src/net/sf/genomeview/gui/WindowManager.java rename to src/main/java/net/sf/genomeview/gui/WindowManager.java diff --git a/src/net/sf/genomeview/gui/components/AAMappingChooser.java b/src/main/java/net/sf/genomeview/gui/components/AAMappingChooser.java similarity index 100% rename from src/net/sf/genomeview/gui/components/AAMappingChooser.java rename to src/main/java/net/sf/genomeview/gui/components/AAMappingChooser.java diff --git a/src/net/sf/genomeview/gui/components/CollisionMap.java b/src/main/java/net/sf/genomeview/gui/components/CollisionMap.java similarity index 100% rename from src/net/sf/genomeview/gui/components/CollisionMap.java rename to src/main/java/net/sf/genomeview/gui/components/CollisionMap.java diff --git a/src/net/sf/genomeview/gui/components/ConnectionMonitor.java b/src/main/java/net/sf/genomeview/gui/components/ConnectionMonitor.java similarity index 100% rename from src/net/sf/genomeview/gui/components/ConnectionMonitor.java rename to src/main/java/net/sf/genomeview/gui/components/ConnectionMonitor.java diff --git a/src/net/sf/genomeview/gui/components/DoubleJSlider.java b/src/main/java/net/sf/genomeview/gui/components/DoubleJSlider.java similarity index 100% rename from src/net/sf/genomeview/gui/components/DoubleJSlider.java rename to src/main/java/net/sf/genomeview/gui/components/DoubleJSlider.java diff --git a/src/net/sf/genomeview/gui/components/EscapeDialog.java b/src/main/java/net/sf/genomeview/gui/components/EscapeDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/components/EscapeDialog.java rename to src/main/java/net/sf/genomeview/gui/components/EscapeDialog.java diff --git a/src/net/sf/genomeview/gui/components/JEditorPaneLabel.java b/src/main/java/net/sf/genomeview/gui/components/JEditorPaneLabel.java similarity index 100% rename from src/net/sf/genomeview/gui/components/JEditorPaneLabel.java rename to src/main/java/net/sf/genomeview/gui/components/JEditorPaneLabel.java diff --git a/src/net/sf/genomeview/gui/components/JOptionPaneX.java b/src/main/java/net/sf/genomeview/gui/components/JOptionPaneX.java similarity index 100% rename from src/net/sf/genomeview/gui/components/JOptionPaneX.java rename to src/main/java/net/sf/genomeview/gui/components/JOptionPaneX.java diff --git a/src/net/sf/genomeview/gui/components/OverlayListener.java b/src/main/java/net/sf/genomeview/gui/components/OverlayListener.java similarity index 100% rename from src/net/sf/genomeview/gui/components/OverlayListener.java rename to src/main/java/net/sf/genomeview/gui/components/OverlayListener.java diff --git a/src/net/sf/genomeview/gui/components/QualifierCombo.java b/src/main/java/net/sf/genomeview/gui/components/QualifierCombo.java similarity index 100% rename from src/net/sf/genomeview/gui/components/QualifierCombo.java rename to src/main/java/net/sf/genomeview/gui/components/QualifierCombo.java diff --git a/src/net/sf/genomeview/gui/components/StrandCombo.java b/src/main/java/net/sf/genomeview/gui/components/StrandCombo.java similarity index 100% rename from src/net/sf/genomeview/gui/components/StrandCombo.java rename to src/main/java/net/sf/genomeview/gui/components/StrandCombo.java diff --git a/src/net/sf/genomeview/gui/components/TypeCombo.java b/src/main/java/net/sf/genomeview/gui/components/TypeCombo.java similarity index 100% rename from src/net/sf/genomeview/gui/components/TypeCombo.java rename to src/main/java/net/sf/genomeview/gui/components/TypeCombo.java diff --git a/src/net/sf/genomeview/gui/components/package.html b/src/main/java/net/sf/genomeview/gui/components/package.html similarity index 100% rename from src/net/sf/genomeview/gui/components/package.html rename to src/main/java/net/sf/genomeview/gui/components/package.html diff --git a/src/net/sf/genomeview/gui/config/BooleanConfig.java b/src/main/java/net/sf/genomeview/gui/config/BooleanConfig.java similarity index 100% rename from src/net/sf/genomeview/gui/config/BooleanConfig.java rename to src/main/java/net/sf/genomeview/gui/config/BooleanConfig.java diff --git a/src/net/sf/genomeview/gui/config/ColorConfig.java b/src/main/java/net/sf/genomeview/gui/config/ColorConfig.java similarity index 100% rename from src/net/sf/genomeview/gui/config/ColorConfig.java rename to src/main/java/net/sf/genomeview/gui/config/ColorConfig.java diff --git a/src/net/sf/genomeview/gui/config/ComboBoxConfig.java b/src/main/java/net/sf/genomeview/gui/config/ComboBoxConfig.java similarity index 100% rename from src/net/sf/genomeview/gui/config/ComboBoxConfig.java rename to src/main/java/net/sf/genomeview/gui/config/ComboBoxConfig.java diff --git a/src/net/sf/genomeview/gui/config/ConfigBox.java b/src/main/java/net/sf/genomeview/gui/config/ConfigBox.java similarity index 100% rename from src/net/sf/genomeview/gui/config/ConfigBox.java rename to src/main/java/net/sf/genomeview/gui/config/ConfigBox.java diff --git a/src/net/sf/genomeview/gui/config/ConfigListener.java b/src/main/java/net/sf/genomeview/gui/config/ConfigListener.java similarity index 100% rename from src/net/sf/genomeview/gui/config/ConfigListener.java rename to src/main/java/net/sf/genomeview/gui/config/ConfigListener.java diff --git a/src/net/sf/genomeview/gui/config/ConfigurationDialog.java b/src/main/java/net/sf/genomeview/gui/config/ConfigurationDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/config/ConfigurationDialog.java rename to src/main/java/net/sf/genomeview/gui/config/ConfigurationDialog.java diff --git a/src/net/sf/genomeview/gui/config/DoubleConfig.java b/src/main/java/net/sf/genomeview/gui/config/DoubleConfig.java similarity index 100% rename from src/net/sf/genomeview/gui/config/DoubleConfig.java rename to src/main/java/net/sf/genomeview/gui/config/DoubleConfig.java diff --git a/src/net/sf/genomeview/gui/config/IntegerConfig.java b/src/main/java/net/sf/genomeview/gui/config/IntegerConfig.java similarity index 100% rename from src/net/sf/genomeview/gui/config/IntegerConfig.java rename to src/main/java/net/sf/genomeview/gui/config/IntegerConfig.java diff --git a/src/net/sf/genomeview/gui/config/StringConfig.java b/src/main/java/net/sf/genomeview/gui/config/StringConfig.java similarity index 100% rename from src/net/sf/genomeview/gui/config/StringConfig.java rename to src/main/java/net/sf/genomeview/gui/config/StringConfig.java diff --git a/src/net/sf/genomeview/gui/dialog/EditFeatureWindow.java b/src/main/java/net/sf/genomeview/gui/dialog/EditFeatureWindow.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/EditFeatureWindow.java rename to src/main/java/net/sf/genomeview/gui/dialog/EditFeatureWindow.java diff --git a/src/net/sf/genomeview/gui/dialog/ExportDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/ExportDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/ExportDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/ExportDialog.java diff --git a/src/net/sf/genomeview/gui/dialog/GVProgressBar.java b/src/main/java/net/sf/genomeview/gui/dialog/GVProgressBar.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/GVProgressBar.java rename to src/main/java/net/sf/genomeview/gui/dialog/GVProgressBar.java diff --git a/src/net/sf/genomeview/gui/dialog/HelpButton.java b/src/main/java/net/sf/genomeview/gui/dialog/HelpButton.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/HelpButton.java rename to src/main/java/net/sf/genomeview/gui/dialog/HelpButton.java diff --git a/src/net/sf/genomeview/gui/dialog/Hider.java b/src/main/java/net/sf/genomeview/gui/dialog/Hider.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/Hider.java rename to src/main/java/net/sf/genomeview/gui/dialog/Hider.java diff --git a/src/net/sf/genomeview/gui/dialog/MergeFeatureDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/MergeFeatureDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/MergeFeatureDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/MergeFeatureDialog.java diff --git a/src/net/sf/genomeview/gui/dialog/MultipleAlignmentOrderingDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/MultipleAlignmentOrderingDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/MultipleAlignmentOrderingDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/MultipleAlignmentOrderingDialog.java diff --git a/src/net/sf/genomeview/gui/dialog/NewFeatureDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/NewFeatureDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/NewFeatureDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/NewFeatureDialog.java diff --git a/src/net/sf/genomeview/gui/dialog/NewFeatureFromCoordinatesDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/NewFeatureFromCoordinatesDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/NewFeatureFromCoordinatesDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/NewFeatureFromCoordinatesDialog.java diff --git a/src/net/sf/genomeview/gui/dialog/NoteDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/NoteDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/NoteDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/NoteDialog.java diff --git a/src/net/sf/genomeview/gui/dialog/NotesTableModel.java b/src/main/java/net/sf/genomeview/gui/dialog/NotesTableModel.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/NotesTableModel.java rename to src/main/java/net/sf/genomeview/gui/dialog/NotesTableModel.java diff --git a/src/net/sf/genomeview/gui/dialog/OpenDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/OpenDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/OpenDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/OpenDialog.java diff --git a/src/net/sf/genomeview/gui/dialog/OpenFileButton.java b/src/main/java/net/sf/genomeview/gui/dialog/OpenFileButton.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/OpenFileButton.java rename to src/main/java/net/sf/genomeview/gui/dialog/OpenFileButton.java diff --git a/src/net/sf/genomeview/gui/dialog/OpenURLButton.java b/src/main/java/net/sf/genomeview/gui/dialog/OpenURLButton.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/OpenURLButton.java rename to src/main/java/net/sf/genomeview/gui/dialog/OpenURLButton.java diff --git a/src/net/sf/genomeview/gui/dialog/SaveDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/SaveDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/SaveDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/SaveDialog.java diff --git a/src/net/sf/genomeview/gui/dialog/SelectedSequenceDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/SelectedSequenceDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/SelectedSequenceDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/SelectedSequenceDialog.java diff --git a/src/net/sf/genomeview/gui/dialog/SequenceViewDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/SequenceViewDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/SequenceViewDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/SequenceViewDialog.java diff --git a/src/net/sf/genomeview/gui/dialog/SplitFeatureDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/SplitFeatureDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/SplitFeatureDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/SplitFeatureDialog.java diff --git a/src/net/sf/genomeview/gui/dialog/StructureTrackConfig.java b/src/main/java/net/sf/genomeview/gui/dialog/StructureTrackConfig.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/StructureTrackConfig.java rename to src/main/java/net/sf/genomeview/gui/dialog/StructureTrackConfig.java diff --git a/src/net/sf/genomeview/gui/dialog/TryAgainHandler.java b/src/main/java/net/sf/genomeview/gui/dialog/TryAgainHandler.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/TryAgainHandler.java rename to src/main/java/net/sf/genomeview/gui/dialog/TryAgainHandler.java diff --git a/src/net/sf/genomeview/gui/dialog/UniqueFeatureHitDialog.java b/src/main/java/net/sf/genomeview/gui/dialog/UniqueFeatureHitDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/dialog/UniqueFeatureHitDialog.java rename to src/main/java/net/sf/genomeview/gui/dialog/UniqueFeatureHitDialog.java diff --git a/src/net/sf/genomeview/gui/explorer/DataExplorer.java b/src/main/java/net/sf/genomeview/gui/explorer/DataExplorer.java similarity index 100% rename from src/net/sf/genomeview/gui/explorer/DataExplorer.java rename to src/main/java/net/sf/genomeview/gui/explorer/DataExplorer.java diff --git a/src/net/sf/genomeview/gui/explorer/DataExplorerManager.java b/src/main/java/net/sf/genomeview/gui/explorer/DataExplorerManager.java similarity index 100% rename from src/net/sf/genomeview/gui/explorer/DataExplorerManager.java rename to src/main/java/net/sf/genomeview/gui/explorer/DataExplorerManager.java diff --git a/src/net/sf/genomeview/gui/explorer/FilterField.java b/src/main/java/net/sf/genomeview/gui/explorer/FilterField.java similarity index 100% rename from src/net/sf/genomeview/gui/explorer/FilterField.java rename to src/main/java/net/sf/genomeview/gui/explorer/FilterField.java diff --git a/src/net/sf/genomeview/gui/explorer/FilteredListModel.java b/src/main/java/net/sf/genomeview/gui/explorer/FilteredListModel.java similarity index 100% rename from src/net/sf/genomeview/gui/explorer/FilteredListModel.java rename to src/main/java/net/sf/genomeview/gui/explorer/FilteredListModel.java diff --git a/src/net/sf/genomeview/gui/explorer/RecentDataPanel.java b/src/main/java/net/sf/genomeview/gui/explorer/RecentDataPanel.java similarity index 100% rename from src/net/sf/genomeview/gui/explorer/RecentDataPanel.java rename to src/main/java/net/sf/genomeview/gui/explorer/RecentDataPanel.java diff --git a/src/net/sf/genomeview/gui/explorer/ScrollToTop.java b/src/main/java/net/sf/genomeview/gui/explorer/ScrollToTop.java similarity index 100% rename from src/net/sf/genomeview/gui/explorer/ScrollToTop.java rename to src/main/java/net/sf/genomeview/gui/explorer/ScrollToTop.java diff --git a/src/net/sf/genomeview/gui/external/ExternalHelper.java b/src/main/java/net/sf/genomeview/gui/external/ExternalHelper.java similarity index 100% rename from src/net/sf/genomeview/gui/external/ExternalHelper.java rename to src/main/java/net/sf/genomeview/gui/external/ExternalHelper.java diff --git a/src/net/sf/genomeview/gui/external/InstructionWorker.java b/src/main/java/net/sf/genomeview/gui/external/InstructionWorker.java similarity index 100% rename from src/net/sf/genomeview/gui/external/InstructionWorker.java rename to src/main/java/net/sf/genomeview/gui/external/InstructionWorker.java diff --git a/src/net/sf/genomeview/gui/external/JavaScriptHandler.java b/src/main/java/net/sf/genomeview/gui/external/JavaScriptHandler.java similarity index 100% rename from src/net/sf/genomeview/gui/external/JavaScriptHandler.java rename to src/main/java/net/sf/genomeview/gui/external/JavaScriptHandler.java diff --git a/src/net/sf/genomeview/gui/information/DragDropRowTableUI.java b/src/main/java/net/sf/genomeview/gui/information/DragDropRowTableUI.java similarity index 100% rename from src/net/sf/genomeview/gui/information/DragDropRowTableUI.java rename to src/main/java/net/sf/genomeview/gui/information/DragDropRowTableUI.java diff --git a/src/net/sf/genomeview/gui/information/FeatureDetailPanel.java b/src/main/java/net/sf/genomeview/gui/information/FeatureDetailPanel.java similarity index 100% rename from src/net/sf/genomeview/gui/information/FeatureDetailPanel.java rename to src/main/java/net/sf/genomeview/gui/information/FeatureDetailPanel.java diff --git a/src/net/sf/genomeview/gui/information/FeatureTable.java b/src/main/java/net/sf/genomeview/gui/information/FeatureTable.java similarity index 100% rename from src/net/sf/genomeview/gui/information/FeatureTable.java rename to src/main/java/net/sf/genomeview/gui/information/FeatureTable.java diff --git a/src/net/sf/genomeview/gui/information/FeatureTableModel.java b/src/main/java/net/sf/genomeview/gui/information/FeatureTableModel.java similarity index 100% rename from src/net/sf/genomeview/gui/information/FeatureTableModel.java rename to src/main/java/net/sf/genomeview/gui/information/FeatureTableModel.java diff --git a/src/net/sf/genomeview/gui/information/GeneStructureView.java b/src/main/java/net/sf/genomeview/gui/information/GeneStructureView.java similarity index 100% rename from src/net/sf/genomeview/gui/information/GeneStructureView.java rename to src/main/java/net/sf/genomeview/gui/information/GeneStructureView.java diff --git a/src/net/sf/genomeview/gui/information/InformationFrame.java b/src/main/java/net/sf/genomeview/gui/information/InformationFrame.java similarity index 100% rename from src/net/sf/genomeview/gui/information/InformationFrame.java rename to src/main/java/net/sf/genomeview/gui/information/InformationFrame.java diff --git a/src/net/sf/genomeview/gui/information/Query.java b/src/main/java/net/sf/genomeview/gui/information/Query.java similarity index 100% rename from src/net/sf/genomeview/gui/information/Query.java rename to src/main/java/net/sf/genomeview/gui/information/Query.java diff --git a/src/net/sf/genomeview/gui/information/TrackSelectionModel.java b/src/main/java/net/sf/genomeview/gui/information/TrackSelectionModel.java similarity index 100% rename from src/net/sf/genomeview/gui/information/TrackSelectionModel.java rename to src/main/java/net/sf/genomeview/gui/information/TrackSelectionModel.java diff --git a/src/net/sf/genomeview/gui/information/TrackTable.java b/src/main/java/net/sf/genomeview/gui/information/TrackTable.java similarity index 100% rename from src/net/sf/genomeview/gui/information/TrackTable.java rename to src/main/java/net/sf/genomeview/gui/information/TrackTable.java diff --git a/src/net/sf/genomeview/gui/information/TrackTableModel.java b/src/main/java/net/sf/genomeview/gui/information/TrackTableModel.java similarity index 100% rename from src/net/sf/genomeview/gui/information/TrackTableModel.java rename to src/main/java/net/sf/genomeview/gui/information/TrackTableModel.java diff --git a/src/net/sf/genomeview/gui/menu/AbstractModelAction.java b/src/main/java/net/sf/genomeview/gui/menu/AbstractModelAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/AbstractModelAction.java rename to src/main/java/net/sf/genomeview/gui/menu/AbstractModelAction.java diff --git a/src/net/sf/genomeview/gui/menu/MainMenu.java b/src/main/java/net/sf/genomeview/gui/menu/MainMenu.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/MainMenu.java rename to src/main/java/net/sf/genomeview/gui/menu/MainMenu.java diff --git a/src/net/sf/genomeview/gui/menu/OpenURLAction.java b/src/main/java/net/sf/genomeview/gui/menu/OpenURLAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/OpenURLAction.java rename to src/main/java/net/sf/genomeview/gui/menu/OpenURLAction.java diff --git a/src/net/sf/genomeview/gui/menu/PopUpMenu.java b/src/main/java/net/sf/genomeview/gui/menu/PopUpMenu.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/PopUpMenu.java rename to src/main/java/net/sf/genomeview/gui/menu/PopUpMenu.java diff --git a/src/net/sf/genomeview/gui/menu/edit/CloneFeatureAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/CloneFeatureAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/CloneFeatureAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/CloneFeatureAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/CopySequenceAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/CopySequenceAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/CopySequenceAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/CopySequenceAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/CreateNewFeatureAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/CreateNewFeatureAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/CreateNewFeatureAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/CreateNewFeatureAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/CreateNewFeatureFromCoordinatesAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/CreateNewFeatureFromCoordinatesAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/CreateNewFeatureFromCoordinatesAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/CreateNewFeatureFromCoordinatesAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/EditStructureAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/EditStructureAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/EditStructureAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/EditStructureAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/ExtendToStartCodonAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/ExtendToStartCodonAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/ExtendToStartCodonAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/ExtendToStartCodonAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/ExtendToStopCodonAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/ExtendToStopCodonAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/ExtendToStopCodonAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/ExtendToStopCodonAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/MergeFeatureAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/MergeFeatureAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/MergeFeatureAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/MergeFeatureAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/RedoAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/RedoAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/RedoAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/RedoAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/RemoveAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/RemoveAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/RemoveAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/RemoveAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/RemoveLocationAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/RemoveLocationAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/RemoveLocationAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/RemoveLocationAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/SplitFeatureAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/SplitFeatureAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/SplitFeatureAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/SplitFeatureAction.java diff --git a/src/net/sf/genomeview/gui/menu/edit/UndoAction.java b/src/main/java/net/sf/genomeview/gui/menu/edit/UndoAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/edit/UndoAction.java rename to src/main/java/net/sf/genomeview/gui/menu/edit/UndoAction.java diff --git a/src/net/sf/genomeview/gui/menu/file/ClearEntriesAction.java b/src/main/java/net/sf/genomeview/gui/menu/file/ClearEntriesAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/file/ClearEntriesAction.java rename to src/main/java/net/sf/genomeview/gui/menu/file/ClearEntriesAction.java diff --git a/src/net/sf/genomeview/gui/menu/file/ExitAction.java b/src/main/java/net/sf/genomeview/gui/menu/file/ExitAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/file/ExitAction.java rename to src/main/java/net/sf/genomeview/gui/menu/file/ExitAction.java diff --git a/src/net/sf/genomeview/gui/menu/file/ExportDataAction.java b/src/main/java/net/sf/genomeview/gui/menu/file/ExportDataAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/file/ExportDataAction.java rename to src/main/java/net/sf/genomeview/gui/menu/file/ExportDataAction.java diff --git a/src/net/sf/genomeview/gui/menu/file/LoadFeaturesAction.java b/src/main/java/net/sf/genomeview/gui/menu/file/LoadFeaturesAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/file/LoadFeaturesAction.java rename to src/main/java/net/sf/genomeview/gui/menu/file/LoadFeaturesAction.java diff --git a/src/net/sf/genomeview/gui/menu/file/LoadSessionAction.java b/src/main/java/net/sf/genomeview/gui/menu/file/LoadSessionAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/file/LoadSessionAction.java rename to src/main/java/net/sf/genomeview/gui/menu/file/LoadSessionAction.java diff --git a/src/net/sf/genomeview/gui/menu/file/SaveAction.java b/src/main/java/net/sf/genomeview/gui/menu/file/SaveAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/file/SaveAction.java rename to src/main/java/net/sf/genomeview/gui/menu/file/SaveAction.java diff --git a/src/net/sf/genomeview/gui/menu/file/SaveImage.java b/src/main/java/net/sf/genomeview/gui/menu/file/SaveImage.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/file/SaveImage.java rename to src/main/java/net/sf/genomeview/gui/menu/file/SaveImage.java diff --git a/src/net/sf/genomeview/gui/menu/file/SaveSessionAction.java b/src/main/java/net/sf/genomeview/gui/menu/file/SaveSessionAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/file/SaveSessionAction.java rename to src/main/java/net/sf/genomeview/gui/menu/file/SaveSessionAction.java diff --git a/src/net/sf/genomeview/gui/menu/file/ShowConfigurationAction.java b/src/main/java/net/sf/genomeview/gui/menu/file/ShowConfigurationAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/file/ShowConfigurationAction.java rename to src/main/java/net/sf/genomeview/gui/menu/file/ShowConfigurationAction.java diff --git a/src/net/sf/genomeview/gui/menu/file/ShowGenomeExplorerAction.java b/src/main/java/net/sf/genomeview/gui/menu/file/ShowGenomeExplorerAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/file/ShowGenomeExplorerAction.java rename to src/main/java/net/sf/genomeview/gui/menu/file/ShowGenomeExplorerAction.java diff --git a/src/net/sf/genomeview/gui/menu/help/ShowAboutDialogAction.java b/src/main/java/net/sf/genomeview/gui/menu/help/ShowAboutDialogAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/help/ShowAboutDialogAction.java rename to src/main/java/net/sf/genomeview/gui/menu/help/ShowAboutDialogAction.java diff --git a/src/net/sf/genomeview/gui/menu/help/ShowInstalledModulesAction.java b/src/main/java/net/sf/genomeview/gui/menu/help/ShowInstalledModulesAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/help/ShowInstalledModulesAction.java rename to src/main/java/net/sf/genomeview/gui/menu/help/ShowInstalledModulesAction.java diff --git a/src/net/sf/genomeview/gui/menu/navigation/AnnotationEndAction.java b/src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationEndAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/navigation/AnnotationEndAction.java rename to src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationEndAction.java diff --git a/src/net/sf/genomeview/gui/menu/navigation/AnnotationMoveLeftAction.java b/src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationMoveLeftAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/navigation/AnnotationMoveLeftAction.java rename to src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationMoveLeftAction.java diff --git a/src/net/sf/genomeview/gui/menu/navigation/AnnotationMoveRightAction.java b/src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationMoveRightAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/navigation/AnnotationMoveRightAction.java rename to src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationMoveRightAction.java diff --git a/src/net/sf/genomeview/gui/menu/navigation/AnnotationStartAction.java b/src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationStartAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/navigation/AnnotationStartAction.java rename to src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationStartAction.java diff --git a/src/net/sf/genomeview/gui/menu/navigation/AnnotationZoomInAction.java b/src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationZoomInAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/navigation/AnnotationZoomInAction.java rename to src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationZoomInAction.java diff --git a/src/net/sf/genomeview/gui/menu/navigation/AnnotationZoomOutAction.java b/src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationZoomOutAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/navigation/AnnotationZoomOutAction.java rename to src/main/java/net/sf/genomeview/gui/menu/navigation/AnnotationZoomOutAction.java diff --git a/src/net/sf/genomeview/gui/menu/navigation/GotoPosition.java b/src/main/java/net/sf/genomeview/gui/menu/navigation/GotoPosition.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/navigation/GotoPosition.java rename to src/main/java/net/sf/genomeview/gui/menu/navigation/GotoPosition.java diff --git a/src/net/sf/genomeview/gui/menu/navigation/GotoTrack.java b/src/main/java/net/sf/genomeview/gui/menu/navigation/GotoTrack.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/navigation/GotoTrack.java rename to src/main/java/net/sf/genomeview/gui/menu/navigation/GotoTrack.java diff --git a/src/net/sf/genomeview/gui/menu/navigation/SearchAction.java b/src/main/java/net/sf/genomeview/gui/menu/navigation/SearchAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/navigation/SearchAction.java rename to src/main/java/net/sf/genomeview/gui/menu/navigation/SearchAction.java diff --git a/src/net/sf/genomeview/gui/menu/plugins/LoadPluginFromURLAction.java b/src/main/java/net/sf/genomeview/gui/menu/plugins/LoadPluginFromURLAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/plugins/LoadPluginFromURLAction.java rename to src/main/java/net/sf/genomeview/gui/menu/plugins/LoadPluginFromURLAction.java diff --git a/src/net/sf/genomeview/gui/menu/selection/ClearFeatureSelectionAction.java b/src/main/java/net/sf/genomeview/gui/menu/selection/ClearFeatureSelectionAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/selection/ClearFeatureSelectionAction.java rename to src/main/java/net/sf/genomeview/gui/menu/selection/ClearFeatureSelectionAction.java diff --git a/src/net/sf/genomeview/gui/menu/selection/ClearRegionSelectionAction.java b/src/main/java/net/sf/genomeview/gui/menu/selection/ClearRegionSelectionAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/selection/ClearRegionSelectionAction.java rename to src/main/java/net/sf/genomeview/gui/menu/selection/ClearRegionSelectionAction.java diff --git a/src/net/sf/genomeview/gui/menu/selection/SelectFromSelectedBack.java b/src/main/java/net/sf/genomeview/gui/menu/selection/SelectFromSelectedBack.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/selection/SelectFromSelectedBack.java rename to src/main/java/net/sf/genomeview/gui/menu/selection/SelectFromSelectedBack.java diff --git a/src/net/sf/genomeview/gui/menu/selection/SelectFromSelectedFirst.java b/src/main/java/net/sf/genomeview/gui/menu/selection/SelectFromSelectedFirst.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/selection/SelectFromSelectedFirst.java rename to src/main/java/net/sf/genomeview/gui/menu/selection/SelectFromSelectedFirst.java diff --git a/src/net/sf/genomeview/gui/menu/selection/SelectFromSelectedForward.java b/src/main/java/net/sf/genomeview/gui/menu/selection/SelectFromSelectedForward.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/selection/SelectFromSelectedForward.java rename to src/main/java/net/sf/genomeview/gui/menu/selection/SelectFromSelectedForward.java diff --git a/src/net/sf/genomeview/gui/menu/selection/SelectFromSelectedLast.java b/src/main/java/net/sf/genomeview/gui/menu/selection/SelectFromSelectedLast.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/selection/SelectFromSelectedLast.java rename to src/main/java/net/sf/genomeview/gui/menu/selection/SelectFromSelectedLast.java diff --git a/src/net/sf/genomeview/gui/menu/selection/ShowSequenceWindowAction.java b/src/main/java/net/sf/genomeview/gui/menu/selection/ShowSequenceWindowAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/selection/ShowSequenceWindowAction.java rename to src/main/java/net/sf/genomeview/gui/menu/selection/ShowSequenceWindowAction.java diff --git a/src/net/sf/genomeview/gui/menu/selection/ZoomToSelectedFeaturesAction.java b/src/main/java/net/sf/genomeview/gui/menu/selection/ZoomToSelectedFeaturesAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/selection/ZoomToSelectedFeaturesAction.java rename to src/main/java/net/sf/genomeview/gui/menu/selection/ZoomToSelectedFeaturesAction.java diff --git a/src/net/sf/genomeview/gui/menu/selection/ZoomToSelectedLocationAction.java b/src/main/java/net/sf/genomeview/gui/menu/selection/ZoomToSelectedLocationAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/selection/ZoomToSelectedLocationAction.java rename to src/main/java/net/sf/genomeview/gui/menu/selection/ZoomToSelectedLocationAction.java diff --git a/src/net/sf/genomeview/gui/menu/selection/ZoomToSelectionAction.java b/src/main/java/net/sf/genomeview/gui/menu/selection/ZoomToSelectionAction.java similarity index 100% rename from src/net/sf/genomeview/gui/menu/selection/ZoomToSelectionAction.java rename to src/main/java/net/sf/genomeview/gui/menu/selection/ZoomToSelectionAction.java diff --git a/src/net/sf/genomeview/gui/search/AbstractSearchResultModel.java b/src/main/java/net/sf/genomeview/gui/search/AbstractSearchResultModel.java similarity index 100% rename from src/net/sf/genomeview/gui/search/AbstractSearchResultModel.java rename to src/main/java/net/sf/genomeview/gui/search/AbstractSearchResultModel.java diff --git a/src/net/sf/genomeview/gui/search/EntrySearchPane.java b/src/main/java/net/sf/genomeview/gui/search/EntrySearchPane.java similarity index 100% rename from src/net/sf/genomeview/gui/search/EntrySearchPane.java rename to src/main/java/net/sf/genomeview/gui/search/EntrySearchPane.java diff --git a/src/net/sf/genomeview/gui/search/EntrySearchResultModel.java b/src/main/java/net/sf/genomeview/gui/search/EntrySearchResultModel.java similarity index 100% rename from src/net/sf/genomeview/gui/search/EntrySearchResultModel.java rename to src/main/java/net/sf/genomeview/gui/search/EntrySearchResultModel.java diff --git a/src/net/sf/genomeview/gui/search/KeywordSearchPane.java b/src/main/java/net/sf/genomeview/gui/search/KeywordSearchPane.java similarity index 100% rename from src/net/sf/genomeview/gui/search/KeywordSearchPane.java rename to src/main/java/net/sf/genomeview/gui/search/KeywordSearchPane.java diff --git a/src/net/sf/genomeview/gui/search/KeywordSearchResultModel.java b/src/main/java/net/sf/genomeview/gui/search/KeywordSearchResultModel.java similarity index 100% rename from src/net/sf/genomeview/gui/search/KeywordSearchResultModel.java rename to src/main/java/net/sf/genomeview/gui/search/KeywordSearchResultModel.java diff --git a/src/net/sf/genomeview/gui/search/MotifSearchPane.java b/src/main/java/net/sf/genomeview/gui/search/MotifSearchPane.java similarity index 100% rename from src/net/sf/genomeview/gui/search/MotifSearchPane.java rename to src/main/java/net/sf/genomeview/gui/search/MotifSearchPane.java diff --git a/src/net/sf/genomeview/gui/search/MotifSearchResultModel.java b/src/main/java/net/sf/genomeview/gui/search/MotifSearchResultModel.java similarity index 100% rename from src/net/sf/genomeview/gui/search/MotifSearchResultModel.java rename to src/main/java/net/sf/genomeview/gui/search/MotifSearchResultModel.java diff --git a/src/net/sf/genomeview/gui/search/OverlapSearchPane.java b/src/main/java/net/sf/genomeview/gui/search/OverlapSearchPane.java similarity index 100% rename from src/net/sf/genomeview/gui/search/OverlapSearchPane.java rename to src/main/java/net/sf/genomeview/gui/search/OverlapSearchPane.java diff --git a/src/net/sf/genomeview/gui/search/OverlapSearchResultModel.java b/src/main/java/net/sf/genomeview/gui/search/OverlapSearchResultModel.java similarity index 100% rename from src/net/sf/genomeview/gui/search/OverlapSearchResultModel.java rename to src/main/java/net/sf/genomeview/gui/search/OverlapSearchResultModel.java diff --git a/src/net/sf/genomeview/gui/search/SearchDialog.java b/src/main/java/net/sf/genomeview/gui/search/SearchDialog.java similarity index 100% rename from src/net/sf/genomeview/gui/search/SearchDialog.java rename to src/main/java/net/sf/genomeview/gui/search/SearchDialog.java diff --git a/src/net/sf/genomeview/gui/search/SearchPanel.java b/src/main/java/net/sf/genomeview/gui/search/SearchPanel.java similarity index 100% rename from src/net/sf/genomeview/gui/search/SearchPanel.java rename to src/main/java/net/sf/genomeview/gui/search/SearchPanel.java diff --git a/src/net/sf/genomeview/gui/search/SequenceSearchPane.java b/src/main/java/net/sf/genomeview/gui/search/SequenceSearchPane.java similarity index 100% rename from src/net/sf/genomeview/gui/search/SequenceSearchPane.java rename to src/main/java/net/sf/genomeview/gui/search/SequenceSearchPane.java diff --git a/src/net/sf/genomeview/gui/search/SequenceSearchResultModel.java b/src/main/java/net/sf/genomeview/gui/search/SequenceSearchResultModel.java similarity index 100% rename from src/net/sf/genomeview/gui/search/SequenceSearchResultModel.java rename to src/main/java/net/sf/genomeview/gui/search/SequenceSearchResultModel.java diff --git a/src/net/sf/genomeview/gui/viztracks/AnnotationFrame.java b/src/main/java/net/sf/genomeview/gui/viztracks/AnnotationFrame.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/AnnotationFrame.java rename to src/main/java/net/sf/genomeview/gui/viztracks/AnnotationFrame.java diff --git a/src/net/sf/genomeview/gui/viztracks/GeneEvidenceLabel.java b/src/main/java/net/sf/genomeview/gui/viztracks/GeneEvidenceLabel.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/GeneEvidenceLabel.java rename to src/main/java/net/sf/genomeview/gui/viztracks/GeneEvidenceLabel.java diff --git a/src/net/sf/genomeview/gui/viztracks/TickmarkTrack.java b/src/main/java/net/sf/genomeview/gui/viztracks/TickmarkTrack.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/TickmarkTrack.java rename to src/main/java/net/sf/genomeview/gui/viztracks/TickmarkTrack.java diff --git a/src/net/sf/genomeview/gui/viztracks/Track.java b/src/main/java/net/sf/genomeview/gui/viztracks/Track.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/Track.java rename to src/main/java/net/sf/genomeview/gui/viztracks/Track.java diff --git a/src/net/sf/genomeview/gui/viztracks/TrackCommunicationModel.java b/src/main/java/net/sf/genomeview/gui/viztracks/TrackCommunicationModel.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/TrackCommunicationModel.java rename to src/main/java/net/sf/genomeview/gui/viztracks/TrackCommunicationModel.java diff --git a/src/net/sf/genomeview/gui/viztracks/TrackConfig.java b/src/main/java/net/sf/genomeview/gui/viztracks/TrackConfig.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/TrackConfig.java rename to src/main/java/net/sf/genomeview/gui/viztracks/TrackConfig.java diff --git a/src/net/sf/genomeview/gui/viztracks/TrackConfigWindow.java b/src/main/java/net/sf/genomeview/gui/viztracks/TrackConfigWindow.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/TrackConfigWindow.java rename to src/main/java/net/sf/genomeview/gui/viztracks/TrackConfigWindow.java diff --git a/src/net/sf/genomeview/gui/viztracks/Zoomer.java b/src/main/java/net/sf/genomeview/gui/viztracks/Zoomer.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/Zoomer.java rename to src/main/java/net/sf/genomeview/gui/viztracks/Zoomer.java diff --git a/src/net/sf/genomeview/gui/viztracks/annotation/FeatureTrack.java b/src/main/java/net/sf/genomeview/gui/viztracks/annotation/FeatureTrack.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/annotation/FeatureTrack.java rename to src/main/java/net/sf/genomeview/gui/viztracks/annotation/FeatureTrack.java diff --git a/src/net/sf/genomeview/gui/viztracks/annotation/FeatureUtils.java b/src/main/java/net/sf/genomeview/gui/viztracks/annotation/FeatureUtils.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/annotation/FeatureUtils.java rename to src/main/java/net/sf/genomeview/gui/viztracks/annotation/FeatureUtils.java diff --git a/src/net/sf/genomeview/gui/viztracks/annotation/StructureTrack.java b/src/main/java/net/sf/genomeview/gui/viztracks/annotation/StructureTrack.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/annotation/StructureTrack.java rename to src/main/java/net/sf/genomeview/gui/viztracks/annotation/StructureTrack.java diff --git a/src/net/sf/genomeview/gui/viztracks/annotation/StructureTrackModel.java b/src/main/java/net/sf/genomeview/gui/viztracks/annotation/StructureTrackModel.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/annotation/StructureTrackModel.java rename to src/main/java/net/sf/genomeview/gui/viztracks/annotation/StructureTrackModel.java diff --git a/src/net/sf/genomeview/gui/viztracks/comparative/MAFVizBuffer.java b/src/main/java/net/sf/genomeview/gui/viztracks/comparative/MAFVizBuffer.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/comparative/MAFVizBuffer.java rename to src/main/java/net/sf/genomeview/gui/viztracks/comparative/MAFVizBuffer.java diff --git a/src/net/sf/genomeview/gui/viztracks/comparative/MultipleAlignmentTrack.java b/src/main/java/net/sf/genomeview/gui/viztracks/comparative/MultipleAlignmentTrack.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/comparative/MultipleAlignmentTrack.java rename to src/main/java/net/sf/genomeview/gui/viztracks/comparative/MultipleAlignmentTrack.java diff --git a/src/net/sf/genomeview/gui/viztracks/comparative/MultipleAlignmentTrack2.java b/src/main/java/net/sf/genomeview/gui/viztracks/comparative/MultipleAlignmentTrack2.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/comparative/MultipleAlignmentTrack2.java rename to src/main/java/net/sf/genomeview/gui/viztracks/comparative/MultipleAlignmentTrack2.java diff --git a/src/net/sf/genomeview/gui/viztracks/comparative/SyntenicTrack.java b/src/main/java/net/sf/genomeview/gui/viztracks/comparative/SyntenicTrack.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/comparative/SyntenicTrack.java rename to src/main/java/net/sf/genomeview/gui/viztracks/comparative/SyntenicTrack.java diff --git a/src/net/sf/genomeview/gui/viztracks/graph/WiggleTrack.java b/src/main/java/net/sf/genomeview/gui/viztracks/graph/WiggleTrack.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/graph/WiggleTrack.java rename to src/main/java/net/sf/genomeview/gui/viztracks/graph/WiggleTrack.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/BarChartBuffer.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/BarChartBuffer.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/BarChartBuffer.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/BarChartBuffer.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/LineChartBuffer.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/LineChartBuffer.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/LineChartBuffer.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/LineChartBuffer.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/NucCounter.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/NucCounter.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/NucCounter.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/NucCounter.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/PileupTooltip.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/PileupTooltip.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/PileupTooltip.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/PileupTooltip.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/PileupTrack.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/PileupTrack.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/PileupTrack.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/PileupTrack.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/PileupTrackConfig.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/PileupTrackConfig.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/PileupTrackConfig.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/PileupTrackConfig.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/ShortReadInsertion.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/ShortReadInsertion.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/ShortReadInsertion.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/ShortReadInsertion.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/ShortReadTrack.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/ShortReadTrack.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/ShortReadTrack.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/ShortReadTrack.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/ShortReadTrackConfig.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/ShortReadTrackConfig.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/ShortReadTrackConfig.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/ShortReadTrackConfig.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/TilingMatrix.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/TilingMatrix.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/TilingMatrix.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/TilingMatrix.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/VizBuffer.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/VizBuffer.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/VizBuffer.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/VizBuffer.java diff --git a/src/net/sf/genomeview/gui/viztracks/hts/srtRender.java b/src/main/java/net/sf/genomeview/gui/viztracks/hts/srtRender.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/hts/srtRender.java rename to src/main/java/net/sf/genomeview/gui/viztracks/hts/srtRender.java diff --git a/src/net/sf/genomeview/gui/viztracks/variation/VariationTrack.java b/src/main/java/net/sf/genomeview/gui/viztracks/variation/VariationTrack.java similarity index 100% rename from src/net/sf/genomeview/gui/viztracks/variation/VariationTrack.java rename to src/main/java/net/sf/genomeview/gui/viztracks/variation/VariationTrack.java diff --git a/src/net/sf/genomeview/plugin/GUIManager.java b/src/main/java/net/sf/genomeview/plugin/GUIManager.java similarity index 100% rename from src/net/sf/genomeview/plugin/GUIManager.java rename to src/main/java/net/sf/genomeview/plugin/GUIManager.java diff --git a/src/net/sf/genomeview/plugin/IPlugin.java b/src/main/java/net/sf/genomeview/plugin/IPlugin.java similarity index 100% rename from src/net/sf/genomeview/plugin/IPlugin.java rename to src/main/java/net/sf/genomeview/plugin/IPlugin.java diff --git a/src/net/sf/genomeview/plugin/PluginCore.java b/src/main/java/net/sf/genomeview/plugin/PluginCore.java similarity index 100% rename from src/net/sf/genomeview/plugin/PluginCore.java rename to src/main/java/net/sf/genomeview/plugin/PluginCore.java diff --git a/src/net/sf/genomeview/plugin/PluginLoader.java b/src/main/java/net/sf/genomeview/plugin/PluginLoader.java similarity index 100% rename from src/net/sf/genomeview/plugin/PluginLoader.java rename to src/main/java/net/sf/genomeview/plugin/PluginLoader.java diff --git a/src/org/java/plugin/JpfException.java b/src/main/java/org/java/plugin/JpfException.java similarity index 100% rename from src/org/java/plugin/JpfException.java rename to src/main/java/org/java/plugin/JpfException.java diff --git a/src/org/java/plugin/ObjectFactory.java b/src/main/java/org/java/plugin/ObjectFactory.java similarity index 100% rename from src/org/java/plugin/ObjectFactory.java rename to src/main/java/org/java/plugin/ObjectFactory.java diff --git a/src/org/java/plugin/PathResolver.java b/src/main/java/org/java/plugin/PathResolver.java similarity index 100% rename from src/org/java/plugin/PathResolver.java rename to src/main/java/org/java/plugin/PathResolver.java diff --git a/src/org/java/plugin/Plugin.java b/src/main/java/org/java/plugin/Plugin.java similarity index 100% rename from src/org/java/plugin/Plugin.java rename to src/main/java/org/java/plugin/Plugin.java diff --git a/src/org/java/plugin/PluginClassLoader.java b/src/main/java/org/java/plugin/PluginClassLoader.java similarity index 100% rename from src/org/java/plugin/PluginClassLoader.java rename to src/main/java/org/java/plugin/PluginClassLoader.java diff --git a/src/org/java/plugin/PluginLifecycleException.java b/src/main/java/org/java/plugin/PluginLifecycleException.java similarity index 100% rename from src/org/java/plugin/PluginLifecycleException.java rename to src/main/java/org/java/plugin/PluginLifecycleException.java diff --git a/src/org/java/plugin/PluginManager.java b/src/main/java/org/java/plugin/PluginManager.java similarity index 100% rename from src/org/java/plugin/PluginManager.java rename to src/main/java/org/java/plugin/PluginManager.java diff --git a/src/org/java/plugin/package.html b/src/main/java/org/java/plugin/package.html similarity index 100% rename from src/org/java/plugin/package.html rename to src/main/java/org/java/plugin/package.html diff --git a/src/org/java/plugin/registry/Documentable.java b/src/main/java/org/java/plugin/registry/Documentable.java similarity index 100% rename from src/org/java/plugin/registry/Documentable.java rename to src/main/java/org/java/plugin/registry/Documentable.java diff --git a/src/org/java/plugin/registry/Documentation.java b/src/main/java/org/java/plugin/registry/Documentation.java similarity index 100% rename from src/org/java/plugin/registry/Documentation.java rename to src/main/java/org/java/plugin/registry/Documentation.java diff --git a/src/org/java/plugin/registry/Extension.java b/src/main/java/org/java/plugin/registry/Extension.java similarity index 100% rename from src/org/java/plugin/registry/Extension.java rename to src/main/java/org/java/plugin/registry/Extension.java diff --git a/src/org/java/plugin/registry/ExtensionMultiplicity.java b/src/main/java/org/java/plugin/registry/ExtensionMultiplicity.java similarity index 100% rename from src/org/java/plugin/registry/ExtensionMultiplicity.java rename to src/main/java/org/java/plugin/registry/ExtensionMultiplicity.java diff --git a/src/org/java/plugin/registry/ExtensionPoint.java b/src/main/java/org/java/plugin/registry/ExtensionPoint.java similarity index 100% rename from src/org/java/plugin/registry/ExtensionPoint.java rename to src/main/java/org/java/plugin/registry/ExtensionPoint.java diff --git a/src/org/java/plugin/registry/Identity.java b/src/main/java/org/java/plugin/registry/Identity.java similarity index 100% rename from src/org/java/plugin/registry/Identity.java rename to src/main/java/org/java/plugin/registry/Identity.java diff --git a/src/org/java/plugin/registry/IntegrityCheckReport.java b/src/main/java/org/java/plugin/registry/IntegrityCheckReport.java similarity index 100% rename from src/org/java/plugin/registry/IntegrityCheckReport.java rename to src/main/java/org/java/plugin/registry/IntegrityCheckReport.java diff --git a/src/org/java/plugin/registry/Library.java b/src/main/java/org/java/plugin/registry/Library.java similarity index 100% rename from src/org/java/plugin/registry/Library.java rename to src/main/java/org/java/plugin/registry/Library.java diff --git a/src/org/java/plugin/registry/ManifestInfo.java b/src/main/java/org/java/plugin/registry/ManifestInfo.java similarity index 100% rename from src/org/java/plugin/registry/ManifestInfo.java rename to src/main/java/org/java/plugin/registry/ManifestInfo.java diff --git a/src/org/java/plugin/registry/ManifestProcessingException.java b/src/main/java/org/java/plugin/registry/ManifestProcessingException.java similarity index 100% rename from src/org/java/plugin/registry/ManifestProcessingException.java rename to src/main/java/org/java/plugin/registry/ManifestProcessingException.java diff --git a/src/org/java/plugin/registry/MatchingRule.java b/src/main/java/org/java/plugin/registry/MatchingRule.java similarity index 100% rename from src/org/java/plugin/registry/MatchingRule.java rename to src/main/java/org/java/plugin/registry/MatchingRule.java diff --git a/src/org/java/plugin/registry/ParameterMultiplicity.java b/src/main/java/org/java/plugin/registry/ParameterMultiplicity.java similarity index 100% rename from src/org/java/plugin/registry/ParameterMultiplicity.java rename to src/main/java/org/java/plugin/registry/ParameterMultiplicity.java diff --git a/src/org/java/plugin/registry/ParameterType.java b/src/main/java/org/java/plugin/registry/ParameterType.java similarity index 100% rename from src/org/java/plugin/registry/ParameterType.java rename to src/main/java/org/java/plugin/registry/ParameterType.java diff --git a/src/org/java/plugin/registry/PluginAttribute.java b/src/main/java/org/java/plugin/registry/PluginAttribute.java similarity index 100% rename from src/org/java/plugin/registry/PluginAttribute.java rename to src/main/java/org/java/plugin/registry/PluginAttribute.java diff --git a/src/org/java/plugin/registry/PluginDescriptor.java b/src/main/java/org/java/plugin/registry/PluginDescriptor.java similarity index 100% rename from src/org/java/plugin/registry/PluginDescriptor.java rename to src/main/java/org/java/plugin/registry/PluginDescriptor.java diff --git a/src/org/java/plugin/registry/PluginElement.java b/src/main/java/org/java/plugin/registry/PluginElement.java similarity index 100% rename from src/org/java/plugin/registry/PluginElement.java rename to src/main/java/org/java/plugin/registry/PluginElement.java diff --git a/src/org/java/plugin/registry/PluginFragment.java b/src/main/java/org/java/plugin/registry/PluginFragment.java similarity index 100% rename from src/org/java/plugin/registry/PluginFragment.java rename to src/main/java/org/java/plugin/registry/PluginFragment.java diff --git a/src/org/java/plugin/registry/PluginPrerequisite.java b/src/main/java/org/java/plugin/registry/PluginPrerequisite.java similarity index 100% rename from src/org/java/plugin/registry/PluginPrerequisite.java rename to src/main/java/org/java/plugin/registry/PluginPrerequisite.java diff --git a/src/org/java/plugin/registry/PluginRegistry.java b/src/main/java/org/java/plugin/registry/PluginRegistry.java similarity index 100% rename from src/org/java/plugin/registry/PluginRegistry.java rename to src/main/java/org/java/plugin/registry/PluginRegistry.java diff --git a/src/org/java/plugin/registry/UniqueIdentity.java b/src/main/java/org/java/plugin/registry/UniqueIdentity.java similarity index 100% rename from src/org/java/plugin/registry/UniqueIdentity.java rename to src/main/java/org/java/plugin/registry/UniqueIdentity.java diff --git a/src/org/java/plugin/registry/Version.java b/src/main/java/org/java/plugin/registry/Version.java similarity index 100% rename from src/org/java/plugin/registry/Version.java rename to src/main/java/org/java/plugin/registry/Version.java diff --git a/src/org/java/plugin/registry/package.html b/src/main/java/org/java/plugin/registry/package.html similarity index 100% rename from src/org/java/plugin/registry/package.html rename to src/main/java/org/java/plugin/registry/package.html diff --git a/src/org/java/plugin/registry/xml/BaseHandler.java b/src/main/java/org/java/plugin/registry/xml/BaseHandler.java similarity index 100% rename from src/org/java/plugin/registry/xml/BaseHandler.java rename to src/main/java/org/java/plugin/registry/xml/BaseHandler.java diff --git a/src/org/java/plugin/registry/xml/DocumentationImpl.java b/src/main/java/org/java/plugin/registry/xml/DocumentationImpl.java similarity index 100% rename from src/org/java/plugin/registry/xml/DocumentationImpl.java rename to src/main/java/org/java/plugin/registry/xml/DocumentationImpl.java diff --git a/src/org/java/plugin/registry/xml/ExtensionImpl.java b/src/main/java/org/java/plugin/registry/xml/ExtensionImpl.java similarity index 100% rename from src/org/java/plugin/registry/xml/ExtensionImpl.java rename to src/main/java/org/java/plugin/registry/xml/ExtensionImpl.java diff --git a/src/org/java/plugin/registry/xml/ExtensionPointImpl.java b/src/main/java/org/java/plugin/registry/xml/ExtensionPointImpl.java similarity index 100% rename from src/org/java/plugin/registry/xml/ExtensionPointImpl.java rename to src/main/java/org/java/plugin/registry/xml/ExtensionPointImpl.java diff --git a/src/org/java/plugin/registry/xml/IdentityImpl.java b/src/main/java/org/java/plugin/registry/xml/IdentityImpl.java similarity index 100% rename from src/org/java/plugin/registry/xml/IdentityImpl.java rename to src/main/java/org/java/plugin/registry/xml/IdentityImpl.java diff --git a/src/org/java/plugin/registry/xml/IntegrityChecker.java b/src/main/java/org/java/plugin/registry/xml/IntegrityChecker.java similarity index 100% rename from src/org/java/plugin/registry/xml/IntegrityChecker.java rename to src/main/java/org/java/plugin/registry/xml/IntegrityChecker.java diff --git a/src/org/java/plugin/registry/xml/LibraryImpl.java b/src/main/java/org/java/plugin/registry/xml/LibraryImpl.java similarity index 100% rename from src/org/java/plugin/registry/xml/LibraryImpl.java rename to src/main/java/org/java/plugin/registry/xml/LibraryImpl.java diff --git a/src/org/java/plugin/registry/xml/ManifestHandler.java b/src/main/java/org/java/plugin/registry/xml/ManifestHandler.java similarity index 100% rename from src/org/java/plugin/registry/xml/ManifestHandler.java rename to src/main/java/org/java/plugin/registry/xml/ManifestHandler.java diff --git a/src/org/java/plugin/registry/xml/ManifestInfoHandler.java b/src/main/java/org/java/plugin/registry/xml/ManifestInfoHandler.java similarity index 100% rename from src/org/java/plugin/registry/xml/ManifestInfoHandler.java rename to src/main/java/org/java/plugin/registry/xml/ManifestInfoHandler.java diff --git a/src/org/java/plugin/registry/xml/ManifestParser.java b/src/main/java/org/java/plugin/registry/xml/ManifestParser.java similarity index 100% rename from src/org/java/plugin/registry/xml/ManifestParser.java rename to src/main/java/org/java/plugin/registry/xml/ManifestParser.java diff --git a/src/org/java/plugin/registry/xml/Model.java b/src/main/java/org/java/plugin/registry/xml/Model.java similarity index 100% rename from src/org/java/plugin/registry/xml/Model.java rename to src/main/java/org/java/plugin/registry/xml/Model.java diff --git a/src/org/java/plugin/registry/xml/ParameterValueParser.java b/src/main/java/org/java/plugin/registry/xml/ParameterValueParser.java similarity index 100% rename from src/org/java/plugin/registry/xml/ParameterValueParser.java rename to src/main/java/org/java/plugin/registry/xml/ParameterValueParser.java diff --git a/src/org/java/plugin/registry/xml/PluginAttributeImpl.java b/src/main/java/org/java/plugin/registry/xml/PluginAttributeImpl.java similarity index 100% rename from src/org/java/plugin/registry/xml/PluginAttributeImpl.java rename to src/main/java/org/java/plugin/registry/xml/PluginAttributeImpl.java diff --git a/src/org/java/plugin/registry/xml/PluginDescriptorImpl.java b/src/main/java/org/java/plugin/registry/xml/PluginDescriptorImpl.java similarity index 100% rename from src/org/java/plugin/registry/xml/PluginDescriptorImpl.java rename to src/main/java/org/java/plugin/registry/xml/PluginDescriptorImpl.java diff --git a/src/org/java/plugin/registry/xml/PluginElementImpl.java b/src/main/java/org/java/plugin/registry/xml/PluginElementImpl.java similarity index 100% rename from src/org/java/plugin/registry/xml/PluginElementImpl.java rename to src/main/java/org/java/plugin/registry/xml/PluginElementImpl.java diff --git a/src/org/java/plugin/registry/xml/PluginFragmentImpl.java b/src/main/java/org/java/plugin/registry/xml/PluginFragmentImpl.java similarity index 100% rename from src/org/java/plugin/registry/xml/PluginFragmentImpl.java rename to src/main/java/org/java/plugin/registry/xml/PluginFragmentImpl.java diff --git a/src/org/java/plugin/registry/xml/PluginPrerequisiteImpl.java b/src/main/java/org/java/plugin/registry/xml/PluginPrerequisiteImpl.java similarity index 100% rename from src/org/java/plugin/registry/xml/PluginPrerequisiteImpl.java rename to src/main/java/org/java/plugin/registry/xml/PluginPrerequisiteImpl.java diff --git a/src/org/java/plugin/registry/xml/PluginRegistryImpl.java b/src/main/java/org/java/plugin/registry/xml/PluginRegistryImpl.java similarity index 100% rename from src/org/java/plugin/registry/xml/PluginRegistryImpl.java rename to src/main/java/org/java/plugin/registry/xml/PluginRegistryImpl.java diff --git a/src/org/java/plugin/registry/xml/Resources.properties b/src/main/java/org/java/plugin/registry/xml/Resources.properties similarity index 100% rename from src/org/java/plugin/registry/xml/Resources.properties rename to src/main/java/org/java/plugin/registry/xml/Resources.properties diff --git a/src/org/java/plugin/registry/xml/Resources_de.properties b/src/main/java/org/java/plugin/registry/xml/Resources_de.properties similarity index 100% rename from src/org/java/plugin/registry/xml/Resources_de.properties rename to src/main/java/org/java/plugin/registry/xml/Resources_de.properties diff --git a/src/org/java/plugin/registry/xml/Resources_ru.properties b/src/main/java/org/java/plugin/registry/xml/Resources_ru.properties similarity index 100% rename from src/org/java/plugin/registry/xml/Resources_ru.properties rename to src/main/java/org/java/plugin/registry/xml/Resources_ru.properties diff --git a/src/org/java/plugin/registry/xml/package.html b/src/main/java/org/java/plugin/registry/xml/package.html similarity index 100% rename from src/org/java/plugin/registry/xml/package.html rename to src/main/java/org/java/plugin/registry/xml/package.html diff --git a/src/org/java/plugin/standard/PluginLifecycleHandler.java b/src/main/java/org/java/plugin/standard/PluginLifecycleHandler.java similarity index 100% rename from src/org/java/plugin/standard/PluginLifecycleHandler.java rename to src/main/java/org/java/plugin/standard/PluginLifecycleHandler.java diff --git a/src/org/java/plugin/standard/Resources.properties b/src/main/java/org/java/plugin/standard/Resources.properties similarity index 100% rename from src/org/java/plugin/standard/Resources.properties rename to src/main/java/org/java/plugin/standard/Resources.properties diff --git a/src/org/java/plugin/standard/Resources_de.properties b/src/main/java/org/java/plugin/standard/Resources_de.properties similarity index 100% rename from src/org/java/plugin/standard/Resources_de.properties rename to src/main/java/org/java/plugin/standard/Resources_de.properties diff --git a/src/org/java/plugin/standard/Resources_ru.properties b/src/main/java/org/java/plugin/standard/Resources_ru.properties similarity index 100% rename from src/org/java/plugin/standard/Resources_ru.properties rename to src/main/java/org/java/plugin/standard/Resources_ru.properties diff --git a/src/org/java/plugin/standard/ShadingPathResolver.java b/src/main/java/org/java/plugin/standard/ShadingPathResolver.java similarity index 100% rename from src/org/java/plugin/standard/ShadingPathResolver.java rename to src/main/java/org/java/plugin/standard/ShadingPathResolver.java diff --git a/src/org/java/plugin/standard/StandardObjectFactory.java b/src/main/java/org/java/plugin/standard/StandardObjectFactory.java similarity index 100% rename from src/org/java/plugin/standard/StandardObjectFactory.java rename to src/main/java/org/java/plugin/standard/StandardObjectFactory.java diff --git a/src/org/java/plugin/standard/StandardPathResolver.java b/src/main/java/org/java/plugin/standard/StandardPathResolver.java similarity index 100% rename from src/org/java/plugin/standard/StandardPathResolver.java rename to src/main/java/org/java/plugin/standard/StandardPathResolver.java diff --git a/src/org/java/plugin/standard/StandardPluginClassLoader.java b/src/main/java/org/java/plugin/standard/StandardPluginClassLoader.java similarity index 100% rename from src/org/java/plugin/standard/StandardPluginClassLoader.java rename to src/main/java/org/java/plugin/standard/StandardPluginClassLoader.java diff --git a/src/org/java/plugin/standard/StandardPluginLifecycleHandler.java b/src/main/java/org/java/plugin/standard/StandardPluginLifecycleHandler.java similarity index 100% rename from src/org/java/plugin/standard/StandardPluginLifecycleHandler.java rename to src/main/java/org/java/plugin/standard/StandardPluginLifecycleHandler.java diff --git a/src/org/java/plugin/standard/StandardPluginLocation.java b/src/main/java/org/java/plugin/standard/StandardPluginLocation.java similarity index 100% rename from src/org/java/plugin/standard/StandardPluginLocation.java rename to src/main/java/org/java/plugin/standard/StandardPluginLocation.java diff --git a/src/org/java/plugin/standard/StandardPluginManager.java b/src/main/java/org/java/plugin/standard/StandardPluginManager.java similarity index 100% rename from src/org/java/plugin/standard/StandardPluginManager.java rename to src/main/java/org/java/plugin/standard/StandardPluginManager.java diff --git a/src/org/java/plugin/standard/jpf.properties b/src/main/java/org/java/plugin/standard/jpf.properties similarity index 100% rename from src/org/java/plugin/standard/jpf.properties rename to src/main/java/org/java/plugin/standard/jpf.properties diff --git a/src/org/java/plugin/standard/package.html b/src/main/java/org/java/plugin/standard/package.html similarity index 100% rename from src/org/java/plugin/standard/package.html rename to src/main/java/org/java/plugin/standard/package.html diff --git a/src/org/java/plugin/util/ExtendedProperties.java b/src/main/java/org/java/plugin/util/ExtendedProperties.java similarity index 100% rename from src/org/java/plugin/util/ExtendedProperties.java rename to src/main/java/org/java/plugin/util/ExtendedProperties.java diff --git a/src/org/java/plugin/util/IoUtil.java b/src/main/java/org/java/plugin/util/IoUtil.java similarity index 100% rename from src/org/java/plugin/util/IoUtil.java rename to src/main/java/org/java/plugin/util/IoUtil.java diff --git a/src/org/java/plugin/util/ResourceManager.java b/src/main/java/org/java/plugin/util/ResourceManager.java similarity index 100% rename from src/org/java/plugin/util/ResourceManager.java rename to src/main/java/org/java/plugin/util/ResourceManager.java diff --git a/src/org/java/plugin/util/Resources.properties b/src/main/java/org/java/plugin/util/Resources.properties similarity index 100% rename from src/org/java/plugin/util/Resources.properties rename to src/main/java/org/java/plugin/util/Resources.properties diff --git a/src/org/java/plugin/util/Resources_de.properties b/src/main/java/org/java/plugin/util/Resources_de.properties similarity index 100% rename from src/org/java/plugin/util/Resources_de.properties rename to src/main/java/org/java/plugin/util/Resources_de.properties diff --git a/src/org/java/plugin/util/Resources_ru.properties b/src/main/java/org/java/plugin/util/Resources_ru.properties similarity index 100% rename from src/org/java/plugin/util/Resources_ru.properties rename to src/main/java/org/java/plugin/util/Resources_ru.properties diff --git a/src/org/java/plugin/util/package.html b/src/main/java/org/java/plugin/util/package.html similarity index 100% rename from src/org/java/plugin/util/package.html rename to src/main/java/org/java/plugin/util/package.html diff --git a/resources/conf/dbxref.txt b/src/main/resources/conf/dbxref.txt similarity index 100% rename from resources/conf/dbxref.txt rename to src/main/resources/conf/dbxref.txt diff --git a/resources/conf/default.conf b/src/main/resources/conf/default.conf similarity index 100% rename from resources/conf/default.conf rename to src/main/resources/conf/default.conf diff --git a/resources/conf/example.editor.conf b/src/main/resources/conf/example.editor.conf similarity index 100% rename from resources/conf/example.editor.conf rename to src/main/resources/conf/example.editor.conf diff --git a/resources/conf/example.webintegration.conf b/src/main/resources/conf/example.webintegration.conf similarity index 100% rename from resources/conf/example.webintegration.conf rename to src/main/resources/conf/example.webintegration.conf diff --git a/resources/conf/logging.conf b/src/main/resources/conf/logging.conf similarity index 100% rename from resources/conf/logging.conf rename to src/main/resources/conf/logging.conf diff --git a/resources/conf/ncbi.tsv b/src/main/resources/conf/ncbi.tsv similarity index 100% rename from resources/conf/ncbi.tsv rename to src/main/resources/conf/ncbi.tsv diff --git a/resources/conf/plazainstances.txt b/src/main/resources/conf/plazainstances.txt similarity index 100% rename from resources/conf/plazainstances.txt rename to src/main/resources/conf/plazainstances.txt diff --git a/resources/conf/repositories.txt b/src/main/resources/conf/repositories.txt similarity index 100% rename from resources/conf/repositories.txt rename to src/main/resources/conf/repositories.txt diff --git a/resources/conf/resources.conf b/src/main/resources/conf/resources.conf similarity index 100% rename from resources/conf/resources.conf rename to src/main/resources/conf/resources.conf diff --git a/resources/images/Globe_48x48.png b/src/main/resources/images/Globe_48x48.png similarity index 100% rename from resources/images/Globe_48x48.png rename to src/main/resources/images/Globe_48x48.png diff --git a/resources/images/Hard Disk_48x48.png b/src/main/resources/images/Hard Disk_48x48.png similarity index 100% rename from resources/images/Hard Disk_48x48.png rename to src/main/resources/images/Hard Disk_48x48.png diff --git a/resources/images/arrow_left.png b/src/main/resources/images/arrow_left.png similarity index 100% rename from resources/images/arrow_left.png rename to src/main/resources/images/arrow_left.png diff --git a/resources/images/arrow_right.png b/src/main/resources/images/arrow_right.png similarity index 100% rename from resources/images/arrow_right.png rename to src/main/resources/images/arrow_right.png diff --git a/resources/images/bdash.png b/src/main/resources/images/bdash.png similarity index 100% rename from resources/images/bdash.png rename to src/main/resources/images/bdash.png diff --git a/resources/images/boxopen.png b/src/main/resources/images/boxopen.png similarity index 100% rename from resources/images/boxopen.png rename to src/main/resources/images/boxopen.png diff --git a/resources/images/cog.png b/src/main/resources/images/cog.png similarity index 100% rename from resources/images/cog.png rename to src/main/resources/images/cog.png diff --git a/resources/images/das.png b/src/main/resources/images/das.png similarity index 100% rename from resources/images/das.png rename to src/main/resources/images/das.png diff --git a/resources/images/delete.png b/src/main/resources/images/delete.png similarity index 100% rename from resources/images/delete.png rename to src/main/resources/images/delete.png diff --git a/resources/images/downarrow.png b/src/main/resources/images/downarrow.png similarity index 100% rename from resources/images/downarrow.png rename to src/main/resources/images/downarrow.png diff --git a/resources/images/edit.png b/src/main/resources/images/edit.png similarity index 100% rename from resources/images/edit.png rename to src/main/resources/images/edit.png diff --git a/resources/images/export.png b/src/main/resources/images/export.png similarity index 100% rename from resources/images/export.png rename to src/main/resources/images/export.png diff --git a/resources/images/genomespace.png b/src/main/resources/images/genomespace.png similarity index 100% rename from resources/images/genomespace.png rename to src/main/resources/images/genomespace.png diff --git a/resources/images/gv2.png b/src/main/resources/images/gv2.png similarity index 100% rename from resources/images/gv2.png rename to src/main/resources/images/gv2.png diff --git a/resources/images/help.png b/src/main/resources/images/help.png similarity index 100% rename from resources/images/help.png rename to src/main/resources/images/help.png diff --git a/resources/images/instances/aly.jpg b/src/main/resources/images/instances/aly.jpg similarity index 100% rename from resources/images/instances/aly.jpg rename to src/main/resources/images/instances/aly.jpg diff --git a/resources/images/instances/ath.jpg b/src/main/resources/images/instances/ath.jpg similarity index 100% rename from resources/images/instances/ath.jpg rename to src/main/resources/images/instances/ath.jpg diff --git a/resources/images/instances/b_anthracis.jpg b/src/main/resources/images/instances/b_anthracis.jpg similarity index 100% rename from resources/images/instances/b_anthracis.jpg rename to src/main/resources/images/instances/b_anthracis.jpg diff --git a/resources/images/instances/bdi.jpg b/src/main/resources/images/instances/bdi.jpg similarity index 100% rename from resources/images/instances/bdi.jpg rename to src/main/resources/images/instances/bdi.jpg diff --git a/resources/images/instances/c_elegans.jpg b/src/main/resources/images/instances/c_elegans.jpg similarity index 100% rename from resources/images/instances/c_elegans.jpg rename to src/main/resources/images/instances/c_elegans.jpg diff --git a/resources/images/instances/cpa.jpg b/src/main/resources/images/instances/cpa.jpg similarity index 100% rename from resources/images/instances/cpa.jpg rename to src/main/resources/images/instances/cpa.jpg diff --git a/resources/images/instances/cre.jpg b/src/main/resources/images/instances/cre.jpg similarity index 100% rename from resources/images/instances/cre.jpg rename to src/main/resources/images/instances/cre.jpg diff --git a/resources/images/instances/d_melanogaster.jpg b/src/main/resources/images/instances/d_melanogaster.jpg similarity index 100% rename from resources/images/instances/d_melanogaster.jpg rename to src/main/resources/images/instances/d_melanogaster.jpg diff --git a/resources/images/instances/gma.jpg b/src/main/resources/images/instances/gma.jpg similarity index 100% rename from resources/images/instances/gma.jpg rename to src/main/resources/images/instances/gma.jpg diff --git a/resources/images/instances/hsapiens.png b/src/main/resources/images/instances/hsapiens.png similarity index 100% rename from resources/images/instances/hsapiens.png rename to src/main/resources/images/instances/hsapiens.png diff --git a/resources/images/instances/idea.png b/src/main/resources/images/instances/idea.png similarity index 100% rename from resources/images/instances/idea.png rename to src/main/resources/images/instances/idea.png diff --git a/resources/images/instances/lja.jpg b/src/main/resources/images/instances/lja.jpg similarity index 100% rename from resources/images/instances/lja.jpg rename to src/main/resources/images/instances/lja.jpg diff --git a/resources/images/instances/mdo.jpg b/src/main/resources/images/instances/mdo.jpg similarity index 100% rename from resources/images/instances/mdo.jpg rename to src/main/resources/images/instances/mdo.jpg diff --git a/resources/images/instances/mes.jpg b/src/main/resources/images/instances/mes.jpg similarity index 100% rename from resources/images/instances/mes.jpg rename to src/main/resources/images/instances/mes.jpg diff --git a/resources/images/instances/mouse.jpg b/src/main/resources/images/instances/mouse.jpg similarity index 100% rename from resources/images/instances/mouse.jpg rename to src/main/resources/images/instances/mouse.jpg diff --git a/resources/images/instances/mrcc299.jpg b/src/main/resources/images/instances/mrcc299.jpg similarity index 100% rename from resources/images/instances/mrcc299.jpg rename to src/main/resources/images/instances/mrcc299.jpg diff --git a/resources/images/instances/mtb.jpg b/src/main/resources/images/instances/mtb.jpg similarity index 100% rename from resources/images/instances/mtb.jpg rename to src/main/resources/images/instances/mtb.jpg diff --git a/resources/images/instances/mtr.jpg b/src/main/resources/images/instances/mtr.jpg similarity index 100% rename from resources/images/instances/mtr.jpg rename to src/main/resources/images/instances/mtr.jpg diff --git a/resources/images/instances/ncrassa.png b/src/main/resources/images/instances/ncrassa.png similarity index 100% rename from resources/images/instances/ncrassa.png rename to src/main/resources/images/instances/ncrassa.png diff --git a/resources/images/instances/nopicture.png b/src/main/resources/images/instances/nopicture.png similarity index 100% rename from resources/images/instances/nopicture.png rename to src/main/resources/images/instances/nopicture.png diff --git a/resources/images/instances/olu.jpg b/src/main/resources/images/instances/olu.jpg similarity index 100% rename from resources/images/instances/olu.jpg rename to src/main/resources/images/instances/olu.jpg diff --git a/resources/images/instances/osa.jpg b/src/main/resources/images/instances/osa.jpg similarity index 100% rename from resources/images/instances/osa.jpg rename to src/main/resources/images/instances/osa.jpg diff --git a/resources/images/instances/osaindica.jpg b/src/main/resources/images/instances/osaindica.jpg similarity index 100% rename from resources/images/instances/osaindica.jpg rename to src/main/resources/images/instances/osaindica.jpg diff --git a/resources/images/instances/ota.jpg b/src/main/resources/images/instances/ota.jpg similarity index 100% rename from resources/images/instances/ota.jpg rename to src/main/resources/images/instances/ota.jpg diff --git a/resources/images/instances/ppa.jpg b/src/main/resources/images/instances/ppa.jpg similarity index 100% rename from resources/images/instances/ppa.jpg rename to src/main/resources/images/instances/ppa.jpg diff --git a/resources/images/instances/ptr.jpg b/src/main/resources/images/instances/ptr.jpg similarity index 100% rename from resources/images/instances/ptr.jpg rename to src/main/resources/images/instances/ptr.jpg diff --git a/resources/images/instances/rat.jpg b/src/main/resources/images/instances/rat.jpg similarity index 100% rename from resources/images/instances/rat.jpg rename to src/main/resources/images/instances/rat.jpg diff --git a/resources/images/instances/rco.jpg b/src/main/resources/images/instances/rco.jpg similarity index 100% rename from resources/images/instances/rco.jpg rename to src/main/resources/images/instances/rco.jpg diff --git a/resources/images/instances/saccer.png b/src/main/resources/images/instances/saccer.png similarity index 100% rename from resources/images/instances/saccer.png rename to src/main/resources/images/instances/saccer.png diff --git a/resources/images/instances/sbi.jpg b/src/main/resources/images/instances/sbi.jpg similarity index 100% rename from resources/images/instances/sbi.jpg rename to src/main/resources/images/instances/sbi.jpg diff --git a/resources/images/instances/smeg.jpg b/src/main/resources/images/instances/smeg.jpg similarity index 100% rename from resources/images/instances/smeg.jpg rename to src/main/resources/images/instances/smeg.jpg diff --git a/resources/images/instances/smo.jpg b/src/main/resources/images/instances/smo.jpg similarity index 100% rename from resources/images/instances/smo.jpg rename to src/main/resources/images/instances/smo.jpg diff --git a/resources/images/instances/vca.jpg b/src/main/resources/images/instances/vca.jpg similarity index 100% rename from resources/images/instances/vca.jpg rename to src/main/resources/images/instances/vca.jpg diff --git a/resources/images/instances/vvi.jpg b/src/main/resources/images/instances/vvi.jpg similarity index 100% rename from resources/images/instances/vvi.jpg rename to src/main/resources/images/instances/vvi.jpg diff --git a/resources/images/instances/zma.jpg b/src/main/resources/images/instances/zma.jpg similarity index 100% rename from resources/images/instances/zma.jpg rename to src/main/resources/images/instances/zma.jpg diff --git a/resources/images/invisible.png b/src/main/resources/images/invisible.png similarity index 100% rename from resources/images/invisible.png rename to src/main/resources/images/invisible.png diff --git a/resources/images/logo.png b/src/main/resources/images/logo.png similarity index 100% rename from resources/images/logo.png rename to src/main/resources/images/logo.png diff --git a/resources/images/network_connect.png b/src/main/resources/images/network_connect.png similarity index 100% rename from resources/images/network_connect.png rename to src/main/resources/images/network_connect.png diff --git a/resources/images/network_disconnect.png b/src/main/resources/images/network_disconnect.png similarity index 100% rename from resources/images/network_disconnect.png rename to src/main/resources/images/network_disconnect.png diff --git a/resources/images/no.png b/src/main/resources/images/no.png similarity index 100% rename from resources/images/no.png rename to src/main/resources/images/no.png diff --git a/resources/images/preview.png b/src/main/resources/images/preview.png similarity index 100% rename from resources/images/preview.png rename to src/main/resources/images/preview.png diff --git a/resources/images/redo.png b/src/main/resources/images/redo.png similarity index 100% rename from resources/images/redo.png rename to src/main/resources/images/redo.png diff --git a/resources/images/save.png b/src/main/resources/images/save.png similarity index 100% rename from resources/images/save.png rename to src/main/resources/images/save.png diff --git a/resources/images/search/ensembl.png b/src/main/resources/images/search/ensembl.png similarity index 100% rename from resources/images/search/ensembl.png rename to src/main/resources/images/search/ensembl.png diff --git a/resources/images/search/google.png b/src/main/resources/images/search/google.png similarity index 100% rename from resources/images/search/google.png rename to src/main/resources/images/search/google.png diff --git a/resources/images/search/ncbi.png b/src/main/resources/images/search/ncbi.png similarity index 100% rename from resources/images/search/ncbi.png rename to src/main/resources/images/search/ncbi.png diff --git a/resources/images/search/plaza.png b/src/main/resources/images/search/plaza.png similarity index 100% rename from resources/images/search/plaza.png rename to src/main/resources/images/search/plaza.png diff --git a/resources/images/settings.png b/src/main/resources/images/settings.png similarity index 100% rename from resources/images/settings.png rename to src/main/resources/images/settings.png diff --git a/resources/images/splash.png b/src/main/resources/images/splash.png similarity index 100% rename from resources/images/splash.png rename to src/main/resources/images/splash.png diff --git a/resources/images/undo.png b/src/main/resources/images/undo.png similarity index 100% rename from resources/images/undo.png rename to src/main/resources/images/undo.png diff --git a/resources/images/uparrow.png b/src/main/resources/images/uparrow.png similarity index 100% rename from resources/images/uparrow.png rename to src/main/resources/images/uparrow.png diff --git a/resources/images/vib.png b/src/main/resources/images/vib.png similarity index 100% rename from resources/images/vib.png rename to src/main/resources/images/vib.png diff --git a/resources/images/visible.png b/src/main/resources/images/visible.png similarity index 100% rename from resources/images/visible.png rename to src/main/resources/images/visible.png diff --git a/resources/images/web.png b/src/main/resources/images/web.png similarity index 100% rename from resources/images/web.png rename to src/main/resources/images/web.png diff --git a/resources/images/yes.png b/src/main/resources/images/yes.png similarity index 100% rename from resources/images/yes.png rename to src/main/resources/images/yes.png diff --git a/resources/images/zoom_in.png b/src/main/resources/images/zoom_in.png similarity index 100% rename from resources/images/zoom_in.png rename to src/main/resources/images/zoom_in.png diff --git a/resources/images/zoom_out.png b/src/main/resources/images/zoom_out.png similarity index 100% rename from resources/images/zoom_out.png rename to src/main/resources/images/zoom_out.png diff --git a/resources/lang/Messages.properties b/src/main/resources/lang/Messages.properties similarity index 100% rename from resources/lang/Messages.properties rename to src/main/resources/lang/Messages.properties diff --git a/resources/lang/Messages_ES.properties b/src/main/resources/lang/Messages_ES.properties similarity index 100% rename from resources/lang/Messages_ES.properties rename to src/main/resources/lang/Messages_ES.properties diff --git a/resources/lang/Messages_FR.properties b/src/main/resources/lang/Messages_FR.properties similarity index 100% rename from resources/lang/Messages_FR.properties rename to src/main/resources/lang/Messages_FR.properties diff --git a/src/org/java/plugin/registry/xml/plugin_1_0.dtd b/src/main/resources/org/java/plugin/registry/xml/plugin_1_0.dtd similarity index 100% rename from src/org/java/plugin/registry/xml/plugin_1_0.dtd rename to src/main/resources/org/java/plugin/registry/xml/plugin_1_0.dtd diff --git a/resources/plugin.xml b/src/main/resources/plugin.xml similarity index 100% rename from resources/plugin.xml rename to src/main/resources/plugin.xml diff --git a/resources/web/ncbi.tsv b/src/main/resources/web/ncbi.tsv similarity index 100% rename from resources/web/ncbi.tsv rename to src/main/resources/web/ncbi.tsv diff --git a/resources/web/public.tsv b/src/main/resources/web/public.tsv similarity index 100% rename from resources/web/public.tsv rename to src/main/resources/web/public.tsv diff --git a/resources/web/synonyms.txt b/src/main/resources/web/synonyms.txt similarity index 100% rename from resources/web/synonyms.txt rename to src/main/resources/web/synonyms.txt diff --git a/src/net/sf/jannot/AminoAcidMapping.java b/src/net/sf/jannot/AminoAcidMapping.java deleted file mode 100644 index e86e288..0000000 --- a/src/net/sf/jannot/AminoAcidMapping.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import java.util.HashMap; - -import be.abeel.io.LineIterator; -import be.abeel.util.DefaultHashMap; - -/** - * Enumerates different genetic codes. - * - * Source of genetic codes: - * http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi - * - * @author Thomas Abeel - * - */ -public enum AminoAcidMapping { - - STANDARDCODE("standard"), YEASTMITOCHONDRIAL("yeastMitochondrial"), INVERTEBRATEMITOCHONDRIAL( - "invertebrateMitochondrial"), EUPLOTIDNUCLEAR("euplotidNuclear"), TABLE11( - "table11"), TABLE12("table12"), TABLE13("table13"), TABLE14( - "table14"), TABLE15("table15"), TABLE16("table16"), TABLE21( - "table21"), TABLE22("table22"), TABLE23("table23"), TABLE4("table4"), TABLE6( - "table6"), TABLE9("table9"), VERTEBRATEMITOCHONDRIAL( - "vertebrateMitochondrial"); - - /* - * Maps codons to amino acids. - */ - private HashMap mapping = new HashMap(); - /* Maps codons to whether they are valid starts */ - private HashMap startmap = new DefaultHashMap( - Boolean.FALSE); - /* - * The full name of a genetic code. This is the first line in the - * description file, if one is present. - */ - private String fullName = null; - /* - * Contains a complete description of the genetic code - */ - private String description = null; - - private AminoAcidMapping(String resource) { - LineIterator it = new LineIterator(AminoAcidMapping.class - .getResourceAsStream("aamapping/" + resource)); - it.setSkipBlanks(true); - char[] aa = it.next().split("=")[1].trim().toCharArray(); - char[] start = it.next().split("=")[1].trim().toCharArray(); - char[] base1 = it.next().split("=")[1].trim().toLowerCase() - .toCharArray(); - char[] base2 = it.next().split("=")[1].trim().toLowerCase() - .toCharArray(); - char[] base3 = it.next().split("=")[1].trim().toLowerCase() - .toCharArray(); - for (int i = 0; i < aa.length; i++) { - mapping.put("" + base1[i] + base2[i] + base3[i], aa[i]); - if (start[i] != '-') - startmap.put("" + base1[i] + base2[i] + base3[i], true); - } - try { - it = new LineIterator(AminoAcidMapping.class - .getResourceAsStream("aamapping/" + resource - + ".description")); - String line = it.next(); - fullName = line; - StringBuffer buf = new StringBuffer(); - while (it.hasNext()) { - line = it.next(); - if (line.startsWith("\\*")) { - line = "" + line + ""; - } - buf.append(line + "\n"); - - } - description = buf.toString(); - } catch (NullPointerException e) { - /* There may not be a description for this particular encoding */ - // XXX Once all genetic codes have a description, this can be - // removed - } - } - - @Override - public String toString() { - if (fullName != null) - return fullName; - else - return super.toString(); - } - - public String getDescription() { - return description; - } - - public char get(String codon) { - Character c = mapping.get(codon.toLowerCase()); - if (c == null) - return 'X'; - else - return c; - } - - public boolean isStart(String codon) { - return startmap.get(codon.toLowerCase()); - } - - public boolean isStop(char aa) { - return aa=='*'; - } - -} diff --git a/src/net/sf/jannot/Cleaner.java b/src/net/sf/jannot/Cleaner.java deleted file mode 100644 index dbfd943..0000000 --- a/src/net/sf/jannot/Cleaner.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import java.io.File; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.util.ArrayList; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.samtools.SAMFileReader; -import net.sf.samtools.seekablestream.SeekableStream; - -/** - * - * Registry for random access files that need to be closed. - * - * See http://bugs.sun.com/view_bug.do?bug_id=6357433 - * - * for explanation why we need to to it the hard way. - * - * @author Thomas Abeel - * - */ -public class Cleaner { - - private static ArrayList rafs = new ArrayList(); - private static ArrayList files = new ArrayList(); - private static ArrayList streams = new ArrayList(); - private static ArrayList sfrs = new ArrayList(); - - public static void register(SAMFileReader sfr, SeekableStream content, File f) { - sfrs.add(sfr); - if(f!=null) - files.add(f); - streams.add(content); - } - - public static void register(RandomAccessFile raf, File f) { - rafs.add(raf); - files.add(f); - } - - private static Logger log = Logger.getLogger(Cleaner.class.getCanonicalName()); - - public static void exit() { - - for (SeekableStream s : streams) { - try { - - s.close(); - } catch (Exception e) { - log.log(Level.WARNING, "Failed to close SeekableStream "+s.getSource(), e); - } - } - - for (SAMFileReader sfr : sfrs) { - try { - sfr.getIndex().close(); - sfr.close(); - } catch (Exception e) { - log.log(Level.WARNING, "Failed to close SAMFileReader "+sfr, e); - } - } - - for (RandomAccessFile raf : rafs) { - try { - raf.close(); - } catch (IOException e) { - log.log(Level.WARNING, "Failed to close RandomAccessFile "+raf, e); - } - - } - System.gc(); - System.gc(); - for (File file : files) { - - if (file.delete()) { - log.info("Successfully deleted: " + file); - } else { - log.info("Failed to delete: " + file); - } - - } - - } - -} diff --git a/src/net/sf/jannot/Data.java b/src/net/sf/jannot/Data.java deleted file mode 100644 index fc6ec7b..0000000 --- a/src/net/sf/jannot/Data.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -/** - * Data for an entry - * - * @author Thomas Abeel - */ -public interface Data { - - /** - * Gets data. The selected data should cover [start,end[. The coordinates - * are one based. - * - * @param start - * the start coordinate, this one will be included. This is a - * one-based coordinate. - * @param end - * the end coordinate, this one will not be included. This is a - * one-based coordinate. - * @return the selected data. - */ - public Iterable get(int start, int end); - - public Iterable get(); - - /** - * @return - */ - public boolean canSave(); - - public String label(); - -} \ No newline at end of file diff --git a/src/net/sf/jannot/DataKey.java b/src/net/sf/jannot/DataKey.java deleted file mode 100644 index b5dcfea..0000000 --- a/src/net/sf/jannot/DataKey.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -/** - * Keys for the entry data - * - * @author Thomas Abeel - */ -public interface DataKey extends Comparable { - -} diff --git a/src/net/sf/jannot/DensityEstimate.java b/src/net/sf/jannot/DensityEstimate.java deleted file mode 100644 index 6e5b6bc..0000000 --- a/src/net/sf/jannot/DensityEstimate.java +++ /dev/null @@ -1,14 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -/** - * @author Thomas Abeel - * - */ -public interface DensityEstimate { - - public int getEstimateCount(Location l); - public int getMaximumCoordinate(); -} diff --git a/src/net/sf/jannot/Description.java b/src/net/sf/jannot/Description.java deleted file mode 100644 index 1df477a..0000000 --- a/src/net/sf/jannot/Description.java +++ /dev/null @@ -1,246 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import java.util.HashMap; -import java.util.Set; -/** - * - * @author Thomas Abeel - * - */ -public class Description { - - private HashMap keyValues = new HashMap(); - - public Setkeys(){ - return keyValues.keySet(); - } - - public void put(String key, String value) { - keyValues.put(key, value); -// setChanged(); -// notifyObservers(); - } - - public String get(String key) { - return keyValues.get(key); - } - - // private String msg; - // - // public final String getMsg() { - // return msg; - // } - - // public final void setMsg(String msg) { - // this.msg = msg; - // setChanged(); - // notifyObservers(); - // } - - // private List accessionNumbers = new Vector(); - - // public List getAccessionNumbers() { - // return Collections.unmodifiableList(accessionNumbers); - // } - - // public void addAccessionNumber(String s) { - // if (!accessionNumbers.contains(s)) - // accessionNumbers.add(s); - // if (primaryAccessionNumber == null) - // primaryAccessionNumber = s; - // setChanged(); - // notifyObservers(); - // - // } - - // /* Project identifier */ - // private String projectIdentifier = null; - // - // public void setProjectIdentifier(String s) { - // this.projectIdentifier = s; - // setChanged(); - // notifyObservers(); - // - // } - - // private StringBuffer freeDescription = new StringBuffer(); - // - // public void addDescriptionLine(String s) { - // freeDescription.append(s + "\n"); - // setChanged(); - // notifyObservers(); - // } - - // private Map freeDescriptionPairs = new HashMap(); - // - // public void addDescriptionValue(String key, String value) { - // freeDescriptionPairs.put(key, value); - // setChanged(); - // notifyObservers(); - // } - - // public String getDescriptionValue(String key) { - // return freeDescriptionPairs.get(key); - // } - // - // private String primaryAccessionNumber = null; - - // public void setPrimaryAccessionNumber(String s) { - // this.primaryAccessionNumber = s; - // if (!accessionNumbers.contains(s)) - // accessionNumbers.add(s); - // setChanged(); - // notifyObservers(); - // - // } - - // private String sequenceVersion = null; - // - // private String taxonomicDivision; - // - // private String dataClass; - // - // private String moleculeType; - // - // public void setSequenceVersion(String trim) { - // this.sequenceVersion = trim; - // setChanged(); - // notifyObservers(); - // - // } - // - // public void setMoleculeType(String trim) { - // this.moleculeType = trim; - // setChanged(); - // notifyObservers(); - // - // } - - // /** - // * Class Definition ----------- - // * ----------------------------------------------------------- CON Entry - // * constructed from segment entry sequences, drawing annotation from - // segment - // * entries ANN Entry constructed from segment entry sequences with its own - // * annotation PAT Patent EST Expressed Sequence Tag GSS Genome Survey - // * Sequence HTC High Thoughput CDNA sequencing HTG High Thoughput Genome - // * sequencing MGA Mass Genome Annotation WGS Whole Genome Shotgun TPA - // Third - // * Party Annotation STS Sequence Tagged Site STD Standard (all entries not - // * classified as above) - // * - // * @param trim - // */ - // public void setDataClass(String trim) { - // this.dataClass = trim; - // setChanged(); - // notifyObservers(); - // - // } - - // /** - // * Division Code ----------------- ---- Bacteriophage PHG Environmental - // * Sample ENV Fungal FUN Human HUM Invertebrate INV Other Mammal MAM Other - // * Vertebrate VRT Mus musculus MUS Plant PLN Prokaryote PRO Other Rodent - // ROD - // * Synthetic SYN Transgenic TGN Unclassified UNC Viral VRL - // * - // * @param trim - // */ - // public void setTaxonomicDivision(String trim) { - // this.taxonomicDivision = trim; - // setChanged(); - // notifyObservers(); - // - // } - // - // private String firstDate = null; - // - // private String secondData = null; - // - // public void setFirstDate(String substring) { - // this.firstDate = substring; - // setChanged(); - // notifyObservers(); - // - // } - // - // public void setSecondDate(String substring) { - // this.secondData = substring; - // setChanged(); - // notifyObservers(); - // - // } - // - // public final String getProjectIdentifier() { - // return projectIdentifier; - // } - - // public final StringBuffer getFreeDescription() { - // StringBuffer desc = new StringBuffer(freeDescription); - // desc.append(System.getProperty("line.separator")); - // for (String key : freeDescriptionPairs.keySet()){ - // desc.append(key+"="+freeDescriptionPairs.get(key)); - // desc.append(System.getProperty("line.separator")); - // } - // return freeDescription; - // } - - // public final String getPrimaryAccessionNumber() { - // return primaryAccessionNumber; - // } - - // public final String getSequenceVersion() { - // return sequenceVersion; - // } - // - // public final String getTaxonomicDivision() { - // return taxonomicDivision; - // } - - // public final String getDataClass() { - // return dataClass; - // } - // - // public final String getMoleculeType() { - // return moleculeType; - // } - // - // public final String getFirstDate() { - // return firstDate; - // } - // - // public final String getSecondData() { - // return secondData; - // } - - @Override - public String toString() { -// if (id != null) { -// return id; -// } else - return keyValues.toString(); - } - - /** - * Add a value to a key. If the keys doesn't exist yet, it is added. - * Different values for a key are separated with a line break. - * - * @param key - * key to use - * @param value - * value to add to the key - */ - public void add(String key, String value) { - if (!keyValues.containsKey(key)) { - put(key, value); - } else { - put(key, get(key) + "\n" + value); - } - - } -} diff --git a/src/net/sf/jannot/Entry.java b/src/net/sf/jannot/Entry.java deleted file mode 100644 index a550396..0000000 --- a/src/net/sf/jannot/Entry.java +++ /dev/null @@ -1,200 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.logging.Logger; - -import net.sf.jannot.refseq.MemorySequence; -import net.sf.jannot.refseq.Sequence; -import net.sf.jannot.shortread.ReadGroup; -import net.sf.nameservice.NameService; - -/** - * Each Entry contains information about a specific genome/chromossomes or any - * chunck of DNA. - * - * With the chunk we associate a sequence, feature annotation, a description, - * graph annotation and alignment annotation. - * - * In order to load data to an Entry set, you should use the class Filesource. - * - * e.g.: EntrySet set = new FileSource(new File("sequence.fasta")).read(); - * - * will read a sequence from a fasta to Entryset set. - * - * new FileSource(new File("sequence.gff")).read(set); - * - * will read notations from the .gff file to Entryset set. - * - * - * - * - * @author Thomas Abeel - * - */ -public class Entry implements Comparable, Iterable { - -// static final NameService ns=new NameService(); - - private static final StringKey seqKey = new StringKey("SEQ*(^#%(@#%)@#^@#^))^)@#)^(@#%^*()SEQ"); - - private static final Logger log=Logger.getLogger(Entry.class.getCanonicalName()); - - final public Description description = new Description(); - - private Map> data = new HashMap>(); - - /** - * Returns the highest position for which there is data - * - * @return - */ - public int getMaximumLength() { - // FIXME think of a more efficient way - long maxSize = 0; - for (DataKey dk : this) { - Data newData = data.get(dk); - /* Update maximum size if applicable */ - long s = 0; - if (newData instanceof Sequence) - s = ((Sequence) newData).size(); - - if (newData instanceof FeatureAnnotation) - s = ((FeatureAnnotation) newData).getMaximumCoordinate(); - - // System.out.println("s update: " + s); - if (s > maxSize) - maxSize = s; - } - return (int) maxSize; - } - - // public AlignmentAnnotation align = null; - - public void add(DataKey key, Data newData) { - - if (!data.containsKey(key)) { - data.put(key, newData); - // if (newData instanceof AlignmentAnnotation) - // align = (AlignmentAnnotation) newData; - } else { - // FIXME implement for feature data */ - log.severe("Already here, you lose!!!"); - - } - - } - - /** - * @param dataKey - * @return - */ - public Data get(DataKey dataKey) { - return data.get(dataKey); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Iterable#iterator() - */ - @Override - public Iterator iterator() { - return data.keySet().iterator(); - } - - /** - * @return - */ - public Iterable shortReads() { - ArrayList out = new ArrayList(); - for (DataKey key : data.keySet()) { - Data x = data.get(key); - if (x instanceof ReadGroup) - out.add((ReadGroup) x); - } - return out; - } - - /** - * @param type - * @return - */ - public MemoryFeatureAnnotation getMemoryAnnotation(DataKey type) { - if (!data.containsKey(type)) - this.add(type, new MemoryFeatureAnnotation()); - Data tmp = this.get(type); - if (tmp instanceof MemoryFeatureAnnotation) - return (MemoryFeatureAnnotation) tmp; - else - return null; - - } - - private final String id; - - public Sequence sequence() { - if (!data.containsKey(seqKey)) { - data.put(seqKey, new MemorySequence()); - } - return (Sequence) data.get(seqKey); - } - - public Entry(String id) { - id=NameService.getPrimaryName(id); - if (id == null) - throw new RuntimeException("Should never be null!"); - this.id = id; - - - } - - @Override - public String toString() { - return id; - } - - /** - * Shortcut to access the id - * - * @return - */ - public String getID() { - return id; - } - /* - * (non-Javadoc) - * - * @see java.lang.Comparable#compareTo(java.lang.Object) - */ - @Override - public int compareTo(Entry o) { - return this.getID().compareTo(o.getID()); - } - - /** - * @param dataKey - * @return - */ - public boolean contains(DataKey dataKey) { - return data.containsKey(dataKey); - } - - public void setSequence(Sequence seq) { - data.put(seqKey, seq); - } - - /** - * @param dataKey - */ - public void remove(DataKey dataKey) { - data.remove(dataKey); - - } - -} diff --git a/src/net/sf/jannot/EntrySet.java b/src/net/sf/jannot/EntrySet.java deleted file mode 100644 index e093a3b..0000000 --- a/src/net/sf/jannot/EntrySet.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.concurrent.ConcurrentSkipListSet; - -import net.sf.nameservice.NameService; - -/** - * Top level class for JAnnot, this class represents a set of {@link Entry}. - * - * - * @author Thomas Abeel - * - */ -public class EntrySet implements Iterable{ - - /* EntrySet level annotation, typically annotation types spanning multiple entries like comparative data */ - final public SyntenicAnnotation syntenic = new SyntenicAnnotation(); - - final public Description description = new Description(); - - private ConcurrentSkipListSet entries = new ConcurrentSkipListSet(); - private HashMap map = new HashMap(); - - /* - * This should be the only way to access the map as it does some key mapping - */ - private Entry mapGet(String key){ - Entry out=map.get(key); - if(out==null) - out=map.get(key.toLowerCase()); - if(out==null) - out=map.get("chr"+key); - if(out==null&&key.toLowerCase().startsWith("chr")) - out=map.get(key.substring(3)); - - return out; - } - - - @Override - public Iterator iterator() { - return entries.iterator(); - } - - public synchronized Entry getOrCreateEntry(String string) { - string=NameService.getPrimaryName(string); - if(mapGet(string)==null){ - Entry e=new Entry(string); - map.put(string, e); - entries.add(e); - } - return mapGet(string); - } - - public synchronized Entry firstEntry(){ - return entries.first(); - } - public synchronized Entry getEntry(String string) { - return mapGet(NameService.getPrimaryName(string)); - - } - - public int size() { - return map.size(); - } - - public void clear() { - entries.clear(); - map.clear(); - syntenic.clear(); - - - } - - -} diff --git a/src/net/sf/jannot/EntrySetAnnotation.java b/src/net/sf/jannot/EntrySetAnnotation.java deleted file mode 100644 index 2d5d34e..0000000 --- a/src/net/sf/jannot/EntrySetAnnotation.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.sf.jannot.alignment.mfa.AlignmentAnnotation; -import net.sf.jannot.shortread.ShortRead; - -/** - * Interface for annotation associated with an EntrySet of type T. - * - * @author Thomas Abeel - * - * @param - * type of the annotation - * @see FeatureAnnotation - * @see AlignmentAnnotation - * @see SyntenicAnnotation - * @see GraphAnnotation - */ -public abstract class EntrySetAnnotation implements Iterable { - - - /** - * Returns all object of type T that overlap with the provided location. - * - * @param l - * @return - */ - public Iterable get(Entry e,Location l){ - return getAll(e); - } - - public abstract boolean contains(T t); - /** - * Returns all object of type T that overlap with the provided location. - * - * @param l - * @return - */ - public Iterable get(Entry e,Location l,int limit){ - return get(e,l); - } - -// public void addAll(EntrySetAnnotation ts){ -// addAll(ts.getAll(e)) -// } -// -// public void addAll(Iterable list){ -// for(T t:list) -// this.list.add(t); -// setChanged(); -// notifyObservers(); -// } - - - - - public abstract Iterable getAll(Entry e) ; - - - public abstract void add(T g); - - - - @Override - public abstract Iterator iterator(); - - - -} diff --git a/src/net/sf/jannot/Feature.java b/src/net/sf/jannot/Feature.java deleted file mode 100644 index beff7cc..0000000 --- a/src/net/sf/jannot/Feature.java +++ /dev/null @@ -1,480 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.jannot.event.ChangeEvent; -import net.sf.jannot.event.FeatureEvent; - -/** - * - * Features are set of characteristics which describe a genome. Lines of a .gff - * file are example of feature. e.g. start and end position of a coding region. - * - * TODO improve this documentation - * - * @author Thomas Abeel - */ -public class Feature implements Comparable, Located { - - private Logger log = Logger.getLogger(Feature.class.getCanonicalName()); - private Location[] location = null; - - private Location singleLocation = null; - - private byte[] phase = null; - - private Type type; - - private Strand strand = Strand.UNKNOWN; - - private Map qualifiers = new HashMap(); - - /** - * Add a new qualifier to this Feature. - * - * The value should not contain line-breaks. - * - * @param key - * of the qualifier - * @param value - * value - */ - public void addQualifier(String key, String value) { - if (value != null) { - assert key != null; - key = key.intern(); - - } - /* Remove line breaks in value */ - if (value != null) - value = value.replaceAll("\n", ""); - - if (!key.equals("score")&&qualifiers.containsKey(key)) - qualifiers.put(key, qualifiers.get(key) + "," + value); - else - qualifiers.put(key, value); - - if (key.equals("score")) - scoreBuffer = false; - - } - - public void setQualifier(String key, String value) { - if(key!=null) - qualifiers.remove(key); - addQualifier(key, value); - - - } - - @Override - public boolean equals(Object f) { - return this == f; - } - - public Type type() { - return type; - - } - - public void setLocation(Collection tmp) { - if (tmp.size() == 1) { - setLocation(tmp.iterator().next()); - } else { - singleLocation = null; - SortedSet set = new TreeSet(); - for (Location l : tmp) - set.add(l); - location = new Location[set.size()]; - int idx = 0; - for (Location l : set) { - location[idx++] = l; - - } - for (Location x : this.location) { - x.setParent(this); - } - updatePhase(); - } - } - - public void setLocation(Location l) { - location = null; - phase = null; - singleLocation = l; - fStart = l.start(); - fEnd = l.end(); - singleLocation.setParent(this); - } - - public void setLocation(Location[] l) { - if (l.length == 1) - setLocation(l[0]); - else { - singleLocation = null; - this.location = l; - for (Location tmp : this.location) { - tmp.setParent(this); - } - - updatePhase(); - - } - - } - - public boolean overlaps(Location otherLoc) { - return otherLoc.overlaps(fStart, fEnd); - } - - public boolean overlaps(Feature otherFeat) { - Location thisLoc = new Location(fStart, fEnd); - return thisLoc.overlaps(otherFeat.fStart, otherFeat.fEnd); - } - - public ChangeEvent setStrand(Strand s) { - ChangeEvent ce = new ChangeStrandEvent(this, this.strand, s); - ce.doChange(); - if (location != null) { - updatePhase(); - } - return ce; - - } - - class ChangeTypeEvent extends FeatureEvent { - private Type prev, next; - - public final Type getPrev() { - return prev; - } - - public final Type getNext() { - return next; - } - - public ChangeTypeEvent(Feature f, Type prev, Type next) { - super(f, "set type to " + next); - this.next = next; - this.prev = prev; - } - - @Override - public void doChange() { - type = next; - - } - - @Override - public void undoChange() { - assert (type == next); - type = prev; - - } - - } - - public ChangeEvent setType(Type type) { - ChangeEvent ce = new ChangeTypeEvent(this, this.type, type); - ce.doChange(); - return ce; - - } - - private int fStart = -1; - private int fEnd = -1; - - // private Location fLocation = new Location(-1, -1); - - /** - * Phase is not the same thing as Frame. Phase is the number of bases to - * skip before reading in-frame, while frame is the actual frame identifier - * beginning at 1. - */ - void updatePhase() { - if (singleLocation == null && location == null) - return; - - Location[] tmpLoc = location(); - - phase = new byte[tmpLoc.length]; - - int fStart = Integer.MAX_VALUE; - int fEnd = 0; - - for (Location l : tmpLoc) { - if (l.start() < fStart) - fStart = l.start(); - if (l.end() > fEnd) - fEnd = l.end(); - } - this.fStart = fStart; - this.fEnd = fEnd; - - int currentPhase = 0; - if (strand == Strand.FORWARD) { - for (int i = 0; i < tmpLoc.length; i++) { - phase[i] = (byte) currentPhase; - // phase.put(location[i], currentPhase); - currentPhase = (tmpLoc[i].length() - currentPhase); - currentPhase %= 3; - currentPhase = 3 - currentPhase; - currentPhase %= 3; - } - } else if (strand == Strand.REVERSE) { - for (int i = tmpLoc.length - 1; i >= 0; i--) { - // phase.put(tmpLoc.get(i), currentPhase); - phase[i] = (byte) currentPhase; - currentPhase = (tmpLoc[i].length() - currentPhase); - currentPhase %= 3; - currentPhase = 3 - currentPhase; - currentPhase %= 3; - } - } else { - for (int i = 0; i < tmpLoc.length; i++) - phase[i] = 0; - // phase.put(location.get(i), 0); - } - - } - - public Location[] location() { - if (location == null) { - assert singleLocation != null; - if(singleLocation==null) - return new Location[0]; - else - return new Location[] { singleLocation }; - } else - return location; - - } - - public int length() { - return fEnd - fStart + 1; - } - - @Override - public int compareTo(Feature o) { - - int comp = new Integer(fStart).compareTo(o.fStart); - if (comp == 0) - comp = new Integer(fEnd).compareTo(o.fEnd); - - if (comp == 0) - return new Integer(hashCode()).compareTo(o.hashCode()); - else - return comp; - } - - public Strand strand() { - return strand; - } - - public void removeQualifier(String key){ - qualifiers.remove(key); - } - - public String qualifier(String key) { - return qualifiers.get(key); - - } - - public Set getQualifiersKeys() { - return qualifiers.keySet(); - } - - /** - * Creates a deep copy of this feature. - * - * @return - */ - public Feature copy() { - Feature out = new Feature(); - SortedSet loc = new TreeSet(); - for (Location l : this.location()) { - loc.add(l.copy()); - } - out.setLocation(loc); - out.setStrand(this.strand()); - - for (String key : qualifiers.keySet()) - out.addQualifier(key, qualifiers.get(key)); - out.type = this.type(); - return out; - } - - // private double bufferedScore = Double.NaN; - @Deprecated - public void setScore(double score) { - // if(score!=bufferedScore){ - setQualifier("score", "" + score); - scoreBuffer=false; - // bufferedScore=score; - // } - // this.score = score; - - } - - private boolean scoreBuffer = false; - private double score = Double.NaN; - - public double getScore() { - if (scoreBuffer) { - return score; - } else { - String val = qualifier("score"); - if (val == null) - return 0; - else { - scoreBuffer = true; - double tmpScore = 0; - try { - tmpScore = Double.parseDouble(val); - } catch (Exception e) { - log.log(Level.WARNING, "Could not parse score: " + val, e); - } - score=tmpScore; - return score; - } - } - } - - @Override - public String toString() { - if (type != null) - return type.toString() + " [" + new Location(fStart, fEnd) + "]"; - else - return "[" + new Location(fStart, fEnd).toString() + "]"; - } - - public int getFrame() { - int frame; - if (location == null) { - if (strand == Strand.REVERSE) - frame = fEnd % 3; - else - frame = fStart % 3; - } else { - if (strand == Strand.REVERSE) - frame = (location[location.length - 1].end()) % 3; - else - frame = (location[0].start()) % 3; - } - return frame == 0 ? 3 : frame; - - } - - public int getPhase(int idx) { - if (location == null) - return 0; - else - return phase[idx]; - - } - - class ChangeStrandEvent extends FeatureEvent { - private Strand from, to; - - public ChangeStrandEvent(Feature f, Strand from, Strand to) { - super(f, "Change strand from " + from.symbol() + " to " + to.symbol()); - this.from = from; - this.to = to; - } - - @Override - public void doChange() { - super.getFeature().strand = to; - - } - - @Override - public void undoChange() { - super.getFeature().strand = from; - - } - - } - - /** - * @return - */ - public String getColor() { - String notes = this.qualifier("colour"); - if (notes == null) - notes = this.qualifier("color"); - return notes; - } - - /** - * - */ - public void clearQualifiers() { - qualifiers.clear(); - - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Located#start() - */ - @Override - public int start() { - return fStart; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Located#end() - */ - @Override - public int end() { - return fEnd; - } - - /** - * @param l - */ - public void addLocation(Location l) { - List arr = new ArrayList(); - if (singleLocation != null) - arr.add(singleLocation); - if (location != null) { - for (Location ll : location) - arr.add(ll); - } - arr.add(l); - setLocation(arr); - } - - /** - * @param rf - */ - public void removeLocation(Location rf) { - List arr = new ArrayList(); - if (singleLocation != null) - throw new RuntimeException("Can not remove the last location!!!"); - if (location != null) { - for (Location ll : location) - if (!ll.equals(rf)) - arr.add(ll); - } - setLocation(arr); - - } - -} diff --git a/src/net/sf/jannot/FeatureAnnotation.java b/src/net/sf/jannot/FeatureAnnotation.java deleted file mode 100644 index 6aa2efa..0000000 --- a/src/net/sf/jannot/FeatureAnnotation.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - - -/** - * Represents the annotation of a single type - * - * @author Thomas Abeel - */ -public interface FeatureAnnotation extends DensityEstimate, Data { - - -} diff --git a/src/net/sf/jannot/ListIterable.java b/src/net/sf/jannot/ListIterable.java deleted file mode 100644 index cdec87b..0000000 --- a/src/net/sf/jannot/ListIterable.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.sf.jannot; - -import java.lang.reflect.Array; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; - -/** - * This Iterator is used to iterate over Lists without fail-fast behavior. - */ -public class ListIterable implements Iterable { - - public ListIterable(List array) { - this.array = array; - } - - private List array; - - - - /* - * (non-Javadoc) - * - * @see java.lang.Iterable#iterator() - */ - @Override - public Iterator iterator() { - return new ListIterator(array); - } -} diff --git a/src/net/sf/jannot/ListIterator.java b/src/net/sf/jannot/ListIterator.java deleted file mode 100644 index cc13e23..0000000 --- a/src/net/sf/jannot/ListIterator.java +++ /dev/null @@ -1,76 +0,0 @@ -package net.sf.jannot; - -import java.lang.reflect.Array; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; - -/** - * This Iterator is used to iterate over Arrays. - */ -public class ListIterator implements Iterator { - /** DOCUMENT ME! */ - private List array; - - /* Number of values that have been returned so far */ - private int returned; - - /** DOCUMENT ME! */ - private int size; - - /** - * create an Iterator for the Array array. - * - * @param array - * java.lang.Object - * @param location - * - * @throws UnsupportedOperationException - * if array is not an Array - */ - public ListIterator(List array) { - this.array = array; - returned = 0; - size = array.size(); - - } - - /** - * Returns true if the iteration has more elements. (In other - * words, returns true if next would return an element - * rather than throwing an exception.) - * - * @return true if the iterator has more elements. - */ - public boolean hasNext() { - return (returned < size); - } - - /** - * Returns the next element in the interation. - * - * @return the next element in the interation. - * - * @throws NoSuchElementException - * iteration has no more elements. - */ - public synchronized T next() throws NoSuchElementException { - return array.get(returned++); - - } - - /** - * Removes from the underlying collection the last element returned by the - * iterator (optional operation). This method can be called only once per - * call to next. The behavior of an iterator is unspecified if the - * underlying collection is modified while the iteration is in progress in - * any way other than by calling this method. - * - * @throws UnsupportedOperationException - * if the remove operation is not supported by this - * Iterator. - */ - public void remove() { - throw new UnsupportedOperationException(); - } -} diff --git a/src/net/sf/jannot/Located.java b/src/net/sf/jannot/Located.java deleted file mode 100644 index 9fa9047..0000000 --- a/src/net/sf/jannot/Located.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -/** - * @author Thomas Abeel - * - */ -public interface Located { - - public int start(); - - public int end(); -} diff --git a/src/net/sf/jannot/LocatedListIterable.java b/src/net/sf/jannot/LocatedListIterable.java deleted file mode 100644 index 9099a8d..0000000 --- a/src/net/sf/jannot/LocatedListIterable.java +++ /dev/null @@ -1,45 +0,0 @@ -package net.sf.jannot; - -import java.lang.reflect.Array; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; - -/** - * This Iterator is used to iterate over Lists without fail-fast behavior. - */ -public class LocatedListIterable implements Iterable { - - private Location location; - - public LocatedListIterable(List array, Location l) { - this.location = l; - this.array = array; - } - - private List array; - - /** - * create an Iterator for the Array array. - * - * @param array - * java.lang.Object - * - * @throws UnsupportedOperationException - * if array is not an Array - */ - public LocatedListIterable(List array) { - this(array, null); - - } - - /* - * (non-Javadoc) - * - * @see java.lang.Iterable#iterator() - */ - @Override - public Iterator iterator() { - return new LocatedListIterator(array,location); - } -} diff --git a/src/net/sf/jannot/LocatedListIterator.java b/src/net/sf/jannot/LocatedListIterator.java deleted file mode 100644 index bb1604a..0000000 --- a/src/net/sf/jannot/LocatedListIterator.java +++ /dev/null @@ -1,106 +0,0 @@ -package net.sf.jannot; - -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; - -/** - * This Iterator is used to iterate over Arrays. - */ -public class LocatedListIterator implements Iterator { - /** DOCUMENT ME! */ - private List array; - - /* Number of values that have been returned so far */ - private int returned; - - /** DOCUMENT ME! */ - private int size; - - private int index; - private Location location; - - /** - * create an Iterator for the Array array. - * - * @param array - * java.lang.Object - * @param location - * - * @throws UnsupportedOperationException - * if array is not an Array - */ - public LocatedListIterator(List array, Location location) { - this.array = array; - this.location = location; - this.index=0; - returned = 0; - if (location == null) - size = array.size(); - else { - for(int i=0;itrue if the iteration has more elements. (In other - * words, returns true if next would return an element - * rather than throwing an exception.) - * - * @return true if the iterator has more elements. - */ - public boolean hasNext() { - return (returned < size); - } - - /** - * Returns the next element in the iteration. - * - * @return the next element in the iteration. - * - * @throws NoSuchElementException - * iteration has no more elements. - */ - public synchronized T next() throws NoSuchElementException { - if (location == null) { - return array.get(returned++); - } else { - try { - Located f=array.get(index); - //while (!array.get(index).getLocation().overlaps(location)) { - while(!location.overlaps(f.start(), f.end())){ - index++; - f=array.get(index); - } - returned++; - return array.get(index++); - } catch (Exception e) { - System.err.println(index+"\t"+array.size() + "\t" + size + "\t" + returned); - throw new NoSuchElementException(); - } - } - - } - - /** - * Removes from the underlying collection the last element returned by the - * iterator (optional operation). This method can be called only once per - * call to next. The behavior of an iterator is unspecified if the - * underlying collection is modified while the iteration is in progress in - * any way other than by calling this method. - * - * @throws UnsupportedOperationException - * if the remove operation is not supported by this - * Iterator. - */ - public void remove() { - throw new UnsupportedOperationException(); - } -} diff --git a/src/net/sf/jannot/Location.java b/src/net/sf/jannot/Location.java deleted file mode 100644 index 80c497d..0000000 --- a/src/net/sf/jannot/Location.java +++ /dev/null @@ -1,220 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import net.sf.jannot.event.ChangeEvent; - -public class Location implements Comparable { - - /** - * These fields are public for efficient getter access. If you want to set these fields, please use the proper setters. - */ - public int start, end; - - private boolean fuzzyEnd; - - private boolean fuzzyStart; - - /** - * Create a location from a String that comes out of the toString method - * - * @param s - * @return - */ - public static Location fromString(String s){ - String[]arr=s.replace('<', ' ').replace('>', ' ').trim().split(".."); - return new Location(Integer.parseInt(arr[0]),Integer.parseInt(arr[1]),s.startsWith("<"),s.endsWith(">")); - } - - @Override - public String toString() { - return (fuzzyStart ? "<" : "") + start + ".." + (fuzzyEnd ? ">" : "") - + end; - } - - public Location(int start, int end, boolean fuzzyStart, boolean fuzzyEnd) { - if (end > start) { - this.start = start; - this.end = end; - } else { - this.start = end; - this.end = start; - } - this.fuzzyStart = fuzzyStart; - this.fuzzyEnd = fuzzyEnd; - } - - public Location(int x, int y) { - this(x, y, false, false); - } - - public final int start() { - return start; - } - - public final ChangeEvent setStart(int start) { - ChangeEvent e = new SetStartEvent(this, this.start, start); - e.doChange(); - return e; - } - - public final int end() { - return end; - } - - public final ChangeEvent setEnd(int end) { - ChangeEvent e = new SetEndEvent(this, this.end, end); - e.doChange(); - return e; - } - - @Override - public int compareTo(Location arg0) { - int comp = new Integer(start).compareTo(arg0.start()); - if (comp == 0) - comp = new Integer(this.end).compareTo(arg0.end()); - - return comp; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + end; - result = prime * result + (fuzzyEnd ? 1231 : 1237); - result = prime * result + (fuzzyStart ? 1231 : 1237); - result = prime * result + start; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - Location other = (Location) obj; - if (end != other.end) - return false; - if (fuzzyEnd != other.fuzzyEnd) - return false; - if (fuzzyStart != other.fuzzyStart) - return false; - if (start != other.start) - return false; - return true; - } - - public int length() { - return end - start + 1; - } - - public boolean overlaps(int lStart,int lEnd) { - if (start >= lStart && start <= lEnd) - return true; - if (end >= lStart && end <= lEnd) - return true; - if (lStart >= start && lEnd <= end) { - return true; - } - return false; - } - - /* - * A location can belong to a feature, but the feature is responsible for - * notifying the location that it belongs to that feature - * - * This change is not recorded using a ChangeEvent. - */ - private Feature parent = null; - - void setParent(Feature f) { - this.parent = f; - } - - public Feature getParent() { - return parent; - } - - class SetEndEvent implements ChangeEvent { - /* New position */ - private int to; - - /* Original position */ - private int from; - - private Location l; - - public SetEndEvent(Location l, int orig, int newpos) { - this.l = l; - this.from = orig; - this.to = newpos; - } - - @Override - public void doChange() { - l.end = to; - if (parent != null) - parent.updatePhase(); - - } - - @Override - public void undoChange() { - assert (l.end == to); - l.end = from; - if (parent != null) - parent.updatePhase(); - - } - - @Override - public String toString() { - return new String("Set end from " + from + " to " + to); - } - } - - class SetStartEvent implements ChangeEvent { - - private int to; - - private int from; - - private Location l; - - public SetStartEvent(Location l, int originalPosition, int newPosition) { - this.l = l; - this.from = originalPosition; - this.to = newPosition; - } - - @Override - public void doChange() { - l.start = to; - if (parent != null) - parent.updatePhase(); - - } - - @Override - public void undoChange() { - assert (l.start == to); - l.start = from; - if (parent != null) - parent.updatePhase(); - } - - @Override - public String toString() { - return new String("Set start from " + from + " to " + to); - } - } - - public Location copy() { - return new Location(start, end, fuzzyStart, fuzzyEnd); - } -} diff --git a/src/net/sf/jannot/MemoryFeatureAnnotation.java b/src/net/sf/jannot/MemoryFeatureAnnotation.java deleted file mode 100644 index 04a2783..0000000 --- a/src/net/sf/jannot/MemoryFeatureAnnotation.java +++ /dev/null @@ -1,192 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - - -/* Represents the annotation of a single type */ - -public class MemoryFeatureAnnotation extends MemoryListData implements FeatureAnnotation { - - /* All data that is kept in memory, these get added manually */ - // private MemoryListData memoryData = new - // MemoryListData(); - -// private HashSet qualifierKeys = new HashSet(); - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - return new LocatedListIterable(this, new Location(start, end)); - - // return memoryData.get(); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get() - */ - @Override - public Iterable get() { - return super.get(); - } - - private double minStart = Integer.MAX_VALUE; - private double maxEnd = 0; - - private String label = null; - - /** - * @param f - * @return - */ - public synchronized boolean add(Feature f) { - if (label == null) - label = f.type().toString(); - super.add(f); -// qualifierKeys.addAll(f.getQualifiersKeys()); - if (f.start() < minStart) - minStart = f.start(); - if (f.end() > maxEnd) - maxEnd = f.end(); -// if (f.getScore() > maxScore) -// maxScore = f.getScore(); -// if (f.getScore() < minScore) -// minScore = f.getScore(); - return true; - } - - /** - * @param f - */ - public synchronized void remove(Feature f) { - super.remove(f); - - } - - /** - * Returns the number of features that resides in memory. - * - * @return - */ - public int cachedCount() { - return super.size(); - } - - /** - * @param row - * @return - */ - public Feature getCached(int row) { - return super.get(row); - } - - /** - * @param first - * @return - */ - public int getCachedIndexOf(Feature first) { - return super.indexOf(first); - } - - /* - * (non-Javadoc) - * - * @see - * net.sf.jannot.DensityEstimate#getEstimateCount(net.sf.jannot.Location) - */ - @Override - public int getEstimateCount(Location l) { - if(cachedCount()<200) - return 0; - double d = cachedCount() / (maxEnd - minStart); - - int estMemory = (int) (l.length() * d); - - return estMemory; - - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.DensityEstimate#getMaximumCoordinate() - */ - @Override - public int getMaximumCoordinate() { - return (int) maxEnd; - } - -// private double minScore = Double.POSITIVE_INFINITY; -// private double maxScore = Double.NEGATIVE_INFINITY; - -// /* -// * (non-Javadoc) -// * -// * @see net.sf.jannot.FeatureAnnotation#getMaxScore() -// */ -// @Override -// public double getMaxScore() { -// return maxScore; -// } -// -// /* -// * (non-Javadoc) -// * -// * @see net.sf.jannot.FeatureAnnotation#getMinScore() -// */ -// @Override -// public double getMinScore() { -// return minScore; -// } - - @Override - public String toString() { - if (super.size() > 0) - return super.get(0).type().toString(); - else - return null; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.FeatureAnnotation#qualifierKeys() - */ -// @Override -// public Set qualifierKeys() { -// return qualifierKeys; -// } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#canSave() - */ - @Override - public boolean canSave() { - if (super.size() > 0) - return true; - else - return false; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#label() - */ - @Override - public String label() { - if (label == null) - return "no data"; - else - return label; - } - -} diff --git a/src/net/sf/jannot/MemoryListData.java b/src/net/sf/jannot/MemoryListData.java deleted file mode 100644 index 57ed827..0000000 --- a/src/net/sf/jannot/MemoryListData.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import java.util.ArrayList; - - -/** - * Data that is stored in memory in a list of a particular type - */ -public abstract class MemoryListData extends ArrayList implements Data { - - public void addAll(MemoryListData t) { - Iterable list = t.get(); - addAll(list); - } - - public void addAll(Iterable list) { - for (T t : list) - this.add(t); - } - - - - - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - return new LocatedListIterable(this, new Location(start,end)); - - - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get() - */ - @Override - public Iterable get() { - return new ListIterable(this); - } - - /* (non-Javadoc) - * @see net.sf.jannot.Data#canSave() - */ - @Override - public boolean canSave() { - return false; - } - -// /** -// * @return -// */ -// public int size() { -// return list.size(); -// } -// -// /** -// * @param row -// * @return -// */ -// public T get(int row) { -// return list.get(row); -// } -// -// /** -// * @param first -// * @return -// */ -// public int indexOf(T o) { -// return list.indexOf(o); -// } - -} diff --git a/src/net/sf/jannot/Strand.java b/src/net/sf/jannot/Strand.java deleted file mode 100644 index aba04a3..0000000 --- a/src/net/sf/jannot/Strand.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -public enum Strand { - - FORWARD, REVERSE, UNKNOWN; - - public int getValue() { - switch (this) { - case FORWARD: - return 1; - case REVERSE: - return -1; - case UNKNOWN: - return 0; - default: - throw new RuntimeException("This is impossible!!!"); - } - - } - - static public Strand get(int i) { - switch (i) { - case 0: - return UNKNOWN; - case 1: - return FORWARD; - case -1: - return REVERSE; - default: - return UNKNOWN; - } - } - - public static Strand fromSymbol(char c){ - switch(c){ - case '+': - return FORWARD; - case '-': - return REVERSE; - default: - return UNKNOWN; - } - } - - /** - * Symbol representing the Strand. Can be either + (plus), - (minus) or . (dot) - * - * @return symbol representation of the strand - */ - public String symbol() { - switch (this) { - case FORWARD: - return "+"; - case REVERSE: - return "-"; - case UNKNOWN: - return "."; - default: - throw new RuntimeException("This is impossible!!!"); - } - } -} diff --git a/src/net/sf/jannot/StringKey.java b/src/net/sf/jannot/StringKey.java deleted file mode 100644 index 7298eec..0000000 --- a/src/net/sf/jannot/StringKey.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.sf.jannot; - -public class StringKey implements DataKey { - - @Override - public String toString() { - return key; - } - - private String key; - - public StringKey(String key) { - this.key = key; - } - - @Override - public boolean equals(Object dkey) { - if (!(dkey instanceof StringKey)) - return false; - return ((StringKey) dkey).key.equals(this.key); - - } - - @Override - public int compareTo(DataKey o) { - return o.toString().compareTo(this.toString()); - } -} \ No newline at end of file diff --git a/src/net/sf/jannot/SyntenicAnnotation.java b/src/net/sf/jannot/SyntenicAnnotation.java deleted file mode 100644 index 80cdc44..0000000 --- a/src/net/sf/jannot/SyntenicAnnotation.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -/** - * - * @author Thomas Abeel - * - */ -public class SyntenicAnnotation extends EntrySetAnnotation { - - private ListsyntenicBlocks=new ArrayList(); - @Override - public List get(Entry e,Location l) { - return syntenicBlocks; - } - private HashSettargets=new HashSet(); - @Override - public void add(SyntenicBlock t) { - syntenicBlocks.add(t); - targets.add(t.target()); -// setChanged(); -// notifyObservers(); - - } - @Override - public List getAll(Entry e) { - return syntenicBlocks; - } - public Set getTargets() { - return targets; - } - @Override - public Iterator iterator() { - return syntenicBlocks.iterator(); - } - /* (non-Javadoc) - * @see net.sf.jannot.EntrySetAnnotation#contains(java.lang.Object) - */ - @Override - public boolean contains(SyntenicBlock t) { - return syntenicBlocks.contains(t); - } - /** - * - */ - public void clear() { - syntenicBlocks.clear(); - - } -} diff --git a/src/net/sf/jannot/SyntenicBlock.java b/src/net/sf/jannot/SyntenicBlock.java deleted file mode 100644 index 78c3592..0000000 --- a/src/net/sf/jannot/SyntenicBlock.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -/** - * Synthenic block provides a syntenic mapping between two entries. It maps one - * location in one entry to another location in the other Entry. - * - * @author Thomas Abeel - * - */ -public class SyntenicBlock { - - private Location refLoc; - private Location targetLoc; - /* ID of reference */ - private String refEntry; - /* ID of target */ - private String targetEntry; - private Strand refStrand; - private Strand targetStrand; - - - public SyntenicBlock(String refEntry, String targetEntry, Location refLoc, - Location targetLoc,Strand refStrand,Strand targetStrand) { - super(); - this.refLoc = refLoc; - this.targetLoc = targetLoc; - this.refEntry = refEntry; - this.targetEntry = targetEntry; - this.refStrand=refStrand; - this.targetStrand=targetStrand; - - } - - - /** - * Flip reference and target - * @return - */ - public SyntenicBlock flip() { - return new SyntenicBlock(targetEntry,refEntry,targetLoc,refLoc,targetStrand,refStrand); - } - - - public String target() { - return targetEntry; - } - - - public Location refLocation() { - return refLoc; - } - - - public Location targetLocation() { - return targetLoc; - } - -} diff --git a/src/net/sf/jannot/Type.java b/src/net/sf/jannot/Type.java deleted file mode 100644 index 5d08eb6..0000000 --- a/src/net/sf/jannot/Type.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; - -/** - * - * I must improve this documentation - * - * Class 'Type' contains list of group names which features can be classified. - * e.g. CDS, intergenic. - * - * Constructor : Type (string name); - * - * Methods: get, toString, moveUp, moveDown - * - * Obs: All previous declared Type names are uniquely stored in a static Type - * array variable. - * - * @author Thomas Abeel - * - */ - -public class Type implements DataKey { - - private static ConcurrentHashMap map = new ConcurrentHashMap(); - - private static List order = new ArrayList(); - static { - - } - - private String name; - - /** - * - * Return array of declared types. - * - * @return - */ - public static Type[] values() { - return order.toArray(new Type[0]); - - } - - /** - * This method is deprecated. Use get(String key) instead. - * - */ - @Deprecated - public static Type valueOf(String s) { - return get(s); - } - - /** - * - * Return key - * - * @param key - * @return - */ - public synchronized static Type get(String key) { - if (!map.containsKey(key)) { - map.put(key, new Type(key)); - order.add(map.get(key)); - } - return map.get(key); - } - - private Type(String string) { - this.name = string; - - } - - /** - * - */ - public String toString() { - return name; - } - - /** - * Class Type stores all Types defined in a array. moveUp swap 'type' index - * with its previous one. If 'type' is the first index, nothing happens. - * - * @param type - */ - public synchronized static void moveUp(Type type) { - int index = order.indexOf(type); - if (index > 0) - Collections.swap(order, index - 1, index); - - } - - /** - * Class Type stores all Types defined in a array. moveDown swap 'type' - * index with its next one. If 'type' is the last index, nothing happens. - * - * @param type - */ - public synchronized static void moveDown(Type type) { - int index = order.indexOf(type); - if (index < order.size() - 1) - Collections.swap(order, index, index + 1); - - } - - /* - * (non-Javadoc) - * - * @see java.lang.Comparable#compareTo(java.lang.Object) - */ - @Override - public int compareTo(DataKey o) { - return o.toString().compareTo(this.toString()); - } -} diff --git a/src/net/sf/jannot/aamapping/euplotidNuclear b/src/net/sf/jannot/aamapping/euplotidNuclear deleted file mode 100644 index 95a183b..0000000 --- a/src/net/sf/jannot/aamapping/euplotidNuclear +++ /dev/null @@ -1,6 +0,0 @@ - AAs = FFLLSSSSYY**CCCWLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG - Starts = -----------------------------------M---------------------------- - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG - diff --git a/src/net/sf/jannot/aamapping/euplotidNuclear.description b/src/net/sf/jannot/aamapping/euplotidNuclear.description deleted file mode 100644 index cfd384e..0000000 --- a/src/net/sf/jannot/aamapping/euplotidNuclear.description +++ /dev/null @@ -1,6 +0,0 @@ -The Euplotid Nuclear Code -*Differences from the Standard Code: - Code 10 Standard - UGA Cys C Ter * -*Systematic Range: -Ciliata: Euplotidae (Hoffman et al. 1995). \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/invertebrateMitochondrial b/src/net/sf/jannot/aamapping/invertebrateMitochondrial deleted file mode 100644 index c098195..0000000 --- a/src/net/sf/jannot/aamapping/invertebrateMitochondrial +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNKKSSSSVVVVAAAADDEEGGGG - Starts = ---M----------------------------MMMM---------------M------------ - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/invertebrateMitochondrial.description b/src/net/sf/jannot/aamapping/invertebrateMitochondrial.description deleted file mode 100644 index 9ee17ee..0000000 --- a/src/net/sf/jannot/aamapping/invertebrateMitochondrial.description +++ /dev/null @@ -1,23 +0,0 @@ -The Invertebrate Mitochondrial Code -*Comment: -The codon AGG is absent in Drosophila. -*Differences from the Standard Code: - Code 5 Standard - AGA Ser S Arg R - AGG Ser S Arg R - AUA Met M Ile I - UGA Trp W Ter * -*Alternative Initiation Codons: -AUA, AUU -AUC: Apis (Crozier and Crozier, 1993) -GUG: Polyplacophora (Boore and Brown, 1994 GenBank Accession Number: U09810) -UUG: Ascaris, Caenorhabditis -*Systematic Range: -Nematoda: Ascaris, Caenorhabditis; -Mollusca: Bivalvia (Hoffmann et al., 1992); Polyplacophora (Boore and Brown, 1994) -Arthropoda/Crustacea: Artemia (Batuecas et al., 1988); -Arthropoda/Insecta: Drosophila [Locusta migratoria (migratory locust), Apis mellifera (honeybee)] -*Comments: -# Several arthropods translate the codon AGG as lysine instead of serine (as in the invertebrate mitochondrial genetic code) or arginine (as in the standard genetic code) (Abascal et al., 2006). -# GUG may possibly function as an initiator in Drosophila (Clary and Wolstenholme, 1985; Gadaleta et al., 1988). AUU is not used as an initiator in Mytilus (Hoffmann et al., 1992). -# "An exceptional mechanism must operate for initiation of translation of the cytochrome oxidase subunit I mRNA in both D. melanogaster (de Bruijn, 1983) and D. yakuba (Clary and Wolstenholme 1983), since its only plausible initiation codon, AUA, is out of frame with the rest of the gene. Initiation appears to require the "reading" of of an AUAA quadruplet, which would be equivalent to initiation at AUA followed immediately by a specific ribosomal frameshift. Another possible mechanism ... is that the mRNA is "edited" to bring the AUA initiation into frame." (Fox, 1987) \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/standard b/src/net/sf/jannot/aamapping/standard deleted file mode 100644 index 8cf59e4..0000000 --- a/src/net/sf/jannot/aamapping/standard +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG - Starts = ---M---------------M---------------M---------------------------- - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/standard.description b/src/net/sf/jannot/aamapping/standard.description deleted file mode 100644 index d897e9b..0000000 --- a/src/net/sf/jannot/aamapping/standard.description +++ /dev/null @@ -1,5 +0,0 @@ -The Standard Code -*Initiation Codon: -AUG -*Alternative Initiation Codons: -In rare cases, translation in eukaryotes can be initiated from codons other than AUG. A well documented case (including direct protein sequencing) is the GUG start of a ribosomal P protein of the fungus Candida albicans (Abramczyk et al.) and the GUG initiation in mammalian NAT1 (Takahashi et al. 2005). Other examples can be found in the following references: Peabody 1989; Prats et al. 1989; Hann et al. 1992; Sugihara et al. 1990. The standard code currently allows initiation from UUG and CUG in addition to AUG. \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table11 b/src/net/sf/jannot/aamapping/table11 deleted file mode 100644 index f78ee73..0000000 --- a/src/net/sf/jannot/aamapping/table11 +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG - Starts = ---M---------------M------------MMMM---------------M------------ - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/table11.description b/src/net/sf/jannot/aamapping/table11.description deleted file mode 100644 index bb306ef..0000000 --- a/src/net/sf/jannot/aamapping/table11.description +++ /dev/null @@ -1,3 +0,0 @@ -The Bacterial and Plant Plastid Code -*Systematic Range and Comments: -Table 11 is used for Bacteria, Archaea, prokaryotic viruses and chloroplast proteins. As in the standard code, initiation is most efficient at AUG. In addition, GUG and UUG starts are documented in Archaea and Bacteria (Kozak 1983, Fotheringham et al. 1986, Golderer et al. 1995, Nolling et al. 1995, Sazuka & Ohara 1996, Genser et al. 1998, Wang et al. 2003). In E. coli, UUG is estimated to serve as initiator for about 3% of the bacterium's proteins (Blattner et al. 1997). CUG is known to function as an initiator for one plasmid-encoded protein (RepA) in Escherichia coli (Spiers and Bergquist, 1992). In addition to the NUG initiations, in rare cases Bacteria can initiate translation from an AUU codon as e.g. in the case of poly(A) polymerase PcnB and the InfC gene that codes for translation initiation factor IF3 (Polard et al. 1991, Liveris et al. 1993, Sazuka & Ohara 1996, Binns & Masters 2002). The internal assignments are the same as in the standard code though UGA codes at low efficiency for Trp in Bacillus subtilis and, presumably, in Escherichia coli (Hatfiled and Diamond, 1993). \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table12 b/src/net/sf/jannot/aamapping/table12 deleted file mode 100644 index 95471a0..0000000 --- a/src/net/sf/jannot/aamapping/table12 +++ /dev/null @@ -1,6 +0,0 @@ - AAs = FFLLSSSSYY**CC*WLLLSPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG - Starts = -------------------M---------------M---------------------------- - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG - diff --git a/src/net/sf/jannot/aamapping/table12.description b/src/net/sf/jannot/aamapping/table12.description deleted file mode 100644 index 39971a1..0000000 --- a/src/net/sf/jannot/aamapping/table12.description +++ /dev/null @@ -1,10 +0,0 @@ -The Alternative Yeast Nuclear Code -*Differences from the Standard Code: - Code 12 Standard - CUG Ser Leu -*Alternative Initiation Codons: -CAG may be used in Candida albicans (Santos et al., 1993). -*Systematic Range: -Endomycetales (yeasts): Candida albicans, Candida cylindracea, Candida melibiosica, Candida parapsilosis, and Candida rugosa (Ohama et al., 1993). -*Comment: -However, other yeast, including Saccharomyces cerevisiae, Candida azyma, Candida diversa, Candida magnoliae, Candida rugopelliculosa, Yarrowia lipolytica, and Zygoascus hellenicus, definitely use the standard (nuclear) code (Ohama et al., 1993). \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table13 b/src/net/sf/jannot/aamapping/table13 deleted file mode 100644 index cfd0347..0000000 --- a/src/net/sf/jannot/aamapping/table13 +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNKKSSGGVVVVAAAADDEEGGGG - Starts = ---M------------------------------MM---------------M------------ - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/table13.description b/src/net/sf/jannot/aamapping/table13.description deleted file mode 100644 index cd0a5d7..0000000 --- a/src/net/sf/jannot/aamapping/table13.description +++ /dev/null @@ -1,11 +0,0 @@ -The Ascidian Mitochondrial Code -*Differences from the Standard Code: - Code 13 Standard - AGA Gly G Arg R - AGG Gly G Arg R - AUA Met M Ile I - UGA Trp W Ter * -*Systematic range and Comments: -There is evidence from a phylogenetically diverse sample of tunicates (Urochordata) that AGA and AGG code for glycine. In other organisms, AGA/AGG code for either arginine or serine and in vertebrate mitochondria they code a STOP. Evidence for glycine translation of AGA/AGG has been found in Pyura stolonifera (Durrheim et al. 1993), Halocynthia roretzi (Kondow et al. 1999, Yokobori et al., 1993, Yokobori et al. 1999) and Ciona savignyi (Yokobori et al. 2003). In addition, the Halocynthia roretzi mitochondrial genome encodes an additional tRNA gene with the anticodon U*CU that is thought to enable the use of AGA or AGG codons for glycine and the gene has been shown to be transcribed in vivo (Kondow et al. 1999, Yokobori et al. 1999). -*Alternative initiation codons: -ATA, GTG and TTG (Yokobori et al. 1999). \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table14 b/src/net/sf/jannot/aamapping/table14 deleted file mode 100644 index abb3e8c..0000000 --- a/src/net/sf/jannot/aamapping/table14 +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSSSSYYY*CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNNKSSSSVVVVAAAADDEEGGGG - Starts = -----------------------------------M---------------------------- - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/table14.description b/src/net/sf/jannot/aamapping/table14.description deleted file mode 100644 index 24c6273..0000000 --- a/src/net/sf/jannot/aamapping/table14.description +++ /dev/null @@ -1,12 +0,0 @@ -The Alternative Flatworm Mitochondrial Code -*Differences from the Standard Code: - Code 14 Standard - AAA Asn N Lys K - AGA Ser S Arg R - AGG Ser S Arg R - UAA Tyr Y Ter * - UGA Trp W Ter * -*Systematic Range: -Platyhelminthes (flatworms) -*Comments: -Code 14 differs from code 9 only by translating UAA to Tyr rather than STOP. A recent study [PMID:11027335] has found no evidence that the codon UAA codes for Tyr in the flatworms but other opinions exist. There are very few GenBank records that are translated with code 14 but a test translation shows that retranslating these records with code 9 can cause premature terminations. Therefore, GenBank will maintain code 14 until further information become available. \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table15 b/src/net/sf/jannot/aamapping/table15 deleted file mode 100644 index 9a1acab..0000000 --- a/src/net/sf/jannot/aamapping/table15 +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSSSSYY*QCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG - Starts = -----------------------------------M---------------------------- - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/table15.description b/src/net/sf/jannot/aamapping/table15.description deleted file mode 100644 index 8298225..0000000 --- a/src/net/sf/jannot/aamapping/table15.description +++ /dev/null @@ -1,6 +0,0 @@ -Blepharisma Nuclear Code -*Differences from the Standard Code: - Code 10 GStandard -UAG Gln Q Ter * -*Systematic Range: -Ciliata: Blepharisma (Liang and Heckman, 1993) \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table16 b/src/net/sf/jannot/aamapping/table16 deleted file mode 100644 index 13f1f90..0000000 --- a/src/net/sf/jannot/aamapping/table16 +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSSSSYY*LCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG - Starts = -----------------------------------M---------------------------- - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/table16.description b/src/net/sf/jannot/aamapping/table16.description deleted file mode 100644 index d8d6180..0000000 --- a/src/net/sf/jannot/aamapping/table16.description +++ /dev/null @@ -1,6 +0,0 @@ -Chlorophycean Mitochondrial Code -*Differences from the Standard Code: - Code 16 Standard -TAG Leu L STOP -*Systematic Range: -Chlorophyceae (Hayashi-Ishimaru et al. 1996. UAG is a sense codon in several chlorophycean mitochondria) and the chytridiomycete fungus Spizellomyces punctatus (Laforest et al. 1997. Mitochondrial tRNAs in the lower fungus Spizellomyces punctatus: tRNA editing and UAG 'stop' codons recognized as leucine). \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table21 b/src/net/sf/jannot/aamapping/table21 deleted file mode 100644 index 7be9a76..0000000 --- a/src/net/sf/jannot/aamapping/table21 +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNNKSSSSVVVVAAAADDEEGGGG - Starts = -----------------------------------M---------------M------------ - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/table21.description b/src/net/sf/jannot/aamapping/table21.description deleted file mode 100644 index 16fcb9f..0000000 --- a/src/net/sf/jannot/aamapping/table21.description +++ /dev/null @@ -1,10 +0,0 @@ -Trematode Mitochondrial Code -*Differences from the Standard Code: - Code 21 Standard -TGA Trp W STOP -ATA Met M Ile -AGA Ser S Arg -AGG Ser S Arg -*Systematic Range: -Trematoda: Ohama, T, S. Osawa, K. Watanabe, T.H. Jukes, 1990. J. Molec Evol. 30 -Garey, J.R. and D.R. Wolstenholme, 1989. J. Molec. Evol. 28: 374-387 329-332. \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table22 b/src/net/sf/jannot/aamapping/table22 deleted file mode 100644 index 6478642..0000000 --- a/src/net/sf/jannot/aamapping/table22 +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSS*SYY*LCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG - Starts = -----------------------------------M---------------------------- - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/table22.description b/src/net/sf/jannot/aamapping/table22.description deleted file mode 100644 index 78996ef..0000000 --- a/src/net/sf/jannot/aamapping/table22.description +++ /dev/null @@ -1,7 +0,0 @@ -Scenedesmus obliquus mitochondrial Code -*Differences from the Standard Code: - Code 22 Standard -TCA STOP * Ser -TAG Leu L STOP -*Systematic Range: -Scenedesmus obliquus: Nedelcu A, Lee RW, Lemieux C, Gray MW and Burger G. "The complete mitochondrial DNA sequence of Scenedesmus obliquus reflects an intermediate stage in the evolution of the green algal mitochondrial genome." Genome Res. 2000 Jun;10(6):819-31. \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table23 b/src/net/sf/jannot/aamapping/table23 deleted file mode 100644 index c040977..0000000 --- a/src/net/sf/jannot/aamapping/table23 +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FF*LSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG - Starts = --------------------------------M--M---------------M------------ - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/table23.description b/src/net/sf/jannot/aamapping/table23.description deleted file mode 100644 index b2b540c..0000000 --- a/src/net/sf/jannot/aamapping/table23.description +++ /dev/null @@ -1,3 +0,0 @@ -Thraustochytrium Mitochondrial Code -This code has been created for the mitochondrial genome of the labyrinthulid Thraustochytrium aureum sequenced by the The Organelle Genome Megasequencing Program (OGMP). -It is the similar to the bacterial code (trans_table 11) but it contains an additional stop codon (TTA) and also has a different set of start codons. \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table4 b/src/net/sf/jannot/aamapping/table4 deleted file mode 100644 index 81d504b..0000000 --- a/src/net/sf/jannot/aamapping/table4 +++ /dev/null @@ -1,6 +0,0 @@ - AAs = FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG - Starts = --MM---------------M------------MMMM---------------M------------ - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG - diff --git a/src/net/sf/jannot/aamapping/table4.description b/src/net/sf/jannot/aamapping/table4.description deleted file mode 100644 index 5fe738a..0000000 --- a/src/net/sf/jannot/aamapping/table4.description +++ /dev/null @@ -1,17 +0,0 @@ -The Mold, Protozoan, and Coelenterate Mitochondrial Code and the Mycoplasma/Spiroplasma Code -*Differences from the Standard Code: - Code 4 Standard - UGA Trp W Ter * -*Alternative Initiation Codons: -Trypanosoma: UUA, UUG, CUG -Leishmania: AUU, AUA -Tertrahymena: AUU, AUA, AUG -Paramecium: AUU, AUA, AUG, AUC, GUG, GUA(?) -(Pritchard et al., 1990) -*Systematic Range: -Mollicutes: The code is used in Entomoplasmatales and Mycoplasmatales (Bove et al. 1989). The situation in the Acholeplasmatales is unclear. Based on a study of ribosomal protein genes, it had been concluded that UGA does not code for tryptophan in plant-pathogenic mycoplasma-like organisms (MLO) and the Acholeplasmataceae (Lim and Sears, 1992) and there seems to be only a single tRNA-CCA for tryptophan in Acholeplasma laidlawii (Tanaka et al. 1989). In contrast, in a study of codon usage in Phytoplasmas, it was found that 30 out of 78 ORFs analyzed translated better with code 4 (UGA for tryptophan) than with code 11 while the remainder showed no differences between the two codes (Melamed et al. 2003). -Fungi: Emericella nidulans, Neurospora crassa, Podospora anserina, Acremonium (Fox, 1987), Candida parapsilosis (Guelin et al., 1991), Trichophyton rubrum (de Bievre and Dujon, 1992), Dekkera/Brettanomyces, Eeniella (Hoeben et al., 1993), and probably Ascobolus immersus, Aspergillus amstelodami, Claviceps purpurea, and Cochliobolus heterostrophus. -Other Eukaryotes: Gigartinales among the red algae (Boyen et al. 1994), and the protozoa Trypanosoma brucei, Leishmania tarentolae, Paramecium tetraurelia, Tetrahymena pyriformis and probably Plasmodium gallinaceum (Aldritt et al., 1989). -Metazoa: Coelenterata (Ctenophora and Cnidaria) -*Comments: -This code is also used for the kinetoplast DNA (maxicircles, minicircles). Kinetoplasts are modified mitochondria (or their parts). \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table6 b/src/net/sf/jannot/aamapping/table6 deleted file mode 100644 index f8cce9e..0000000 --- a/src/net/sf/jannot/aamapping/table6 +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSSSSYYQQCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG - Starts = -----------------------------------M---------------------------- - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/table6.description b/src/net/sf/jannot/aamapping/table6.description deleted file mode 100644 index e0a4e4c..0000000 --- a/src/net/sf/jannot/aamapping/table6.description +++ /dev/null @@ -1,13 +0,0 @@ -The Ciliate, Dasycladacean and Hexamita Nuclear Code -*Differences from the Standard Code: - Code 6 Standard - UAA Gln Q Ter * - UAG Gln Q Ter * -*Systematic Range: -Ciliata: Oxytricha and Stylonychia (Hoffman et al. 1995), Paramecium, Tetrahymena, Oxytrichidae and probably Glaucoma chattoni. -Dasycladaceae: Acetabularia (Schneider et al., 1989) and Batophora (Schneider and de Groot, 1991). -Diplomonadida: -*Scope: Hexamita inflata, Diplomonadida ATCC50330, and ATCC50380. -Ref.: Keeling, P.J. and Doolittle, W.F. 1996.. A non-canonical genetic code in an early diverging eukaryotic lineage. The EMBO Journal 15, 2285-2290. -*Comment: -The ciliate macronuclear code has not been determined completely. The codon UAA is known to code for Gln only in the Oxytrichidae. \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/table9 b/src/net/sf/jannot/aamapping/table9 deleted file mode 100644 index c96c51e..0000000 --- a/src/net/sf/jannot/aamapping/table9 +++ /dev/null @@ -1,6 +0,0 @@ - AAs = FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNNKSSSSVVVVAAAADDEEGGGG - Starts = -----------------------------------M---------------M------------ - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG - diff --git a/src/net/sf/jannot/aamapping/table9.description b/src/net/sf/jannot/aamapping/table9.description deleted file mode 100644 index fb5a33b..0000000 --- a/src/net/sf/jannot/aamapping/table9.description +++ /dev/null @@ -1,9 +0,0 @@ -The Echinoderm and Flatworm Mitochondrial Code -*Differences from the Standard Code: - Code 9 Standard - AAA Asn N Lys K - AGA Ser S Arg R - AGG Ser S Arg R - UGA Trp W Ter * -*Systematic Range: -Asterozoa (starfishes) (Himeno et al., 1987) Echinozoa (sea urchins) (Jacobs et al., 1988; Cantatore et al., 1989) Rhabditophora among the Platyhelminthes (Telford et al. 2000) \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/vertebrateMitochondrial b/src/net/sf/jannot/aamapping/vertebrateMitochondrial deleted file mode 100644 index 7f9ed9e..0000000 --- a/src/net/sf/jannot/aamapping/vertebrateMitochondrial +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNKKSS**VVVVAAAADDEEGGGG - Starts = --------------------------------MMMM---------------M------------ - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/vertebrateMitochondrial.description b/src/net/sf/jannot/aamapping/vertebrateMitochondrial.description deleted file mode 100644 index b8ddf93..0000000 --- a/src/net/sf/jannot/aamapping/vertebrateMitochondrial.description +++ /dev/null @@ -1,16 +0,0 @@ -The Vertebrate Mitochondrial Code -*Differences from the Standard Code: - Code 2 Standard - AGA Ter * Arg R - AGG Ter * Arg R - AUA Met M Ile I - UGA Trp W Ter * -*Alternative Initiation Codon: -Bos: AUA -Homo: AUA, AUU -Mus: AUA, AUU, AUC -Coturnix, Gallus: also GUG (Desjardins and Morais, 1991) -*Systematic Range: -Vertebrata -*Comment: -# The transcripts of several vertebrate mitochondrial genes end in U or UA, which become termination codons (UAA) upon subsequent polyadenylation. \ No newline at end of file diff --git a/src/net/sf/jannot/aamapping/yeastMitochondrial b/src/net/sf/jannot/aamapping/yeastMitochondrial deleted file mode 100644 index cbf2086..0000000 --- a/src/net/sf/jannot/aamapping/yeastMitochondrial +++ /dev/null @@ -1,5 +0,0 @@ - AAs = FFLLSSSSYY**CCWWTTTTPPPPHHQQRRRRIIMMTTTTNNKKSSRRVVVVAAAADDEEGGGG - Starts = ----------------------------------MM---------------------------- - Base1 = TTTTTTTTTTTTTTTTCCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAGGGGGGGGGGGGGGGG - Base2 = TTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGGTTTTCCCCAAAAGGGG - Base3 = TCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAGTCAG diff --git a/src/net/sf/jannot/aamapping/yeastMitochondrial.description b/src/net/sf/jannot/aamapping/yeastMitochondrial.description deleted file mode 100644 index 4879e21..0000000 --- a/src/net/sf/jannot/aamapping/yeastMitochondrial.description +++ /dev/null @@ -1,18 +0,0 @@ -The Yeast Mitochondrial Code -*Differences from the Standard Code: - Code 3 Standard - AUA Met M Ile I - CUU Thr T Leu L - CUC Thr T Leu L - CUA Thr T Leu L - CUG Thr T Leu L - UGA Trp W Ter * - CGA absent Arg R - CGC absent Arg R -*Systematic Range: -Saccharomyces cerevisiae, Candida glabrata, Hansenula saturnus, and Kluyveromyces thermotolerans (Clark-Walker and Weiller, 1994) -*Comments: -# The remaining CGN codons are rare in Saccharomyces cerevisiae and absent in Candida glabrata (= Torulopsis glabrata). -# The AUA codon is common in the gene var1 coding for the single mitochonLIial ribosomal protein, but rare in genes encoding the enzymes. -# The coding assignments of the AUA (Met or Ile) and CUU (possibly Leu, not Thr) are uncertain in Hansenula saturnus. -# The coding assignment of Thr to CUN is uncertain in Kluyveromyces thermotolerans (Clark-Walker and Weiller, 1994). \ No newline at end of file diff --git a/src/net/sf/jannot/alignment/ReferenceSequence.java b/src/net/sf/jannot/alignment/ReferenceSequence.java deleted file mode 100644 index d24096f..0000000 --- a/src/net/sf/jannot/alignment/ReferenceSequence.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * %HEADER% - */ - -package net.sf.jannot.alignment; - -import net.sf.jannot.refseq.MemorySequence; -import net.sf.jannot.refseq.Sequence; - -/** - * Sequence that can be used as reference for multiple alignments. - * - * @author tabeel - * - */ -public class ReferenceSequence extends MemorySequence{ - private int refGapCount; - private int[] mapping = null; - - public ReferenceSequence(StringBuffer sequence) { - super(sequence); - calculateMapping(); - } - - public ReferenceSequence(MemorySequence sequence) { - super(sequence); - calculateMapping(); - } - - - -// private int countGaps() { -// int gaps = 0; -// for (int i = 1; i <= this.size(); i++) { -// if (this.getNucleotide(i) == '-') -// gaps++; -// -// } -// return gaps; -// } - - private void calculateMapping() { - mapping = new int[this.size()]; - refGapCount=0; - int index = 0; - int pos = 0; - for (int i = 0; i < this.size(); i++) { - - pos++; - if (this.getNucleotide(i + 1) != '-') { - mapping[index++] = pos; - }else{ - refGapCount++; - } - - } - for (int i = index; i < this.size(); i++) { - mapping[i] = pos + 1; - } -// refGapCount = countGaps(); - - } - - @Override - public void setSequence(String sequence) { - super.setSequence(sequence); - calculateMapping(); - } - - @Override - public void addSequence(String seq) { - super.addSequence(seq); - calculateMapping(); - } - - /** - * Returns the alignment position if you know the position in the reference - * sequence. Suppose you have the following reference sequence - * - *

-	 * AAAATTTT
-	 * 
- * - * The corresponding alignment to some other sequence of this reference is - * - *
-	 * AAAA----TTTT
-	 * 
- * - * Then this method allows you the query which position in the original - * reference sequence corresponds to which position in the reference - * alignment. - * - * For example 5 in the reference sequence maps to 9 in the reference - * alignment. And 4 maps to 4. - * - * Both coordinates are 1 based! - * - */ - public int ref2aln(int position) { - if(position>mapping.length){ - return mapping[mapping.length-1]; -// throw new IllegalArgumentException((position-1)+"\t"+mapping.length); - } - if (mapping[position - 1] == 0) - System.err.println("ref2aln: " + (position - 1) + "\t" + mapping[position - 1]); - return mapping[position - 1]; - } - - public int getRefGapCount() { - return refGapCount; - - } - -} \ No newline at end of file diff --git a/src/net/sf/jannot/alignment/maf/AbstractAlignmentBlock.java b/src/net/sf/jannot/alignment/maf/AbstractAlignmentBlock.java deleted file mode 100644 index 4c44ef9..0000000 --- a/src/net/sf/jannot/alignment/maf/AbstractAlignmentBlock.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.alignment.maf; - -import net.sf.jannot.Located; -import net.sf.jannot.Location; -import net.sf.jannot.Strand; -import net.sf.jannot.refseq.Sequence; - -/** - * @author Thomas Abeel - * - */ -public abstract class AbstractAlignmentBlock implements Comparable, Located, - Iterable { - /* Buffers for finding nucleotides */ - // protected int[] position = null; - // private Entry ref = null; - private Location loc = new Location(0, 0); - - public AbstractAlignmentBlock(int start, int end) { - this.loc = new Location(start, end); - } - - // public void setRef(Entry entry) { - // this.ref = entry; - // update(entry); - // } - - // /** - // * @param reference - // */ - // private void update(Entry reference) { - // this.ref = reference; - // - // for (AlignmentSequence as : this) { - // System.out.println(as); - // if (as.entry() == ref) { - // - // return; - // } - // } - // - // } - - /* - * (non-Javadoc) - * - * @see java.lang.Comparable#compareTo(java.lang.Object) - */ - @Override - public int compareTo(AbstractAlignmentBlock o) { - int thisVal = this.hashCode(); - int anotherVal = o.hashCode(); - return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1)); - } - - // - // /* - // * (non-Javadoc) - // * - // * @see net.sf.jannot.Located#getLocation() - // */ - // @Override - // public Location getLocation() { - // return loc; - // } - @Override - public int start() { - return loc.start; - } - - @Override - public int end() { - return loc.end; - } - - public int length() { - return loc.length(); - } - - /** - * @param as - * @return - */ - public abstract void add(AbstractAlignmentSequence as); - - /** - * @param i - * @return - */ - public abstract AbstractAlignmentSequence getAlignmentSequence(int i); - - /** - * @return - */ - public abstract int size(); - -} diff --git a/src/net/sf/jannot/alignment/maf/AbstractAlignmentSequence.java b/src/net/sf/jannot/alignment/maf/AbstractAlignmentSequence.java deleted file mode 100644 index 6fb7fe9..0000000 --- a/src/net/sf/jannot/alignment/maf/AbstractAlignmentSequence.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.alignment.maf; - -import net.sf.jannot.Strand; -import net.sf.jannot.refseq.Sequence; - -/** - * @author Thomas Abeel - * - */ -public abstract class AbstractAlignmentSequence { - - /** - * @param id2 - * @param start - * the real start, not some weird UCSC start, this is ZERO based - * @param noNucleotides2 - * @param srcSize - * @param fromSymbol - */ - public AbstractAlignmentSequence(String id, int start, int noNucleotides, Strand fromSymbol) { - this.id = id; - this.start = start; - this.noNucleotides = noNucleotides; - this.strand = fromSymbol; - } - - protected String id; - - @Override - public String toString() { - return id + " " + start() + " " + end(); - } - - // private Entry ref; - protected int start; - protected int noNucleotides; - protected Strand strand; - - public abstract Sequence seq(); - - /** - * @return - */ - public int end() { - return start + noNucleotides + 1; - } - - /** - * One based coordinate of this multiple alignment block - * - * @return - */ - public int start() { - return start + 1; - } - - public String getName() { - return id; - } - - // /** - // * @return - // */ - // public Entry entry() { - // return ref; - // } - - /** - * @return - */ - public Strand strand() { - return strand; - } - -} diff --git a/src/net/sf/jannot/alignment/maf/AbstractMAFMultipleAlignment.java b/src/net/sf/jannot/alignment/maf/AbstractMAFMultipleAlignment.java deleted file mode 100644 index 955019a..0000000 --- a/src/net/sf/jannot/alignment/maf/AbstractMAFMultipleAlignment.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.alignment.maf; - -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import net.sf.jannot.Data; - -/** - * @author Thomas Abeel - * - */ -public abstract class AbstractMAFMultipleAlignment implements Data { - - public String label() { - return "Multiple alignment"; - } - - /** - * - */ - private static final long serialVersionUID = 6205720325158215670L; - private Set species = new HashSet(); - - /** - * @param string - */ - public void addSpecies(String string) { - species.add(string); - - } - - public Collection species() { - return Collections.unmodifiableCollection(species); - } - - @Override - public abstract Iterable get(int start, int end); - - @Override - public abstract Iterable get(); - - @Override - public boolean canSave() { - return false; - } - - public abstract int noAlignmentBlocks(); - -} diff --git a/src/net/sf/jannot/alignment/maf/LazyAlignmentBlock.java b/src/net/sf/jannot/alignment/maf/LazyAlignmentBlock.java deleted file mode 100644 index 87d9961..0000000 --- a/src/net/sf/jannot/alignment/maf/LazyAlignmentBlock.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.alignment.maf; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import net.sf.jannot.Strand; -import net.sf.jannot.picard.LineBlockCompressedInputStream; -import net.sf.jannot.refseq.MemorySequence; -import net.sf.jannot.utils.SequenceTools; - -/** - * - * @author Thomas Abeel - * @author thpar - * - */ -public class LazyAlignmentBlock extends AbstractAlignmentBlock { - - private long offsetStart; - - private LineBlockCompressedInputStream zr; - - private ArrayList list = new ArrayList(); - - public LazyAlignmentBlock(long offsetStart, LineBlockCompressedInputStream zr,int start,int end) { - super(start,end); - this.offsetStart = offsetStart; - this.zr = zr; - - } - - public void add(AbstractAlignmentSequence as) { - list.add(as); - } - -// @Override -// public int translate(int pos) { -// if (position == null){ -//// System.out.println("Translate lazy load"); -// lazyLoad(); -//// System.out.println("Pos after: "+position); -// -// } -// if (pos < position.length) -// return position[pos]; -// else { -// System.err.println("Wrong translate: " + position.length + "\t" + pos); -// return position[position.length - 1]; -// } -// } - - private boolean lazyLoading = false; - - - /** - * Load the actual alignment block from the zipped maf file and fill in the - * gaps in the alignment sequences - */ - public synchronized void lazyLoad() { - if (list.size()==0||lazyLoading) - return; - lazyLoading = true; - -// System.out.println(" maf.bgz access ... "); - // make a mapping id -> alignment sequence - Map idMap = new HashMap(); - for (AbstractAlignmentSequence s : list) { - idMap.put(s.id, s); - } - - try { - zr.seek(offsetStart); - // long lineNumber = zr.getFilePointer(); - // while (lineNumber >= 0 && lineNumber <= offsetEnd) { - String line = zr.readLine(); - // System.err.println("Processing block"); - while (!line.startsWith("#") && !line.isEmpty()) { - // System.err.println("\t" + line); - String[] cols = line.split("\\s+"); - if (cols.length == 7) { - String type = cols[0]; - if (type.equals("s")) { - String id = cols[1]; - LazyAlignmentSequence alSeq = (LazyAlignmentSequence) idMap.get(id); - - if (alSeq != null) { -// System.err.println("Loading sequence for: " + id); - MemorySequence seq = new MemorySequence(cols[6]); - alSeq.noNucleotides = Integer.parseInt(cols[3]); - int startNuc = Integer.parseInt(cols[2]); - int totalLength = Integer.parseInt(cols[5]); - if (alSeq.strand == Strand.FORWARD) { - alSeq.start = startNuc; - alSeq.setSeq(seq);// = seq; - } else { - alSeq.start = totalLength - startNuc - alSeq.noNucleotides; - alSeq.setSeq(SequenceTools.reverseComplement(seq));// - - // ; - } - -// list.add(alSeq); - } else { - System.err.println("LAS is not in map! " + id); - } - } - } - line = zr.readLine(); - // } - // lineNumber = zr.getFilePointer(); - } - -// AbstractAlignmentSequence as = list.get(0); -// this.loc = new Location(as.start(), as.end()); -// System.err.println("Initing with: " + as); -// System.err.println("\tseq=" + as.seq()); -// super.initPosition(as); - } catch (NumberFormatException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - /* - * (non-Javadoc) - * - * @see java.lang.Iterable#iterator() - */ - @Override - public Iterator iterator() { - return list.iterator(); - } - - /* - * (non-Javadoc) - * - * @see - * net.sf.jannot.alignment.maf.AbstractAlignmentBlock#getAlignmentSequence - * (int) - */ - @Override - public AbstractAlignmentSequence getAlignmentSequence(int i) { - return list.get(i); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.alignment.maf.AbstractAlignmentBlock#size() - */ - @Override - public int size() { - return list.size(); - } - -} diff --git a/src/net/sf/jannot/alignment/maf/LazyAlignmentSequence.java b/src/net/sf/jannot/alignment/maf/LazyAlignmentSequence.java deleted file mode 100644 index c1b382c..0000000 --- a/src/net/sf/jannot/alignment/maf/LazyAlignmentSequence.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.alignment.maf; - -import net.sf.jannot.Strand; -import net.sf.jannot.refseq.Sequence; - -/** - * @author Thomas Abeel - * - */ -public class LazyAlignmentSequence extends AbstractAlignmentSequence { - - private LazyAlignmentBlock parent; - - /** - * @param selectedChrom - * @param nucStart - * @param alignmentLength - * @param strand2 - */ - public LazyAlignmentSequence(String id, int nucStart, int alignmentLength, Strand strand, LazyAlignmentBlock parent) { - super(id, nucStart, alignmentLength, strand); - this.parent = parent; - } - - /* This field needs to be set by the lazy load method of the parent */ - private Sequence seq = null; - - @Override - public Sequence seq() { - if (seq == null) { - parent.lazyLoad(); - - } - - return seq; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.alignment.maf.AbstractAlignmentSequence#end() - */ - @Override - public int end() { - if (seq == null) { - parent.lazyLoad(); - } - return super.end(); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.alignment.maf.AbstractAlignmentSequence#start() - */ - @Override - public int start() { - if (seq == null) - parent.lazyLoad(); - return super.start(); - } - - /** - * @param seq2 - */ - public void setSeq(Sequence seq) { - this.seq = seq; - - } - -} diff --git a/src/net/sf/jannot/alignment/maf/MAFMemoryMultipleAlignment.java b/src/net/sf/jannot/alignment/maf/MAFMemoryMultipleAlignment.java deleted file mode 100644 index ec8781f..0000000 --- a/src/net/sf/jannot/alignment/maf/MAFMemoryMultipleAlignment.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.alignment.maf; - -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import net.sf.jannot.Data; -import net.sf.jannot.MemoryListData; - -/** - * @author Thomas Abeel - * - */ -public class MAFMemoryMultipleAlignment extends AbstractMAFMultipleAlignment { - - private MemoryListData delegate; - - public MAFMemoryMultipleAlignment() { - final Data _self = this; - delegate = new MemoryListData() { - - @Override - public String label() { - return _self.label(); - } - - }; - } - - @Override - public Iterable get(int start, int end){ - return delegate.get(start, end); - } - - @Override - public Iterable get(){ - return delegate.get(); - - } - - public void add(MemoryAlignmentBlock a) { - delegate.add(a); - - } - - @Override - public int noAlignmentBlocks() { - return delegate.size(); - } - - -} diff --git a/src/net/sf/jannot/alignment/maf/MemoryAlignmentBlock.java b/src/net/sf/jannot/alignment/maf/MemoryAlignmentBlock.java deleted file mode 100644 index e758dfe..0000000 --- a/src/net/sf/jannot/alignment/maf/MemoryAlignmentBlock.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.alignment.maf; - -import java.util.ArrayList; -import java.util.Iterator; - -import net.sf.jannot.Location; - -/** - * @author Thomas Abeel - * - */ -public class MemoryAlignmentBlock extends AbstractAlignmentBlock { - - public MemoryAlignmentBlock(int start, int end) { - super(start, end); - } - - private ArrayList list = new ArrayList(); - /** - * - */ - private static final long serialVersionUID = -8021564812568122679L; - - @Override - public void add(AbstractAlignmentSequence as) { - // if (list.size() == 0) { - // //this.loc = new Location(as.start(), as.end()); - // initPosition(as); - // } - list.add(as); - } - - /** - * @param entry - */ - @Override - public AbstractAlignmentSequence getAlignmentSequence(int i) { - return list.get(i); - - } - - /* - * (non-Javadoc) - * - * @see java.lang.Iterable#iterator() - */ - @Override - public Iterator iterator() { - return list.iterator(); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.alignment.maf.AbstractAlignmentBlock#size() - */ - @Override - public int size() { - return list.size(); - } - -} diff --git a/src/net/sf/jannot/alignment/maf/MemoryAlignmentSequence.java b/src/net/sf/jannot/alignment/maf/MemoryAlignmentSequence.java deleted file mode 100644 index 8849540..0000000 --- a/src/net/sf/jannot/alignment/maf/MemoryAlignmentSequence.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.alignment.maf; - -import net.sf.jannot.Strand; -import net.sf.jannot.refseq.Sequence; -import net.sf.jannot.utils.SequenceTools; - -/** - * @author Thomas Abeel - * - */ -public class MemoryAlignmentSequence extends AbstractAlignmentSequence { - private Sequence seq; - - /** - * @param e - * @param parseInt - * @param fromSymbol - * @param string - */ - public MemoryAlignmentSequence(String id, int start, int noNucleotides, int srcSize, Strand fromSymbol, Sequence seq) { - super(id,fromSymbol == Strand.FORWARD?start: srcSize - start - noNucleotides,noNucleotides,fromSymbol); - /* Overwrite start as well!! */ - if (fromSymbol == Strand.FORWARD) { - this.seq = seq; - } else { - this.seq = SequenceTools.reverseComplement(seq); - } - this.noNucleotides = noNucleotides; - this.strand = fromSymbol; - - } - - /* (non-Javadoc) - * @see net.sf.jannot.alignment.maf.AbstractAlignmentSequence#seq() - */ - @Override - public Sequence seq() { - return seq; - } -} diff --git a/src/net/sf/jannot/alignment/maf/SequenceTranslator.java b/src/net/sf/jannot/alignment/maf/SequenceTranslator.java deleted file mode 100644 index 2ca9e6a..0000000 --- a/src/net/sf/jannot/alignment/maf/SequenceTranslator.java +++ /dev/null @@ -1,73 +0,0 @@ -package net.sf.jannot.alignment.maf; - -import java.io.FileNotFoundException; -import java.io.PrintWriter; - -import cern.colt.Arrays; -import net.sf.jannot.Strand; -import net.sf.jannot.alignment.maf.AbstractAlignmentSequence; -import net.sf.jannot.refseq.Sequence; - -/** - * - * @author Thomas Abeel - * - */ -public class SequenceTranslator { - private int[] position; - private int maxCur = 0; - - public SequenceTranslator(AbstractAlignmentSequence alignmentSequence) { - initPosition(alignmentSequence); - } - - private void initPosition(AbstractAlignmentSequence as) { - - int len = -1; - len = as.end() - as.start(); - position = new int[len + 1]; - int cur = 0; - int ix = 0; - // FIXME easy to speed this up! - Sequence seq = as.seq(); - for (int i = 1; i <= seq.size(); i++) { - char nt; - if (as.strand() == Strand.FORWARD) - nt = as.seq().get(i, i + 1).iterator().next(); - else - nt = as.seq().get(as.seq().size() - i + 1, as.seq().size() - i + 2).iterator().next(); - if (nt == '-') { - cur++; - } else { - position[ix++] = cur++; - } - } - while (ix < position.length) { - position[ix++] = cur++; - } - maxCur = cur; - } - - private int[] revtable = null; - - public synchronized int[] getReverseTranslationTable() { - if (revtable == null) { - revtable = new int[maxCur]; - for (int i = 0; i < position.length; i++) { - revtable[position[i]] = i; - } - for (int i = 1; i < revtable.length; i++) { - if (revtable[i] == 0) { - revtable[i] = revtable[i - 1]; - } - } - - } - return revtable; - - } - - public int translate(int pos) { - return position[pos]; - } -} diff --git a/src/net/sf/jannot/alignment/mfa/Alignment.java b/src/net/sf/jannot/alignment/mfa/Alignment.java deleted file mode 100644 index eb8f28d..0000000 --- a/src/net/sf/jannot/alignment/mfa/Alignment.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.alignment.mfa; - -import java.util.BitSet; - -import net.sf.jannot.Located; -import net.sf.jannot.alignment.ReferenceSequence; -import net.sf.jannot.refseq.MemorySequence; -import net.sf.jannot.refseq.Sequence; - -public class Alignment implements Located { - - private String name; - private MemorySequence alignment; - private ReferenceSequence reference; - - /** - * Returns the expanded query sequence including gaps - * - * @return expanded query sequence - */ - public Sequence getExpandedQuerySequence() { - return alignment; - } - - /** - * Returns the expanded reference sequence including gaps. - * - * @return expanded reference sequence - */ - public Sequence getExpandedReferenceSequence() { - return reference; - } - - public Alignment(String name, MemorySequence sequence, ReferenceSequence reference) { - this.name = name; - this.alignment = sequence; - this.reference = reference; - aligned = new BitSet(); - - /* Only positions in reference sequence are cached */ - for (int i = 1; i < this.refLength(); i++) { - char inf = getNucleotide(i); - char ref = getReferenceNucleotide(i); - if (inf != '-' && ref != '-' && Character.toLowerCase(inf) == Character.toLowerCase(ref)) - aligned.set(i); - } - - } - - /** - * Returns the name of this alignment - * - * @return - */ - public String name() { - return name; - } - - /** - * Gives the nucleotide that appears at the given position in the alignment. - * The coordinates are in the expanded reference sequence. - * - * @param pos - * position the get nucleotide - * @return nucleotide at provided position - */ - public char getNucleotide(int pos) { - return alignment.getNucleotide(reference.ref2aln(pos)); - } - - /** - * Gives the nucleotide that appears at the given position in the reference - * sequence. The coordinates are in the expanded reference sequence. - * - * @param pos - * position the get nucleotide - * @return nucleotide at provided position - */ - public char getReferenceNucleotide(int pos) { - return reference.getNucleotide(reference.ref2aln(pos)); - } - - private BitSet aligned; - - /** - * Returns whether the supplied position is aligned. Two sequences are - * aligned in a position if the share the same nucleotide. - * - * @param pos - * @return - */ - public boolean isAligned(int pos) { - return aligned.get(pos); - } - - /** - * Returns the length of the reference sequence. This is the length of the - * reference alignment minus all gaps. - * - * @return - */ - public int refLength() { - return reference.size() - reference.getRefGapCount(); - } - - /* - * Returns true if there is extra data between this position and the next - * one. - */ - public int sizeGapAfter(int i) { - return reference.ref2aln(i + 1) - reference.ref2aln(i) - 1; - - } - - @Override - public String toString() { - return name; - } - - @Override - public int start() { - return 1; - - } - - @Override - public int end() { - return refLength(); - } - -} diff --git a/src/net/sf/jannot/alignment/mfa/AlignmentAnnotation.java b/src/net/sf/jannot/alignment/mfa/AlignmentAnnotation.java deleted file mode 100644 index dfcd2bc..0000000 --- a/src/net/sf/jannot/alignment/mfa/AlignmentAnnotation.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.alignment.mfa; - -import net.sf.jannot.Data; -import net.sf.jannot.MemoryListData; -import be.abeel.util.CountMap; - -public class AlignmentAnnotation extends MemoryListData implements Data { - - public String label(){ - return "Multiple alignment"; - } - - private static final long serialVersionUID = -5188981624665479856L; -// private MemoryListData dataList = new MemoryListData(); - private byte[][] conservation; - - public void addAll(Iterable align) { - for (Alignment a : align) { - super.add(a); - } - calculateConservation(); - } - - /** - * Conservation is calculated on the species where the nucleotide is - * present. - */ - private void calculateConservation() { - conservation = new byte[4][super.get(0).refLength()]; - CountMap cm = new CountMap(); - for (int i = 0; i < conservation[0].length; i++) { - cm.clear(); - for (Alignment a : this) { - char nt = Character.toLowerCase(a.getNucleotide(i + 1)); - if (nt != '-') - cm.count(nt); - } - conservation[0][i] = cm.get('a').byteValue(); - conservation[1][i] = cm.get('c').byteValue(); - conservation[2][i] = cm.get('g').byteValue(); - conservation[3][i] = cm.get('t').byteValue(); - - } - - } - - public int numAlignments() { - return super.size(); - } - -// public Alignment getAlignment(int i) { -// if (dataList.size() == 0)// This alignment is not loaded -// return null; -// return dataList.get(i); -// } - - public int getNucleotideCount(char nt, int position) { - if (conservation == null) - return 0; - switch (Character.toLowerCase(nt)) { - case 'a': - return conservation[0][position - 1]; - case 'c': - return conservation[1][position - 1]; - case 'g': - return conservation[2][position - 1]; - case 't': - return conservation[3][position - 1]; - - } - return -1; - - } - - /** - * Position in the reference - * - * This coordinate is one based - * - * @param position - * @return - */ - public double getConservation(int position) { - if (conservation == null)// No data loaded in this multiple alignment - return 0; - if (position <= conservation[0].length && position > 0) { - - double max = conservation[0][position - 1]; - double sum = max; - for (int i = 1; i < conservation.length; i++) { - sum += conservation[i][position - 1]; - if (conservation[i][position - 1] > max) - max = conservation[i][position - 1]; - } - return max / sum; - } else - return 0; - - } - - public double getFootprint(int position) { - if (conservation == null) - return 0; - if (position <= conservation[0].length && position > 0) { - - double sum = 0; - for (int i = 0; i < conservation.length; i++) { - sum += conservation[i][position - 1]; - - } - return sum / numAlignments(); - } else - return 0; - } - - @Override - public Iterable get(int start, int end) { - //It doesn't make sense for this data implementation to be queried by range - return get(); - } - - @Override - public Iterable get() { - return super.get(); - } - - @Override - public boolean canSave() { - - return false; - } - -} diff --git a/src/net/sf/jannot/bigwig/BigWigData.java b/src/net/sf/jannot/bigwig/BigWigData.java deleted file mode 100644 index ccc4b68..0000000 --- a/src/net/sf/jannot/bigwig/BigWigData.java +++ /dev/null @@ -1,245 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.bigwig; - -import java.util.ArrayList; -import java.util.logging.Logger; - -import net.sf.jannot.Data; -import net.sf.jannot.pileup.Pile; -import net.sf.jannot.pileup.PileNormalization; -import net.sf.jannot.pileup.PileTools; - -import org.broad.igv.bbfile.BBFileReader; -import org.broad.igv.bbfile.BBZoomLevelHeader; -import org.broad.igv.bbfile.BigWigIterator; -import org.broad.igv.bbfile.RPChromosomeRegion; -import org.broad.igv.bbfile.WigItem; -import org.broad.igv.bbfile.ZoomDataRecord; -import org.broad.igv.bbfile.ZoomLevelIterator; - -/** - * @author Thomas Abeel - * - */ -public class BigWigData implements Data, PileNormalization { - - private Logger log = Logger.getLogger(BigWigData.class.getCanonicalName()); - private String chr; - - // public int zoom = 0; - // - private int size=-1; - - // private WindowFunction wf; - - private BBFileReader tr; - - // private int maxZoom; - - public String label() { - String out = tr.getLocator().toString().replace('\\', '/'); - return out.substring(out.lastIndexOf('/') + 1); - - } - - private int[] zoomReductionLevels = null; - - /** - * @param chr - * @param tr - */ - public BigWigData(String chr, BBFileReader tr) { - this.chr = chr; - this.tr = tr; - - zoomReductionLevels=new int[tr.getZoomLevelCount()+1]; - zoomReductionLevels[0]=5; - for (BBZoomLevelHeader header : tr.getZoomLevels().getZoomLevelHeaders()) { - System.out.println("$$" + header.getZoomLevel() + "\t" + header.getReductionLevel()); - zoomReductionLevels[header.getZoomLevel()] = header.getReductionLevel(); - // header.print(); - } - RPChromosomeRegion b=tr.getChromosomeBounds(tr.getChromosomeID(chr),tr.getChromosomeID(chr)); - size=b.getEndBase(); - System.out.println(chr+"\t"+b.getStartBase()+"\t"+b.getEndBase()); -// System.out.println(tr.getChromosomeBounds()); -// System.out.println(tr.getChromosomeRegions()); - // /maxZoom = tr.getMaxZoom(); - // for (String s : tr.getDatasetNames()) { - // String[] arr = s.split("/"); - // System.out.println("Checking: "+s); - // if (!arr[2].equals("raw")) { - // int currentZoom = Integer.parseInt(arr[2].substring(1)); - // if (currentZoom > maxZoom) - // maxZoom = currentZoom; - // } - // - // } - - // wf = tr.getWindowFunctions().get(0); - // TDFDataset data = tr.getDataset(chr, 0, wf); - // log.log(Level.INFO,"nTiles: " + data.getNumberOfTiles()); - // log.log(Level.INFO,"tileSize: " + data.getTileWidth()); - // - // this.size = data.getTileWidth(); - // log.log(Level.INFO,"Zooms: "); - // int tmpSize = this.size; - // int tmpZoom = 0; - // while (tmpZoom <= maxZoom) { - // log.log(Level.INFO,"Z" + tmpZoom + "\t" + tmpSize); - // tmpSize /= 2; - // tmpZoom++; - // } - - } - - // public List availableWindowFunctions() { - // return tr.getWindowFunctions(); - // } - - // public void requestWindowFunction(WindowFunction wf){ - // this.wf=wf; - // } - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - // if(size<0) - // setSize(); - // int tmpSize = size; - // int zoom = 0; - int idx = 0; - while ((end - start + 1) / 400 > zoomReductionLevels[idx]) - idx++; - if(idx>0) - idx--; -// System.out.println("ZL: "+idx+"\t"+zoomReductionLevels[idx]); - // while (tmpSize / 2 > (end - start + 1)) { - // tmpSize /= 2; - // zoom++; - // } - // - // if (zoom > maxZoom) { - // zoom = -1; - // } - - // TDFDataset data = tr.getDataset(chr, zoom, wf); - - ArrayList out = new ArrayList(); - - if(idx>0) - fillZoom(out,start,end,idx); - else - fillWig(out,start,end); - - - // for (TDFTile tft : data.getTiles(start, end)) { - // for (int i = 0; i < tft.getSize(); i++) { - // int s = tft.getStartPosition(i); - // int e = tft.getEndPosition(i); - // float vf = tft.getValue(0, i); - // float vr=0; - // if(tft.noValues()>1) - // vr = tft.getValue(1, i); - // if(Float.isNaN(vf)||Float.isInfinite(vf)) - // vf=0; - // if(Float.isNaN(vr)||Float.isInfinite(vr)) - // vr=0; - // if (e > start && s < end) { - // Pile tmp = new Pile(s, vf, vr, null); - // tmp.setLen(e - s); - // out.add(tmp); - // } - // } - // - // } - return out; - - } - - private void fillZoom(ArrayList out, int start, int end,int zoom) { - ZoomLevelIterator zlIter = tr.getZoomLevelIterator(zoom,chr, start, chr, end, false); - while (zlIter.hasNext()) { - ZoomDataRecord rec = zlIter.next(); - int n = rec.getBasesCovered(); - if (n > 0) { - Pile tmp=PileTools.create(rec.getChromStart(), rec.getMeanVal()); -// DoublePile tmp = new DoublePile(rec.getChromStart(), rec.getMeanVal(), 0, null); - tmp.setLength(rec.getChromEnd() - rec.getChromStart()); -// System.out.println("Base covered = " + n); -// double mean = rec.getSumData() / n; -// System.out.println(rec.getChromName() + "\t" + rec.getChromStart() + "\t" + rec.getChromEnd() + "\t" -// + mean); - out.add(tmp); - } - - } - - } - - private void fillWig(ArrayList out, int start, int end) { - BigWigIterator zlIter = tr.getBigWigIterator( chr, start, chr, end, false); - while (zlIter.hasNext()) { - WigItem rec = zlIter.next(); - int n = rec.getEndBase()-rec.getStartBase();//.getBasesCovered(); - if (n > 0) { -// DoublePile tmp = new DoublePile(rec.getStartBase(),rec.getWigValue(), 0, null); - Pile tmp=PileTools.create(rec.getStartBase(),rec.getWigValue()); - tmp.setLength(n); -// System.out.println("Base covered = " + n); -// double mean = rec.getSumData() / n; -// System.out.println(rec.getChromName() + "\t" + rec.getChromStart() + "\t" + rec.getChromEnd() + "\t" -// + mean); - out.add(tmp); - } - - } - - } - - // private void setSize() { - // System.out.println("Setting size..."); - // TDFDataset data = tr.getDataset(chr, 0, wf); - // this.size = data.getTileWidth(); - // } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get() - */ - @Override - public Iterable get() { - return get(1, size); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#canSave() - */ - @Override - public boolean canSave() { - return false; - } - - @Override - public boolean supportsNormalization() { - // FIXME implementing PileNormalization? Yes. Actually supporting it? No. - return false; - } - -// /** -// * @param wf2 -// * @return -// */ -// public boolean isCurrentWindowFunction(WindowFunction wf) { -// return this.wf == wf; -// } - -} diff --git a/src/net/sf/jannot/bigwig/BigWigDataSource.java b/src/net/sf/jannot/bigwig/BigWigDataSource.java deleted file mode 100644 index a182c1b..0000000 --- a/src/net/sf/jannot/bigwig/BigWigDataSource.java +++ /dev/null @@ -1,151 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.bigwig; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.HashSet; -import java.util.Set; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.StringKey; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.picard.SeekableFileCachedHTTPStream; -import net.sf.jannot.source.DataSource; -import net.sf.jannot.source.Locator; -import net.sf.jannot.tabix.PileupWrapper; -import net.sf.samtools.seekablestream.SeekableFileStream; -import net.sf.samtools.seekablestream.SeekableStream; - -import org.broad.igv.bbfile.BBFileReader; -import org.broad.igv.tdf.TDFReader; - -import cern.colt.Arrays; - -/** - * - * Data source for BigWig files. - * - * @author Thomas Abeel - * - */ -public class BigWigDataSource extends DataSource { - - private SeekableStream s = null; - - /** - * @param file - * @throws URISyntaxException - * @throws ReadFailedException - * @throws IOException - * @throws MalformedURLException - */ - public BigWigDataSource(Locator l) throws ReadFailedException, URISyntaxException, MalformedURLException, IOException { - super(l); - if (!l.isURL()) - s = new SeekableFileStream(l.file()); - else - s = new SeekableFileCachedHTTPStream(l.url()); - tr = new BBFileReader(l,s); - - } - - private BBFileReader tr = null; - - // /** - // * @param url - // * @throws URISyntaxException - // * @throws ReadFailedException - // * @throws IOException - // */ - // public TDFDataSource(URL url) throws ReadFailedException, - // URISyntaxException, IOException { - // super(new Locator(url.toString())); - // s=new SeekableFileCachedHTTPStream(url); - // tr=TDFReader.getReader(s); - // } - - // /** - // * @param string - // * @throws URISyntaxException - // * @throws ReadFailedException - // */ - // private TDFDataSource(String string) throws ReadFailedException, - // URISyntaxException { - // tr = TDFReader.getReader(string); - // - // } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#read(net.sf.jannot.EntrySet) - */ - @Override - public EntrySet read(EntrySet set) throws ReadFailedException { - - if (set == null) - set = new EntrySet(); - // SAMFileReader inputSam = getReader(); -// System.out.println(tr.getDatasetNames()); -// System.out.println(tr.getDataMin()); -// System.out.println(tr.getDataMax()); -// System.out.println(tr.getGroupNames()); -// System.out.println(tr.getWindowFunctions()); -// System.out.println(Arrays.toString(tr.getTrackNames())); - - Set chrs = new HashSet(); - - for (String s : tr.getChromosomeNames()) { -// String[] arr = s.split("/"); - chrs.add(s); - Entry e = set.getOrCreateEntry(s); - e.add(new StringKey(tr.getLocator().toString()), new BigWigData(s, tr)); - } -// chrs.remove("All"); -// for (String chr : chrs) { -// -// -// } - - // for (String name : index.names()) { - // Entry e = set.getOrCreateEntry(name); - // // try { - // try { - // e.setSequence(new FaidxData(index, content, name)); - // } catch (Exception ex) { - // System.err.println("Faidx error URL: " + url); - // System.err.println("Faidx error file: " + file); - // throw new ReadFailedException(ex); - // - // } - // } - return set; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#isIndexed() - */ - @Override - public boolean isIndexed() { - return true; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#size() - */ - @Override - public long size() { - return s.length(); - } -} diff --git a/src/net/sf/jannot/event/AnnotationEvent.java b/src/net/sf/jannot/event/AnnotationEvent.java deleted file mode 100644 index 8e25750..0000000 --- a/src/net/sf/jannot/event/AnnotationEvent.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.event; - -import net.sf.jannot.FeatureAnnotation; - -public abstract class AnnotationEvent implements ChangeEvent { - - protected FeatureAnnotation annotation; - - private String msg = new String(); - - public AnnotationEvent(FeatureAnnotation a) { - this.annotation = a; - } - - public AnnotationEvent(FeatureAnnotation a, String msg){ - this.annotation = a; - this.msg = msg; - } - - @Override - public String toString(){ - return new String("Edit annotation "+"("+msg+")"); - } -} diff --git a/src/net/sf/jannot/event/ChangeEvent.java b/src/net/sf/jannot/event/ChangeEvent.java deleted file mode 100644 index 85cca08..0000000 --- a/src/net/sf/jannot/event/ChangeEvent.java +++ /dev/null @@ -1,11 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.event; - -public interface ChangeEvent { - - public void doChange(); - public void undoChange(); - -} diff --git a/src/net/sf/jannot/event/FeatureEvent.java b/src/net/sf/jannot/event/FeatureEvent.java deleted file mode 100644 index 439e35c..0000000 --- a/src/net/sf/jannot/event/FeatureEvent.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.event; - -import net.sf.jannot.Feature; - -public abstract class FeatureEvent implements ChangeEvent { - - private Feature feature; - - private String msg = new String(); - - public final Feature getFeature() { - return feature; - } - - public FeatureEvent(Feature f) { - this.feature = f; - } - - public FeatureEvent(Feature f, String msg) { - this.feature = f; - this.msg = msg; - } - - @Override - public String toString(){ - return new String("Edit feature "+feature+" ("+msg+")"); - } -} diff --git a/src/net/sf/jannot/exception/ReadFailedException.java b/src/net/sf/jannot/exception/ReadFailedException.java deleted file mode 100644 index 906e9cb..0000000 --- a/src/net/sf/jannot/exception/ReadFailedException.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.exception; - -import java.io.IOException; - -public class ReadFailedException extends Exception { - - private static final long serialVersionUID = 1L; - - - public ReadFailedException(IOException e) { - super(e); - } - - - public ReadFailedException(Throwable arg0) { - super(arg0); - } - public ReadFailedException(String arg0) { - super(arg0); - } -} diff --git a/src/net/sf/jannot/exception/SaveFailedException.java b/src/net/sf/jannot/exception/SaveFailedException.java deleted file mode 100644 index ad79be2..0000000 --- a/src/net/sf/jannot/exception/SaveFailedException.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.exception; - -public class SaveFailedException extends Exception { - - public SaveFailedException() { - super(); - - } - - public SaveFailedException(String arg0, Throwable arg1) { - super(arg0, arg1); - - } - - public SaveFailedException(String arg0) { - super(arg0); - - } - - public SaveFailedException(Throwable arg0) { - super(arg0); - - } - - /** - * - */ - private static final long serialVersionUID = -2022595560772769970L; - -} diff --git a/src/net/sf/jannot/indexing/Faidx.java b/src/net/sf/jannot/indexing/Faidx.java deleted file mode 100644 index af016c9..0000000 --- a/src/net/sf/jannot/indexing/Faidx.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.indexing; - -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.PrintWriter; -import java.net.URISyntaxException; - -import net.sf.jannot.source.Locator; - -/** - * @author Thomas Abeel - * - */ -public class Faidx { - - public static void index(Locator data, Locator index) throws URISyntaxException, IOException { - - PrintWriter out = new PrintWriter(index.file()); - BufferedInputStream bis = new BufferedInputStream(data.stream()); - byte[] buffer = new byte[8 * 1024]; - int read = bis.read(buffer); - long filepos = 0; - long entryLen = 0; - // boolean newLine = false; - boolean firstLine = false; - boolean firstSpacer = false; - boolean newEntry = true; - long lineLen = 0; - int spacer = 0; - boolean firstEntry = true; - boolean lineSet = false; - // boolean firstChar = false; - long oStart = 0; - int oSpacer = 0; - long oLen = 0; - long oLine = 0; - String oName = null; - - StringBuffer name = new StringBuffer(); - while (read > 0) { - for (int i = 0; i < read; i++) { - - char c = (char) buffer[i]; - if (c == '>'&&!firstLine) { - spacer = 0; - // firstChar = true; - firstSpacer = true; - firstLine = true; - lineSet = false; - newEntry = true; - name.setLength(0); - // System.out.println("ELen=" + entryLen); - if (!firstEntry) { - oLen = entryLen; - output(oSpacer, oLen, oLine, oName, oStart, out); - - } - firstEntry = false; - entryLen = 0; - - } else if (c == '\n' || c == '\r') { - - if (newEntry) { - newEntry = false; - oName = name.toString().trim(); - - } else if (!firstLine && !lineSet) { - oLine = lineLen; - lineSet = true; - } - spacer++; - lineLen = 0; - - } else { - - if (newEntry) - name.append(c); - else { - if (lineSet&&firstSpacer) { - oSpacer = spacer; - firstSpacer = false; - } - if (firstLine) { - oStart = filepos; - firstLine = false; - } - - lineLen++; - entryLen++; - } - spacer = 0; - } - - filepos++; - - } - read = bis.read(buffer); - } - oLen = entryLen; - output(oSpacer, oLen, oLine, oName, oStart, out); - out.close(); - } - - /** - * @param oName - * @param oLine - * @param oLen - * @param oSpacer - * @param oStart - * @param out - * - */ - private static void output(int oSpacer, long oLen, long oLine, String oName, long oStart, PrintWriter out) { - out.println(oName + "\t" + oLen + "\t" + (oStart) + "\t" + oLine + "\t" + (oLine + oSpacer)); - - } - -} diff --git a/src/net/sf/jannot/mafix/IndexedMAF.java b/src/net/sf/jannot/mafix/IndexedMAF.java deleted file mode 100644 index 7023bef..0000000 --- a/src/net/sf/jannot/mafix/IndexedMAF.java +++ /dev/null @@ -1,239 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.mafix; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.Set; -import java.util.SortedSet; - -import net.sf.jannot.Strand; -import net.sf.jannot.alignment.maf.AbstractAlignmentBlock; -import net.sf.jannot.alignment.maf.AbstractMAFMultipleAlignment; -import net.sf.jannot.alignment.maf.LazyAlignmentBlock; -import net.sf.jannot.alignment.maf.LazyAlignmentSequence; -import net.sf.jannot.picard.LineBlockCompressedInputStream; -import net.sf.samtools.seekablestream.SeekableStream; - -import org.broad.LRUCache; - -/** - * @author thpar - * @author Thomas Abeel - * - */ -public class IndexedMAF extends AbstractMAFMultipleAlignment { - - private static final long serialVersionUID = -5395637172502888568L; - private MAFIndex idx; - private SeekableStream compressedContent; - - private String selectedChrom = null; - - /** - * Looks for a compressed version of the requested MAF file and its index - * file. Creates an index from this file. - * - * @param maf - * name of the compressed MAF stream. - * @param index - * name of the index stream - * - * @throws FileNotFoundException - * @throws IOException - */ - public IndexedMAF(SeekableStream maf, InputStream index) throws FileNotFoundException, IOException { - this.compressedContent = maf; - this.idx = new MAFIndex(index); - } - - /** - * Creates a new IndexedMaf out of an other one, but setting the selected - * chromosome and pointing to the content of the original IndexedMaf. - * - * @param chr - * @param maf - */ - public IndexedMAF(String chr, IndexedMAF maf) { - this.compressedContent = maf.compressedContent; - this.idx = maf.getIndex(); - setSelectedChrom(chr); - } - - @Override - public Iterable get(int start, int end) { - if (selectedChrom != null) - return get(selectedChrom, start, end); - else - return new ArrayList(); - } - - private LRUCache blockCache = new LRUCache(200); - - /** - * - * @param fromNuc - * @param toNuc - * @return list of all AlignmentBlocks that overlap with the requested range - * [fromNuc, toNuc[ - */ - Iterable get(String chr, int fromNuc, int toNuc) { - SortedSet mafEntries = idx.getMAFEntries(chr, fromNuc, toNuc); - BlockList blockList = new BlockList(mafEntries); - return blockList; - - } - - @Override - public Iterable get() { - return get(0, Integer.MAX_VALUE); - } - - @Override - public boolean canSave() { - return false; - } - - MAFIndex getIndex() { - return this.idx; - } - - String getSelectedChrom() { - return selectedChrom; - } - - void setSelectedChrom(String selectedChrom) { - this.selectedChrom = selectedChrom; - } - - public Set getNames() { - return this.idx.getNames(); - } - - // 'species' include ALL SPECIES that are compared. - // in 'names', we're only talking about the reference species or chromosome - // @Override - // Collectionspecies(){ - // return Collections.unmodifiableCollection(getNames()); - // } - - private class BlockList implements Iterable { - - private SortedSet mafEntries; - - BlockList(SortedSet mafEntries) { - this.mafEntries = mafEntries; - - } - - /* - * (non-Javadoc) - * - * @see java.lang.Iterable#iterator() - */ - @Override - public Iterator iterator() { - return new BlockIterator(); - } - - private class BlockIterator implements Iterator { - private Iterator entryIterator; - private LineBlockCompressedInputStream zr; - - BlockIterator() { - this.entryIterator = mafEntries.iterator(); - this.zr = new LineBlockCompressedInputStream(compressedContent); - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#hasNext() - */ - @Override - public boolean hasNext() { - return entryIterator.hasNext(); - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#next() - */ - @Override - public AbstractAlignmentBlock next() { - MAFEntry mafEntry = entryIterator.next(); - - // here we can already get the info in mafEntry, - // without further parsing! (position, length, strands, species, - // ...) - - LazyAlignmentBlock alBlock = getOrCreate(mafEntry); - - return alBlock; - } - - private LazyAlignmentBlock getOrCreate(MAFEntry mafEntry) { - if (!blockCache.containsKey(mafEntry)) { - - LazyAlignmentBlock alBlock = new LazyAlignmentBlock(mafEntry.getStart(), zr, - mafEntry.getNucStart(), mafEntry.getNucStart() + mafEntry.getAlignmentLength()); - -// List strands = mafEntry.getStrands(); - int[] species = mafEntry.getSpecies(); - - LazyAlignmentSequence alSeq = new LazyAlignmentSequence(getSelectedChrom(), mafEntry.getNucStart(), - mafEntry.getAlignmentLength(), Strand.FORWARD, alBlock); - alBlock.add(alSeq); - for (int spec : species) { - int specIdx=(int)Math.abs(spec); - Strand s=Strand.FORWARD; - if(spec<0) - s=Strand.REVERSE; - String name = idx.getSpeciesName(getSelectedChrom(), specIdx); - alSeq = new LazyAlignmentSequence(name, mafEntry.getNucStart(), mafEntry.getAlignmentLength(), - s, alBlock); - alBlock.add(alSeq); - } - blockCache.put(mafEntry,alBlock); - } - return blockCache.get(mafEntry); - - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#remove() - */ - @Override - public void remove() { - // no removing support - } - - } - } - - // @Override - // String toString(){ - // return this.getClass().getName()+"@"+this.hashCode(); - // } - - @Override - public Collection species() { - if (this.selectedChrom == null) - return new ArrayList(); - return idx.getSpecies(selectedChrom); - } - - @Override - public int noAlignmentBlocks() { - return idx.size(selectedChrom); - } - -} diff --git a/src/net/sf/jannot/mafix/MAFEntry.java b/src/net/sf/jannot/mafix/MAFEntry.java deleted file mode 100644 index ef97332..0000000 --- a/src/net/sf/jannot/mafix/MAFEntry.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.mafix; - - -/** - * The offset pair (start and end of an aligment) in a block zipped file and the - * length of the represented alignment in nucleotides. - * - * @author thpar - * @author Thomas Abeel - * - */ -class MAFEntry implements Comparable { - - /** - * @return the start - */ - long getStart() { - return start; - } - - /** - * Start of the alignment (nucleotides are counted one based) - */ - private int nucStart; - - /** - * Length of the represented alignment - */ - private int alignmentLength; - - - /** - * The list of species involved in this particular alignment (the reference - * chromosome NOT included) - */ - private int[] species; - - /** - * Begin offset in the block zipped file - */ - - private long start; - - - - /** - * - * @param allSpecies - * @param specCode - * comma-separated list of species numbers - */ - void setSpeciesEncoding(String specCode) { - if(specCode.trim().equals(".")){ - species=new int[0]; - return; - } - String[] specsArray = specCode.split(","); - species = new int[specsArray.length]; - for (int i = 0; i < specsArray.length; i++) - species[i] = Integer.parseInt(specsArray[i]); - - } - - /** - * Does the alignment this entry represent overlap with the range defined by - * [rangeFrom, rangeTo[ ? - * - * @param rangeFrom - * @param rangeTo - * @return - */ - boolean overlaps(int rangeFrom, int rangeTo) { - int nucEnd = nucStart + alignmentLength - 1; - - return ((nucStart < rangeFrom && nucEnd >= rangeFrom) || nucStart >= rangeFrom && nucStart < rangeTo); - - } - - @Override - public int compareTo(MAFEntry o) { - if (nucStart == o.nucStart) { - if (alignmentLength == o.alignmentLength) - return 0; - else if (alignmentLength < o.alignmentLength) - return -1; - else - return 1; - } else { - if (nucStart < o.nucStart) - return -1; - else - return 1; - } - } - - @Override - public boolean equals(Object o) { - if (!(o instanceof MAFEntry)) - return false; - MAFEntry oo = (MAFEntry) o; - int comp = this.compareTo(oo); - return comp == 0; - } - - int getNucStart() { - return nucStart; - } - - void setNucStart(int nucStart) { - this.nucStart = nucStart; - } - - int getAlignmentLength() { - return alignmentLength; - } - - void setAlignmentLength(int alignmentLength) { - this.alignmentLength = alignmentLength; - } - - void setOffsetPair(long start) { - this.start = start; - } - - - int[] getSpecies() { - return species; - } - - /** - * @param speciesLocationMap - * @return - */ - String getEncodedSpecies() { - - if (species.length == 0) - return "."; - - StringBuffer list = new StringBuffer(); - for (int spec : species) { - list.append(spec); - list.append(","); - - } - if (list.length() > 0) { - list.deleteCharAt(list.length() - 1); - } - return list.toString(); - - } - - /** - * @param encodeSpecies - */ - void setSpecies(int[] encodeSpecies) { - this.species = encodeSpecies; - - } - - -} diff --git a/src/net/sf/jannot/mafix/MAFIndex.java b/src/net/sf/jannot/mafix/MAFIndex.java deleted file mode 100644 index 0ce5667..0000000 --- a/src/net/sf/jannot/mafix/MAFIndex.java +++ /dev/null @@ -1,327 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.mafix; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.zip.GZIPOutputStream; - -import cern.colt.Arrays; - -import be.abeel.io.LineIterator; - -/** - * The index of a MAF file. - * - * @author thpar - * @author Thomas Abeel - * - */ -class MAFIndex { - // number of nucs per tile - private int TILE_SIZE = 100; - - /** - * Pairs an index (nucleotide position to position in alignment file) with a - * tiling (nucleotide range to nucleotide positions with associated - * entries). - * - * @author thpar - * - */ - private class ChrIndex { - /** - * The index keeps a reference from the nucleotide position to a - * {@link MAFEntry} - */ - public Map index = new HashMap(); - /** - * Mapping of tile number to a list of alignment starts A tile is mapped - * to the alignment start if it somewhere overlaps with the alignment. - */ - public Map> tiling = new HashMap>(); - } - - /** - * Maps chromosome names to their indexes - */ - private Map chromIndexes = new HashMap(); - - /** - * Reference chromosome names mapped to the species they're aligned with. - * The list of species contains ALL species, including the reference - * chromosome itself, that's on place 0. - */ - private Map> chromSpecies = new HashMap>(); - - /** - * Start a new empty index object - */ - MAFIndex() { - } - - /** - * create an index object streamed from an index file - * - * @param indexFile - * @throws IOException - */ - MAFIndex(InputStream indexFile) throws IOException { - this.loadFromStream(indexFile); - } - - /** - * Write the index to a file, compressed with GZIP. - * - * @param indexFile - */ - void writeToFile(File indexFile) throws IOException { - System.out.println("Writing index to file"); - GZIPOutputStream gzo = new GZIPOutputStream(new FileOutputStream(indexFile)); - - PrintWriter pw = new PrintWriter(gzo); - - for (Entry chrEntry : chromIndexes.entrySet()) { - String refChrom = chrEntry.getKey(); - // get all species that are aligned to this chromosome - List species = chromSpecies.get(refChrom); - - // make species mapping - // output species at the same time - Map speciesLocationMap = new HashMap(); - pw.print(":"); - for (int specCount = 0; specCount < species.size(); specCount++) { - String spec = species.get(specCount); - pw.print(spec); - speciesLocationMap.put(spec, specCount); - if (specCount < species.size() - 1) { - pw.print(","); - } - } - pw.println(); - Map index = chrEntry.getValue().index; - for (Entry entry : index.entrySet()) { - int nuc = entry.getKey(); - MAFEntry mafEntry = entry.getValue(); - int alignmentLength = mafEntry.getAlignmentLength(); - long fileStart = mafEntry.getStart(); - // long fileEnd = mafEntry.getEnd(); - - // String strands = mafEntry.getEncodedStrands(); - String speciesCode = mafEntry.getEncodedSpecies(); - - pw.println(nuc + "\t" + alignmentLength + "\t" + fileStart + "\t" + "\t" + "\t" + speciesCode); - - } - } - - pw.close(); - } - - - - void addEntry(String chr, MAFEntry mafEntry) { - ChrIndex chrIndex = chromIndexes.get(chr); - if (chrIndex == null) { - chrIndex = new ChrIndex(); - chromIndexes.put(chr, chrIndex); - } - - Map index = chrIndex.index; - - index.put(mafEntry.getNucStart(), mafEntry); - int endNucPosition = mafEntry.getNucStart() + mafEntry.getAlignmentLength() - 1; - - int startTileNumber = getTileNumber(mafEntry.getNucStart()); - int endTileNumber = getTileNumber(endNucPosition); - for (int i = startTileNumber; i <= endTileNumber; i++) { - List tile = getTile(chr, i); - tile.add(mafEntry.getNucStart()); - } - } - - /** - * Translate a nucleotide position to the tile number - * - * @param nucPosition - * @return - */ - private int getTileNumber(int nucPosition) { - return nucPosition / TILE_SIZE; - } - - /** - * Tiles are counted zero based - * - * @param chr - * name of the chromosome - * @param tileNumber - * @return list with all alignment starts within this tile - */ - private List getTile(String chr, int tileNumber) { - ChrIndex chrIndex = chromIndexes.get(chr); - if (chrIndex == null) { - chrIndex = new ChrIndex(); - chromIndexes.put(chr, chrIndex); - } - - Map> tiling = chrIndex.tiling; - - List tile; - if (!tiling.containsKey(tileNumber)) { - tile = new ArrayList(); - tiling.put(tileNumber, tile); - } else { - tile = tiling.get(tileNumber); - } - return tile; - } - - /** - * - * Returns all the alignments that overlap with [nucFrom, nucTo[ - * - * @param nucFrom - * @param nucTo - * @return - */ - SortedSet getMAFEntries(String chr, int nucFrom, int nucTo) { - int startTile = getTileNumber(nucFrom); - int endTile = getTileNumber(nucTo - 1); - - SortedSet mafEntries = new TreeSet(); - - ChrIndex chrIndex = chromIndexes.get(chr); - if (chrIndex == null) - return mafEntries; - - Map index = chrIndex.index; - Map> tiling = chrIndex.tiling; - - for (int i = startTile; i <= endTile; i++) { - if (tiling.containsKey(i)) { - List alignmentStarts = tiling.get(i); - // iterate the starting points and retrieve the entry in the - // index - // entries overlapping with the requested range are returned - for (int alStart : alignmentStarts) { - MAFEntry entry = index.get(alStart); - if (entry.overlaps(nucFrom, nucTo)) { - mafEntries.add(entry); - } - - } - } - } - return mafEntries; - } - - void loadFromStream(InputStream indexFile) throws FileNotFoundException, IOException { - LineIterator lit = new LineIterator(indexFile); - - String currentChrom = new String(); - - for (String line : lit) { - if (line.startsWith(":")) { - // started on a new chromosome - String[] species = line.substring(1).split(","); - currentChrom = species[0]; - for (int i = 0; i < species.length; i++) { - addSpecies(currentChrom, species[i]); - } - - } else { - String[] cols = line.split("\t"); - MAFEntry mafEnt = new MAFEntry(); - mafEnt.setNucStart(Integer.parseInt(cols[0]) + 1); - mafEnt.setAlignmentLength(Integer.parseInt(cols[1])); - mafEnt.setOffsetPair(Long.parseLong(cols[2])); - // mafEnt.setStrandEncoding(cols[4]); - mafEnt.setSpeciesEncoding(cols[5]); - - this.addEntry(currentChrom, mafEnt); - } - } - } - - MAFEntry getMAFEntry(String chr, int nucPosition) { - if (!chromIndexes.containsKey(chr)) - return null; - return chromIndexes.get(chr).index.get(nucPosition); - } - - /** - * @return The names of the stored chromosomes - */ - Set getNames() { - return chromIndexes.keySet(); - } - - /** - * Returns the list of species/chromosome the reference chromosomse is - * mapped to, including the reference chromosome itself on place 0. - * - * @param chr - * the reference chromosome - * @return - */ - List getSpecies(String chr) { - return chromSpecies.get(chr); - } - - void addSpecies(String refChrom, String spec) { - List species; - species = this.chromSpecies.get(refChrom); - if (species == null) { - species = new ArrayList(); - chromSpecies.put(refChrom, species); - } - if (!species.contains(spec)) { - species.add(spec); - } - } - - /** - * @param blockSpecies - * @param blockStrands - * @return - */ - int[] encodeSpecies(String refChrom, List blockSpecies, String blockStrands) { - int[] out = new int[blockSpecies.size()]; - List list = chromSpecies.get(refChrom); - for (int i = 0; i < blockSpecies.size(); i++) { - int sign = 1; - if (blockStrands.charAt(i+1) == '-') - sign = -1; - out[i] = sign * list.indexOf(blockSpecies.get(i)); - } - return out; - } - - /** - * @param selectedChrom - * @param spec - * @return - */ - String getSpeciesName(String selectedChrom, int spec) { - return chromSpecies.get(selectedChrom).get(spec); - } - - public int size(String selectedChrom) { - return chromIndexes.get(selectedChrom).index.size(); - } - -} diff --git a/src/net/sf/jannot/mafix/MafixFactory.java b/src/net/sf/jannot/mafix/MafixFactory.java deleted file mode 100644 index b41e3eb..0000000 --- a/src/net/sf/jannot/mafix/MafixFactory.java +++ /dev/null @@ -1,223 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.mafix; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.List; - -import net.sf.samtools.util.BlockCompressedInputStream; -import net.sf.samtools.util.BlockCompressedOutputStream; -import net.sf.samtools.seekablestream.SeekableStream; -import be.abeel.io.LineIterator; - -/** - * @author thpar - * @author Thomas Abeel - * - */ -public class MafixFactory { - - - /** - * Read the original MAF file and write it to the block zipped stream. Add - * every new Alignment Block to the index. - * @throws URISyntaxException - */ - public static void generateBlockZippedFile(InputStream is, File out) throws FileNotFoundException, IOException, URISyntaxException { - BufferedInputStream bis=new BufferedInputStream(is, 1024*1024); - LineIterator it=new LineIterator(bis); - - BlockCompressedOutputStream bcos = new BlockCompressedOutputStream(out); - - for(String line:it){ - bcos.write(line.getBytes()); - bcos.write(System.getProperty("line.separator").getBytes()); - - } - - bcos.close(); - - } - /** - * Reads a line from the inputstream until a \n or \n\r is encountered. The - * file pointer will be positioned at the beginning of the next line after - * this read. - * - * @param bcos - * - * @return a string with the read characters. Null when no more characters - * are being read. - */ - private static String readLine(BlockCompressedInputStream bcos) throws IOException { - - int readChar = bcos.read(); - if (readChar < 0) - return null; // EOF - - StringBuffer lineBuffer = new StringBuffer(); - long readAheadCharPos = 0; - int readAheadChar = 0; - - readAheadCharPos = bcos.getFilePointer(); - readAheadChar = bcos.read(); - - while (readAheadChar >= 0 && readChar != '\n' && readChar != '\r') { - lineBuffer.append((char)readChar); - - readChar = readAheadChar; - - readAheadCharPos = bcos.getFilePointer(); - // int available =bcos.available(); - readAheadChar = bcos.read(); - - } - if (readChar >= 0 && readAheadChar >= 0) { - if (readAheadCharPos >= 0 && !(readChar == '\r' && readAheadChar == '\n')) { - // the readAhead ate a char from the next line. - // cough it up... - bcos.seek(readAheadCharPos); - } - } - - return lineBuffer.toString(); - } - - public static void generateIndex(SeekableStream is, File out) throws IOException { - System.out.println("Generating index"); - MAFIndex idx = new MAFIndex(); - - /** - * position of a block in the zipped file - */ - long blockStart = 0; - /** - * Does the next line contain the nuc location for human? - */ - boolean nextLineHuman = false; - - /** - * Name of the reference chromosome we're reading - */ - String thisChrom = new String(); - - /** - * Are we currently inside a MA block? - */ - boolean inBlock = false; - - /** - * Start position of this MA - */ - int nucPosition = 0; - int alignmentLength = 0; - int srcSize = -1; - BlockCompressedInputStream bcos = new BlockCompressedInputStream(is); - - bcos.seek(0); - long beginLinePointer = bcos.getFilePointer(); -// long lastLinePointer = beginLinePointer; - - List blockSpecies = new ArrayList(); - StringBuffer blockStrands = new StringBuffer(); - - String line = readLine(bcos); - while (line != null) { - - // ignore comments - if (!line.startsWith("#")) { - - // split on whitespace - String[] columns = line.split("\\s+"); - - // when encountering an a-line, save position and mark next line - // as - // containing human coordinates - if (columns[0].equals("a")) { - - inBlock = true; - blockStart = beginLinePointer; - blockSpecies = new ArrayList(); - blockStrands = new StringBuffer(); - nextLineHuman = true; - } else if (columns[0].equals("s")) { - if (nextLineHuman) { - nucPosition = Integer.parseInt(columns[2]); - alignmentLength = Integer.parseInt(columns[3]); - srcSize = Integer.parseInt(columns[5]); - nextLineHuman = false; - // add the human chromosome name - thisChrom = columns[1]; - } else { - blockSpecies.add(columns[1]); - } - idx.addSpecies(thisChrom, columns[1]); - blockStrands.append(columns[4]); - - } -// System.out.println("Strands: "+blockStrands.toString()); - if (inBlock && line.isEmpty()) { - MAFEntry mafEntry = new MAFEntry(); - nucPosition = fixPosition(nucPosition, blockStrands.charAt(0), srcSize, alignmentLength); - mafEntry.setNucStart(nucPosition); - mafEntry.setAlignmentLength(alignmentLength); - mafEntry.setOffsetPair(blockStart); - mafEntry.setSpecies(idx.encodeSpecies(thisChrom,blockSpecies,blockStrands.toString())); - - idx.addEntry(thisChrom, mafEntry); - inBlock = false; - } - } - -// lastLinePointer = beginLinePointer; - beginLinePointer = bcos.getFilePointer(); - line = readLine(bcos); - } - if (inBlock) { - MAFEntry mafEntry = new MAFEntry(); - mafEntry.setNucStart(nucPosition); - mafEntry.setAlignmentLength(alignmentLength); - mafEntry.setOffsetPair(blockStart); - mafEntry.setSpecies(idx.encodeSpecies(thisChrom,blockSpecies,blockStrands.toString())); - idx.addEntry(thisChrom, mafEntry); - inBlock = false; - } - idx.writeToFile(out); - } - - /** - * @param nucPosition - * @param srcSize - * @param charAt - * @return - */ - private static int fixPosition(int start, char strand, int srcSize, int noNucleotides) { - if (strand == '+') - return start; - else if (strand == '-') - return srcSize - start - noNucleotides; - throw new RuntimeException("Could not fix position..."); - } - -// /** -// * Creates a block zipped file from the original MAF, generates an mfi index -// * file and writes this index to a zipfile in the same directory. -// * @param seekableStream -// * -// * @param mafFile -// * @throws FileNotFoundException -// * @throws IOException -// * @throws URISyntaxException -// */ -// public static void compressAndIndex(InputStream seekableStream, File file) throws FileNotFoundException, IOException, URISyntaxException { -// new MafixFactory(seekableStream,file); -// -// } - -} diff --git a/src/net/sf/jannot/parser/ALNParser.java b/src/net/sf/jannot/parser/ALNParser.java deleted file mode 100644 index e012311..0000000 --- a/src/net/sf/jannot/parser/ALNParser.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.alignment.ReferenceSequence; -import net.sf.jannot.alignment.mfa.Alignment; -import net.sf.jannot.alignment.mfa.AlignmentAnnotation; -import net.sf.jannot.refseq.MemorySequence; -import net.sf.jannot.refseq.Sequence; -import be.abeel.io.LineIterator; - -public class ALNParser extends Parser { - - /** - * @param dataKey - */ - public ALNParser(DataKey dataKey) { - super(dataKey); - - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if(set==null) - set=new EntrySet(); - List list = new ArrayList(); - boolean header=true; - LineIterator it=new LineIterator(is); - int index=0; - - while(it.hasNext()){ - String line=it.next(); - if(line.length()==0&&header){ - header=false; - - - } - if(line.length()==0){ - index=0; - }else{ - String[]arr=line.split(" +"); - if(header){ - list.add(new Entry(arr[0].split(" ")[0].trim())); - } - ((MemorySequence)list.get(index).sequence()).addSequence(arr[1]); - index++; - } - - - - - } - Entry ref = set.getEntry(list.get(0).getID()); - if (ref != null) { - List alist = new ArrayList(); - ReferenceSequence rs = new ReferenceSequence((MemorySequence)list.get(0).sequence()); - for (int i = 0; i < list.size(); i++) { - System.out.println(list.get(i).getID()); - Alignment align = new Alignment(list.get(i).getID(),(MemorySequence)list.get(i).sequence(), rs); - alist.add(align); - System.out.println("adding alignment: " + align); - } - //ref.alignment.addAll(alist); - AlignmentAnnotation alignAnnot=new AlignmentAnnotation(); - ref.add(dataKey, alignAnnot); - alignAnnot.addAll((Iterable)alist); - - } - - return set; - } - - - -} diff --git a/src/net/sf/jannot/parser/BEDParser.java b/src/net/sf/jannot/parser/BEDParser.java deleted file mode 100644 index e647627..0000000 --- a/src/net/sf/jannot/parser/BEDParser.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.FeatureAnnotation; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Type; -import be.abeel.io.LineIterator; - -/** - * - * @author Thomas Abeel - * - */ -public class BEDParser extends Parser { - - private String defaultType; - - /** - * @param dataKey - */ - public BEDParser(String fileName) { - super(null); - String[] arr = fileName.replace('\\', '/').split("/"); - defaultType = arr[arr.length - 1]; - - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - Type type = null; - LineIterator it = new LineIterator(is); - it.setSkipBlanks(true); - it.setSkipComments(true); - for (String line : it) { - /* Handle header lines */ - if (line.startsWith("track")) { - String name = BEDTools.parseTrack(line).get("name"); - System.out.println(BEDTools.parseTrack(line)); - System.out.println("NAME: " + name); - if (name != null) - type = Type.get(name); - continue; - } else if (line.startsWith("browser")) - continue; - Feature f = BEDTools.parseLine(line, type, defaultType); - MemoryFeatureAnnotation fa = set.getOrCreateEntry(f.qualifier("chrom")).getMemoryAnnotation(f.type());// (FeatureAnnotation) - fa.add(f); - - } - return set; - } - - @Override - public void write(OutputStream os, Entry entry) { - - PrintWriter out = new PrintWriter(os); - - for (DataKey data : entry) { - - if (entry.get(data) instanceof FeatureAnnotation) { - String headerLine = "track name=\""+entry.get(data).label()+"\""; - if(entry.description.keys().size()>0) - headerLine+=" description=\""+entry.description.toString()+"\""; - out.println(headerLine); - FeatureAnnotation fa = (FeatureAnnotation) entry.get(data); - for (Feature f : fa.get()) { - out.println(line(f, entry.getID(),entry)); - } - } - - } - - out.flush(); - - } - - private String line(Feature f, String acc, Entry e) { - - StringBuffer out = new StringBuffer(); - - out.append(e.getID() + "\t"); - out.append((f.start()-1) + "\t"); - out.append(f.end() + "\t"); - out.append(f.qualifier("Name") + "\t"); - out.append(f.qualifier("score") + "\t"); - out.append(f.strand().symbol() + "\t"); - out.append((f.start()-1) + "\t"); - out.append(f.end() + "\t"); - if (f.getColor()!=null) - out.append(f.getColor().toString()); - else - out.append(""); - return out.toString(); - } - -} diff --git a/src/net/sf/jannot/parser/BEDTools.java b/src/net/sf/jannot/parser/BEDTools.java deleted file mode 100644 index 212dc52..0000000 --- a/src/net/sf/jannot/parser/BEDTools.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; - -/** - * @author Thomas Abeel - * - */ -public class BEDTools { - - public static Feature parseLine(String line,Type type,String defaultType){ - /* Any other lines */ - String[] arr = line.split("\t"); - Feature f = new Feature(); - if(type==null) - if(defaultType!=null){ - type=Type.get(defaultType); - }else{ - if (arr.length == 12) { - type=Type.get("CDS"); - }else - type=Type.get("BED"); - } - f.setType(type); - /* Chromosome */ - f.addQualifier("chrom", arr[0]); - - /* Optional name */ - if (arr.length > 3) - f.addQualifier("Name", arr[3]); - /* - * If user only specified 4 column, (s)he may have forgotten the - * name column and put a score instead at position 3 - */ - try { - if (arr.length == 4) { - double score = Double.parseDouble(arr[3]); - f.setScore(score); - } - } catch (NumberFormatException e) { - // no worries, nothing wrong - } - - /* Optional score */ - if (arr.length > 4) - f.setScore(Double.parseDouble(arr[4])); - - /* Optional strand */ - if (arr.length > 5) { - char strand = arr[5].charAt(0); - switch (strand) { - case '-': - f.setStrand(Strand.REVERSE); - break; - case '+': - f.setStrand(Strand.FORWARD); - break; - case '.': - case '?': - f.setStrand(Strand.UNKNOWN); - break; - } - } - /* Optional color */ - if (arr.length > 8) { - f.addQualifier("color", arr[8]); - } - Location chromLoc = new Location(Integer.parseInt(arr[1]) + 1, Integer.parseInt(arr[2])); - - /* TODO implement other optional fields */ - SortedSet tmp = new TreeSet(); - if (arr.length == 12) { - Location codingLoc = new Location(Integer.parseInt(arr[6]) + 1, Integer.parseInt(arr[7])); - - int count = Integer.parseInt(arr[9]); - String[] arrSize = arr[10].split(","); - String[] arrStart = arr[11].split(","); - - for (int i = 0; i < count; i++) { - int start = Integer.parseInt(arrStart[i].trim()) + chromLoc.start; - int end = Integer.parseInt(arrSize[i].trim()) + start - 1; - Location loc = new Location(start, end); - if (loc.start < codingLoc.start && loc.end > codingLoc.start) - loc.setStart(codingLoc.start); - if (loc.start < codingLoc.end && loc.end > codingLoc.end) - loc.setEnd(codingLoc.end); - if (loc.start >= codingLoc.start && loc.end <= codingLoc.end) - tmp.add(loc); - - } - /* Non-coding gene */ - if (tmp.size() == 0) { - f.setType(Type.get("pseudoGene")); - for (int i = 0; i < count; i++) { - int start = Integer.parseInt(arrStart[i].trim()) + chromLoc.start; - int end = Integer.parseInt(arrSize[i].trim()) + start - 1; - Location loc = new Location(start, end); - tmp.add(loc); - - } - - } - } else { - - tmp.add(chromLoc); - - } - f.setLocation(tmp); - return f; - } - - public static HashMap parseTrack(String trackLine) { - HashMap out = new HashMap(); - - List matchList = new ArrayList(); - Pattern regex = Pattern.compile("[\\S]+=[\\S\"']+|[\\S]+=\"[^\"]*\"|[\\S]+='[^']*'"); - Matcher regexMatcher = regex.matcher(trackLine); - while (regexMatcher.find()) { - matchList.add(regexMatcher.group()); - } - - for (String s : matchList) { - System.out.println("QQ=" + s); - // String[] arr = trackLine.split(" "); - // for (String s : arr) { - String[] kv = s.split("="); - if (kv.length > 1) - if(kv[1].charAt(0)=='\''||kv[1].charAt(0)=='\"') - out.put(kv[0], kv[1].substring(1,kv[1].length()-1)); - else - out.put(kv[0], kv[1]); - else - out.put(kv[0], null); - - } - // } - return out; - } -} diff --git a/src/net/sf/jannot/parser/BedGraphParser.java b/src/net/sf/jannot/parser/BedGraphParser.java deleted file mode 100644 index 8266860..0000000 --- a/src/net/sf/jannot/parser/BedGraphParser.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.StringKey; -import net.sf.jannot.wiggle.FloatArrayWiggle; -import be.abeel.io.LineIterator; -import cern.colt.list.FloatArrayList; - -public class BedGraphParser extends Parser { - - /** - * @param dataKey - */ - public BedGraphParser(DataKey datakey) { - super(datakey); - - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - it.setSkipComments(true); - it.setCommentIdentifier("#"); - it.addCommentIdentifier("browser"); - it.addCommentIdentifier("track"); - - FloatArrayList values = new FloatArrayList(); - String last = ""; - Entry e = null; - for (String line : it) { - String[] arr = line.split("\t"); - int start = Integer.parseInt(arr[1]); - int end = Integer.parseInt(arr[2]); - if (!last.equals(arr[0])) { - last = arr[0]; - - if (e != null){ - e.add(dataKey, new FloatArrayWiggle(values.elements())); - System.out.println("Adding: "+e+"\t"+values.size()); - values=new FloatArrayList(); - } - e = set.getOrCreateEntry(arr[0]); - } - float val = Float.parseFloat(arr[3]); - /* Make sure the array is big enough */ - if(end>values.size()) - values.setSize(end); - for (int i = start; i < end; i++) { - values.set(i, val); - } - - } - - return set; - } - - -} diff --git a/src/net/sf/jannot/parser/EMBLParser.java b/src/net/sf/jannot/parser/EMBLParser.java deleted file mode 100644 index fbc1302..0000000 --- a/src/net/sf/jannot/parser/EMBLParser.java +++ /dev/null @@ -1,438 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.io.StringReader; -import java.util.SortedSet; -import java.util.Vector; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.FeatureAnnotation; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; -import net.sf.jannot.refseq.MemorySequence; -import be.abeel.io.LineIterator; - -/** - * Parser for EMBL files. - * - * EMBL Specifications: - * ftp://ftp.ebi.ac.uk/pub/databases/embl/doc/usrman.txt - * - * @author thabe, thpar - * - */ -public class EMBLParser extends Parser { - - EMBLParser() { - super(null); - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - - LineIterator it = new LineIterator(is); - it.setSkipBlanks(true); - int currentLine = 1; - Entry entry = null; - boolean seqMode = false; - StringBuffer seqBuffer = new StringBuffer(); - for (String line : it) { - if (line.startsWith("ID")) { - seqMode = false; - /* output last feature of previous entry */ - constructFeature(entry); - storeSequence(entry, seqBuffer); - entry = createNewEntry(line, set); - } else if (currentLine == 1) { - // No ID line in this file - entry = set.iterator().next(); - } - if (line.startsWith("XX") || line.startsWith("FH") || line.startsWith("AH") || line.startsWith("//")) { - // do nothing, contains no data - } else if (line.startsWith("FT")) { - processFeatureLine(line, entry); - } else if (line.startsWith("SQ")) { - seqMode = true; - // do nothing, this line is ignored - } else { - if (!seqMode) - processLine(line, entry); - else { - String cline = condense(line); - // assert(cline.length()==60); - seqBuffer.append(cline); - } - - } - - currentLine++; - } - /* output last feature of the file */ - constructFeature(entry); - storeSequence(entry, seqBuffer); - // /* Light mode, never encountered an ID line */ - // if (entry.getID().equals("defaultEMBLentry")) { - // set.add(entry); - // } - - return set; - } - - private void storeSequence(Entry entry, StringBuffer seqBuffer) { - if (entry != null && seqBuffer.length() > 0) - entry.setSequence(new MemorySequence(seqBuffer.toString())); - seqBuffer.setLength(0); - - } - - private String condense(String line) { - return line.trim().substring(0, 65).replaceAll(" ", ""); - } - - private Vector featureBuffer = new Vector(); - - private void processFeatureLine(String line, Entry entry) { - - String key = line.substring(5, 20).trim(); - if (!key.equals("")) { - constructFeature(entry); - featureBuffer.add(line); - } else { - featureBuffer.add(line); - } - - } - - /* Create a feature from the data available in the feature buffer */ - private void constructFeature(Entry entry) { - if (featureBuffer.size() > 0) { - boolean buildingLocation = true; - String type = featureBuffer.get(0).substring(5, 21).trim(); - StringBuffer location = new StringBuffer(); - Vector qualifiers = new Vector(); - for (int i = 0; i < featureBuffer.size(); i++) { - String lc = featureBuffer.get(i).substring(21).trim(); - boolean slash = lc.startsWith("/"); - if (slash) - buildingLocation = false; - if (buildingLocation) - location.append(lc); - else { - if (slash) - qualifiers.add(new StringBuffer(lc)); - else - qualifiers.lastElement().append("\n" + lc); - } - - } - featureBuffer.clear(); - try { - SortedSet l = ParserTools.parseLocation(location.toString()); - Strand s = ParserTools.getStrand(location.toString()); - - Feature f = new Feature(); - addQualifiers(qualifiers, f); - f.setLocation(l); - f.setStrand(s); - - f.setType(Type.get(type)); - MemoryFeatureAnnotation fa = entry.getMemoryAnnotation(f.type()); - fa.add(f); - // entry.annotation.add(f); - } catch (Exception e) { - e.printStackTrace(); - System.err.println("Parser error! " + e); - System.err.println("Location=" + location); - System.err.println("Qualifiers=" + qualifiers); - // System.err.println("Source=" + source); - - } - - } - - } - - private void addQualifiers(Vector qualifiers, Feature f) { - // List out = new Vector(); - for (StringBuffer s : qualifiers) { - String[] arr = s.toString().split("="); - try { - - f.addQualifier(arr[0].substring(1).trim(), stripQuotes(arr[1].trim())); - } catch (Exception e) { - f.addQualifier("note", arr[0]); - - } - } - // return out; - } - - private String stripQuotes(String trim) { - return trim.replaceAll("\"", ""); - } - - private void processLine(String line, Entry entry) { - - if (line.startsWith("AC")) { - String[] arr = line.substring(5).split(";"); - for (String s : arr) { - entry.description.add("acc", s.trim()); - } - - } else if (line.startsWith("PR")) { - entry.description.put("project identifier", line.substring(5)); - - } else if (line.startsWith("DT")) { - processDate(line, entry); - } else if (line.startsWith("DE")) { - entry.description.add("description", line.substring(5)); - } else if (line.startsWith("KW")) { - entry.description.add("kw", line.substring(5)); - } else if (line.startsWith("OS")) { - entry.description.add("os", line.substring(5)); - } else if (line.startsWith("OC")) { - entry.description.add("oc", line.substring(5)); - } else if (line.startsWith("R")) { - // TODO implement reference stuff - // System.out.println("Ignoring reference line: " + line); - } else if (line.startsWith("DR")) { - // TODO implement database reference stuff - // System.out.println("Ignoring database reference line: " + line); - } else if (line.startsWith("CC")) { - // TODO implement comments stuff - System.out.println("Ignoring comments line: " + line); - } else if (line.startsWith("AS")) { - // TODO implement assembly stuff - // System.out.println("Ignoring assembly line: " + line); - } else if (line.startsWith("CO")) { - // TODO implement construct stuff - // System.out.println("Ignoring construct line: " + line); - } else { - System.err.println("Unrecognized line: " + line); - } - } - - /* Keeps track of the first data line, there should be two */ - private boolean firstDateLine = true; - - private void processDate(String line, Entry entry) { - if (firstDateLine) { - entry.description.put("first date", line.substring(5)); - firstDateLine = false; - } else { - entry.description.put("second date", line.substring(5)); - } - - } - - private Entry createNewEntry(String idLine, EntrySet set) { - // Entry out = new Entry(source); - String[] arr = idLine.substring(5).split(";"); - if (arr.length != 7) { - System.err.println("The ID line is not conform the specifications. We can extract the ID, but other fields will be ignored."); - System.err.println("\t" + idLine); - String emergencyID = arr[0].split("\\s+")[0].trim(); - System.err.println("Extracted ID:" + emergencyID); - return set.getOrCreateEntry(emergencyID); - } else { - Entry out = set.getOrCreateEntry(arr[0].trim()); - out.description.put("seqversion", arr[1].substring(3).trim()); - // if (!arr[2].trim().equals("linear")) - // throw new - // UnsupportedException("Only linear sequences are supported! Found " - // + arr[2]); - out.description.put("moleculeType", arr[3].trim()); - out.description.put("dataClass", arr[4].trim()); - out.description.put("taxDivision", arr[5].trim()); - return out; - - } - - } - - private static final String spacer = " "; - - /* Indicates whether the sequence should be written to file */ - public boolean storeSequence = true; - - @Override - public void write(OutputStream os, Entry e, DataKey[] dks) { - - PrintWriter out = new PrintWriter(new OutputStreamWriter(os)); - // if (source == null || source.equals(e.defaultSource)) { - /* ID line */ - out.println("ID" + spacer + e.getID() + "; SV " + e.description.get("seqversion") + "; linear; " - + e.description.get("moleculeType") + "; " + e.description.get("dataClass") + "; " + e.description.get("taxDivision") - + "; " + e.sequence().size() + " BP."); - out.println("XX"); - - /* Accession line */ - String primaryAcc = e.getID(); - out.print("AC" + spacer + primaryAcc + "; "); - if (e.description.get("acc") != null) { - for (String acc : e.description.get("acc").split("\n")) { - if (!acc.equals(primaryAcc)) - out.print(acc + "; "); - } - } - out.println(); - out.println("XX"); - /* Date lines */ - out.println("DT" + spacer + e.description.get("first date")); - out.println("DT" + spacer + e.description.get("second date")); - out.println("XX"); - - /* Description lines */ - if (e.description.get("description") != null) { - for (String line : new LineIterator(new StringReader(e.description.get("description").toString()))) { - out.println("DE" + spacer + line); - } - out.println("XX"); - } - - /* O lines */ - if (e.description.get("os") != null) { - out.println("OS" + spacer + e.description.get("os")); - out.println("XX"); - } - if (e.description.get("oc") != null) { - out.println("OC" + spacer + e.description.get("oc")); - out.println("XX"); - } - if (e.description.get("kw") != null) { - out.println("KW" + spacer + e.description.get("kw")); - out.println("XX"); - } - // } - /* Feature header */ - out.println("FH Key Location/Qualifiers"); - out.println("FH"); - // for (Type t : Type.values()) { - // for (Feature f : e.annotation.getByType(t)) { - // if (source == null | f.getSource().equals(source)) - // out.println(line(f)); - // - // } - // - // } - for (DataKey data : dks) { - if (e.get(data) instanceof FeatureAnnotation) { - MemoryFeatureAnnotation fa = e.getMemoryAnnotation((Type) data); - for (Feature f : fa.get()) { - out.println(line(f)); - } - } - - } - out.println("XX"); - if (storeSequence) { - // if (source == null || source.equals(e.defaultSource)) { - out.println("SQ Sequence " + e.sequence().size() + " BP ; 0 A; 0 C; 0 G; 0 T; 0 other;"); - char[] line = new char[80]; - for (int i = 0; i < 80; i++) - line[i] = ' '; - int pos = 0; - // for (int i = 1; i <= e.sequence().size(); i++) { - int idx = 1; - for (char c : e.sequence().get()) { - line[pos++] = c;// e.sequence().getNucleotide(i); - - if (idx % 10 == 0) - line[pos++] = ' '; - if (idx % 60 == 0) { - char[] number = new String("" + idx).toCharArray(); - for (int j = 0; j < number.length; j++) - line[line.length - 1 - j] = number[number.length - 1 - j]; - pos = 0; - out.println(line); - } - idx++; - } - for (int i = pos; i < 80; i++) - line[i] = ' '; - char[] number = new String("" + e.sequence().size()).toCharArray(); - for (int j = 0; j < number.length; j++) - line[line.length - 1 - j] = number[number.length - 1 - j]; - out.println(line); - // } - } - out.flush(); - - } - - private String line(Feature f) { - String ftstart = "FT"; - while (ftstart.length() < 21) { - ftstart += " "; - } - String fType = f.type().toString().substring(0, Math.min(15, f.type().toString().length())); - StringBuffer line = new StringBuffer("FT" + spacer + fType); - while (line.length() < 21) - line.append(" "); - line.append(unparse(f.strand(), f.location())); - StringBuffer out = new StringBuffer(); - out.append(line); - for (String key : f.getQualifiersKeys()) { - line = new StringBuffer("FT"); - while (line.length() < 21) - line.append(" "); - - - String qual = f.qualifier(key); - if (qual == null) - System.err.println("EMBLParse: " + f + "\t" + key + "\t" + qual); - if (qual == null) { - line.append("/" + key); - out.append("\n" + line); - } else { - for (String q : qual.split(",")) { - line.append("/" + key + "=" + q); - String outline = line.toString().replaceAll("\n", "\n" + ftstart); - out.append("\n" + outline); - } - } - } - - return out.toString(); - - } - - private String unparse(Strand s, Location[] location) { - String ftstart = "FT"; - while (ftstart.length() < 21) { - ftstart += " "; - } - StringBuffer loc = new StringBuffer(); - if (s == Strand.REVERSE) { - loc.append("complement("); - } - if (location.length > 1) { - loc.append("join("); - for (Location l : location) { - if (location[0].equals(l)) - loc.append(l); - else - loc.append(",\n" + ftstart + l); - } - loc.append(")"); - } else - loc.append(location[0]); - if (s == Strand.REVERSE) - loc.append(")"); - return loc.toString(); - } - -} diff --git a/src/net/sf/jannot/parser/FastaParser.java b/src/net/sf/jannot/parser/FastaParser.java deleted file mode 100644 index 2ef4efc..0000000 --- a/src/net/sf/jannot/parser/FastaParser.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.BufferedOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.alignment.ReferenceSequence; -import net.sf.jannot.alignment.mfa.Alignment; -import net.sf.jannot.alignment.mfa.AlignmentAnnotation; -import net.sf.jannot.refseq.MemorySequence; -import net.sf.jannot.refseq.Sequence; -import be.abeel.io.LineIterator; - -/** - * In case of multiple alignments it is strongly advised to set the dataKey - * - * @author Thomas Abeel - * - */ -public class FastaParser extends Parser { - /** - * Flag to indicate whether the parser should always force sequences to go - * into separate entries, even if they look like a multiple alignment. - */ - public static boolean forceEntries = false; - - public FastaParser() { - super(null); - } - - /** - * @param dataKey - */ - public FastaParser(DataKey dataKey) { - super(dataKey); - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - StringBuffer current = null; - ArrayList seq = new ArrayList(); - ArrayList names = new ArrayList(); - ArrayList description = new ArrayList(); - - for (String line : it) { - - if (line.startsWith(">")) { - - names.add(line.substring(1).trim().split("[ \t]+", 2)[0]); - current = new StringBuffer(); - seq.add(current); - description.add(line.substring(1).trim()); - - // current.description.setPrimaryAccessionNumber(line.substring(1).split(" ")[0].split("\t")[0]); - - } else { - current.append(line); - } - } - if (!forceEntries && likelyMultipleAlign(seq)) { - AlignmentAnnotation alignAnnot = new AlignmentAnnotation(); - Entry ref = set.getOrCreateEntry(names.get(0)); - - // ref.data.get(dataKey); - if (ref != null) { - List alist = new ArrayList(); - ReferenceSequence rs = new ReferenceSequence(seq.get(0)); - for (int i = 0; i < seq.size(); i++) { - // System.out.println(names.get(i)); - Alignment align = new Alignment(names.get(i), - new MemorySequence(seq.get(i)), rs); - alist.add(align); - // System.out.println("adding alignment: " + align); - } - alignAnnot.addAll((Iterable) alist); - ref.add(dataKey, alignAnnot); - } - } else { - for (int i = 0; i < seq.size(); i++) { - Entry e = set.getOrCreateEntry(names.get(i)); - // Sequence s=(Sequence) e.sequence(); - e.setSequence(new MemorySequence(seq.get(i))); - // s.setSequence(); - - // e.description.add("header", description.get(i)); - } - } - - return set; - } - - /* - * Check if all sequences are the same size and if there is no other data - * besides the sequences. - */ - private boolean likelyMultipleAlign(ArrayList data) { - HashSet lengths = new HashSet(); - lengths.add(0); - for (StringBuffer e : data) { - lengths.add(e.length()); - - } - return lengths.size() == 2 && data.size() > 1; - - } - - @Override - public void write(OutputStream os, Entry entry) { - PrintWriter out = new PrintWriter(new BufferedOutputStream(os)); - // if (source == null || source.equals(entry.defaultSource)) { - if (entry.description.get("header") != null) - out.println(">" + entry.description.get("header")); - else - out.println(">" + entry.getID()); - Sequence seq = (Sequence) entry.sequence(); - int i = 1; - for (; i < seq.size() - 80; i += 80) - out.println(ss(seq.get(i, i + 80), 80)); - out.println(ss(seq.get(i, seq.size() + 1), seq.size() - i + 1)); - - // } - out.flush(); - - } - - /** - * @param iterable - * @return - */ - private char[] ss(Iterable iterablem, int len) { - char[] out = new char[len]; - int idx = 0; - for (char c : iterablem) { - out[idx++] = c; - } - return out; - - } - -} diff --git a/src/net/sf/jannot/parser/GFF3Parser.java b/src/net/sf/jannot/parser/GFF3Parser.java deleted file mode 100644 index 4fda9b7..0000000 --- a/src/net/sf/jannot/parser/GFF3Parser.java +++ /dev/null @@ -1,255 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; -import java.util.Set; - -import org.apache.commons.collections.map.Flat3Map; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.FeatureAnnotation; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; -import be.abeel.io.LineIterator; - -/** - * - * @author Thomas Abeel - * - */ -public class GFF3Parser extends Parser { - - /** - * @param dataKey - */ - GFF3Parser() { - super(null); - - } - - /** - * Will return an entry for each unique seq_id - */ - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - - /* Keeps track of which features have the same ID */ - Map parentMap = new HashMap(); - LineIterator it = new LineIterator(is, true, true); - - Map quals = new Flat3Map(); - for (String line : it) { - String[] arr = line.trim().split("\t"); - - try { - if (arr.length < 9) { - arr = padGff(arr); - } - - quals.clear(); - parseQualifiers(arr[8], quals); - - Location l = new Location(Integer.parseInt(arr[3]), Integer.parseInt(arr[4])); - String parent = extractParent(quals, arr[2], arr[0]); - - /* Add to existing feature */ - if (parent != null && parentMap.containsKey(parent)) { - - parentMap.get(parent).addLocation(l); - - } else {/* Add as a new feature */ - Feature f = new Feature(); - f.setLocation(l); - char strand = arr[6].charAt(0); - switch (strand) { - case '-': - f.setStrand(Strand.REVERSE); - break; - case '+': - f.setStrand(Strand.FORWARD); - break; - case '.': - case '?': - f.setStrand(Strand.UNKNOWN); - break; - } - // f.addQualifier(new Qualifier("seqid", arr[0])); - f.addQualifier("source", arr[1]); - f.setType(Type.get(arr[2])); - if (!(arr[5].length() == 1 && arr[5].charAt(0) == '.') && arr[5].length() != 0) - f.setScore(Double.parseDouble(arr[5])); - for (java.util.Map.Entry me : quals.entrySet()) { - f.addQualifier(me.getKey(), me.getValue()); - } - // String[] attributes = arr[8].split(";"); - // for (String s : attributes) { - // String[] pair = s.trim().split("="); - // if (pair.length == 2) { - // String[] values = pair[1].split(","); - // for (String v : values) { - // f.addQualifier(new Qualifier(pair[0], v)); - // } - // } else - // f.addQualifier(new Qualifier("note", pair[0])); - // } - if (parent != null) - parentMap.put(parent, f); - // String id = f.singleQualifierValue("id"); - // assert(id!=null); - // idMap.put(id, f); - // set.getOrCreateEntry(arr[0]).annotation.add(f); - MemoryFeatureAnnotation fa = set.getOrCreateEntry(arr[0]).getMemoryAnnotation(f.type()); - fa.add(f); - } - - } catch (Exception e) { - e.printStackTrace(); - System.err.println("Could not parse line: " + Arrays.toString(arr)); - } - - } - parentMap = null; - return set; - } - - /** - * @param string - * @param quals - */ - private void parseQualifiers(String qq, Map quals) { - String[] arr = qq.split(";"); - for (String s : arr) { - int i = s.indexOf('='); - String key = "note"; - if (i >= 0) - key = s.substring(0, i); - key = key.trim(); - - String value = s.substring(i + 1, s.length()); - value = value.trim(); - - if (quals.containsKey(key)) - quals.put(key, quals.get(key) + "," + value); - else - quals.put(key, value); - } - - } - - public static String[] padGff(String[] arr) { - String[] newArray = new String[9]; - int fullToken = 0; - for (String token : arr) { - newArray[fullToken++] = token; - } - for (int emptyToken = fullToken; emptyToken < newArray.length; emptyToken++) { - newArray[emptyToken] = "."; - } - return newArray; - } - - public static String extractParent(Map quals, String type, String chr) { - String out = quals.get("ID"); - if (out == null) - out = quals.get("Parent"); - if (out != null) - out = chr + "$$" + type + "$$" + out; - return out; - - } - - // private static String tryParent(String line, String key) { - // if (!line.contains(key)) - // return null; - // String[] arr = line.split(";"); - // for (String s : arr) { - // if (s.trim().startsWith(key)) - // return s.trim().split("=")[1].trim(); - // } - // return null; - // } - - @Override - public void write(OutputStream os, Entry entry, DataKey[] dks) { - - PrintWriter out = new PrintWriter(os); - for (DataKey dk : dks) { - if (entry.get(dk) instanceof FeatureAnnotation) { - FeatureAnnotation fa = (FeatureAnnotation) entry.get(dk); - for (Feature f : fa.get()) { - - this.fixID(f); - for (int i = 0; i < f.location().length; i++) - out.println(line(entry, f, entry.getID(), i)); - } - } - } - out.flush(); - } - - private String line(Entry e, Feature f, String acc, int locIdx) { - StringBuffer out = new StringBuffer(); - out.append(e.getID() + "\t"); - out.append(f.qualifier("source") + "\t"); - out.append(f.type() + "\t"); - out.append(f.location()[locIdx].start() + "\t"); - out.append(f.location()[locIdx].end() + "\t"); - out.append(f.getScore() + "\t"); - out.append(f.strand().symbol() + "\t.\t"); - StringBuffer qualifiers = new StringBuffer(); - for (String s : f.getQualifiersKeys()) { - if (!s.equals("source") && !s.equals("seqid")) { - qualifiers.append(";" + s + "="); - qualifiers.append(f.qualifier(s)); - - } - - } - if (qualifiers.length() > 0) - out.append(qualifiers.substring(1)); - else - out.append("no qualifiers"); - return out.toString(); - } - - /** - * value to be used for assigning random IDs. Initialized randomly and then - * incremented with one with every next ID. - */ - private int randomID=new Random(System.currentTimeMillis()).nextInt(); - - - /** - * Set a temporary ID if needed, to make sure multi-exon CDS's have a common - * ID to refer to. - * - * @param feat - */ - private void fixID(Feature feat) { - Set quals = feat.getQualifiersKeys(); - if (!quals.contains("ID")) { - if (quals.contains("Parent")) { - feat.setQualifier("ID", "Child_of_" + feat.qualifier("Parent")); - } else { - String rand = String.format("%08d", randomID++); - feat.setQualifier("ID", "Random_ID_" + rand); - } - } - } - -} diff --git a/src/net/sf/jannot/parser/GTFParser.java b/src/net/sf/jannot/parser/GTFParser.java deleted file mode 100644 index f0b4966..0000000 --- a/src/net/sf/jannot/parser/GTFParser.java +++ /dev/null @@ -1,231 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -import org.apache.commons.collections.map.Flat3Map; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.FeatureAnnotation; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; -import be.abeel.io.LineIterator; - -/** - * - * @author Thomas Abeel - * - */ -public class GTFParser extends Parser { - - /** - * @param dataKey - */ - public GTFParser() { - super(null); - // TODO Auto-generated constructor stub - } - - /** - * Will return an entry for each unique seq_id - */ - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - - /* Keeps track of which features have the same ID */ - Map parentMap = new HashMap(); - LineIterator it = new LineIterator(is, true, true); - - Map quals = new Flat3Map(); - for (String line : it) { - String[] arr = line.trim().split("\t"); - - try { - if (arr.length < 9) { - arr = padGff(arr); - } - - quals.clear(); - parseQualifiers(arr[8], quals); - - Location l = new Location(Integer.parseInt(arr[3]), Integer.parseInt(arr[4])); - String parent = extractParent(quals, arr[2],arr[0]); - - /* Add to existing feature */ - if (parent != null && parentMap.containsKey(parent)) { - - parentMap.get(parent).addLocation(l); - - } else {/* Add as a new feature */ - Feature f = new Feature(); - f.setLocation(l); - char strand = arr[6].charAt(0); - switch (strand) { - case '-': - f.setStrand(Strand.REVERSE); - break; - case '+': - f.setStrand(Strand.FORWARD); - break; - case '.': - case '?': - f.setStrand(Strand.UNKNOWN); - break; - } - // f.addQualifier(new Qualifier("seqid", arr[0])); - f.addQualifier("source", arr[1]); - f.setType(Type.get(arr[2])); - if (!(arr[5].length() == 1 && arr[5].charAt(0) == '.') && arr[5].length() != 0) - f.setScore(Double.parseDouble(arr[5])); - for (java.util.Map.Entry me : quals.entrySet()) { - f.addQualifier(me.getKey(), me.getValue()); - } - // String[] attributes = arr[8].split(";"); - // for (String s : attributes) { - // String[] pair = s.trim().split("="); - // if (pair.length == 2) { - // String[] values = pair[1].split(","); - // for (String v : values) { - // f.addQualifier(new Qualifier(pair[0], v)); - // } - // } else - // f.addQualifier(new Qualifier("note", pair[0])); - // } - if (parent != null) - parentMap.put(parent, f); - // String id = f.singleQualifierValue("id"); - // assert(id!=null); - // idMap.put(id, f); - // set.getOrCreateEntry(arr[0]).annotation.add(f); - MemoryFeatureAnnotation fa = set.getOrCreateEntry(arr[0]).getMemoryAnnotation(f.type()); - fa.add(f); - } - - } catch (Exception e) { - e.printStackTrace(); - System.err.println("Could not parse line: " + Arrays.toString(arr)); - } - - } - parentMap = null; - return set; - } - - /** - * @param string - * @param quals - */ - private void parseQualifiers(String qq, Map quals) { - String[] arr = qq.split(";"); - for (String s : arr) { - s = s.trim(); - if (s.length() > 0) { - int i = s.indexOf(' '); - String key = "note"; - if (i >= 0) - key = s.substring(0, i); - key = key.trim(); - - String value = s.substring(i + 1, s.length()); - value = value.trim().replaceAll("\"", ""); - - if (quals.containsKey(key)) - quals.put(key, quals.get(key) + "," + value); - else - quals.put(key, value); - } - } - - } - - public static String[] padGff(String[] arr) { - String[] newArray = new String[9]; - int fullToken = 0; - for (String token : arr) { - newArray[fullToken++] = token; - } - for (int emptyToken = fullToken; emptyToken < newArray.length; emptyToken++) { - newArray[emptyToken] = "."; - } - return newArray; - } - - public static String extractParent(Map quals, String type, String chromosome) { - String out = quals.get("transcript_id"); -// if (out == null) -// out = quals.get("gene_id"); - if (out != null) - out = chromosome+"$$"+type + "$$" + out; - return out; - - } - - // private static String tryParent(String line, String key) { - // if (!line.contains(key)) - // return null; - // String[] arr = line.split(";"); - // for (String s : arr) { - // if (s.trim().startsWith(key)) - // return s.trim().split("=")[1].trim(); - // } - // return null; - // } - - @Override - public void write(OutputStream os, Entry entry, DataKey[] dks) { - - PrintWriter out = new PrintWriter(os); - for (DataKey dk : dks) { - if (entry.get(dk) instanceof FeatureAnnotation) { - FeatureAnnotation fa = (FeatureAnnotation) entry.get(dk); - for (Feature f : fa.get()) { - for(int i=0;i 0) - out.append(qualifiers.substring(1)); - else - out.append("no qualifiers"); - return out.toString(); - } - - -} diff --git a/src/net/sf/jannot/parser/GenbankParser.java b/src/net/sf/jannot/parser/GenbankParser.java deleted file mode 100644 index da648e1..0000000 --- a/src/net/sf/jannot/parser/GenbankParser.java +++ /dev/null @@ -1,186 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Type; -import net.sf.jannot.refseq.MemorySequence; -import be.abeel.io.LineIterator; - -/* - * http://www.ncbi.nlm.nih.gov/Sitemap/samplerecord.html - * - * http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&rettype=gb&id=NM_023037 - */ -public class GenbankParser extends Parser { - - /** - * @param dataKey - */ - public GenbankParser() { - this(null); - - } - /** - * @param dataKey - */ - public GenbankParser(DataKey key) { - super(key); - - } - - private Feature lastFeature = null; - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - Entry e = null; - LineIterator it = new LineIterator(is); - String locus=null; - String definition=null; - String version=null; - boolean featureMode = false; - boolean seqMode = false; - for (String line : it) { - if (line.startsWith("//")) { - seqMode = false; - } - if (seqMode) { - processSequenceLine(line, e); - } - if (line.startsWith("ORIGIN")) { - addQualifiers(e); - seqMode = true; - featureMode = false; - } - - if (featureMode) { - if (line.startsWith("BASE COUNT")) { - //Ignore line - }else{ - processFeatureLine(line, e,it); - } - - } - if (line.startsWith("FEATURES")) { - featureMode = true; - seqMode = false; - } - - - if (line.startsWith("LOCUS")) { - String[] arr = line.trim().split("[ ]+"); -// e = set.getOrCreateEntry(arr[1]); - locus=arr[1]; - - } - if (line.startsWith("DEFINITION")) { - definition=line.substring(10).trim(); - - } - if (line.startsWith("VERSION")) { - String[] arr = line.trim().split("\\s+",2); -// e = set.getOrCreateEntry(arr[1]); - version=arr[1]; -// if(version!=null) - e.description.put("VERSION", version); - - } - if (line.startsWith("ACCESSION")) { - - String[] arr = line.trim().split("[ ]+"); - // e.description.setID(arr[1]); - if(arr.length==1){ - arr=new String[2]; - arr[1]=locus; - } - e = set.getOrCreateEntry(arr[1]); -// - if(locus!=null) - e.description.put("LOCUS", locus); - if(definition!=null) - e.description.put("DEFINITION", definition); - - } - - } - return set; - } - - private StringBuffer qualifierBuffer = new StringBuffer(); - - private void processFeatureLine(String line, Entry e, LineIterator it) { - - if (line.startsWith(" ")) { - if(line.trim().startsWith("/")) - qualifierBuffer.append("\n"); - qualifierBuffer.append(line.trim()); - } else { - if (lastFeature != null) { - addQualifiers(e); - } - lastFeature = new Feature(); - String nl=it.peek(); - while(nl.startsWith(" ")&&!nl.trim().startsWith("/")){ - line+=it.next().trim(); - nl=it.peek(); - } - - String[] arr = line.trim().split(" [ ]+"); - try{ - lastFeature.setType(Type.get(arr[0])); - lastFeature.setStrand(ParserTools.getStrand(arr[1])); - // System.out.println(arr[1]+"\t"+e.annotation.noFeatures()); - lastFeature.setLocation(ParserTools.parseLocation(arr[1])); - }catch(ArrayIndexOutOfBoundsException aei){ - aei.printStackTrace(); - System.err.println("Offending line: "+line +" for entry "+e); - }catch(NumberFormatException nfe){ - nfe.printStackTrace(); - System.err.println("Offending line: "+line +" for entry "+e); - } - - } - - } - - private void addQualifiers(Entry e) { - String[] arr = qualifierBuffer.toString().split("\n"); - for (int i = 1; i < arr.length; i++) { - if (arr[i].contains("=")) { - - String[] qarr = arr[i].split("="); - lastFeature.addQualifier(qarr[0].substring(1), qarr[1]); - } - - else - lastFeature.addQualifier(arr[i].substring(1),null); - - } - qualifierBuffer = new StringBuffer(); - MemoryFeatureAnnotation fa = e.getMemoryAnnotation(lastFeature.type()); - fa.add(lastFeature); - // e.annotation.add(lastFeature); - - } - - private void processSequenceLine(String line, Entry e) { - String seq = cleanSeq(line); - ((MemorySequence) e.sequence()).addSequence(seq); - - } - - private String cleanSeq(String line) { - String out = line.replaceAll("[0-9 ]", ""); - return out; - } - -} diff --git a/src/net/sf/jannot/parser/MAFParser.java b/src/net/sf/jannot/parser/MAFParser.java deleted file mode 100644 index bec04d3..0000000 --- a/src/net/sf/jannot/parser/MAFParser.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; -import java.util.Arrays; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Strand; -import net.sf.jannot.alignment.maf.AbstractAlignmentSequence; -import net.sf.jannot.alignment.maf.MAFMemoryMultipleAlignment; -import net.sf.jannot.alignment.maf.MemoryAlignmentBlock; -import net.sf.jannot.alignment.maf.MemoryAlignmentSequence; -import net.sf.jannot.refseq.MemorySequence; -import be.abeel.io.LineIterator; - -/** - * @author Thomas Abeel - * - */ -public class MAFParser extends Parser { - - /** - * @param dataKey - */ - public MAFParser(DataKey dataKey) { - super(dataKey); - // TODO Auto-generated constructor stub - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.parser.Parser#parse(java.io.InputStream, - * net.sf.jannot.source.DataSource, net.sf.jannot.EntrySet) - */ - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - it.setCommentIdentifier("#"); - it.setSkipBlanks(true); - MemoryAlignmentBlock a = null; - Entry entry = null; - MAFMemoryMultipleAlignment ma =null; - boolean first = true; - for (String line : it) { - if (line.charAt(0) == 'a') { - first = true; - } else if (line.charAt(0) == 's') { - - String[] arr = line.split("[ \t]+"); - - assert arr.length == 7; - // if (entry == null) { - String[] name = arr[1].split("\\."); - - if(first){ - ma= new MAFMemoryMultipleAlignment(); - if (set.getEntry(name[name.length - 1]) != null) { - entry = set.getOrCreateEntry(name[name.length - 1]); - } else{ - entry = set.getOrCreateEntry(arr[1]); - } - if(entry.get(dataKey)!=null) - ma=(MAFMemoryMultipleAlignment) entry.get(dataKey); - else - entry.add(dataKey, ma); - - } - - - // } - MemorySequence seq = new MemorySequence(arr[6]); - AbstractAlignmentSequence s = new MemoryAlignmentSequence(arr[1], Integer.parseInt(arr[2]), - Integer.parseInt(arr[3]), Integer.parseInt(arr[5]), Strand.fromSymbol(arr[4].charAt(0)), seq); - if (first) { - first = false; - a = new MemoryAlignmentBlock(s.start(), s.end()); - ma.add(a); - } - a.add(s); - ma.addSpecies(arr[1]); - - } - } - return set; - } -} diff --git a/src/net/sf/jannot/parser/PTTParser.java b/src/net/sf/jannot/parser/PTTParser.java deleted file mode 100644 index 4e41328..0000000 --- a/src/net/sf/jannot/parser/PTTParser.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; -import java.util.Arrays; -import java.util.SortedSet; -import java.util.TreeSet; - -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; -import be.abeel.io.LineIterator; - -public class PTTParser extends Parser { - - /** - * @param dataKey - */ - public PTTParser() { - super(null); - // TODO Auto-generated constructor stub - } - - /** - * Will return an entry for each unique seq_id - */ - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - it.setSkipBlanks(true); - it.setSkipComments(true); - Type t = Type.get("protein"); - for (String line : it) { - String[] arr = line.trim().split("\t"); - try { - - String[] loc = arr[0].trim().split("\\.\\."); - Location l = new Location(Integer.parseInt(loc[0]), Integer.parseInt(loc[1])); - Feature f = new Feature(); - SortedSet tmp = new TreeSet(); - tmp.add(l); - f.setLocation(tmp); - char strand = arr[1].charAt(0); - switch (strand) { - case '-': - f.setStrand(Strand.REVERSE); - break; - case '+': - f.setStrand(Strand.FORWARD); - break; - case '.': - case '?': - f.setStrand(Strand.UNKNOWN); - break; - } - f.addQualifier("length", arr[2]); - f.addQualifier("PID", arr[3]); - f.addQualifier("Gene", arr[4]); - f.addQualifier("Synonym", arr[5]); - f.addQualifier("Code", arr[6]); - f.addQualifier("COG", arr[7]); - f.addQualifier("Product", arr[8]); - - f.setType(t); - - // set.getEntry().annotation.add(f); - MemoryFeatureAnnotation fa = set.iterator().next().getMemoryAnnotation(t); - fa.add(f); - - } catch (Exception e) { - e.printStackTrace(); - System.err.println("Could not parse line: " + Arrays.toString(arr)); - } - - } - return set; - } - - - -} diff --git a/src/net/sf/jannot/parser/Parser.java b/src/net/sf/jannot/parser/Parser.java deleted file mode 100644 index a754845..0000000 --- a/src/net/sf/jannot/parser/Parser.java +++ /dev/null @@ -1,273 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Arrays; -import java.util.logging.Logger; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.StringKey; -import net.sf.jannot.Type; -import net.sf.jannot.parser.software.BlastM8Parser; -import net.sf.jannot.parser.software.BroadSolexa; -import net.sf.jannot.parser.software.FindPeaksParser; -import net.sf.jannot.parser.software.GeneMarkParser; -import net.sf.jannot.parser.software.MapViewParser; -import net.sf.jannot.parser.software.MaqSNPParser; -import net.sf.jannot.parser.software.MauveParser; -import net.sf.jannot.parser.software.SIPHTParser; -import net.sf.jannot.parser.software.TRNAscanParser; -import net.sf.jannot.parser.software.TransTermHPParser; -import be.abeel.io.LineIterator; - -public abstract class Parser { - - public static final Parser GFF3 = new GFF3Parser(); - - public static final Parser EMBL = new EMBLParser(); - - private static Logger log = Logger.getLogger(Parser.class.toString()); - - // FIXME this should be dynamically determined - public static Parser[] parsers(Object source) { - return new Parser[] { GFF3, new BEDParser(source.toString()), EMBL, new GTFParser(), new BlastM8Parser(), new FindPeaksParser(), new GeneMarkParser(), - new MaqSNPParser(), new TransTermHPParser(), new TRNAscanParser(), new EMBLParser(), new FastaParser(), new GenbankParser(), new PTTParser(), - new TBLParser(),new VCFParser(source.toString()),new WiggleParser() }; - } - - public Parser(DataKey dataKey) { - this.dataKey = dataKey; - } - - @Override - public String toString() { - return this.getClass().getName().replaceAll("net.sf.jannot.parser.", ""); - } - - /** - * Read all data from an input stream. Set the data source for each item to - * the supplied source. If and EntrySet is supplied the data will be added - * to this set, otherwise a new set will be created. Either the supplied or - * the new EntrySet is returned. - * - * @param is - * inputStream - * @param source - * source to set to features - * @param set - * TODO - * @param entrySet - * the EntrySet to which all stuff will be added - * @return either the supplied EntrySet or a new one containing the loaded - * stuff - */ - public abstract EntrySet parse(InputStream is, EntrySet set); - - /** - * Output everything from the provided entry to the output stream. - * - * - * @param os - * output stream to write data to - * @param e - * the entry to save - * @param source - * the source to filter on, or null when no filtering is - * required. - */ - public void write(OutputStream os, Entry entry) { - write(os, entry, Type.values()); - } - - public void write(OutputStream os, Entry entry, DataKey[] dk) { - // Do nothing by default, parser can choose to implement the write - // method. - - } - - public static Parser detectParser(InputStream is, Object source) throws IOException { - - Parser p = findParser(is, source); - log.info("parser: " + p); - return p; - - } - - /** - * Method to automagically detect parsers. - * - * @param is - * @param source - * @return - * @throws IOException - */ - private static Parser findParser(InputStream is, Object source) throws IOException { - LineIterator it = new LineIterator(is); - // it.setSkipComments(true); - it.setSkipBlanks(true); - String firstLine = it.next(); - String nonCommentLine = firstLine; - - // Skip comments and UCSC browser information lines - while (nonCommentLine.startsWith("#") || nonCommentLine.startsWith("browser")) { - nonCommentLine = it.next(); - - } - if(firstLine.contains("fileformat=VCF")) - return new VCFParser(source.toString()); - - if (firstLine.contains("Mauve1")) - return new MauveParser(new StringKey(source.toString())); - - if (nonCommentLine.equals("id chrom start end max_coord")) - return new FindPeaksParser(); - - log.info("firstLine: " + firstLine); - log.info("nonCommentLine: " + nonCommentLine); - if (firstLine.startsWith("Guide for interpreting SIPHT output")) - return new SIPHTParser(new StringKey(source.toString())); - if (firstLine.startsWith("##maf")) - return new MAFParser(new StringKey(source.toString())); - if (nonCommentLine.startsWith("GeneMark")) - return new GeneMarkParser(); - if (nonCommentLine.startsWith("TransTermHP")) - return new TransTermHPParser(); - if (nonCommentLine.startsWith("gvheader:syntenic")) { - return new SyntenicParser(new StringKey(source.toString())); - } - - // System.out.println("Detect: " + line); - if (nonCommentLine.startsWith("track")) { - if (nonCommentLine.startsWith("track type=wiggle_0")) { - return new WiggleParser(); - } else if (nonCommentLine.startsWith("track type=bedGraph")) { - return new BedGraphParser(new StringKey(source.toString())); - } else { - nonCommentLine = it.next(); - } - - } - - if (nonCommentLine.startsWith("LOCUS")) - return new GenbankParser(); - log.info("tab split nonCommentLine: " + nonCommentLine.split("\t").length); - String[] nonCommentArr = nonCommentLine.split("\t"); - if (nonCommentArr.length == 9) { - if (nonCommentArr[0].contains("..")) - return new PTTParser(); - else { - boolean no1 = nonCommentArr[1].matches("[0-9]+"); - boolean no2 = nonCommentArr[2].matches("[0-9]+"); - - if (no1 && no2) { - return new BEDParser(source.toString()); - } else if (nonCommentArr[8].contains("=")) - return new GFF3Parser(); - else - return new GTFParser(); - - } - - } - - if (nonCommentLine.split("[ \t]+").length == 8) { - String[] head = new String[] { "Sequence", "tRNA", "Bounds", "tRNA", "Anti", "Intron", "Bounds", "Cove" }; - if (Arrays.equals(nonCommentLine.split("[ \t]+"), head)) { - return new TRNAscanParser(); - } - } - - /* Can either be BlastM8 or BED */ - if (nonCommentLine.split("\t").length == 12) { - String[] arr = nonCommentLine.split("\t"); - try { - Double.parseDouble(arr[4]); - } catch (NumberFormatException ne) { - return new BlastM8Parser(); - } - char c = arr[5].charAt(0); - if (c == '+' || c == '-' || c == '.') - return new BEDParser(source.toString()); - - try { - Double.parseDouble(arr[9]); - Double.parseDouble(arr[11]); - } catch (NumberFormatException ne) { - return new MaqSNPParser(); - } - - return new BlastM8Parser(); - } - - if (nonCommentLine.split("\t").length == 16) { - return new MapViewParser(new StringKey(source.toString())); - } - if (nonCommentLine.startsWith("ID") || nonCommentLine.startsWith("FT") || nonCommentLine.startsWith("FH")) - return new EMBLParser(); - - if (nonCommentLine.startsWith(">")) { - - if (nonCommentLine.startsWith(">Feature ")) - return new TBLParser(); - else - return specifyFastaType(nonCommentLine, source); - - } - - return null; - // if (nonCommentLine.split("\t").length == 1) { - // return new ALNParser(new StringKey(source.toString())); - // } - // - // if (nonCommentLine.split("\t").length != 9) - // return new BEDParser(); - - } - - /* - * Data key for data types that require some external information to - * determine the name of the data - */ - protected DataKey dataKey = null; - - public void setDataKey(DataKey dk){ - this.dataKey=dk; - } - - @Deprecated - public void setDataKey(String s) { - setDataKey(new StringKey(s)); - } - - private static Parser specifyFastaType(String line, Object source) { - boolean broadShortRead = true; - try { - String[] arr = line.split(" "); - /* The final thing on the header line should be the word 'mismatches */ - if (!arr[arr.length - 1].equals("mismatches)")) { - broadShortRead = false; - } - /* Try to parse the number of mismatches */ - Integer.parseInt(arr[arr.length - 2].substring(1)); - /* Strand should be either 'fw' or 'rc' */ - if (!arr[2].equals("fw") && !arr[2].equals("rc")) - broadShortRead = false; - - } catch (NumberFormatException e) { - broadShortRead = false; - } catch (IndexOutOfBoundsException e) { - broadShortRead = false; - } - if (broadShortRead) - return new BroadSolexa(new StringKey(source.toString())); - else - return new FastaParser(new StringKey(source.toString())); - } - -} diff --git a/src/net/sf/jannot/parser/ParserTools.java b/src/net/sf/jannot/parser/ParserTools.java deleted file mode 100644 index 055ff4e..0000000 --- a/src/net/sf/jannot/parser/ParserTools.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.util.SortedSet; -import java.util.TreeSet; - -import net.sf.jannot.Location; -import net.sf.jannot.Strand; - -public class ParserTools { - public static Strand getStrand(String location) { - if (location.toString().contains("complement")) - return Strand.REVERSE; - else - return Strand.FORWARD; - } - - public static SortedSet parseLocation(String location) { - SortedSet out = new TreeSet(); - String t = location.toString().replaceAll("complement\\((.*?)\\)", "$1"); - String y = t.replaceAll("order\\((.*?)\\)", "$1"); - String x = y.replaceAll("join\\((.*?)\\)", "$1"); - - String[] arr = x.split(","); - for (String s : arr) { - String[] pos = s.split("\\.\\."); - int start, end; - boolean fuzzyStart = false, fuzzyEnd = false; - if (pos[0].startsWith("<")) { - - start = Integer.parseInt(pos[0].substring(1)); - fuzzyStart = true; - } else - start = Integer.parseInt(pos[0]); - - if (pos.length == 1) { - end=start; - - } else if (pos[1].startsWith(">")) { - - end = Integer.parseInt(pos[1].substring(1)); - fuzzyEnd = true; - } else - end = Integer.parseInt(pos[1]); - out.add(new Location(start, end, fuzzyStart, fuzzyEnd)); - - } - - return out; - } - -} diff --git a/src/net/sf/jannot/parser/SyntenicParser.java b/src/net/sf/jannot/parser/SyntenicParser.java deleted file mode 100644 index 285b32c..0000000 --- a/src/net/sf/jannot/parser/SyntenicParser.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; - -import net.sf.jannot.DataKey; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Location; -import net.sf.jannot.Strand; -import net.sf.jannot.SyntenicBlock; -import be.abeel.io.LineIterator; - -/** - * This parser read syntenic blocks from an 8 column file that has the following - * formatting. - * - * - * Synthenic block: - * - * Starts with the line - * - *
- * gvheader:syntenic
- * 
- * - * 8 columns - * - * 0,1,2,3 name,start,end,strand of reference - * - * 4,5,6,7 name,start,end,strand of informant - * - * - * @author Thomas Abeel - * - */ -public class SyntenicParser extends Parser { - - /** - * @param dataKey - */ - public SyntenicParser(DataKey dataKey) { - super(dataKey); - // TODO Auto-generated constructor stub - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - // Listlist=new ArrayList(); - if (set == null) - set = new EntrySet(); - // Mapmapping=new HashMap(); - - LineIterator it = new LineIterator(is); - it.setSkipBlanks(true); - it.setSkipComments(true); - it.addCommentIdentifier("gvheader"); - for (String line : it) { - String[] arr = line.split("\t"); - Location refLoc = new Location(Integer.parseInt(arr[1]), Integer.parseInt(arr[2])); - Strand refStrand = Strand.fromSymbol(arr[3].charAt(0)); - Location informantLoc = new Location(Integer.parseInt(arr[5]), Integer.parseInt(arr[6])); - Strand informantStrand = Strand.fromSymbol(arr[7].charAt(0)); - - SyntenicBlock sb = new SyntenicBlock(arr[0], arr[4], refLoc, informantLoc, refStrand, informantStrand); - set.syntenic.add(sb); - // FIXME set.getOrCreateEntry(arr[0], source); - SyntenicBlock sbf = sb.flip(); - set.syntenic.add(sbf); - // FIXME set.getOrCreateEntry(arr[4], source); - - } - return set; - } - -} diff --git a/src/net/sf/jannot/parser/TBLParser.java b/src/net/sf/jannot/parser/TBLParser.java deleted file mode 100644 index 6f86f3c..0000000 --- a/src/net/sf/jannot/parser/TBLParser.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; -import be.abeel.io.LineIterator; - -/** - * - * Sequin file format parser. - * - * http/www.ncbi.nlm.nih.gov/Sequin/table.html - * - * @author Thomas Abeel - * - */ -public class TBLParser extends Parser { - - /** - * @param dataKey - */ - public TBLParser() { - super(null); - // TODO Auto-generated constructor stub - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.parser.Parser#parse(java.io.InputStream, - * net.sf.jannot.source.DataSource, net.sf.jannot.EntrySet) - */ - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - Entry current = null; - Feature currentF = null; - for (String line : it) { - if (line.startsWith(">")) { - current = set.getOrCreateEntry(line.split(">Feature ")[1]); - } else { - if (current == null) { - current = set.getOrCreateEntry("default"); - } - - String[] arr = line.split("[ \t]+", 3); - if (arr.length == 3) { - if (arr[0].equals("")) { - currentF.addQualifier(arr[1], arr[2]); - } else { - currentF = new Feature(); - - int s = Integer.parseInt(arr[0]); - int t = Integer.parseInt(arr[1]); - if (s > t) - currentF.setStrand(Strand.REVERSE); - else - currentF.setStrand(Strand.FORWARD); - currentF.setType(Type.get(arr[2])); - currentF.addLocation(new Location(s, t)); - // current.annotation.add(currentF); - MemoryFeatureAnnotation fa =current.getMemoryAnnotation(currentF.type()); - fa.add(currentF); - } - - } else { - int s = Integer.parseInt(arr[0]); - int t = Integer.parseInt(arr[1]); - currentF.addLocation(new Location(s, t)); - } - } - } - return set; - } - -} diff --git a/src/net/sf/jannot/parser/UnsupportedException.java b/src/net/sf/jannot/parser/UnsupportedException.java deleted file mode 100644 index ba6a8f0..0000000 --- a/src/net/sf/jannot/parser/UnsupportedException.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -public class UnsupportedException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = -5256648264973150248L; - - public UnsupportedException(String string) { - super(string); - } - -} diff --git a/src/net/sf/jannot/parser/VCFParser.java b/src/net/sf/jannot/parser/VCFParser.java deleted file mode 100644 index f00c319..0000000 --- a/src/net/sf/jannot/parser/VCFParser.java +++ /dev/null @@ -1,170 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.InputStream; -import java.util.Arrays; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Type; -import be.abeel.io.LineIterator; - -/** - * - * @author Thomas Abeel - * - */ -public class VCFParser extends Parser { - - enum Variation { - Match, SingleSubstitution, LongSubstitution, SingleDeletion, LongDeletion, SingleInsertion, LongInsertion; - - } - - /** - * @param dataKey - */ - VCFParser(String fileName) { - super(null); - String[] arr = fileName.replace('\\', '/').split("/"); - setDataKey(Type.get(arr[arr.length - 1])); - } - - /** - * Will return an entry for each unique seq_id - */ - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - - LineIterator it = new LineIterator(is, true, true); - - for (String line : it) { - String[] arr = line.trim().split("\\s+"); - Entry e = set.getOrCreateEntry(arr[0]); - MemoryFeatureAnnotation annot = e.getMemoryAnnotation(dataKey); - Feature newFeature = new Feature(); - if (arr.length < 7) - throw new RuntimeException("Not sufficient columns " + Arrays.toString(arr)); - - /* - * Only parse lines that pass the filters - */ - String filter = arr[6]; - if (!(filter.equalsIgnoreCase("PASS") || filter.equals("."))) - continue; - - int pos = Integer.parseInt(arr[1]); - - String id = arr[2]; - - newFeature.setQualifier("id", id); - - String ref = arr[3]; - - newFeature.setQualifier("ref", ref); - - String multiAlt = arr[4]; - - for (String alt : multiAlt.split(",")) { - - Feature f = newFeature.copy(); - f.setQualifier("alt", alt); - double score = 0; - if (arr[5].charAt(0) != '.') - score = Double.parseDouble(arr[5]); - f.setQualifier("score", "" + score); - - int refLength = ref.length(); - - int altLength = alt.length(); - Variation variation = null; - - if (ref.length() == alt.length()) { - if (alt.equals(".") || ref.equals(alt)) - variation = Variation.Match; - else { - if (ref.length() == 1) - variation = Variation.SingleSubstitution; - else - variation = Variation.LongSubstitution; - } - } else { - // assume(ref.length() > 0 && alt.length() > 0) - if (ref.length() == 1 || alt.length() == 1) { - int diff = ref.length() - alt.length(); - // if (ref.length() > alt.length()) - if (diff > 1) - variation = Variation.LongDeletion; - else if (diff > 0) - variation = Variation.SingleDeletion; - else if (diff < -1) - variation = Variation.LongInsertion; - else if (diff < 0) - variation = Variation.SingleInsertion; - else - throw new RuntimeException("This is not supposed to happen!"); - } else { - variation = Variation.LongSubstitution; - } - - } - /* - * Only include differences, don't load matches - */ - if (variation != Variation.Match) { - int end = pos + refLength - 1; - int start = pos; - // if(variation==Variation.SingleSubstitution||variation==Variation.SingleInsertion||variation==Variation.LongInsertion) - // end=pos; - if (variation == Variation.SingleDeletion || variation == Variation.LongDeletion) { - start = pos + 1; - - // end=pos+refLength; - - } - - f.setLocation(new Location(start, end)); - - /* - * Add winglets for large events - */ - if (variation == Variation.LongInsertion) { - f.addLocation(new Location(pos - altLength / 2, pos - altLength / 2)); - f.addLocation(new Location(pos + altLength / 2, pos + altLength / 2)); - } - /* - * Add additional winglets for unclear calls - */ - if (variation == Variation.LongInsertion && alt.contains("N")) { - f.addLocation(new Location(pos - (int)((altLength / 2)*1.1), pos - (int)((altLength / 2)*1.1))); - f.addLocation(new Location(pos + (int)((altLength / 2)*1.1), pos +(int)((altLength / 2)*1.1))); - } - - int delta = altLength - refLength; - if (variation == Variation.LongSubstitution && refLength < altLength) { - f.addLocation(new Location(start - delta / 2, start - delta / 2)); - f.addLocation(new Location(end + delta / 2, end + delta / 2)); - if (alt.contains("N")) { - f.addLocation(new Location(start - (int)((delta / 2)*1.1),start- (int)((delta / 2)*1.1))); - f.addLocation(new Location(end + (int)((delta / 2)*1.1),end+ (int)((delta / 2)*1.1))); - } - } - - f.addQualifier("delta", ""+delta); - f.setType(Type.get(variation.toString())); - annot.add(f); - } - } - // lazy val blankFilter=filter.equals(".") - - } - return set; - } -} diff --git a/src/net/sf/jannot/parser/WiggleParser.java b/src/net/sf/jannot/parser/WiggleParser.java deleted file mode 100644 index fe5d729..0000000 --- a/src/net/sf/jannot/parser/WiggleParser.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Map; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.StringKey; -import net.sf.jannot.wiggle.TroveArrayWiggle; -import be.abeel.io.LineIterator; -/** - * - * @author Thomas - * - */ -public class WiggleParser extends Parser { - - public WiggleParser() { - super(null); - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - try { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - it.setSkipComments(true); - it.setCommentIdentifier("#"); - it.addCommentIdentifier("browser "); - - // FloatArrayList values = new FloatArrayList(); - TroveArrayWiggle daw = null; - boolean variable = false; - int step = 0; - int span = 1; - int start = 0; - int stepOffset = 1; - String name = "" + System.currentTimeMillis(); - Entry e = null; - for (String line : it) { - //System.out.println("Parsing: "+line); - if (line.startsWith("track")) { - MaplineMap=BEDTools.parseTrack(line); - name = lineMap.get("name"); - String chr=lineMap.get("chrom"); - e=set.getEntry(chr); - - } else if (line.startsWith("variableStep")) { - if(e==null) - e=set.iterator().next(); - add(e, name, daw); - - String[] arr = line.split("[ \t]+"); - span = 1; - variable = true; - - for (String s : arr) { - String[] kv = s.split("="); - if (kv[0].equals("span")) { - span = Integer.parseInt(kv[1].trim()); - } - if (kv[0].equals("chrom")) { - e = set.getOrCreateEntry(kv[1].trim()); - daw = new TroveArrayWiggle(e.getMaximumLength()); - - } - - } - } else if (line.startsWith("fixedStep")) { - if(e==null) - e=set.iterator().next(); - add(e, name, daw); - - String[] arr = line.split("[ \t]+"); - variable = false; - - stepOffset = 1; - for (String s : arr) { - String[] kv = s.split("="); - if (kv[0].equals("span")) - span = Integer.parseInt(kv[1]); - if (kv[0].equals("step")) - step = Integer.parseInt(kv[1]); - if (kv[0].equals("start")) - start = Integer.parseInt(kv[1]); - if (kv[0].equals("chrom")) { - e = set.getOrCreateEntry(kv[1].trim()); - daw = new TroveArrayWiggle(e.getMaximumLength()); - } - } - } else if (variable) { - String[] arr = line.split("[ \t]+"); - int s = Integer.parseInt(arr[0]); - double val = Double.parseDouble(arr[1]); - - for (int i = s; i < s + span; i++) { - daw.set(i, (float) val); - } - } else { - double val = Double.parseDouble(line); - - for (int i = start + stepOffset; i < start + stepOffset + span; i++) { - daw.set(i, (float) val); - } - stepOffset += step; - } - } - add(e, name, daw); - } catch (IOException ioex) { - throw new RuntimeException(ioex); - } - - - return set; - } - - /** - * @param e - * @param name - * @param daw - */ - private void add(Entry e, String name, TroveArrayWiggle daw) { - /* Add the previous one */ - if (daw != null) { - daw.init(); - e.add(new StringKey(name), daw); - - daw = null; - } - - } - - - -} diff --git a/src/net/sf/jannot/parser/software/BlastM8Parser.java b/src/net/sf/jannot/parser/software/BlastM8Parser.java deleted file mode 100644 index 1d6464c..0000000 --- a/src/net/sf/jannot/parser/software/BlastM8Parser.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser.software; - -import java.io.InputStream; - -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; -import net.sf.jannot.parser.Parser; -import be.abeel.io.LineIterator; - -public class BlastM8Parser extends Parser { - - /** - * @param dataKey - */ - public BlastM8Parser() { - super(null); - // TODO Auto-generated constructor stub - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if(set==null) - set=new EntrySet(); -// Entry[] out = new Entry[1]; -// // try { -// out[0] = new Entry(source); - LineIterator it = new LineIterator(is); - it.setSkipComments(true); - Type t=Type.get("NCBI Blast hit"); - for (String line : it) { - String[] arr = line.split("\t"); - Feature f = new Feature(); - f.setType(t); - f.setScore(Double.parseDouble(arr[10])); - int start = Integer.parseInt(arr[6]); - int end = Integer.parseInt(arr[7]); - Strand s = Strand.FORWARD; - if (start > end) { - int tmp = start; - start = end; - end = tmp; - s = Strand.REVERSE; - } - f.setStrand(s); - f.addLocation(new Location(start, end)); - f.addQualifier("subject id", arr[1]); - f.addQualifier("% identity", arr[2]); - // f.addQualifier(new Qualifier("% positives", arr[3])); - f.addQualifier("alignment length", arr[3]); - f.addQualifier("bit score", arr[11]); - MemoryFeatureAnnotation fa=set.iterator().next().getMemoryAnnotation(t); - fa.add(f); - - } - - return set; - } - - -} diff --git a/src/net/sf/jannot/parser/software/BroadSolexa.java b/src/net/sf/jannot/parser/software/BroadSolexa.java deleted file mode 100644 index d4b1551..0000000 --- a/src/net/sf/jannot/parser/software/BroadSolexa.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser.software; - -import java.io.InputStream; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.parser.Parser; -import net.sf.jannot.refseq.MemorySequence; -import net.sf.jannot.shortread.BasicShortRead; -import net.sf.jannot.shortread.MemoryReadSet; -import net.sf.jannot.utils.SequenceTools; -import be.abeel.io.LineIterator; - -/** - * A short read parser for Broad data - * - * @author Thomas Abeel - * - */ -public class BroadSolexa extends Parser { - - /** - * @param dataKey - */ - public BroadSolexa(DataKey dataKey) { - super(dataKey); - - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - - long time=System.currentTimeMillis(); - - /* This parser assumes that header and sequences lines alternate */ - int mapStart = -1; - boolean forward = false; - Entry entry = null; -// set.setMute(true); - - for (String line : it) { - - if (line.startsWith(">")) { - try { - String[] arr = line.split(" "); - /* Mapping start in Broad short read format is zero based, correct for it*/ - String[]arr3=arr[3].split("\\."); - mapStart = Integer.parseInt(arr3[1]); - forward = arr[2].equals("fw"); - - entry = set.getOrCreateEntry(arr3[0]); -// if(entry.shortReads.getReadGroup(source)==null){ -// entry.shortReads.add(source, new MemoryReadSet()); -// } - if(entry==null) - { - throw new ReadFailedException("There is no reference sequence loaded for this short read: "+arr[3]); - // current.description.setPrimaryAccessionNumber(line.substring(1).split(" ")[0].split("\t")[0]); - } - if(!entry.contains(dataKey)){ - entry.add(dataKey, new MemoryReadSet()); - } - } catch (Exception e) { - e.printStackTrace(); - System.out.println("Offending line: " + line); - return set; - } finally { - } - } else { - MemoryReadSet mrs=(MemoryReadSet) entry.get(dataKey); - //if(forward) - //FIXME mrs.add(new BasicShortRead(line.toCharArray(), mapStart, forward)); - // else - //FIXME mrs.add(new BasicShortRead(SequenceTools.reverseComplement(new MemorySequence(new StringBuffer(line))).getSequence().toCharArray(), mapStart, forward)); - } - } -// set.setMute(false); - - return set; - } - - - -} diff --git a/src/net/sf/jannot/parser/software/FindPeaksParser.java b/src/net/sf/jannot/parser/software/FindPeaksParser.java deleted file mode 100644 index ac52f49..0000000 --- a/src/net/sf/jannot/parser/software/FindPeaksParser.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser.software; - -import java.io.InputStream; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; -import net.sf.jannot.parser.Parser; -import be.abeel.io.LineIterator; - -/** - * @author Thomas Abeel - * - */ -public class FindPeaksParser extends Parser { - - /** - * @param dataKey - */ - public FindPeaksParser() { - super(null); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.parser.Parser#parse(java.io.InputStream, - * net.sf.jannot.source.DataSource, net.sf.jannot.EntrySet) - */ - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - - LineIterator it = new LineIterator(is); - it.setSkipBlanks(true); - it.setSkipComments(true); - /* Skip first line */ - it.next(); - Type t = Type.get("peak"); - for (String line : it) { - String[] arr = line.split("[ \t]+"); - Entry e = set.getOrCreateEntry(arr[1]); - Feature f = new Feature(); - int start = Integer.parseInt(arr[2]); - int end = Integer.parseInt(arr[3]); - f.setType(t); - f.addQualifier("max_coord", arr[4]); - f.addQualifier("Name", "Peak "+arr[0]); - //f.addQualifier("t-score", arr[5]); - f.setScore(Double.parseDouble(arr[5])); - f.addLocation(new Location(start, end)); - f.setStrand(Strand.UNKNOWN); - MemoryFeatureAnnotation fa = e.getMemoryAnnotation(t); - fa.add(f); - - } - return set; - } - -} diff --git a/src/net/sf/jannot/parser/software/GeneMarkParser.java b/src/net/sf/jannot/parser/software/GeneMarkParser.java deleted file mode 100644 index 15fe434..0000000 --- a/src/net/sf/jannot/parser/software/GeneMarkParser.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser.software; - -import java.io.InputStream; - -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; -import net.sf.jannot.parser.Parser; -import be.abeel.io.LineIterator; - -/** - * Parser for the output of the GeneMark gene caller - * - * @author Thomas Abeel - * - */ -public class GeneMarkParser extends Parser { - - /** - * @param dataKey - */ - public GeneMarkParser() { - super(null); - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if(set==null) - set=new EntrySet(); - Type t=Type.get("CDS_pred"); - MemoryFeatureAnnotation fa=set.iterator().next().getMemoryAnnotation(t); - for(String line:new LineIterator(is)){ - if(!line.startsWith(" ")||line.contains("Gene")||line.contains("Length")) - continue; - String[]arr=line.replace('<', ' ').trim().split("[ \t]+"); - Feature f=new Feature(); - f.addLocation(new Location(Integer.parseInt(arr[2]),Integer.parseInt(arr[3]))); - f.setStrand(Strand.fromSymbol(arr[1].charAt(0))); - f.setType(t); - f.addQualifier("source", "GeneMark"); - f.addQualifier("Gene",arr[0]); - fa.add(f); - } - - - return set; - } - -} diff --git a/src/net/sf/jannot/parser/software/MapViewParser.java b/src/net/sf/jannot/parser/software/MapViewParser.java deleted file mode 100644 index 227fce4..0000000 --- a/src/net/sf/jannot/parser/software/MapViewParser.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser.software; - -import java.io.InputStream; -import java.io.OutputStream; - -import be.abeel.io.LineIterator; -import be.abeel.util.TimeInterval; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.parser.Parser; -import net.sf.jannot.shortread.BasicShortRead; -import net.sf.jannot.shortread.MemoryReadSet; -import net.sf.jannot.shortread.ShortRead; -import net.sf.jannot.source.DataSource; - -public class MapViewParser extends Parser { - - /** - * @param dataKey - */ - public MapViewParser(DataKey dataKey) { - super(dataKey); - // TODO Auto-generated constructor stub - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - - long time = System.currentTimeMillis(); - - -// set.setMute(true); - int count = 0; - for (String line : it) { - String[] arr = line.split("\t"); - Entry entry = set.getOrCreateEntry(arr[1]); - -// if(e.shortReads.getReadGroup(source)==null){ -// e.shortReads.add(source, new MemoryReadSet()); -// } - if(!entry.contains(dataKey)){ - entry.add(dataKey, new MemoryReadSet()); - } - if (!arr[14].matches(".*[nN].*")) { - MemoryReadSet mrs=(MemoryReadSet) entry.get(dataKey); - //mrs.add(new BasicShortRead(arr[14].toCharArray(), Integer.parseInt(arr[2]), arr[3].charAt(0) == '+')); - } else { - // System.out.println("discarding: "+arr[0]); - count++; - } - - } - System.out.println("Discarded: " + count + " short reads because of ambiguity"); -// set.setMute(false); - - return set; - } - - - -} diff --git a/src/net/sf/jannot/parser/software/MaqSNPParser.java b/src/net/sf/jannot/parser/software/MaqSNPParser.java deleted file mode 100644 index 1448f70..0000000 --- a/src/net/sf/jannot/parser/software/MaqSNPParser.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser.software; - -import java.io.InputStream; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Type; -import net.sf.jannot.parser.Parser; -import be.abeel.io.LineIterator; - -/** - * - * Parser for the Maq SNP format. - * - * Maq: Mapping and Assembly with Qualities - * http://maq.sourceforge.net/maq-man.shtml - * - * This parser handles the output of the cns2snp program of MAQ. - * - * @author Thomas Abeel - * - */ -public class MaqSNPParser extends Parser { - - /** - * @param dataKey - */ - public MaqSNPParser() { - super(null); - // TODO Auto-generated constructor stub - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.parser.Parser#parse(java.io.InputStream, - * net.sf.jannot.source.DataSource, net.sf.jannot.EntrySet) - */ - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - it.setSkipBlanks(true); - it.setSkipComments(true); - Type t=Type.get("SNP"); - - for(String line:it){ - String[]arr=line.split("\t"); - Entry e=set.getOrCreateEntry(arr[0]); - MemoryFeatureAnnotation fa=e.getMemoryAnnotation(t); - Feature f=new Feature(); - int pos=Integer.parseInt(arr[1]); - f.addLocation(new Location(pos,pos)); - f.addQualifier("reference",arr[2]); - f.addQualifier("consensus",arr[3]); - f.addQualifier("phred-like consensus quality",arr[4]); - f.addQualifier("read depth",arr[5]); - f.addQualifier("average coverage",arr[6]); - f.addQualifier("highests mapping quality",arr[7]); - f.addQualifier("minimum consensus quality",arr[8]); - f.addQualifier("second best call",arr[9]); - f.addQualifier("log likelihood ratio second and third best call",arr[10]); - f.addQualifier("third best call",arr[11]); - f.setType(t); - fa.add(f); - - } - return set; - - - } - - - -} diff --git a/src/net/sf/jannot/parser/software/MauveParser.java b/src/net/sf/jannot/parser/software/MauveParser.java deleted file mode 100644 index f0bc301..0000000 --- a/src/net/sf/jannot/parser/software/MauveParser.java +++ /dev/null @@ -1,118 +0,0 @@ -package net.sf.jannot.parser.software; - -import java.io.InputStream; -import java.util.ArrayList; - -import cern.colt.Arrays; - -import be.abeel.io.LineIterator; - -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Strand; -import net.sf.jannot.alignment.maf.AbstractAlignmentBlock; -import net.sf.jannot.alignment.maf.AbstractAlignmentSequence; -import net.sf.jannot.alignment.maf.MAFMemoryMultipleAlignment; -import net.sf.jannot.alignment.maf.MemoryAlignmentBlock; -import net.sf.jannot.alignment.maf.MemoryAlignmentSequence; -import net.sf.jannot.parser.Parser; -import net.sf.jannot.refseq.MemorySequence; - -public class MauveParser extends Parser { - - /** - * @param dataKey - */ - public MauveParser(DataKey dataKey) { - super(dataKey); - - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - it.setCommentIdentifier("#"); - it.setSkipBlanks(true); - it.setSkipComments(true); - MemoryAlignmentBlock a = null; - Entry entry = null; - MAFMemoryMultipleAlignment ma = null; - - StringBuffer buffer = null; - boolean marker = true; - // boolean next = false; - String headerLine = null; - - // ArrayList blocks = new - // ArrayList(); - // ArrayList seqs = new - // ArrayList(); - - for (String line : it) { - - if (line.charAt(0) == '=') { - marker = true; - // System.out.println("Close old block: " + line); - - /* Start new block */ - } else if (line.charAt(0) == '>') { - System.out.println("Parsing: " + line); - String[] arr = line.split("[ ]+"); - String[] locArr = arr[1].split(":")[1].split("-"); - - if (ma == null) { - String name = arr[3].substring(arr[3].lastIndexOf('/') + 1).split("\\.")[0]; - entry = set.getOrCreateEntry(name); - ma = new MAFMemoryMultipleAlignment(); - entry.add(dataKey, ma); - } - - if (buffer != null) { - - addSequence(buffer, headerLine, a, entry,ma); - - } - if (marker) { - marker = false; - System.out.println("->Make block " + Arrays.toString(arr) + "\t" + java.util.Arrays.toString(locArr)); - - a = new MemoryAlignmentBlock(Integer.parseInt(locArr[0]), Integer.parseInt(locArr[1])); - ma.add(a); - } - buffer = new StringBuffer(); - headerLine = line; - - } else { - buffer.append(line); - - } - } - addSequence(buffer, headerLine, a, entry,ma); - - for (AbstractAlignmentBlock ab : ma.get()) { - System.out.println("AB: " + ab.start() + "\t" + ab.end()); - for (AbstractAlignmentSequence as : ab) { - System.out.println("\tAS: " + as.getName() + "\t" + as.start() + "\t" + as.end()); - } - } - return set; - } - - private void addSequence(StringBuffer buffer, String headerLine, MemoryAlignmentBlock a, Entry entry, MAFMemoryMultipleAlignment ma) { - String[] prevArr = headerLine.split("[ ]+"); - System.out.println("-->Add sequence " + prevArr[3]); - - String[] prevLocArr = prevArr[1].split(":")[1].split("-"); - - MemorySequence seq = new MemorySequence(buffer.toString()); - AbstractAlignmentSequence s = new MemoryAlignmentSequence(prevArr[3], Integer.parseInt(prevLocArr[0]), - Integer.parseInt(prevLocArr[1]) - Integer.parseInt(prevLocArr[0]) + 1, entry.getMaximumLength(), - Strand.fromSymbol(prevArr[2].charAt(0)), seq); - a.add(s); - ma.addSpecies(prevArr[3]); - - } -} diff --git a/src/net/sf/jannot/parser/software/SIPHTParser.java b/src/net/sf/jannot/parser/software/SIPHTParser.java deleted file mode 100644 index e658a61..0000000 --- a/src/net/sf/jannot/parser/software/SIPHTParser.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser.software; - -import java.io.InputStream; -import java.util.ArrayList; - -import cern.colt.Arrays; - -import be.abeel.io.LineIterator; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Strand; -import net.sf.jannot.StringKey; -import net.sf.jannot.Type; -import net.sf.jannot.parser.Parser; - -/** - * @author Thomas Abeel - * - */ -public class SIPHTParser extends Parser { - /** - * @param stringKey - */ - public SIPHTParser(StringKey stringKey) { - super(stringKey); - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - it.setSkipBlanks(true); - String id = null; - Type t = Type.get("SIPHT"); - int count = 0; - while (it.hasNext() && count < 1) { - if (it.next().startsWith("~")) - count++; - } - ArrayList header = new ArrayList(); - for (String line : it) { - if (line.startsWith("~") || line.startsWith("**")) { - count++; - continue; - } - String[] arr = line.split("\t+",header.size()>0?header.size():0); - if (count == 1) { - //System.out.println("header: " + Arrays.toString(arr)); - for (String s : arr) { - header.add(s.trim()); - } - } - - if (count == 2 || count == 3) { - System.out.println("putative: " + Arrays.toString(arr)); - Feature f = new Feature(); - f.setType(t); - int start = Integer.parseInt(arr[8]); - int end = Integer.parseInt(arr[9]); - if (arr[10].equals("<<<")) - f.setStrand(Strand.REVERSE); - else - f.setStrand(Strand.FORWARD); - f.addLocation(new Location(start,end)); - for(int i=0;i end) { - f.setStrand(Strand.REVERSE); - } else { - f.setStrand(Strand.FORWARD); - } - MemoryFeatureAnnotation fa = e.getMemoryAnnotation(t); - fa.add(f); - - } - return set; - } - -} diff --git a/src/net/sf/jannot/parser/software/TransTermHPParser.java b/src/net/sf/jannot/parser/software/TransTermHPParser.java deleted file mode 100644 index accca37..0000000 --- a/src/net/sf/jannot/parser/software/TransTermHPParser.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.parser.software; - -import java.io.InputStream; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; -import net.sf.jannot.parser.Parser; -import be.abeel.io.LineIterator; - -/** - * Parser for the output of the TransTermHP program as described in - * - * C. Kingsford, K. Ayanbule and S.L. Salzberg. Rapid, accurate, - * computational discovery of Rho-independent transcription terminators - * illuminates their relationship to DNA uptake. Genome Biology 8:R22 (2007). - * - * - * Data format description: http://transterm.cbcb.umd.edu/description.html - * - * - * @author Thomas Abeel - * - */ -public class TransTermHPParser extends Parser { - - /** - * @param dataKey - */ - public TransTermHPParser() { - super(null); - // TODO Auto-generated constructor stub - } - - @Override - public EntrySet parse(InputStream is, EntrySet set) { - if (set == null) - set = new EntrySet(); - LineIterator it = new LineIterator(is); - String id = null; - Type t = Type.get("TransTermHP"); - for (String line : it) { - line = line.trim(); - if (line.startsWith("SEQUENCE")) - id = line.substring(9); - if (line.startsWith("TERM")) { - String[] arr = line.split("[ \t\n\f\r]+"); - Feature f = new Feature(); - f.setType(t); - f.addLocation(new Location(Integer.parseInt(arr[2]), Integer.parseInt(arr[4]))); - f.setStrand(Strand.fromSymbol(arr[5].charAt(0))); - f.addQualifier("source", "TransTermHP"); - f.addQualifier("location", loc(arr[6].charAt(0))); - f.setScore(Integer.parseInt(arr[7]) / 100.0); - f.addQualifier("hairpin score", arr[8]); - f.addQualifier("tail score", arr[9]); - f.addQualifier("note", arr[10]); - // System.out.println(f); - Entry e = set.getOrCreateEntry(id); - MemoryFeatureAnnotation fa = e.getMemoryAnnotation(t); - fa.add(f); - } - } - - return set; - } - - private String loc(char charAt) { - switch (charAt) { - case 'g': - case 'G': - return "In the interior of a gene (at least 50bp from an end)"; - case 'f': - case 'F': - return "Between two +strand genes"; - case 'R': - case 'r': - return "Between two -strand genes"; - case 'T': - case 't': - return "Between a +strand gene and a -strand gene"; - default: - return "Not defined"; - } - - } - -} diff --git a/src/net/sf/jannot/parser/software/package.html b/src/net/sf/jannot/parser/software/package.html deleted file mode 100644 index 21be8ee..0000000 --- a/src/net/sf/jannot/parser/software/package.html +++ /dev/null @@ -1 +0,0 @@ -Parsers for specific programs. \ No newline at end of file diff --git a/src/net/sf/jannot/picard/BinaryBlob.java b/src/net/sf/jannot/picard/BinaryBlob.java deleted file mode 100644 index 1dd2bb4..0000000 --- a/src/net/sf/jannot/picard/BinaryBlob.java +++ /dev/null @@ -1,197 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.picard; - -import java.io.File; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.util.logging.Logger; - -import net.sf.jannot.Cleaner; - -/** - * @author Thomas Abeel - * - */ -public class BinaryBlob { - /* Files are each 32 Mb */ - private static final int BLOCKSIZE = 32 * 1024 * 1024; - /* Each file contains n number of blocks */ - // private static final int BLOCKSPERFILE = 40; - // private ArrayList blocks = new ArrayList(); - - // private void updateBlocks(long pos, int length) { - // blocks.clear(); - // long startBlock = pos / BLOCKSIZE; - // while (startBlock * BLOCKSIZE < pos + length) { - // blocks.add((int) startBlock); - // startBlock++; - // - // } - // } - - private File[] bufferFiles; - private RandomAccessFile[] rafs; - // private URL url; - // private SeekableHTTPStream urlstream; - private Logger log = Logger.getLogger(BinaryBlob.class.getCanonicalName()); - - public BinaryBlob(long size) throws IOException { - bufferFiles = new File[1 + (int) (size / (BLOCKSIZE))]; - rafs = new RandomAccessFile[bufferFiles.length]; - - log.fine("Creating BinaryBlob cache files"); - for (int i = 0; i < bufferFiles.length; i++) { - bufferFiles[i] = File.createTempFile("GenomeView.binaryblob", ".tmp." + i); - bufferFiles[i].deleteOnExit(); - rafs[i] = new RandomAccessFile(bufferFiles[i], "rwd"); - Cleaner.register(rafs[i], bufferFiles[i]); - } - - // retrievedBlocks = new BitSet(); - - } - - /** - * @param i - * @param value - * @throws IOException - */ - public synchronized void putFloat(long pos, float value) throws IOException { - long fIndex = pos / BLOCKSIZE; - long fPos = pos % BLOCKSIZE; - rafs[(int) fIndex].seek(fPos); - rafs[(int) fIndex].writeFloat(value); - - } - - // /** - // * @param out - // * @param start - // * @param len - // */ - // public void getFloat(float[] out, int start, int len) { - // // TODO Auto-generated method stub - // - // } - - // /** - // * @return - // */ - // public int size() { - // return size; - // } - - /** - * @param i - * @return - * @throws IOException - */ - public synchronized float getFloat(int pos) throws IOException { - int fIndex=(int)(pos/BLOCKSIZE); - long fPos=pos%BLOCKSIZE; - if(fPos>=rafs[fIndex].length()) - return 0; - - rafs[fIndex].seek(fPos); - return rafs[fIndex].readFloat(); - } - // private synchronized void retrieve(long block) throws IOException { - // try { - // System.out.println("getting block " + block); - // /* Download block data */ - // urlstream.seek(block * BLOCKSIZE); - // byte[] buffer = new byte[BLOCKSIZE]; - // urlstream.read(buffer, 0, BLOCKSIZE); - // - // /* Cache */ - // rafs[(int) (block / BLOCKSPERFILE)].seek((block % BLOCKSPERFILE) * - // BLOCKSIZE); - // rafs[(int) (block / BLOCKSPERFILE)].write(buffer); - // retrievedBlocks.set((int) block); - // - // } catch (Exception e) { - // log.log(Level.SEVERE, "Exception during retrieval", e); - // - // } - // } - - // private BitSet retrievedBlocks = null; - // - // // private RandomAccessFile raf; - - // public synchronized int read(long position, byte[] buffer, int offset, - // int length) throws IOException { - // if (offset < 0 || length < 0 || (offset + length) > buffer.length) { - // throw new IndexOutOfBoundsException(); - // } - // updateBlocks(position, length); - // /* Check whether all blocks we need are cached */ - // for (int block : blocks) { - // if (!retrievedBlocks.get(block)) { - // retrieve(block); - // } - // } - // - // /* Total bytes read */ - // int n = 0; - // - // /* First file in which we need to read something */ - // long startFile = position / (BLOCKSIZE * BLOCKSPERFILE); - // - // /* Last file in which we need to read something */ - // long endFile = (position + length) / (BLOCKSIZE * BLOCKSPERFILE); - // - // /* First file */ - // RandomAccessFile workingRaf = rafs[(int) startFile]; - // position = position - (startFile * BLOCKSIZE * BLOCKSPERFILE); - // workingRaf.seek(position); - // - // /* Available bytes in first file */ - // long avail = BLOCKSIZE * BLOCKSPERFILE - position; - // if (avail > length) - // avail = length; - // - // // /--> read first chunk - // while (n < avail) { - // int count = workingRaf.read(buffer, offset + n, (int) (avail - n)); - // if (count < 0) { - // throw new EOFException(); - // } - // n += count; - // } - // - // /* Middle files */ - // for (long i = startFile + 1; i < endFile; i++) { - // avail = BLOCKSIZE * BLOCKSPERFILE; - // workingRaf = rafs[(int) i]; - // workingRaf.seek(0); - // while (n < avail) { - // int count = workingRaf.read(buffer, offset + n, (int) (avail - n)); - // if (count < 0) { - // throw new EOFException(); - // } - // n += count; - // } - // } - // - // /* Last file */ - // if (startFile < endFile) { - // workingRaf = rafs[(int) endFile]; - // workingRaf.seek(0); - // while (n < length) { - // workingRaf = rafs[(int) endFile]; - // workingRaf.seek(0); - // int count = workingRaf.read(buffer, offset + n, length - n); - // if (count < 0) { - // throw new EOFException(); - // } - // n += count; - // } - // } - // - // return n; - // } - -} diff --git a/src/net/sf/jannot/picard/LineBlockCompressedInputStream.java b/src/net/sf/jannot/picard/LineBlockCompressedInputStream.java deleted file mode 100644 index 669b075..0000000 --- a/src/net/sf/jannot/picard/LineBlockCompressedInputStream.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.picard; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; - -import net.sf.samtools.util.BlockCompressedInputStream; -import net.sf.samtools.seekablestream.SeekableBufferedStream; -import net.sf.samtools.seekablestream.SeekableStream; - -/** - * @author Thomas Abeel - * - */ -public class LineBlockCompressedInputStream extends BlockCompressedInputStream { - - private BufferedReader br=null; - /** - * Reads a line from the inputstream until a \n or \n\r is encountered. The - * file pointer will be positioned at the beginning of the next line after - * this read. - * - * @return a string with the read characters. Null when no more characters - * are being read. - */ - public String readLine() throws IOException { - return br.readLine(); - } - - @Override - public void seek(long place){ - try { - super.seek(place); - br=new BufferedReader(new InputStreamReader(this)); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - /** - * @param strm - */ - public LineBlockCompressedInputStream(SeekableStream strm) { - super(new SeekableBufferedStream(strm)); - br=new BufferedReader(new InputStreamReader(this)); - } - - - -} diff --git a/src/net/sf/jannot/picard/SeekableFileCachedHTTPStream.java b/src/net/sf/jannot/picard/SeekableFileCachedHTTPStream.java deleted file mode 100644 index cedb78d..0000000 --- a/src/net/sf/jannot/picard/SeekableFileCachedHTTPStream.java +++ /dev/null @@ -1,223 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.picard; - -import java.io.EOFException; -import java.io.File; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.BitSet; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.jannot.Cleaner; -import net.sf.jannot.exception.ReadFailedException; - -import net.sf.samtools.seekablestream.SeekableHTTPStream; -import net.sf.samtools.seekablestream.SeekableStream; -import be.abeel.net.URIFactory; - -/** - * @author Thomas Abeel - */ -public class SeekableFileCachedHTTPStream extends net.sf.samtools.seekablestream.SeekableHTTPStream { - - private Logger log = Logger.getLogger(SeekableFileCachedHTTPStream.class.getCanonicalName()); - - class Cache { - private ArrayList blocks = new ArrayList(); - - private void updateBlocks(long pos, int length) { - blocks.clear(); - long startBlock = pos / BLOCKSIZE; - while (startBlock * BLOCKSIZE < pos + length) { - blocks.add((int) startBlock); - startBlock++; - - } - } - - private File[] bufferFiles; - private RandomAccessFile[] rafs; - // private URL url; - private SeekableHTTPStream urlstream; - - private Cache(URL url) throws IOException, ReadFailedException { - urlstream = new SeekableHTTPStream(url); - long len=urlstream.length(); - log.fine("Reported size "+len +" for "+url); - bufferFiles = new File[1+(int) (len / (BLOCKSIZE * BLOCKSPERFILE))]; - rafs = new RandomAccessFile[bufferFiles.length]; - - log.fine("Creating "+bufferFiles.length+" HTTP cache files for "+url); - for (int i = 0; i < bufferFiles.length; i++) { - bufferFiles[i] = File.createTempFile("GenomeView.urlbuffer", ".tmp." + i); - bufferFiles[i].deleteOnExit(); - rafs[i] = new RandomAccessFile(bufferFiles[i], "rwd"); - Cleaner.register(rafs[i], bufferFiles[i]); - } - - retrievedBlocks = new BitSet(); - - } - - private synchronized void retrieve(long block) throws IOException { - try { - log.log(Level.FINE,"getting block " + block); - /* Download block data */ - urlstream.seek(block * BLOCKSIZE); - byte[] buffer = new byte[BLOCKSIZE]; - urlstream.read(buffer, 0, BLOCKSIZE); - - /* Cache */ - rafs[(int) (block / BLOCKSPERFILE)].seek((block % BLOCKSPERFILE) * BLOCKSIZE); - rafs[(int) (block / BLOCKSPERFILE)].write(buffer); - retrievedBlocks.set((int) block); - - } catch (Exception e) { - log.log(Level.SEVERE, "Exception during retrieval rafs.len="+rafs.length+", url="+urlstream.getSource(), e); - - } - } - - private BitSet retrievedBlocks = null; - - // private RandomAccessFile raf; - - public synchronized int read(long position, byte[] buffer, int offset, int length) throws IOException { - if (offset < 0 || length < 0 || (offset + length) > buffer.length) { - throw new IndexOutOfBoundsException(); - } - updateBlocks(position, length); - /* Check whether all blocks we need are cached */ - for (int block : blocks) { - if (!retrievedBlocks.get(block)) { - retrieve(block); - } - } - - /* Total bytes read */ - int n = 0; - - /* First file in which we need to read something */ - long startFile = position / (BLOCKSIZE * BLOCKSPERFILE); - - /* Last file in which we need to read something */ - long endFile = (position + length) / (BLOCKSIZE * BLOCKSPERFILE); - - /* First file */ - RandomAccessFile workingRaf = rafs[(int) startFile]; - position = position - (startFile * BLOCKSIZE * BLOCKSPERFILE); - workingRaf.seek(position); - - /* Available bytes in first file */ - long avail = BLOCKSIZE * BLOCKSPERFILE - position; - if (avail > length) - avail = length; - - // /--> read first chunk - while (n < avail) { - int count = workingRaf.read(buffer, offset + n, (int) (avail - n)); - if (count < 0) { - throw new EOFException(); - } - n += count; - } - - /* Middle files */ - for (long i = startFile + 1; i < endFile; i++) { - avail=BLOCKSIZE*BLOCKSPERFILE; - workingRaf = rafs[(int) i]; - workingRaf.seek(0); - while (n < avail ) { - int count = workingRaf.read(buffer, offset + n, (int) (avail - n)); - if (count < 0) { - throw new EOFException(); - } - n += count; - } - } - - /* Last file */ - if (startFile < endFile) { - workingRaf = rafs[(int) endFile]; - workingRaf.seek(0); - while (n < length) { - workingRaf = rafs[(int) endFile]; - workingRaf.seek(0); - int count = workingRaf.read(buffer, offset + n, length - n); - if (count < 0) { - throw new EOFException(); - } - n += count; - } - } - - return n; - } - - } - - private long position = 0; - - private Cache cache; - private static final int BLOCKSIZE = 256 * 1024; - /* Each file contains n number of blocks */ - private static final int BLOCKSPERFILE = 40; - - public SeekableFileCachedHTTPStream(URL url) throws IOException, ReadFailedException { - super(url); - cache = new Cache(url); - - } - - private SeekableFileCachedHTTPStream(URL url, Cache c) { - super(url); - this.cache = c; - } - - public void seek(long position) { - this.position = position; - } - - public synchronized int read(byte[] buffer, int offset, int length) throws IOException { - int n = cache.read(position, buffer, offset, length); - position += n; - return n; - - } - - /** - * Closes this SeekableFileCachedHTTPStream and its entire lineage. - * - * @throws IOException - */ - public void closeAll() { - try { - for (RandomAccessFile raf : cache.rafs) - raf.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - public SeekableStream stream() { - try { - return new SeekableFileCachedHTTPStream(URIFactory.url(super.getSource()), cache); - } catch (MalformedURLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return null; - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return null; - } - } -} diff --git a/src/net/sf/jannot/pileup/DoublePile.java b/src/net/sf/jannot/pileup/DoublePile.java deleted file mode 100644 index 0068329..0000000 --- a/src/net/sf/jannot/pileup/DoublePile.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.pileup; - -/** - * @author Thomas Abeel - * - */ -public class DoublePile extends SinglePile { - public DoublePile(int pos, float val0, float val1) { - super(pos, val0); - this.val1 = val1; - - } - - private float val1; - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.pileup.SinglePile#getValueCount() - */ - @Override - public int getValueCount() { - return 2; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.pileup.SinglePile#getValue(int) - */ - @Override - public float getValue(int i) { - if (i == 0) - return super.getValue(0); - else if (i == 1) - return val1; - else - throw new IndexOutOfBoundsException( - "DoublePile only supports two value, you requested the value with index " + i); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.pileup.SinglePile#getTotal() - */ - @Override - public float getTotal() { - return getValue(0) + getValue(1); - } - -} diff --git a/src/net/sf/jannot/pileup/MultiPile.java b/src/net/sf/jannot/pileup/MultiPile.java deleted file mode 100644 index 3e738ec..0000000 --- a/src/net/sf/jannot/pileup/MultiPile.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.pileup; - -import cern.colt.Arrays; - - -/** - * @author Thomas Abeel - * - */ -public class MultiPile extends DoublePile { - - private float[] val; - - private double sum=0; - - public String toString(){ - return super.start()+"="+Arrays.toString(val); - - } - - public MultiPile(int pos, float[] arr) { - super(pos, arr.length>0?arr[0]:Float.NaN, arr.length>1?arr[1]:Float.NaN); - this.val=arr; - for(float f:val) - sum+=f; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.pileup.DoublePile#getValueCount() - */ - @Override - public int getValueCount() { - return val.length; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.pileup.DoublePile#getValue(int) - */ - @Override - public float getValue(int i) { - return val[i]; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.pileup.DoublePile#getTotal() - */ - @Override - public float getTotal() { - return (float)sum; - } - -} diff --git a/src/net/sf/jannot/pileup/Pile.java b/src/net/sf/jannot/pileup/Pile.java deleted file mode 100644 index 6e5b102..0000000 --- a/src/net/sf/jannot/pileup/Pile.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.pileup; - -/** - * - * @author Thomas Abeel - * - */ -public interface Pile { - public float getTotal(); - public int start(); - public int end(); - public float getValue(int i); - public int getValueCount(); - public byte[]getBases(); - public int getLength(); - public void setLength(int len); - - -} diff --git a/src/net/sf/jannot/pileup/PileNormalization.java b/src/net/sf/jannot/pileup/PileNormalization.java deleted file mode 100644 index a53d8db..0000000 --- a/src/net/sf/jannot/pileup/PileNormalization.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.pileup; - -import net.sf.jannot.Data; -/** - * - * @author Thomas Abeel - * - */ -public interface PileNormalization { - - public boolean supportsNormalization(); - -} diff --git a/src/net/sf/jannot/pileup/PileTools.java b/src/net/sf/jannot/pileup/PileTools.java deleted file mode 100644 index a7f34db..0000000 --- a/src/net/sf/jannot/pileup/PileTools.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.pileup; - -/** - * - * @author Thomas Abeel - * - */ -public class PileTools { - /** - * Creates the most memory efficient pile implementation for the given - * values. - * - * @param s - * @param arr - * @return - */ - public static Pile create(int s, float ... arr) { - switch (arr.length) { - case 0: - return null; - case 1: - return new SinglePile(s, arr[0]); - case 2: - return new DoublePile(s, arr[0], arr[1]); - default: - return new MultiPile(s, arr); - - } - - } -} diff --git a/src/net/sf/jannot/pileup/ReadDetailPile.java b/src/net/sf/jannot/pileup/ReadDetailPile.java deleted file mode 100644 index 4f9ed29..0000000 --- a/src/net/sf/jannot/pileup/ReadDetailPile.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.pileup; - - -/** - * @author Thomas Abeel - * - */ -public class ReadDetailPile extends DoublePile { - - private byte[] bases = null; - - - /** - * Gives you the actual bases that are present in this pile. This method may - * return null if the summary format does not have base - * information. - * - * @return - */ - public byte[] getBases() { - return bases; - } - - - - public ReadDetailPile(int pos, float fcov, float rcov, byte[] bases) { - super(pos,fcov,rcov); - this.bases = bases; - } - - /** - * Creates a pile up for read data from a pile up file - * - * @param pos - * position of the pile - * @param reads - * read data - */ - public static ReadDetailPile create(int pos, byte[] reads) { - float rcoverage = 0; - float fcoverage = 0; - for (int i = 0; i < reads.length; i++) { - byte c = reads[i]; - if (c == '^') - i++; - else if (c == '-' || c == '+') { - int jump = reads[++i]; - try { - i += Integer.parseInt("" + (char) jump); - } catch (NumberFormatException ne) { - System.err.println("NFE: " + pos); - } - } else if (c == '.' || c == 'A' || c == 'C' || c == 'G' || c == 'T' || c == 'N') { - fcoverage++; - } else if (c == ',' || c == 'a' || c == 'c' || c == 'g' || c == 't' || c == 'n') { - rcoverage++; - } else { - // System.err.println("PILE: unknown char: "+(char)c); - } - - } - return new ReadDetailPile(pos, fcoverage, rcoverage, reads); - } - - - - - -} diff --git a/src/net/sf/jannot/pileup/SinglePile.java b/src/net/sf/jannot/pileup/SinglePile.java deleted file mode 100644 index fa2b6fa..0000000 --- a/src/net/sf/jannot/pileup/SinglePile.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.pileup; - -import net.sf.jannot.Located; - -/** - * - * Pile representing a single value. - * - * @author Thomas Abeel - * - */ -public class SinglePile implements Located,Pile { - /* 1-based location of this pile */ - private int pos = 0; - - private int len = 1; - - private float val0 = 0; - -// private float fcoverage = 0; - -// private byte[] bases = null; - -// public int getPos() { -// return pos; -// } - - public int getValueCount(){ - return 1; - } - - public float getValue(int i) { - if(i==0) - return val0; - else - throw new IndexOutOfBoundsException("Single pile only has one value"); - } - -// public float getFCoverage() { -// return fcoverage; -// } - - public float getTotal() { - return val0; - } - - /** - * Gives you the actual bases that are present in this pile. This method may - * return null if the summary format does not have base - * information. - * - * @return - */ - public byte[] getBases() { - return null; - } - - public void setLength(int len) { - this.len = len; - } - - public int getLength() { - return len; - } - - public SinglePile(int pos, float val) { - this.pos = pos; - this.val0=val; - - } - -// /** -// * Creates a pile up for read data from a pile up file -// * -// * @param pos -// * position of the pile -// * @param reads -// * read data -// */ -// public SinglePile(int pos, byte[] reads) { -// -// this.pos = pos; -// this.rcoverage = 0; -// this.fcoverage = 0; -// for (int i = 0; i < reads.length; i++) { -// byte c = reads[i]; -// if (c == '^') -// i++; -// else if (c == '-' || c == '+') { -// int jump = reads[++i]; -// try { -// i += Integer.parseInt("" + (char) jump); -// } catch (NumberFormatException ne) { -// System.err.println("NFE: " + pos); -// } -// } else if (c == '.' || c == 'A' || c == 'C' || c == 'G' || c == 'T' || c == 'N') { -// fcoverage++; -// } else if (c == ',' || c == 'a' || c == 'c' || c == 'g' || c == 't' || c == 'n') { -// rcoverage++; -// } else { -// // System.err.println("PILE: unknown char: "+(char)c); -// } -// -// } -// -// this.bases = reads; -// } - - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Located#start() - */ - @Override - public int start() { - return pos; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Located#end() - */ - @Override - public int end() { - return pos + len; - } - -} diff --git a/src/net/sf/jannot/refseq/FaidxData.java b/src/net/sf/jannot/refseq/FaidxData.java deleted file mode 100644 index 7e8433f..0000000 --- a/src/net/sf/jannot/refseq/FaidxData.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.refseq; - -import net.sf.jannot.refseq.FaidxIndex.IndexEntry; -import net.sf.samtools.seekablestream.SeekableStream; - - -/** - * - * @author Thomas Abeel - * - */ -public class FaidxData extends Sequence { - - - private SeekableStream data = null; - private IndexEntry idx; - - - /** - * @param index - * @param content - * @param name - */ - public FaidxData(FaidxIndex index, SeekableStream content, String name) { - - this.data = content; - this.idx = index.get(name); - - - } - - @Override - public Iterable get(int start, int end) { - return new FaixDataIterable(data, start, end-1, idx.start, idx.len, idx.lineLen, idx.byteLen); - } - - @Override - public Iterable get() { - return get(1,(int)(idx.len+1)); - //return new FaixDataIterable(data, 1, (int) this.len, this.start, this.len, this.lineLen, this.byteLen); - } - - @Override - public int size() { - return (int) idx.len; - } - -} diff --git a/src/net/sf/jannot/refseq/FaidxIndex.java b/src/net/sf/jannot/refseq/FaidxIndex.java deleted file mode 100644 index 130a12e..0000000 --- a/src/net/sf/jannot/refseq/FaidxIndex.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.refseq; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; - -import be.abeel.io.LineIterator; -/** - * - * @author Thomas Abeel - * - */ -public class FaidxIndex { - - - class IndexEntry{ - long len,start,lineLen,byteLen; - - /** - * @param len - * @param start - * @param lineLen - * @param byteLen - */ - IndexEntry(long len, long start, long lineLen, long byteLen) { - super(); - this.len = len; - this.start = start; - this.lineLen = lineLen; - this.byteLen = byteLen; - } - } - private HashMapmapping=new HashMap(); - private String[]names; - - - public FaidxIndex(InputStream is) { - LineIterator it = new LineIterator(is); - ArrayListlines=new ArrayList(); - for (String line : it) { - lines.add(line); - } - names=new String[lines.size()]; - - int idx=0; - for(String line:lines){ - String[] arr = line.split("\t"); - try { - names[idx++]=arr[0]; - IndexEntry ie=new IndexEntry(Long.parseLong(arr[1]), Long.parseLong(arr[2]), Long.parseLong(arr[3]), Long.parseLong(arr[4])); - mapping.put(arr[0],ie); - - - } catch (ArrayIndexOutOfBoundsException e) { - System.err.println("Could not parse: " + line); - while(it.hasNext()){ - System.err.println(it.next()); - } - } - } - - } - - public String[] names() { - return names; - } - - public IndexEntry get(String name){ - return mapping.get(name); - } - -} diff --git a/src/net/sf/jannot/refseq/FaixDataIterable.java b/src/net/sf/jannot/refseq/FaixDataIterable.java deleted file mode 100644 index b79bc0d..0000000 --- a/src/net/sf/jannot/refseq/FaixDataIterable.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.refseq; - -import java.io.IOException; -import java.util.Iterator; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.samtools.seekablestream.SeekableStream; - -/** - * @author mavoo - * @author Thomas Abeel - * - */ -public class FaixDataIterable implements Iterable { - - private SeekableStream data; - - private int qStart; - - private int qEnd; - - private long start; - - private long len; - - private long lineLen; - - private long byteLen; - - public FaixDataIterable(SeekableStream data, int start, int end, long start2, long len, long lineLen, long byteLen) { - this.data = data; - this.qStart = start; - this.qEnd = end; - this.start = start2; - this.len = len; - - this.lineLen = lineLen; - this.byteLen = byteLen; - } - - public Iterator iterator() { - return new FaixDataIterator(data, qStart, qEnd, start, len, lineLen, byteLen); - } - private static Logger log = Logger.getLogger(FaixDataIterable.class.getCanonicalName()); - - private class FaixDataIterator implements Iterator { - private static final int BUFFERSIZE = 1024;// *1024; - private SeekableStream data; - /* Contains nucleotides */ - private byte[] buffer = new byte[BUFFERSIZE]; - // private long[] coordinates; - private long qPosition = 0L; - - /* Make sure the first time, we read something */ - private int bufferIndex = buffer.length + 1; - private long currentFilePos; - private long byteLen; - private long lineLen; - private long start; - - - /* Incoming qStart and qEnd coordinates are 1-based */ - public FaixDataIterator(SeekableStream data, int qStart, int qEnd, long start, long len, long lineLen, - long byteLen) { - this.data = data; - currentFilePos = translate(qStart<1?1:qStart, start, lineLen, byteLen); - - this.start = start; - this.lineLen = lineLen; - this.byteLen = byteLen; - qPosition = qStart; - } - - private long translate(int position, long start, long lineLen, long byteLen) { - position--; - long lines = position / lineLen; - long lineOffset = position - lines * lineLen; - return start + lines * byteLen + lineOffset; - - } - - public boolean hasNext() { - return qPosition < qEnd + 1; - } - - - public Character next() { - if (qPosition < 1) { - qPosition++; - return '_'; - } - if (bufferIndex >= buffer.length) - try { - refill(); - } catch (IOException e) { - log.log(Level.SEVERE,"Exception while refilling buffer",e); - throw new RuntimeException(e); - } - char retVal = (char) buffer[bufferIndex++]; - if(retVal>='a'&&retVal<='z') - retVal+='A'-'a'; - qPosition++; - return retVal; - - } - - /* Fill the buffer with data */ - private void refill() throws IOException { - long endFilePos = translate((int) qPosition + 1024, start, lineLen, byteLen); - byte[] tmpBuffer = new byte[(int) (endFilePos - currentFilePos)]; - data.seek(currentFilePos); - data.read(tmpBuffer); - currentFilePos = endFilePos; - int bIdx = 0; - for (int i = 0; i < tmpBuffer.length; i++) { - if (Character.isLetter((char) tmpBuffer[i]) && bIdx < buffer.length) - buffer[bIdx++] = tmpBuffer[i]; - - } - bufferIndex = 0; - - } - - public void remove() { - throw new UnsupportedOperationException("Remove not supported for FaixDataIterator."); - } - - private void close() { - // - } - } -} diff --git a/src/net/sf/jannot/refseq/MemorySequence.java b/src/net/sf/jannot/refseq/MemorySequence.java deleted file mode 100644 index 955d56f..0000000 --- a/src/net/sf/jannot/refseq/MemorySequence.java +++ /dev/null @@ -1,355 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.refseq; - -import net.sf.jannot.AminoAcidMapping; -import net.sf.jannot.utils.ArrayIterable; -import net.sf.jannot.utils.SequenceTools; -import cern.colt.list.ByteArrayList; - -public class MemorySequence extends Sequence { - - @Deprecated - public char getNucleotide(int index) { - if (index < 1 || index > size()) - return '_'; - return get(index - 1); - - } - - @Deprecated - public char getReverseNucleotide(int index) { - return SequenceTools.complement(getNucleotide(index)); - } - - @Deprecated - public char getAminoAcid(int pos, AminoAcidMapping mapping) { - String codon = "" + getNucleotide(pos) + getNucleotide(pos + 1) + getNucleotide(pos + 2); - return mapping.get(codon); - } - - @Deprecated - public char getReverseAminoAcid(int pos, AminoAcidMapping mapping) { - String codon = "" + getReverseNucleotide(pos + 2) + getReverseNucleotide(pos + 1) + getReverseNucleotide(pos); - return mapping.get(codon); - } - - // /** - // * Gets a subsequence from this sequence. The selected sequence is - // * [start,end[. The coordinates are one based. - // * - // * @param start - // * the start coordinate, this one will be included in the - // * sequence. This is a one-based coordinate. - // * @param end - // * the end coordinate, this one will not be included in the - // * sequence. This is a one-based coordinate. - // * @return the selected subsequence. - // */ - // @Deprecated - // public String getSubSequence(int start, int end) { - // start--;// = startPos; - // end--;// = startPos; - // StringBuffer out = new StringBuffer(); - // for (int i = start; i < end; i++) { - // out.append(get(i)); - // } - // return out.toString(); - // } - - private DefaultByteArrayList sequence = new DefaultByteArrayList((byte) 0xff); - - static class DefaultByteArrayList extends ByteArrayList { - - private byte def; - - private DefaultByteArrayList(byte[] ele, byte def) { - super(ele); - this.def = def; - } - - public DefaultByteArrayList(byte def) { - this.def = def; - } - - public void setDef(byte def) { - this.def = def; - } - - @Override - public byte get(int index) { - if (index >= 0 && index < super.size) - return super.get(index); - else - return def; - } - - public DefaultByteArrayList copy() { - return new DefaultByteArrayList(super.elements, this.def); - } - - } - - private char decode(int b) { - switch (b) { - case 0: - return 'A'; - case 1: - return 'C'; - case 2: - return 'G'; - case 3: - return 'T'; - case 4: - return 'N'; - case 5: - return '-'; - case 6: - default: - return '_'; - } - } - - private int encode(char c) { - switch (c) { - case 'a': - case 'A': - return 0; - case 'c': - case 'C': - return 1; - case 'g': - case 'G': - return 2; - case 't': - case 'T': - return 3; - case 'n': - case 'N': - return 4; - case '-': - return 5; - default: - return 6; - } - - } - - /* Zero based setter for the sequence */ - private void set(int pos, char c) { - int coded = encode(c); - int mask = 15; - if (pos % 2 == 1) { - coded <<= 4; - - } else - mask <<= 4; - - if (sequence.size() <= pos / 2) - sequence.setSize(sequence.size() + 1); - - int current = sequence.get(pos / 2); - current &= mask; - int newCurrent = current | coded; - sequence.set(pos / 2, (byte) newCurrent); - } - - /* Zero based getter for the sequence */ - - protected char get(int pos) { - int current = sequence.get(pos / 2); - int mask = 15; - if (pos % 2 == 1) { - current >>= 4; - } else { - current &= mask; - } - return decode(current); - } - - public MemorySequence() { - - } - - /** - * Copy constructor - * - * @param sequence - * sequence to make a copy of - */ - public MemorySequence(MemorySequence sequence) { - this.sequence = sequence.sequence.copy(); - this.size = sequence.size; - } - - public MemorySequence(String string) { - this(new StringBuffer(string)); - } - - public MemorySequence(StringBuffer string) { - setSequence(string); - } - - // @Deprecated - // public final String getSequence() { - // return getSubSequence(1, size + 1); - // } - - // private int startPos = 1; - - @Override - public String toString() { - return stringRepresentation(); - } - - // /** - // * Set the sequences starting from the given position. - // * - // * @param seq - // * @param start - // * 1 based start coordinate - // */ - // public void setSequence(String seq, int start) { - // setSequence(new StringBuffer(seq), start); - // } - - public void setSequence(String sequence) { - setSequence(new StringBuffer(sequence)); - } - - // public char getNucleotide(int index) { - // if (index < 1 || index > size()) - // return '_'; - // return get(index - 1); - // - // } - - // public char getReverseNucleotide(int index) { - // return SequenceTools.complement(getNucleotide(index)); - // } - - public int size() { - return size; - } - - // public char getAminoAcid(int pos, AminoAcidMapping mapping) { - // String codon = "" + getNucleotide(pos) + getNucleotide(pos + 1) - // + getNucleotide(pos + 2); - // return mapping.get(codon); - // } - // - // public char getReverseAminoAcid(int pos, AminoAcidMapping mapping) { - // String codon = "" + getReverseNucleotide(pos + 2) - // + getReverseNucleotide(pos + 1) + getReverseNucleotide(pos); - // return mapping.get(codon); - // } - // - // /** - // * Gets a subsequence from this sequence. The selected sequence is - // * [start,end[. The coordinates are one based. - // * - // * @param start - // * the start coordinate, this one will be included in the - // * sequence. This is a one-based coordinate. - // * @param end - // * the end coordinate, this one will not be included in the - // * sequence. This is a one-based coordinate. - // * @return the selected subsequence. - // */ - // public String getSubSequence(int start, int end) { - // start--;// = startPos; - // end--;// = startPos; - // StringBuffer out = new StringBuffer(); - // for (int i = start; i < end; i++) { - // out.append(get(i)); - // } - // return out.toString(); - // } - // - // // public int getStartPos() { - // // return startPos; - // } - - // public int getEndPos() { - // return size(); - // } - - public void addSequence(String seq) { - int currentLength = size(); - for (int i = 0; i < seq.length(); i++) { - set(i + currentLength, seq.charAt(i)); - size++; - } -// setChanged(); -// notifyObservers(); - - } - - public void setSequence(StringBuffer seq) { - this.sequence = new DefaultByteArrayList((byte) 0xff); - for (int i = 0; i < seq.length(); i++) { - set(i, seq.charAt(i)); - } - - this.size = seq.length(); -// setChanged(); -// notifyObservers(); - - } - - // public void setSequence(StringBuffer seq, int start) { - // - // - // } - - private int size = 0; - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - char[] seq = new char[end - start]; - - // getSubSequence(start, end).toCharArray(); - - start--;// = startPos; - end--;// = startPos; - for (int i = start; i < end; i++) { - seq[i - start] = get(i); - } - return new ArrayIterable(seq); - - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get() - */ - @Override - public Iterable get() { - return get(1, size()+1); - // return new ArrayIterable(); - // char[] seq = getSequence().toCharArray(); - // return new ArrayIterable(seq); - } - - // /** - // * Set the length of the sequence explicitly. Set it to a negative number - // to - // * use the actual size of the sequence. - // * - // * - // * @param size - // */ - // public void setSize(int size) { - // this.size = size; - // setChanged(); - // notifyObservers(); - // } - -} diff --git a/src/net/sf/jannot/refseq/Sequence.java b/src/net/sf/jannot/refseq/Sequence.java deleted file mode 100644 index c8347f6..0000000 --- a/src/net/sf/jannot/refseq/Sequence.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.refseq; - -import net.sf.jannot.Data; -/** - * - * @author Thomas Abeel - * - */ -public abstract class Sequence implements Data { - - - public String label(){ - return "Sequence"; - } - - public boolean canSave(){ - return false; - } - - public abstract int size(); - - /** - * Gets a subsequence from this sequence. The selected sequence is - * [start,end[. The coordinates are one based. - * - * @param start - * the start coordinate, this one will be included in the - * sequence. This is a one-based coordinate. - * @param end - * the end coordinate, this one will not be included in the - * sequence. This is a one-based coordinate. - * @return the selected subsequence. - */ - @Override - public abstract Iterable get(int start, int end); - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get() - */ - @Override - public abstract Iterable get(); - - /** - * Coordinates are 1-based, cover [start,end[ - * @param start - * @param end - * @return - */ - public Sequence subsequence(int start,int end){ - return new SubSequence(this, start,end); - } - /** - * Use this method sparingly as it can be a fairly expensive operation - * @return - */ - public String stringRepresentation(){ - StringBuffer out=new StringBuffer(size()); - for(Character c:get()){ - out.append(c); - } - return out.toString(); - } - -} diff --git a/src/net/sf/jannot/refseq/SubSequence.java b/src/net/sf/jannot/refseq/SubSequence.java deleted file mode 100644 index f6987dd..0000000 --- a/src/net/sf/jannot/refseq/SubSequence.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.refseq; - -/** - * @author Thomas Abeel - * - */ -public class SubSequence extends Sequence { - - private int end; - private int start; - private Sequence seq; - - /** - * @param start - * @param end - */ - public SubSequence(Sequence s, int start, int end) { - this.seq = s; - this.start = start; - this.end = end; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.refseq.Sequence#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - return seq.get(start + this.start, end); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.refseq.Sequence#get() - */ - @Override - public Iterable get() { - return seq.get(this.start, this.end); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.refseq.Sequence#size() - */ - @Override - public int size() { - return end-start; - } - -} diff --git a/src/net/sf/jannot/shortread/BAMreads.java b/src/net/sf/jannot/shortread/BAMreads.java deleted file mode 100644 index a9d40a7..0000000 --- a/src/net/sf/jannot/shortread/BAMreads.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.shortread; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.logging.Logger; - -import net.sf.jannot.Entry; -import net.sf.jannot.Location; -import net.sf.jannot.source.SAMDataSource; -import net.sf.samtools.SAMFileReader; -import net.sf.samtools.SAMRecord; -import net.sf.samtools.SAMFileReader.ValidationStringency; -import net.sf.samtools.util.CloseableIterator; - -/** - * - * @author Thomas Abeel - * - */ -public class BAMreads extends ReadGroup implements Iterable { - - private String key; - - private synchronized Iterable get(Location r) { - return qFast( r); - - } - - /* qFast */ - private List qFastBuffer = new ArrayList(); - private Location qFastBufferLocation = new Location(-5, -5); - private HashMap qFastFirst = new HashMap(); - private HashMap qFastSecond = new HashMap(); - private int qFastMaxPairedLenght; - - private Logger log=Logger.getLogger(BAMreads.class.getCanonicalName()); - - private synchronized Iterable qFast(Location r) { - if (r.start() != qFastBufferLocation.start() || r.end() != qFastBufferLocation.end()) { - qFastBuffer.clear(); - qFastFirst.clear(); - qFastSecond.clear(); - //System.out.println("QFAST"); - int start = r.start() - 500; - int end = r.end() + 500; - CloseableIterator it = cqr.query(key, start, end, false); - if(cqr==null||key==null) - log.warning("NullPointerDetected: key="+key+"\tcqr="+cqr); - while (it.hasNext()) { - try { - SAMRecord tmp = it.next(); - int aStart = tmp.getAlignmentStart(); - int aEnd = tmp.getAlignmentEnd(); - if (aStart == 0 || aEnd == 0) - continue; - if ((aEnd - aStart + 1) > maxLenght) - maxLenght = (aEnd - aStart + 1); - qFastBuffer.add(tmp); - // byte[] seq = tmp.getReadBases(); - // if (complete(seq)) { - // ExtendedShortRead esr = new ExtendedShortRead(tmp); - // qFastBuffer.add(esr); - String name = tmp.getReadName(); - if (ShortReadTools.isPaired(tmp) && tmp.getFirstOfPairFlag()) - qFastFirst.put(name, tmp); - if (ShortReadTools.isPaired(tmp) && tmp.getSecondOfPairFlag()) - qFastSecond.put(name, tmp); - - if (qFastFirst.containsKey(name) && qFastSecond.containsKey(name)) { - int len = Math.max(qFastFirst.get(name).getAlignmentEnd() - - qFastSecond.get(name).getAlignmentStart() + 1, qFastSecond.get(name) - .getAlignmentEnd() - qFastFirst.get(name).getAlignmentStart() + 1); - if (len > qFastMaxPairedLenght) - qFastMaxPairedLenght = len; - } - - } catch (RuntimeException ex) { - System.err.println(key); - - } - } - qFastBufferLocation = r; - it.close(); - } - - return qFastBuffer; - } - - public int getPairLength() { - return qFastMaxPairedLenght; - } - - private int maxLenght = 0; - - @Override - public Iterable get(int start, int end) { - return get(new Location(start, end)); - } - - @Override - public Iterable get() { - return this; - - } - - static class BAMiterator implements CloseableIterator { - private CloseableIterator it; - private int keyIndex; - - public BAMiterator(CloseableIterator in, int key) { - this.keyIndex = key; - it = in; - makeNext(); - } - - @Override - public boolean hasNext() { - if (next == null) - it.close(); - return next != null; - } - - private void makeNext() { - - if (!it.hasNext()) { - next = null; - } else { - boolean found = false; - while (!found) { - try { - SAMRecord tmp = it.next(); - if (tmp == null || tmp.getReferenceIndex() == keyIndex) { - next = tmp; - found = true; - } else { - next = null; - } - } catch (RuntimeException e) { - e.printStackTrace(); - } - } - } - } - - private SAMRecord next = null; - - @Override - public SAMRecord next() { - SAMRecord tmp = next; - makeNext(); - return tmp; - } - - @Override - public void remove() { - throw new UnsupportedOperationException("Remove not supported"); - - } - - @Override - public void close() { - it.close(); - - } - } - - @Override - public Iterator iterator() { - return new BAMiterator(cqr.iterator(), keyIndex); - } - - public String label() { - return source.getSourceKey().toString(); - } - - private CachingQueryReader cqr; - private int keyIndex; - private SAMDataSource source; - - private static final Logger logger = Logger.getLogger(BAMreads.class.getCanonicalName()); - - public BAMreads(SAMDataSource source, String key) { - this.source = source; - SAMFileReader.setDefaultValidationStringency(ValidationStringency.SILENT); - this.keyIndex = source.getReader().getFileHeader().getSequenceIndex(key.toString()); - cqr = CachingQueryReader.create(source); - this.key = key; - - } - - public String getKey() { - return key; - } - - @Override - public int readLength() { - return maxLenght; - } - - /* - * (non-Javadoc) - * - * @see - * net.sf.jannot.shortread.ReadGroup#getSecondRead(net.sf.samtools.SAMRecord - * ) - */ - @Override - public SAMRecord getSecondRead(SAMRecord one) { - return qFastSecond.get(one.getReadName()); - } - - /* - * (non-Javadoc) - * - * @see - * net.sf.jannot.shortread.ReadGroup#getSecondRead(net.sf.samtools.SAMRecord - * ) - */ - @Override - public SAMRecord getFirstRead(SAMRecord second) { - return qFastFirst.get(second.getReadName()); - } -} diff --git a/src/net/sf/jannot/shortread/BasicShortRead.java b/src/net/sf/jannot/shortread/BasicShortRead.java deleted file mode 100644 index d8a0aad..0000000 --- a/src/net/sf/jannot/shortread/BasicShortRead.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.shortread; - -import net.sf.jannot.Strand; -/** - * - * @author Thomas Abeel - * - */ -public class BasicShortRead extends ShortRead { - - - /* - * This contains the start coordinate of the short read. Also the - * orientation is encoded in this value. - * - * The coordinate is one based - * - * Negative values indicate reverse strand, positive ones forward strand - */ - private int mapStart; - /* Length of the short read */ - private short length; - - private byte[] seq; - - public BasicShortRead(char[] seq, int mapStart, boolean forward) { - byte[] tmp = new byte[seq.length]; - for (int i = 0; i < seq.length; i++) - tmp[i] = (byte) seq[i]; - init(tmp, mapStart, forward); - } - - public BasicShortRead(byte[] seq, int mapStart, boolean forward) { - init(seq, mapStart, forward); - } - - private void init(byte[] seq, int mapStart, boolean forward) { - if (forward) - this.mapStart = mapStart; - else - this.mapStart = -mapStart; - - if (seq == null) { - this.seq = null; - this.length = 0; - return; - } - if (seq.length > Short.MAX_VALUE) - throw new RuntimeException("Short reads should be shorter than "+Short.MAX_VALUE+" nucleotides"); - length = (short) seq.length; - /* Convert sequence to byte[] */ - this.seq = new byte[(int) Math.ceil(seq.length / 4.0)]; - for (int i = 0; i < seq.length; i++) { - byte c = seq[i]; - byte bc = encode(c); - byte bc2 = (byte) (bc << (i % 4) * 2); - this.seq[i / 4] |= bc2; - // System.out.println("adding: " + c + "\t" + - // Integer.toBinaryString(0xFF & bc) + "\t" + - // Integer.toBinaryString(0xFF & bc2) + "\t" + - // Integer.toBinaryString(0xFF & this.seq[i / 4])); - } - } - - /* - * These should be one-based coordinates - */ - public char getNucleotide(int pos) { - return nuc(pos); - } - - final private char nuc(int pos) { - if (pos > length) { - throw new RuntimeException("Position outside this read length: pos=" + pos + "; length=" + length); - } else { - /* One based coordinate, correct for it! */ - pos--; - byte b = this.seq[pos / 4]; - int mask = (3 << (pos % 4) * 2); - int b2 = (b & mask); - int b3 = (b2 >>> (pos % 4) * 2); - // System.out.println("decoding: " + (pos+1) + "\t" + - // Integer.toBinaryString(0xFF & b) + "\t" + - // Integer.toBinaryString(0xFF & mask) + "\t" + - // Integer.toBinaryString(0xFF & b2) + "\t" + - // Integer.toBinaryString(0xFF & b3)); - return decode((byte) b3); - } - } - - private char decode(byte b) { - switch (b) { - case 0: - return 'A'; - case 1: - return 'C'; - - case 2: - return 'G'; - case 3: - return 'T'; - } - throw new RuntimeException("Unknown byte value for decoding: " + b); - } - - private byte encode(byte c) { - switch (c) { - case 'a': - case 'A': - return 0; - case 'c': - case 'C': - return 1; - case 'g': - case 'G': - return 2; - case 't': - case 'T': - return 3; - } - throw new RuntimeException("Unknown character for encoding: " + (char)c); - } - - - - - public int start() { - return Math.abs(mapStart); - } - - public int end() { - return start() + length - 1; - } - - public Strand strand() { - if (mapStart < 0) { - return Strand.REVERSE; - } else - return Strand.FORWARD; - } - - public int length() { - return length; - } - - // @Override - // public String toString() { - // - // } - -} - diff --git a/src/net/sf/jannot/shortread/CachingQueryReader.java b/src/net/sf/jannot/shortread/CachingQueryReader.java deleted file mode 100644 index e0861ff..0000000 --- a/src/net/sf/jannot/shortread/CachingQueryReader.java +++ /dev/null @@ -1,360 +0,0 @@ -/** - * %HEADER% - */ -/* - * The Broad Institute - * SOFTWARE COPYRIGHT NOTICE AGREEMENT - * This is copyright (2007-2009) by the Broad Institute/Massachusetts Institute - * of Technology. It is licensed to You under the Gnu Public License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.opensource.org/licenses/gpl-2.0.php - * - * This software is supplied without any warranty or guaranteed support - * whatsoever. Neither the Broad Institute nor MIT can be responsible for its - * use, misuse, or functionality. - */ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package net.sf.jannot.shortread; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.WeakHashMap; -import java.util.logging.Logger; - -import net.sf.jannot.source.SAMDataSource; -import net.sf.samtools.SAMRecord; -import net.sf.samtools.util.CloseableIterator; -import be.abeel.util.LRUCache; - -/** - * A wrapper for {@link SAMDataSource} that supports query by interval and is - * cached - * - * @author jrobinso - * @author Thomas Abeel - */ -public class CachingQueryReader { - - private static Logger log = Logger.getLogger(CachingQueryReader.class.getCanonicalName()); - private String cachedChr = ""; - private static int maxTileCount = 30; - private int tileSize = 8000; - private SAMDataSource ds; - private LRUCache cache; - - private static WeakHashMap wmap = new WeakHashMap(); - - public static CachingQueryReader create(SAMDataSource ds) { - if (wmap.get(ds) == null) - wmap.put(ds, new CachingQueryReader(ds)); - return wmap.get(ds); - } - - private CachingQueryReader(SAMDataSource ds) { - this.ds = ds; - cache = new LRUCache(maxTileCount); - } - - // - - public CloseableIterator iterator() { - return ds.getReader().iterator(); - } - - private EmptyIterator empty = new EmptyIterator(); - - public CloseableIterator query(String sequence, int start, int end, boolean contained) { - - int startTile = (start + 1) / getTileSize(sequence); - int endTile = end / getTileSize(sequence); // <= inclusive - List tiles = getTiles(sequence, startTile, endTile); - - if (tiles.size() == 0) { - return empty; - } - - // Count total # of records - int recordCount = tiles.get(0).getOverlappingRecords().size(); - for (Tile t : tiles) { - recordCount += t.getContainedRecords().size(); - } - - List alignments = new ArrayList(recordCount); - alignments.addAll(tiles.get(0).getOverlappingRecords()); - for (Tile t : tiles) { - alignments.addAll(t.getContainedRecords()); - } - return new TiledIterator(start, end, alignments); - } - - private List getTiles(String seq, int startTile, int endTile) { - - if (!seq.equals(cachedChr)) { - cache = new LRUCache(maxTileCount); - cachedChr = seq; - } - - List tiles = new ArrayList(endTile - startTile + 1); - List tilesToLoad = new ArrayList(endTile - startTile + 1); - - int tileSize = getTileSize(seq); - for (int t = startTile; t <= endTile; t++) { - Tile tile = cache.get(t); - - if (tile == null) { - int start = t * tileSize; - int end = start + tileSize; - - tile = new Tile(t, start, end); - cache.put(t, tile); - } - - tiles.add(tile); - - // The current tile is loaded, load any preceding tiles we have - // pending - if (tile.isLoaded()) { - if (tilesToLoad.size() > 0) { - loadTiles(seq, tilesToLoad); - } - tilesToLoad.clear(); - } else { - tilesToLoad.add(tile); - } - } - - if (tilesToLoad.size() > 0) { - loadTiles(seq, tilesToLoad); - } - - return tiles; - } - - private void loadTiles(String seq, List tiles) { - - int start = tiles.get(0).start; - int end = tiles.get(tiles.size() - 1).end; - CloseableIterator iter = null; - - // log.debug("Loading : " + start + " - " + end); - int alignmentCount = 0; - // long t0 = System.currentTimeMillis(); - try { - iter = ds.getReader().query(seq, start, end, false); - - int tileSize = getTileSize(seq); - while (iter.hasNext()) { - SAMRecord record = iter.next(); - - // Range of tile indices that this alignment contributes to. - int aStart = record.getAlignmentStart(); - int aEnd = record.getAlignmentEnd();// record.getEnd(); - int idx0 = Math.max(0, (aStart - start) / tileSize); - int idx1 = Math.min(tiles.size() - 1, (record.getAlignmentEnd() - start) / tileSize); - - // Loop over tiles this read overlaps - for (int i = idx0; i <= idx1; i++) { - Tile t = tiles.get(i); - // FIXME aEnd??? - if ((aStart >= t.start) && (aStart < t.end)) { - t.containedRecords.add(record); - } else if ((aEnd >= t.start) && (aStart < t.start)) { - t.overlappingRecords.add(record); - } - } - - alignmentCount++; -// if (alignmentCount % 5000 == 0) { -// // IGVMainFrame.getInstance().setStatusBarMessage("Reads loaded: " -// // + alignmentCount); -// } - } - - for (Tile t : tiles) { - t.setLoaded(true); - } - - // double dt = (System.currentTimeMillis() - t0) / 1000.0; - // log.debug("Loaded " + alignmentCount + " in " + dt); - - } finally { - if (iter != null) { - iter.close(); - } - // IGVMainFrame.getInstance().resetStatusMessage(); - } - } - - /** - * @return the tileSize - */ - public int getTileSize(String chr) { - if (chr.equals("M") || chr.equals("chrM") || chr.equals("MT") || chr.equals("chrMT")) { - return 100; - } else { - return tileSize; - } - } - - static class Tile { - - private boolean loaded = false; - private List containedRecords; - private int end; - private List overlappingRecords; - private int start; - private int tileNumber; - - Tile(int tileNumber, int start, int end) { - this.tileNumber = tileNumber; - this.start = start; - this.end = end; - containedRecords = new ArrayList(16000); - overlappingRecords = new ArrayList(); - } - - /** - * @return the tileNumber - */ - public int getTileNumber() { - return tileNumber; - } - - /** - * @param tileNumber - * the tileNumber to set - */ - public void setTileNumber(int tileNumber) { - this.tileNumber = tileNumber; - } - - /** - * @return the start - */ - public int getStart() { - return start; - } - - /** - * @param start - * the start to set - */ - public void setStart(int start) { - this.start = start; - } - - /** - * @return the containedRecords - */ - public List getContainedRecords() { - return containedRecords; - } - - /** - * @param containedRecords - * the containedRecords to set - */ - public void setContainedRecords(List containedRecords) { - this.containedRecords = containedRecords; - } - - /** - * @return the overlappingRecords - */ - public List getOverlappingRecords() { - return overlappingRecords; - } - - /** - * @param overlappingRecords - * the overlappingRecords to set - */ - public void setOverlappingRecords(List overlappingRecords) { - this.overlappingRecords = overlappingRecords; - } - - /** - * @return the loaded - */ - public boolean isLoaded() { - return loaded; - } - - /** - * @param loaded - * the loaded to set - */ - public void setLoaded(boolean loaded) { - this.loaded = loaded; - } - } - - public class TiledIterator implements CloseableIterator { - - int tileIdx = 0; - Iterator currentSamIterator; - int end; - SAMRecord nextRecord; - int start; - List alignments; - - TiledIterator(int start, int end, List alignments) { - this.alignments = alignments; - this.start = start; - this.end = end; - currentSamIterator = alignments.iterator(); - advanceToFirstRecord(); - } - - public void close() { - // No-op - } - - public boolean hasNext() { - return nextRecord != null; - } - - public SAMRecord next() { - SAMRecord ret = nextRecord; - - advanceToNextRecord(); - - return ret; - } - - public void remove() { - // ignored - } - - private void advanceToFirstRecord() { - advanceToNextRecord(); - } - - private void advanceToNextRecord() { - advance(); - - while ((nextRecord != null) && (nextRecord.getAlignmentEnd() < start)) { - advance(); - } - } - - private void advance() { - if (currentSamIterator.hasNext()) { - nextRecord = currentSamIterator.next(); - if (nextRecord.getAlignmentStart() > end) { - nextRecord = null; - } - } else { - nextRecord = null; - } - } - } -} -// ~ Formatted by Jindent --- http://www.jindent.com - diff --git a/src/net/sf/jannot/shortread/EmptyIterator.java b/src/net/sf/jannot/shortread/EmptyIterator.java deleted file mode 100644 index 8e9b9cb..0000000 --- a/src/net/sf/jannot/shortread/EmptyIterator.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.shortread; - -import net.sf.samtools.util.CloseableIterator; -/** - * - * @author Thomas Abeel - * - * @param - */ -public class EmptyIterator implements CloseableIterator { - - public EmptyIterator() { - } - - public void close() { - // ignore - } - - public boolean hasNext() { - return false; - } - - public T next() { - return null; - } - - public void remove() { - // ignore - } -} diff --git a/src/net/sf/jannot/shortread/MemoryReadSet.java b/src/net/sf/jannot/shortread/MemoryReadSet.java deleted file mode 100644 index 1ded296..0000000 --- a/src/net/sf/jannot/shortread/MemoryReadSet.java +++ /dev/null @@ -1,218 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.shortread; - -import java.util.ArrayList; -import java.util.ConcurrentModificationException; -import java.util.HashMap; -import java.util.SortedSet; -import java.util.TreeSet; - -import net.sf.jannot.Data; -import net.sf.jannot.Location; -import net.sf.samtools.SAMRecord; -import be.abeel.util.FrequencyMap; - -/** - * - * @author Thomas Abeel - * - */ -public class MemoryReadSet extends ReadGroup { - - public String label(){ - return "Memory readset"; - } - - private SortedSet set = new TreeSet(); - private int maxPos = 0; - - private int maxLength = 0; - - /* Maps for paired reads, these will be empty for non-paired data sets */ - private HashMap first = new HashMap(); - private HashMap second = new HashMap(); - private int maxPairedLenght; - - private FrequencyMap fm = new FrequencyMap(); - - private void addQuiet(SAMRecord g) { - set.add(g); - if (g.getAlignmentEnd() > maxPos) - maxPos = g.getAlignmentEnd(); - if ((g.getAlignmentEnd()-g.getAlignmentStart()+1) > maxLength) - maxLength = (g.getAlignmentEnd()-g.getAlignmentStart()+1); - /* Keep track of paired reads */ -// if (g instanceof ShortReadTools) { -// ShortReadTools esr = (ShortReadTools) g; -// String name = esr.record().getReadName(); -// if (esr.isPaired() && esr.isFirstInPair()) { -// first.put(name, esr); -// if (second.containsKey(name)) { -// int len = Math.max(first.get(name).end() - second.get(name).start() + 1, second.get(name).end() -// - first.get(name).start() + 1); -// fm.count(len); -// if (len > maxPairedLenght) -// maxPairedLenght = len; -// } -// } -// if (esr.isPaired() && esr.isSecondInPair()) { -// -// second.put(name, esr); -// if (first.containsKey(name)) { -// int len = Math.max(first.get(name).end() - second.get(name).start() + 1, second.get(name).end() -// - first.get(name).start() + 1); -// fm.count(len); -// if (len > maxPairedLenght) -// maxPairedLenght = len; -// } -// -// } -// } - - // updatePileup(g); - } - - // @Override - public void add(SAMRecord g) { - addQuiet(g); - // setChanged(); - // notifyObservers(); - } - - // @Override - public void addAll(Data t) { - - for (SAMRecord s : t.get()) { - add(s); - } - - } - - // @Override - // public void addAll(Iterable list) { - // for (ShortRead sr : list) { - // addQuiet(sr); - // } - // setChanged(); - // notifyObservers(); - // } - - // private void updatePileup(ShortRead sr) { - // if (pileupForward.size() <= sr.end()) { - // pileupForward.setSize(sr.end() + 1); - // pileupReverse.setSize(sr.end() + 1); - // } - // for (int i = sr.start() - 1; i < sr.end(); i++) { - // if (sr.strand() == Strand.FORWARD) { - // int val = pileupForward.get(i) + 1; - // pileupForward.set(i, val); - // - // } else { - // int val = pileupReverse.get(i) + 1; - // pileupReverse.set(i, val); - // - // } - // int pile = pileupForward.get(i) + pileupReverse.get(i); - // if (pile > maxPile) - // maxPile = pile; - // } - // - // } - - // @Override - private Iterable get(Location l) { - try { - return set;//.subSet(ShortRead.getQuery(l.start() - maxLength), ShortRead.getQuery(l.end() + maxLength)); - } catch (ConcurrentModificationException e) { - return new ArrayList(); - } - } - - public int size() { - return set.size(); - } - - // @Override - // public List getAll() { - // return new ArrayList(set); - // } - - // @Override - // public Iterator iterator() { - // return set.iterator(); - // } - -// @Override -// protected int maxPos() { -// return maxPos; -// } - - @Override - public int readLength() { - return maxLength; - } - - public void clear() { - set.clear(); - maxLength = 0; - maxPos = 0; - // maxPile = 0; - // setChanged(); - // notifyObservers(); - - } - -// public ShortReadTools getSecond(ShortReadTools sr) { -// return second.get(sr.record().getReadName()); -// } -// -// public ShortReadTools getFirst(ShortReadTools sr) { -// return first.get(sr.record().getReadName()); -// } - - public int getPairLength() { - return maxPairedLenght; - - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - return get(new Location(start, end)); - } - - @Override - public Iterable get() { - return set; - } - - /* (non-Javadoc) - * @see net.sf.jannot.shortread.ReadGroup#getSecondRead(net.sf.samtools.SAMRecord) - */ - @Override - public SAMRecord getSecondRead(SAMRecord one) { - - //XXX This is broken - //FIXME This is broken - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see net.sf.jannot.shortread.ReadGroup#getSecondRead(net.sf.samtools.SAMRecord) - */ - @Override - public SAMRecord getFirstRead(SAMRecord one) { - - //XXX This is broken - //FIXME This is broken - // TODO Auto-generated method stub - return null; - } -} \ No newline at end of file diff --git a/src/net/sf/jannot/shortread/ReadGroup.java b/src/net/sf/jannot/shortread/ReadGroup.java deleted file mode 100644 index 65b9dcb..0000000 --- a/src/net/sf/jannot/shortread/ReadGroup.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.shortread; - -import net.sf.jannot.Data; -import net.sf.samtools.SAMRecord; - -/** - * - * @author Thomas Abeel - * - */ -public abstract class ReadGroup implements Data { - - /** - * Returns the maximum length of a read. In case this information is not - * available, it is sufficient to return the maximum length so far - * encountered in the get() or get(start,end) queries. - */ - public abstract int readLength(); - - /** - * - * Get the second read in a mate-pair. - * - * @param one - * the read for which to find the mate - * @return the mate - */ - public abstract SAMRecord getSecondRead(SAMRecord one); - - /** - * Returns the maximum length of a pair of reads. - * - * The length of a pair is defined as the distance between the start of the - * first read and the end of the second. - * - * In case this information is not available, it is sufficient to return the - * maximum pair length so far encountered in the get() or get(start,end) - * queries. - */ - public abstract int getPairLength(); - - public boolean canSave() { - return false; - } - - /** - * @param second - * @return - */ - public abstract SAMRecord getFirstRead(SAMRecord second) ; - -} diff --git a/src/net/sf/jannot/shortread/ShortRead.java b/src/net/sf/jannot/shortread/ShortRead.java deleted file mode 100644 index 1ed6f18..0000000 --- a/src/net/sf/jannot/shortread/ShortRead.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.shortread; - -import net.sf.jannot.Strand; -/** - * - * @author Thomas Abeel - * - */ -public abstract class ShortRead implements Comparable { - - public static ShortRead getQuery(int pos) { - return new BasicShortRead(new byte[0], pos, true); - } - - /* - * These should be one-based coordinates - */ - public abstract char getNucleotide(int pos); - - @Override - public int compareTo(ShortRead o) { - if (this == o) - return 0; - int comp = new Integer(this.start()).compareTo(new Integer(o.start())); - if (comp == 0) - comp++; - return comp; - } - - @Override - public boolean equals(Object obj) { - return this == obj; - } - - public abstract int start(); - - public abstract int end(); - - public abstract Strand strand(); - - public abstract int length(); - - // @Override - // public String toString() { - // - // } - - public boolean isFirstInPair() { - return true; - } - - - - public boolean isPaired() { - return false; - } -} diff --git a/src/net/sf/jannot/shortread/ShortReadTools.java b/src/net/sf/jannot/shortread/ShortReadTools.java deleted file mode 100644 index 603b5a6..0000000 --- a/src/net/sf/jannot/shortread/ShortReadTools.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.shortread; - -import java.util.Arrays; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.jannot.Strand; -import net.sf.samtools.Cigar; -import net.sf.samtools.CigarElement; -import net.sf.samtools.CigarOperator; -import net.sf.samtools.SAMRecord; - -/** - * - * @author Thomas Abeel - * - */ -public class ShortReadTools { - - public static int length(SAMRecord sr) { - return sr.getAlignmentEnd() - start(sr) + 1; - } - - public static boolean isSecondInPair(SAMRecord sr) { - return !isFirstInPair(sr); - } - - /** - * Returns nucleotide in the aligned read; - */ - @Deprecated - public static char getNucleotide(SAMRecord sr, int pos) { - byte[] construct = null; - construct = construct(sr); - return (char) construct[pos - 1]; - - } - - private static Logger log = Logger.getLogger(ShortReadTools.class.getCanonicalName()); - - public static byte[] construct(SAMRecord sr) { - int pos = 0; - int superPos = 0; - byte[] out = new byte[length(sr)]; - byte[] readBases = sr.getReadBases(); - try { - for (CigarElement ce : sr.getCigar().getCigarElements()) { - CigarOperator co = ce.getOperator(); - for (int i = 0; i < ce.getLength(); i++) { - switch (co) { - case I: - superPos++; - // System.out.println("I: "+pos); - break; - case N: - out[pos++] = '_'; - break; - case D: - // System.out.println("D: "+pos); - out[pos++] = '-'; - break; - case M: - - /* Bases are present */ - if(readBases.length>0){ - assert pos < out.length; - assert superPos < readBases.length; - out[pos] = readBases[superPos]; - }else - out[pos] = 'M'; - pos++; - superPos++; - break; - case S: - //out[pos] = readBases[superPos]; - //pos++; - superPos++; - break; - case H: - i++; - break; - default: - System.err.println("def: " + co + "\t" + pos + "\t" + superPos + "\t" + out[pos]); - break; - - } - } - } - } catch (IndexOutOfBoundsException ex) { - log.severe("Read bases: " + new String(readBases)+" len: "+readBases.length); - log.severe("Cigar string: " + sr.getCigarString()); - log.log(Level.SEVERE, "Could not get sequence for read", ex); - - } - - return out; - } - - public static int end(SAMRecord sr) { - return sr.getAlignmentEnd(); - } - - public static boolean isFirstInPair(SAMRecord sr) { - return isPaired(sr) ? sr.getFirstOfPairFlag() : true; - } - - public static boolean isPaired(SAMRecord sr) { - return sr.getReadPairedFlag(); - } - - public static int start(SAMRecord sr) { - return sr.getAlignmentStart(); - } - - public static Strand strand(SAMRecord sr) { - return sr.getReadNegativeStrandFlag() ? Strand.REVERSE : Strand.FORWARD; - } - -} diff --git a/src/net/sf/jannot/source/AbstractStreamDataSource.java b/src/net/sf/jannot/source/AbstractStreamDataSource.java deleted file mode 100644 index 9f3c8dd..0000000 --- a/src/net/sf/jannot/source/AbstractStreamDataSource.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source; - -import java.io.InputStream; - -import net.sf.jannot.EntrySet; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.parser.Parser; - -/** - * Extends DataSource. - * - * Contains methods to read - * - * @author Thomas Abeel - * - */ -public abstract class AbstractStreamDataSource extends DataSource { - private Parser parser; - - private InputStream ios; - - public final void setParser(Parser parser) { - this.parser = parser; - } - - public final void setIos(InputStream ios) { - this.ios = ios; - } - - protected AbstractStreamDataSource(Locator l) { -super(l); - } - - /** - * - */ - @Override - public EntrySet read(EntrySet set) throws ReadFailedException { - return parser.parse(ios,set); - - - } - - public InputStream getIos(){ - return ios; - } - - public Parser getParser() { - return parser; - } -} diff --git a/src/net/sf/jannot/source/DataSource.java b/src/net/sf/jannot/source/DataSource.java deleted file mode 100644 index 443453c..0000000 --- a/src/net/sf/jannot/source/DataSource.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source; - -import java.io.File; -import java.io.IOException; -import java.net.URL; - -import net.sf.jannot.EntrySet; -import net.sf.jannot.exception.ReadFailedException; - -/** - * - * @author Thomas Abeel - * - */ -public abstract class DataSource implements Comparable { - - protected Locator locator=null; - - protected DataSource(Locator l){ - this.locator=l; - } - - @Override - public int compareTo(DataSource o) { - return this.toString().compareTo(o.toString()); - } - - public EntrySet read() throws ReadFailedException { - return read(null); - } - - public abstract EntrySet read(EntrySet add) throws ReadFailedException; - - public abstract boolean isIndexed(); - - public abstract long size(); - - protected static long size(URL url, File file) { - long size = 0; - if (url != null) - try { - size = url.openConnection().getContentLength(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if (file != null) - size = file.length(); - - return size; - - } - - public Locator getLocator(){ - return locator; - } -} diff --git a/src/net/sf/jannot/source/DataSourceFactory.java b/src/net/sf/jannot/source/DataSourceFactory.java deleted file mode 100644 index d053cc5..0000000 --- a/src/net/sf/jannot/source/DataSourceFactory.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.logging.Logger; - -import net.sf.jannot.bigwig.BigWigDataSource; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.source.cache.CachedURLSource; -import net.sf.jannot.tabix.IndexedFeatureFile; -import net.sf.jannot.tdf.TDFDataSource; - -/** - * - * @author Thomas Abeel - * - */ -public class DataSourceFactory { - private static Logger log = Logger.getLogger(DataSourceFactory.class.getCanonicalName()); - - public enum Sources { - LOCALFILE, URL;// , DAS; - @Override - public String toString() { - switch (this) { - case URL: - return "URL"; - case LOCALFILE: - return "Local file"; - // case DIRECTORY: - // return "Directory"; - // case DAS: - // return "DAS server"; - } - return null; - } - } - - public static boolean disableURLCaching = true; - - public static DataSource create(Locator locator) throws URISyntaxException, IOException, ReadFailedException { - return create(locator,null); - - } - - public static DataSource create(Locator data, Locator index) throws URISyntaxException, IOException, - ReadFailedException { - log.info("Data: " + data); - log.info("Index: " + index); - if (data.isURL()) { - SSL.certify(data.url()); - } - - if (data.isTDF()) { - return new TDFDataSource(data); - } - - if(data.isBigWig()) - return new BigWigDataSource(data); - - if (index == null) { - log.info("Could not find index"); - if (data.isURL()) { - if (disableURLCaching) { - log.info("Loading as regular URLSource"); - return new URLSource(data.url()); - } else { - log.info("Loading as CachedURLSource"); - return new CachedURLSource(data.url()); - } - } else { - log.info("Loading as FileSource"); - return new FileSource(data.file()); - } - } else { - - if (data.isBAM()) { - return new SAMDataSource(data, index); - } - if (data.isFasta()) - return new IndexedFastaDataSource(data, index); - - if (data.isTabix()) - return new IndexedFeatureFile(data, index); - - if (data.isMaf()) - return new IndexedMAFDataSource(data, index); - } - log.severe("Could not construct data source for \n\t" + data + "\n\t" + index); - return null; - - } - - - - -} diff --git a/src/net/sf/jannot/source/FileSource.java b/src/net/sf/jannot/source/FileSource.java deleted file mode 100644 index d1962fc..0000000 --- a/src/net/sf/jannot/source/FileSource.java +++ /dev/null @@ -1,97 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; - -import net.sf.jannot.parser.Parser; - -/** - * Extends AbstractStreamDataSource. It prepares the data to be read. - * - * @author Thomas Abeel - * - */ -public class FileSource extends AbstractStreamDataSource { - - private File file; - - - - - public FileSource(String file) throws IOException { - this(new File(file)); - } - public File getFile(){ - return file; - } - public FileSource(File file) throws IOException { - super(new Locator(file.toString())); - InputStream ios1, ios2; - ios1 = new FileInputStream(file); - ios2 = new FileInputStream(file); - Parser p = Parser.detectParser(ios1,file); - ios1.close(); - super.setParser(p); - super.setIos(ios2); - this.file = file; - } - -// @Override -// public void saveOwn(EntrySet entries) { -// try { -// int count = 0; -// File bak = new File(file + ".bak." + count++); -// while (infiniteBackups && bak.exists()) { -// bak = new File(file + ".bak." + count); -// } -// file.renameTo(bak); -// -// OutputStream os = new FileOutputStream(file); -// for (Entry e : entries) { -// super.getParser().write(os, e, this); -// } -// os.close(); -// } catch (FileNotFoundException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// -// -// } - - @Override - public String toString() { - if (file.getParentFile() != null) { - return ".../" + file.getParentFile().getName() + "/" - + file.getName().toString(); - } else - return file.getName().toString(); - - } - - /* (non-Javadoc) - * @see net.sf.jannot.source.DataSource#isIndexed() - */ - @Override - public boolean isIndexed() { - return false; - } - - /* (non-Javadoc) - * @see net.sf.jannot.source.DataSource#size() - */ - @Override - public long size() { - return file.length(); - } - - -} diff --git a/src/net/sf/jannot/source/IndexManager.java b/src/net/sf/jannot/source/IndexManager.java deleted file mode 100644 index 4f76c57..0000000 --- a/src/net/sf/jannot/source/IndexManager.java +++ /dev/null @@ -1,190 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.util.logging.Logger; - -import atk.util.MD5Tools; -import net.sf.jannot.indexing.Faidx; -import net.sf.jannot.mafix.MafixFactory; -import net.sf.jannot.tabix.TabixWriter; -import net.sf.jannot.tabix.TabixWriter.Conf; -import net.sf.samtools.BAMIndexer; -import net.sf.samtools.SAMFileHeader; -import net.sf.samtools.SAMFileReader; -import net.sf.samtools.SAMRecord; -import net.sf.samtools.SAMRecordIterator; - -/** - * @author Thomas Abeel - * - */ -public class IndexManager { - private static Logger log = Logger.getLogger(IndexManager.class.getCanonicalName()); - public static File cacheDir = new File(System.getProperty("user.home")+"/.genomeview/index"); - - public static Locator getIndex(Locator locator) { - String postfix = locator.getPostfix(); - if (postfix == null) { - log.info("JAnnot does not know the index format for this locator: " + locator); - } - log.info("Trying to find local index"); - Locator out = findLocalIndex(locator); - if (out == null) { - log.info("Trying to find remote index"); - out = findRemoteIndex(locator); - } - - return out; - - } - - /** - * @param locator - * @param postfix - * @return - */ - private static Locator findRemoteIndex(Locator locator) { - Locator index = new Locator(locator + "." + locator.getPostfix()); - - if (!index.exists()||index.length()==0) - index = null; - - /* Special case handling of bam files */ - if (index == null) { - index = new Locator(locator.toString().substring(0, locator.toString().length() - 4) + "." + locator.getPostfix()); - if (!index.exists()||index.length()==0) - index = null; - } - return index; - } - - /** - * @param locator - * @param postfix - * @return - */ - private static Locator findLocalIndex(Locator locator) { - if (!cacheDir.exists()) - cacheDir.mkdir(); - Locator idx = cacheIndex(locator); - if (!idx.exists()||idx.length()==0) - idx = null; - return idx; - } - - private static Locator cacheIndex(Locator locator) { - return new Locator(cacheDir + "/" + MD5Tools.md5(locator.toString()) + "." + locator.getPostfix()); - } - - /** - * A potentially long-running method that will create an index for the - * provided locator - * - * @param locator - * @throws URISyntaxException - * @throws IOException - * @throws MalformedURLException - */ - public static boolean createIndex(Locator locator) throws MalformedURLException, IOException, URISyntaxException { - log.info("Creating index for "+locator); - if (!cacheDir.exists()) - cacheDir.mkdir(); - - Locator idx = cacheIndex(locator); - - if(!idx.isURL()){ - Locator tmp=new Locator(locator.toString() + "." + locator.getPostfix()); - File f=tmp.file(); - try{ - f.createNewFile(); - }catch(IOException e){ - log.warning("Tried to make index file, failed: "+e); - } - if(f.exists()&&f.canWrite()) - idx=tmp; - - } - - if (idx.exists()) - log.info("Index already exists and will be overwritten!!!"); - - if(locator.isMaf()){ - MafixFactory.generateIndex(locator.stream(), idx.file()); - - } - - if (locator.isBAM()) { - - InputStream ios = locator.stream(); - - SAMFileReader sfr = new SAMFileReader(ios); - sfr.enableFileSource(true); - - SAMFileHeader head = sfr.getFileHeader(); - - File tmpOutput= new File(idx+".tmp"); - BAMIndexer bix = new BAMIndexer(tmpOutput, head); - - SAMRecordIterator sir = sfr.iterator(); - while (sir.hasNext()) { - SAMRecord n = sir.next(); - bix.processAlignment(n); - - } - bix.finish(); - idx.file().delete(); - boolean rename=tmpOutput.renameTo(idx.file()); - log.info("Did rename succeed? "+rename); - System.out.println(rename); - return rename; -// return true; - // public BAMIndexer(final File output, SAMFileHeader fileHeader) { - // - // numReferences = fileHeader.getSequenceDictionary().size(); - // indexBuilder = new BAMIndexBuilder(fileHeader); - // outputWriter = new BinaryBAMIndexWriter(numReferences, output); - // } - - } - - if (locator.isTabix()) { - Conf c = locator.getTabixConfiguration(); - try { - TabixWriter tw = new TabixWriter(locator, c); - - tw.createIndex(idx); - return true; - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - if (locator.isFasta()) { - - Faidx.index(locator, idx); - return true; - } - - return false; - - } - - /** - * @param data - * @return - */ - public static boolean canBuildIndex(Locator data) { - boolean tbx = data.isTabix() && data.isBlockCompressed(); - return data.isBAM() || tbx || (data.isFasta() && !data.isAnyCompressed()) || (data.isMaf() && data.isBlockCompressed()); - } - -} diff --git a/src/net/sf/jannot/source/IndexedFastaDataSource.java b/src/net/sf/jannot/source/IndexedFastaDataSource.java deleted file mode 100644 index cb4b451..0000000 --- a/src/net/sf/jannot/source/IndexedFastaDataSource.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.picard.SeekableFileCachedHTTPStream; -import net.sf.jannot.refseq.FaidxData; -import net.sf.jannot.refseq.FaidxIndex; -import net.sf.samtools.seekablestream.SeekableFileStream; -import net.sf.samtools.seekablestream.SeekableStream; -import be.abeel.net.URIFactory; - -/** - * - * @author Thomas Abeel - * - */ -public class IndexedFastaDataSource extends DataSource { - - private SeekableStream content; - private Locator index; - private Locator data; - - - /** - * @param data - * @param index - * @throws URISyntaxException - * @throws ReadFailedException - * @throws IOException - * @throws MalformedURLException - */ - public IndexedFastaDataSource(Locator data, Locator index) throws MalformedURLException, IOException, - ReadFailedException, URISyntaxException { - super(data); - if (data.isURL()) - content = new SeekableFileCachedHTTPStream(data.url()); - else - content = new SeekableFileStream(data.file()); - this.index = index; - this.data = data; - - } - - @Override - public EntrySet read(EntrySet set) throws ReadFailedException { - if (content == null) - throw new RuntimeException("Boenk!"); - if (set == null) - set = new EntrySet(); - // SAMFileReader inputSam = getReader(); - - InputStream iis = null; - if (index.isURL()) - try { - iis = index.url().openStream(); - } catch (MalformedURLException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - else - try { - iis = new FileInputStream(index.file()); - } catch (FileNotFoundException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - FaidxIndex index = new FaidxIndex(iis); - // SAMSequenceDictionary tmpDic = - // inputSam.getFileHeader().getSequenceDictionary(); - // for (int i = 0; i < tmpDic.size(); i++) { - for (String name : index.names()) { - Entry e = set.getOrCreateEntry(name); - // try { - try { - e.setSequence(new FaidxData(index, content, name)); - } catch (Exception ex) { - System.err.println("Faidx error locator: " + data); - System.err.println("Faidx error index locator: " + index); - throw new ReadFailedException(ex); - - } - } - return set; - } - - @Override - public String toString() { - return content.toString(); - } - - @Override - public void finalize() { - // content.closeAll(); - - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#isIndexed() - */ - @Override - public boolean isIndexed() { - return true; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#size() - */ - @Override - public long size() { - return data.length(); - } - -} diff --git a/src/net/sf/jannot/source/IndexedMAFDataSource.java b/src/net/sf/jannot/source/IndexedMAFDataSource.java deleted file mode 100644 index 40e46bd..0000000 --- a/src/net/sf/jannot/source/IndexedMAFDataSource.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Type; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.mafix.IndexedMAF; -import net.sf.jannot.picard.SeekableFileCachedHTTPStream; -import net.sf.samtools.seekablestream.SeekableFileStream; -import net.sf.samtools.seekablestream.SeekableStream; - - -/** - * @author Thomas Abeel - * @author Thomas Van Parys - * - */ -public class IndexedMAFDataSource extends DataSource { - - private SeekableStream content; - private Locator index; - private Locator data; - - - - /** - * @param data - * @param index - * @throws URISyntaxException - * @throws ReadFailedException - * @throws IOException - * @throws MalformedURLException - */ - public IndexedMAFDataSource(Locator data, Locator index) throws MalformedURLException, IOException, ReadFailedException, URISyntaxException { - super(data); - if (data.isURL()) - content = new SeekableFileCachedHTTPStream(data.url()); - else - content = new SeekableFileStream(data.file()); - this.index = index; - this.data = data; - } - - @Override - public EntrySet read(EntrySet set) throws ReadFailedException { - if (content == null) - throw new RuntimeException("Boenk!"); - if (set == null) - set = new EntrySet(); - // SAMFileReader inputSam = getReader(); - - InputStream iis = null; - if (index.isURL()) - try { - iis = index.url().openStream(); - } catch (MalformedURLException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (URISyntaxException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - else - try { - iis = new FileInputStream(index.file()); - } catch (FileNotFoundException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - - try { - IndexedMAF maf = new IndexedMAF(content, iis); - //System.out.println("Reading MAF: "); - - for (String name : maf.getNames()){ - //System.out.println("Adding individual chroms: "+name); - String[] nameParts = name.split("\\."); - - //the chromosome name is probably the last part - //after the dot - String chrom = nameParts[nameParts.length-1]; - - //if the chrom entry already exists, use that one - //otherwise, use the full name we found in the MAF - Entry e = null; - if (set.getEntry(chrom)!=null){ - e = set.getOrCreateEntry(chrom); - } else { - e = set.getOrCreateEntry(name); - } - IndexedMAF idxMaf=new IndexedMAF(name, maf); - //System.out.println("Adding MAF: "+content+"\t"+idxMaf+"\t"+idxMaf.getClass()); - e.add(Type.get(data.toString()), idxMaf); - } - - } catch (Exception ex) { - log.log(Level.SEVERE,"Mafix error data: " + data+"\n\n"+"Mafix error index: " + index,ex); - throw new ReadFailedException(ex); - - } - return set; - } - private static Logger log=Logger.getLogger(IndexedMAFDataSource.class.getCanonicalName()); - - @Override - public void finalize() { - //content.closeAll(); - - } - - /* (non-Javadoc) - * @see net.sf.jannot.source.DataSource#isIndexed() - */ - @Override - public boolean isIndexed() { - return true; - } - - /* (non-Javadoc) - * @see net.sf.jannot.source.DataSource#size() - */ - @Override - public long size() { - return data.length(); - } - -} diff --git a/src/net/sf/jannot/source/Locator.java b/src/net/sf/jannot/source/Locator.java deleted file mode 100644 index a9a1064..0000000 --- a/src/net/sf/jannot/source/Locator.java +++ /dev/null @@ -1,343 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.net.URLConnection; -import java.util.logging.Logger; - -import net.sf.jannot.tabix.TabixWriter; -import net.sf.jannot.tabix.TabixWriter.Conf; - -import net.sf.samtools.seekablestream.SeekableStream; -import net.sf.samtools.seekablestream.SeekableStreamFactory; -import be.abeel.net.URIFactory; - -/** - * - * Intelligent descriptor of a file. Can either be local or remote on a server. - * Can be indexed or plain. This locator can describe the type of data that is - * in the file. - * - * @author Thomas Abeel - * - */ -public class Locator { - private static Logger log = Logger.getLogger(Locator.class.getCanonicalName()); - private String locator; - private long length = -1; - private boolean exists = false; - private boolean streamCompressed = false; - private boolean blockCompressed = false; - private String ext; - private long lastModified=-1; - - @Override - public String toString() { - return locator; - } - - /** - * Removes the index extension from the file name - */ - public void stripIndex() { - if (locator.endsWith(".mfi") || locator.endsWith(".tbi") - || locator.endsWith(".fai")) { - locator = locator.substring(0, locator.length() - 4); - init(); - } - if(locator.endsWith(".bai")){ - locator = locator.substring(0, locator.length() - 4); - if(!locator.endsWith(".bam")) - locator+=".bam"; - init(); - } - - } - - public Locator(File f){ - this(f.toString()); - } - public Locator(String l) { - if (l.startsWith("file://")){ - l = l.substring(7); - } - this.locator = l.trim(); - init(); - } - - /** - * - */ - private void init() { - String[] arr = locator.toString().toLowerCase().split("\\."); - initExt(arr); - - if (isURL()) { - initURL(); - } else - initFile(); - - } - - public boolean isStreamCompressed() { - return streamCompressed; - } - - public boolean isBlockCompressed() { - return blockCompressed; - } - - /** - * @param arr - */ - private void initExt(String[] arr) { - streamCompressed = false; - blockCompressed = false; - ext = arr[arr.length - 1]; - if (arr[arr.length - 1].equals("bgz")) { - ext = arr[arr.length - 2]; - blockCompressed = true; - } - if (arr[arr.length - 1].equals("gz")) { - ext = arr[arr.length - 2]; - streamCompressed = true; - } - - } - - /** - * - */ - private void initURL() { - try { - log.fine("Checking: " + locator); - URLConnection conn = URIFactory.url(locator).openConnection(); - conn.setUseCaches(false); - log.info(conn.getHeaderFields().toString()); - String header = conn.getHeaderField(null); - if (header.contains("404")) { - log.info("404 file not found: " + locator); - return; - } - if (header.contains("500")) { - log.info("500 server error: " + locator); - return; - } - - if (conn.getContentLength() > 0) { - byte[] buffer = new byte[50]; - - conn.getInputStream().read(buffer); - /* - * This is not supposed to happen, except with badly configured - * CMS that take over - */ - if (new String(buffer).trim().startsWith("= 0 || locator.indexOf('?') >= 0; - - } - - /** - * @return - */ - public boolean isTDF() { - - return ext.equals("tdf"); - } - - public boolean isWig() { - return ext.equals("wig"); - } - - public boolean isBigWig() { - return ext.equals("bw") || ext.equals("bigwig"); - } - - public boolean isTabix() { - return ext.equals("vcf")||ext.equals("gff") || ext.equals("gff3") || ext.equals("bed") || ext.equals("tsv") - || ext.equals("pileup") || ext.equals("swig") || ext.equals("tab"); - - } - - public boolean requiresIndex() { - return (isMaf() && isBlockCompressed()) || isBAM()|| ext.equals("tsv") || ext.equals("pileup") - || ext.equals("swig") || ext.equals("tab"); - } - - public boolean recommendedIndex() { - return requiresIndex() || isFasta() || isMaf(); - } - - public boolean supportsIndex() { - return recommendedIndex() || requiresIndex() ||isVCF()|| ext.equals("gff") || ext.equals("gff3") || ext.equals("bed"); - } - - public boolean isBAM() { - return ext.equals("bam"); - - } - - public boolean isFasta() { - return ext.equals("fasta") || ext.equals("fa") || ext.equals("fas") || ext.equals("con") || ext.equals("fna")|| ext.equals("tfa"); - } - - public boolean isMaf() { - return ext.equals("maf"); - - } - - public boolean isVCF() { - return ext.equals("vcf"); - - } - - public boolean isPileup() { - return ext.equals("pileup"); - } - - - public long lastModified(){ - return lastModified; - } - /** - * @return - */ - public Conf getTabixConfiguration() { - if (!isTabix()) - return null; - if (ext.equals("gff") || ext.equals("gff3")) { - return TabixWriter.GFF_CONF; - } - if (ext.equals("bed")) { - return TabixWriter.BED_CONF; - } - - if(ext.equals("vcf")){ - return TabixWriter.VCF_CONF; - } - Conf out = new Conf(0, 0, 0, 0, '#', 0); - - if (ext.equals("pileup") || ext.equals("swig") || ext.equals("tab") || ext.equals("tsv")) { - out.chrColumn = 1; - out.startColumn = 2; - out.endColumn = 2; - } - - return out; - - } - - /** - * @return - * @throws IOException - * @throws FileNotFoundException - * @throws URISyntaxException - * @throws MalformedURLException - */ - public SeekableStream stream() throws IOException, URISyntaxException { - if (!isURL()) - return SeekableStreamFactory.getInstance().getStreamFor(this.file().toString()); - else - return SeekableStreamFactory.getInstance().getStreamFor(this.url()); - } - - public boolean isAnyCompressed() { - return streamCompressed || blockCompressed; - } - - public String getName() throws MalformedURLException, URISyntaxException { - if (isURL()) { - int slashIndex = url().getPath().lastIndexOf('/'); - return url().getPath().substring(slashIndex + 1); - - } else - return file().getName(); - - } - - -} diff --git a/src/net/sf/jannot/source/SAMDataSource.java b/src/net/sf/jannot/source/SAMDataSource.java deleted file mode 100644 index bea6edf..0000000 --- a/src/net/sf/jannot/source/SAMDataSource.java +++ /dev/null @@ -1,288 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; - -import net.sf.jannot.Cleaner; -import net.sf.jannot.DataKey; -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.picard.SeekableFileCachedHTTPStream; -import net.sf.jannot.shortread.BAMreads; -import net.sf.samtools.SAMFileReader; -import net.sf.samtools.SAMFileReader.ValidationStringency; -import net.sf.samtools.SAMSequenceDictionary; -import net.sf.samtools.SAMSequenceRecord; -import net.sf.samtools.seekablestream.SeekableFileStream; -import net.sf.samtools.seekablestream.SeekableStream; -import be.abeel.net.URIFactory; - -/** - * - * @author Thomas Abeel - * - */ -public class SAMDataSource extends DataSource { - - class SAMKey implements DataKey { - - private String string; - - SAMKey(String file) { - this.string = file; - } - - @Override - public String toString() { - return this.string; - } - - public int compareTo(DataKey o) { - return toString().compareTo(toString()); - } - - @Override - public boolean equals(Object o) { - return toString().equals(o.toString()); - } - - } - - private SeekableStream content; - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((content == null) ? 0 : content.hashCode()); - result = prime * result + ((index == null) ? 0 : index.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - SAMDataSource other = (SAMDataSource) obj; - if (content == null) { - if (other.content != null) - return false; - } else if (!content.equals(other.content)) - return false; - if (index == null) { - if (other.index != null) - return false; - } else if (!index.equals(other.index)) - return false; - return true; - } - - /* File containing the BAM index */ - private File index; - /* Display name for this data */ - private DataKey sourceKey; - - private SAMFileReader sfr = null; - private long size; - - public SAMFileReader getReader() { - // System.out.println(content); - // System.out.println(content.getSource()); - if (sfr == null) { - SAMFileReader.setDefaultValidationStringency(ValidationStringency.SILENT); - System.out.println("SDS: "+content+"\t"+index); - sfr = new SAMFileReader(content, index, false); - Cleaner.register(sfr, content, deleteIndex ? index : null); - - } - return sfr; - // return new SAMFileReader(content, index, false); - - } - - /** - * BAM file URL - * - * @param url - * @throws IOException - * @throws ReadFailedException - * @throws URISyntaxException - */ - private void init(URL url, URL idx) throws IOException, ReadFailedException, URISyntaxException { - setSourceKey(new SAMKey(url.toString())); - /* BAM file */ - // content =new SeekableHTTPStream(url); - content = new SeekableFileCachedHTTPStream(url); - size = url.openConnection().getContentLength(); - - /* Index file */ - File tmpBAI = File.createTempFile("urlbam", ".bai"); - tmpBAI.deleteOnExit(); -// url = URIFactory.url(idx); - copy(idx.openStream(), tmpBAI); - index = tmpBAI; - deleteIndex = true; - - } - - /** - * BAM file URL, index is local - * - * @param url - * @throws IOException - * @throws ReadFailedException - * @throws URISyntaxException - */ - private void init(URL url, File idx) throws IOException, ReadFailedException, URISyntaxException { - setSourceKey(new SAMKey(url.toString())); - /* BAM file */ - // content =new SeekableHTTPStream(url); - content = new SeekableFileCachedHTTPStream(url); - size = url.openConnection().getContentLength(); - - index = idx; - - - } - - private boolean deleteIndex = false; - - private static void copy(InputStream in, File file) throws IOException { - OutputStream out = new FileOutputStream(file); - - byte[] buffer = new byte[100000]; - while (true) { - int amountRead = in.read(buffer); - if (amountRead == -1) { - break; - } - out.write(buffer, 0, amountRead); - - } - out.close(); - - } - - /** - * BAM file - * - * @param file - * @throws IOException - */ - private void init(File file,File index) throws IOException { - setSourceKey(new SAMKey(file.toString())); - size = file.length(); - content = new SeekableFileStream(file); - this.index =index; - } - - /** - * @param data - * @param index2 - */ - public SAMDataSource(Locator data, Locator index) { - super(data); - if (data == null || index == null) - throw new RuntimeException("Either data or index are not provided: " + data + "; " + index); - if (data.isURL()) { - try { - if(index.isURL()) - init(data.url(), index.url()); - else - init(data.url(), index.file()); - } catch (MalformedURLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ReadFailedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } else { - try { - init(data.file(),index.file()); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - } - - @Override - public EntrySet read(EntrySet set) throws ReadFailedException { - if (set == null) - set = new EntrySet(); - SAMFileReader inputSam = getReader(); - - SAMSequenceDictionary tmpDic = inputSam.getFileHeader().getSequenceDictionary(); - for (int i = 0; i < tmpDic.size(); i++) { - SAMSequenceRecord org = inputSam.getFileHeader().getSequence(i); - Entry e = set.getOrCreateEntry(org.getSequenceName()); - e.add(getSourceKey(), new BAMreads(this, org.getSequenceName())); - // e.shortReads.add(this, new BAMreads(this, e)); - - } - return set; - } - - @Override - public String toString() { - return content.toString(); - } - - @Override - public void finalize() { - sfr.close(); - if (content instanceof SeekableFileCachedHTTPStream) - ((SeekableFileCachedHTTPStream) content).closeAll(); - - } - - private void setSourceKey(DataKey sourceKey) { - this.sourceKey = sourceKey; - } - - public DataKey getSourceKey() { - return sourceKey; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#isIndexed() - */ - @Override - public boolean isIndexed() { - return true; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#size() - */ - @Override - public long size() { - return size; - } - -} diff --git a/src/net/sf/jannot/source/SSL.java b/src/net/sf/jannot/source/SSL.java deleted file mode 100644 index 81378dc..0000000 --- a/src/net/sf/jannot/source/SSL.java +++ /dev/null @@ -1,152 +0,0 @@ -package net.sf.jannot.source; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URL; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; -import java.security.cert.X509Certificate; -import java.util.Properties; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLException; -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManager; -import javax.net.ssl.TrustManagerFactory; -import javax.net.ssl.X509TrustManager; - -public class SSL { - public static void certify(URL url) { - if (url.toString().startsWith("https://")) { - System.out.println("Using SSL."); - try { - addCertificate(url); - Properties systemProps = System.getProperties(); - systemProps.put("javax.net.ssl.trustStore", certFile); - System.setProperties(systemProps); - } catch (Exception e) { - e.printStackTrace(); - System.err.println("Something went wrong while installing the certificate"); - } - } - } - - private static void addCertificate(URL url) throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException, KeyManagementException { - String host = url.getHost(); - int port = 443; - char[] passphrase = "changeit".toCharArray(); - - File file = new File(certFile); - if (file.isFile() == false) { - char SEP = File.separatorChar; - File dir = new File(System.getProperty("java.home") + SEP + "lib" + SEP + "security"); - file = new File(dir, "jssecacerts"); - if (file.isFile() == false) { - file = new File(dir, "cacerts"); - } - } - System.out.println("Loading KeyStore " + file + "..."); - InputStream in = new FileInputStream(file); - KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); - ks.load(in, passphrase); - in.close(); - - SSLContext context = SSLContext.getInstance("TLS"); - TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - tmf.init(ks); - X509TrustManager defaultTrustManager = (X509TrustManager) tmf.getTrustManagers()[0]; - SavingTrustManager tm = new SavingTrustManager(defaultTrustManager); - context.init(null, new TrustManager[] { tm }, null); - SSLSocketFactory factory = context.getSocketFactory(); - - System.out.println("Opening connection to " + host + ":" + port + "..."); - SSLSocket socket = (SSLSocket) factory.createSocket(host, port); - socket.setSoTimeout(10000); - try { - System.out.println("Checking for existing certificate..."); - socket.startHandshake(); - socket.close(); - } catch (SSLException e) { - // Ignore, we don't have the required certificate and will install - // it now. - } - - X509Certificate[] chain = tm.chain; - if (chain == null) { - System.out.println("Could not obtain server certificate chain"); - return; - } - - MessageDigest sha1 = MessageDigest.getInstance("SHA1"); - MessageDigest md5 = MessageDigest.getInstance("MD5"); - for (int i = 0; i < chain.length; i++) { - X509Certificate cert = chain[i]; - System.out.println(" " + (i + 1) + " Subject " + cert.getSubjectDN()); - System.out.println(" Issuer " + cert.getIssuerDN()); - sha1.update(cert.getEncoded()); - System.out.println(" sha1 " + toHexString(sha1.digest())); - md5.update(cert.getEncoded()); - System.out.println(" md5 " + toHexString(md5.digest())); - System.out.println(); - } - - /* Store certificates */ - System.out.println("Storing certificates"); - int index = 0; - for (X509Certificate cert : chain) { - String alias = host + "-" + index++; - ks.setCertificateEntry(alias, cert); - - } - OutputStream out = new FileOutputStream(certFile); - ks.store(out, passphrase); - out.close(); - - } - - private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray(); - private final static String certFile = "tmpcacert"; - - private static String toHexString(byte[] bytes) { - StringBuilder sb = new StringBuilder(bytes.length * 3); - for (int b : bytes) { - b &= 0xff; - sb.append(HEXDIGITS[b >> 4]); - sb.append(HEXDIGITS[b & 15]); - sb.append(' '); - } - return sb.toString(); - } - - private static class SavingTrustManager implements X509TrustManager { - - private final X509TrustManager tm; - private X509Certificate[] chain; - - SavingTrustManager(X509TrustManager tm) { - this.tm = tm; - } - - public X509Certificate[] getAcceptedIssuers() { - throw new UnsupportedOperationException(); - } - - public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { - throw new UnsupportedOperationException(); - } - - public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { - this.chain = chain; - tm.checkServerTrusted(chain, authType); - } - } -} diff --git a/src/net/sf/jannot/source/URLSource.java b/src/net/sf/jannot/source/URLSource.java deleted file mode 100644 index 5f3d034..0000000 --- a/src/net/sf/jannot/source/URLSource.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.PushbackInputStream; -import java.net.MalformedURLException; -import java.net.URL; - -import net.sf.jannot.parser.Parser; -/** - * - * @author Thomas Abeel - * - */ -public class URLSource extends AbstractStreamDataSource { - - protected URL url; - - /* - * Only for use by subclasses. The extra object is only to distinguish - * constructors and is ignored - */ - protected URLSource(URL url, Object x) throws IOException { - super(new Locator(url.toString())); - this.url = url; - } - - private void init() throws MalformedURLException, IOException { - PushbackInputStream pis=new PushbackInputStream(url.openStream(), 16*1024); - byte[]buffer=new byte[16*1024]; - int i=pis.read(buffer); - super.setParser(Parser.detectParser(new ByteArrayInputStream(buffer,0,i),url)); - pis.unread(buffer,0,i); - super.setIos(pis); - - } - - public URLSource(URL url) throws IOException { - this(url, null); - SSL.certify(url); - init(); - - } - -// @Override -// public void saveOwn(EntrySet entries) throws SaveFailedException { -// try { -// System.out.println(url.getProtocol() + "://" + url.getHost() + url.getPath()); -// url = new URL(url.getProtocol() + "://" + url.getHost() + url.getPath()); -// File tmp = File.createTempFile("GenomeView", "save"); -// tmp.deleteOnExit(); -// OutputStream os = new FileOutputStream(tmp); -// for (Entry e : entries) { -// super.getParser().write(os, e, this); -// } -// os.close(); -// LineIterator it = new LineIterator(tmp); -// System.out.println("-------"); -// System.out.println("Uploaded file:"); -// for (String line : it) -// System.out.println(line); -// System.out.println("---EOF---"); -// it.close(); -// -// String reply = ClientHttpUpload.upload(tmp, url); -// System.out.println("SERVER REPLY: " + reply); -// // TODO add more checks on the reply. -// if (reply.equals("")) { -// -// throw new SaveFailedException("Empty reply from server"); -// -// } -// if (reply.toLowerCase().contains("error")) { -// JOptionPane.showMessageDialog(null, reply); -// throw new SaveFailedException("Error reply from server"); -// -// } -// JOptionPane.showMessageDialog(null, reply); -// -// } catch (IOException e) { -// -// e.printStackTrace(); -// throw new SaveFailedException("IOException"); -// } -// -// } - - public URL getURL() { - return url; - } - - @Override - public String toString() { - return url.toString(); - } - - /* (non-Javadoc) - * @see net.sf.jannot.source.DataSource#isIndexed() - */ - @Override - public boolean isIndexed() { - return false; - } - - - private long cachedSize=-2; - - /* (non-Javadoc) - * @see net.sf.jannot.source.DataSource#size() - */ - @Override - public long size() { - if(cachedSize==-2) - try { - cachedSize=url.openConnection().getContentLength(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return cachedSize; - } - -// @Override -// public boolean isDestructiveSave() { -// -// return false; -// } - -} diff --git a/src/net/sf/jannot/source/cache/CachedURLSource.java b/src/net/sf/jannot/source/cache/CachedURLSource.java deleted file mode 100644 index deca6ef..0000000 --- a/src/net/sf/jannot/source/cache/CachedURLSource.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source.cache; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; -import java.net.URL; - -import net.sf.jannot.EntrySet; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.exception.SaveFailedException; -import net.sf.jannot.parser.Parser; -import net.sf.jannot.source.SSL; -import net.sf.jannot.source.URLSource; - -public class CachedURLSource extends URLSource { - - public CachedURLSource(URL url) throws IOException { - super(url, null); - - } - - - - @Override - public EntrySet read(EntrySet set) throws ReadFailedException { - if (!SourceCache.contains(url)) { - SSL.certify(url); - try { - super.setParser(Parser.detectParser(url.openStream(),url)); - final PipedInputStream in = new PipedInputStream(); - final PipedOutputStream forParser = new PipedOutputStream(in); - - new Thread(new Runnable() { - public void run() { - try { - OutputStream out = SourceCache.startCaching(url); - InputStream is=url.openStream(); - byte[] buffer = new byte[100000]; - while (true) { - - int amountRead = is.read(buffer); - if (amountRead == -1) { - break; - } - forParser.write(buffer, 0, amountRead); - out.write(buffer, 0, amountRead); - - } - forParser.close(); - out.close(); - SourceCache.finish(url); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - }).start(); - - super.setIos(in); - } catch (Exception e) { - throw new ReadFailedException(e); - - } - return super.read(set); - } else { - try { - return SourceCache.get(url).read(set); - } catch (IOException e) { - throw new ReadFailedException(e); - } - } - } - -} diff --git a/src/net/sf/jannot/source/cache/SourceCache.java b/src/net/sf/jannot/source/cache/SourceCache.java deleted file mode 100644 index 9c357c7..0000000 --- a/src/net/sf/jannot/source/cache/SourceCache.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source.cache; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.net.URL; -import java.util.HashSet; -import java.util.Set; - -import atk.util.MD5Tools; -import be.abeel.io.ExtensionFileFilter; -import net.sf.jannot.source.DataSource; -import net.sf.jannot.source.FileSource; - - -public class SourceCache { - - public static File cacheDir=new File(System.getProperty("user.home"));; - - public static boolean contains(URL url) { - - - System.out.println("URL cache: "+cacheDir); - if(!cacheDir.exists()) - cacheDir.mkdir(); - File[]files=cacheDir.listFiles(new ExtensionFileFilter("url")); - Setnames=new HashSet(); - String md5=MD5Tools.md5(url.toString()); - for(File file:files){ - names.add(file.getName()); - - } - return names.contains(md5+".url"); - - } - - public static DataSource get(URL url) throws IOException { - System.out.println("Retrieving from cache: "+url); - return new FileSource(new File(cacheDir,MD5Tools.md5(url.toString())+".url")); - } - - public static OutputStream startCaching(URL url) throws FileNotFoundException { - return new FileOutputStream(new File(cacheDir,MD5Tools.md5(url.toString())+".tmp")); - } - - /** - * This method should only be called when the data is completely written. - * - * @param url - */ - public static void finish(URL url) { - File f=new File(cacheDir,MD5Tools.md5(url.toString())+".tmp"); - f.renameTo(new File(cacheDir,MD5Tools.md5(url.toString())+".url")); - - } - -} diff --git a/src/net/sf/jannot/source/das/DAS.java b/src/net/sf/jannot/source/das/DAS.java deleted file mode 100644 index 69634ed..0000000 --- a/src/net/sf/jannot/source/das/DAS.java +++ /dev/null @@ -1,321 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source.das; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.List; -import java.util.Stack; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.MemoryFeatureAnnotation; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.refseq.MemorySequence; -import net.sf.jannot.source.DataSource; - -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -import be.abeel.net.URIFactory; - -public class DAS extends DataSource { - - private String serverPrefix; - - private DSN dsn = null; - - public DAS(String serverPrefix) throws MalformedURLException, ParserConfigurationException, SAXException, IOException, URISyntaxException { - super(null); - this.serverPrefix = serverPrefix; - dsn = new DSN(serverPrefix); - } - - private DSN getDSN() { - return dsn; - } - - private EntryPointParser entryPoints = null; - - private class EntryPointParser extends DefaultHandler { - private Stack parserStack = new Stack(); - private ArrayList epList = new ArrayList(); - - @Override - public void endElement(String uri, String localName, String name) throws SAXException { - // TODO Auto-generated method stub - super.endElement(uri, localName, name); - String stackName = parserStack.pop(); - if (!name.equals(stackName)) { - throw new SAXException("Tags do not match: expected=" + stackName + "; actual=" + name); - } - } - - @Override - public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException { - // TODO Auto-generated method stub - super.startElement(uri, localName, name, attributes); - parserStack.push(name); - if (name.equalsIgnoreCase("SEGMENT")) { - EntryPoint ep = new EntryPoint(); - ep.id = attributes.getValue("id"); - ep.start = Integer.parseInt(attributes.getValue("start")); - ep.stop = Integer.parseInt(attributes.getValue("stop")); - epList.add(ep); - } - } - - public List getAll() { - return epList; - } - - } - - static public class EntryPoint { - String id; - int start, stop; - - public String toString() { - return id + " [" + start + "," + stop + "]"; - } - } - - private static class SequenceParser extends DefaultHandler { - StringBuffer seq = null; - - @Override - public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException { - // TODO Auto-generated method stub - super.startElement(uri, localName, name, attributes); - if (name.equalsIgnoreCase("DNA")) { - seq = new StringBuffer(); - } - } - - @Override - public void characters(char[] ch, int start, int length) throws SAXException { - // TODO Auto-generated method stub - super.characters(ch, start, length); - seq.append(ch, start, length); - } - - } - - private void getEntry(EntrySet set,String ref, EntryPoint ep) throws MalformedURLException, ParserConfigurationException, SAXException, IOException, URISyntaxException { - StringBuffer seq = this.getSequence(ref, ep); - Entry out = set.getOrCreateEntry(ref + ":" + ep); -// out.setID(); - out.setSequence(new MemorySequence(seq)); - // System.out.println("Ref: " + ref); - // if (ref.contains("Homo")) { - System.out.println("Ref: " + ref); - - for (String source : this.getDSN().getSources(ref)) { - List list = this.getFeatures(source, ep); - for(Feature f:list){ -// out.annotation.addAll(list); - MemoryFeatureAnnotation fa = out.getMemoryAnnotation(f.type()); - fa.add(f); - } - } - // System.out.println("** " + list); - - // } - - - } - - private static class FeatureParser extends DefaultHandler { - private Stack parserStack = new Stack(); - private String featureID = null; - private String typeID = null; - private int end; - private int start; - private String methodID; - private char strand; - private double score; - - @Override - public void characters(char[] ch, int st, int length) throws SAXException { - // TODO Auto-generated method stub - super.characters(ch, st, length); - if (parserStack.peek().equalsIgnoreCase("START")) { - start = Integer.parseInt(new String(ch, st, length)); - - } - if (parserStack.peek().equalsIgnoreCase("END")) { - end = Integer.parseInt(new String(ch, st, length)); - - } - if (parserStack.peek().equalsIgnoreCase("orientation")) { - strand = ch[st]; - } - if (parserStack.peek().equalsIgnoreCase("score")) { - if (length == 1 && ch[st] == '-') - score = 0; - else { - score = Double.parseDouble(new String(ch, st, length)); - } - } - } - - @Override - public void endElement(String uri, String localName, String name) throws SAXException { - // TODO Auto-generated method stub - super.endElement(uri, localName, name); - String stackName = parserStack.pop(); - if (!name.equals(stackName)) { - throw new SAXException("Tags do not match: expected=" + stackName + "; actual=" + name); - } - if (name.equalsIgnoreCase("feature")) { - Feature f = new Feature(); - f.addLocation(new Location(start, end)); - f.setType(Type.get(typeID)); - f.addQualifier("source", methodID); - f.addQualifier("name", featureID); - f.setScore(score); - f.setStrand(Strand.fromSymbol(strand)); - list.add(f); - - } - } - - @Override - public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException { - // TODO Auto-generated method stub - super.startElement(uri, localName, name, attributes); - parserStack.push(name); - if (name.equalsIgnoreCase("feature")) { - featureID = attributes.getValue("id"); - - } - if (name.equalsIgnoreCase("type")) { - typeID = attributes.getValue("id"); - - } - if (name.equalsIgnoreCase("method")) { - methodID = attributes.getValue("id"); - - } - } - - private List list = new ArrayList(); - - } - - private List getFeatures(String source, EntryPoint e) throws MalformedURLException, SAXException, IOException, ParserConfigurationException, URISyntaxException { - SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); - FeatureParser featp = new FeatureParser(); - // System.out.println("Getting features: " + featureDSN); - // System.out.println(serverPrefix + "/das/" + featureDSN + - // "/features?segment=" + e.id + ":" + e.start + "," + e.stop); - parser.parse(URIFactory.url(serverPrefix + "/das/" + source + "/features?segment=" + e.id + ":" + e.start + "," + e.stop).openStream(), featp); - return featp.list; - } - - private EntryPoint ep = null; - private String reference = null; - - public void setEntryPoint(EntryPoint ep) { - this.ep = ep; - } - - public void setReference(String reference) { - this.reference = reference; - } - - private StringBuffer getSequence(String ref, EntryPoint e) throws MalformedURLException, SAXException, IOException, ParserConfigurationException, URISyntaxException { - SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); - SequenceParser seqp = new SequenceParser(); - System.out.println(ref + "/dna?segment=" + e.id + ":" + e.start + "," + e.stop); - parser.parse(URIFactory.url(ref + "/dna?segment=" + e.id + ":" + e.start + "," + e.stop).openStream(), seqp); - return clean(seqp.seq); - } - - private StringBuffer clean(StringBuffer seq) { - return new StringBuffer(new String(seq).replaceAll("[ \t\n\r]", "")); - } - - public List getEntryPoints(String ref) throws MalformedURLException, SAXException, IOException, ParserConfigurationException, URISyntaxException { - if (entryPoints == null) { - SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); - entryPoints = new EntryPointParser(); - parser.parse(URIFactory.url(ref + "/entry_points").openStream(), entryPoints); - } - return entryPoints.getAll(); - - } - -// @Override -// public boolean isDestructiveSave() { -// // TODO Auto-generated method stub -// return false; -// } - - @Override - public EntrySet read(EntrySet set) throws ReadFailedException { - if (set == null) - set = new EntrySet(); - if(ep==null||reference==null) - throw new ReadFailedException("Both the EntryPoint and the Reference need to be set!"); - try { - this.getEntry(set,reference, ep); - } catch (MalformedURLException e) { - e.printStackTrace(); - throw new ReadFailedException(e); - } catch (ParserConfigurationException e) { - e.printStackTrace(); - throw new ReadFailedException(e); - } catch (SAXException e) { - e.printStackTrace(); - throw new ReadFailedException(e); - } catch (IOException e) { - e.printStackTrace(); - throw new ReadFailedException(e); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return set; - } - - - public List getReferences() { - return dsn.getReferences(); - } - - @Override - public void finalize() { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see net.sf.jannot.source.DataSource#isIndexed() - */ - @Override - public boolean isIndexed() { - return false; - } - - /* (non-Javadoc) - * @see net.sf.jannot.source.DataSource#size() - */ - @Override - public long size() { - return 0; - } - -} diff --git a/src/net/sf/jannot/source/das/DSN.java b/src/net/sf/jannot/source/das/DSN.java deleted file mode 100644 index 26bcf04..0000000 --- a/src/net/sf/jannot/source/das/DSN.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.source.das; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Stack; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -import be.abeel.net.URIFactory; - -public class DSN { - - class DSNParser extends DefaultHandler { - private HashMap> mastermap = new HashMap>(); - private Stack parserStack = new Stack(); - private String source = null; - - @Override - public void characters(char[] ch, int start, int length) throws SAXException { - // TODO Auto-generated method stub - super.characters(ch, start, length); - - if (parserStack.peek().equalsIgnoreCase("MAPMASTER")) { - String s = new String(ch, start, length); -// System.out.println("Mapmaster=" + s); - if (!mastermap.containsKey(s)) - mastermap.put(s, new ArrayList()); - mastermap.get(s).add(source); - } - } - - @Override - public void endElement(String uri, String localName, String name) throws SAXException { - // TODO Auto-generated method stub - super.endElement(uri, localName, name); - String stackName = parserStack.pop(); - if (!name.equals(stackName)) { - throw new SAXException("Tags do not match: expected=" + stackName + "; actual=" + name); - } else { -// System.out.println("match"); - } - } - - @Override - public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException { - // TODO Auto-generated method stub - super.startElement(uri, localName, name, attributes); - parserStack.push(name); -// System.out.println("Start-"); -// System.out.println("\t" + uri); -// System.out.println("\t" + localName); -// System.out.println("\t" + name); -// System.out.println("\t" + attributes); - if (name.equalsIgnoreCase("SOURCE")) { - String val = attributes.getValue("id"); -// System.out.println("val=" + val); - source = val; - } - - } - - } - - public List getReferences() { - return new ArrayList(dsn.mastermap.keySet()); - } - - public List getSources(String reference){ - return dsn.mastermap.get(reference); - } - - private DSNParser dsn; - - public DSN(String server) throws ParserConfigurationException, SAXException, MalformedURLException, IOException, URISyntaxException { - SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); - dsn = new DSNParser(); - parser.parse(URIFactory.url(server + "/das/dsn").openStream(), dsn); - -// System.out.println(dsn.mastermap); -// for (String key : dsn.mastermap.keySet()) { -// System.out.println(key); -// for (String s : dsn.mastermap.get(key)) -// System.out.println("\t" + s); -// } - } -} diff --git a/src/net/sf/jannot/tabix/BEDWrapper.java b/src/net/sf/jannot/tabix/BEDWrapper.java deleted file mode 100644 index aad06de..0000000 --- a/src/net/sf/jannot/tabix/BEDWrapper.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix; - -import java.io.IOException; -import java.net.URISyntaxException; - -import net.sf.jannot.Feature; -import net.sf.jannot.tabix.codec.BEDCodec; - -/** - * - * @author Thomas Abeel - * - */ -public class BEDWrapper extends FeatureWrapper { - - BEDWrapper(String key, IndexedFeatureFile data, TabIndex idx) { - super(key, data, idx); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - try { - return new BEDCodec(this, data.query(key, start, end)); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - -} \ No newline at end of file diff --git a/src/net/sf/jannot/tabix/BinaryCodec.java b/src/net/sf/jannot/tabix/BinaryCodec.java deleted file mode 100644 index 3b54465..0000000 --- a/src/net/sf/jannot/tabix/BinaryCodec.java +++ /dev/null @@ -1,721 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2009 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package net.sf.jannot.tabix; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * Encapsulates file representation of various primitive data types. Forces - * little-endian disk representation. Note that this class is currently not very - * efficient. There are plans to increase the size of the ByteBuffer, and move - * data between the ByteBuffer and the underlying input or output stream in - * larger chunks. - * - * All the read methods throw RuntimeEOFException if the input stream is - * exhausted before the required number of bytes are read. - * - * @author Dave Tefft - */ -public class BinaryCodec { - - // Outstream to write to - private OutputStream outputStream; - // If a file or filename was given it will be stored here. Used for error - // reporting. - private String outputFileName; - - // Input stream to read from - private InputStream inputStream; - // If a file or filename was give to read from it will be stored here. Used - // for error reporting. - private String inputFileName; - - /* - * Mode that the BinaryCodec is in. It is either writing to a binary file or - * reading from. This is set to true if it is writing to a binary file Right - * now we don't support reading and writing to the same file with the same - * BinaryCodec instance - */ - private boolean isWriting; - - /** - * For byte swapping. - */ - private ByteBuffer byteBuffer; - - /** - * For reading Strings of known length, this can reduce object creation - */ - private final byte[] scratchBuffer = new byte[16]; - - // Byte order used in BAM files. - private static final ByteOrder LITTLE_ENDIAN = ByteOrder.LITTLE_ENDIAN; - private static final byte NULL_BYTE[] = { 0 }; - - private static final long MAX_UBYTE = (Byte.MAX_VALUE * 2) + 1; - private static final long MAX_USHORT = (Short.MAX_VALUE * 2) + 1; - private static final long MAX_UINT = ((long) Integer.MAX_VALUE * 2) + 1; - - // We never serialize more than this much at a time (except for Strings) - private static final int MAX_BYTE_BUFFER = 8; - - // //////////////////////////////////////////////// - // Constructors // - // //////////////////////////////////////////////// - - /** - * Constructs BinaryCodec from a file and set it's mode to writing or not - * - * @param file - * file to be written to or read from - * @param writing - * whether the file is being written to - */ - public BinaryCodec(final File file, final boolean writing) { - this(); - try { - this.isWriting = writing; - if (this.isWriting) { - this.outputStream = new FileOutputStream(file); - this.outputFileName = file.getName(); - } else { - this.inputStream = new FileInputStream(file); - this.inputFileName = file.getName(); - } - } catch (FileNotFoundException e) { - throw new RuntimeIOException("File not found: " + file, e); - } - } - - /** - * Constructs BinaryCodec from a file name and set it's mode to writing or - * not - * - * @param fileName - * name of the file to be written to or read from - * @param writing - * writing whether the file is being written to - */ - public BinaryCodec(final String fileName, final boolean writing) { - this(new File(fileName), writing); - } - - /** - * Constructs BinaryCodec from an output stream - * - * @param outputStream - * Stream to write to, since it's an output stream we know that - * isWriting should be set to true - */ - public BinaryCodec(final OutputStream outputStream) { - this(); - setOutputStream(outputStream); - } - - /** - * Constructs BinaryCodec from an input stream - * - * @param inputStream - * Stream to read from, since we are reading isWriting is set to - * false - */ - public BinaryCodec(final InputStream inputStream) { - this(); - setInputStream(inputStream); - } - - /** - * Ambiguous whether reading or writing until set{In,Out}putStream is called - */ - public BinaryCodec() { - initByteBuffer(); - } - - /** - * Shared among ctors. Note that if endianness is changed, all the unsigned - * methods must also be changed. - */ - private void initByteBuffer() { - byteBuffer = ByteBuffer.allocate(MAX_BYTE_BUFFER); - byteBuffer.order(LITTLE_ENDIAN); - } - - // //////////////////////////////////////////////// - // Writing methods // - // //////////////////////////////////////////////// - - /** - * Write whatever has been put into the byte buffer - * - * @param numBytes - * -- how much to write. Note that in case of writing an unsigned - * value, more bytes were put into the ByteBuffer than will get - * written out. - */ - private void writeByteBuffer(final int numBytes) { - assert (numBytes <= byteBuffer.limit()); - writeBytes(byteBuffer.array(), 0, numBytes); - } - - /** - * Writes a byte to the output buffer - * - * @param bite - * byte array to write - */ - public void writeByte(final byte bite) { - byteBuffer.clear(); - byteBuffer.put(bite); - writeByteBuffer(1); - } - - public void writeByte(final int b) { - writeByte((byte) b); - } - - /** - * Writes a byte array to the output buffer - * - * @param bytes - * value to write - */ - public void writeBytes(final byte[] bytes) { - writeBytes(bytes, 0, bytes.length); - } - - public void writeBytes(final byte[] bytes, final int startOffset, final int numBytes) { - if (!isWriting) { - throw new IllegalStateException("Calling write method on BinaryCodec open for read."); - } - try { - outputStream.write(bytes, startOffset, numBytes); - } catch (IOException e) { - throw new RuntimeIOException(constructErrorMessage("Write error"), e); - } - } - - /** - * Write a 32-bit int to the output stream - * - * @param value - * int to write - */ - public void writeInt(final int value) { - byteBuffer.clear(); - byteBuffer.putInt(value); - writeByteBuffer(4); - } - - /** - * Write a double (8 bytes) to the output stream - * - * @param value - * double to write - */ - public void writeDouble(final double value) { - byteBuffer.clear(); - byteBuffer.putDouble(value); - writeByteBuffer(8); - } - - /** - * Write a 64-bit long to the output stream - * - * @param value - * long to write - */ - public void writeLong(final long value) { - byteBuffer.clear(); - byteBuffer.putLong(value); - writeByteBuffer(8); - } - - /** - * Write a 16-bit short to output stream - */ - public void writeShort(final short value) { - byteBuffer.clear(); - byteBuffer.putShort(value); - writeByteBuffer(2); - } - - /** - * Write a float (4 bytes) to the output stream - * - * @param value - * float to write - */ - public void writeFloat(final float value) { - byteBuffer.clear(); - byteBuffer.putFloat(value); - writeByteBuffer(4); - } - - /** - * Writes a boolean (1 byte) to the output buffer - * - * @param value - * boolean to write - */ - public void writeBoolean(final boolean value) { - byteBuffer.clear(); - byteBuffer.put(value ? (byte) 1 : (byte) 0); - writeByteBuffer(1); - } - - /** - * Writes a string to the buffer as ASCII bytes - * - * @param value - * string to write to buffer - * @param writeLength - * prefix the string with the length as a 32-bit int - * @param appendNull - * add a null byte to the end of the string - */ - public void writeString(final String value, final boolean writeLength, final boolean appendNull) { - if (writeLength) { - int lengthToWrite = value.length(); - if (appendNull) - lengthToWrite++; - writeInt(lengthToWrite); - } - - // Actually writes the string to a buffer - writeString(value); - - if (appendNull) - writeBytes(NULL_BYTE); - - } - - /** - * Write a string to the buffer as ASCII bytes - * - * @param value - * string to write - */ - private void writeString(final String value) { - writeBytes(value.getBytes()); - } - - - - /** - * Write an 8-bit unsigned byte. NOTE: This method will break if we change - * to big-endian. - */ - public void writeUByte(final short val) { - if (val < 0) { - throw new IllegalArgumentException("Negative value (" + val + ") passed to unsigned writing method."); - } - if (val > MAX_UBYTE) { - throw new IllegalArgumentException("Value (" + val + ") to large to be written as ubyte."); - } - byteBuffer.clear(); - byteBuffer.putShort(val); - writeByteBuffer(1); - } - - /** - * Write a 16-bit unsigned short. NOTE: This method will break if we change - * to big-endian. - */ - public void writeUShort(final int val) { - if (val < 0) { - throw new IllegalArgumentException("Negative value (" + val + ") passed to unsigned writing method."); - } - if (val > MAX_USHORT) { - throw new IllegalArgumentException("Value (" + val + ") to large to be written as ushort."); - } - byteBuffer.clear(); - byteBuffer.putInt(val); - writeByteBuffer(2); - } - - /** - * Write a 32-bit unsigned int. NOTE: This method will break if we change to - * big-endian. - */ - public void writeUInt(final long val) { - if (val < 0) { - throw new IllegalArgumentException("Negative value (" + val + ") passed to unsigned writing method."); - } - if (val > MAX_UINT) { - throw new IllegalArgumentException("Value (" + val + ") to large to be written as uint."); - } - byteBuffer.clear(); - byteBuffer.putLong(val); - writeByteBuffer(4); - } - - // //////////////////////////////////////////////// - // Reading methods // - // //////////////////////////////////////////////// - - /** - * Read a byte array from the input stream. - * - * @throws net.sf.samtools.util.RuntimeEOFException - * if fewer than buffer.length bytes to read - */ - public void readBytes(final byte[] buffer) { - readBytes(buffer, 0, buffer.length); - } - - /** - * Read a byte array from the input stream - * - * @param buffer - * where to put bytes read - * @param offset - * offset to start putting bytes into buffer - * @param length - * number of bytes to read - * @throws RuntimeEOFException - * if fewer than length bytes to read - */ - public void readBytes(final byte[] buffer, final int offset, final int length) { - int totalNumRead = 0; - do { - final int numRead = readBytesOrFewer(buffer, offset + totalNumRead, length - totalNumRead); - if (numRead < 0) { - throw new RuntimeEOFException(constructErrorMessage("Premature EOF")); - } else { - totalNumRead += numRead; - } - } while (totalNumRead < length); - } - - /** - * Reads a byte array from the input stream. - * - * @param buffer - * where to put bytes read - * @param offset - * offset to start putting bytes into buffer - * @param length - * number of bytes to read. Fewer bytes may be read if EOF is - * reached before length bytes have been read. - * @return the total number of bytes read into the buffer, or -1 if there is - * no more data because the end of the stream has been reached. - */ - public int readBytesOrFewer(final byte[] buffer, final int offset, final int length) { - if (isWriting) { - throw new IllegalStateException("Calling read method on BinaryCodec open for write."); - } - try { - return inputStream.read(buffer, offset, length); - } catch (IOException e) { - throw new RuntimeIOException(constructErrorMessage("Read error"), e); - } - } - - /** - * @return a single byte read from the input stream. - */ - public byte readByte() { - if (isWriting) { - throw new IllegalStateException("Calling read method on BinaryCodec open for write."); - } - try { - final int ret = inputStream.read(); - if (ret == -1) { - throw new RuntimeEOFException(constructErrorMessage("Premature EOF")); - } - return (byte) ret; - } catch (IOException e) { - throw new RuntimeIOException(constructErrorMessage("Read error"), e); - } - } - - /** - * @return true if it is possible to know for sure if at EOF, and it is - * known for sure. If the input stream is a ByteArrayInputStream, - * this is faster than causing a RuntimeEOFException to be thrown. - */ - public boolean knownAtEof() { - if (isWriting) { - throw new IllegalStateException("Calling knownAtEof method on BinaryCodec open for write."); - } - try { - return inputStream instanceof ByteArrayInputStream && inputStream.available() == 0; - } catch (IOException e) { - throw new RuntimeIOException(constructErrorMessage("available() error"), e); - } - } - - /** - * Read a string off the input stream, as ASCII bytes - * - * @param length - * length of string to read - * @return String read from stream - */ - public String readString(final int length) { - final byte[] buffer; - // Recycle single buffer if possible - if (length <= scratchBuffer.length) { - buffer = scratchBuffer; - } else { - buffer = new byte[length]; - - } - readBytes(buffer, 0, length); - - return new String(buffer,0,length);//StringUtil.bytesToString(buffer, 0, length); - } - - /** - * Read ASCII bytes from the input stream until a null byte is read - * - * @return String constructed from the ASCII bytes read - */ - public String readNullTerminatedString() { - return readNullTerminatedString(this); - } - // This method might more appropriately live in BinaryCodec, but all the byte <=> char conversion - // should be in the same place. - private static String readNullTerminatedString(final BinaryCodec binaryCodec) { - final StringBuilder ret = new StringBuilder(); - for (byte b = binaryCodec.readByte(); b != 0; b = binaryCodec.readByte()) { - ret.append((char)(b & 0xff)); - } - return ret.toString(); - } - /** - * Read an int length, and then a String of that length - * - * @param devourNull - * if true, the length include a null terminator, which is read - * and discarded - */ - public String readLengthAndString(final boolean devourNull) { - int length = readInt(); - if (devourNull) { - --length; - } - final String ret = readString(length); - if (devourNull) { - readByte(); - } - return ret; - } - - private void readByteBuffer(final int numBytes) { - assert (numBytes <= byteBuffer.capacity()); - readBytes(byteBuffer.array(), 0, numBytes); - byteBuffer.limit(byteBuffer.capacity()); - byteBuffer.position(numBytes); - } - - /** - * Read an int off the input stream - * - * @return int from input stream - */ - public int readInt() { - readByteBuffer(4); - byteBuffer.flip(); - return byteBuffer.getInt(); - } - - /** - * Reads a double off the input stream - * - * @return double - */ - public double readDouble() { - readByteBuffer(8); - byteBuffer.flip(); - return byteBuffer.getDouble(); - } - - /** - * Reads a long off the input stream - * - * @return long - */ - public long readLong() { - readByteBuffer(8); - byteBuffer.flip(); - - long out=byteBuffer.getLong(); - - byte[]arr=byteBuffer.array(); - -// System.out.println(Long.toHexString(out)); - return out; - } - - public short readShort() { - readByteBuffer(2); - byteBuffer.flip(); - return byteBuffer.getShort(); - } - - /** - * Reads a float off the input stream - * - * @return float - */ - public float readFloat() { - readByteBuffer(4); - byteBuffer.flip(); - return byteBuffer.getFloat(); - } - - /** - * Reads a boolean off the input stream, represented as a byte with value 1 - * or 0 - * - * @return boolean - */ - public boolean readBoolean() { - return (((int) readByte()) == 1); - } - - /** - * Reads an 8-bit unsigned byte from the input stream. This method assumes - * little-endianness. - */ - public short readUByte() { - readByteBuffer(1); - byteBuffer.put((byte) 0); - byteBuffer.flip(); - return byteBuffer.getShort(); - } - - /** - * Reads a 16-bit unsigned short from the input stream. This method assumes - * little-endianness. - */ - public int readUShort() { - readByteBuffer(2); - byteBuffer.putShort((short) 0); - byteBuffer.flip(); - return byteBuffer.getInt(); - } - - /** - * Reads a 32-bit unsigned int from the input stream. This method assumes - * little-endianness. - */ - public long readUInt() { - readByteBuffer(4); - byteBuffer.putInt(0); - byteBuffer.flip(); - return byteBuffer.getLong(); - } - /** - * Reads a 64-bit unsigned long from the input stream. This method assumes - * little-endianness and will truncate for large values. - */ - public long readULong() { - readByteBuffer(8); - byteBuffer.putInt(0); - byteBuffer.flip(); - return byteBuffer.getLong(); - } - /** - * Close the appropriate stream - */ - public void close() { - try { - if (this.isWriting) - this.outputStream.close(); - else - this.inputStream.close(); - } catch (IOException e) { - throw new RuntimeIOException(e.getMessage(), e); - } - } - - private String constructErrorMessage(final String msg) { - final StringBuilder sb = new StringBuilder(msg); - sb.append("; BinaryCodec in "); - sb.append(isWriting ? "write" : "read"); - sb.append("mode; "); - final String filename = isWriting ? outputFileName : inputFileName; - if (filename != null) { - sb.append("file: "); - sb.append(filename); - } else { - sb.append("streamed file (filename not available)"); - } - return sb.toString(); - } - - // //////////////////////////////////////////////// - // Some getters // - // //////////////////////////////////////////////// - - public String getInputFileName() { - return inputFileName; - } - - public String getOutputFileName() { - return outputFileName; - } - - public void setOutputFileName(final String outputFileName) { - this.outputFileName = outputFileName; - } - - public void setInputFileName(final String inputFileName) { - this.inputFileName = inputFileName; - } - - public boolean isWriting() { - return isWriting; - } - - public OutputStream getOutputStream() { - return outputStream; - } - - public InputStream getInputStream() { - return inputStream; - } - - public void setInputStream(final InputStream is) { - isWriting = false; - this.inputStream = is; - } - - public void setOutputStream(final OutputStream os) { - isWriting = true; - this.outputStream = os; - - } -} diff --git a/src/net/sf/jannot/tabix/FeatureWrapper.java b/src/net/sf/jannot/tabix/FeatureWrapper.java deleted file mode 100644 index 5b7096c..0000000 --- a/src/net/sf/jannot/tabix/FeatureWrapper.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix; - -import net.sf.jannot.Feature; -import net.sf.jannot.FeatureAnnotation; - -/** - * @author Thomas Abeel - * - */ -public abstract class FeatureWrapper extends TabixWrapper implements FeatureAnnotation { - - - -// private HashSetqualifierKeys=new HashSet(); - - /** - * @param key - * @param data - * @param idx - */ - public FeatureWrapper(String key, IndexedFeatureFile data, TabIndex idx) { - super(key, data, idx); - } - -// public void update(Feature f) { -//// if (f.getScore() > maxScore) -//// maxScore = f.getScore(); -//// if (f.getScore() < minScore) -//// minScore = f.getScore(); -//// qualifierKeys.addAll(f.getQualifiersKeys()); -// } - -// private double minScore = Double.POSITIVE_INFINITY, maxScore = Double.NEGATIVE_INFINITY; - -// /* -// * (non-Javadoc) -// * -// * @see net.sf.jannot.FeatureAnnotation#getMaxScore() -// */ -// @Override -// public double getMaxScore() { -// return maxScore; -// } - -// /* -// * (non-Javadoc) -// * -// * @see net.sf.jannot.FeatureAnnotation#getMinScore() -// */ -// @Override -// public double getMinScore() { -// return minScore; -// } - /* (non-Javadoc) - * @see net.sf.jannot.FeatureAnnotation#qualifierKeys() - */ -// @Override -// public Set qualifierKeys() { -// return qualifierKeys; -// } - -} diff --git a/src/net/sf/jannot/tabix/GFFWrapper.java b/src/net/sf/jannot/tabix/GFFWrapper.java deleted file mode 100644 index 55601ee..0000000 --- a/src/net/sf/jannot/tabix/GFFWrapper.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix; - -import java.io.IOException; -import java.net.URISyntaxException; - -import net.sf.jannot.Feature; -import net.sf.jannot.FeatureAnnotation; -import net.sf.jannot.Location; -import net.sf.jannot.tabix.codec.GFFCodec; -/** - */ -public class GFFWrapper extends FeatureWrapper { - - public GFFWrapper(String key, IndexedFeatureFile data, TabIndex idx) { - super(key, data, idx); - } - - - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - try { - return new GFFCodec(this,data.query(key, start, end)); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - - - - - - - -} \ No newline at end of file diff --git a/src/net/sf/jannot/tabix/IndexedFeatureFile.java b/src/net/sf/jannot/tabix/IndexedFeatureFile.java deleted file mode 100644 index 4154951..0000000 --- a/src/net/sf/jannot/tabix/IndexedFeatureFile.java +++ /dev/null @@ -1,853 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.logging.Logger; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.StringKey; -import net.sf.jannot.Type; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.picard.LineBlockCompressedInputStream; -import net.sf.jannot.source.DataSource; -import net.sf.jannot.source.Locator; -import net.sf.samtools.util.BlockCompressedInputStream; -import be.abeel.util.LRUCache; - -/** - * - * @author Thomas Abeel - * - */ -public class IndexedFeatureFile extends DataSource { - // FIXME a lot of duplicated stuff from CachingQueryReader with respect to - // the tiling caching... - - public String source() { - return data.toString(); - } - - @Override - public String toString() { - return data.toString(); - } - - /** - * Index constructed from a binary index file - */ - private TabIndex idx; - - /** - * Compressed data file. - */ - private Locator data; - // private Locator index; - - private long size; - - public TabIndex getIndex() { - return idx; - } - - // /** - // * Reads an index file and constructs an index object. - // * - // * @param indexFile - // * the compressed index file - // * - // * @throws IOException - // */ - // public IndexedFeatureFile(File compressedFile) throws IOException { - // this(compressedFile, 8000, 50); - // } - // - // public IndexedFeatureFile(URL compressedURL) throws IOException, - // URISyntaxException { - // this(compressedURL, 8000, 50); - // } - - // /** - // * Reads an index file and constructs an index object. - // * - // * - // * @param compressedFile - // * the compressed, indexed data file - // * @throws IOException - // */ - // private IndexedFeatureFile(File compressedFile, int tileSize, int tiles) - // throws IOException { - // File indexFile = new File(compressedFile.toString() + ".tbi"); - // this.compFile = compressedFile; - // this.size = compressedFile.length(); - // BlockCompressedInputStream in = new - // BlockCompressedInputStream(indexFile); - // setup(in, tileSize, tiles); - // } - - // /** - // * Reads an index file and constructs an index object. - // * - // * @param indexFile - // * the compressed index file - // * @param compressedFile - // * the compressed, indexed data file - // * @throws IOException - // * @throws URISyntaxException - // */ - // private IndexedFeatureFile(URL compressedFile, int tileSize, int tiles) - // throws IOException, URISyntaxException { - // URL indexFile = URIFactory.url(compressedFile.toString() + ".tbi"); - // this.size = compressedFile.openConnection().getContentLength(); - // this.compFile = compressedFile; - // BlockCompressedInputStream in = new - // BlockCompressedInputStream(indexFile); - // setup(in, tileSize, tiles); - // } - - /** - * @param data - * @param index - * @throws IOException - * @throws URISyntaxException - */ - public IndexedFeatureFile(Locator data, Locator index) throws IOException, URISyntaxException { - super(data); - this.data = data; - // this.index = index; - this.size = data.length(); - BlockCompressedInputStream in = null; - if (index.isURL()) { - in = new BlockCompressedInputStream(index.url()); - } else - in = new BlockCompressedInputStream(index.file()); - setup(in, 8000, 50); - } - - private void setup(BlockCompressedInputStream in, int tileSize, int tiles) throws IOException { - BinaryCodec bc = new BinaryCodec(in); - this.tileSize = tileSize; - this.maxTileCount = tiles; - // read magic - byte[] buffer = new byte[4]; - bc.readBytes(buffer); - - // read number of sequences - int n = bc.readInt(); - - // create new index object - idx = new TabIndex(n); - idx.magic = new String(buffer); - - // read header info and write to idx - idx.preset = bc.readUInt(); - idx.sc = bc.readUInt(); - idx.bc = bc.readUInt(); - idx.ec = bc.readUInt(); - // System.out.println("Read EC: "+idx.ec) - idx.meta = (char) bc.readUInt(); - - // skip line - bc.readUInt(); - - // create buffer to contain sequence names - int namesLen = bc.readInt(); - buffer = new byte[namesLen]; - bc.readBytes(buffer); - - // parse names and add to index - StringBuffer word = new StringBuffer(); - for (byte letter : buffer) { - if (letter != 0) { - word.append((char) letter); - } else { - idx.names.add(new String(word)); - word = new StringBuffer(); - } - } - - for (int i = 0; i < idx.size(); i++) { - long binSize = bc.readUInt(); - - for (int j = 0; j < binSize; j++) { - long key = bc.readUInt(); - ArrayList p = new ArrayList(); - idx.index[i].put((int) key, p); - - int numberOfPairs = bc.readInt(); - p.ensureCapacity(numberOfPairs); - for (int k = 0; k < numberOfPairs; k++) { - p.add(new Pair64(bc.readLong(), bc.readLong())); - } - } - - int numberOfOffsets = bc.readInt(); - - idx.linIndex[i].ensureCapacity(numberOfOffsets); - for (int j = 0; j < numberOfOffsets; j++) { - idx.linIndex[i].add(bc.readLong()); - } - // System.out.println("Linidex: "+idx.names.get(i)+"\t"+idx.linIndex[i]); - } - - in.close(); - - } - - /** - * Translate REG to BINS. - * - * @param beg - * @param end - * @param list - * @return - */ - private ArrayList reg2bins(int beg, int end) { - /* - * Recap: - * - * From C manual: When shifting to the right for unsigned int, bits fall - * off the least significant end, and 0's are shifted in from the most - * significant end. This is also known as logical right shift (logical - * shifts shift in 0's). If this occurs, then you divide by 2^K (if - * you're shifting K bits) - * - * Note that in the C version, beg and end are UNSIGNED ints. So if in - * Java we want to bitshift to the right, we explicitly have to say to - * add zeros to the left by using ">>>". - */ - - // warning, k is an int, assigned to a short... - ArrayList list = new ArrayList(); - list.ensureCapacity(MAX_BIN); - int k; - --end; - list.add((short) 0); - for (k = 1 + (beg >>> 26); k <= 1 + (end >>> 26); ++k) - list.add((short) k); - for (k = 9 + (beg >>> 23); k <= 9 + (end >>> 23); ++k) - list.add((short) k); - for (k = 73 + (beg >>> 20); k <= 73 + (end >>> 20); ++k) - list.add((short) k); - for (k = 585 + (beg >>> 17); k <= 585 + (end >>> 17); ++k) - list.add((short) k); - for (k = 4681 + (beg >>> 14); k <= 4681 + (end >>> 14); ++k) - list.add((short) k); - list.trimToSize(); - return list; - } - - private boolean is_overlap(int beg, int end, int rbeg, int rend) { - return (rend >= beg && rbeg <= end); - } - - final int MAX_BIN = 37450; - final int TAD_LIDX_SHIFT = 14; - - // preset masks - final int TI_PRESET_GENERIC = 0; - final int TI_PRESET_SAM = 1; - final int TI_PRESET_VCF = 2; - final int TI_FLAG_UCSC = 0x10000; - - // private String sequence; - // - // private int start; - // - // private int end; - - // private int entriesFound = 0; - - private ArrayList get_chunk_coordinates(int tid, int beg, int end) { - - ArrayList bins = reg2bins(beg, end); - - HashMap> index = idx.index[tid]; - - long min_off = (beg >> TAD_LIDX_SHIFT >= idx.linIndex[tid].size()) ? 0 : idx.linIndex[tid] - .get(beg >> TAD_LIDX_SHIFT); - - ArrayList off = new ArrayList(); - - for (int bin : bins) { - if (index.containsKey(bin)) { - ArrayList p = index.get(bin); - for (Pair64 pair : p) { - if (pair.end > min_off) - off.add(pair); - } - } - } - // if not a single bin matches... don't bother any further - if (off.size() == 0) - return off; - - Collections.sort(off); - // resolve completely contained adjacent blocks - int i, l; - for (i = 1, l = 0; i < off.size(); ++i) { - if (off.get(l).end < off.get(i).end) { - off.set(++l, off.get(i)); - } - } - // the position of l is the last entry that matters - // so the number of entries is l+1 - int n_off = l + 1; - - // resolve overlaps between adjacent blocks; this may happen due to the - // merge in indexing - for (i = 1; i < n_off; ++i) { - if (off.get(i - 1).end >= off.get(i).start) { - off.get(i - 1).end = off.get(i).start; - } - } - - // merge adjacent blocks - for (i = 1, l = 0; i < n_off; ++i) { - if (off.get(l).end >>> 16 == off.get(i).start >>> 16) { - off.get(l).end = off.get(i).end; - } else { - off.set(++l, off.get(i)); - } - } - n_off = l + 1; - - // we possibly have some leftover blocks now at the end of the arraylist - // only the first n_off blocks should be used, so copy these to a new - // ArrayList. - ArrayList new_off = new ArrayList(); - new_off.ensureCapacity(n_off); - for (i = 0; i < n_off; i++) { - new_off.add(off.get(i)); - } - - return new_off; - } - - private ArrayList empty = new ArrayList(); - private Logger log = Logger.getLogger(IndexedFeatureFile.class.toString()); - private int tileSize; - - static class Tile { - - private boolean loaded = false; - // private List containedRecords; - private int end; - private List overlappingRecords; - private int start; - private int tileNumber; - - Tile(int tileNumber, int start, int end) { - this.tileNumber = tileNumber; - this.start = start; - this.end = end; - // containedRecords = new ArrayList(16000); - overlappingRecords = new ArrayList(); - } - - /** - * @return the tileNumber - */ - public int getTileNumber() { - return tileNumber; - } - - /** - * @param tileNumber - * the tileNumber to set - */ - public void setTileNumber(int tileNumber) { - this.tileNumber = tileNumber; - } - - /** - * @return the start - */ - public int getStart() { - return start; - } - - /** - * @param start - * the start to set - */ - public void setStart(int start) { - this.start = start; - } - - // /** - // * @return the containedRecords - // */ - // public List getContainedRecords() { - // return containedRecords; - // } - // - // /** - // * @param containedRecords - // * the containedRecords to set - // */ - // public void setContainedRecords(List containedRecords) { - // this.containedRecords = containedRecords; - // } - - /** - * @return the overlappingRecords - */ - public List getOverlappingRecords() { - return overlappingRecords; - } - - /** - * @param overlappingRecords - * the overlappingRecords to set - */ - public void setOverlappingRecords(List overlappingRecords) { - this.overlappingRecords = overlappingRecords; - } - - /** - * @return the loaded - */ - public boolean isLoaded() { - return loaded; - } - - /** - * @param loaded - * the loaded to set - */ - public void setLoaded(boolean loaded) { - this.loaded = loaded; - } - } - - private int cachedChr = -1; - private int maxTileCount; - private LRUCache cache; - - private List getTiles(int tid, int startTile, int endTile) throws IOException, URISyntaxException { - - if (tid != cachedChr) { - cache = new LRUCache(maxTileCount); - cachedChr = tid; - } - - List tiles = new ArrayList(endTile - startTile + 1); - List tilesToLoad = new ArrayList(endTile - startTile + 1); - - for (int t = startTile; t <= endTile; t++) { - Tile tile = cache.get(t); - - if (tile == null) { - int start = t * tileSize; - int end = start + tileSize; - - tile = new Tile(t, start, end); - cache.put(t, tile); - } - - tiles.add(tile); - // The current tile is loaded, load any preceding tiles we have - // pending - if (tile.isLoaded()) { - if (tilesToLoad.size() > 0) { - loadTiles(tid, tilesToLoad); - } - tilesToLoad.clear(); - } else { - tilesToLoad.add(tile); - } - } - - if (tilesToLoad.size() > 0) { - loadTiles(tid, tilesToLoad); - } - - return tiles; - } - - private void loadTiles(int tid, List tiles) throws IOException, URISyntaxException { - - int start = tiles.get(0).start; - int end = tiles.get(tiles.size() - 1).end; - ArrayList iter; - - // log.info("Loading tiles in range : " + start + " - " + end); - // int alignmentCount = 0; - // long t0 = System.currentTimeMillis(); - - // iter = ds.getReader().query(seq, start, end, false); - iter = readRawRange(tid, start, end); - - // while (iter.hasNext()) { - for (TabixLine record : iter) { - // SAMRecord record = iter.next(); - // System.out.println("Processing: " + record.line()); - // Range of tile indices that this alignment contributes to. - int aStart = record.beg;// record.getAlignmentStart(); - int aEnd = record.end;// getAlignmentEnd();// record.getEnd(); - int idx0 = Math.max(0, (aStart - start) / tileSize); - int idx1 = Math.min(tiles.size() - 1, (record.end - start) / tileSize); - - // Loop over tiles this read overlaps - for (int i = idx0; i <= idx1; i++) { - Tile t = tiles.get(i); - - // if ((aStart >= t.start) && (aEnd < t.end)) { - // t.containedRecords.add(record); - // } else - if ((aEnd >= t.start) && (aStart < t.end)) { - t.overlappingRecords.add(record); - } - } - - // alignmentCount++; - } - // log.info("Read count="+SeekableFileStream.readCount); - - for (Tile t : tiles) { - t.setLoaded(true); - } - } - - private ArrayList readRange(int tid, int beg, int end) throws IOException, URISyntaxException { - int startTile = (beg + 1) / tileSize; - int endTile = end / tileSize; // <= inclusive - List tiles = getTiles(tid, startTile, endTile); - - if (tiles.size() == 0) { - return empty; - } - // System.out.println("ReadRange: " + beg + "\t" + end + "\t" + - // startTile + "\t" + endTile + "\t" + tileSize); - // Count total # of records - int recordCount = tiles.get(0).getOverlappingRecords().size(); - for (Tile t : tiles) { - recordCount += t.getOverlappingRecords().size(); - } - - ArrayList alignments = new ArrayList(recordCount); - // alignments.addAll(tiles.get(0).getOverlappingRecords()); - for (Tile t : tiles) { - // System.out.println("Tile: " + t.getContainedRecords()); - // FIXME may introduce duplicates, although it shouldn't - alignments.addAll(t.getOverlappingRecords()); - } - - // for (TabixLine tl : alignments) - // System.out.println("\t" + tl.line()); - - return alignments;// new TiledIterator(start, end, alignments); - } - - /** - * Read a range from the compressed GFF-file. - * - * @param tid - * the sequence number (0 based) - * @param beg - * begin of range - * @param end - * end of range - * @return A list of Strings, one GFF entry a line. - * @throws URISyntaxException - */ - private ArrayList readRawRange(int tid, int beg, int end) throws IOException, URISyntaxException { - - ArrayList output = new ArrayList(); - - ArrayList off = get_chunk_coordinates(tid, beg, end); - - if (off.size() == 0) - return output; - - LineBlockCompressedInputStream in = new LineBlockCompressedInputStream(data.stream()); - - // System.out.println("Reading raw: " + tid + " " + beg + " " + end + - // " " + off); - - for (Pair64 bin : off) { - - // seek to beginning of block - in.seek(bin.start); - // keep reading until end of block - - /* - * Checking the file pointer is not a good thing to check here as it is wrapped - * in a buffered reader that will put the pointer way forward. - */ - while (in.getFilePointer() >= 0 /* && in.getFilePointer() < bin.end */) { - // System.out.println("FP1: " + in.getFilePointer() + "\t" + - // bin.end); - TabixLine intv = this.readParsedLine(in, tid, beg, end);// Line(in); - if (intv == null) - break; - if (intv.end > end) - break; - // System.out.println("Raw line: " + intv.line()); - // System.out.println("\t" + intv.line().length()); - // System.out.println("\ttid: " + tid + "\t" + intv.tid); - // System.out.println("\tmeta: " + intv.meta); - // System.out.println("\tFP2: " + in.getFilePointer() + "\t" + - // bin.end); - // if it's not a comment, the sequence id is correct, we are not - // seeking beyond the requested end yet - // and the found entry overlaps with our request: we found a GFF - // entry. - if (intv.meta) - continue; - else - // if (line.charAt(0) != idx.meta) { - // try { - // //ParsedLine intv = get_intv(line); - // // log.info("$"+intv.beg+" "+intv.end+"$-"+line); - if (intv.tid == tid && intv.beg < end) { - if (is_overlap(beg, end, intv.beg, intv.end)) { - output.add(intv); - } - } - // } catch (NumberFormatException nf) { - // throw new IOException("Problems while parsing: " + line+ - // "\n\tReadRange: " + beg + "\t" + end); - // } - // } - } - } - in.close(); - // this.entriesFound = output.size(); - return output; - } - - /** - * Reads a parsed line from a BlockCompressedInputStream without using a - * buffer. This enables us to control the filePointer on every line read. - * - * - * @param in - * @param end - * @param beg - * @param tid - * @return - * @throws IOException - */ - private TabixLine readParsedLine(LineBlockCompressedInputStream in, int tid, int beg, int end) throws IOException { - - TabixLine p = new TabixLine(); - - String line = in.readLine(); - if (line == null) - return null; - p.setLine(line); - p.parse(idx, '\t'); - - return p; - } - - // /** - // * Take a line from the indexed file and retrieve the essential fields, - // * according to the column numbers read at the beginning of the index - // file. - // * - // * This could be extended with file specific exceptions (SAM preset, UCSC - // * flag, etc...). See original C-code. annotated_c_project/index.c - // starting - // * line 149 - // * - // * @param str - // * GFF entry - // * @return a parsed GFF line with begin, end, sequence id and bin - // */ - // private ParsedLine get_intv(String str) { - // ParsedLine intv = new ParsedLine(); - // - // String[] arr = str.split("\t"); - // intv.tid = idx.names.indexOf(arr[(int) idx.sc - 1]); - // intv.beg = Integer.parseInt(arr[(int) idx.bc - 1]); - // intv.end = Integer.parseInt(arr[(int) idx.ec - 1]); - // - // // Scanner parseLine = new Scanner(str); - // // parseLine.useDelimiter("\t"); - // // int col = 1; - // // while (parseLine.hasNext()) { - // // String content = parseLine.next(); - // // if (col == idx.sc) { - // // // sequence - // // intv.tid = idx.names.indexOf(content); - // // } - // // if (col == idx.bc) { - // // // start - // // intv.beg = Integer.parseInt(content); - // // } - // // if (col == idx.ec) { - // // // end - // // intv.end = Integer.parseInt(content); - // // } - // // col++; - // // } - // intv.payload = str; - // - // intv.bin = ti_reg2bin(intv.beg, intv.end); - // return intv; - // } - - private String lastSeq = null; - private int lastStart = -1; - private int lastEnd = -1; - private ArrayList lastList = null; - - // @Override - public synchronized Iterable query(String sequence, int start, int end) throws IOException, - URISyntaxException { - if (!idx.names.contains(sequence)) - return null; - if (sequence.equals(lastSeq) && start >= lastStart && end <= lastEnd) - return lastList; - - int tid = idx.names.indexOf(sequence); - ArrayList entryList = this.readRange(tid, start, end); - lastSeq = sequence; - lastStart = start; - lastEnd = end; - lastList = entryList; - - return entryList; - } - - // /** - // * @return the number of entries found in the last query - // */ - // public int entriesFound() { - // return this.entriesFound; - // } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#read(net.sf.jannot.EntrySet) - */ - @Override - public EntrySet read(EntrySet add) throws ReadFailedException { - if (add == null) - add = new EntrySet(); - // System.out.println("Tabix names: " + idx.names); - - for (String name : idx.names) { - Entry e = add.getOrCreateEntry(name); - // System.out.println("Adding e: " + e); - /* This should be done better, but for now I have no idea how */ - if (data.isPileup()) - e.add(new StringKey(data.toString()), new PileupWrapper(name, this, idx)); - else if (data.toString().toLowerCase().contains(".swig") || data.toString().toLowerCase().contains(".tab") - || data.toString().toLowerCase().contains(".tsv")) - e.add(new StringKey(data.toString()), new SWigWrapper(name, this, idx)); - else if (data.toString().toLowerCase().contains(".bed")) - e.add(Type.get(data.toString()), new BEDWrapper(name, this, idx)); - else if (data.toString().toLowerCase().contains(".gff")) - e.add(Type.get(data.toString()), new GFFWrapper(name, this, idx)); - else if (data.isVCF()) { - e.add(Type.get(data.toString()), new VCFWrapper(name, this, idx)); - } else - log.severe("Don't now how to read this file, can't figure out the type: " + data); - } - return add; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#isIndexed() - */ - @Override - public boolean isIndexed() { - return true; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#size() - */ - @Override - public long size() { - return size; - } - -} - -/** - * - * Organized content of an index file - */ -class TabIndex { - - /** - * File identifier magic. Should be \1 - */ - String magic; - - /** - * Preset mask (for db specific settings?) - */ - long preset; - - /** - * Column number with sequence name - */ - long sc; - /** - * Column number with starting nt - */ - long bc; - /** - * Column number with ending nt - */ - long ec; - - /** - * Defines the character for meta information. Comment lines, normally set - * to '#' - */ - char meta; - - /** - * List of mappings (key to binlist), one per sequence. - */ - HashMap>[] index; - - /** - * Linear indexes, one per sequence - */ - ArrayList[] linIndex; - - /** - * Sequence list - */ - List names = new ArrayList(); - - /** - * Create a new TabIndex - * - * @param size - * the number of sequences in the index - */ - public TabIndex(int size) { - index = new HashMap[size]; - linIndex = new ArrayList[size]; - for (int i = 0; i < size; i++) { - index[i] = new HashMap>(); - linIndex[i] = new ArrayList(); - } - } - - public int size() { - return index.length; - } - -} diff --git a/src/net/sf/jannot/tabix/Pair64.java b/src/net/sf/jannot/tabix/Pair64.java deleted file mode 100644 index a368bf7..0000000 --- a/src/net/sf/jannot/tabix/Pair64.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix; - -/** - * Pair of longs - * - * @author Thomas Abeel, Thomas Van Parys - * - */ -public class Pair64 implements Comparable{ - /** - * Pair value - */ - public long start, end; - - public Pair64(long u, long v) { - this.start = u; - this.end = v; - } - - @Override - public int compareTo(Pair64 o) { - long a = this.start; - long b = o.start; - if (a < b) - return -1; - else if (a == b) - return 0; - else - return 1; - } - - @Override - public String toString() { - final long compressedOffset = start >> 16; - final int uncompressedOffset = (int) (start & 0xFFFF); - final long compressedOffsetE = end >> 16; - final int uncompressedOffsetE = (int) (end & 0xFFFF); - return compressedOffset + "," + uncompressedOffset + "\t" + compressedOffsetE + "," + uncompressedOffsetE; - } - -} - diff --git a/src/net/sf/jannot/tabix/PileupWrapper.java b/src/net/sf/jannot/tabix/PileupWrapper.java deleted file mode 100644 index 2347230..0000000 --- a/src/net/sf/jannot/tabix/PileupWrapper.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix; - -import java.io.IOException; -import java.net.URISyntaxException; - -import net.sf.jannot.pileup.DoublePile; -import net.sf.jannot.pileup.PileNormalization; -import net.sf.jannot.tabix.codec.PileupCodec; - -public class PileupWrapper extends TabixWrapper implements PileNormalization { - - PileupWrapper(String key, IndexedFeatureFile data, TabIndex idx) { - super(key, data, idx); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - try { - return new PileupCodec(data.query(key, start, end)); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - - @Override - public boolean supportsNormalization() { - return false; - } - -} \ No newline at end of file diff --git a/src/net/sf/jannot/tabix/RuntimeEOFException.java b/src/net/sf/jannot/tabix/RuntimeEOFException.java deleted file mode 100644 index 583acef..0000000 --- a/src/net/sf/jannot/tabix/RuntimeEOFException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2009 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package net.sf.jannot.tabix; - - -/** - * Thrown by various codecs to indicate EOF without having to clutter the API with throws clauses - */ -public class RuntimeEOFException extends RuntimeException { - public RuntimeEOFException() { - } - - public RuntimeEOFException(final String s) { - super(s); - } - - public RuntimeEOFException(final String s, final Throwable throwable) { - super(s, throwable); - } - - public RuntimeEOFException(final Throwable throwable) { - super(throwable); - } -} diff --git a/src/net/sf/jannot/tabix/RuntimeIOException.java b/src/net/sf/jannot/tabix/RuntimeIOException.java deleted file mode 100644 index 8d7e655..0000000 --- a/src/net/sf/jannot/tabix/RuntimeIOException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2009 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package net.sf.jannot.tabix; - - -/** - * Thrown by various IO classes to indicate IOException without having to clutter the API with throws clauses - */ -public class RuntimeIOException extends RuntimeException { - public RuntimeIOException() { - } - - public RuntimeIOException(final String s) { - super(s); - } - - public RuntimeIOException(final String s, final Throwable throwable) { - super(s, throwable); - } - - public RuntimeIOException(final Throwable throwable) { - super(throwable); - } -} diff --git a/src/net/sf/jannot/tabix/SWigWrapper.java b/src/net/sf/jannot/tabix/SWigWrapper.java deleted file mode 100644 index a899027..0000000 --- a/src/net/sf/jannot/tabix/SWigWrapper.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix; - -import java.io.IOException; -import java.net.URISyntaxException; - -import net.sf.jannot.pileup.DoublePile; -import net.sf.jannot.pileup.Pile; -import net.sf.jannot.pileup.PileNormalization; -import net.sf.jannot.tabix.codec.SWigCodec; - -public class SWigWrapper extends TabixWrapper implements PileNormalization { - - SWigWrapper(String key, IndexedFeatureFile data, TabIndex idx) { - super(key, data, idx); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - try { - return new SWigCodec(data.query(key, start, end)); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - - @Override - public boolean supportsNormalization() { - return false; - } - -} \ No newline at end of file diff --git a/src/net/sf/jannot/tabix/TabixFileConstants.java b/src/net/sf/jannot/tabix/TabixFileConstants.java deleted file mode 100644 index 3718739..0000000 --- a/src/net/sf/jannot/tabix/TabixFileConstants.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2009 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package net.sf.jannot.tabix; - -/** - * Constants used in reading & writing BAM files - */ -class TabixFileConstants { - /** - * The beginning of a BAMRecord is a fixed-size block of 8 int32s - */ - static final int FIXED_BLOCK_SIZE = 8 * 4; - - /** - * Sanity check -- we never expect BAMRecords to be as big as this. - */ - static final int MAXIMUM_RECORD_LENGTH = 1024 * 1024; - - /** - * BAM file magic number. This is what is present in the gunzipped version of the file, - * which never exists on disk. - */ - - static final byte[] BAM_MAGIC = "BAM\1".getBytes(); - /** - * BAM index file magic number. - */ - static final byte[] BAM_INDEX_MAGIC = "BAI\1".getBytes(); -} diff --git a/src/net/sf/jannot/tabix/TabixFileIndex.java b/src/net/sf/jannot/tabix/TabixFileIndex.java deleted file mode 100644 index 61bcfe9..0000000 --- a/src/net/sf/jannot/tabix/TabixFileIndex.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * The MIT License - * - * Copyright (c) 2009 The Broad Institute - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package net.sf.jannot.tabix; - - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.nio.ByteOrder; -import java.nio.MappedByteBuffer; -import java.nio.channels.FileChannel; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.BitSet; -import java.util.Collections; -import java.util.List; - -/** - * Internal class for reading BAM file indexes. - */ -class TabixFileIndex -{ - private static final int MAX_BINS = 37450; // =(8^6-1)/7+1 - private static final int BAM_LIDX_SHIFT = 16; - - private File mFile = null; - private FileInputStream mFileStream = null; - private FileChannel mFileChannel = null; - private MappedByteBuffer mFileBuffer = null; - - - TabixFileIndex(final File file) { - mFile = file; - } - - void close() { - closeFileStream(); - } - - /** - * Get list of regions of BAM file that may contain SAMRecords for the given range - * @param referenceIndex sequence of desired SAMRecords - * @param startPos 1-based start of the desired interval, inclusive - * @param endPos 1-based end of the desired interval, inclusive - * @return array of pairs of virtual file positions. Each pair is the first and last - * virtual file position in a range that can be scanned to find SAMRecords that overlap the given - * positions. The last position in each pair is a virtual file pointer to the first SAMRecord beyond - * the range that may contain the indicated SAMRecords. - */ - long[] getSearchBins(final int referenceIndex, final int startPos, final int endPos) { - - openIndex(); - seek(4); - - final int sequenceCount = readInteger(); - System.out.println("# Sequence count: " + sequenceCount); - if (referenceIndex >= sequenceCount) { - return null; - } - - final BitSet regionBins = regionToBins(startPos, endPos); - if (regionBins == null) { - return null; - } - - skipToSequence(referenceIndex); - - // System.out.println("# Sequence target TID: " + referenceIndex); - final int nIndexBins = readInteger(); - // System.out.println("# nBins: " + nIndexBins); - if (nIndexBins == 0) { - return null; - } - - List chunkList = new ArrayList(); - for (int i = 0; i < nIndexBins; i++) { - final int indexBin = readInteger(); - final int nChunks = readInteger(); - // System.out.println("# bin[" + i + "] = " + indexBin + ", nChunks = " + nChunks); - if (regionBins.get(indexBin)) { - for (int ci = 0; ci < nChunks; ci++) { - final long chunkBegin = readLong(); - final long chunkEnd = readLong(); - chunkList.add(new Chunk(chunkBegin, chunkEnd)); - } - } else { - skipBytes(16 * nChunks); - } - } - - if (chunkList.isEmpty()) { - return null; - } - - final int start = (startPos <= 0) ? 0 : startPos-1; - final int regionLinearBin = start >> BAM_LIDX_SHIFT; - final int nLinearBins = readInteger(); - // System.out.println("# nLinearBins: " + nLinearBins); - // System.out.println("# regionLinearBin: " + regionLinearBin); - long minimumOffset = 0; - if (regionLinearBin < nLinearBins) { - skipBytes(8 * regionLinearBin); - minimumOffset = readLong(); - } - chunkList = optimizeChunkList(chunkList, minimumOffset); - return convertToArray(chunkList); - } - - /** - * Use to get close to the unmapped reads at the end of a BAM file. - * @return The file offset of the first record in the last linear bin, or -1 - * if there are no elements in linear bins (i.e. no mapped reads). - */ - long getStartOfLastLinearBin() { - openIndex(); - seek(4); - - final int sequenceCount = readInteger(); - // Because no reads may align to the last sequence in the sequence dictionary, - // grab the last element of the linear index for each sequence, and return - // the last one from the last sequence that has one. - long lastLinearIndexPointer = -1; - for (int i = 0; i < sequenceCount; i++) { - // System.out.println("# Sequence TID: " + i); - final int nBins = readInteger(); - // System.out.println("# nBins: " + nBins); - for (int j1 = 0; j1 < nBins; j1++) { - // Skip bin # - skipBytes(4); - final int nChunks = readInteger(); - // Skip chunks - skipBytes(16 * nChunks); - } - final int nLinearBins = readInteger(); - if (nLinearBins > 0) { - // Skip to last element of list of linear bins - skipBytes(8 * (nLinearBins - 1)); - lastLinearIndexPointer = readLong(); - } - } - return lastLinearIndexPointer; - } - - private void skipToSequence(final int sequenceIndex) { - for (int i = 0; i < sequenceIndex; i++) { - // System.out.println("# Sequence TID: " + i); - final int nBins = readInteger(); - // System.out.println("# nBins: " + nBins); - for (int j = 0; j < nBins; j++) { - final int bin = readInteger(); - final int nChunks = readInteger(); - // System.out.println("# bin[" + j + "] = " + bin + ", nChunks = " + nChunks); - skipBytes(16 * nChunks); - } - final int nLinearBins = readInteger(); - // System.out.println("# nLinearBins: " + nLinearBins); - skipBytes(8 * nLinearBins); - } - } - - private List optimizeChunkList(final List chunkList, final long minimumOffset) { - Chunk lastChunk = null; - Collections.sort(chunkList); - final List result = new ArrayList(); - for (final Chunk chunk : chunkList) { - if (chunk.getChunkEnd() <= minimumOffset) { - continue; - } - if (result.isEmpty()) { - result.add(chunk); - lastChunk = chunk; - continue; - } - // Coalesce chunks that are in adjacent file blocks. - // This is a performance optimization. - final long lastFileBlock = getFileBlock(lastChunk.getChunkEnd()); - final long chunkFileBlock = getFileBlock(chunk.getChunkStart()); - if (chunkFileBlock - lastFileBlock > 1) { - result.add(chunk); - lastChunk = chunk; - } else { - if (chunk.getChunkEnd() > lastChunk.getChunkEnd()) { - lastChunk.setChunkEnd(chunk.getChunkEnd()); - } - } - } - return result; - } - - private long[] convertToArray(final List chunkList) { - final int count = chunkList.size() * 2; - if (count == 0) { - return null; - } - int index = 0; - final long[] result = new long[count]; - for (final Chunk chunk : chunkList) { - result[index++] = chunk.getChunkStart(); - result[index++] = chunk.getChunkEnd(); - } - return result; - } - - /** - * Get candidate bins for the specified region - * @param startPos 1-based start of target region, inclusive. - * @param endPos 1-based end of target region, inclusive. - * @return bit set for each bin that may contain SAMRecords in the target region. - */ - private BitSet regionToBins(final int startPos, final int endPos) { - final int maxPos = 0x1FFFFFFF; - final int start = (startPos <= 0) ? 0 : (startPos-1) & maxPos; - final int end = (endPos <= 0) ? maxPos : (endPos-1) & maxPos; - if (start > end) { - return null; - } - int k; - final BitSet bitSet = new BitSet(MAX_BINS); - bitSet.set(0); - for (k = 1 + (start>>26); k <= 1 + (end>>26); ++k) bitSet.set(k); - for (k = 9 + (start>>23); k <= 9 + (end>>23); ++k) bitSet.set(k); - for (k = 73 + (start>>20); k <= 73 + (end>>20); ++k) bitSet.set(k); - for (k = 585 + (start>>17); k <= 585 + (end>>17); ++k) bitSet.set(k); - for (k = 4681 + (start>>14); k <= 4681 + (end>>14); ++k) bitSet.set(k); - return bitSet; - } - - private long getFileBlock(final long bgzfOffset) { - return ((bgzfOffset >> 16L) & 0xFFFFFFFFFFFFL); - } - - private void openIndex() { - if (mFileBuffer != null) { - return; - } - openFileStream(); - seek(0); - final byte[] buffer = new byte[4]; - readBytes(buffer); - if (!Arrays.equals(buffer, TabixFileConstants.BAM_INDEX_MAGIC)) { - // closeFileStream(); - System.err.println("Invalid file header in BAM index " + mFile + - ": " + new String(buffer)); - } - } - - private void readBytes(final byte[] buffer) { - mFileBuffer.get(buffer); - } - - private int readInteger() { - return mFileBuffer.getInt(); - } - - private long readLong() { - return mFileBuffer.getLong(); - } - - private void skipBytes(final int count) { - mFileBuffer.position(mFileBuffer.position() + count); - } - - private void seek(final int position) { - mFileBuffer.position(position); - } - - private void openFileStream() { - if (mFileStream != null) { - return; - } - try { - mFileStream = new FileInputStream(mFile); - mFileChannel = mFileStream.getChannel(); - mFileBuffer = mFileChannel.map(FileChannel.MapMode.READ_ONLY, 0L, mFileChannel.size()); - mFileBuffer.order(ByteOrder.LITTLE_ENDIAN); - } catch (IOException exc) { - throw new RuntimeIOException(exc.getMessage(), exc); - } - } - - private void closeFileStream() { - try { - mFileBuffer = null; - if (mFileChannel != null) { - mFileChannel.close(); - mFileChannel = null; - } - if (mFileStream != null) { - mFileStream.close(); - mFileStream = null; - } - } catch (IOException exc) { - throw new RuntimeIOException(exc.getMessage(), exc); - } - } - - private static class Chunk - implements Comparable { - - private long mChunkStart; - private long mChunkEnd; - - Chunk(final long start, final long end) { - mChunkStart = start; - mChunkEnd = end; - } - - long getChunkStart() { - return mChunkStart; - } - - void setChunkStart(final long value) { - mChunkStart = value; - } - - long getChunkEnd() { - return mChunkEnd; - } - - void setChunkEnd(final long value) { - mChunkEnd = value; - } - - public int compareTo(final Chunk chunk) { - int result = Long.signum(mChunkStart - chunk.mChunkStart); - if (result == 0) { - result = Long.signum(mChunkEnd - chunk.mChunkEnd); - } - return result; - } - - @Override - public boolean equals(final Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - final Chunk chunk = (Chunk) o; - - if (mChunkEnd != chunk.mChunkEnd) return false; - if (mChunkStart != chunk.mChunkStart) return false; - - return true; - } - - @Override - public int hashCode() { - int result = (int) (mChunkStart ^ (mChunkStart >>> 32)); - result = 31 * result + (int) (mChunkEnd ^ (mChunkEnd >>> 32)); - return result; - } - } -} diff --git a/src/net/sf/jannot/tabix/TabixLine.java b/src/net/sf/jannot/tabix/TabixLine.java deleted file mode 100644 index 8d80a33..0000000 --- a/src/net/sf/jannot/tabix/TabixLine.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix; - -import java.util.ArrayList; - -/** - * - * @author Thomas Abeel - * - */ -public class TabixLine { - // /* Buffer for individual columns */ - private ArrayList buffer = new ArrayList(); - // /* Buffer for current column */ - // private StringBuffer current = new StringBuffer(); - int tid; - public int beg; - public int end; - // private int bin; - /* Indicates comment lines or other useless lines, like empty ones */ - boolean meta = false; - private String line; - - // private String[] payload; - - public String line() { - return line; - } - - public String get(int idx) { - return buffer.get(idx); - } - - public int getInt(int idx) { - return Integer.parseInt(get(idx)); - } - - public double getDouble(int idx) { - return Double.parseDouble(get(idx)); - } - - // private int ti_reg2bin(int beg, int end) { - // --end; - // if (beg >>> 14 == end >>> 14) - // return 4681 + (beg >>> 14); - // if (beg >>> 17 == end >>> 17) - // return 585 + (beg >>> 17); - // if (beg >>> 20 == end >>> 20) - // return 73 + (beg >>> 20); - // if (beg >>> 23 == end >>> 23) - // return 9 + (beg >>> 23); - // if (beg >>> 26 == end >>> 26) - // return 1 + (beg >>> 26); - // return 0; - // } - - // /** - // * Add one single character to the column that's currently being read. - // * - // * @param c - // */ - // public void add(char c) { - // current.append(c); - // } - - // /** - // * Set the current column to the given string and jump to next column. - // * - // * @param col - // */ - // public void setColumn(String col){ - // buffer.add(col); - // current = new StringBuffer(); - // } - - // /** - // * Go to the next column - // * - // */ - // public void next() { - // buffer.add(current.toString()); - // current = new StringBuffer(); - // - // } - - public void parse(TabIndex idx, char split) { - // /* Make sure to add last column */ - // buffer.add(current.toString()); - // current=null; - /* Handle empty lines */ - if (line.length() == 0) { - this.meta = true; - return; - } - StringBuffer tmp = new StringBuffer(); - for (int i = 0; i < line.length(); i++) { - char c = line.charAt(i); - if (c == split) { - buffer.add(tmp.toString()); - tmp = new StringBuffer(); - } else { - tmp.append(c); - - } - - } - - buffer.add(tmp.toString()); - - this.tid = idx.names.indexOf(buffer.get((int) idx.sc - 1)); - this.beg = Integer.parseInt(buffer.get((int) idx.bc - 1).toString()); - if(idx.ec>0) - this.end = Integer.parseInt(buffer.get((int) idx.ec - 1).toString()); - else - this.end=beg; - // this.bin = ti_reg2bin(this.beg, this.end); - // payload=buffer.toArray(new String[0]); - // buffer=null; - } - - /** - * @return - */ - public int length() { - return buffer.size(); - } - - /** - * @param line - */ - public void setLine(String line) { - this.line = line; - - } - - // /** - // * @return - // */ - // public String[] getPayload() { - // return payload; - // } -} \ No newline at end of file diff --git a/src/net/sf/jannot/tabix/TabixReader.java b/src/net/sf/jannot/tabix/TabixReader.java deleted file mode 100644 index 6a70bdb..0000000 --- a/src/net/sf/jannot/tabix/TabixReader.java +++ /dev/null @@ -1,493 +0,0 @@ -/* The MIT License - - Copyright (c) 2010 Broad Institute. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - */ -/* Contact: Heng Li */ - -package net.sf.jannot.tabix; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.URISyntaxException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Set; - -import net.sf.jannot.picard.LineBlockCompressedInputStream; -import net.sf.jannot.source.Locator; -import net.sf.samtools.util.BlockCompressedInputStream; -import net.sf.samtools.seekablestream.SeekableFileStream; -import net.sf.samtools.seekablestream.SeekableHTTPStream; - -/** - * @author tarkvara - * - */ -public class TabixReader { - - //FIXME duplication with IndexedFeatureFile - protected Locator mFn; - private BlockCompressedInputStream mFp; - - protected int mPreset; - protected int mSc; - protected int mBc; - protected int mEc; - protected int mMeta; - protected int mSkip; - protected String[] mSeq; - - protected HashMap mChr2tid; - - private static int MAX_BIN = 37450; - private static int TAD_MIN_CHUNK_GAP = 32768; - protected static int TAD_LIDX_SHIFT = 14; - - protected class TPair64 implements Comparable { - long u, v; - - public TPair64(final long _u, final long _v) { - u = _u; - v = _v; - } - - public TPair64(final TPair64 p) { - u = p.u; - v = p.v; - } - - public int compareTo(final TPair64 p) { - return u == p.u ? 0 : ((u < p.u) ^ (u < 0) ^ (p.u < 0)) ? -1 : 1; // unsigned - // 64-bit - // comparison - } - }; - - protected class TIndex { - HashMap b; // binning index - long[] l; // linear index - }; - - private TIndex[] mIndex; - - protected class TIntv { - int tid, beg, end, bin; - }; - - private static boolean less64(final long u, final long v) { // unsigned - // 64-bit - // comparison - return (u < v) ^ (u < 0) ^ (v < 0); - } - - /** - * The constructor - * - * @param fn - * File name of the data file - * @throws URISyntaxException - */ - public TabixReader(Locator data) throws IOException, URISyntaxException { - - if (!data.isURL()) - mFp = new LineBlockCompressedInputStream(new SeekableFileStream(data.file())); - else - mFp = new LineBlockCompressedInputStream(new SeekableHTTPStream(data.url())); - mFn = data; -// data. -// mFp = new BlockCompressedInputStream(new File(fn)); - - File indexFile = new File(mFn + ".tbi"); - if (indexFile.exists()) { - readIndex(indexFile); - } - } - -// public TabixReader(final URL url, final File index) throws IOException { -// mFn = url.toString(); -// mFp = new BlockCompressedInputStream(url); -// readIndex(index); -// } - - private static int reg2bins(final int beg, final int _end, final int[] list) { - int i = 0, k, end = _end; - if (beg >= end) - return 0; - if (end >= 1 << 29) - end = 1 << 29; - --end; - list[i++] = 0; - for (k = 1 + (beg >> 26); k <= 1 + (end >> 26); ++k) - list[i++] = k; - for (k = 9 + (beg >> 23); k <= 9 + (end >> 23); ++k) - list[i++] = k; - for (k = 73 + (beg >> 20); k <= 73 + (end >> 20); ++k) - list[i++] = k; - for (k = 585 + (beg >> 17); k <= 585 + (end >> 17); ++k) - list[i++] = k; - for (k = 4681 + (beg >> 14); k <= 4681 + (end >> 14); ++k) - list[i++] = k; - return i; - } - - public static int readInt(final InputStream is) throws IOException { - byte[] buf = new byte[4]; - is.read(buf); - return ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN).getInt(); - } - - public static long readLong(final InputStream is) throws IOException { - byte[] buf = new byte[8]; - is.read(buf); - return ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN).getLong(); - } - - public static String readLine(final InputStream is) throws IOException { - StringBuffer buf = new StringBuffer(); - int c; - while ((c = is.read()) >= 0 && c != '\n') - buf.append((char) c); - if (c < 0) - return null; - return buf.toString(); - } - - /** - * Read the Tabix index from a file - * - * @param fp - * File pointer - */ - public final void readIndex(final File fp) throws IOException { - if (fp == null) - return; - BlockCompressedInputStream is = new BlockCompressedInputStream(fp); - byte[] buf = new byte[4]; - - is.read(buf, 0, 4); // read "TBI\1" - mSeq = new String[readInt(is)]; // # sequences - mChr2tid = new HashMap(); - mPreset = readInt(is); - mSc = readInt(is); - mBc = readInt(is); - mEc = readInt(is); - mMeta = readInt(is); - mSkip = readInt(is); - // read sequence dictionary - int i, j, k, l = readInt(is); - buf = new byte[l]; - is.read(buf); - for (i = j = k = 0; i < buf.length; ++i) { - if (buf[i] == 0) { - byte[] b = new byte[i - j]; - System.arraycopy(buf, j, b, 0, b.length); - String s = new String(b); - mChr2tid.put(s, k); - mSeq[k++] = s; - j = i + 1; - } - } - // read the index - mIndex = new TIndex[mSeq.length]; - for (i = 0; i < mSeq.length; ++i) { - // the binning index - int n_bin = readInt(is); - mIndex[i] = new TIndex(); - mIndex[i].b = new HashMap(); - for (j = 0; j < n_bin; ++j) { - int bin = readInt(is); - TPair64[] chunks = new TPair64[readInt(is)]; - for (k = 0; k < chunks.length; ++k) { - long u = readLong(is); - long v = readLong(is); - chunks[k] = new TPair64(u, v); // in C, this is inefficient - } - mIndex[i].b.put(bin, chunks); - } - // the linear index - mIndex[i].l = new long[readInt(is)]; - for (k = 0; k < mIndex[i].l.length; ++k) - mIndex[i].l[k] = readLong(is); - } - // close - is.close(); - } - - /** - * Read the Tabix index from the default file. - */ - public void readIndex() throws IOException { - readIndex(new File(mFn + ".tbi")); - } - - /** - * Read one line from the data file. - */ - public String readLine() throws IOException { - return readLine(mFp); - } - - protected int chr2tid(final String chr) { - if (mChr2tid.containsKey(chr)) - return mChr2tid.get(chr); - else - return -1; - } - - /** - * Parse a region in the format of "chr1", "chr1:100" or "chr1:100-1000" - * - * @param reg - * Region string - * @return An array where the three elements are sequence_id, region_begin - * and region_end. On failure, sequence_id==-1. - */ - public int[] parseReg(final String reg) { // FIXME: NOT working when the - // sequence name contains : or - // -. - String chr; - int colon, hyphen; - int[] ret = new int[3]; - colon = reg.indexOf(':'); - hyphen = reg.indexOf('-'); - chr = colon >= 0 ? reg.substring(0, colon) : reg; - ret[1] = colon >= 0 ? Integer.parseInt(reg.substring(colon + 1, hyphen >= 0 ? hyphen : reg.length())) - 1 : 0; - ret[2] = hyphen >= 0 ? Integer.parseInt(reg.substring(hyphen + 1)) : 0x7fffffff; - ret[0] = chr2tid(chr); - return ret; - } - - protected TIntv getIntv(final String s) { - TIntv intv = new TIntv(); - int col = 0, end = 0, beg = 0; - while ((end = s.indexOf('\t', beg)) >= 0 || end == -1) { - ++col; - if (col == mSc) { - intv.tid = chr2tid(s.substring(beg, end)); - } else if (col == mBc) { - intv.beg = intv.end = Integer.parseInt(s.substring(beg, end)); - if ((mPreset & 0x10000) != 0) - ++intv.end; - else - --intv.beg; - if (intv.beg < 0) - intv.beg = 0; - if (intv.end < 1) - intv.end = 1; - } else { // FIXME: SAM supports are not tested yet - if ((mPreset & 0xffff) == 0) { // generic - if (col == mEc) - intv.end = Integer.parseInt(s.substring(beg, end)); - } else if ((mPreset & 0xffff) == 1) { // SAM - if (col == 6) { // CIGAR - int l = 0, i, j; - String cigar = s.substring(beg, end); - for (i = j = 0; i < cigar.length(); ++i) { - if (cigar.charAt(i) > '9') { - int op = cigar.charAt(i); - if (op == 'M' || op == 'D' || op == 'N') - l += Integer.parseInt(cigar.substring(j, i)); - } - } - intv.end = intv.beg + l; - } - } else if ((mPreset & 0xffff) == 2) { // VCF - String alt; - alt = end >= 0 ? s.substring(beg, end) : s.substring(beg); - if (col == 4) { // REF - if (alt.length() > 0) - intv.end = intv.beg + alt.length(); - } else if (col == 8) { // INFO - int e_off = -1, i = alt.indexOf("END="); - if (i == 0) - e_off = 4; - else if (i > 0) { - i = alt.indexOf(";END="); - if (i >= 0) - e_off = i + 5; - } - if (e_off > 0) { - i = alt.indexOf(";", e_off); - intv.end = Integer.parseInt(i > e_off ? alt.substring(e_off, i) : alt.substring(e_off)); - } - } - } - } - if (end == -1) - break; - beg = end + 1; - } - return intv; - } - - public Set getReferenceNames() { - return mChr2tid.keySet(); - } - - public class Iterator { - private int i, n_seeks; - private int tid, beg, end; - private TPair64[] off; - private long curr_off; - private boolean iseof; - - Iterator(final int _tid, final int _beg, final int _end, final TPair64[] _off) { - i = -1; - n_seeks = 0; - curr_off = 0; - iseof = false; - off = _off; - tid = _tid; - beg = _beg; - end = _end; - } - - public String next() throws IOException { - if (iseof) - return null; - for (;;) { - if (curr_off == 0 || !less64(curr_off, off[i].v)) { // then jump - // to the - // next - // chunk - if (i == off.length - 1) - break; // no more chunks - if (i >= 0) - assert (curr_off == off[i].v); // otherwise bug - if (i < 0 || off[i].v != off[i + 1].u) { // not adjacent - // chunks; then - // seek - mFp.seek(off[i + 1].u); - curr_off = mFp.getFilePointer(); - ++n_seeks; - } - ++i; - } - String s; - if ((s = readLine(mFp)) != null) { - TIntv intv; - char[] str = s.toCharArray(); - curr_off = mFp.getFilePointer(); - if (str.length == 0 || str[0] == mMeta) - continue; - intv = getIntv(s); - if (intv.tid != tid || intv.beg >= end) - break; // no need to proceed - else if (intv.end > beg && intv.beg < end) - return s; // overlap; return - } else - break; // end of file - } - iseof = true; - return null; - } - }; - - public Iterator query(final int tid, final int beg, final int end) { - TPair64[] off, chunks; - long min_off; - TIndex idx = mIndex[tid]; - int[] bins = new int[MAX_BIN]; - int i, l, n_off, n_bins = reg2bins(beg, end, bins); - if (idx.l.length > 0) - min_off = (beg >> TAD_LIDX_SHIFT >= idx.l.length) ? idx.l[idx.l.length - 1] : idx.l[beg >> TAD_LIDX_SHIFT]; - else - min_off = 0; - for (i = n_off = 0; i < n_bins; ++i) { - if ((chunks = idx.b.get(bins[i])) != null) - n_off += chunks.length; - } - if (n_off == 0) - return null; - off = new TPair64[n_off]; - for (i = n_off = 0; i < n_bins; ++i) - if ((chunks = idx.b.get(bins[i])) != null) - for (int j = 0; j < chunks.length; ++j) - if (less64(min_off, chunks[j].v)) - off[n_off++] = new TPair64(chunks[j]); - if (n_off == 0) - return null; - Arrays.sort(off, 0, n_off); - // resolve completely contained adjacent blocks - for (i = 1, l = 0; i < n_off; ++i) { - if (less64(off[l].v, off[i].v)) { - ++l; - off[l].u = off[i].u; - off[l].v = off[i].v; - } - } - n_off = l + 1; - // resolve overlaps between adjacent blocks; this may happen due to the - // merge in indexing - for (i = 1; i < n_off; ++i) - if (!less64(off[i - 1].v, off[i].u)) - off[i - 1].v = off[i].u; - // merge adjacent blocks - for (i = 1, l = 0; i < n_off; ++i) { - if (off[l].v >> 16 == off[i].u >> 16) - off[l].v = off[i].v; - else { - ++l; - off[l].u = off[i].u; - off[l].v = off[i].v; - } - } - n_off = l + 1; - // return - TPair64[] ret = new TPair64[n_off]; - for (i = 0; i < n_off; ++i) - ret[i] = new TPair64(off[i].u, off[i].v); // in C, this is - // inefficient - return new TabixReader.Iterator(tid, beg, end, ret); - } - - public Iterator query(final String reg) { - int[] x = parseReg(reg); - return query(x[0], x[1], x[2]); - } - -// public static void main(String[] args) { -// if (args.length < 1) { -// System.out.println("Usage: java -cp .:sam.jar TabixReader [region]"); -// System.exit(1); -// } -// try { -// TabixReader tr = new TabixReader(args[0]); -// String s; -// if (args.length == 1) { // no region is specified; print the whole -// // file -// while ((s = tr.readLine()) != null) -// System.out.println(s); -// } else { // a region is specified; random access -// TabixReader.Iterator iter = tr.query(args[1]); // get the -// // iterator -// while (iter != null && (s = iter.next()) != null) -// System.out.println(s); -// } -// } catch (IOException e) { -// } -// } -} diff --git a/src/net/sf/jannot/tabix/TabixWrapper.java b/src/net/sf/jannot/tabix/TabixWrapper.java deleted file mode 100644 index 24e9c41..0000000 --- a/src/net/sf/jannot/tabix/TabixWrapper.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix; - -import net.sf.jannot.Data; -import net.sf.jannot.DensityEstimate; -import net.sf.jannot.Location; - -public abstract class TabixWrapper implements Data, DensityEstimate { - - public boolean canSave(){ - return false; - } - private static final int RECORDSIZE = 12; - protected String key; - protected IndexedFeatureFile data; - protected TabIndex idx; - - public String label(){ - String s=data.source(); - int bIndx=s.lastIndexOf('\\'); - int fIdx=s.lastIndexOf('/'); - int idx=Math.max(bIndx, fIdx); - return s.substring(idx+1); - - } - - TabixWrapper(String key, IndexedFeatureFile data, TabIndex idx) { - this.data = data; - this.key = key; - this.idx = idx; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get() - */ - @Override - public Iterable get() { - return get(1, getMaximumCoordinate()); - - } - - /* - * (non-Javadoc) - * - * @see - * net.sf.jannot.DensityEstimate#getEstimateCount(net.sf.jannot.Location) - */ - @Override - public int getEstimateCount(Location l) { - int tid = idx.names.indexOf(key); - long max = 0; - long min = Long.MAX_VALUE; - for (int i = 0; i < idx.linIndex[tid].size(); i++) { - long val = idx.linIndex[tid].get(i) >> 16; - if (val > 0 && val < min) - min = val; - if (val > max) - max = val; - } - - double fraction = l.length() / (double) getMaximumCoordinate(); - int estimate = (int) (fraction * (max - min) / RECORDSIZE); - return estimate; - - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.DensityEstimate#getMaximumCoordinate() - */ - @Override - public int getMaximumCoordinate() { - int tid = idx.names.indexOf(key); - return idx.linIndex[tid].size() * 16 * 1024; - } - -} \ No newline at end of file diff --git a/src/net/sf/jannot/tabix/TabixWriter.java b/src/net/sf/jannot/tabix/TabixWriter.java deleted file mode 100644 index 475cdb9..0000000 --- a/src/net/sf/jannot/tabix/TabixWriter.java +++ /dev/null @@ -1,363 +0,0 @@ -package net.sf.jannot.tabix; - -/* The MIT License - - Copyright (c) 2010 Broad Institute. - Portions Copyright (c) 2011 University of Toronto. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - */ - -import java.io.File; -import java.io.IOException; -import java.io.OutputStream; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.jannot.picard.LineBlockCompressedInputStream; -import net.sf.jannot.source.Locator; -import net.sf.samtools.util.BlockCompressedInputStream; -import net.sf.samtools.util.BlockCompressedOutputStream; -import net.sf.samtools.seekablestream.SeekableFileStream; -import net.sf.samtools.seekablestream.SeekableHTTPStream; - -/** - * Tabix writer, based on Heng Li's C implementation. - * - * @author tarkvara - */ -public class TabixWriter extends TabixReader { - private static final Logger LOG = Logger.getLogger(TabixWriter.class.getCanonicalName()); - private static final Charset LATIN1 = Charset.forName("ISO-8859-1"); - - public static final int TI_PRESET_GENERIC = 0; - public static final int TI_PRESET_SAM = 1; - public static final int TI_PRESET_VCF = 2; - public static final int TI_FLAG_UCSC = 0x10000; - - public static final Conf GFF_CONF = new Conf(0, 1, 4, 5, '#', 0); - public static final Conf BED_CONF = new Conf(TI_FLAG_UCSC, 1, 2, 3, '#', 0); - public static final Conf PSLTBL_CONF = new Conf(TI_FLAG_UCSC, 15, 17, 18, '#', 0); - public static final Conf SAM_CONF = new Conf(TI_PRESET_SAM, 3, 4, 0, '@', 0); - public static final Conf VCF_CONF = new Conf(TI_PRESET_VCF, 1, 2, 0, '#', 0); - - /** The binning index. */ - List>> binningIndex = new ArrayList>>(); - - /** The linear index. */ - List> linearIndex = new ArrayList>(); - -// public static void main(String[] args) { -// try { -// new TabixWriter(new File(args[0]), BED_CONF).createIndex(); -// } catch (Exception x) { -// LOG.log(Level.SEVERE, "Failed to create tabix index.", x); -// } -// } - - public TabixWriter(Locator fn, Conf conf) throws Exception { - super(fn); - applyConf(conf); - mChr2tid = new LinkedHashMap(); - } - - private void applyConf(Conf conf) { - mPreset = conf.preset; - mSc = conf.chrColumn; - mBc = conf.startColumn; - mEc = conf.endColumn; - mMeta = conf.commentChar; - mSkip = conf.linesToSkip; - } - - public void createIndex(Locator idx) throws Exception { - LineBlockCompressedInputStream fp; - if (!mFn.isURL()) - fp = new LineBlockCompressedInputStream(new SeekableFileStream(mFn.file())); - else - fp = new LineBlockCompressedInputStream(new SeekableHTTPStream(mFn.url())); - makeIndex(fp); - fp.close(); - File indexFile = idx.file(); - BlockCompressedOutputStream fpidx = new BlockCompressedOutputStream(indexFile); - saveIndex(fpidx); - fpidx.close(); - } - - private void makeIndex(BlockCompressedInputStream fp) throws Exception { - int last_bin, save_bin; - int last_coor, last_tid, save_tid; - long save_off, last_off, lineno = 0, offset0 = (long) -1; - String str; - - save_bin = save_tid = last_tid = last_bin = 0xffffffff; // Was unsigned - // in C - // implementation. - save_off = last_off = 0; - last_coor = 0xffffffff; // Should be unsigned. - while ((str = readLine(fp)) != null) { - ++lineno; - if (lineno <= mSkip || str.charAt(0) == mMeta) { - last_off = fp.getFilePointer(); - continue; - } - TIntv intv = getIntv(str); - if (intv.beg < 0 || intv.end < 0) { - throw new Exception("The indexes overlap or are out of bounds."); - } - if (last_tid != intv.tid) { // change of chromosomes - if (last_tid > intv.tid) { - throw new Exception(String.format( - "The chromosome blocks are not continuous at line %d, is the file sorted? [pos %d].", - lineno, intv.beg + 1)); - } - last_tid = intv.tid; - last_bin = 0xffffffff; - } else if (last_coor > intv.beg) { - throw new Exception(String.format("File out of order at line %d.", lineno)); - } - long tmp = insertLinear(linearIndex.get(intv.tid), intv.beg, intv.end, last_off); - if (last_off == 0) - offset0 = tmp; - if (intv.bin != last_bin) { // then possibly write the binning index - if (save_bin != 0xffffffff) { // save_bin==0xffffffffu only - // happens to the first record - insertBinning(binningIndex.get(save_tid), save_bin, save_off, last_off); - } - save_off = last_off; - save_bin = last_bin = intv.bin; - save_tid = intv.tid; - if (save_tid < 0) - break; - } - if (fp.getFilePointer() <= last_off) { - throw new Exception(String.format("Bug in BGZF: %x < %x.", fp.getFilePointer(), last_off)); - } - last_off = fp.getFilePointer(); - last_coor = intv.beg; - } - if (save_tid >= 0) - insertBinning(binningIndex.get(save_tid), save_bin, save_off, fp.getFilePointer()); - mergeChunks(); - fillMissing(); - if (offset0 != (long) -1 && !linearIndex.isEmpty() && linearIndex.get(0) != null) { - int beg = (int) (offset0 >> 32), end = (int) (offset0 & 0xffffffff); - for (int i = beg; i <= end; ++i) { - linearIndex.get(0).set(i, 0L); - } - } - } - - private void insertBinning(Map> binningForChr, int bin, long beg, long end) { - if (!binningForChr.containsKey(bin)) { - binningForChr.put(bin, new ArrayList()); - } - List list = binningForChr.get(bin); - list.add(new TPair64(beg, end)); - } - - private long insertLinear(List linearForChr, int beg, int end, long offset) { - beg = beg >> TAD_LIDX_SHIFT; - end = (end - 1) >> TAD_LIDX_SHIFT; - - // Expand the array if necessary. - int newSize = Math.max(beg, end) + 1; - while (linearForChr.size() < newSize) { - linearForChr.add(0L); - } - if (beg == end) { - if (linearForChr.get(beg) == 0L) { - linearForChr.set(beg, offset); - } - } else { - for (int i = beg; i <= end; ++i) { - if (linearForChr.get(i) == 0L) { - linearForChr.set(i, offset); - } - } - } - return (long) beg << 32 | end; - } - - private void mergeChunks() { - for (int i = 0; i < binningIndex.size(); i++) { - Map> binningForChr = binningIndex.get(i); - for (Integer k : binningForChr.keySet()) { - List p = binningForChr.get(k); - int m = 0; - for (int l = 1; l < p.size(); l++) { - if (p.get(m).v >> 16 == p.get(l).u >> 16) { - p.get(m).v = p.get(l).v; - } else { - p.set(++m, p.get(l)); - } - } - while (p.size() > m + 1) { - p.remove(p.size() - 1); - } - } - } - } - - private void fillMissing() { - for (int i = 0; i < linearIndex.size(); ++i) { - List linearForChr = linearIndex.get(i); - for (int j = 1; j < linearForChr.size(); ++j) { - if (linearForChr.get(j) == 0) { - linearForChr.set(j, linearForChr.get(j - 1)); - } - } - } - } - - public static void writeInt(final OutputStream os, int value) throws IOException { - byte[] buf = new byte[4]; - ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN).putInt(value); - os.write(buf); - } - - public static void writeLong(final OutputStream os, long value) throws IOException { - byte[] buf = new byte[8]; - ByteBuffer.wrap(buf).order(ByteOrder.LITTLE_ENDIAN).putLong(value); - os.write(buf); - } - - private void saveIndex(BlockCompressedOutputStream fp) throws IOException { - fp.write("TBI\1".getBytes(LATIN1)); - writeInt(fp, binningIndex.size()); - - // Write the ti_conf_t - writeInt(fp, mPreset); - writeInt(fp, mSc); - writeInt(fp, mBc); - writeInt(fp, mEc); - writeInt(fp, mMeta); - writeInt(fp, mSkip); - - // Write sequence dictionary. Since mChr2tid is a LinkedHashmap, the - // keyset - // will be returned in insertion order. - int l = 0; - for (String k : mChr2tid.keySet()) { - l += k.length() + 1; - } - writeInt(fp, l); - for (String k : mChr2tid.keySet()) { - fp.write(k.getBytes(LATIN1)); - fp.write(0); - } - - for (int i = 0; i < mChr2tid.size(); i++) { - Map> binningForChr = binningIndex.get(i); - - // Write the binning index. - writeInt(fp, binningForChr.size()); - for (int k : binningForChr.keySet()) { - List p = binningForChr.get(k); - writeInt(fp, k); - writeInt(fp, p.size()); - for (TPair64 bin : p) { - writeLong(fp, bin.u); - writeLong(fp, bin.v); - } - } - // Write the linear index. - List linearForChr = linearIndex.get(i); - writeInt(fp, linearForChr.size()); - for (int x = 0; x < linearForChr.size(); x++) { - writeLong(fp, linearForChr.get(x)); - } - } - } - - /** - * Override chr2tid so that getInv() adds new chromosomes as we read the - * source file. - */ - @Override - protected int chr2tid(String chr) { - if (!mChr2tid.containsKey(chr)) { - // Doesn't exist yet. - mChr2tid.put(chr, mChr2tid.size()); - - // Expand our indices. - binningIndex.add(new HashMap>()); - linearIndex.add(new ArrayList()); - } - return mChr2tid.get(chr); - } - - /** - * Override getIntv because it's a good time to figure out which bin things - * should go into. - * - * @param line - * a line read from the source file - * @return an object describing the interval - */ - @Override - protected TIntv getIntv(String line) { - TIntv result = super.getIntv(line); - result.bin = reg2bin(result.beg, result.end); - return result; - } - - private int reg2bin(int beg, int end) { - --end; - if (beg >> 14 == end >> 14) - return 4681 + (beg >> 14); - if (beg >> 17 == end >> 17) - return 585 + (beg >> 17); - if (beg >> 20 == end >> 20) - return 73 + (beg >> 20); - if (beg >> 23 == end >> 23) - return 9 + (beg >> 23); - if (beg >> 26 == end >> 26) - return 1 + (beg >> 26); - return 0; - } - - public static class Conf { - int preset; - public int chrColumn; - public int startColumn; - public int endColumn; - char commentChar; - int linesToSkip; - - public Conf(int preset, int chrColumn, int startColumn, int endColumn, char commentChar, int linesToSkip) { - this.preset = preset; - this.chrColumn = chrColumn; - this.startColumn = startColumn; - this.endColumn = endColumn; - this.commentChar = commentChar; - this.linesToSkip = linesToSkip; - } - } -} diff --git a/src/net/sf/jannot/tabix/VCFWrapper.java b/src/net/sf/jannot/tabix/VCFWrapper.java deleted file mode 100644 index 2e19670..0000000 --- a/src/net/sf/jannot/tabix/VCFWrapper.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix; - -import java.io.IOException; -import java.net.URISyntaxException; - -import net.sf.jannot.Feature; -import net.sf.jannot.tabix.codec.BEDCodec; -import net.sf.jannot.variation.VCFCodec; -import net.sf.jannot.variation.Variation; - -/** - * - * @author Thomas Abeel - * - */ -public class VCFWrapper extends TabixWrapper { - - VCFWrapper(String key, IndexedFeatureFile data, TabIndex idx) { - super(key, data, idx); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - try { - return new VCFCodec(this, data.query(key, start, end)); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (URISyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - -} \ No newline at end of file diff --git a/src/net/sf/jannot/tabix/codec/BEDCodec.java b/src/net/sf/jannot/tabix/codec/BEDCodec.java deleted file mode 100644 index cb2b8ae..0000000 --- a/src/net/sf/jannot/tabix/codec/BEDCodec.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix.codec; - -import net.sf.jannot.Feature; -import net.sf.jannot.parser.BEDTools; -import net.sf.jannot.tabix.FeatureWrapper; -import net.sf.jannot.tabix.TabixLine; - -/** - * @author Thomas Abeel - * - */ -public class BEDCodec extends Codec { - - - private FeatureWrapper wrapper; - - /** - * @param in - */ - public BEDCodec(FeatureWrapper wrapper,Iterable in) { - super(in,1024); - this.wrapper=wrapper; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.tabix.codec.Codec#parse(java.lang.String) - */ - @Override - public Feature parse(TabixLine line) { - Feature f = BEDTools.parseLine(line.line(), null,null); -// wrapper.update(f); - return f; - } - -} diff --git a/src/net/sf/jannot/tabix/codec/Codec.java b/src/net/sf/jannot/tabix/codec/Codec.java deleted file mode 100644 index 19a4403..0000000 --- a/src/net/sf/jannot/tabix/codec/Codec.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix.codec; - -import java.util.Iterator; - -import net.sf.jannot.tabix.TabixLine; -import be.abeel.util.LRUCache; - -/** - * @author Thomas Abeel - * - */ -public abstract class Codec implements Iterable { - - private Iterable in; - protected LRUCache lru; - - public Codec(Iterable in,int lruSize) { - this.in = in; - this.lru=new LRUCache(lruSize); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Iterable#iterator() - */ - @Override - public Iterator iterator() { - return new CodecIterator(in); - } - - /** - * @param next - * @return - */ - public abstract T parse(TabixLine next); - - class CodecIterator implements Iterator { - - private Iterator it; - - /** - * @param in - */ - public CodecIterator(Iterable in) { - this.it = in.iterator(); - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#hasNext() - */ - @Override - public boolean hasNext() { - return it.hasNext(); - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#next() - */ - @Override - public T next() { - return parse(it.next()); - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#remove() - */ - @Override - public void remove() { - throw new UnsupportedOperationException(); - - } - - } -} diff --git a/src/net/sf/jannot/tabix/codec/GFFCodec.java b/src/net/sf/jannot/tabix/codec/GFFCodec.java deleted file mode 100644 index 3b0a0e4..0000000 --- a/src/net/sf/jannot/tabix/codec/GFFCodec.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix.codec; - -import java.util.SortedSet; -import java.util.TreeSet; - -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.Strand; -import net.sf.jannot.Type; -import net.sf.jannot.tabix.FeatureWrapper; -import net.sf.jannot.tabix.TabixLine; - -/** - * @author Thomas Abeel - * - */ -public class GFFCodec extends Codec { - - private FeatureWrapper wrapper; - - /** - * @param wrapper - * @param in - */ - public GFFCodec(FeatureWrapper wrapper, Iterable in) { - super(in,1024); - this.wrapper=wrapper; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.tabix.codec.Codec#parse(java.lang.String) - */ - @Override - public Feature parse(TabixLine line) { - Feature f = lru.get(line); - if (f != null) - return f; - else { - - try { - // if (arr.length < 9) { - // arr = GFF3Parser.padGff(arr); - // } - Location l = new Location(line.getInt(3), line.getInt(4)); - //String parent = GFF3Parser.extractParent(line.get(8)); - - // /* Add to existing feature */ - // if (parent != null && parentMap.containsKey(parent) && - // arr[2].equals("CDS")) { - // - // parentMap.get(parent).addLocation(l); - // - // } else {/* Add as a new feature */ - f = new Feature(); - SortedSet tmp = new TreeSet(); - tmp.add(l); - f.setLocation(tmp); - char strand = line.get(6).charAt(0); - switch (strand) { - case '-': - f.setStrand(Strand.REVERSE); - break; - case '+': - f.setStrand(Strand.FORWARD); - break; - case '.': - case '?': - f.setStrand(Strand.UNKNOWN); - break; - } - // f.addQualifier(new Qualifier("seqid", arr[0])); - f.addQualifier("source", line.get(1)); - f.setType(Type.get(line.get(2))); - String five = line.get(5); - if (!(five.length() == 1 && five.charAt(0) == '.') && five.length() != 0) - f.setScore(Double.parseDouble(five)); - if (line.length() > 8) { - String[] attributes = line.get(8).split(";"); - for (String s : attributes) { - String[] pair = s.trim().split("="); - if (pair.length == 2) { - String[] values = pair[1].split(","); - for (String v : values) { - f.addQualifier(pair[0], v); - } - } else - f.addQualifier("note", pair[0]); - } - } -// wrapper.update(f); - // if (parent != null && f.type() == Type.get("CDS")) - // parentMap.put(parent, f); - // String id = f.singleQualifierValue("id"); - // assert(id!=null); - // idMap.put(id, f); - // set.getOrCreateEntry(arr[0]).annotation.add(f); - // FeatureAnnotation fa = - // set.getOrCreateEntry(arr[0]).getAnnotation(f.type()); - // fa.add(f); - return f; - // } - - } catch (Exception e) { - e.printStackTrace(); - System.err.println("Could not parse line: " + line); - return null; - } - } - } - -} diff --git a/src/net/sf/jannot/tabix/codec/PileupCodec.java b/src/net/sf/jannot/tabix/codec/PileupCodec.java deleted file mode 100644 index 9ffc3e7..0000000 --- a/src/net/sf/jannot/tabix/codec/PileupCodec.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix.codec; - -import net.sf.jannot.pileup.DoublePile; -import net.sf.jannot.pileup.ReadDetailPile; -import net.sf.jannot.tabix.TabixLine; - -/** - * @author Thomas Abeel - * - */ -public class PileupCodec extends Codec { - - - /** - * @param in - */ - public PileupCodec(Iterable in) { - super(in,15000); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.tabix.codec.Codec#parse(java.lang.String) - */ - @Override - public DoublePile parse(TabixLine line) { - DoublePile f = lru.get(line); - if (f != null) - return f; - else { - int pos = line.getInt(1); -// int coverage = line.getInt(3); - byte[] reads = line.get(4).getBytes(); - ReadDetailPile p = ReadDetailPile.create(pos, reads); - lru.put(line, f); - return p; - } - } - -} diff --git a/src/net/sf/jannot/tabix/codec/SWigCodec.java b/src/net/sf/jannot/tabix/codec/SWigCodec.java deleted file mode 100644 index 6ac98ec..0000000 --- a/src/net/sf/jannot/tabix/codec/SWigCodec.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tabix.codec; - -import net.sf.jannot.pileup.Pile; -import net.sf.jannot.pileup.PileTools; -import net.sf.jannot.tabix.TabixLine; - -/** - * @author Thomas Abeel - * - */ -public class SWigCodec extends Codec { - - /** - * @param in - */ - public SWigCodec(Iterable in) { - super(in, 15000); - } - - @Override - public Pile parse(TabixLine line) { - Pile f = lru.get(line); - if (f != null) - return f; - else { - int pos = line.getInt(1); - int fcoverage = line.getInt(2); - int rcoverage = line.getInt(3); - Pile p = PileTools.create(pos, fcoverage, rcoverage); - lru.put(line, f); - return p; - } - } - -} diff --git a/src/net/sf/jannot/tdf/ReadType.java b/src/net/sf/jannot/tdf/ReadType.java deleted file mode 100644 index 35c7d3c..0000000 --- a/src/net/sf/jannot/tdf/ReadType.java +++ /dev/null @@ -1,9 +0,0 @@ -package net.sf.jannot.tdf; -/** - * - * @author Thomas Abeel - * - */ -public enum ReadType { - FIRSTREADFORWARDMAP, FIRSTREADREVERSEMAP, SECONDREADFORWARDMAP, SECONDREADREVERSEMAP; -} \ No newline at end of file diff --git a/src/net/sf/jannot/tdf/TDFData.java b/src/net/sf/jannot/tdf/TDFData.java deleted file mode 100644 index df5b68a..0000000 --- a/src/net/sf/jannot/tdf/TDFData.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tdf; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.jannot.Data; -import net.sf.jannot.pileup.Pile; -import net.sf.jannot.pileup.PileNormalization; -import net.sf.jannot.pileup.PileTools; -import net.sf.jannot.tdf.TDFData.TrackType; - -import org.broad.igv.tdf.TDFDataset; -import org.broad.igv.tdf.TDFReader; -import org.broad.igv.tdf.TDFTile; -import org.broad.igv.track.WindowFunction; - -/** - * @author Thomas Abeel - * - */ -public class TDFData implements Data, PileNormalization { - - private Logger log = Logger.getLogger(TDFData.class.getCanonicalName()); - private String chr; - - private int size = -1; - - private WindowFunction wf; - - private TDFReader tr; - - private int maxZoom; - private TrackType trackType; - - public TrackType trackType(){ - return trackType; - } - - public String label() { - String out = tr.getLocator().replace('\\', '/'); - return out.substring(out.lastIndexOf('/') + 1); - - } - - enum TrackType{ - SENSEAWARECOVERAGE,COVERAGE,OTHER; - } - - /** - * @param chr - * @param tr - */ - public TDFData(String chr, TDFReader tr) { - this.chr = chr; - this.tr = tr; - trackType=TrackType.OTHER; - try{ - TrackType.valueOf(tr.getTrackType()); - }catch(IllegalArgumentException ie){ - log.warning("JAnnot does not recognize this track type: "+tr.getTrackType()); - } - log.info("Track type: "+tr.getTrackType()); - log.info("Datasets: "+tr.getDatasetNames()); - log.info("Groups: "+tr.getGroupNames()); - log.info("Track names: "+Arrays.toString(tr.getTrackNames())); - maxZoom = tr.getMaxZoom(); - - wf = tr.getWindowFunctions().get(0); - - } - - public List availableWindowFunctions() { - return tr.getWindowFunctions(); - } - - public void requestWindowFunction(WindowFunction wf) { - this.wf = wf; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - log.log(Level.FINEST, "TDF query: " + start + "\t" + end); - if (size < 0) { - TDFDataset data = tr.getDataset(chr, 0, wf); - this.size = data.getTileWidth(); - log.info("Setting TDF data size to " + this.size); - - } - if (end < 0) - end = size; - int tmpSize = size; - int zoom = 0; - while (tmpSize / 2 > (end - start + 1)) { - tmpSize /= 2; - zoom++; - } - - if (zoom > maxZoom) { - zoom = -1; - } - - TDFDataset data = tr.getDataset(chr, zoom, wf); - - ArrayList out = new ArrayList(); - for (TDFTile tft : data.getTiles(start, end)) { - for (int i = 0; i < tft.getSize(); i++) { - float[] arr = new float[tft.noValues()]; - for (int j = 0; j < tft.noValues(); j++) { - arr[j] = tft.getValue(j, i); - if (Float.isNaN(arr[j]) || Float.isInfinite(arr[j])) - arr[j] = 0; - } - int s = tft.getStartPosition(i); - int e = tft.getEndPosition(i); - if (e >= start && s <= end) { - Pile tmp = PileTools.create(s, arr); - tmp.setLength(e - s); - out.add(tmp); - } - } - - } - return out; - - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get() - */ - @Override - public Iterable get() { - return get(1, size); - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#canSave() - */ - @Override - public boolean canSave() { - return false; - } - - /** - * @param wf2 - * @return - */ - public boolean isCurrentWindowFunction(WindowFunction wf) { - return this.wf == wf; - } - - @Override - public boolean supportsNormalization() { - return true; - } - -} diff --git a/src/net/sf/jannot/tdf/TDFDataSource.java b/src/net/sf/jannot/tdf/TDFDataSource.java deleted file mode 100644 index b371922..0000000 --- a/src/net/sf/jannot/tdf/TDFDataSource.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.tdf; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.HashSet; -import java.util.Set; - -import net.sf.jannot.Entry; -import net.sf.jannot.EntrySet; -import net.sf.jannot.StringKey; -import net.sf.jannot.exception.ReadFailedException; -import net.sf.jannot.picard.SeekableFileCachedHTTPStream; -import net.sf.jannot.source.DataSource; -import net.sf.jannot.source.Locator; -import net.sf.jannot.tabix.PileupWrapper; -import net.sf.samtools.seekablestream.SeekableFileStream; -import net.sf.samtools.seekablestream.SeekableStream; - -import org.broad.igv.tdf.TDFReader; - -import cern.colt.Arrays; - -/** - * - * Data source for TDF files. - * - * @author Thomas Abeel - * - */ -public class TDFDataSource extends DataSource { - - private SeekableStream s = null; - - /** - * @param file - * @throws URISyntaxException - * @throws ReadFailedException - * @throws IOException - * @throws MalformedURLException - */ - public TDFDataSource(Locator l) throws ReadFailedException, URISyntaxException, MalformedURLException, IOException { - super(l); - if (!l.isURL()) - s = new SeekableFileStream(l.file()); - else - s = new SeekableFileCachedHTTPStream(l.url()); - tr = TDFReader.getReader(s); - - } - - private TDFReader tr = null; - - // /** - // * @param url - // * @throws URISyntaxException - // * @throws ReadFailedException - // * @throws IOException - // */ - // public TDFDataSource(URL url) throws ReadFailedException, - // URISyntaxException, IOException { - // super(new Locator(url.toString())); - // s=new SeekableFileCachedHTTPStream(url); - // tr=TDFReader.getReader(s); - // } - - // /** - // * @param string - // * @throws URISyntaxException - // * @throws ReadFailedException - // */ - // private TDFDataSource(String string) throws ReadFailedException, - // URISyntaxException { - // tr = TDFReader.getReader(string); - // - // } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#read(net.sf.jannot.EntrySet) - */ - @Override - public EntrySet read(EntrySet set) throws ReadFailedException { - - if (set == null) - set = new EntrySet(); - // SAMFileReader inputSam = getReader(); -// System.out.println(tr.getDatasetNames()); -// System.out.println(tr.getDataMin()); -// System.out.println(tr.getDataMax()); -// System.out.println(tr.getGroupNames()); -// System.out.println(tr.getWindowFunctions()); -// System.out.println(Arrays.toString(tr.getTrackNames())); - - Set chrs = new HashSet(); - - for (String s : tr.getDatasetNames()) { - String[] arr = s.split("/"); - chrs.add(arr[1]); - } - chrs.remove("All"); - for (String chr : chrs) { - Entry e = set.getOrCreateEntry(chr); - e.add(new StringKey(tr.getLocator()), new TDFData(chr, tr)); - - } - - // for (String name : index.names()) { - // Entry e = set.getOrCreateEntry(name); - // // try { - // try { - // e.setSequence(new FaidxData(index, content, name)); - // } catch (Exception ex) { - // System.err.println("Faidx error URL: " + url); - // System.err.println("Faidx error file: " + file); - // throw new ReadFailedException(ex); - // - // } - // } - return set; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#isIndexed() - */ - @Override - public boolean isIndexed() { - return true; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.source.DataSource#size() - */ - @Override - public long size() { - return s.length(); - } -} diff --git a/src/net/sf/jannot/utils/ArrayIterable.java b/src/net/sf/jannot/utils/ArrayIterable.java deleted file mode 100644 index 1606e77..0000000 --- a/src/net/sf/jannot/utils/ArrayIterable.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.sf.jannot.utils; - -import java.lang.reflect.Array; -import java.util.Iterator; -import java.util.NoSuchElementException; - -/** - * This Iterator is used to iterate over Arrays. - */ -public class ArrayIterable implements Iterable { - private Object array; - - /** - * create an Iterator for the Array array. - * - * @param array - * java.lang.Object - * - * @throws UnsupportedOperationException - * if array is not an Array - */ - public ArrayIterable(Object array) { - if (!array.getClass().isArray()) { - throw new UnsupportedOperationException("ArrayIterator must be " - + "initialized with an Array to iterate over."); - } - - this.array = array; - - } - - /* (non-Javadoc) - * @see java.lang.Iterable#iterator() - */ - @Override - public Iterator iterator() { - return new ArrayIterator(array); - } -} diff --git a/src/net/sf/jannot/utils/ArrayIterator.java b/src/net/sf/jannot/utils/ArrayIterator.java deleted file mode 100644 index f8fe22c..0000000 --- a/src/net/sf/jannot/utils/ArrayIterator.java +++ /dev/null @@ -1,84 +0,0 @@ -package net.sf.jannot.utils; - -import java.lang.reflect.Array; -import java.util.Iterator; -import java.util.NoSuchElementException; - -/** - * This Iterator is used to iterate over Arrays. - */ -public class ArrayIterator implements Iterator { - /** DOCUMENT ME! */ - private Object array; - - /** DOCUMENT ME! */ - private int position; - - /** DOCUMENT ME! */ - private int length; - - /** - * create an Iterator for the Array array. - * - * @param array - * java.lang.Object - * - * @throws UnsupportedOperationException - * if array is not an Array - */ - public ArrayIterator(Object array) { - if (!array.getClass().isArray()) { - throw new UnsupportedOperationException("ArrayIterator must be " - + "initialized with an Array to iterate over."); - } - - this.array = array; - position = 0; - length = Array.getLength(array); - } - - /** - * Returns true if the iteration has more elements. (In other - * words, returns true if next would return an element - * rather than throwing an exception.) - * - * @return true if the iterator has more elements. - */ - public boolean hasNext() { - return (position < length); - } - - /** - * Returns the next element in the interation. - * - * @return the next element in the interation. - * - * @throws NoSuchElementException - * iteration has no more elements. - */ - public synchronized T next() throws NoSuchElementException { - try { - T result = (T) Array.get(array, position); - position++; - - return result; - } catch (ArrayIndexOutOfBoundsException e) { - throw new NoSuchElementException(e.getMessage()); - } - } - - /** - * Removes from the underlying collection the last element returned by the - * iterator (optional operation). This method can be called only once per - * call to next. The behavior of an iterator is unspecified if the - * underlying collection is modified while the iteration is in progress in - * any way other than by calling this method. - * - * @throws UnsupportedOperationException - * if the remove operation is not supported by this - * Iterator. - */ - public void remove() { - throw new UnsupportedOperationException(); - } -} diff --git a/src/net/sf/jannot/utils/SequenceTools.java b/src/net/sf/jannot/utils/SequenceTools.java deleted file mode 100644 index 3c056d1..0000000 --- a/src/net/sf/jannot/utils/SequenceTools.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.utils; - -import java.util.Iterator; -import java.util.SortedSet; - -import net.sf.jannot.AminoAcidMapping; -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.Strand; -import net.sf.jannot.refseq.MemorySequence; -import net.sf.jannot.refseq.Sequence; - -public class SequenceTools { - - public static char complement(char nucleotide) { - - switch (nucleotide) { - case 'a': - return 't'; - case 't': - return 'a'; - case 'g': - return 'c'; - case 'c': - return 'g'; - case 'A': - return 'T'; - case 'T': - return 'A'; - case 'G': - return 'C'; - case 'C': - return 'G'; - case '-': - return '-'; - default: - return 'N'; - - } - } - - - - public static String translate(Sequence dna, AminoAcidMapping mapping) { - char[] output = new char[(int)Math.ceil(dna.size() / 3.0)]; - Iteratorit=dna.get().iterator(); - int index=0; - while(it.hasNext()){ - String codon=nextCodon(it); - output[index++] = mapping.get(codon); - } - return new String(output); - } - - - - - /** - * @param it - * @return - */ - private static String nextCodon(Iterator it) { - char[]tmp=new char[]{'n','n','n'}; - if(it.hasNext()) - tmp[0]=it.next(); - if(it.hasNext()) - tmp[1]=it.next(); - if(it.hasNext()) - tmp[2]=it.next(); - return new String(tmp); - } - - - - public static Sequence extractSequence(Sequence seq, Feature feat) { - //System.out.println("SQ:"+seq); - StringBuffer out = new StringBuffer(); - Location[] arr = feat.location(); - - - for (int j = 0; j < arr.length; j++) { - StringBuffer x=new StringBuffer(); - Iterable cc = seq.get(arr[j].start, arr[j].end+1); - for (Character c : cc) { - out.append(c); - x.append(c); - - } - //System.out.println("exon: "+x.toString()); - - - } - Sequence sq = new MemorySequence(out); - if (feat.strand() == Strand.REVERSE) - sq = SequenceTools.reverseComplement(new MemorySequence(out)); - - return sq; - } - - - - /** - * Create a reverse complement sequence to the supplied sequence - * - * @param sequence - * @return - */ - public static Sequence reverseComplement(Sequence sequence) { - StringBuffer buffer = new StringBuffer(sequence.size()); - for(char c:sequence.get()){ - buffer.append(SequenceTools.complement(c)); - } - buffer.reverse(); - return new MemorySequence(buffer); - } - -} diff --git a/src/net/sf/jannot/variation/Allele.java b/src/net/sf/jannot/variation/Allele.java deleted file mode 100644 index f24f663..0000000 --- a/src/net/sf/jannot/variation/Allele.java +++ /dev/null @@ -1,27 +0,0 @@ -package net.sf.jannot.variation; - -public class Allele { - - private String alt; - private String ref; -// private float af; - - public String alternative() { - return alt; - } - - public String reference(){ - return ref; - } - public Allele(String ref,String alt) { - this.alt = alt; - this.ref=ref; - - - } - -// public float alternativeFrequency() { -// return af; -// } - -} \ No newline at end of file diff --git a/src/net/sf/jannot/variation/VCFCodec.java b/src/net/sf/jannot/variation/VCFCodec.java deleted file mode 100644 index 0bc0144..0000000 --- a/src/net/sf/jannot/variation/VCFCodec.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.variation; - -import java.util.HashMap; - -import net.sf.jannot.Feature; -import net.sf.jannot.Location; -import net.sf.jannot.Type; -import net.sf.jannot.parser.BEDTools; -import net.sf.jannot.tabix.FeatureWrapper; -import net.sf.jannot.tabix.TabixLine; -import net.sf.jannot.tabix.VCFWrapper; -import net.sf.jannot.tabix.codec.Codec; - - -/** - * @author Thomas Abeel - * - */ -public class VCFCodec extends Codec { - - - private VCFWrapper wrapper; - - /** - * @param in - */ - public VCFCodec(VCFWrapper vcfWrapper,Iterable in) { - super(in,1024); - this.wrapper=vcfWrapper; - } - - - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.tabix.codec.Codec#parse(java.lang.String) - */ - @Override - public Variation parse(TabixLine line) { - Variation f = new VCFVariation(line); -// f.setType(Type.get("SNP")); -// f.setLocation(new Location(line.beg,line.end)); -// f.addQualifier("ref", line.get(3)); -// if(line.get(4).charAt(0)!='.') -// f.addQualifier("alt", line.get(4)); - - -// wrapper.update(f); - return f; - } - -} diff --git a/src/net/sf/jannot/variation/VCFVariation.java b/src/net/sf/jannot/variation/VCFVariation.java deleted file mode 100644 index ed015f6..0000000 --- a/src/net/sf/jannot/variation/VCFVariation.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.sf.jannot.variation; - -import java.util.HashMap; - -import net.sf.jannot.tabix.TabixLine; - -class VCFVariation implements Variation{ - - private TabixLine line; - - public VCFVariation(TabixLine line) { - this.line=line; - } - - - @Override - public Allele[] alleles() { - String ref=line.get(3); - String alt=line.get(4); -// String[]arr=line.get(7).split(";"); -// HashMapmap=map(arr); - return new Allele[]{new Allele(ref,alt)}; - } - -// private HashMap map(String[] arr) { -// HashMapout=new HashMap(); -// for(String s:arr){ -// String[]split=s.split("="); -// out.put(split[0],split[1]); -// } -// return out; -// } - - @Override - public int start() { - return line.beg; - } - - } \ No newline at end of file diff --git a/src/net/sf/jannot/variation/Variation.java b/src/net/sf/jannot/variation/Variation.java deleted file mode 100644 index 6f8ef29..0000000 --- a/src/net/sf/jannot/variation/Variation.java +++ /dev/null @@ -1,10 +0,0 @@ -package net.sf.jannot.variation; - -public interface Variation { - - - Allele[] alleles(); - - int start(); - -} diff --git a/src/net/sf/jannot/wiggle/AbstractWiggle.java b/src/net/sf/jannot/wiggle/AbstractWiggle.java deleted file mode 100644 index 902e648..0000000 --- a/src/net/sf/jannot/wiggle/AbstractWiggle.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.wiggle; - -import net.sf.jannot.utils.ArrayIterable; - -/** - * - * @author Thomas Abeel - * - */ -public abstract class AbstractWiggle implements Graph, Query { - - public String label(){ - return "wiggle"; - } - - private FloatCache buffer5 = null; - - private int lastStart=-1,lastEnd=-1,lastRes=-1; - private float[]last=null; - @Override - public float[] get(int start, int end, int resolutionIndex) { - if(buffer5==null) - throw new RuntimeException("Wiggle needs to be initialized!"); - if(lastStart==start&&lastEnd==end&&lastRes==resolutionIndex) - return last; - if (resolutionIndex < 5) { - last = getRawRange(start, end); - - } else { - last = buffer5.getRawRange(start, end); - resolutionIndex -= 5; - - } - while (resolutionIndex > 0) { - last = merge(last); - resolutionIndex--; - } - return last; - - } - - private float[] merge(float[] ds) { - float[] out = new float[(ds.length + 1) / 2]; - double max = 0; - for (int i = 0; i < ds.length - 1; i += 2) { - out[i / 2] = (ds[i] + ds[i + 1]) / 2; - if (out[i / 2] > max) - max = out[i / 2]; - } - if (ds.length % 2 == 1) - out[out.length - 1] = ds[ds.length - 1]; - // for (int i = 0; i < out.length; i++) - // out[i] /= max; - return out; - } - -// @Override -// public abstract String getName(); - - @Override - public abstract float max(); - - @Override - public abstract float min(); - - @Override - public abstract float[] getRawRange(int start, int end); - - @Override - public abstract long size(); - - public void init(Query source) { - buffer5=new FloatCache(source); - - } - - - - /* (non-Javadoc) - * @see net.sf.jannot.Data#get(int, int) - */ - @Override - public Iterable get(int start, int end) { - float[]out=getRawRange(start, end); - return new ArrayIterable(out); - } - - - -} diff --git a/src/net/sf/jannot/wiggle/DiskArrayWiggle.java b/src/net/sf/jannot/wiggle/DiskArrayWiggle.java deleted file mode 100644 index 1e56ad0..0000000 --- a/src/net/sf/jannot/wiggle/DiskArrayWiggle.java +++ /dev/null @@ -1,195 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.wiggle; - -import java.io.IOException; -import java.util.Iterator; - -import net.sf.jannot.picard.BinaryBlob; - -/** - * - * Make wiggle - * - * Fill it with setMethod - * - * Initialize with init(); - * - * @author Thomas Abeel - * - */ -public class DiskArrayWiggle extends AbstractWiggle implements Iterable { - - // private float[] buffer; - // private String name; - private float min = Float.POSITIVE_INFINITY; - private float max = Float.NEGATIVE_INFINITY; - // private FloatBuffer fb = null; - // private int size; - - private BinaryBlob blob = null; - private int size; - - public DiskArrayWiggle(int size) throws IOException { - this.size=size; - System.out.println("Mapping: " + size * 4); - blob = new BinaryBlob(size * 4); - System.out.println("Mapping successfull!"); - - } - - /** - * Zero based coordinate - * - * @param position - * @param value - */ - public void set(int position, float value) { - - if (value > max) - max = value; - if (value < min) - min = value; - try { - blob.putFloat(position * 4, value); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - public void init() { - super.init(this); - } - - // - // @Override - // public String getName() { - // return name; - // } - - @Override - public float[] getRawRange(int start, int end) { - if (start >= size) - return new float[0]; - float[] out = new float[end - start]; - int len = out.length; - if (start + len > size) - len = size - start; - if (start < 0) - start = 0; - for(int i=start;i get() { - return this; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#canSave() - */ - @Override - public boolean canSave() { - return false; - } - - class DiskIterator implements Iterator { - - private int currentIdx = 1; - private DiskArrayWiggle daw; - - /** - * @param blob - */ - public DiskIterator(DiskArrayWiggle blob) { - this.daw = blob; - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#hasNext() - */ - @Override - public boolean hasNext() { - return currentIdx <= daw.size(); - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#next() - */ - @Override - public Float next() { - return daw.value(currentIdx++); - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#remove() - */ - @Override - public void remove() { - throw new RuntimeException("Does not work"); - - } - - } - - @Override - public Iterator iterator() { - return new DiskIterator(this); - } - -} diff --git a/src/net/sf/jannot/wiggle/FloatArrayWiggle.java b/src/net/sf/jannot/wiggle/FloatArrayWiggle.java deleted file mode 100644 index 336a00c..0000000 --- a/src/net/sf/jannot/wiggle/FloatArrayWiggle.java +++ /dev/null @@ -1,98 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.wiggle; - -import net.sf.jannot.utils.ArrayIterable; - -/** - * - * @author Thomas Abeel - * - */ -public class FloatArrayWiggle extends AbstractWiggle { - - private float[] buffer; - // private String name; - private float min = Float.POSITIVE_INFINITY; - private float max = Float.NEGATIVE_INFINITY; - - public FloatArrayWiggle(float[] arr) { - // this.name = name; - this.buffer = arr; - for (float f : arr) { - if (f > max) - max = f; - if (f < min) - min = f; - } - super.init(this); - - } - - // - // @Override - // public String getName() { - // return name; - // } - - @Override - public float[] getRawRange(int start, int end) { - if (start >= buffer.length) - return new float[0]; - float[] out = new float[end - start]; - int len = out.length; - if (start + len > buffer.length) - len = buffer.length - start; - if (start < 0) - start = 0; - System.arraycopy(buffer, start, out, 0, len); - return out; - } - - @Override - public float max() { - return max; - } - - @Override - public float min() { - return min; - } - - @Override - public long size() { - return buffer.length; - } - - /** - * Get a single value, one based coordinate - * - * @see net.sf.jannot.wiggle.Graph#value(int) - */ - @Override - public float value(int pos) { - return buffer[pos - 1]; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get() - */ - @Override - public Iterable get() { - - return new ArrayIterable(buffer); - - } - - /* (non-Javadoc) - * @see net.sf.jannot.Data#canSave() - */ - @Override - public boolean canSave() { - return false; - } - -} diff --git a/src/net/sf/jannot/wiggle/FloatCache.java b/src/net/sf/jannot/wiggle/FloatCache.java deleted file mode 100644 index 1ea017f..0000000 --- a/src/net/sf/jannot/wiggle/FloatCache.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.wiggle; - -import java.util.BitSet; -/** - * - * @author Thomas Abeel - * - */ -class FloatCache implements Query { - - private static final int reductionfactor = 32; - private float[] buffer; - private BitSet valid = new BitSet(); - private Query source; - - public FloatCache(Query source) { - buffer = new float[1+(int) (source.size() / reductionfactor)]; -// System.out.println("Original: " + source.size() + "\t" + buffer.length); - this.source = source; - } - - public float[] getRawRange(int start, int end) { - if(start/reductionfactor>=buffer.length) - return new float[0]; -// System.out.println("Buffer5: "+start+"\t"+end); - // System.out.println("Buffer5: "+start/reductionfactor+"\t"+end/reductionfactor); - for (int i = start / reductionfactor; i < end / reductionfactor; i++) { - if (i>=0&&ibuffer.length) - len=buffer.length-start/reductionfactor; - if(start<0) - start=0; - System.arraycopy(buffer, start / reductionfactor, out, 0,len); - // System.out.println(out[0]+"\t"+out[1]+"\t"+out[2]+"\t"+out[3]+"\t"+out[4]+"\t"+out[5]); - return out; - } - - @Override - public long size() { - return buffer.length; - } - -} \ No newline at end of file diff --git a/src/net/sf/jannot/wiggle/Graph.java b/src/net/sf/jannot/wiggle/Graph.java deleted file mode 100644 index 623c85c..0000000 --- a/src/net/sf/jannot/wiggle/Graph.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.wiggle; - -import net.sf.jannot.Data; - -/** - * - * @author Thomas Abeel - * - */ -public interface Graph extends Data{ - - /** - * Returns float array with float[i] containing a value - * - * Resolutions should be powers of two: 1,2,4,8,16,32,64,128,256,... - * - * Their corresponding indices are: 0,1,2,3,4,5,6,7,8,... - * - * @param start - * zero based coordinate of the start - * @param end - * zero based coordinate of the end, non-inclusive - * @param resolutionIndex - * index of the desired resolution - */ - public float[] get(int start, int end, int resolutionIndex); - - public float min(); - - public float max(); - - //public String getName(); - - /** - * @param pos one based coordinate - * @return - */ - public float value(int pos); - -} diff --git a/src/net/sf/jannot/wiggle/Query.java b/src/net/sf/jannot/wiggle/Query.java deleted file mode 100644 index cf51a4f..0000000 --- a/src/net/sf/jannot/wiggle/Query.java +++ /dev/null @@ -1,14 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.wiggle; -/** - * - * @author Thomas Abeel - * - */ -public interface Query { - float[] getRawRange(int start, int end); - - long size(); -} diff --git a/src/net/sf/jannot/wiggle/TroveArrayWiggle.java b/src/net/sf/jannot/wiggle/TroveArrayWiggle.java deleted file mode 100644 index 3fa671e..0000000 --- a/src/net/sf/jannot/wiggle/TroveArrayWiggle.java +++ /dev/null @@ -1,197 +0,0 @@ -/** - * %HEADER% - */ -package net.sf.jannot.wiggle; - -import gnu.trove.map.hash.TIntFloatHashMap; - -import java.io.IOException; -import java.util.Iterator; - -import net.sf.jannot.picard.BinaryBlob; - -/** - * - * Make wiggle - * - * Fill it with setMethod - * - * Initialize with init(); - * - * @author Thomas Abeel - * - */ -public class TroveArrayWiggle extends AbstractWiggle implements Iterable { - - // private float[] buffer; - // private String name; - private float min = Float.POSITIVE_INFINITY; - private float max = Float.NEGATIVE_INFINITY; - // private FloatBuffer fb = null; - // private int size; - - private TIntFloatHashMap blob = null; - private int size; - - public TroveArrayWiggle(int size) throws IOException { - this.size = size; - System.out.println("Mapping: " + size * 4); - blob = new TIntFloatHashMap(); - System.out.println("Mapping successfull!"); - - } - - /** - * Zero based coordinate - * - * @param position - * @param value - */ - public void set(int position, float value) { - - if (value > max) - max = value; - if (value < min) - min = value; - // try { - blob.put(position, value); - // } catch (IOException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } - } - - public void init() { - super.init(this); - } - - // - // @Override - // public String getName() { - // return name; - // } - - @Override - public float[] getRawRange(int start, int end) { - if (start >= size) - return new float[0]; - float[] out = new float[end - start]; - int len = out.length; - if (start + len > size) - len = size - start; - if (start < 0) - start = 0; - for (int i = start; i < end; i++) - // try { - out[i - start] = blob.get(i); - // } catch (IOException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } - // blob.getFloat(out, start, len); - // System.arraycopy(fb.capacity(), start, out, 0, len); - return out; - } - - @Override - public float max() { - return max; - } - - @Override - public float min() { - return min; - } - - @Override - public long size() { - return size;// / 4; - } - - /** - * Get a single value, one based coordinate - * - * @see net.sf.jannot.wiggle.Graph#value(int) - */ - @Override - public float value(int pos) { -// try { - return blob.get(pos-1); -// } catch (IOException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// }// buffer[pos - 1]; -// return -1; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#get() - */ - @Override - public Iterable get() { - return this; - } - - /* - * (non-Javadoc) - * - * @see net.sf.jannot.Data#canSave() - */ - @Override - public boolean canSave() { - return false; - } - - class DiskIterator implements Iterator { - - private int currentIdx = 1; - private TroveArrayWiggle daw; - - /** - * @param blob - */ - public DiskIterator(TroveArrayWiggle blob) { - this.daw = blob; - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#hasNext() - */ - @Override - public boolean hasNext() { - return currentIdx <= daw.size(); - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#next() - */ - @Override - public Float next() { - return daw.value(currentIdx++); - } - - /* - * (non-Javadoc) - * - * @see java.util.Iterator#remove() - */ - @Override - public void remove() { - throw new RuntimeException("Does not work"); - - } - - } - - @Override - public Iterator iterator() { - return new DiskIterator(this); - } - -} diff --git a/src/net/sf/nameservice/NameService.java b/src/net/sf/nameservice/NameService.java deleted file mode 100644 index d6216e0..0000000 --- a/src/net/sf/nameservice/NameService.java +++ /dev/null @@ -1,65 +0,0 @@ -package net.sf.nameservice; - -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; - -import net.sf.jannot.exception.ReadFailedException; -import be.abeel.io.LineIterator; - -public class NameService { - public static final HashMap map = new HashMap(); - - static { - try { - resetDefault(); - - } catch (Exception e) { - e.printStackTrace(); - System.err - .println("Failed to load naming service, synonyms won't work..."); - } - } - - void printMapping() { - System.out.println(map); - } - - public static String getPrimaryName(String key) { - key = key.trim(); - if (map.containsKey(key.toUpperCase())) - return map.get(key.toUpperCase()); - else - return key; - } - - public static void resetDefault() throws ReadFailedException { - map.clear(); - addSynonyms(NameService.class.getResourceAsStream("synonyms.txt")); - } - - public static void addSynonym(String primary, String alt) { - map.put(primary.trim().replace(' ', '_').toUpperCase(), primary.trim()); - String[] arr = alt.split(","); - for (String s : arr) { - map.put(s.trim().toUpperCase(),primary.trim()); - map.put(s.trim().replace(' ', '_').toUpperCase(), primary.trim()); - } - - } - - public static void addSynonyms(InputStream is) throws ReadFailedException { - for (String line : new LineIterator(is, true, true)) { - String[] prim = line.split("="); - addSynonym(prim[0],prim[1]); - - } - try { - is.close(); - } catch (IOException ioe) { - ioe.printStackTrace(); - System.err - .println("Failed to close the file, probably synonyms will work anyway..."); - } - } -} diff --git a/src/net/sf/nameservice/synonyms.txt b/src/net/sf/nameservice/synonyms.txt deleted file mode 100644 index 24efe41..0000000 --- a/src/net/sf/nameservice/synonyms.txt +++ /dev/null @@ -1,3791 +0,0 @@ -# Generated with gbk.CreateSynonymFile$ defined in CreateSynonymFile.scala -# Executed in /C:/tabeel/workspaceB/GenomeViewPrivate/bin/ on Wed Oct 16 16:38:39 EDT 2013 -# Please contact Thomas (tabeel@broadinstitute.org) for problems or questions -# -# Configuration summary: -# Current date and time: Wed Oct 16 16:38:39 EDT 2013 -# Number of processors: 2 -# Free memory :15184400 -# Max memory: 259522560 -# Total JVM: 16252928 -# OS: Windows XP 5.1 -# Architecture: x86 -# JVM version: 1.6.0_23 -# Auto-generated file with the GVP project. -Acaryochloris marina MBIC11017 chromosome, complete genome. (NC_009925)=NC_009925,NC_009925.1,gi|158333233|ref|NC_009925.1| -Acaryochloris marina MBIC11017 plasmid pREB1, complete sequence. (NC_009926)=NC_009926,NC_009926.1,gi|158339488|ref|NC_009926.1| -Acaryochloris marina MBIC11017 plasmid pREB2, complete sequence. (NC_009927)=NC_009927,NC_009927.1,gi|158339871|ref|NC_009927.1| -Acaryochloris marina MBIC11017 plasmid pREB3, complete sequence. (NC_009928)=NC_009928,NC_009928.1,gi|158340280|ref|NC_009928.1| -Acaryochloris marina MBIC11017 plasmid pREB4, complete sequence. (NC_009929)=NC_009929,NC_009929.1,gi|158340643|ref|NC_009929.1| -Acaryochloris marina MBIC11017 plasmid pREB5, complete sequence. (NC_009930)=NC_009930,NC_009930.1,gi|158340917|ref|NC_009930.1| -Acaryochloris marina MBIC11017 plasmid pREB6, complete sequence. (NC_009931)=NC_009931,NC_009931.1,gi|158341140|ref|NC_009931.1| -Acaryochloris marina MBIC11017 plasmid pREB7, complete sequence. (NC_009932)=NC_009932,NC_009932.1,gi|158341329|ref|NC_009932.1| -Acaryochloris marina MBIC11017 plasmid pREB8, complete sequence. (NC_009933)=NC_009933,NC_009933.1,gi|158341503|ref|NC_009933.1| -Acaryochloris marina MBIC11017 plasmid pREB9, complete sequence. (NC_009934)=NC_009934,NC_009934.1,gi|158341621|ref|NC_009934.1| -Acetobacter pasteurianus IFO 3283-01-42C plasmid pAPA42C_011, (NC_017104)=NC_017104,NC_017104.1,gi|384117540|ref|NC_017104.1| -Acetobacter pasteurianus IFO 3283-01-42C plasmid pAPA42C_020, (NC_017105)=NC_017105,NC_017105.1,gi|384117719|ref|NC_017105.1| -Acetobacter pasteurianus IFO 3283-01-42C plasmid pAPA42C_030, (NC_017151)=NC_017151,NC_017151.1,gi|384120457|ref|NC_017151.1| -Acetobacter pasteurianus IFO 3283-01-42C plasmid pAPA42C_040, (NC_017106)=NC_017106,NC_017106.1,gi|384117533|ref|NC_017106.1| -Acetobacter pasteurianus IFO 3283-01-42C plasmid pAPA42C_050, (NC_017107)=NC_017107,NC_017107.1,gi|384117537|ref|NC_017107.1| -Acetobacter pasteurianus IFO 3283-01-42C plasmid pAPA42C_060, (NC_017152)=NC_017152,NC_017152.1,gi|384120521|ref|NC_017152.1| -Acetobacter pasteurianus IFO 3283-01-42C, complete genome. (NC_017150)=NC_017150,NC_017150.1,gi|384117894|ref|NC_017150.1| -Acetobacter pasteurianus IFO 3283-01 plasmid pAPA01-011, complete (NC_013210)=NC_013210,NC_013210.1,gi|258512909|ref|NC_013210.1| -Acetobacter pasteurianus IFO 3283-01 plasmid pAPA01-020, complete (NC_013211)=NC_013211,NC_013211.1,gi|258513088|ref|NC_013211.1| -Acetobacter pasteurianus IFO 3283-01 plasmid pAPA01-030, complete (NC_013212)=NC_013212,NC_013212.1,gi|258513263|ref|NC_013212.1| -Acetobacter pasteurianus IFO 3283-01 plasmid pAPA01-040, complete (NC_013213)=NC_013213,NC_013213.1,gi|258513327|ref|NC_013213.1| -Acetobacter pasteurianus IFO 3283-01 plasmid pAPA01-050, complete (NC_013214)=NC_013214,NC_013214.1,gi|258513331|ref|NC_013214.1| -Acetobacter pasteurianus IFO 3283-01 plasmid pAPA01-060, complete (NC_013215)=NC_013215,NC_013215.1,gi|258513334|ref|NC_013215.1| -Acetobacter pasteurianus IFO 3283-01, complete genome. (NC_013209)=NC_013209,NC_013209.1,gi|258541105|ref|NC_013209.1| -Acetobacter pasteurianus IFO 3283-03 plasmid pAPA03-010, complete (NC_017101)=NC_017101,NC_017101.1,gi|384049357|ref|NC_017101.1| -Acetobacter pasteurianus IFO 3283-03 plasmid pAPA03-020, complete (NC_017118)=NC_017118,NC_017118.1,gi|384052169|ref|NC_017118.1| -Acetobacter pasteurianus IFO 3283-03 plasmid pAPA03-030, complete (NC_017119)=NC_017119,NC_017119.1,gi|384052344|ref|NC_017119.1| -Acetobacter pasteurianus IFO 3283-03 plasmid pAPA03-040, complete (NC_017142)=NC_017142,NC_017142.1,gi|384052408|ref|NC_017142.1| -Acetobacter pasteurianus IFO 3283-03 plasmid pAPA03-050, complete (NC_017120)=NC_017120,NC_017120.1,gi|384049538|ref|NC_017120.1| -Acetobacter pasteurianus IFO 3283-03 plasmid pAPA03-060, complete (NC_017109)=NC_017109,NC_017109.1,gi|384049535|ref|NC_017109.1| -Acetobacter pasteurianus IFO 3283-03, complete genome. (NC_017100)=NC_017100,NC_017100.1,gi|384049541|ref|NC_017100.1| -Acetobacter pasteurianus IFO 3283-07 plasmid pAPA07-010, complete (NC_017143)=NC_017143,NC_017143.1,gi|384055288|ref|NC_017143.1| -Acetobacter pasteurianus IFO 3283-07 plasmid pAPA07-020, complete (NC_017122)=NC_017122,NC_017122.1,gi|384052412|ref|NC_017122.1| -Acetobacter pasteurianus IFO 3283-07 plasmid pAPA07-030, complete (NC_017110)=NC_017110,NC_017110.1,gi|384052587|ref|NC_017110.1| -Acetobacter pasteurianus IFO 3283-07 plasmid pAPA07-040, complete (NC_017123)=NC_017123,NC_017123.1,gi|384055284|ref|NC_017123.1| -Acetobacter pasteurianus IFO 3283-07 plasmid pAPA07-050, complete (NC_017144)=NC_017144,NC_017144.1,gi|384055281|ref|NC_017144.1| -Acetobacter pasteurianus IFO 3283-07 plasmid pAPA07-060, complete (NC_017124)=NC_017124,NC_017124.1,gi|384055278|ref|NC_017124.1| -Acetobacter pasteurianus IFO 3283-07, complete genome. (NC_017121)=NC_017121,NC_017121.1,gi|384052651|ref|NC_017121.1| -Acetobacter pasteurianus IFO 3283-12 plasmid pAPA12-014, complete (NC_017136)=NC_017136,NC_017136.1,gi|384043891|ref|NC_017136.1| -Acetobacter pasteurianus IFO 3283-12 plasmid pAPA12-020, complete (NC_017113)=NC_017113,NC_017113.1,gi|384043652|ref|NC_017113.1| -Acetobacter pasteurianus IFO 3283-12 plasmid pAPA12-030, complete (NC_017114)=NC_017114,NC_017114.1,gi|384043827|ref|NC_017114.1| -Acetobacter pasteurianus IFO 3283-12 plasmid pAPA12-040, complete (NC_017115)=NC_017115,NC_017115.1,gi|384044072|ref|NC_017115.1| -Acetobacter pasteurianus IFO 3283-12 plasmid pAPA12-050, complete (NC_017116)=NC_017116,NC_017116.1,gi|384044076|ref|NC_017116.1| -Acetobacter pasteurianus IFO 3283-12 plasmid pAPA12-060, complete (NC_017137)=NC_017137,NC_017137.1,gi|384044069|ref|NC_017137.1| -Acetobacter pasteurianus IFO 3283-12, complete genome. (NC_017108)=NC_017108,NC_017108.1,gi|384041026|ref|NC_017108.1| -Acetobacter pasteurianus IFO 3283-22 plasmid pAPA22-010, complete (NC_017117)=NC_017117,NC_017117.1,gi|384055705|ref|NC_017117.1| -Acetobacter pasteurianus IFO 3283-22 plasmid pAPA22-020, complete (NC_017126)=NC_017126,NC_017126.1,gi|384055466|ref|NC_017126.1| -Acetobacter pasteurianus IFO 3283-22 plasmid pAPA22-030, complete (NC_017127)=NC_017127,NC_017127.1,gi|384055641|ref|NC_017127.1| -Acetobacter pasteurianus IFO 3283-22 plasmid pAPA22-040, complete (NC_017145)=NC_017145,NC_017145.1,gi|384058511|ref|NC_017145.1| -Acetobacter pasteurianus IFO 3283-22 plasmid pAPA22-050, complete (NC_017128)=NC_017128,NC_017128.1,gi|384058515|ref|NC_017128.1| -Acetobacter pasteurianus IFO 3283-22 plasmid pAPA22-060, complete (NC_017129)=NC_017129,NC_017129.1,gi|384058518|ref|NC_017129.1| -Acetobacter pasteurianus IFO 3283-22, complete genome. (NC_017125)=NC_017125,NC_017125.1,gi|384055883|ref|NC_017125.1| -Acetobacter pasteurianus IFO 3283-26 plasmid pAPA26-013, complete (NC_017130)=NC_017130,NC_017130.1,gi|384061216|ref|NC_017130.1| -Acetobacter pasteurianus IFO 3283-26 plasmid pAPA26-020, complete (NC_017131)=NC_017131,NC_017131.1,gi|384061398|ref|NC_017131.1| -Acetobacter pasteurianus IFO 3283-26 plasmid pAPA26-030, complete (NC_017147)=NC_017147,NC_017147.1,gi|384061152|ref|NC_017147.1| -Acetobacter pasteurianus IFO 3283-26 plasmid pAPA26-040, complete (NC_017132)=NC_017132,NC_017132.1,gi|384061394|ref|NC_017132.1| -Acetobacter pasteurianus IFO 3283-26 plasmid pAPA26-050, complete (NC_017148)=NC_017148,NC_017148.1,gi|384061573|ref|NC_017148.1| -Acetobacter pasteurianus IFO 3283-26 plasmid pAPA26-060, complete (NC_017133)=NC_017133,NC_017133.1,gi|384058521|ref|NC_017133.1| -Acetobacter pasteurianus IFO 3283-26, complete genome. (NC_017146)=NC_017146,NC_017146.1,gi|384058524|ref|NC_017146.1| -Acetobacter pasteurianus IFO 3283-32 plasmid pAPA32-012, complete (NC_017134)=NC_017134,NC_017134.1,gi|384061576|ref|NC_017134.1| -Acetobacter pasteurianus IFO 3283-32 plasmid pAPA32-020, complete (NC_017149)=NC_017149,NC_017149.1,gi|384064454|ref|NC_017149.1| -Acetobacter pasteurianus IFO 3283-32 plasmid pAPA32-030, complete (NC_017135)=NC_017135,NC_017135.1,gi|384061754|ref|NC_017135.1| -Acetobacter pasteurianus IFO 3283-32 plasmid pAPA32-040, complete (NC_017102)=NC_017102,NC_017102.1,gi|384064450|ref|NC_017102.1| -Acetobacter pasteurianus IFO 3283-32 plasmid pAPA32-050, complete (NC_017103)=NC_017103,NC_017103.1,gi|384064444|ref|NC_017103.1| -Acetobacter pasteurianus IFO 3283-32 plasmid pAPA32-060, complete (NC_017112)=NC_017112,NC_017112.1,gi|384064447|ref|NC_017112.1| -Acetobacter pasteurianus IFO 3283-32, complete genome. (NC_017111)=NC_017111,NC_017111.1,gi|384061818|ref|NC_017111.1| -Acetobacterium woodii DSM 1030 chromosome, complete genome. (NC_016894)=NC_016894,NC_016894.1,gi|379009891|ref|NC_016894.1| -Acetohalobium arabaticum DSM 5501 chromosome, complete genome. (NC_014378)=NC_014378,NC_014378.1,gi|302390797|ref|NC_014378.1| -Acholeplasma laidlawii PG-8A chromosome, complete genome. (NC_010163)=NC_010163,NC_010163.1,gi|162446888|ref|NC_010163.1| -Achromobacter xylosoxidans A8 chromosome, complete genome. (NC_014640)=NC_014640,NC_014640.1,gi|311103224|ref|NC_014640.1| -Achromobacter xylosoxidans A8 plasmid pA81, complete sequence. (NC_014641)=NC_014641,NC_014641.1,gi|311109684|ref|NC_014641.1| -Achromobacter xylosoxidans A8 plasmid pA82, complete sequence. (NC_014642)=NC_014642,NC_014642.1,gi|311109789|ref|NC_014642.1| -Acidaminococcus fermentans DSM 20731 chromosome, complete genome. (NC_013740)=NC_013740,NC_013740.1,gi|284047386|ref|NC_013740.1| -Acidaminococcus intestini RyC-MR95 chromosome, complete genome. (NC_016077)=NC_016077,NC_016077.1,gi|352683411|ref|NC_016077.1| -Acidianus hospitalis W1 chromosome, complete genome. (NC_015518)=NC_015518,NC_015518.1,gi|332795693|ref|NC_015518.1| -Acidilobus saccharovorans 345-15 chromosome, complete genome. (NC_014374)=NC_014374,NC_014374.1,gi|302347802|ref|NC_014374.1| -Acidimicrobium ferrooxidans DSM 10331 chromosome, complete genome. (NC_013124)=NC_013124,NC_013124.1,gi|256370824|ref|NC_013124.1| -Acidiphilium cryptum JF-5 chromosome, complete genome. (NC_009484)=NC_009484,NC_009484.1,gi|148259021|ref|NC_009484.1| -Acidiphilium cryptum JF-5 plasmid pACRY01, complete sequence. (NC_009467)=NC_009467,NC_009467.1,gi|148243635|ref|NC_009467.1| -Acidiphilium cryptum JF-5 plasmid pACRY02, complete sequence. (NC_009468)=NC_009468,NC_009468.1,gi|148243807|ref|NC_009468.1| -Acidiphilium cryptum JF-5 plasmid pACRY03, complete sequence. (NC_009469)=NC_009469,NC_009469.1,gi|148243977|ref|NC_009469.1| -Acidiphilium cryptum JF-5 plasmid pACRY04, complete sequence. (NC_009470)=NC_009470,NC_009470.1,gi|148244055|ref|NC_009470.1| -Acidiphilium cryptum JF-5 plasmid pACRY05, complete sequence. (NC_009471)=NC_009471,NC_009471.1,gi|148244088|ref|NC_009471.1| -Acidiphilium cryptum JF-5 plasmid pACRY06, complete sequence. (NC_009472)=NC_009472,NC_009472.1,gi|148244117|ref|NC_009472.1| -Acidiphilium cryptum JF-5 plasmid pACRY07, complete sequence. (NC_009473)=NC_009473,NC_009473.1,gi|148244127|ref|NC_009473.1| -Acidiphilium cryptum JF-5 plasmid pACRY08, complete sequence. (NC_009474)=NC_009474,NC_009474.1,gi|148244133|ref|NC_009474.1| -Acidiphilium multivorum AIU301 plasmid pACMV1, complete sequence. (NC_015178)=NC_015178,NC_015178.1,gi|325112992|ref|NC_015178.1| -Acidiphilium multivorum AIU301 plasmid pACMV2, complete sequence. (NC_015187)=NC_015187,NC_015187.1,gi|325168931|ref|NC_015187.1| -Acidiphilium multivorum AIU301 plasmid pACMV3, complete sequence. (NC_015179)=NC_015179,NC_015179.1,gi|325113277|ref|NC_015179.1| -Acidiphilium multivorum AIU301 plasmid pACMV4, complete sequence. (NC_015188)=NC_015188,NC_015188.1,gi|325169001|ref|NC_015188.1| -Acidiphilium multivorum AIU301 plasmid pACMV5, complete sequence. (NC_015180)=NC_015180,NC_015180.1,gi|325168242|ref|NC_015180.1| -Acidiphilium multivorum AIU301 plasmid pACMV6, complete sequence. (NC_015181)=NC_015181,NC_015181.1,gi|325168262|ref|NC_015181.1| -Acidiphilium multivorum AIU301 plasmid pACMV7, complete sequence. (NC_015189)=NC_015189,NC_015189.1,gi|325169046|ref|NC_015189.1| -Acidiphilium multivorum AIU301 plasmid pACMV8, complete sequence. (NC_015182)=NC_015182,NC_015182.1,gi|325168277|ref|NC_015182.1| -Acidiphilium multivorum AIU301, complete genome. (NC_015186)=NC_015186,NC_015186.1,gi|326402148|ref|NC_015186.1| -Acidithiobacillus caldus SM-1 chromosome, complete genome. (NC_015850)=NC_015850,NC_015850.1,gi|340780744|ref|NC_015850.1| -Acidithiobacillus caldus SM-1 megaplasmid, complete sequence. (NC_015851)=NC_015851,NC_015851.1,gi|340783625|ref|NC_015851.1| -Acidithiobacillus caldus SM-1 plasmid pLAtc1, complete sequence. (NC_015852)=NC_015852,NC_015852.1,gi|340783881|ref|NC_015852.1| -Acidithiobacillus caldus SM-1 plasmid pLAtc2, complete sequence. (NC_015853)=NC_015853,NC_015853.1,gi|340783921|ref|NC_015853.1| -Acidithiobacillus caldus SM-1 plasmid pLAtc3, complete sequence. (NC_015854)=NC_015854,NC_015854.1,gi|340783892|ref|NC_015854.1| -Acidithiobacillus ferrivorans SS3 chromosome, complete genome. (NC_015942)=NC_015942,NC_015942.1,gi|344198243|ref|NC_015942.1| -Acidithiobacillus ferrooxidans ATCC 23270, complete genome. (NC_011761)=NC_011761,NC_011761.1,gi|218665024|ref|NC_011761.1| -Acidithiobacillus ferrooxidans ATCC 53993 chromosome, complete (NC_011206)=NC_011206,NC_011206.1,gi|198282148|ref|NC_011206.1| -Granulicella tundricola chromosome, complete genome. (NC_015064)=NC_015064,NC_015064.1,gi|322433659|ref|NC_015064.1| -Granulicella tundricola plasmid pACIX901, complete sequence. (NC_015057)=NC_015057,NC_015057.1,gi|322432858|ref|NC_015057.1| -Granulicella tundricola plasmid pACIX902, complete sequence. (NC_015065)=NC_015065,NC_015065.1,gi|322437479|ref|NC_015065.1| -Granulicella tundricola plasmid pACIX903, complete sequence. (NC_015058)=NC_015058,NC_015058.1,gi|322433172|ref|NC_015058.1| -Granulicella tundricola plasmid pACIX904, complete sequence. (NC_015059)=NC_015059,NC_015059.1,gi|322433342|ref|NC_015059.1| -Granulicella tundricola plasmid pACIX905, complete sequence. (NC_015060)=NC_015060,NC_015060.1,gi|322836736|ref|NC_015060.1| -Acidobacterium capsulatum ATCC 51196, complete genome. (NC_012483)=NC_012483,NC_012483.1,gi|225871699|ref|NC_012483.1| -Acidothermus cellulolyticus 11B chromosome, complete genome. (NC_008578)=NC_008578,NC_008578.1,gi|117927211|ref|NC_008578.1| -Acidovorax sp. JS42 chromosome, complete genome. (NC_008782)=NC_008782,NC_008782.1,gi|121592436|ref|NC_008782.1| -Acidovorax sp. JS42 plasmid pAOVO01, complete sequence. (NC_008765)=NC_008765,NC_008765.1,gi|121582466|ref|NC_008765.1| -Acidovorax sp. JS42 plasmid pAOVO02, complete sequence. (NC_008766)=NC_008766,NC_008766.1,gi|121582553|ref|NC_008766.1| -Acidovorax avenae subsp. avenae ATCC 19860 chromosome, complete (NC_015138)=NC_015138,NC_015138.1,gi|326314823|ref|NC_015138.1| -Acidovorax citrulli AAC00-1 chromosome, complete genome. (NC_008752)=NC_008752,NC_008752.1,gi|120608714|ref|NC_008752.1| -Acidovorax ebreus TPSY chromosome, complete genome. (NC_011992)=NC_011992,NC_011992.1,gi|222109225|ref|NC_011992.1| -Aciduliprofundum boonei T469 chromosome, complete genome. (NC_013926)=NC_013926,NC_013926.1,gi|289595678|ref|NC_013926.1| -Acinetobacter sp. ADP1 chromosome, complete genome. (NC_005966)=NC_005966,NC_005966.1,gi|50083297|ref|NC_005966.1| -Acinetobacter baumannii 1656-2 chromosome, complete genome. (NC_017162)=NC_017162,NC_017162.1,gi|384129960|ref|NC_017162.1| -Acinetobacter baumannii 1656-2 plasmid ABKp1, complete sequence. (NC_017163)=NC_017163,NC_017163.1,gi|384133685|ref|NC_017163.1| -Acinetobacter baumannii 1656-2 plasmid ABKp2, complete sequence. (NC_017164)=NC_017164,NC_017164.1,gi|384133676|ref|NC_017164.1| -Acinetobacter baumannii AB0057 chromosome, complete genome. (NC_011586)=NC_011586,NC_011586.1,gi|213155370|ref|NC_011586.1| -Acinetobacter baumannii AB0057 plasmid pAB0057, complete sequence. (NC_011585)=NC_011585,NC_011585.1,gi|213155358|ref|NC_011585.1| -Acinetobacter baumannii AB307-0294, complete genome. (NC_011595)=NC_011595,NC_011595.1,gi|215481761|ref|NC_011595.1| -Acinetobacter baumannii ACICU chromosome, complete genome. (NC_010611)=NC_010611,NC_010611.1,gi|184156320|ref|NC_010611.1| -Acinetobacter baumannii ACICU plasmid pACICU1, complete sequence. (NC_010605)=NC_010605,NC_010605.1,gi|184159988|ref|NC_010605.1| -Acinetobacter baumannii ACICU plasmid pACICU2, complete sequence. (NC_010606)=NC_010606,NC_010606.1,gi|184160017|ref|NC_010606.1| -Acinetobacter baumannii ATCC 17978 chromosome, complete genome. (NC_009085)=NC_009085,NC_009085.1,gi|126640115|ref|NC_009085.1| -Acinetobacter baumannii ATCC 17978 plasmid pAB1, complete sequence. (NC_009083)=NC_009083,NC_009083.1,gi|126640097|ref|NC_009083.1| -Acinetobacter baumannii ATCC 17978 plasmid pAB2, complete sequence. (NC_009084)=NC_009084,NC_009084.1,gi|126640109|ref|NC_009084.1| -Acinetobacter baumannii AYE chromosome, complete genome. (NC_010410)=NC_010410,NC_010410.1,gi|169794206|ref|NC_010410.1| -Acinetobacter baumannii AYE plasmid p1ABAYE, complete sequence. (NC_010401)=NC_010401,NC_010401.1,gi|169302972|ref|NC_010401.1| -Acinetobacter baumannii AYE plasmid p2ABAYE, complete sequence. (NC_010402)=NC_010402,NC_010402.1,gi|169302980|ref|NC_010402.1| -Acinetobacter baumannii AYE plasmid p3ABAYE, complete sequence. (NC_010404)=NC_010404,NC_010404.1,gi|169786889|ref|NC_010404.1| -Acinetobacter baumannii AYE plasmid p4ABAYE, complete sequence. (NC_010403)=NC_010403,NC_010403.1,gi|169302992|ref|NC_010403.1| -Acinetobacter baumannii MDR-TJ chromosome, complete genome. (NC_017847)=NC_017847,NC_017847.1,gi|387122089|ref|NC_017847.1| -Acinetobacter baumannii MDR-TJ plasmid pABTJ1, complete sequence. (NC_017848)=NC_017848,NC_017848.1,gi|387125794|ref|NC_017848.1| -Acinetobacter baumannii MDR-ZJ06 chromosome, complete genome. (NC_017171)=NC_017171,NC_017171.1,gi|384141246|ref|NC_017171.1| -Acinetobacter baumannii MDR-ZJ06 plasmid pMDR-ZJ06, complete (NC_017172)=NC_017172,NC_017172.1,gi|384145110|ref|NC_017172.1| -Acinetobacter baumannii SDF chromosome, complete genome. (NC_010400)=NC_010400,NC_010400.1,gi|169632029|ref|NC_010400.1| -Acinetobacter baumannii SDF plasmid p1ABSDF, complete sequence. (NC_010395)=NC_010395,NC_010395.1,gi|169302963|ref|NC_010395.1| -Acinetobacter baumannii SDF plasmid p2ABSDF, complete sequence. (NC_010396)=NC_010396,NC_010396.1,gi|169786833|ref|NC_010396.1| -Acinetobacter baumannii SDF plasmid p3ABSDF, complete sequence. (NC_010398)=NC_010398,NC_010398.1,gi|169786864|ref|NC_010398.1| -Acinetobacter baumannii TCDC-AB0715 chromosome, complete genome. (NC_017387)=NC_017387,NC_017387.1,gi|385235550|ref|NC_017387.1| -Acinetobacter baumannii TCDC-AB0715 plasmid p1ABTCDC0715, complete (NC_017165)=NC_017165,NC_017165.1,gi|385239402|ref|NC_017165.1| -Acinetobacter baumannii TCDC-AB0715 plasmid p2ABTCDC0715, complete (NC_017166)=NC_017166,NC_017166.1,gi|385239413|ref|NC_017166.1| -Acinetobacter calcoaceticus PHEA-2 chromosome, complete genome. (NC_016603)=NC_016603,NC_016603.1,gi|375133618|ref|NC_016603.1| -Acinetobacter oleivorans DR1 chromosome, complete genome. (NC_014259)=NC_014259,NC_014259.1,gi|299768250|ref|NC_014259.1| -Actinobacillus pleuropneumoniae serovar 3 str. JL03 chromosome, (NC_010278)=NC_010278,NC_010278.1,gi|165975457|ref|NC_010278.1| -Actinobacillus pleuropneumoniae serovar 5b str. L20 chromosome, (NC_009053)=NC_009053,NC_009053.1,gi|126207488|ref|NC_009053.1| -Actinobacillus pleuropneumoniae serovar 7 str. AP76 plasmid ABB7_B, (NC_010941)=NC_010941,NC_010941.1,gi|190151404|ref|NC_010941.1| -Actinobacillus pleuropneumoniae serovar 7 str. AP76 plasmid APP7_A, (NC_010942)=NC_010942,NC_010942.1,gi|190151409|ref|NC_010942.1| -Actinobacillus pleuropneumoniae serovar 7 str. AP76 plasmid APP7_C, (NC_010940)=NC_010940,NC_010940.1,gi|190151401|ref|NC_010940.1| -Actinobacillus pleuropneumoniae serovar 7 str. AP76, complete (NC_010939)=NC_010939,NC_010939.1,gi|190149269|ref|NC_010939.1| -Actinobacillus succinogenes 130Z chromosome, complete genome. (NC_009655)=NC_009655,NC_009655.1,gi|152977688|ref|NC_009655.1| -Actinoplanes sp. SE50/110 chromosome, complete genome. (NC_017803)=NC_017803,NC_017803.1,gi|386845069|ref|NC_017803.1| -Actinoplanes missouriensis 431, complete genome. (NC_017093)=NC_017093,NC_017093.1,gi|383775170|ref|NC_017093.1| -Actinosynnema mirum DSM 43827 chromosome, complete genome. (NC_013093)=NC_013093,NC_013093.1,gi|256374160|ref|NC_013093.1| -Advenella kashmirensis WT001 chromosome, complete genome. (NC_017964)=NC_017964,NC_017964.1,gi|389870301|ref|NC_017964.1| -Advenella kashmirensis WT001 plasmid pWTk445, complete sequence. (NC_017965)=NC_017965,NC_017965.1,gi|389874175|ref|NC_017965.1| -Aequorivita sublithincola DSM 14238 chromosome, complete genome. (NC_018013)=NC_018013,NC_018013.1,gi|390952789|ref|NC_018013.1| -Aerococcus urinae ACS-120-V-Col10a chromosome, complete genome. (NC_015278)=NC_015278,NC_015278.1,gi|326802614|ref|NC_015278.1| -Aeromonas hydrophila subsp. hydrophila ATCC 7966 chromosome, (NC_008570)=NC_008570,NC_008570.1,gi|117617447|ref|NC_008570.1| -Aeromonas salmonicida salmonicida A449 plasmid pAsa1, complete (NC_004923)=NC_004923,NC_004923.1,gi|32453760|ref|NC_004923.1| -Aeromonas salmonicida salmonicida A449 plasmid pAsa2, complete (NC_004925)=NC_004925,NC_004925.1,gi|32453780|ref|NC_004925.1| -Aeromonas salmonicida salmonicida A449 plasmid pAsa3, complete (NC_004924)=NC_004924,NC_004924.1,gi|32453769|ref|NC_004924.1| -Aeromonas salmonicida subsp. salmonicida A449 plasmid 4, complete (NC_009349)=NC_009349,NC_009349.1,gi|145301211|ref|NC_009349.1| -Aeromonas salmonicida subsp. salmonicida A449 plasmid 5, complete (NC_009350)=NC_009350,NC_009350.1,gi|145301385|ref|NC_009350.1| -Aeromonas salmonicida subsp. salmonicida A449, complete genome. (NC_009348)=NC_009348,NC_009348.1,gi|145297124|ref|NC_009348.1| -Aeromonas veronii B565 chromosome, complete genome. (NC_015424)=NC_015424,NC_015424.1,gi|330827700|ref|NC_015424.1| -Aeropyrum pernix K1, complete genome. (NC_000854)=NC_000854,NC_000854.2,gi|118430835|ref|NC_000854.2| -Aggregatibacter actinomycetemcomitans ANH9381 chromosome, complete (NC_016513)=NC_016513,NC_016513.1,gi|365966241|ref|NC_016513.1| -Aggregatibacter actinomycetemcomitans D7S-1 chromosome, complete (NC_017846)=NC_017846,NC_017846.1,gi|387119833|ref|NC_017846.1| -Aggregatibacter aphrophilus NJ8700 chromosome, complete genome. (NC_012913)=NC_012913,NC_012913.1,gi|251791816|ref|NC_012913.1| -Agrobacterium sp. H13-3 chromosome linear, complete sequence. (NC_015508)=NC_015508,NC_015508.1,gi|332715374|ref|NC_015508.1| -Agrobacterium sp. H13-3 chromosome, complete genome. (NC_015183)=NC_015183,NC_015183.1,gi|325291453|ref|NC_015183.1| -Agrobacterium sp. H13-3 plasmid pAspH13-3a, complete sequence. (NC_015184)=NC_015184,NC_015184.1,gi|325168279|ref|NC_015184.1| -Agrobacterium radiobacter K84 chromosome 1, complete genome. (NC_011985)=NC_011985,NC_011985.1,gi|222084201|ref|NC_011985.1| -Agrobacterium radiobacter K84 chromosome 2, complete genome. (NC_011983)=NC_011983,NC_011983.1,gi|222080781|ref|NC_011983.1| -Agrobacterium radiobacter K84 plasmid pAgK84, complete sequence. (NC_011994)=NC_011994,NC_011994.1,gi|222112705|ref|NC_011994.1| -Agrobacterium radiobacter K84 plasmid pAtK84b, complete sequence. (NC_011990)=NC_011990,NC_011990.1,gi|222108940|ref|NC_011990.1| -Agrobacterium radiobacter K84 plasmid pAtK84c, complete sequence. (NC_011987)=NC_011987,NC_011987.1,gi|222101962|ref|NC_011987.1| -Agrobacterium tumefaciens str. C58 chromosome circular, complete (NC_003062)=NC_003062,NC_003062.2,gi|159184118|ref|NC_003062.2| -Agrobacterium tumefaciens str. C58 chromosome linear, complete (NC_003063)=NC_003063,NC_003063.2,gi|159185562|ref|NC_003063.2| -Agrobacterium tumefaciens str. C58 plasmid At, complete sequence. (NC_003064)=NC_003064,NC_003064.2,gi|159186452|ref|NC_003064.2| -Agrobacterium tumefaciens str. C58 plasmid Ti, complete sequence. (NC_003065)=NC_003065,NC_003065.3,gi|159161952|ref|NC_003065.3| -Agrobacterium vitis S4 chromosome 1, complete genome. (NC_011989)=NC_011989,NC_011989.1,gi|222147015|ref|NC_011989.1| -Agrobacterium vitis S4 chromosome 2, complete genome. (NC_011988)=NC_011988,NC_011988.1,gi|222106127|ref|NC_011988.1| -Agrobacterium vitis S4 plasmid pAtS4a, complete sequence. (NC_011986)=NC_011986,NC_011986.1,gi|222102329|ref|NC_011986.1| -Agrobacterium vitis S4 plasmid pAtS4b, complete sequence. (NC_011991)=NC_011991,NC_011991.1,gi|222109117|ref|NC_011991.1| -Agrobacterium vitis S4 plasmid pAtS4c, complete sequence. (NC_011984)=NC_011984,NC_011984.1,gi|222083145|ref|NC_011984.1| -Agrobacterium vitis S4 plasmid pAtS4e, complete sequence. (NC_011981)=NC_011981,NC_011981.1,gi|222102412|ref|NC_011981.1| -Agrobacterium vitis S4 plasmid pTiS4, complete sequence. (NC_011982)=NC_011982,NC_011982.1,gi|222080117|ref|NC_011982.1| -Akkermansia muciniphila ATCC BAA-835 chromosome, complete genome. (NC_010655)=NC_010655,NC_010655.1,gi|187734516|ref|NC_010655.1| -Alcanivorax borkumensis SK2 chromosome, complete genome. (NC_008260)=NC_008260,NC_008260.1,gi|110832861|ref|NC_008260.1| -Alicycliphilus denitrificans BC chromosome, complete genome. (NC_014910)=NC_014910,NC_014910.1,gi|319760738|ref|NC_014910.1| -Alicycliphilus denitrificans BC plasmid pALIDE01, complete (NC_014908)=NC_014908,NC_014908.1,gi|319760024|ref|NC_014908.1| -Alicycliphilus denitrificans BC plasmid pALIDE02, complete (NC_014911)=NC_014911,NC_014911.1,gi|319765069|ref|NC_014911.1| -Alicycliphilus denitrificans K601 chromosome, complete genome. (NC_015422)=NC_015422,NC_015422.1,gi|330822653|ref|NC_015422.1| -Alicycliphilus denitrificans K601 plasmid pALIDE201, complete (NC_015423)=NC_015423,NC_015423.1,gi|330827325|ref|NC_015423.1| -Alicyclobacillus acidocaldarius subsp. acidocaldarius DSM 446 (NC_013205)=NC_013205,NC_013205.1,gi|258510020|ref|NC_013205.1| -Alicyclobacillus acidocaldarius subsp. acidocaldarius DSM 446 (NC_013206)=NC_013206,NC_013206.1,gi|257792943|ref|NC_013206.1| -Alicyclobacillus acidocaldarius subsp. acidocaldarius DSM 446 (NC_013207)=NC_013207,NC_013207.1,gi|257793042|ref|NC_013207.1| -Alicyclobacillus acidocaldarius subsp. acidocaldarius DSM 446 (NC_013208)=NC_013208,NC_013208.1,gi|257793135|ref|NC_013208.1| -Alicyclobacillus acidocaldarius subsp. acidocaldarius Tc-4-1 (NC_017167)=NC_017167,NC_017167.1,gi|384133787|ref|NC_017167.1| -Aliivibrio salmonicida LFI1238 chromosome 2, complete sequence. (NC_011313)=NC_011313,NC_011313.1,gi|209808847|ref|NC_011313.1| -Aliivibrio salmonicida LFI1238 chromosome chromosome 1, complete (NC_011312)=NC_011312,NC_011312.1,gi|209693634|ref|NC_011312.1| -Aliivibrio salmonicida LFI1238 plasmid pVSAL320, complete sequence. (NC_011314)=NC_011314,NC_011314.1,gi|209967944|ref|NC_011314.1| -Aliivibrio salmonicida LFI1238 plasmid pVSAL43, complete sequence. (NC_011316)=NC_011316,NC_011316.1,gi|215538592|ref|NC_011316.1| -Aliivibrio salmonicida LFI1238 plasmid pVSAL54, complete sequence. (NC_011315)=NC_011315,NC_011315.1,gi|209809832|ref|NC_011315.1| -Aliivibrio salmonicida LFI1238 plasmid pVSAL840, complete sequence. (NC_011311)=NC_011311,NC_011311.1,gi|215778350|ref|NC_011311.1| -Alistipes finegoldii DSM 17242 chromosome, complete genome. (NC_018011)=NC_018011,NC_018011.1,gi|390945347|ref|NC_018011.1| -Alkalilimnicola ehrlichii MLHE-1 chromosome, complete genome. (NC_008340)=NC_008340,NC_008340.1,gi|114319166|ref|NC_008340.1| -Alkaliphilus metalliredigens QYMF chromosome, complete genome. (NC_009633)=NC_009633,NC_009633.1,gi|150387853|ref|NC_009633.1| -Alkaliphilus oremlandii OhILAs chromosome, complete genome. (NC_009922)=NC_009922,NC_009922.1,gi|158319059|ref|NC_009922.1| -Allochromatium vinosum DSM 180 chromosome, complete genome. (NC_013851)=NC_013851,NC_013851.1,gi|288939764|ref|NC_013851.1| -Allochromatium vinosum DSM 180 plasmid pALVIN01, complete sequence. (NC_013852)=NC_013852,NC_013852.1,gi|288947674|ref|NC_013852.1| -Allochromatium vinosum DSM 180 plasmid pALVIN02, complete sequence. (NC_013862)=NC_013862,NC_013862.1,gi|288986931|ref|NC_013862.1| -Alteromonas sp. SN2 chromosome, complete genome. (NC_015554)=NC_015554,NC_015554.1,gi|333891490|ref|NC_015554.1| -Alteromonas macleodii str. 'Deep ecotype' chromosome, complete (NC_011138)=NC_011138,NC_011138.2,gi|332139409|ref|NC_011138.2| -Aminobacterium colombiense DSM 12261 chromosome, complete genome. (NC_014011)=NC_014011,NC_014011.1,gi|294101015|ref|NC_014011.1| -Ammonifex degensii KC4 chromosome, complete genome. (NC_013385)=NC_013385,NC_013385.1,gi|260891930|ref|NC_013385.1| -Ammonifex degensii KC4 plasmid pADEG01, complete sequence. (NC_013386)=NC_013386,NC_013386.1,gi|260893985|ref|NC_013386.1| -Amycolatopsis mediterranei S699 chromosome, complete genome. (NC_017186)=NC_017186,NC_017186.1,gi|384145136|ref|NC_017186.1| -Amycolatopsis mediterranei U32 chromosome, complete genome. (NC_014318)=NC_014318,NC_014318.1,gi|300781937|ref|NC_014318.1| -Amycolicicoccus subflavus DQS3-9A1 chromosome, complete genome. (NC_015564)=NC_015564,NC_015564.1,gi|333917679|ref|NC_015564.1| -Amycolicicoccus subflavus DQS3-9A1 plasmid pAS9A-1, complete (NC_015560)=NC_015560,NC_015560.1,gi|333917529|ref|NC_015560.1| -Amycolicicoccus subflavus DQS3-9A1 plasmid pAS9A-2, complete (NC_015561)=NC_015561,NC_015561.1,gi|333917557|ref|NC_015561.1| -Anabaena variabilis ATCC 29413 chromosome, complete genome. (NC_007413)=NC_007413,NC_007413.1,gi|75906225|ref|NC_007413.1| -Anabaena variabilis ATCC 29413 incision element, complete genome. (NC_014000)=NC_014000,NC_014000.1,gi|292905252|ref|NC_014000.1| -Anabaena variabilis ATCC 29413 plasmid A, complete sequence. (NC_007410)=NC_007410,NC_007410.1,gi|75812284|ref|NC_007410.1| -Anabaena variabilis ATCC 29413 plasmid B, complete sequence. (NC_007411)=NC_007411,NC_007411.1,gi|75812629|ref|NC_007411.1| -Anabaena variabilis ATCC 29413 plasmid C, complete sequence. (NC_007412)=NC_007412,NC_007412.1,gi|75812661|ref|NC_007412.1| -Anaerobaculum mobile DSM 13181 chromosome, complete genome. (NC_018024)=NC_018024,NC_018024.1,gi|392406391|ref|NC_018024.1| -Anaerococcus prevotii DSM 20548 chromosome, complete genome. (NC_013171)=NC_013171,NC_013171.1,gi|257065520|ref|NC_013171.1| -Anaerococcus prevotii DSM 20548 plasmid pAPRE01, complete sequence. (NC_013164)=NC_013164,NC_013164.1,gi|256821123|ref|NC_013164.1| -Anaerolinea thermophila UNI-1, complete genome. (NC_014960)=NC_014960,NC_014960.1,gi|320159410|ref|NC_014960.1| -Anaeromyxobacter sp. Fw109-5 chromosome, complete genome. (NC_009675)=NC_009675,NC_009675.1,gi|153002879|ref|NC_009675.1| -Anaeromyxobacter sp. K chromosome, complete genome. (NC_011145)=NC_011145,NC_011145.1,gi|197120421|ref|NC_011145.1| -Anaeromyxobacter dehalogenans 2CP-1 chromosome, complete genome. (NC_011891)=NC_011891,NC_011891.1,gi|220915123|ref|NC_011891.1| -Anaeromyxobacter dehalogenans 2CP-C chromosome, complete genome. (NC_007760)=NC_007760,NC_007760.1,gi|86156430|ref|NC_007760.1| -Anaplasma centrale str. Israel chromosome, complete genome. (NC_013532)=NC_013532,NC_013532.1,gi|269958255|ref|NC_013532.1| -Anaplasma marginale str. Florida, complete genome. (NC_012026)=NC_012026,NC_012026.1,gi|222474741|ref|NC_012026.1| -Anaplasma marginale str. St. Maries, complete genome. (NC_004842)=NC_004842,NC_004842.2,gi|56416370|ref|NC_004842.2| -Anaplasma phagocytophilum HZ, complete genome. (NC_007797)=NC_007797,NC_007797.1,gi|88606690|ref|NC_007797.1| -Anoxybacillus flavithermus WK1 chromosome, complete genome. (NC_011567)=NC_011567,NC_011567.1,gi|212637849|ref|NC_011567.1| -Aquifex aeolicus VF5 plasmid ece1, complete sequence. (NC_001880)=NC_001880,NC_001880.1,gi|10957041|ref|NC_001880.1| -Aquifex aeolicus VF5, complete genome. (NC_000918)=NC_000918,NC_000918.1,gi|15282445|ref|NC_000918.1| -Arcanobacterium haemolyticum DSM 20595 chromosome, complete genome. (NC_014218)=NC_014218,NC_014218.1,gi|297570613|ref|NC_014218.1| -Archaeoglobus fulgidus DSM 4304, complete genome. (NC_000917)=NC_000917,NC_000917.1,gi|11497621|ref|NC_000917.1| -Archaeoglobus profundus DSM 5631 chromosome, complete genome. (NC_013741)=NC_013741,NC_013741.1,gi|284161128|ref|NC_013741.1| -Archaeoglobus profundus DSM 5631 plasmid pArcpr01, complete (NC_013742)=NC_013742,NC_013742.1,gi|284162948|ref|NC_013742.1| -Archaeoglobus veneficus SNP6 chromosome, complete genome. (NC_015320)=NC_015320,NC_015320.1,gi|327399920|ref|NC_015320.1| -Arcobacter sp. L plasmid pABL, complete sequence. (NC_017193)=NC_017193,NC_017193.1,gi|383505584|ref|NC_017193.1| -Arcobacter sp. L, complete genome. (NC_017192)=NC_017192,NC_017192.1,gi|384170815|ref|NC_017192.1| -Arcobacter butzleri ED-1, complete genome. (NC_017187)=NC_017187,NC_017187.1,gi|384154712|ref|NC_017187.1| -Arcobacter butzleri RM4018, complete genome. (NC_009850)=NC_009850,NC_009850.1,gi|157736271|ref|NC_009850.1| -Arcobacter nitrofigilis DSM 7299 chromosome, complete genome. (NC_014166)=NC_014166,NC_014166.1,gi|296271545|ref|NC_014166.1| -Aromatoleum aromaticum EbN1 chromosome, complete genome. (NC_006513)=NC_006513,NC_006513.1,gi|56475432|ref|NC_006513.1| -Azoarcus sp. EbN1 plasmid 1, complete sequence. (NC_006823)=NC_006823,NC_006823.1,gi|58616149|ref|NC_006823.1| -Azoarcus sp. EbN1 plasmid 2, complete sequence. (NC_006824)=NC_006824,NC_006824.1,gi|58616422|ref|NC_006824.1| -Arthrobacter sp. FB24 plasmid 1, complete sequence. (NC_008537)=NC_008537,NC_008537.1,gi|116662073|ref|NC_008537.1| -Arthrobacter sp. FB24 plasmid 2, complete sequence. (NC_008538)=NC_008538,NC_008538.1,gi|116662232|ref|NC_008538.1| -Arthrobacter sp. FB24 plasmid 3, complete sequence. (NC_008539)=NC_008539,NC_008539.1,gi|116662341|ref|NC_008539.1| -Arthrobacter sp. FB24, complete sequence. (NC_008541)=NC_008541,NC_008541.1,gi|116668568|ref|NC_008541.1| -Arthrobacter arilaitensis Re117 chromosome, complete genome. (NC_014550)=NC_014550,NC_014550.1,gi|308175814|ref|NC_014550.1| -Arthrobacter arilaitensis Re117 plasmid pRE117-1, complete (NC_014549)=NC_014549,NC_014549.1,gi|308171843|ref|NC_014549.1| -Arthrobacter arilaitensis Re117 plasmid pRE117-2, complete (NC_014548)=NC_014548,NC_014548.1,gi|308151709|ref|NC_014548.1| -Arthrobacter aurescens TC1 plasmid TC1, complete sequence. (NC_008712)=NC_008712,NC_008712.1,gi|119952258|ref|NC_008712.1| -Arthrobacter aurescens TC1 plasmid TC2, complete sequence. (NC_008713)=NC_008713,NC_008713.1,gi|119952551|ref|NC_008713.1| -Arthrobacter aurescens TC1, complete genome. (NC_008711)=NC_008711,NC_008711.1,gi|119960487|ref|NC_008711.1| -Arthrobacter chlorophenolicus A6 chromosome, complete genome. (NC_011886)=NC_011886,NC_011886.1,gi|220910783|ref|NC_011886.1| -Arthrobacter chlorophenolicus A6 plasmid pACHL01, complete (NC_011879)=NC_011879,NC_011879.1,gi|219882541|ref|NC_011879.1| -Arthrobacter chlorophenolicus A6 plasmid pACHL02, complete (NC_011881)=NC_011881,NC_011881.1,gi|219883257|ref|NC_011881.1| -Arthrobacter phenanthrenivorans Sphe3 chromosome, complete genome. (NC_015145)=NC_015145,NC_015145.1,gi|325961450|ref|NC_015145.1| -Arthrobacter phenanthrenivorans Sphe3 plasmid pASPHE301, complete (NC_015146)=NC_015146,NC_015146.1,gi|325965294|ref|NC_015146.1| -Arthrobacter phenanthrenivorans Sphe3 plasmid pASPHE302, complete (NC_015147)=NC_015147,NC_015147.1,gi|325965484|ref|NC_015147.1| -Aster yellows witches'-broom phytoplasma AYWB plasmid pAYWB-I, (NC_007717)=NC_007717,NC_007717.1,gi|85057952|ref|NC_007717.1| -Aster yellows witches'-broom phytoplasma AYWB plasmid pAYWB-II, (NC_007718)=NC_007718,NC_007718.1,gi|85057958|ref|NC_007718.1| -Aster yellows witches'-broom phytoplasma AYWB plasmid pAYWB-III, (NC_007719)=NC_007719,NC_007719.1,gi|85057963|ref|NC_007719.1| -Aster yellows witches'-broom phytoplasma AYWB plasmid pAYWB-IV, (NC_007720)=NC_007720,NC_007720.1,gi|85057971|ref|NC_007720.1| -Aster yellows witches'-broom phytoplasma AYWB, complete genome. (NC_007716)=NC_007716,NC_007716.1,gi|85057280|ref|NC_007716.1| -Asticcacaulis excentricus CB 48 chromosome 1, complete sequence. (NC_014816)=NC_014816,NC_014816.1,gi|315497051|ref|NC_014816.1| -Asticcacaulis excentricus CB 48 chromosome 2, complete sequence. (NC_014817)=NC_014817,NC_014817.1,gi|315499382|ref|NC_014817.1| -Asticcacaulis excentricus CB 48 plasmid pASTEX01, complete (NC_014818)=NC_014818,NC_014818.1,gi|315500504|ref|NC_014818.1| -Asticcacaulis excentricus CB 48 plasmid pASTEX02, complete (NC_014819)=NC_014819,NC_014819.1,gi|315500677|ref|NC_014819.1| -Atopobium parvulum DSM 20469 chromosome, complete genome. (NC_013203)=NC_013203,NC_013203.1,gi|257783814|ref|NC_013203.1| -Azoarcus sp. BH72 chromosome, complete genome. (NC_008702)=NC_008702,NC_008702.1,gi|119896292|ref|NC_008702.1| -Azorhizobium caulinodans ORS 571 chromosome, complete genome. (NC_009937)=NC_009937,NC_009937.1,gi|158421624|ref|NC_009937.1| -Azospirillum sp. B510 chromosome, complete genome. (NC_013854)=NC_013854,NC_013854.1,gi|288956841|ref|NC_013854.1| -Azospirillum sp. B510 plasmid pAB510a, complete sequence. (NC_013855)=NC_013855,NC_013855.1,gi|288959735|ref|NC_013855.1| -Azospirillum sp. B510 plasmid pAB510b, complete sequence. (NC_013856)=NC_013856,NC_013856.1,gi|288960867|ref|NC_013856.1| -Azospirillum sp. B510 plasmid pAB510c, complete sequence. (NC_013857)=NC_013857,NC_013857.1,gi|288961527|ref|NC_013857.1| -Azospirillum sp. B510 plasmid pAB510d, complete sequence. (NC_013858)=NC_013858,NC_013858.1,gi|288962075|ref|NC_013858.1| -Azospirillum sp. B510 plasmid pAB510e, complete sequence. (NC_013859)=NC_013859,NC_013859.1,gi|288962595|ref|NC_013859.1| -Azospirillum sp. B510 plasmid pAB510f, complete sequence. (NC_013860)=NC_013860,NC_013860.1,gi|288963025|ref|NC_013860.1| -Azospirillum brasilense Sp245 plasmid AZOBR_p1, complete sequence. (NC_016594)=NC_016594,NC_016594.1,gi|392377157|ref|NC_016594.1| -Azospirillum brasilense Sp245 plasmid AZOBR_p2, complete sequence. (NC_016618)=NC_016618,NC_016618.1,gi|392383673|ref|NC_016618.1| -Azospirillum brasilense Sp245 plasmid AZOBR_p3, complete sequence. (NC_016595)=NC_016595,NC_016595.1,gi|392378906|ref|NC_016595.1| -Azospirillum brasilense Sp245 plasmid AZOBR_p4, complete sequence. (NC_016596)=NC_016596,NC_016596.1,gi|392379715|ref|NC_016596.1| -Azospirillum brasilense Sp245 plasmid AZOBR_p5, complete sequence. (NC_016619)=NC_016619,NC_016619.1,gi|392384558|ref|NC_016619.1| -Azospirillum brasilense Sp245 plasmid AZOBR_p6, complete sequence. (NC_016597)=NC_016597,NC_016597.1,gi|392380387|ref|NC_016597.1| -Azospirillum brasilense Sp245, complete genome. (NC_016617)=NC_016617,NC_016617.1,gi|392380513|ref|NC_016617.1| -Azospirillum lipoferum 4B plasmid AZO_p1, complete sequence. (NC_016585)=NC_016585,NC_016585.1,gi|374998023|ref|NC_016585.1| -Azospirillum lipoferum 4B plasmid AZO_p2, complete sequence. (NC_016586)=NC_016586,NC_016586.1,gi|374998886|ref|NC_016586.1| -Azospirillum lipoferum 4B plasmid AZO_p3, complete sequence. (NC_016623)=NC_016623,NC_016623.1,gi|374293519|ref|NC_016623.1| -Azospirillum lipoferum 4B plasmid AZO_p4, complete sequence. (NC_016587)=NC_016587,NC_016587.1,gi|375006210|ref|NC_016587.1| -Azospirillum lipoferum 4B plasmid AZO_p5, complete sequence. (NC_016624)=NC_016624,NC_016624.1,gi|374294063|ref|NC_016624.1| -Azospirillum lipoferum 4B plasmid AZO_p6, complete sequence. (NC_016588)=NC_016588,NC_016588.1,gi|374999497|ref|NC_016588.1| -Azospirillum lipoferum 4B, complete genome. (NC_016622)=NC_016622,NC_016622.1,gi|374290655|ref|NC_016622.1| -Azotobacter vinelandii DJ chromosome, complete genome. (NC_012560)=NC_012560,NC_012560.1,gi|226942170|ref|NC_012560.1| -Bacillus sp. JS chromosome, complete genome. (NC_017743)=NC_017743,NC_017743.1,gi|386756580|ref|NC_017743.1| -Bacillus amyloliquefaciens DSM 7, complete genome. (NC_014551)=NC_014551,NC_014551.1,gi|308171891|ref|NC_014551.1| -Bacillus amyloliquefaciens FZB42, complete genome. (NC_009725)=NC_009725,NC_009725.1,gi|154684518|ref|NC_009725.1| -Bacillus amyloliquefaciens LL3 chromosome, complete genome. (NC_017190)=NC_017190,NC_017190.1,gi|384162404|ref|NC_017190.1| -Bacillus amyloliquefaciens LL3 plasmid pMC1, complete sequence. (NC_017189)=NC_017189,NC_017189.1,gi|384162394|ref|NC_017189.1| -Bacillus amyloliquefaciens TA208 chromosome, complete genome. (NC_017188)=NC_017188,NC_017188.1,gi|384157612|ref|NC_017188.1| -Bacillus amyloliquefaciens XH7 chromosome, complete genome. (NC_017191)=NC_017191,NC_017191.1,gi|384166624|ref|NC_017191.1| -Bacillus amyloliquefaciens Y2 chromosome, complete genome. (NC_017912)=NC_017912,NC_017912.1,gi|387896523|ref|NC_017912.1| -Bacillus amyloliquefaciens subsp. plantarum CAU B946, complete (NC_016784)=NC_016784,NC_016784.1,gi|375360690|ref|NC_016784.1| -Bacillus amyloliquefaciens subsp. plantarum YAU B9601-Y2, complete (NC_017061)=NC_017061,NC_017061.1,gi|384263631|ref|NC_017061.1| -Bacillus anthracis str. A0248 plasmid pXO1, complete sequence. (NC_012656)=NC_012656,NC_012656.1,gi|229599713|ref|NC_012656.1| -Bacillus anthracis str. A0248 plasmid pXO2, complete sequence. (NC_012655)=NC_012655,NC_012655.1,gi|229599623|ref|NC_012655.1| -Bacillus anthracis str. A0248, complete genome. (NC_012659)=NC_012659,NC_012659.1,gi|229599883|ref|NC_012659.1| -Bacillus anthracis str. Ames chromosome, complete genome. (NC_003997)=NC_003997,NC_003997.3,gi|30260195|ref|NC_003997.3| -Bacillus anthracis str. CDC 684 chromosome, complete genome. (NC_012581)=NC_012581,NC_012581.1,gi|227812678|ref|NC_012581.1| -Bacillus anthracis str. CDC 684 plasmid pX01, complete sequence. (NC_012579)=NC_012579,NC_012579.1,gi|227811427|ref|NC_012579.1| -Bacillus anthracis str. CDC 684 plasmid pX02, complete sequence. (NC_012577)=NC_012577,NC_012577.1,gi|227811309|ref|NC_012577.1| -Bacillus anthracis str. H9401 chromosome, complete genome. (NC_017729)=NC_017729,NC_017729.1,gi|386733873|ref|NC_017729.1| -Bacillus anthracis str. H9401 plasmid BAP1, complete sequence. (NC_017726)=NC_017726,NC_017726.1,gi|386733559|ref|NC_017726.1| -Bacillus anthracis str. H9401 plasmid BAP2, complete sequence. (NC_017727)=NC_017727,NC_017727.1,gi|386733762|ref|NC_017727.1| -Bacillus anthracis str. Sterne chromosome, complete genome. (NC_005945)=NC_005945,NC_005945.1,gi|49183039|ref|NC_005945.1| -Bacillus anthracis str. 'Ames Ancestor' chromosome, complete (NC_007530)=NC_007530,NC_007530.2,gi|50196905|ref|NC_007530.2| -Bacillus anthracis str. 'Ames Ancestor' plasmid pXO1, complete (NC_007322)=NC_007322,NC_007322.2,gi|47566322|ref|NC_007322.2| -Bacillus anthracis str. 'Ames Ancestor' plasmid pXO2, complete (NC_007323)=NC_007323,NC_007323.3,gi|50163691|ref|NC_007323.3| -Bacillus atrophaeus 1942 chromosome, complete genome. (NC_014639)=NC_014639,NC_014639.1,gi|311066968|ref|NC_014639.1| -Bacillus cellulosilyticus DSM 2522 chromosome, complete genome. (NC_014829)=NC_014829,NC_014829.1,gi|317126741|ref|NC_014829.1| -Bacillus cereus 03BB102 plasmid p03BB102_179, complete sequence. (NC_012473)=NC_012473,NC_012473.1,gi|225871489|ref|NC_012473.1| -Bacillus cereus 03BB102, complete genome. (NC_012472)=NC_012472,NC_012472.1,gi|225862057|ref|NC_012472.1| -Bacillus cereus AH187 chromosome, complete genome. (NC_011658)=NC_011658,NC_011658.1,gi|217957581|ref|NC_011658.1| -Bacillus cereus AH187 plasmid pAH187_12, complete sequence. (NC_011654)=NC_011654,NC_011654.1,gi|217316512|ref|NC_011654.1| -Bacillus cereus AH187 plasmid pAH187_270, complete sequence. (NC_011655)=NC_011655,NC_011655.1,gi|217956691|ref|NC_011655.1| -Bacillus cereus AH187 plasmid pAH187_3, complete sequence. (NC_011657)=NC_011657,NC_011657.1,gi|217322982|ref|NC_011657.1| -Bacillus cereus AH187 plasmid pAH187_45, complete sequence. (NC_011656)=NC_011656,NC_011656.1,gi|217322921|ref|NC_011656.1| -Bacillus cereus AH820 chromosome, complete genome. (NC_011773)=NC_011773,NC_011773.1,gi|218901206|ref|NC_011773.1| -Bacillus cereus AH820 plasmid pAH820_10, complete sequence. (NC_011771)=NC_011771,NC_011771.1,gi|218847796|ref|NC_011771.1| -Bacillus cereus AH820 plasmid pAH820_272, complete sequence. (NC_011777)=NC_011777,NC_011777.1,gi|218848185|ref|NC_011777.1| -Bacillus cereus AH820 plasmid pAH820_3, complete sequence. (NC_011776)=NC_011776,NC_011776.1,gi|218848179|ref|NC_011776.1| -Bacillus cereus ATCC 10987 chromosome, complete genome. (NC_003909)=NC_003909,NC_003909.8,gi|42779081|ref|NC_003909.8| -Bacillus cereus ATCC 10987 plasmid pBc10987, complete sequence. (NC_005707)=NC_005707,NC_005707.1,gi|44004339|ref|NC_005707.1| -Bacillus cereus ATCC 14579 plasmid pBClin15, complete sequence. (NC_004721)=NC_004721,NC_004721.2,gi|56973315|ref|NC_004721.2| -Bacillus cereus ATCC 14579, complete genome. (NC_004722)=NC_004722,NC_004722.1,gi|30018278|ref|NC_004722.1| -Bacillus cereus B4264 chromosome, complete genome. (NC_011725)=NC_011725,NC_011725.1,gi|218230750|ref|NC_011725.1| -Bacillus cereus E33L chromosome, complete genome. (NC_006274)=NC_006274,NC_006274.1,gi|52140164|ref|NC_006274.1| -Bacillus cereus E33L plasmid pE33L466, complete sequence. (NC_007103)=NC_007103,NC_007103.1,gi|67077889|ref|NC_007103.1| -Bacillus cereus E33L plasmid pE33L5, complete sequence. (NC_007104)=NC_007104,NC_007104.1,gi|67078320|ref|NC_007104.1| -Bacillus cereus E33L plasmid pE33L54, complete sequence. (NC_007105)=NC_007105,NC_007105.1,gi|67078326|ref|NC_007105.1| -Bacillus cereus E33L plasmid pE33L8, complete sequence. (NC_007106)=NC_007106,NC_007106.1,gi|67078381|ref|NC_007106.1| -Bacillus cereus E33L plasmid pE33L9, complete sequence. (NC_007107)=NC_007107,NC_007107.1,gi|67078390|ref|NC_007107.1| -Bacillus cereus F837/76 chromosome, complete genome. (NC_016779)=NC_016779,NC_016779.1,gi|376264031|ref|NC_016779.1| -Bacillus cereus F837/76 plasmid pF837_10, complete sequence. (NC_016780)=NC_016780,NC_016780.1,gi|376269859|ref|NC_016780.1| -Bacillus cereus F837/76 plasmid pF837_55, complete sequence. (NC_016794)=NC_016794,NC_016794.1,gi|376270191|ref|NC_016794.1| -Bacillus cereus G9842 chromosome, complete genome. (NC_011772)=NC_011772,NC_011772.1,gi|218895141|ref|NC_011772.1| -Bacillus cereus G9842 plasmid pG9842_140, complete sequence. (NC_011774)=NC_011774,NC_011774.1,gi|218847808|ref|NC_011774.1| -Bacillus cereus G9842 plasmid pG9842_209, complete sequence. (NC_011775)=NC_011775,NC_011775.1,gi|218847927|ref|NC_011775.1| -Bacillus cereus NC7401 plasmid pNC1, complete sequence. (NC_016772)=NC_016772,NC_016772.1,gi|375287510|ref|NC_016772.1| -Bacillus cereus NC7401 plasmid pNC2, complete sequence. (NC_016773)=NC_016773,NC_016773.1,gi|375287575|ref|NC_016773.1| -Bacillus cereus NC7401 plasmid pNC3, complete sequence. (NC_016793)=NC_016793,NC_016793.1,gi|374858101|ref|NC_016793.1| -Bacillus cereus NC7401 plasmid pNC4, complete sequence. (NC_016774)=NC_016774,NC_016774.1,gi|374717315|ref|NC_016774.1| -Bacillus cereus NC7401 plasmid pNCcld, complete sequence. (NC_016792)=NC_016792,NC_016792.1,gi|376258298|ref|NC_016792.1| -Bacillus cereus NC7401, complete genome. (NC_016771)=NC_016771,NC_016771.1,gi|375282101|ref|NC_016771.1| -Bacillus cereus Q1 chromosome, complete genome. (NC_011969)=NC_011969,NC_011969.1,gi|222093774|ref|NC_011969.1| -Bacillus cereus Q1 plasmid pBc239, complete sequence. (NC_011973)=NC_011973,NC_011973.1,gi|221642090|ref|NC_011973.1| -Bacillus cereus Q1 plasmid pBc53, complete sequence. (NC_011971)=NC_011971,NC_011971.1,gi|221316922|ref|NC_011971.1| -Bacillus cereus biovar anthracis str. CI chromosome, complete (NC_014335)=NC_014335,NC_014335.1,gi|301051741|ref|NC_014335.1| -Bacillus cereus biovar anthracis str. CI plasmid pBAslCI14, (NC_014333)=NC_014333,NC_014333.1,gi|300885230|ref|NC_014333.1| -Bacillus cereus biovar anthracis str. CI plasmid pCI-XO1, complete (NC_014331)=NC_014331,NC_014331.1,gi|301068040|ref|NC_014331.1| -Bacillus cereus biovar anthracis str. CI plasmid pCI-XO2, complete (NC_014332)=NC_014332,NC_014332.1,gi|301067930|ref|NC_014332.1| -Bacillus clausii KSM-K16, complete genome. (NC_006582)=NC_006582,NC_006582.1,gi|56961782|ref|NC_006582.1| -Bacillus coagulans 2-6 chromosome, complete genome. (NC_015634)=NC_015634,NC_015634.1,gi|336112679|ref|NC_015634.1| -Bacillus coagulans 36D1 chromosome, complete genome. (NC_016023)=NC_016023,NC_016023.1,gi|347750441|ref|NC_016023.1| -Bacillus cereus subsp. cytotoxis NVH 391-98 plasmid pBC9801, (NC_009673)=NC_009673,NC_009673.1,gi|152973842|ref|NC_009673.1| -Bacillus cytotoxicus NVH 391-98 chromosome, complete genome. (NC_009674)=NC_009674,NC_009674.1,gi|152973854|ref|NC_009674.1| -Bacillus halodurans C-125 chromosome, complete genome. (NC_002570)=NC_002570,NC_002570.2,gi|57596592|ref|NC_002570.2| -Bacillus licheniformis ATCC 14580 chromosome, complete genome. (NC_006270)=NC_006270,NC_006270.3,gi|163119169|ref|NC_006270.3| -Bacillus licheniformis ATCC 14580, complete genome. (NC_006322)=NC_006322,NC_006322.1,gi|52783855|ref|NC_006322.1| -Bacillus megaterium DSM 319 chromosome, complete genome. (NC_014103)=NC_014103,NC_014103.1,gi|295702242|ref|NC_014103.1| -Bacillus megaterium QM B1551 chromosome, complete genome. (NC_014019)=NC_014019,NC_014019.1,gi|294496875|ref|NC_014019.1| -Bacillus megaterium QM B1551 plasmid pBM100, complete sequence. (NC_010008)=NC_010008,NC_010008.2,gi|294672670|ref|NC_010008.2| -Bacillus megaterium QM B1551 plasmid pBM200, complete sequence. (NC_010009)=NC_010009,NC_010009.2,gi|294672655|ref|NC_010009.2| -Bacillus megaterium QM B1551 plasmid pBM300, complete sequence. (NC_010010)=NC_010010,NC_010010.2,gi|294672678|ref|NC_010010.2| -Bacillus megaterium QM B1551 plasmid pBM400, complete sequence. (NC_004604)=NC_004604,NC_004604.2,gi|294663009|ref|NC_004604.2| -Bacillus megaterium QM B1551 plasmid pBM500, complete sequence. (NC_014025)=NC_014025,NC_014025.1,gi|294509091|ref|NC_014025.1| -Bacillus megaterium QM B1551 plasmid pBM600, complete sequence. (NC_014031)=NC_014031,NC_014031.1,gi|294505704|ref|NC_014031.1| -Bacillus megaterium QM B1551 plasmid pBM700, complete sequence. (NC_014023)=NC_014023,NC_014023.1,gi|294508916|ref|NC_014023.1| -Bacillus megaterium WSH-002 chromosome, complete genome. (NC_017138)=NC_017138,NC_017138.1,gi|384044176|ref|NC_017138.1| -Bacillus megaterium WSH-002 plasmid WSH-002_p1, complete sequence. (NC_017139)=NC_017139,NC_017139.1,gi|384044106|ref|NC_017139.1| -Bacillus megaterium WSH-002 plasmid WSH-002_p2, complete sequence. (NC_017140)=NC_017140,NC_017140.1,gi|384044079|ref|NC_017140.1| -Bacillus megaterium WSH-002 plasmid WSH-002_p3, complete sequence. (NC_017141)=NC_017141,NC_017141.1,gi|384044091|ref|NC_017141.1| -Bacillus pseudofirmus OF4 chromosome, complete genome. (NC_013791)=NC_013791,NC_013791.2,gi|316994385|ref|NC_013791.2| -Bacillus pseudofirmus OF4 plasmid pBpOF4-01, complete sequence. (NC_013792)=NC_013792,NC_013792.1,gi|288561476|ref|NC_013792.1| -Bacillus pseudofirmus OF4 plasmid pBpOF4-02, complete sequence. (NC_013793)=NC_013793,NC_013793.1,gi|288557107|ref|NC_013793.1| -Bacillus pumilus SAFR-032 chromosome, complete genome. (NC_009848)=NC_009848,NC_009848.1,gi|157690798|ref|NC_009848.1| -Bacillus selenitireducens MLS10 chromosome, complete genome. (NC_014219)=NC_014219,NC_014219.1,gi|297582338|ref|NC_014219.1| -Bacillus subtilis subsp. subtilis str. 168 chromosome, complete (NC_000964)=NC_000964,NC_000964.3,gi|255767013|ref|NC_000964.3| -Bacillus subtilis BSn5 chromosome, complete genome. (NC_014976)=NC_014976,NC_014976.1,gi|321311376|ref|NC_014976.1| -Bacillus subtilis subsp. subtilis str. RO-NN-1 chromosome, complete (NC_017195)=NC_017195,NC_017195.1,gi|384173661|ref|NC_017195.1| -Bacillus subtilis subsp. spizizenii TU-B-10 chromosome, complete (NC_016047)=NC_016047,NC_016047.1,gi|350264100|ref|NC_016047.1| -Bacillus subtilis subsp. spizizenii str. W23 chromosome, complete (NC_014479)=NC_014479,NC_014479.1,gi|305672698|ref|NC_014479.1| -Bacillus thuringiensis str. Al Hakam chromosome, complete genome. (NC_008600)=NC_008600,NC_008600.1,gi|118475778|ref|NC_008600.1| -Bacillus thuringiensis str. Al Hakam plasmid pALH1, complete (NC_008598)=NC_008598,NC_008598.1,gi|118445179|ref|NC_008598.1| -Bacillus thuringiensis BMB171 chromosome, complete genome. (NC_014171)=NC_014171,NC_014171.1,gi|296500838|ref|NC_014171.1| -Bacillus thuringiensis BMB171 plasmid pBMB171, complete sequence. (NC_014172)=NC_014172,NC_014172.1,gi|296506382|ref|NC_014172.1| -Bacillus thuringiensis serovar chinensis CT-43 chromosome, complete (NC_017208)=NC_017208,NC_017208.1,gi|384184088|ref|NC_017208.1| -Bacillus thuringiensis serovar chinensis CT-43 plasmid pCT127, (NC_017202)=NC_017202,NC_017202.1,gi|384183674|ref|NC_017202.1| -Bacillus thuringiensis serovar chinensis CT-43 plasmid pCT14, (NC_017209)=NC_017209,NC_017209.1,gi|384183635|ref|NC_017209.1| -Bacillus thuringiensis serovar chinensis CT-43 plasmid pCT281, (NC_017203)=NC_017203,NC_017203.1,gi|384183816|ref|NC_017203.1| -Bacillus thuringiensis serovar chinensis CT-43 plasmid pCT51, (NC_017204)=NC_017204,NC_017204.1,gi|384183548|ref|NC_017204.1| -Bacillus thuringiensis serovar chinensis CT-43 plasmid pCT6880, (NC_017210)=NC_017210,NC_017210.1,gi|384183658|ref|NC_017210.1| -Bacillus thuringiensis serovar chinensis CT-43 plasmid pCT72, (NC_017205)=NC_017205,NC_017205.1,gi|384189584|ref|NC_017205.1| -Bacillus thuringiensis serovar chinensis CT-43 plasmid pCT8252, (NC_017211)=NC_017211,NC_017211.1,gi|384183665|ref|NC_017211.1| -Bacillus thuringiensis serovar chinensis CT-43 plasmid pCT83, (NC_017206)=NC_017206,NC_017206.1,gi|384189671|ref|NC_017206.1| -Bacillus thuringiensis serovar chinensis CT-43 plasmid pCT8513, (NC_017207)=NC_017207,NC_017207.1,gi|384183624|ref|NC_017207.1| -Bacillus thuringiensis serovar chinensis CT-43 plasmid pCT9547, (NC_017212)=NC_017212,NC_017212.1,gi|384189578|ref|NC_017212.1| -Bacillus thuringiensis serovar finitimus YBT-020 chromosome, (NC_017200)=NC_017200,NC_017200.1,gi|384177910|ref|NC_017200.1| -Bacillus thuringiensis serovar finitimus YBT-020 plasmid pBMB26, (NC_017201)=NC_017201,NC_017201.1,gi|384183356|ref|NC_017201.1| -Bacillus thuringiensis serovar finitimus YBT-020 plasmid pBMB28, (NC_017199)=NC_017199,NC_017199.1,gi|384177763|ref|NC_017199.1| -Bacillus thuringiensis serovar konkukian str. 97-27 chromosome, (NC_005957)=NC_005957,NC_005957.1,gi|49476684|ref|NC_005957.1| -Bacillus thuringiensis serovar konkukian str. 97-27 plasmid (NC_006578)=NC_006578,NC_006578.1,gi|56899872|ref|NC_006578.1| -Bacillus weihenstephanensis KBAB4 chromosome, complete genome. (NC_010184)=NC_010184,NC_010184.1,gi|163938013|ref|NC_010184.1| -Bacillus weihenstephanensis KBAB4 plasmid pBWB401, complete (NC_010180)=NC_010180,NC_010180.1,gi|163943169|ref|NC_010180.1| -Bacillus weihenstephanensis KBAB4 plasmid pBWB402, complete (NC_010181)=NC_010181,NC_010181.1,gi|163943459|ref|NC_010181.1| -Bacillus weihenstephanensis KBAB4 plasmid pBWB403, complete (NC_010182)=NC_010182,NC_010182.1,gi|163937865|ref|NC_010182.1| -Bacillus weihenstephanensis KBAB4 plasmid pBWB404, complete (NC_010183)=NC_010183,NC_010183.1,gi|163937941|ref|NC_010183.1| -Bacteriovorax marinus SJ, complete genome. (NC_016620)=NC_016620,NC_016620.1,gi|374286830|ref|NC_016620.1| -Bacteroides fragilis 638R, complete genome. (NC_016776)=NC_016776,NC_016776.1,gi|375356399|ref|NC_016776.1| -Bacteroides fragilis NCTC 9343 chromosome, complete genome. (NC_003228)=NC_003228,NC_003228.3,gi|60679597|ref|NC_003228.3| -Bacteroides fragilis NCTC 9343 plasmid pBF9343, complete sequence. (NC_006873)=NC_006873,NC_006873.1,gi|60650141|ref|NC_006873.1| -Bacteroides fragilis YCH46 chromosome, complete genome. (NC_006347)=NC_006347,NC_006347.1,gi|53711291|ref|NC_006347.1| -Bacteroides fragilis YCH46 plasmid pBFY46, complete sequence. (NC_006297)=NC_006297,NC_006297.1,gi|52421214|ref|NC_006297.1| -Bacteroides helcogenes P 36-108 chromosome, complete genome. (NC_014933)=NC_014933,NC_014933.1,gi|319899888|ref|NC_014933.1| -Bacteroides salanitronis DSM 18170 chromosome, complete genome. (NC_015164)=NC_015164,NC_015164.1,gi|325297172|ref|NC_015164.1| -Bacteroides salanitronis DSM 18170 plasmid pBACSA01, complete (NC_015165)=NC_015165,NC_015165.1,gi|325300726|ref|NC_015165.1| -Bacteroides salanitronis DSM 18170 plasmid pBACSA02, complete (NC_015168)=NC_015168,NC_015168.1,gi|324976987|ref|NC_015168.1| -Bacteroides salanitronis DSM 18170 plasmid pBACSA03, complete (NC_015166)=NC_015166,NC_015166.1,gi|324959701|ref|NC_015166.1| -Bacteroides thetaiotaomicron VPI-5482 chromosome, complete genome. (NC_004663)=NC_004663,NC_004663.1,gi|29345410|ref|NC_004663.1| -Bacteroides thetaiotaomicron VPI-5482 plasmid p5482, complete (NC_004703)=NC_004703,NC_004703.1,gi|29611500|ref|NC_004703.1| -Bacteroides vulgatus ATCC 8482 chromosome, complete genome. (NC_009614)=NC_009614,NC_009614.1,gi|150002608|ref|NC_009614.1| -Bartonella bacilliformis KC583, complete genome. (NC_008783)=NC_008783,NC_008783.1,gi|121601635|ref|NC_008783.1| -Bartonella clarridgeiae 73, complete genome. (NC_014932)=NC_014932,NC_014932.1,gi|319898193|ref|NC_014932.1| -Bartonella grahamii as4aup plasmid pBGR3, complete sequence. (NC_012847)=NC_012847,NC_012847.1,gi|240851420|ref|NC_012847.1| -Bartonella grahamii as4aup, complete genome. (NC_012846)=NC_012846,NC_012846.1,gi|240849682|ref|NC_012846.1| -Bartonella henselae str. Houston-1 chromosome, complete genome. (NC_005956)=NC_005956,NC_005956.1,gi|49474831|ref|NC_005956.1| -Bartonella quintana str. Toulouse, complete genome. (NC_005955)=NC_005955,NC_005955.1,gi|49473688|ref|NC_005955.1| -Bartonella tribocorum CIP 105476 chromosome, complete genome. (NC_010161)=NC_010161,NC_010161.1,gi|163867306|ref|NC_010161.1| -Bartonella tribocorum CIP 105476 plasmid pBT01, complete sequence. (NC_010160)=NC_010160,NC_010160.1,gi|163659859|ref|NC_010160.1| -Baumannia cicadellinicola str. Hc (Homalodisca coagulata), complete (NC_007984)=NC_007984,NC_007984.1,gi|94676460|ref|NC_007984.1| -Bdellovibrio bacteriovorus HD100, complete genome. (NC_005363)=NC_005363,NC_005363.1,gi|42521650|ref|NC_005363.1| -Beijerinckia indica subsp. indica ATCC 9039 chromosome, complete (NC_010581)=NC_010581,NC_010581.1,gi|182677002|ref|NC_010581.1| -Beijerinckia indica subsp. indica ATCC 9039 plasmid pBIND01, (NC_010580)=NC_010580,NC_010580.1,gi|182676825|ref|NC_010580.1| -Beijerinckia indica subsp. indica ATCC 9039 plasmid pBIND02, (NC_010578)=NC_010578,NC_010578.1,gi|182676785|ref|NC_010578.1| -Belliella baltica DSM 15883 chromosome, complete genome. (NC_018010)=NC_018010,NC_018010.1,gi|390941666|ref|NC_018010.1| -Beutenbergia cavernae DSM 12333 chromosome, complete genome. (NC_012669)=NC_012669,NC_012669.1,gi|229818502|ref|NC_012669.1| -Bifidobacterium adolescentis ATCC 15703 chromosome, complete (NC_008618)=NC_008618,NC_008618.1,gi|119025018|ref|NC_008618.1| -Bifidobacterium animalis subsp. animalis ATCC 25527 chromosome, (NC_017834)=NC_017834,NC_017834.1,gi|386866198|ref|NC_017834.1| -Bifidobacterium animalis subsp. lactis AD011 chromosome, complete (NC_011835)=NC_011835,NC_011835.1,gi|219682499|ref|NC_011835.1| -Bifidobacterium animalis subsp. lactis B420 chromosome, complete (NC_017866)=NC_017866,NC_017866.1,gi|387819930|ref|NC_017866.1| -Bifidobacterium animalis subsp. lactis BB-12 chromosome, complete (NC_017214)=NC_017214,NC_017214.1,gi|384189768|ref|NC_017214.1| -Bifidobacterium animalis subsp. lactis BLC1 chromosome, complete (NC_017216)=NC_017216,NC_017216.1,gi|384193072|ref|NC_017216.1| -Bifidobacterium animalis subsp. lactis Bi-07 chromosome, complete (NC_017867)=NC_017867,NC_017867.1,gi|387821585|ref|NC_017867.1| -Bifidobacterium animalis subsp. lactis Bl-04 chromosome, complete (NC_012814)=NC_012814,NC_012814.1,gi|241190066|ref|NC_012814.1| -Bifidobacterium animalis subsp. lactis CNCM I-2494 chromosome, (NC_017215)=NC_017215,NC_017215.1,gi|384191411|ref|NC_017215.1| -Bifidobacterium animalis subsp. lactis DSM 10140 chromosome, (NC_012815)=NC_012815,NC_012815.1,gi|241195472|ref|NC_012815.1| -Bifidobacterium animalis subsp. lactis V9 chromosome, complete (NC_017217)=NC_017217,NC_017217.1,gi|384194622|ref|NC_017217.1| -Bifidobacterium bifidum BGN4 chromosome, complete genome. (NC_017999)=NC_017999,NC_017999.1,gi|390935917|ref|NC_017999.1| -Bifidobacterium bifidum PRL2010 chromosome, complete genome. (NC_014638)=NC_014638,NC_014638.1,gi|311063459|ref|NC_014638.1| -Bifidobacterium bifidum S17 chromosome, complete genome. (NC_014616)=NC_014616,NC_014616.1,gi|310286520|ref|NC_014616.1| -Bifidobacterium breve ACS-071-V-Sch8b chromosome, complete genome. (NC_017218)=NC_017218,NC_017218.1,gi|384196195|ref|NC_017218.1| -Bifidobacterium dentium Bd1 chromosome, complete genome. (NC_013714)=NC_013714,NC_013714.1,gi|283454959|ref|NC_013714.1| -Bifidobacterium longum subsp. longum BBMN68 chromosome, complete (NC_014656)=NC_014656,NC_014656.1,gi|312132275|ref|NC_014656.1| -Bifidobacterium longum DJO10A chromosome, complete genome. (NC_010816)=NC_010816,NC_010816.1,gi|189438863|ref|NC_010816.1| -Bifidobacterium longum DJO10A plasmid pDOJH10L, complete sequence. (NC_004252)=NC_004252,NC_004252.1,gi|23307853|ref|NC_004252.1| -Bifidobacterium longum DJO10A plasmid pDOJH10S, complete sequence. (NC_004253)=NC_004253,NC_004253.1,gi|23307864|ref|NC_004253.1| -Bifidobacterium longum subsp. longum JCM 1217, complete genome. (NC_015067)=NC_015067,NC_015067.1,gi|322690193|ref|NC_015067.1| -Bifidobacterium longum subsp. longum JDM301 chromosome, complete (NC_014169)=NC_014169,NC_014169.1,gi|296453187|ref|NC_014169.1| -Bifidobacterium longum subsp. longum KACC 91563 chromosome, (NC_017221)=NC_017221,NC_017221.1,gi|384200575|ref|NC_017221.1| -Bifidobacterium longum subsp. longum KACC 91563 plasmid BLNIAS_P1, (NC_017220)=NC_017220,NC_017220.1,gi|384202547|ref|NC_017220.1| -Bifidobacterium longum subsp. longum KACC 91563 plasmid BLNIAS_P2, (NC_017222)=NC_017222,NC_017222.1,gi|384202553|ref|NC_017222.1| -Bifidobacterium longum NCC2705 chromosome, complete genome. (NC_004307)=NC_004307,NC_004307.2,gi|58036264|ref|NC_004307.2| -Bifidobacterium longum NCC2705 plasmid pBLO1, complete sequence. (NC_004943)=NC_004943,NC_004943.1,gi|32456045|ref|NC_004943.1| -Bifidobacterium longum subsp. infantis 157F plasmid p157F-NC1, (NC_015053)=NC_015053,NC_015053.1,gi|322690183|ref|NC_015053.1| -Bifidobacterium longum subsp. infantis 157F plasmid p157F-NC2, (NC_015066)=NC_015066,NC_015066.1,gi|322690189|ref|NC_015066.1| -Bifidobacterium longum subsp. infantis 157F, complete genome. (NC_015052)=NC_015052,NC_015052.1,gi|322688191|ref|NC_015052.1| -Bifidobacterium longum subsp. infantis ATCC 15697, complete genome. (NC_017219)=NC_017219,NC_017219.1,gi|384198022|ref|NC_017219.1| -Bifidobacterium longum subsp. infantis ATCC 15697 chromosome, (NC_011593)=NC_011593,NC_011593.1,gi|213690928|ref|NC_011593.1| -Blastococcus saxobsidens DD2, complete genome. (NC_016943)=NC_016943,NC_016943.1,gi|379733551|ref|NC_016943.1| -Blattabacterium sp. (Blaberus giganteus) chromosome, complete (NC_017924)=NC_017924,NC_017924.1,gi|387906790|ref|NC_017924.1| -Blattabacterium sp. (Blaberus giganteus) plasmid pBGIBA, complete (NC_017925)=NC_017925,NC_017925.1,gi|387907363|ref|NC_017925.1| -Blattabacterium sp. (Blattella germanica) str. Bge plasmid pBge, (NC_015679)=NC_015679,NC_015679.1,gi|336478154|ref|NC_015679.1| -Blattabacterium sp. (Blattella germanica) str. Bge, complete (NC_013454)=NC_013454,NC_013454.1,gi|262340793|ref|NC_013454.1| -Blattabacterium sp. (Cryptocercus punctulatus) str. Cpu chromosome, (NC_016621)=NC_016621,NC_016621.1,gi|374290092|ref|NC_016621.1| -Blattabacterium sp. (Cryptocercus punctulatus) str. Cpu plasmid (NC_016598)=NC_016598,NC_016598.1,gi|374290638|ref|NC_016598.1| -Blattabacterium sp. (Mastotermes darwiniensis) str. MADAR (NC_016146)=NC_016146,NC_016146.1,gi|357420708|ref|NC_016146.1| -Blattabacterium sp. (Mastotermes darwiniensis) str. MADAR plasmid (NC_016150)=NC_016150,NC_016150.1,gi|357420702|ref|NC_016150.1| -Blattabacterium sp. (Periplaneta americana) str. BPLAN plasmid (NC_013419)=NC_013419,NC_013419.1,gi|261599111|ref|NC_013419.1| -Blattabacterium sp. (Periplaneta americana) str. BPLAN, complete (NC_013418)=NC_013418,NC_013418.2,gi|295656029|ref|NC_013418.2| -Bordetella avium 197N chromosome, complete genome. (NC_010645)=NC_010645,NC_010645.1,gi|187476514|ref|NC_010645.1| -Bordetella bronchiseptica RB50 chromosome, complete genome. (NC_002927)=NC_002927,NC_002927.3,gi|33598993|ref|NC_002927.3| -Bordetella parapertussis 12822 chromosome, complete genome. (NC_002928)=NC_002928,NC_002928.3,gi|33594723|ref|NC_002928.3| -Bordetella pertussis CS chromosome, complete genome. (NC_017223)=NC_017223,NC_017223.1,gi|384202563|ref|NC_017223.1| -Bordetella pertussis Tohama I chromosome, complete genome. (NC_002929)=NC_002929,NC_002929.2,gi|33591275|ref|NC_002929.2| -Bordetella petrii DSM 12804 chromosome, complete genome. (NC_010170)=NC_010170,NC_010170.1,gi|163854304|ref|NC_010170.1| -Borrelia afzelii PKo chromosome, complete genome. (NC_017238)=NC_017238,NC_017238.1,gi|384206503|ref|NC_017238.1| -Borrelia afzelii PKo plasmid cp26, complete sequence. (NC_017229)=NC_017229,NC_017229.1,gi|384206192|ref|NC_017229.1| -Borrelia afzelii PKo plasmid cp32-1, complete sequence. (NC_017230)=NC_017230,NC_017230.1,gi|384206220|ref|NC_017230.1| -Borrelia afzelii PKo plasmid cp32-11, complete sequence. (NC_017224)=NC_017224,NC_017224.1,gi|384206409|ref|NC_017224.1| -Borrelia afzelii PKo plasmid cp32-12, complete sequence. (NC_017225)=NC_017225,NC_017225.1,gi|384206020|ref|NC_017225.1| -Borrelia afzelii PKo plasmid cp32-3, complete sequence. (NC_017226)=NC_017226,NC_017226.1,gi|384206063|ref|NC_017226.1| -Borrelia afzelii PKo plasmid cp32-5, complete sequence. (NC_017227)=NC_017227,NC_017227.1,gi|384206106|ref|NC_017227.1| -Borrelia afzelii PKo plasmid cp32-7, complete sequence. (NC_017231)=NC_017231,NC_017231.1,gi|384206262|ref|NC_017231.1| -Borrelia afzelii PKo plasmid cp32-9, complete sequence. (NC_017228)=NC_017228,NC_017228.1,gi|384206150|ref|NC_017228.1| -Borrelia afzelii PKo plasmid lp17, complete sequence. (NC_017232)=NC_017232,NC_017232.1,gi|384206380|ref|NC_017232.1| -Borrelia afzelii PKo plasmid lp28-2, complete sequence. (NC_017239)=NC_017239,NC_017239.1,gi|384206338|ref|NC_017239.1| -Borrelia afzelii PKo plasmid lp28-3, complete sequence. (NC_017233)=NC_017233,NC_017233.1,gi|384206297|ref|NC_017233.1| -Borrelia afzelii PKo plasmid lp28-4, complete sequence. (NC_017234)=NC_017234,NC_017234.1,gi|384206319|ref|NC_017234.1| -Borrelia afzelii PKo plasmid lp28-7, complete sequence. (NC_017235)=NC_017235,NC_017235.1,gi|384206451|ref|NC_017235.1| -Borrelia afzelii PKo plasmid lp28-8, complete sequence. (NC_017236)=NC_017236,NC_017236.1,gi|384206482|ref|NC_017236.1| -Borrelia afzelii PKo plasmid lp32-10, complete sequence. (NC_017240)=NC_017240,NC_017240.1,gi|384207328|ref|NC_017240.1| -Borrelia afzelii PKo plasmid lp38, complete sequence. (NC_017237)=NC_017237,NC_017237.1,gi|384207453|ref|NC_017237.1| -Borrelia afzelii PKo plasmid lp54, complete sequence. (NC_017241)=NC_017241,NC_017241.1,gi|384207382|ref|NC_017241.1| -Borrelia afzelii PKo clone fragment a. (NT_167350)=NT_167350,NT_167350.1,gi|294679205|ref|NT_167350.1| -Borrelia afzelii PKo clone fragment b. (NT_167351)=NT_167351,NT_167351.1,gi|294679220|ref|NT_167351.1| -Borrelia afzelii PKo clone fragment c. (NT_167352)=NT_167352,NT_167352.1,gi|294679245|ref|NT_167352.1| -Borrelia afzelii PKo plasmid cp27, complete sequence. (NC_008274)=NC_008274,NC_008274.1,gi|111074118|ref|NC_008274.1| -Borrelia afzelii PKo plasmid cp30, complete sequence. (NC_008273)=NC_008273,NC_008273.1,gi|111074074|ref|NC_008273.1| -Borrelia afzelii PKo plasmid lp25, complete sequence. (NC_008569)=NC_008569,NC_008569.1,gi|117621834|ref|NC_008569.1| -Borrelia afzelii PKo plasmid lp28, complete sequence. (NC_008568)=NC_008568,NC_008568.1,gi|117621799|ref|NC_008568.1| -Borrelia afzelii PKo plasmid lp32, complete sequence. (NC_008567)=NC_008567,NC_008567.1,gi|117621743|ref|NC_008567.1| -Borrelia afzelii PKo plasmid lp34, complete sequence. (NC_008566)=NC_008566,NC_008566.1,gi|117621706|ref|NC_008566.1| -Borrelia afzelii PKo plasmid lp60, complete sequence. (NC_008564)=NC_008564,NC_008564.1,gi|117621570|ref|NC_008564.1| -Borrelia afzelii PKo plasmid lp60-2, complete sequence. (NC_008565)=NC_008565,NC_008565.1,gi|117621646|ref|NC_008565.1| -Borrelia afzelii PKo, complete genome. (NC_008277)=NC_008277,NC_008277.1,gi|111114823|ref|NC_008277.1| -Borrelia bissettii DN127 chromosome, complete genome. (NC_015921)=NC_015921,NC_015921.1,gi|343127324|ref|NC_015921.1| -Borrelia bissettii DN127 plasmid cp26, complete sequence. (NC_015907)=NC_015907,NC_015907.1,gi|343126945|ref|NC_015907.1| -Borrelia bissettii DN127 plasmid cp32-11, complete sequence. (NC_015903)=NC_015903,NC_015903.1,gi|343126711|ref|NC_015903.1| -Borrelia bissettii DN127 plasmid cp32-3, complete sequence. (NC_015908)=NC_015908,NC_015908.1,gi|343126973|ref|NC_015908.1| -Borrelia bissettii DN127 plasmid cp32-4, complete sequence. (NC_015904)=NC_015904,NC_015904.1,gi|343126758|ref|NC_015904.1| -Borrelia bissettii DN127 plasmid cp32-5, complete sequence. (NC_015909)=NC_015909,NC_015909.1,gi|343127016|ref|NC_015909.1| -Borrelia bissettii DN127 plasmid cp32-6, complete sequence. (NC_015905)=NC_015905,NC_015905.1,gi|343126801|ref|NC_015905.1| -Borrelia bissettii DN127 plasmid cp32-7, complete sequence. (NC_015910)=NC_015910,NC_015910.1,gi|343127060|ref|NC_015910.1| -Borrelia bissettii DN127 plasmid cp32-quad, complete sequence. (NC_015906)=NC_015906,NC_015906.1,gi|343126844|ref|NC_015906.1| -Borrelia bissettii DN127 plasmid cp9, complete sequence. (NC_015911)=NC_015911,NC_015911.1,gi|343127105|ref|NC_015911.1| -Borrelia bissettii DN127 plasmid lp17, complete sequence. (NC_015915)=NC_015915,NC_015915.1,gi|343127118|ref|NC_015915.1| -Borrelia bissettii DN127 plasmid lp25, complete sequence. (NC_015922)=NC_015922,NC_015922.1,gi|343128166|ref|NC_015922.1| -Borrelia bissettii DN127 plasmid lp28-3, complete sequence. (NC_015916)=NC_015916,NC_015916.1,gi|343128141|ref|NC_015916.1| -Borrelia bissettii DN127 plasmid lp28-4, complete sequence. (NC_015917)=NC_015917,NC_015917.1,gi|343127152|ref|NC_015917.1| -Borrelia bissettii DN127 plasmid lp28-7, complete sequence. (NC_015918)=NC_015918,NC_015918.1,gi|343127183|ref|NC_015918.1| -Borrelia bissettii DN127 plasmid lp54, complete sequence. (NC_015919)=NC_015919,NC_015919.1,gi|343127253|ref|NC_015919.1| -Borrelia bissettii DN127 plasmid lp56, complete sequence. (NC_015920)=NC_015920,NC_015920.1,gi|343127220|ref|NC_015920.1| -Borrelia burgdorferi B31 chromosome, complete genome. (NC_001318)=NC_001318,NC_001318.1,gi|15594346|ref|NC_001318.1| -Borrelia burgdorferi B31 plasmid cp26, complete sequence. (NC_001903)=NC_001903,NC_001903.1,gi|11497007|ref|NC_001903.1| -Borrelia burgdorferi B31 plasmid cp32-1, complete sequence. (NC_000948)=NC_000948,NC_000948.1,gi|11497060|ref|NC_000948.1| -Borrelia burgdorferi B31 plasmid cp32-3, complete sequence. (NC_000949)=NC_000949,NC_000949.1,gi|11497103|ref|NC_000949.1| -Borrelia burgdorferi B31 plasmid cp32-4, complete sequence. (NC_000950)=NC_000950,NC_000950.1,gi|11497149|ref|NC_000950.1| -Borrelia burgdorferi B31 plasmid cp32-6, complete sequence. (NC_000951)=NC_000951,NC_000951.1,gi|11497193|ref|NC_000951.1| -Borrelia burgdorferi B31 plasmid cp32-7, complete sequence. (NC_000952)=NC_000952,NC_000952.1,gi|11497236|ref|NC_000952.1| -Borrelia burgdorferi B31 plasmid cp32-8, complete sequence. (NC_000953)=NC_000953,NC_000953.1,gi|11497281|ref|NC_000953.1| -Borrelia burgdorferi B31 plasmid cp32-9, complete sequence. (NC_000954)=NC_000954,NC_000954.1,gi|11497325|ref|NC_000954.1| -Borrelia burgdorferi B31 plasmid cp9, complete sequence. (NC_001904)=NC_001904,NC_001904.1,gi|11497048|ref|NC_001904.1| -Borrelia burgdorferi B31 plasmid lp17, complete sequence. (NC_001849)=NC_001849,NC_001849.2,gi|365823332|ref|NC_001849.2| -Borrelia burgdorferi B31 plasmid lp21, complete sequence. (NC_000955)=NC_000955,NC_000955.2,gi|365823329|ref|NC_000955.2| -Borrelia burgdorferi B31 plasmid lp25, complete sequence. (NC_001850)=NC_001850,NC_001850.1,gi|11496607|ref|NC_001850.1| -Borrelia burgdorferi B31 plasmid lp28-1, complete sequence. (NC_001851)=NC_001851,NC_001851.2,gi|365823337|ref|NC_001851.2| -Borrelia burgdorferi B31 plasmid lp28-2, complete sequence. (NC_001852)=NC_001852,NC_001852.1,gi|11496664|ref|NC_001852.1| -Borrelia burgdorferi B31 plasmid lp28-3, complete sequence. (NC_001853)=NC_001853,NC_001853.1,gi|11496697|ref|NC_001853.1| -Borrelia burgdorferi B31 plasmid lp28-4, complete sequence. (NC_001854)=NC_001854,NC_001854.1,gi|11496735|ref|NC_001854.1| -Borrelia burgdorferi B31 plasmid lp36, complete sequence. (NC_001855)=NC_001855,NC_001855.1,gi|11496779|ref|NC_001855.1| -Borrelia burgdorferi B31 plasmid lp38, complete sequence. (NC_001856)=NC_001856,NC_001856.1,gi|11496831|ref|NC_001856.1| -Borrelia burgdorferi B31 plasmid lp5, complete sequence. (NC_000957)=NC_000957,NC_000957.1,gi|11497445|ref|NC_000957.1| -Borrelia burgdorferi B31 plasmid lp54, complete sequence. (NC_001857)=NC_001857,NC_001857.2,gi|365823346|ref|NC_001857.2| -Borrelia burgdorferi B31 plasmid lp56, complete sequence. (NC_000956)=NC_000956,NC_000956.1,gi|11497372|ref|NC_000956.1| -Borrelia burgdorferi JD1 chromosome, complete genome. (NC_017403)=NC_017403,NC_017403.1,gi|387825662|ref|NC_017403.1| -Borrelia burgdorferi JD1 plasmid JD1 cp26, complete sequence. (NC_017395)=NC_017395,NC_017395.1,gi|387825554|ref|NC_017395.1| -Borrelia burgdorferi JD1 plasmid JD1 cp32-1+5, complete sequence. (NC_017394)=NC_017394,NC_017394.1,gi|387825484|ref|NC_017394.1| -Borrelia burgdorferi JD1 plasmid JD1 cp32-10, complete sequence. (NC_017428)=NC_017428,NC_017428.1,gi|387826681|ref|NC_017428.1| -Borrelia burgdorferi JD1 plasmid JD1 cp32-11, complete sequence. (NC_017393)=NC_017393,NC_017393.1,gi|387825444|ref|NC_017393.1| -Borrelia burgdorferi JD1 plasmid JD1 cp32-12, complete sequence. (NC_017396)=NC_017396,NC_017396.1,gi|387825581|ref|NC_017396.1| -Borrelia burgdorferi JD1 plasmid JD1 cp32-3, complete sequence. (NC_017427)=NC_017427,NC_017427.1,gi|387826639|ref|NC_017427.1| -Borrelia burgdorferi JD1 plasmid JD1 cp32-6, complete sequence. (NC_017425)=NC_017425,NC_017425.1,gi|387826553|ref|NC_017425.1| -Borrelia burgdorferi JD1 plasmid JD1 cp32-8, complete sequence. (NC_017426)=NC_017426,NC_017426.1,gi|387826596|ref|NC_017426.1| -Borrelia burgdorferi JD1 plasmid JD1 cp32-9, complete sequence. (NC_017397)=NC_017397,NC_017397.1,gi|387825622|ref|NC_017397.1| -Borrelia burgdorferi JD1 plasmid JD1 lp17, complete sequence. (NC_017410)=NC_017410,NC_017410.1,gi|387826736|ref|NC_017410.1| -Borrelia burgdorferi JD1 plasmid JD1 lp25, complete sequence. (NC_017409)=NC_017409,NC_017409.1,gi|387826517|ref|NC_017409.1| -Borrelia burgdorferi JD1 plasmid JD1 lp28-1, complete sequence. (NC_017404)=NC_017404,NC_017404.1,gi|387826782|ref|NC_017404.1| -Borrelia burgdorferi JD1 plasmid JD1 lp28-3, complete sequence. (NC_017405)=NC_017405,NC_017405.1,gi|387826795|ref|NC_017405.1| -Borrelia burgdorferi JD1 plasmid JD1 lp28-4, complete sequence. (NC_017407)=NC_017407,NC_017407.1,gi|387826817|ref|NC_017407.1| -Borrelia burgdorferi JD1 plasmid JD1 lp28-5, complete sequence. (NC_017406)=NC_017406,NC_017406.1,gi|387826721|ref|NC_017406.1| -Borrelia burgdorferi JD1 plasmid JD1 lp28-6, complete sequence. (NC_017408)=NC_017408,NC_017408.1,gi|387826486|ref|NC_017408.1| -Borrelia burgdorferi JD1 plasmid JD1 lp28-7, complete sequence. (NC_017412)=NC_017412,NC_017412.1,gi|387826748|ref|NC_017412.1| -Borrelia burgdorferi JD1 plasmid JD1 lp36, complete sequence. (NC_017411)=NC_017411,NC_017411.1,gi|387826840|ref|NC_017411.1| -Borrelia burgdorferi JD1 plasmid JD1 lp38, complete sequence. (NC_017413)=NC_017413,NC_017413.1,gi|387826532|ref|NC_017413.1| -Borrelia burgdorferi JD1 plasmid JD1_lp54, complete sequence. (NC_013129)=NC_013129,NC_013129.1,gi|256041951|ref|NC_013129.1| -Borrelia burgdorferi N40 chromosome, complete genome. (NC_017418)=NC_017418,NC_017418.1,gi|387826928|ref|NC_017418.1| -Borrelia burgdorferi N40 plasmid N40_cp26, complete sequence. (NC_017401)=NC_017401,NC_017401.1,gi|387827984|ref|NC_017401.1| -Borrelia burgdorferi N40 plasmid N40_cp32-10, complete sequence. (NC_017424)=NC_017424,NC_017424.1,gi|387827798|ref|NC_017424.1| -Borrelia burgdorferi N40 plasmid N40_cp32-12, complete sequence. (NC_017423)=NC_017423,NC_017423.1,gi|387827926|ref|NC_017423.1| -Borrelia burgdorferi N40 plasmid N40_cp32-4, complete sequence. (NC_017400)=NC_017400,NC_017400.1,gi|387827965|ref|NC_017400.1| -Borrelia burgdorferi N40 plasmid N40_cp32-5, complete sequence. (NC_017398)=NC_017398,NC_017398.1,gi|387826859|ref|NC_017398.1| -Borrelia burgdorferi N40 plasmid N40_cp32-7, complete sequence. (NC_017422)=NC_017422,NC_017422.1,gi|387827903|ref|NC_017422.1| -Borrelia burgdorferi N40 plasmid N40_cp32-9, complete sequence. (NC_017402)=NC_017402,NC_017402.1,gi|387827867|ref|NC_017402.1| -Borrelia burgdorferi N40 plasmid N40_cp9, complete sequence. (NC_017399)=NC_017399,NC_017399.1,gi|387826896|ref|NC_017399.1| -Borrelia burgdorferi N40 plasmid N40_lp17, complete sequence. (NC_017417)=NC_017417,NC_017417.1,gi|387827839|ref|NC_017417.1| -Borrelia burgdorferi N40 plasmid N40_lp25, complete sequence. (NC_017420)=NC_017420,NC_017420.1,gi|387827856|ref|NC_017420.1| -Borrelia burgdorferi N40 plasmid N40_lp28-2, complete sequence. (NC_017419)=NC_017419,NC_017419.1,gi|387827738|ref|NC_017419.1| -Borrelia burgdorferi N40 plasmid N40_lp28-4, complete sequence. (NC_017416)=NC_017416,NC_017416.1,gi|387828029|ref|NC_017416.1| -Borrelia burgdorferi N40 plasmid N40_lp28-5, complete sequence. (NC_017415)=NC_017415,NC_017415.1,gi|387828011|ref|NC_017415.1| -Borrelia burgdorferi N40 plasmid N40_lp36, complete sequence. (NC_017414)=NC_017414,NC_017414.1,gi|387826906|ref|NC_017414.1| -Borrelia burgdorferi N40 plasmid N40_lp38, complete sequence. (NC_017421)=NC_017421,NC_017421.1,gi|387827769|ref|NC_017421.1| -Borrelia burgdorferi N40 plasmid N40_lp54, complete sequence. (NC_013130)=NC_013130,NC_013130.1,gi|256055273|ref|NC_013130.1| -Borrelia burgdorferi ZS7 plasmid ZS7_cp26, complete sequence. (NC_011724)=NC_011724,NC_011724.1,gi|218203978|ref|NC_011724.1| -Borrelia burgdorferi ZS7 plasmid ZS7_cp32-1, complete sequence. (NC_011731)=NC_011731,NC_011731.1,gi|218442268|ref|NC_011731.1| -Borrelia burgdorferi ZS7 plasmid ZS7_cp32-12, complete sequence. (NC_011735)=NC_011735,NC_011735.1,gi|218442354|ref|NC_011735.1| -Borrelia burgdorferi ZS7 plasmid ZS7_cp32-3+10, complete sequence. (NC_011720)=NC_011720,NC_011720.1,gi|218202726|ref|NC_011720.1| -Borrelia burgdorferi ZS7 plasmid ZS7_cp32-4, complete sequence. (NC_011736)=NC_011736,NC_011736.1,gi|218442394|ref|NC_011736.1| -Borrelia burgdorferi ZS7 plasmid ZS7_cp32-9, complete sequence. (NC_011722)=NC_011722,NC_011722.1,gi|218203897|ref|NC_011722.1| -Borrelia burgdorferi ZS7 plasmid ZS7_lp17, complete sequence. (NC_011782)=NC_011782,NC_011782.1,gi|218875581|ref|NC_011782.1| -Borrelia burgdorferi ZS7 plasmid ZS7_lp25, complete sequence. (NC_011783)=NC_011783,NC_011783.1,gi|219405371|ref|NC_011783.1| -Borrelia burgdorferi ZS7 plasmid ZS7_lp28-1, complete sequence. (NC_011780)=NC_011780,NC_011780.1,gi|218875340|ref|NC_011780.1| -Borrelia burgdorferi ZS7 plasmid ZS7_lp28-2, complete sequence. (NC_011779)=NC_011779,NC_011779.1,gi|218868768|ref|NC_011779.1| -Borrelia burgdorferi ZS7 plasmid ZS7_lp28-3, complete sequence. (NC_011781)=NC_011781,NC_011781.1,gi|218875456|ref|NC_011781.1| -Borrelia burgdorferi ZS7 plasmid ZS7_lp28-4, complete sequence. (NC_011785)=NC_011785,NC_011785.1,gi|218906779|ref|NC_011785.1| -Borrelia burgdorferi ZS7 plasmid ZS7_lp36, complete sequence. (NC_011778)=NC_011778,NC_011778.1,gi|218868668|ref|NC_011778.1| -Borrelia burgdorferi ZS7 plasmid ZS7_lp54, complete sequence. (NC_011784)=NC_011784,NC_011784.1,gi|219499124|ref|NC_011784.1| -Borrelia burgdorferi ZS7, complete genome. (NC_011728)=NC_011728,NC_011728.1,gi|218249165|ref|NC_011728.1| -Borrelia crocidurae str. Achema chromosome, complete genome. (NC_017808)=NC_017808,NC_017808.1,gi|386859226|ref|NC_017808.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017774)=NC_017774,NC_017774.1,gi|386858849|ref|NC_017774.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017775)=NC_017775,NC_017775.1,gi|386858858|ref|NC_017775.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017776)=NC_017776,NC_017776.1,gi|386644995|ref|NC_017776.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017777)=NC_017777,NC_017777.1,gi|386859037|ref|NC_017777.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017778)=NC_017778,NC_017778.1,gi|386859044|ref|NC_017778.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017779)=NC_017779,NC_017779.1,gi|386858652|ref|NC_017779.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017780)=NC_017780,NC_017780.1,gi|386859192|ref|NC_017780.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017781)=NC_017781,NC_017781.1,gi|386858626|ref|NC_017781.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017782)=NC_017782,NC_017782.1,gi|386858667|ref|NC_017782.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017783)=NC_017783,NC_017783.1,gi|386858678|ref|NC_017783.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017784)=NC_017784,NC_017784.1,gi|386858688|ref|NC_017784.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017785)=NC_017785,NC_017785.1,gi|386858702|ref|NC_017785.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017786)=NC_017786,NC_017786.1,gi|386858706|ref|NC_017786.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017787)=NC_017787,NC_017787.1,gi|386858865|ref|NC_017787.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017788)=NC_017788,NC_017788.1,gi|386858754|ref|NC_017788.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017789)=NC_017789,NC_017789.1,gi|386858640|ref|NC_017789.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017794)=NC_017794,NC_017794.1,gi|386858925|ref|NC_017794.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017795)=NC_017795,NC_017795.1,gi|386858840|ref|NC_017795.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017796)=NC_017796,NC_017796.1,gi|386858760|ref|NC_017796.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017797)=NC_017797,NC_017797.1,gi|386859201|ref|NC_017797.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017798)=NC_017798,NC_017798.1,gi|386858793|ref|NC_017798.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017799)=NC_017799,NC_017799.1,gi|386858623|ref|NC_017799.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017800)=NC_017800,NC_017800.1,gi|386858843|ref|NC_017800.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017801)=NC_017801,NC_017801.1,gi|386858845|ref|NC_017801.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017802)=NC_017802,NC_017802.1,gi|386858806|ref|NC_017802.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017809)=NC_017809,NC_017809.1,gi|386858947|ref|NC_017809.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017810)=NC_017810,NC_017810.1,gi|386858954|ref|NC_017810.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017811)=NC_017811,NC_017811.1,gi|386858811|ref|NC_017811.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017812)=NC_017812,NC_017812.1,gi|386858817|ref|NC_017812.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017813)=NC_017813,NC_017813.1,gi|386858961|ref|NC_017813.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017814)=NC_017814,NC_017814.1,gi|386858829|ref|NC_017814.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017815)=NC_017815,NC_017815.1,gi|386860091|ref|NC_017815.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017816)=NC_017816,NC_017816.1,gi|386858645|ref|NC_017816.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017817)=NC_017817,NC_017817.1,gi|386858972|ref|NC_017817.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017818)=NC_017818,NC_017818.1,gi|386860095|ref|NC_017818.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017819)=NC_017819,NC_017819.1,gi|386859010|ref|NC_017819.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017820)=NC_017820,NC_017820.1,gi|386860119|ref|NC_017820.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017821)=NC_017821,NC_017821.1,gi|386858648|ref|NC_017821.1| -Borrelia crocidurae str. Achema plasmid unnamed, complete sequence. (NC_017822)=NC_017822,NC_017822.1,gi|386859015|ref|NC_017822.1| -Borrelia duttonii Ly plasmid pl11, complete sequence. (NC_011224)=NC_011224,NC_011224.1,gi|203283903|ref|NC_011224.1| -Borrelia duttonii Ly plasmid pl15, complete sequence. (NC_011226)=NC_011226,NC_011226.1,gi|203283912|ref|NC_011226.1| -Borrelia duttonii Ly plasmid pl165, complete sequence. (NC_011247)=NC_011247,NC_011247.1,gi|203288506|ref|NC_011247.1| -Borrelia duttonii Ly plasmid pl23, complete sequence. (NC_011257)=NC_011257,NC_011257.1,gi|203288797|ref|NC_011257.1| -Borrelia duttonii Ly plasmid pl23b, complete sequence. (NC_011259)=NC_011259,NC_011259.1,gi|203288819|ref|NC_011259.1| -Borrelia duttonii Ly plasmid pl26, complete sequence. (NC_011261)=NC_011261,NC_011261.1,gi|203288832|ref|NC_011261.1| -Borrelia duttonii Ly plasmid pl27, complete sequence. (NC_011265)=NC_011265,NC_011265.1,gi|203288911|ref|NC_011265.1| -Borrelia duttonii Ly plasmid pl28, complete sequence. (NC_011245)=NC_011245,NC_011245.1,gi|203288469|ref|NC_011245.1| -Borrelia duttonii Ly plasmid pl31, complete sequence. (NC_011262)=NC_011262,NC_011262.1,gi|203288867|ref|NC_011262.1| -Borrelia duttonii Ly plasmid pl32, complete sequence. (NC_011264)=NC_011264,NC_011264.1,gi|203288888|ref|NC_011264.1| -Borrelia duttonii Ly plasmid pl35, complete sequence. (NC_011248)=NC_011248,NC_011248.1,gi|203288641|ref|NC_011248.1| -Borrelia duttonii Ly plasmid pl36, complete sequence. (NC_011249)=NC_011249,NC_011249.1,gi|203288661|ref|NC_011249.1| -Borrelia duttonii Ly plasmid pl40, complete sequence. (NC_011250)=NC_011250,NC_011250.1,gi|203288682|ref|NC_011250.1| -Borrelia duttonii Ly plasmid pl41, complete sequence. (NC_011251)=NC_011251,NC_011251.1,gi|203288701|ref|NC_011251.1| -Borrelia duttonii Ly plasmid pl42, complete sequence. (NC_011254)=NC_011254,NC_011254.1,gi|203288730|ref|NC_011254.1| -Borrelia duttonii Ly plasmid pl70, complete sequence. (NC_011256)=NC_011256,NC_011256.1,gi|203288751|ref|NC_011256.1| -Borrelia duttonii Ly, complete genome. (NC_011229)=NC_011229,NC_011229.1,gi|203283926|ref|NC_011229.1| -Borrelia garinii BgVir chromosome chromosome linear, complete (NC_017717)=NC_017717,NC_017717.1,gi|386853410|ref|NC_017717.1| -Borrelia garinii BgVir plasmid cp26, complete sequence. (NC_017725)=NC_017725,NC_017725.1,gi|386854243|ref|NC_017725.1| -Borrelia garinii BgVir plasmid lp54, complete sequence. (NC_017804)=NC_017804,NC_017804.1,gi|386853317|ref|NC_017804.1| -Borrelia garinii PBi chromosome linear, complete sequence. (NC_006156)=NC_006156,NC_006156.1,gi|51598263|ref|NC_006156.1| -Borrelia garinii PBi plasmid cp26, complete sequence. (NC_006128)=NC_006128,NC_006128.1,gi|51038597|ref|NC_006128.1| -Borrelia garinii PBi plasmid lp54, complete sequence. (NC_006129)=NC_006129,NC_006129.1,gi|51038624|ref|NC_006129.1| -Borrelia hermsii DAH chromosome, complete genome. (NC_010673)=NC_010673,NC_010673.1,gi|187917883|ref|NC_010673.1| -Borrelia recurrentis A1 plasmid pl124, complete sequence. (NC_011246)=NC_011246,NC_011246.1,gi|203288272|ref|NC_011246.1| -Borrelia recurrentis A1 plasmid pl23, complete sequence. (NC_011252)=NC_011252,NC_011252.1,gi|203288364|ref|NC_011252.1| -Borrelia recurrentis A1 plasmid pl33, complete sequence. (NC_011253)=NC_011253,NC_011253.1,gi|203288382|ref|NC_011253.1| -Borrelia recurrentis A1 plasmid pl35, complete sequence. (NC_011255)=NC_011255,NC_011255.1,gi|203288400|ref|NC_011255.1| -Borrelia recurrentis A1 plasmid pl37, complete sequence. (NC_011258)=NC_011258,NC_011258.1,gi|203288416|ref|NC_011258.1| -Borrelia recurrentis A1 plasmid pl53, complete sequence. (NC_011260)=NC_011260,NC_011260.1,gi|203288436|ref|NC_011260.1| -Borrelia recurrentis A1 plasmid pl6, complete sequence. (NC_011263)=NC_011263,NC_011263.1,gi|203288465|ref|NC_011263.1| -Borrelia recurrentis A1, complete genome. (NC_011244)=NC_011244,NC_011244.1,gi|203287471|ref|NC_011244.1| -Borrelia turicatae 91E135 chromosome, complete genome. (NC_008710)=NC_008710,NC_008710.1,gi|119952806|ref|NC_008710.1| -Brachybacterium faecium DSM 4810 chromosome, complete genome. (NC_013172)=NC_013172,NC_013172.1,gi|257067223|ref|NC_013172.1| -Brachyspira hyodysenteriae WA1 chromosome, complete genome. (NC_012225)=NC_012225,NC_012225.1,gi|225618950|ref|NC_012225.1| -Brachyspira hyodysenteriae WA1 plasmid pBHWA1, complete sequence. (NC_012226)=NC_012226,NC_012226.1,gi|225350699|ref|NC_012226.1| -Brachyspira intermedia PWS/A chromosome, complete genome. (NC_017243)=NC_017243,NC_017243.1,gi|384207496|ref|NC_017243.1| -Brachyspira intermedia PWS/A plasmid pInt, complete sequence. (NC_017242)=NC_017242,NC_017242.1,gi|384207492|ref|NC_017242.1| -Brachyspira murdochii DSM 12563 chromosome, complete genome. (NC_014150)=NC_014150,NC_014150.1,gi|296125058|ref|NC_014150.1| -Brachyspira pilosicoli 95/1000 chromosome, complete genome. (NC_014330)=NC_014330,NC_014330.1,gi|300869639|ref|NC_014330.1| -Bradyrhizobium sp. BTAi1 chromosome, complete genome. (NC_009485)=NC_009485,NC_009485.1,gi|148251626|ref|NC_009485.1| -Bradyrhizobium sp. BTAi1 plasmid pBBta01, complete sequence. (NC_009475)=NC_009475,NC_009475.1,gi|148240870|ref|NC_009475.1| -Bradyrhizobium sp. ORS 278 chromosome, complete genome. (NC_009445)=NC_009445,NC_009445.1,gi|146337175|ref|NC_009445.1| -Bradyrhizobium sp. S23321, complete genome. (NC_017082)=NC_017082,NC_017082.1,gi|383768277|ref|NC_017082.1| -Bradyrhizobium japonicum USDA 110 chromosome, complete genome. (NC_004463)=NC_004463,NC_004463.1,gi|27375111|ref|NC_004463.1| -Bradyrhizobium japonicum USDA 6, complete genome. (NC_017249)=NC_017249,NC_017249.1,gi|384213726|ref|NC_017249.1| -Brevibacillus brevis NBRC 100599, complete genome. (NC_012491)=NC_012491,NC_012491.1,gi|226309587|ref|NC_012491.1| -Brevundimonas subvibrioides ATCC 15264 chromosome, complete genome. (NC_014375)=NC_014375,NC_014375.1,gi|302381116|ref|NC_014375.1| -Brucella abortus A13334 chromosome 1, complete sequence. (NC_016795)=NC_016795,NC_016795.1,gi|376271796|ref|NC_016795.1| -Brucella abortus A13334 chromosome 2, complete sequence. (NC_016777)=NC_016777,NC_016777.1,gi|376270416|ref|NC_016777.1| -Brucella abortus S19 chromosome 1, complete sequence. (NC_010742)=NC_010742,NC_010742.1,gi|189023268|ref|NC_010742.1| -Brucella abortus S19 chromosome 2, complete sequence. (NC_010740)=NC_010740,NC_010740.1,gi|189022234|ref|NC_010740.1| -Brucella abortus bv. 1 str. 9-941 chromosome I, complete sequence. (NC_006932)=NC_006932,NC_006932.1,gi|62288991|ref|NC_006932.1| -Brucella abortus bv. 1 str. 9-941 chromosome II, complete sequence. (NC_006933)=NC_006933,NC_006933.1,gi|62316961|ref|NC_006933.1| -Brucella canis ATCC 23365 chromosome I, complete sequence. (NC_010103)=NC_010103,NC_010103.1,gi|161617991|ref|NC_010103.1| -Brucella canis ATCC 23365 chromosome II, complete sequence. (NC_010104)=NC_010104,NC_010104.1,gi|161620094|ref|NC_010104.1| -Brucella canis HSK A52141 chromosome 1, complete sequence. (NC_016778)=NC_016778,NC_016778.1,gi|376274175|ref|NC_016778.1| -Brucella canis HSK A52141 chromosome 2, complete sequence. (NC_016796)=NC_016796,NC_016796.1,gi|376276498|ref|NC_016796.1| -Brucella melitensis ATCC 23457 chromosome I, complete sequence. (NC_012441)=NC_012441,NC_012441.1,gi|225851546|ref|NC_012441.1| -Brucella melitensis ATCC 23457 chromosome II, complete sequence. (NC_012442)=NC_012442,NC_012442.1,gi|225685871|ref|NC_012442.1| -Brucella melitensis M28 chromosome chromosome 1, complete sequence. (NC_017244)=NC_017244,NC_017244.1,gi|384407464|ref|NC_017244.1| -Brucella melitensis M28 chromosome chromosome 2, complete sequence. (NC_017245)=NC_017245,NC_017245.1,gi|384409638|ref|NC_017245.1| -Brucella melitensis M5-90 chromosome chromosome I, complete (NC_017246)=NC_017246,NC_017246.1,gi|384210366|ref|NC_017246.1| -Brucella melitensis M5-90 chromosome chromosome II, complete (NC_017247)=NC_017247,NC_017247.1,gi|384212538|ref|NC_017247.1| -Brucella melitensis NI chromosome chromosome I, complete sequence. (NC_017248)=NC_017248,NC_017248.1,gi|384444089|ref|NC_017248.1| -Brucella melitensis NI chromosome chromosome II, complete sequence. (NC_017283)=NC_017283,NC_017283.1,gi|384446171|ref|NC_017283.1| -Brucella melitensis biovar Abortus 2308 chromosome I, complete (NC_007618)=NC_007618,NC_007618.1,gi|82698932|ref|NC_007618.1| -Brucella melitensis biovar Abortus 2308 chromosome II, complete (NC_007624)=NC_007624,NC_007624.1,gi|83268957|ref|NC_007624.1| -Brucella melitensis bv. 1 str. 16M chromosome I, complete sequence. (NC_003317)=NC_003317,NC_003317.1,gi|17986284|ref|NC_003317.1| -Brucella melitensis bv. 1 str. 16M chromosome II, complete (NC_003318)=NC_003318,NC_003318.1,gi|17988344|ref|NC_003318.1| -Brucella microti CCM 4915 chromosome 1, complete genome. (NC_013119)=NC_013119,NC_013119.1,gi|256368465|ref|NC_013119.1| -Brucella microti CCM 4915 chromosome 2, complete sequence. (NC_013118)=NC_013118,NC_013118.1,gi|256014795|ref|NC_013118.1| -Brucella ovis ATCC 25840 chromosome I, complete sequence. (NC_009505)=NC_009505,NC_009505.1,gi|148558820|ref|NC_009505.1| -Brucella ovis ATCC 25840 chromosome II, complete sequence. (NC_009504)=NC_009504,NC_009504.1,gi|148557829|ref|NC_009504.1| -Brucella pinnipedialis B2/94 chromosome 1, complete sequence. (NC_015857)=NC_015857,NC_015857.1,gi|340789630|ref|NC_015857.1| -Brucella pinnipedialis B2/94 chromosome 2, complete sequence. (NC_015858)=NC_015858,NC_015858.1,gi|340791767|ref|NC_015858.1| -Brucella suis 1330 chromosome I, complete genome. (NC_017251)=NC_017251,NC_017251.1,gi|384223698|ref|NC_017251.1| -Brucella suis 1330 chromosome II, complete genome. (NC_017250)=NC_017250,NC_017250.1,gi|384222553|ref|NC_017250.1| -Brucella suis 1330 chromosome I, complete sequence. (NC_004310)=NC_004310,NC_004310.3,gi|56968325|ref|NC_004310.3| -Brucella suis 1330 chromosome II, complete sequence. (NC_004311)=NC_004311,NC_004311.2,gi|56968493|ref|NC_004311.2| -Brucella suis ATCC 23445 chromosome I, complete sequence. (NC_010169)=NC_010169,NC_010169.1,gi|163842277|ref|NC_010169.1| -Brucella suis ATCC 23445 chromosome II, complete genome. (NC_010167)=NC_010167,NC_010167.1,gi|163844199|ref|NC_010167.1| -Brucella suis VBI22 chromosome I, complete sequence. (NC_016797)=NC_016797,NC_016797.1,gi|376279704|ref|NC_016797.1| -Brucella suis VBI22 chromosome II, complete sequence. (NC_016775)=NC_016775,NC_016775.1,gi|376277991|ref|NC_016775.1| -Buchnera aphidicola str. 5A (Acyrthosiphon pisum) chromosome, (NC_011833)=NC_011833,NC_011833.1,gi|219681389|ref|NC_011833.1| -Buchnera aphidicola str. APS (Acyrthosiphon pisum) chromosome, (NC_002528)=NC_002528,NC_002528.1,gi|15616630|ref|NC_002528.1| -Buchnera aphidicola str. APS (Acyrthosiphon pisum) plasmid pLeu, (NC_002253)=NC_002253,NC_002253.1,gi|10957103|ref|NC_002253.1| -Buchnera aphidicola str. APS (Acyrthosiphon pisum) plasmid pTrp, (NC_002252)=NC_002252,NC_002252.1,gi|10957099|ref|NC_002252.1| -Buchnera aphidicola str. Ak (Acyrthosiphon kondoi) chromosome, (NC_017256)=NC_017256,NC_017256.1,gi|384227456|ref|NC_017256.1| -Buchnera aphidicola str. Ak (Acyrthosiphon kondoi) plasmid pLeu, (NC_017257)=NC_017257,NC_017257.1,gi|384228016|ref|NC_017257.1| -Buchnera aphidicola str. Ak (Acyrthosiphon kondoi) plasmid pTrp, (NC_017258)=NC_017258,NC_017258.1,gi|384227452|ref|NC_017258.1| -Buchnera aphidicola str. Bp (Baizongia pistaciae) chromosome, (NC_004545)=NC_004545,NC_004545.1,gi|27904513|ref|NC_004545.1| -Buchnera aphidicola str. Bp (Baizongia pistaciae) plasmid pBBp1, (NC_004555)=NC_004555,NC_004555.1,gi|28191365|ref|NC_004555.1| -Buchnera aphidicola (Cinara cedri) plasmid pLeu-BCc, complete (NC_011878)=NC_011878,NC_011878.1,gi|219882535|ref|NC_011878.1| -Buchnera aphidicola str. Cc (Cinara cedri), complete genome. (NC_008513)=NC_008513,NC_008513.1,gi|116514950|ref|NC_008513.1| -Buchnera aphidicola str. JF98 (Acyrthosiphon pisum) chromosome, (NC_017254)=NC_017254,NC_017254.1,gi|384226396|ref|NC_017254.1| -Buchnera aphidicola str. JF99 (Acyrthosiphon pisum) chromosome, (NC_017253)=NC_017253,NC_017253.1,gi|384226395|ref|NC_017253.1| -Buchnera aphidicola str. LL01 (Acyrthosiphon pisum) chromosome, (NC_017255)=NC_017255,NC_017255.1,gi|384226874|ref|NC_017255.1| -Buchnera aphidicola str. Sg (Schizaphis graminum) chromosome, (NC_004061)=NC_004061,NC_004061.1,gi|21672294|ref|NC_004061.1| -Buchnera aphidicola str. TLW03 (Acyrthosiphon pisum) chromosome, (NC_017252)=NC_017252,NC_017252.1,gi|384225821|ref|NC_017252.1| -Buchnera aphidicola str. Tuc7 (Acyrthosiphon pisum) chromosome, (NC_011834)=NC_011834,NC_011834.1,gi|219681945|ref|NC_011834.1| -Buchnera aphidicola str. Ua (Uroleucon ambrosiae) chromosome, (NC_017259)=NC_017259,NC_017259.1,gi|384228035|ref|NC_017259.1| -Buchnera aphidicola str. Ua (Uroleucon ambrosiae) plasmid pLeu, (NC_017261)=NC_017261,NC_017261.1,gi|384228027|ref|NC_017261.1| -Buchnera aphidicola str. Ua (Uroleucon ambrosiae) plasmid pTrp, (NC_017260)=NC_017260,NC_017260.1,gi|384228024|ref|NC_017260.1| -Buchnera aphidicola (Cinara tujafilina) chromosome, complete (NC_015662)=NC_015662,NC_015662.1,gi|336233113|ref|NC_015662.1| -Burkholderia sp. 383 chromosome 1, complete sequence. (NC_007510)=NC_007510,NC_007510.1,gi|78064658|ref|NC_007510.1| -Burkholderia sp. 383 chromosome 2, complete sequence. (NC_007511)=NC_007511,NC_007511.1,gi|78060853|ref|NC_007511.1| -Burkholderia sp. 383 chromosome 3, complete genome. (NC_007509)=NC_007509,NC_007509.1,gi|78059643|ref|NC_007509.1| -Burkholderia sp. CCGE1001 chromosome 1, complete sequence. (NC_015136)=NC_015136,NC_015136.1,gi|323524377|ref|NC_015136.1| -Burkholderia sp. CCGE1001 chromosome 2, complete sequence. (NC_015137)=NC_015137,NC_015137.1,gi|323527923|ref|NC_015137.1| -Burkholderia sp. CCGE1002 chromosome 1, complete sequence. (NC_014117)=NC_014117,NC_014117.1,gi|295675101|ref|NC_014117.1| -Burkholderia sp. CCGE1002 chromosome 2, complete sequence. (NC_014118)=NC_014118,NC_014118.1,gi|295698848|ref|NC_014118.1| -Burkholderia sp. CCGE1002 chromosome 3, complete sequence. (NC_014119)=NC_014119,NC_014119.1,gi|295680425|ref|NC_014119.1| -Burkholderia sp. CCGE1002 plasmid pBC201, complete sequence. (NC_014120)=NC_014120,NC_014120.1,gi|295701107|ref|NC_014120.1| -Burkholderia sp. CCGE1003 chromosome 1, complete sequence. (NC_014539)=NC_014539,NC_014539.1,gi|307728076|ref|NC_014539.1| -Burkholderia sp. CCGE1003 chromosome 2, complete sequence. (NC_014540)=NC_014540,NC_014540.1,gi|307725550|ref|NC_014540.1| -Burkholderia sp. KJ006 chromosome chromosome 1, complete sequence. (NC_017920)=NC_017920,NC_017920.1,gi|387900762|ref|NC_017920.1| -Burkholderia sp. KJ006 chromosome chromosome 2, complete sequence. (NC_017921)=NC_017921,NC_017921.1,gi|387903680|ref|NC_017921.1| -Burkholderia sp. KJ006 chromosome chromosome 3, complete sequence. (NC_017922)=NC_017922,NC_017922.1,gi|387905813|ref|NC_017922.1| -Burkholderia sp. KJ006 plasmid pKJ006, complete sequence. (NC_017923)=NC_017923,NC_017923.1,gi|387906744|ref|NC_017923.1| -Burkholderia sp. YI23 chromosome 1, complete sequence. (NC_016589)=NC_016589,NC_016589.1,gi|377819444|ref|NC_016589.1| -Burkholderia sp. YI23 chromosome 2, complete sequence. (NC_016625)=NC_016625,NC_016625.1,gi|377812245|ref|NC_016625.1| -Burkholderia sp. YI23 chromosome 3, complete sequence. (NC_016590)=NC_016590,NC_016590.1,gi|377807392|ref|NC_016590.1| -Burkholderia sp. YI23 plasmid byi_1p, complete sequence. (NC_016626)=NC_016626,NC_016626.1,gi|377810593|ref|NC_016626.1| -Burkholderia sp. YI23 plasmid byi_2p, complete sequence. (NC_016591)=NC_016591,NC_016591.1,gi|377807001|ref|NC_016591.1| -Burkholderia sp. YI23 plasmid byi_3p, complete sequence. (NC_016592)=NC_016592,NC_016592.1,gi|377822214|ref|NC_016592.1| -Burkholderia ambifaria AMMD chromosome 1, complete sequence. (NC_008390)=NC_008390,NC_008390.1,gi|115350056|ref|NC_008390.1| -Burkholderia ambifaria AMMD chromosome 2, complete sequence. (NC_008391)=NC_008391,NC_008391.1,gi|115357970|ref|NC_008391.1| -Burkholderia ambifaria AMMD chromosome 3, complete sequence. (NC_008392)=NC_008392,NC_008392.1,gi|115360317|ref|NC_008392.1| -Burkholderia cepacia AMMD plasmid 1, complete sequence. (NC_008385)=NC_008385,NC_008385.1,gi|115345482|ref|NC_008385.1| -Burkholderia ambifaria MC40-6 chromosome 1, complete sequence. (NC_010551)=NC_010551,NC_010551.1,gi|172059067|ref|NC_010551.1| -Burkholderia ambifaria MC40-6 chromosome 2, complete sequence. (NC_010552)=NC_010552,NC_010552.1,gi|172062142|ref|NC_010552.1| -Burkholderia ambifaria MC40-6 chromosome 3, complete sequence. (NC_010557)=NC_010557,NC_010557.1,gi|172064800|ref|NC_010557.1| -Burkholderia ambifaria MC40-6 plasmid pBMC401, complete sequence. (NC_010553)=NC_010553,NC_010553.1,gi|172064525|ref|NC_010553.1| -Burkholderia cenocepacia AU 1054 chromosome 1, complete sequence. (NC_008060)=NC_008060,NC_008060.1,gi|107021562|ref|NC_008060.1| -Burkholderia cenocepacia AU 1054 chromosome 2, complete sequence. (NC_008061)=NC_008061,NC_008061.1,gi|107025343|ref|NC_008061.1| -Burkholderia cenocepacia AU 1054 chromosome 3, complete sequence. (NC_008062)=NC_008062,NC_008062.1,gi|107028231|ref|NC_008062.1| -Burkholderia cenocepacia HI2424 chromosome 1, complete sequence. (NC_008542)=NC_008542,NC_008542.1,gi|116688024|ref|NC_008542.1| -Burkholderia cenocepacia HI2424 chromosome 2, complete sequence. (NC_008543)=NC_008543,NC_008543.1,gi|116691273|ref|NC_008543.1| -Burkholderia cenocepacia HI2424 chromosome 3, complete sequence. (NC_008544)=NC_008544,NC_008544.1,gi|116686245|ref|NC_008544.1| -Burkholderia cenocepacia HI2424 plasmid 1, complete sequence. (NC_008545)=NC_008545,NC_008545.1,gi|116687164|ref|NC_008545.1| -Burkholderia cenocepacia J2315 chromosome 1, complete sequence. (NC_011000)=NC_011000,NC_011000.1,gi|206558403|ref|NC_011000.1| -Burkholderia cenocepacia J2315 chromosome 2, complete sequence. (NC_011001)=NC_011001,NC_011001.1,gi|206561868|ref|NC_011001.1| -Burkholderia cenocepacia J2315 chromosome 3, complete sequence. (NC_011002)=NC_011002,NC_011002.1,gi|191639869|ref|NC_011002.1| -Burkholderia cenocepacia J2315 plasmid pBCJ2315, complete sequence. (NC_011003)=NC_011003,NC_011003.1,gi|206479926|ref|NC_011003.1| -Burkholderia cenocepacia MC0-3 chromosome 1, complete sequence. (NC_010508)=NC_010508,NC_010508.1,gi|170731356|ref|NC_010508.1| -Burkholderia cenocepacia MC0-3 chromosome 2, complete sequence. (NC_010515)=NC_010515,NC_010515.1,gi|170735571|ref|NC_010515.1| -Burkholderia cenocepacia MC0-3 chromosome 3, complete sequence. (NC_010512)=NC_010512,NC_010512.1,gi|170734517|ref|NC_010512.1| -Burkholderia gladioli BSR3 chromosome 1, complete sequence. (NC_015381)=NC_015381,NC_015381.1,gi|330814956|ref|NC_015381.1| -Burkholderia gladioli BSR3 chromosome 2, complete sequence. (NC_015376)=NC_015376,NC_015376.1,gi|330819133|ref|NC_015376.1| -Burkholderia gladioli BSR3 plasmid bgla_1p, complete sequence. (NC_015382)=NC_015382,NC_015382.1,gi|330822218|ref|NC_015382.1| -Burkholderia gladioli BSR3 plasmid bgla_2p, complete sequence. (NC_015377)=NC_015377,NC_015377.1,gi|330822093|ref|NC_015377.1| -Burkholderia gladioli BSR3 plasmid bgla_3p, complete sequence. (NC_015378)=NC_015378,NC_015378.1,gi|330818808|ref|NC_015378.1| -Burkholderia gladioli BSR3 plasmid bgla_4p, complete sequence. (NC_015383)=NC_015383,NC_015383.1,gi|330814453|ref|NC_015383.1| -Burkholderia glumae BGR1 chromosome 1, complete sequence. (NC_012724)=NC_012724,NC_012724.2,gi|339905954|ref|NC_012724.2| -Burkholderia glumae BGR1 chromosome 2, complete sequence. (NC_012721)=NC_012721,NC_012721.2,gi|339717964|ref|NC_012721.2| -Burkholderia glumae BGR1 plasmid bglu_1p, complete sequence. (NC_012723)=NC_012723,NC_012723.1,gi|238025581|ref|NC_012723.1| -Burkholderia glumae BGR1 plasmid bglu_2p, complete sequence. (NC_012718)=NC_012718,NC_012718.1,gi|238023296|ref|NC_012718.1| -Burkholderia glumae BGR1 plasmid bglu_3p, complete sequence. (NC_012720)=NC_012720,NC_012720.2,gi|339717136|ref|NC_012720.2| -Burkholderia glumae BGR1 plasmid bglu_4p, complete sequence. (NC_012725)=NC_012725,NC_012725.2,gi|339717962|ref|NC_012725.2| -Burkholderia mallei ATCC 23344 chromosome 1, complete sequence. (NC_006348)=NC_006348,NC_006348.1,gi|53723370|ref|NC_006348.1| -Burkholderia mallei ATCC 23344 chromosome 2, complete sequence. (NC_006349)=NC_006349,NC_006349.2,gi|77358719|ref|NC_006349.2| -Burkholderia mallei NCTC 10229 chromosome I, complete sequence. (NC_008836)=NC_008836,NC_008836.1,gi|124383319|ref|NC_008836.1| -Burkholderia mallei NCTC 10229 chromosome II, complete sequence. (NC_008835)=NC_008835,NC_008835.1,gi|124381141|ref|NC_008835.1| -Burkholderia mallei NCTC 10247 chromosome I, complete sequence. (NC_009080)=NC_009080,NC_009080.1,gi|126447966|ref|NC_009080.1| -Burkholderia mallei NCTC 10247 chromosome II, complete sequence. (NC_009079)=NC_009079,NC_009079.1,gi|126445587|ref|NC_009079.1| -Burkholderia mallei SAVP1 chromosome I, complete sequence. (NC_008785)=NC_008785,NC_008785.1,gi|121598179|ref|NC_008785.1| -Burkholderia mallei SAVP1 chromosome II, complete sequence. (NC_008784)=NC_008784,NC_008784.1,gi|121596444|ref|NC_008784.1| -Burkholderia multivorans ATCC 17616 chromosome 1, complete (NC_010084)=NC_010084,NC_010084.1,gi|161523180|ref|NC_010084.1| -Burkholderia multivorans ATCC 17616 chromosome 2, complete (NC_010086)=NC_010086,NC_010086.1,gi|161519706|ref|NC_010086.1| -Burkholderia multivorans ATCC 17616 chromosome 3, complete (NC_010087)=NC_010087,NC_010087.1,gi|161522356|ref|NC_010087.1| -Burkholderia multivorans ATCC 17616 plasmid pBMUL01, complete (NC_010070)=NC_010070,NC_010070.1,gi|161506495|ref|NC_010070.1| -Burkholderia multivorans ATCC 17616 chromosome 1, complete (NC_010804)=NC_010804,NC_010804.1,gi|189348893|ref|NC_010804.1| -Burkholderia multivorans ATCC 17616 chromosome 2, complete genome. (NC_010805)=NC_010805,NC_010805.1,gi|189351978|ref|NC_010805.1| -Burkholderia multivorans ATCC 17616 chromosome 3, complete (NC_010801)=NC_010801,NC_010801.1,gi|189347993|ref|NC_010801.1| -Burkholderia multivorans ATCC 17616 plasmid pTGL1, complete (NC_010802)=NC_010802,NC_010802.1,gi|189348761|ref|NC_010802.1| -Burkholderia phymatum STM815 chromosome 1, complete sequence. (NC_010622)=NC_010622,NC_010622.1,gi|186474773|ref|NC_010622.1| -Burkholderia phymatum STM815 chromosome 2, complete sequence. (NC_010623)=NC_010623,NC_010623.1,gi|186471973|ref|NC_010623.1| -Burkholderia phymatum STM815 plasmid pBPHY01, complete sequence. (NC_010625)=NC_010625,NC_010625.1,gi|186470346|ref|NC_010625.1| -Burkholderia phymatum STM815 plasmid pBPHY02, complete sequence. (NC_010627)=NC_010627,NC_010627.1,gi|186474323|ref|NC_010627.1| -Burkholderia phytofirmans PsJN chromosome 1, complete sequence. (NC_010681)=NC_010681,NC_010681.1,gi|187922035|ref|NC_010681.1| -Burkholderia phytofirmans PsJN chromosome 2, complete sequence. (NC_010676)=NC_010676,NC_010676.1,gi|187918714|ref|NC_010676.1| -Burkholderia phytofirmans PsJN plasmid pBPHYT01, complete sequence. (NC_010679)=NC_010679,NC_010679.1,gi|187921867|ref|NC_010679.1| -Burkholderia pseudomallei 1026b chromosome 1, complete sequence. (NC_017831)=NC_017831,NC_017831.1,gi|386860126|ref|NC_017831.1| -Burkholderia pseudomallei 1026b chromosome 2, complete sequence. (NC_017832)=NC_017832,NC_017832.1,gi|386863735|ref|NC_017832.1| -Burkholderia pseudomallei 1106a chromosome I, complete sequence. (NC_009076)=NC_009076,NC_009076.1,gi|126451443|ref|NC_009076.1| -Burkholderia pseudomallei 1106a chromosome II, complete sequence. (NC_009078)=NC_009078,NC_009078.1,gi|126455463|ref|NC_009078.1| -Burkholderia pseudomallei 1710b chromosome I, complete sequence. (NC_007434)=NC_007434,NC_007434.1,gi|76808520|ref|NC_007434.1| -Burkholderia pseudomallei 1710b chromosome II, complete sequence. (NC_007435)=NC_007435,NC_007435.1,gi|76817237|ref|NC_007435.1| -Burkholderia pseudomallei 668 chromosome I, complete sequence. (NC_009074)=NC_009074,NC_009074.1,gi|126438353|ref|NC_009074.1| -Burkholderia pseudomallei 668 chromosome chromosome II, complete (NC_009075)=NC_009075,NC_009075.1,gi|126442307|ref|NC_009075.1| -Burkholderia pseudomallei K96243 chromosome 1, complete sequence. (NC_006350)=NC_006350,NC_006350.1,gi|53717639|ref|NC_006350.1| -Burkholderia pseudomallei K96243 chromosome 2, complete sequence. (NC_006351)=NC_006351,NC_006351.1,gi|53721039|ref|NC_006351.1| -Burkholderia pseudomallei MSHR346 chromosome I, complete genome. (NC_012695)=NC_012695,NC_012695.1,gi|237810278|ref|NC_012695.1| -Burkholderia rhizoxinica HKI 454 chromosome, complete genome. (NC_014722)=NC_014722,NC_014722.1,gi|312794749|ref|NC_014722.1| -Burkholderia rhizoxinica HKI 454 plasmid pBRH01, complete sequence. (NC_014718)=NC_014718,NC_014718.1,gi|312602094|ref|NC_014718.1| -Burkholderia rhizoxinica HKI 454 plasmid pBRH02, complete sequence. (NC_014723)=NC_014723,NC_014723.1,gi|330399456|ref|NC_014723.1| -Burkholderia thailandensis E264 chromosome I, complete sequence. (NC_007651)=NC_007651,NC_007651.1,gi|83718394|ref|NC_007651.1| -Burkholderia thailandensis E264 chromosome II, complete sequence. (NC_007650)=NC_007650,NC_007650.1,gi|83716035|ref|NC_007650.1| -Burkholderia vietnamiensis G4 chromosome 1, complete sequence. (NC_009256)=NC_009256,NC_009256.1,gi|134294128|ref|NC_009256.1| -Burkholderia vietnamiensis G4 chromosome 2, complete sequence. (NC_009255)=NC_009255,NC_009255.1,gi|134292031|ref|NC_009255.1| -Burkholderia vietnamiensis G4 chromosome 3, complete sequence. (NC_009254)=NC_009254,NC_009254.1,gi|134290884|ref|NC_009254.1| -Burkholderia vietnamiensis G4 plasmid pBVIE01, complete sequence. (NC_009230)=NC_009230,NC_009230.1,gi|134288152|ref|NC_009230.1| -Burkholderia vietnamiensis G4 plasmid pBVIE02, complete sequence. (NC_009227)=NC_009227,NC_009227.1,gi|134287530|ref|NC_009227.1| -Burkholderia vietnamiensis G4 plasmid pBVIE03, complete sequence. (NC_009229)=NC_009229,NC_009229.1,gi|134287902|ref|NC_009229.1| -Burkholderia vietnamiensis G4 plasmid pBVIE04, complete sequence. (NC_009228)=NC_009228,NC_009228.1,gi|134287794|ref|NC_009228.1| -Burkholderia vietnamiensis G4 plasmid pBVIE05, complete sequence. (NC_009226)=NC_009226,NC_009226.1,gi|134287418|ref|NC_009226.1| -Burkholderia xenovorans LB400 chromosome 1, complete sequence. (NC_007951)=NC_007951,NC_007951.1,gi|91781384|ref|NC_007951.1| -Burkholderia xenovorans LB400 chromosome 2, complete sequence. (NC_007952)=NC_007952,NC_007952.1,gi|91777110|ref|NC_007952.1| -Burkholderia xenovorans LB400 chromosome 3, complete genome. (NC_007953)=NC_007953,NC_007953.1,gi|91780071|ref|NC_007953.1| -Butyrivibrio proteoclasticus B316 chromosome 1, complete genome. (NC_014387)=NC_014387,NC_014387.1,gi|302669374|ref|NC_014387.1| -Butyrivibrio proteoclasticus B316 chromosome 2, complete genome. (NC_014388)=NC_014388,NC_014388.1,gi|302669123|ref|NC_014388.1| -Butyrivibrio proteoclasticus B316 plasmid pCY186, complete (NC_014390)=NC_014390,NC_014390.1,gi|302668499|ref|NC_014390.1| -Butyrivibrio proteoclasticus B316 plasmid pCY360, complete (NC_014389)=NC_014389,NC_014389.1,gi|302668698|ref|NC_014389.1| -Caldicellulosiruptor bescii DSM 6725 chromosome, complete genome. (NC_012034)=NC_012034,NC_012034.1,gi|222528057|ref|NC_012034.1| -Caldicellulosiruptor bescii DSM 6725 plasmid pATHE01, complete (NC_012036)=NC_012036,NC_012036.1,gi|222530712|ref|NC_012036.1| -Caldicellulosiruptor bescii DSM 6725 plasmid pATHE02, complete (NC_012037)=NC_012037,NC_012037.1,gi|222530721|ref|NC_012037.1| -Caldicellulosiruptor hydrothermalis 108 chromosome, complete (NC_014652)=NC_014652,NC_014652.1,gi|312126262|ref|NC_014652.1| -Caldicellulosiruptor kristjanssonii 177R1B chromosome, complete (NC_014721)=NC_014721,NC_014721.1,gi|312792283|ref|NC_014721.1| -Caldicellulosiruptor kristjanssonii 177R1B plasmid pCALKR01, (NC_014719)=NC_014719,NC_014719.1,gi|312281360|ref|NC_014719.1| -Caldicellulosiruptor kronotskyensis 2002 chromosome, complete (NC_014720)=NC_014720,NC_014720.1,gi|312621127|ref|NC_014720.1| -Caldicellulosiruptor lactoaceticus 6A chromosome, complete genome. (NC_015949)=NC_015949,NC_015949.1,gi|344995333|ref|NC_015949.1| -Caldicellulosiruptor obsidiansis OB47 chromosome, complete genome. (NC_014392)=NC_014392,NC_014392.1,gi|302870731|ref|NC_014392.1| -Caldicellulosiruptor owensensis OL chromosome, complete genome. (NC_014657)=NC_014657,NC_014657.1,gi|312134082|ref|NC_014657.1| -Caldicellulosiruptor saccharolyticus DSM 8903 chromosome, complete (NC_009437)=NC_009437,NC_009437.1,gi|146295085|ref|NC_009437.1| -Caldilinea aerophila DSM 14535 = NBRC 104270, complete genome. (NC_017079)=NC_017079,NC_017079.1,gi|383760955|ref|NC_017079.1| -Caldisericum exile AZM16c01, complete genome. (NC_017096)=NC_017096,NC_017096.1,gi|383787661|ref|NC_017096.1| -Calditerrivibrio nitroreducens DSM 19672 chromosome, complete (NC_014758)=NC_014758,NC_014758.1,gi|313671969|ref|NC_014758.1| -Calditerrivibrio nitroreducens DSM 19672 plasmid pCALNI01, complete (NC_014749)=NC_014749,NC_014749.1,gi|313652020|ref|NC_014749.1| -Caldivirga maquilingensis IC-167 chromosome, complete genome. (NC_009954)=NC_009954,NC_009954.1,gi|159040592|ref|NC_009954.1| -Campylobacter concisus 13826 plasmid pCCON16, complete sequence. (NC_009796)=NC_009796,NC_009796.1,gi|157149612|ref|NC_009796.1| -Campylobacter concisus 13826 plasmid pCCON31, complete sequence. (NC_009795)=NC_009795,NC_009795.1,gi|157149578|ref|NC_009795.1| -Campylobacter concisus 13826, complete genome. (NC_009802)=NC_009802,NC_009802.1,gi|157163852|ref|NC_009802.1| -Campylobacter curvus 525.92 chromosome, complete genome. (NC_009715)=NC_009715,NC_009715.1,gi|154173617|ref|NC_009715.1| -Campylobacter fetus subsp. fetus 82-40 chromosome, complete genome. (NC_008599)=NC_008599,NC_008599.1,gi|118474057|ref|NC_008599.1| -Campylobacter hominis ATCC BAA-381 plasmid pCH4, complete sequence. (NC_009713)=NC_009713,NC_009713.1,gi|154147860|ref|NC_009713.1| -Campylobacter hominis ATCC BAA-381, complete genome. (NC_009714)=NC_009714,NC_009714.1,gi|154147866|ref|NC_009714.1| -Campylobacter jejuni subsp. jejuni 81116, complete genome. (NC_009839)=NC_009839,NC_009839.1,gi|157414322|ref|NC_009839.1| -Campylobacter jejuni subsp. jejuni 81-176 plasmid pTet, complete (NC_008790)=NC_008790,NC_008790.1,gi|121999251|ref|NC_008790.1| -Campylobacter jejuni subsp. jejuni 81-176 plasmid pVir, complete (NC_008770)=NC_008770,NC_008770.1,gi|121582657|ref|NC_008770.1| -Campylobacter jejuni subsp. jejuni 81-176, complete genome. (NC_008787)=NC_008787,NC_008787.1,gi|121612099|ref|NC_008787.1| -Campylobacter jejuni subsp. jejuni IA3902 chromosome, complete (NC_017279)=NC_017279,NC_017279.1,gi|384447320|ref|NC_017279.1| -Campylobacter jejuni subsp. jejuni IA3902 plasmid pVir, complete (NC_017284)=NC_017284,NC_017284.1,gi|384448934|ref|NC_017284.1| -Campylobacter jejuni subsp. jejuni ICDCCJ07001 chromosome, complete (NC_014802)=NC_014802,NC_014802.1,gi|315123616|ref|NC_014802.1| -Campylobacter jejuni subsp. jejuni ICDCCJ07001 plasmid pTet, (NC_014801)=NC_014801,NC_014801.1,gi|315123578|ref|NC_014801.1| -Campylobacter jejuni subsp. jejuni M1 chromosome, complete genome. (NC_017280)=NC_017280,NC_017280.1,gi|384440681|ref|NC_017280.1| -Campylobacter jejuni subsp. jejuni NCTC 11168 chromosome, complete (NC_002163)=NC_002163,NC_002163.1,gi|15791399|ref|NC_002163.1| -Campylobacter jejuni RM1221, complete genome. (NC_003912)=NC_003912,NC_003912.7,gi|57236892|ref|NC_003912.7| -Campylobacter jejuni subsp. jejuni S3 chromosome, complete genome. (NC_017281)=NC_017281,NC_017281.1,gi|384442354|ref|NC_017281.1| -Campylobacter jejuni subsp. jejuni S3 plasmid pTet, complete (NC_017282)=NC_017282,NC_017282.1,gi|384442304|ref|NC_017282.1| -Campylobacter jejuni subsp. doylei 269.97 chromosome, complete (NC_009707)=NC_009707,NC_009707.1,gi|153950938|ref|NC_009707.1| -Campylobacter lari RM2100 megaplasmid pCL2100, complete sequence. (NC_012040)=NC_012040,NC_012040.1,gi|222778487|ref|NC_012040.1| -Campylobacter lari RM2100, complete genome. (NC_012039)=NC_012039,NC_012039.1,gi|222823046|ref|NC_012039.1| -Candidatus Accumulibacter phosphatis clade IIA str. UW-1 (NC_013194)=NC_013194,NC_013194.1,gi|257091663|ref|NC_013194.1| -Candidatus Accumulibacter phosphatis clade IIA str. UW-1 plasmid (NC_013190)=NC_013190,NC_013190.1,gi|257074450|ref|NC_013190.1| -Candidatus Accumulibacter phosphatis clade IIA str. UW-1 plasmid (NC_013191)=NC_013191,NC_013191.1,gi|257074491|ref|NC_013191.1| -Candidatus Accumulibacter phosphatis clade IIA str. UW-1 plasmid (NC_013193)=NC_013193,NC_013193.1,gi|257091505|ref|NC_013193.1| -Candidatus Amoebophilus asiaticus 5a2 chromosome, complete genome. (NC_010830)=NC_010830,NC_010830.1,gi|189501470|ref|NC_010830.1| -Candidatus Arthromitus sp. SFB-mouse-Japan, complete genome. (NC_015913)=NC_015913,NC_015913.1,gi|342731686|ref|NC_015913.1| -Candidatus Arthromitus sp. SFB-mouse-Yit, complete genome. (NC_017294)=NC_017294,NC_017294.1,gi|384455125|ref|NC_017294.1| -Candidatus Arthromitus sp. SFB-rat-Yit, complete genome. (NC_016012)=NC_016012,NC_016012.1,gi|347541852|ref|NC_016012.1| -Candidatus Azobacteroides pseudotrichonymphae genomovar. CFP2 (NC_011561)=NC_011561,NC_011561.1,gi|212550259|ref|NC_011561.1| -Candidatus Azobacteroides pseudotrichonymphae genomovar. CFP2 (NC_011562)=NC_011562,NC_011562.1,gi|212550288|ref|NC_011562.1| -Candidatus Azobacteroides pseudotrichonymphae genomovar. CFP2 (NC_011563)=NC_011563,NC_011563.1,gi|212550314|ref|NC_011563.1| -Candidatus Azobacteroides pseudotrichonymphae genomovar. CFP2 (NC_011564)=NC_011564,NC_011564.1,gi|212550319|ref|NC_011564.1| -Candidatus Azobacteroides pseudotrichonymphae genomovar. CFP2 (NC_011565)=NC_011565,NC_011565.1,gi|212550357|ref|NC_011565.1| -Candidatus Blochmannia floridanus chromosome, complete genome. (NC_005061)=NC_005061,NC_005061.1,gi|33519483|ref|NC_005061.1| -Candidatus Blochmannia pennsylvanicus str. BPEN chromosome, (NC_007292)=NC_007292,NC_007292.1,gi|71891793|ref|NC_007292.1| -Candidatus Blochmannia vafer str. BVAF chromosome, complete genome. (NC_014909)=NC_014909,NC_014909.2,gi|365823447|ref|NC_014909.2| -Candidatus Carsonella ruddii PV, complete genome. (NC_008512)=NC_008512,NC_008512.1,gi|116334902|ref|NC_008512.1| -Candidatus Chloracidobacterium thermophilum B chromosome chromosome (NC_016024)=NC_016024,NC_016024.1,gi|347753732|ref|NC_016024.1| -Candidatus Chloracidobacterium thermophilum B chromosome chromosome (NC_016025)=NC_016025,NC_016025.1,gi|347755961|ref|NC_016025.1| -Candidatus Cloacamonas acidaminovorans. (NS_000195)=NS_000195,NS_000195.1,gi|218960350|ref|NS_000195.1| -Candidatus Desulforudis audaxviator MP104C chromosome, complete (NC_010424)=NC_010424,NC_010424.1,gi|169830219|ref|NC_010424.1| -Candidatus Hamiltonella defensa 5AT (Acyrthosiphon pisum) plasmid (NC_012752)=NC_012752,NC_012752.1,gi|238899346|ref|NC_012752.1| -Candidatus Hamiltonella defensa 5AT (Acyrthosiphon pisum), complete (NC_012751)=NC_012751,NC_012751.1,gi|238897251|ref|NC_012751.1| -Candidatus Hodgkinia cicadicola Dsem chromosome, complete genome. (NC_012960)=NC_012960,NC_012960.1,gi|253795547|ref|NC_012960.1| -Candidatus Korarchaeum cryptofilum OPF8 chromosome, complete (NC_010482)=NC_010482,NC_010482.1,gi|170289627|ref|NC_010482.1| -Candidatus Koribacter versatilis Ellin345 chromosome, complete (NC_008009)=NC_008009,NC_008009.1,gi|94967031|ref|NC_008009.1| -Candidatus Liberibacter asiaticus str. psy62 chromosome, complete (NC_012985)=NC_012985,NC_012985.3,gi|346722692|ref|NC_012985.3| -Candidatus Liberibacter solanacearum CLso-ZC1 chromosome, complete (NC_014774)=NC_014774,NC_014774.1,gi|315121750|ref|NC_014774.1| -NC10 bacterium 'Dutch sediment', complete genome. (NC_013260)=NC_013260,NC_013260.1,gi|392373140|ref|NC_013260.1| -Candidatus Midichloria mitochondrii IricVA chromosome, complete (NC_015722)=NC_015722,NC_015722.1,gi|339319317|ref|NC_015722.1| -Candidatus Moranella endobia PCIT chromosome, complete genome. (NC_015735)=NC_015735,NC_015735.1,gi|339477722|ref|NC_015735.1| -Candidatus Nitrospira defluvii, complete genome. (NC_014355)=NC_014355,NC_014355.1,gi|302035394|ref|NC_014355.1| -Candidatus Pelagibacter sp. IMCC9063 chromosome, complete genome. (NC_015380)=NC_015380,NC_015380.1,gi|330812975|ref|NC_015380.1| -Candidatus Pelagibacter ubique HTCC1062 chromosome, complete (NC_007205)=NC_007205,NC_007205.1,gi|71082709|ref|NC_007205.1| -Candidatus Phytoplasma australiense, complete genome. (NC_010544)=NC_010544,NC_010544.1,gi|197294169|ref|NC_010544.1| -Candidatus Phytoplasma mali, complete genome. (NC_011047)=NC_011047,NC_011047.1,gi|194246403|ref|NC_011047.1| -Candidatus Protochlamydia amoebophila UWE25 chromosome, complete (NC_005861)=NC_005861,NC_005861.1,gi|46445634|ref|NC_005861.1| -Candidatus Puniceispirillum marinum IMCC1322 chromosome, complete (NC_014010)=NC_014010,NC_014010.1,gi|294083570|ref|NC_014010.1| -Candidatus Rickettsia amblyommii str. GAT-30V chromosome, complete (NC_017028)=NC_017028,NC_017028.1,gi|383311892|ref|NC_017028.1| -Candidatus Rickettsia amblyommii str. GAT-30V plasmid pMCE_1, (NC_017020)=NC_017020,NC_017020.1,gi|383327248|ref|NC_017020.1| -Candidatus Rickettsia amblyommii str. GAT-30V plasmid pMCE_2, (NC_017029)=NC_017029,NC_017029.1,gi|381214373|ref|NC_017029.1| -Candidatus Rickettsia amblyommii str. GAT-30V plasmid pMCE_3, (NC_017021)=NC_017021,NC_017021.1,gi|383327284|ref|NC_017021.1| -Candidatus Riesia pediculicola USDA chromosome, complete genome. (NC_014109)=NC_014109,NC_014109.1,gi|295698239|ref|NC_014109.1| -Candidatus Riesia pediculicola USDA plasmid pPAN, complete (NC_013962)=NC_013962,NC_013962.1,gi|292493920|ref|NC_013962.1| -Candidatus Ruthia magnifica str. Cm (Calyptogena magnifica), (NC_008610)=NC_008610,NC_008610.1,gi|118602060|ref|NC_008610.1| -Candidatus Solibacter usitatus Ellin6076 chromosome, complete (NC_008536)=NC_008536,NC_008536.1,gi|116619145|ref|NC_008536.1| -Candidatus Sulcia muelleri CARI chromosome, complete genome. (NC_014499)=NC_014499,NC_014499.1,gi|307128504|ref|NC_014499.1| -Candidatus Sulcia muelleri DMIN chromosome, complete genome. (NC_014004)=NC_014004,NC_014004.1,gi|293977746|ref|NC_014004.1| -Candidatus Sulcia muelleri GWSS, complete genome. (NC_010118)=NC_010118,NC_010118.1,gi|161833634|ref|NC_010118.1| -Candidatus Sulcia muelleri SMDSEM, complete genome. (NC_013123)=NC_013123,NC_013123.1,gi|256370581|ref|NC_013123.1| -Candidatus Tremblaya princeps PCIT chromosome, complete genome. (NC_015736)=NC_015736,NC_015736.1,gi|339478129|ref|NC_015736.1| -Candidatus Tremblaya princeps PCVAL chromosome, complete genome. (NC_017293)=NC_017293,NC_017293.1,gi|384455014|ref|NC_017293.1| -Candidatus Vesicomyosocius okutanii HA, complete genome. (NC_009465)=NC_009465,NC_009465.1,gi|148244169|ref|NC_009465.1| -Candidatus Zinderia insecticola CARI chromosome, complete genome. (NC_014497)=NC_014497,NC_014497.1,gi|307069503|ref|NC_014497.1| -Capnocytophaga canimorsus Cc5 chromosome, complete genome. (NC_015846)=NC_015846,NC_015846.1,gi|340620779|ref|NC_015846.1| -Capnocytophaga ochracea DSM 7271 chromosome, complete genome. (NC_013162)=NC_013162,NC_013162.1,gi|256818848|ref|NC_013162.1| -Carboxydothermus hydrogenoformans Z-2901 chromosome, complete (NC_007503)=NC_007503,NC_007503.1,gi|78042616|ref|NC_007503.1| -Carnobacterium sp. 17-4 chromosome, complete genome. (NC_015391)=NC_015391,NC_015391.1,gi|328956382|ref|NC_015391.1| -Carnobacterium sp. 17-4 plasmid pCAR50, complete sequence. (NC_015390)=NC_015390,NC_015390.1,gi|328958803|ref|NC_015390.1| -Catenulispora acidiphila DSM 44928 chromosome, complete genome. (NC_013131)=NC_013131,NC_013131.1,gi|256389232|ref|NC_013131.1| -Caulobacter sp. K31 chromosome, complete genome. (NC_010338)=NC_010338,NC_010338.1,gi|167643973|ref|NC_010338.1| -Caulobacter sp. K31 plasmid pCAUL01, complete sequence. (NC_010335)=NC_010335,NC_010335.1,gi|167621728|ref|NC_010335.1| -Caulobacter sp. K31 plasmid pCAUL02, complete sequence. (NC_010333)=NC_010333,NC_010333.1,gi|167621562|ref|NC_010333.1| -Caulobacter crescentus CB15 chromosome, complete genome. (NC_002696)=NC_002696,NC_002696.2,gi|16124256|ref|NC_002696.2| -Caulobacter crescentus NA1000 chromosome, complete genome. (NC_011916)=NC_011916,NC_011916.1,gi|221232939|ref|NC_011916.1| -Caulobacter segnis ATCC 21756 chromosome, complete genome. (NC_014100)=NC_014100,NC_014100.1,gi|295687459|ref|NC_014100.1| -Cellulomonas fimi ATCC 484 chromosome, complete genome. (NC_015514)=NC_015514,NC_015514.1,gi|332668532|ref|NC_015514.1| -Cellulomonas flavigena DSM 20109 chromosome, complete genome. (NC_014151)=NC_014151,NC_014151.1,gi|296127869|ref|NC_014151.1| -Cellulophaga algicola DSM 14237 chromosome, complete genome. (NC_014934)=NC_014934,NC_014934.1,gi|319951593|ref|NC_014934.1| -Cellulophaga lytica DSM 7489 chromosome, complete genome. (NC_015167)=NC_015167,NC_015167.1,gi|325284916|ref|NC_015167.1| -Cellvibrio japonicus Ueda107 chromosome, complete genome. (NC_010995)=NC_010995,NC_010995.1,gi|192358779|ref|NC_010995.1| -Cenarchaeum symbiosum A, complete genome. (NC_014820)=NC_014820,NC_014820.1,gi|315630472|ref|NC_014820.1| -Chelativorans sp. BNC1 chromosome, complete genome. (NC_008254)=NC_008254,NC_008254.1,gi|110632362|ref|NC_008254.1| -Chelativorans sp. BNC1 plasmid 3, complete sequence. (NC_008244)=NC_008244,NC_008244.1,gi|110347349|ref|NC_008244.1| -Mesorhizobium sp. BNC1 plasmid 1, complete sequence. (NC_008242)=NC_008242,NC_008242.1,gi|110346917|ref|NC_008242.1| -Mesorhizobium sp. BNC1 plasmid 2, complete sequence. (NC_008243)=NC_008243,NC_008243.1,gi|110347235|ref|NC_008243.1| -Chitinophaga pinensis DSM 2588 chromosome, complete genome. (NC_013132)=NC_013132,NC_013132.1,gi|256419057|ref|NC_013132.1| -Chlamydia muridarum Nigg plasmid pMoPn, complete sequence. (NC_002182)=NC_002182,NC_002182.1,gi|10957566|ref|NC_002182.1| -Chlamydia muridarum Nigg, complete genome. (NC_002620)=NC_002620,NC_002620.2,gi|29337300|ref|NC_002620.2| -Chlamydia trachomatis 434/Bu chromosome, complete genome. (NC_010287)=NC_010287,NC_010287.1,gi|166153973|ref|NC_010287.1| -Chlamydia trachomatis A2497, complete genome. (NC_016798)=NC_016798,NC_016798.1,gi|376282008|ref|NC_016798.1| -Chlamydia trachomatis A2497 chromosome, complete genome. (NC_017437)=NC_017437,NC_017437.1,gi|385269641|ref|NC_017437.1| -Chlamydia trachomatis A2497 plasmid0001, complete sequence. (NC_017438)=NC_017438,NC_017438.1,gi|385270623|ref|NC_017438.1| -Chlamydia trachomatis A/HAR-13 plasmid pCTA, complete sequence. (NC_007430)=NC_007430,NC_007430.1,gi|76789623|ref|NC_007430.1| -Chlamydia trachomatis A/HAR-13, complete genome. (NC_007429)=NC_007429,NC_007429.1,gi|76788711|ref|NC_007429.1| -Chlamydia trachomatis B/Jali20/OT chromosome, complete genome. (NC_012686)=NC_012686,NC_012686.1,gi|237802433|ref|NC_012686.1| -Chlamydia trachomatis B/TZ1A828/OT chromosome, complete genome. (NC_012687)=NC_012687,NC_012687.1,gi|237804348|ref|NC_012687.1| -Chlamydia trachomatis D-EC chromosome, complete genome. (NC_017434)=NC_017434,NC_017434.1,gi|385243207|ref|NC_017434.1| -Chlamydia trachomatis D-EC plasmid pCTDEC1, complete sequence. (NC_017435)=NC_017435,NC_017435.1,gi|385244078|ref|NC_017435.1| -Chlamydia trachomatis D-LC chromosome, complete genome. (NC_017436)=NC_017436,NC_017436.1,gi|385244087|ref|NC_017436.1| -Chlamydia trachomatis D-LC plasmid pCTDLC1, complete sequence. (NC_017433)=NC_017433,NC_017433.1,gi|385244958|ref|NC_017433.1| -Chlamydia trachomatis D/UW-3/CX, complete genome. (NC_000117)=NC_000117,NC_000117.1,gi|15604717|ref|NC_000117.1| -Chlamydia trachomatis E/11023 chromosome, complete genome. (NC_017431)=NC_017431,NC_017431.1,gi|385241358|ref|NC_017431.1| -Chlamydia trachomatis E/150 chromosome, complete genome. (NC_017439)=NC_017439,NC_017439.1,gi|385244967|ref|NC_017439.1| -Chlamydia trachomatis E/SW3, complete genome. (NC_017952)=NC_017952,NC_017952.1,gi|389858571|ref|NC_017952.1| -Chlamydia trachomatis F/SW4, complete genome. (NC_017951)=NC_017951,NC_017951.1,gi|389857697|ref|NC_017951.1| -Chlamydia trachomatis F/SW5, complete genome. (NC_017953)=NC_017953,NC_017953.1,gi|389859448|ref|NC_017953.1| -Chlamydia trachomatis G/11074 chromosome, complete genome. (NC_017440)=NC_017440,NC_017440.1,gi|385245895|ref|NC_017440.1| -Chlamydia trachomatis G/11222 chromosome, complete genome. (NC_017430)=NC_017430,NC_017430.1,gi|385240430|ref|NC_017430.1| -Chlamydia trachomatis G/9301 chromosome, complete genome. (NC_017432)=NC_017432,NC_017432.1,gi|385242285|ref|NC_017432.1| -Chlamydia trachomatis G/9768 chromosome, complete genome. (NC_017429)=NC_017429,NC_017429.1,gi|385239509|ref|NC_017429.1| -Chlamydia trachomatis L2b/UCH-1/proctitis chromosome, complete (NC_010280)=NC_010280,NC_010280.2,gi|352951305|ref|NC_010280.2| -Chlamydia trachomatis L2c chromosome, complete genome. (NC_015744)=NC_015744,NC_015744.1,gi|339625373|ref|NC_015744.1| -Chlamydia trachomatis Sweden2, complete genome. (NC_017441)=NC_017441,NC_017441.1,gi|386262357|ref|NC_017441.1| -Chlamydophila abortus S26/3, complete genome. (NC_004552)=NC_004552,NC_004552.2,gi|62184647|ref|NC_004552.2| -Chlamydophila caviae GPIC chromosome, complete genome. (NC_003361)=NC_003361,NC_003361.3,gi|29839769|ref|NC_003361.3| -Chlamydophila caviae GPIC plasmid pCpGP1, complete sequence. (NC_004720)=NC_004720,NC_004720.1,gi|29839220|ref|NC_004720.1| -Chlamydophila felis Fe/C-56 plasmid pCfe1, complete sequence. (NC_007900)=NC_007900,NC_007900.1,gi|89898813|ref|NC_007900.1| -Chlamydophila felis Fe/C-56, complete genome. (NC_007899)=NC_007899,NC_007899.1,gi|89897807|ref|NC_007899.1| -Chlamydophila pecorum E58 chromosome, complete genome. (NC_015408)=NC_015408,NC_015408.1,gi|330443755|ref|NC_015408.1| -Chlamydia phage CPAR39, complete genome. (NC_002180)=NC_002180,NC_002180.1,gi|9791176|ref|NC_002180.1| -Chlamydophila pneumoniae AR39, complete genome. (NC_002179)=NC_002179,NC_002179.2,gi|58021288|ref|NC_002179.2| -Chlamydophila pneumoniae CWL029 chromosome, complete genome. (NC_000922)=NC_000922,NC_000922.1,gi|15617929|ref|NC_000922.1| -Chlamydophila pneumoniae J138 chromosome, complete genome. (NC_002491)=NC_002491,NC_002491.1,gi|15835535|ref|NC_002491.1| -Chlamydophila pneumoniae LPCoLN chromosome, complete genome. (NC_017285)=NC_017285,NC_017285.1,gi|384448988|ref|NC_017285.1| -Chlamydophila pneumoniae LPCoLN plasmid unnamed, complete sequence. (NC_017286)=NC_017286,NC_017286.1,gi|384450086|ref|NC_017286.1| -Chlamydophila pneumoniae TW-183, complete genome. (NC_005043)=NC_005043,NC_005043.1,gi|33241335|ref|NC_005043.1| -Chlamydophila psittaci 01DC11 chromosome, complete genome. (NC_017289)=NC_017289,NC_017289.1,gi|384451106|ref|NC_017289.1| -Chlamydophila psittaci 02DC15 chromosome, complete genome. (NC_017292)=NC_017292,NC_017292.1,gi|384454035|ref|NC_017292.1| -Chlamydophila psittaci 08DC60 chromosome, complete genome. (NC_017290)=NC_017290,NC_017290.1,gi|384452082|ref|NC_017290.1| -Chlamydophila psittaci 6BC chromosome, complete genome. (NC_017287)=NC_017287,NC_017287.1,gi|384450095|ref|NC_017287.1| -Chlamydophila psittaci 6BC plasmid pCps6BC, complete sequence. (NC_017288)=NC_017288,NC_017288.1,gi|384451098|ref|NC_017288.1| -Chlamydophila psittaci 6BC chromosome, complete genome. (NC_015470)=NC_015470,NC_015470.1,gi|332286959|ref|NC_015470.1| -Chlamydophila psittaci 6BC plasmid p6BC, complete sequence. (NC_015217)=NC_015217,NC_015217.1,gi|332286950|ref|NC_015217.1| -Chlamydophila psittaci C19/98 chromosome, complete genome. (NC_017291)=NC_017291,NC_017291.1,gi|384453056|ref|NC_017291.1| -Chlamydophila psittaci RD1, complete genome. (NC_014796)=NC_014796,NC_014796.1,gi|392376213|ref|NC_014796.1| -Chlorobaculum parvum NCIB 8327 chromosome, complete genome. (NC_011027)=NC_011027,NC_011027.1,gi|193211676|ref|NC_011027.1| -Chlorobium chlorochromatii CaD3 chromosome, complete genome. (NC_007514)=NC_007514,NC_007514.1,gi|78187984|ref|NC_007514.1| -Chlorobium limicola DSM 245 chromosome, complete genome. (NC_010803)=NC_010803,NC_010803.1,gi|189345558|ref|NC_010803.1| -Chlorobium luteolum DSM 273 chromosome, complete genome. (NC_007512)=NC_007512,NC_007512.1,gi|78185892|ref|NC_007512.1| -Chlorobium phaeobacteroides BS1 chromosome, complete genome. (NC_010831)=NC_010831,NC_010831.1,gi|189499000|ref|NC_010831.1| -Chlorobium phaeobacteroides DSM 266 chromosome, complete genome. (NC_008639)=NC_008639,NC_008639.1,gi|119355857|ref|NC_008639.1| -Chlorobium phaeovibrioides DSM 265 chromosome, complete genome. (NC_009337)=NC_009337,NC_009337.1,gi|145218822|ref|NC_009337.1| -Chlorobium tepidum TLS chromosome, complete genome. (NC_002932)=NC_002932,NC_002932.3,gi|21672841|ref|NC_002932.3| -Chloroflexus sp. Y-400-fl chromosome, complete genome. (NC_012032)=NC_012032,NC_012032.1,gi|222523302|ref|NC_012032.1| -Chloroflexus aggregans DSM 9485 chromosome, complete genome. (NC_011831)=NC_011831,NC_011831.1,gi|219846956|ref|NC_011831.1| -Chloroflexus aurantiacus J-10-fl chromosome, complete genome. (NC_010175)=NC_010175,NC_010175.1,gi|163845603|ref|NC_010175.1| -Chloroherpeton thalassium ATCC 35110 chromosome, complete genome. (NC_011026)=NC_011026,NC_011026.1,gi|193213720|ref|NC_011026.1| -Chromobacterium violaceum ATCC 12472 chromosome, complete genome. (NC_005085)=NC_005085,NC_005085.1,gi|34495455|ref|NC_005085.1| -Chromohalobacter salexigens DSM 3043 chromosome, complete genome. (NC_007963)=NC_007963,NC_007963.1,gi|92112136|ref|NC_007963.1| -Citrobacter koseri ATCC BAA-895 chromosome, complete genome. (NC_009792)=NC_009792,NC_009792.1,gi|157144296|ref|NC_009792.1| -Citrobacter koseri ATCC BAA-895 plasmid pCKO2, complete sequence. (NC_009794)=NC_009794,NC_009794.1,gi|157149316|ref|NC_009794.1| -Citrobacter koseri ATCC BAA-895 plasmid pCKO3, complete sequence. (NC_009793)=NC_009793,NC_009793.1,gi|157149300|ref|NC_009793.1| -Citrobacter rodentium ICC168 plasmid pCROD1, complete sequence. (NC_013717)=NC_013717,NC_013717.1,gi|283777746|ref|NC_013717.1| -Citrobacter rodentium ICC168 plasmid pCROD2, complete sequence. (NC_013718)=NC_013718,NC_013718.1,gi|283488383|ref|NC_013718.1| -Citrobacter rodentium ICC168 plasmid pCROD3, complete sequence. (NC_013719)=NC_013719,NC_013719.1,gi|283454955|ref|NC_013719.1| -Citrobacter rodentium ICC168, complete genome. (NC_013716)=NC_013716,NC_013716.1,gi|283783779|ref|NC_013716.1| -Clavibacter michiganensis subsp. michiganensis NCPPB 382 (NC_009480)=NC_009480,NC_009480.1,gi|148271178|ref|NC_009480.1| -Clavibacter michiganensis subsp. michiganensis NCPPB 382 plasmid (NC_009478)=NC_009478,NC_009478.1,gi|148245183|ref|NC_009478.1| -Clavibacter michiganensis subsp. michiganensis NCPPB 382 plasmid (NC_009479)=NC_009479,NC_009479.1,gi|148271110|ref|NC_009479.1| -Clavibacter michiganensis subsp. sepedonicus chromosome, complete (NC_010407)=NC_010407,NC_010407.1,gi|170780462|ref|NC_010407.1| -Clavibacter michiganensis subsp. sepedonicus plasmid pCS1, complete (NC_010399)=NC_010399,NC_010399.1,gi|189016631|ref|NC_010399.1| -Clavibacter michiganensis subsp. sepedonicus plasmid pCSL1, (NC_010408)=NC_010408,NC_010408.1,gi|189016698|ref|NC_010408.1| -Clostridiales genomosp. BVAB3 str. UPII9-5 chromosome, complete (NC_013895)=NC_013895,NC_013895.2,gi|308513210|ref|NC_013895.2| -Clostridium sp. BNL1100 chromosome, complete genome. (NC_016791)=NC_016791,NC_016791.1,gi|376259380|ref|NC_016791.1| -Clostridium sp. SY8519, complete genome. (NC_015737)=NC_015737,NC_015737.1,gi|339441064|ref|NC_015737.1| -Clostridium acetobutylicum ATCC 824 chromosome, complete genome. (NC_003030)=NC_003030,NC_003030.1,gi|15893298|ref|NC_003030.1| -Clostridium acetobutylicum ATCC 824 plasmid pSOL1, complete (NC_001988)=NC_001988,NC_001988.2,gi|15004705|ref|NC_001988.2| -Clostridium acetobutylicum DSM 1731 chromosome, complete genome. (NC_015687)=NC_015687,NC_015687.1,gi|337735209|ref|NC_015687.1| -Clostridium acetobutylicum DSM 1731 plasmid pSMBa, complete (NC_015686)=NC_015686,NC_015686.1,gi|337735032|ref|NC_015686.1| -Clostridium acetobutylicum DSM 1731 plasmid pSMBb, complete (NC_015688)=NC_015688,NC_015688.1,gi|337738947|ref|NC_015688.1| -Clostridium acetobutylicum EA 2018 EA2018plasmid, complete (NC_017296)=NC_017296,NC_017296.1,gi|384456541|ref|NC_017296.1| -Clostridium acetobutylicum EA 2018 chromosome, complete genome. (NC_017295)=NC_017295,NC_017295.1,gi|384456718|ref|NC_017295.1| -Clostridium beijerinckii NCIMB 8052 chromosome, complete genome. (NC_009617)=NC_009617,NC_009617.1,gi|150014892|ref|NC_009617.1| -Clostridium botulinum A2 str. Kyoto chromosome, complete genome. (NC_012563)=NC_012563,NC_012563.1,gi|226947222|ref|NC_012563.1| -Clostridium botulinum A3 str. Loch Maree chromosome, complete (NC_010520)=NC_010520,NC_010520.1,gi|170758191|ref|NC_010520.1| -Clostridium botulinum A3 str. Loch Maree plasmid pCLK, complete (NC_010418)=NC_010418,NC_010418.1,gi|169834729|ref|NC_010418.1| -Clostridium botulinum A str. ATCC 19397 chromosome, complete (NC_009697)=NC_009697,NC_009697.1,gi|153930785|ref|NC_009697.1| -Clostridium botulinum A str. ATCC 3502 chromosome, complete genome. (NC_009495)=NC_009495,NC_009495.1,gi|148378011|ref|NC_009495.1| -Clostridium botulinum A str. ATCC 3502 plasmid pBOT3502, complete (NC_009496)=NC_009496,NC_009496.1,gi|148381586|ref|NC_009496.1| -Clostridium botulinum A str. Hall chromosome, complete genome. (NC_009698)=NC_009698,NC_009698.1,gi|153934468|ref|NC_009698.1| -Clostridium botulinum B1 str. Okra chromosome, complete genome. (NC_010516)=NC_010516,NC_010516.1,gi|170754211|ref|NC_010516.1| -Clostridium botulinum B1 str. Okra plasmid pCLD, complete sequence. (NC_010379)=NC_010379,NC_010379.1,gi|169834533|ref|NC_010379.1| -Clostridium botulinum BKT015925 chromosome, complete genome. (NC_015425)=NC_015425,NC_015425.1,gi|331268188|ref|NC_015425.1| -Clostridium botulinum BKT015925 plasmid p1BKT015925, complete (NC_015417)=NC_015417,NC_015417.1,gi|331270865|ref|NC_015417.1| -Clostridium botulinum BKT015925 plasmid p2BKT015925, complete (NC_015426)=NC_015426,NC_015426.1,gi|331270761|ref|NC_015426.1| -Clostridium botulinum BKT015925 plasmid p3BKT015925, complete (NC_015418)=NC_015418,NC_015418.1,gi|331271088|ref|NC_015418.1| -Clostridium botulinum BKT015925 plasmid p4BKT015925, complete (NC_015427)=NC_015427,NC_015427.1,gi|331270707|ref|NC_015427.1| -Clostridium botulinum BKT015925 plasmid p5BKT015925, complete (NC_015419)=NC_015419,NC_015419.1,gi|331268174|ref|NC_015419.1| -Clostridium botulinum B str. Eklund 17B chromosome, complete (NC_010674)=NC_010674,NC_010674.1,gi|187932320|ref|NC_010674.1| -Clostridium botulinum B str. Eklund 17B plasmid pCLL, complete (NC_010680)=NC_010680,NC_010680.1,gi|187935795|ref|NC_010680.1| -Clostridium botulinum Ba4 str. 657 chromosome, complete genome. (NC_012658)=NC_012658,NC_012658.1,gi|237793320|ref|NC_012658.1| -Clostridium botulinum Ba4 str. 657 plasmid pCLJ, complete sequence. (NC_012654)=NC_012654,NC_012654.1,gi|229587271|ref|NC_012654.1| -Clostridium botulinum Ba4 str. 657 plasmid pCLJ2, complete (NC_012657)=NC_012657,NC_012657.1,gi|229599876|ref|NC_012657.1| -Clostridium botulinum E3 str. Alaska E43 chromosome, complete (NC_010723)=NC_010723,NC_010723.1,gi|188587536|ref|NC_010723.1| -Clostridium botulinum F str. 230613 chromosome, complete genome. (NC_017297)=NC_017297,NC_017297.1,gi|384460459|ref|NC_017297.1| -Clostridium botulinum F str. 230613 plasmid pCBF, complete (NC_017298)=NC_017298,NC_017298.1,gi|384463962|ref|NC_017298.1| -Clostridium botulinum F str. Langeland chromosome, complete genome. (NC_009699)=NC_009699,NC_009699.1,gi|153937894|ref|NC_009699.1| -Clostridium botulinum F str. Langeland plasmid pCLI, complete (NC_009700)=NC_009700,NC_009700.1,gi|153941546|ref|NC_009700.1| -Clostridium botulinum H04402 065, complete genome. (NC_017299)=NC_017299,NC_017299.1,gi|387816237|ref|NC_017299.1| -Clostridium cellulolyticum H10 chromosome, complete genome. (NC_011898)=NC_011898,NC_011898.1,gi|220927459|ref|NC_011898.1| -Clostridium cellulovorans 743B chromosome, complete genome. (NC_014393)=NC_014393,NC_014393.1,gi|302872922|ref|NC_014393.1| -Clostridium clariflavum DSM 19732 chromosome, complete genome. (NC_016627)=NC_016627,NC_016627.1,gi|374294493|ref|NC_016627.1| -Clostridium difficile 2007855, complete genome. (NC_017178)=NC_017178,NC_017178.1,gi|383843666|ref|NC_017178.1| -Clostridium difficile 630 chromosome, complete genome. (NC_009089)=NC_009089,NC_009089.1,gi|126697566|ref|NC_009089.1| -Clostridium difficile 630 plasmid pCD630, complete sequence. (NC_008226)=NC_008226,NC_008226.1,gi|110666922|ref|NC_008226.1| -Clostridium difficile BI1 plasmid pCDBI1, complete sequence. (NC_017176)=NC_017176,NC_017176.1,gi|383843667|ref|NC_017176.1| -Clostridium difficile BI1, complete genome. (NC_017177)=NC_017177,NC_017177.1,gi|383843668|ref|NC_017177.1| -Clostridium difficile BI1, complete genome. (NC_017179)=NC_017179,NC_017179.1,gi|383843669|ref|NC_017179.1| -Clostridium difficile CD196 chromosome, complete genome. (NC_013315)=NC_013315,NC_013315.1,gi|260681769|ref|NC_013315.1| -Clostridium difficile CF5, complete genome. (NC_017173)=NC_017173,NC_017173.1,gi|383843664|ref|NC_017173.1| -Clostridium difficile M120, complete genome. (NC_017174)=NC_017174,NC_017174.1,gi|383843665|ref|NC_017174.1| -Clostridium difficile R20291 chromosome, complete genome. (NC_013316)=NC_013316,NC_013316.1,gi|260685375|ref|NC_013316.1| -Clostridium kluyveri DSM 555 chromosome, complete genome. (NC_009706)=NC_009706,NC_009706.1,gi|153952670|ref|NC_009706.1| -Clostridium kluyveri DSM 555 plasmid pCKL555A, complete sequence. (NC_009466)=NC_009466,NC_009466.1,gi|148245107|ref|NC_009466.1| -Clostridium kluyveri NBRC 12016 plasmid pCKL1, complete sequence. (NC_011836)=NC_011836,NC_011836.1,gi|219684028|ref|NC_011836.1| -Clostridium kluyveri NBRC 12016, complete genome. (NC_011837)=NC_011837,NC_011837.1,gi|219853343|ref|NC_011837.1| -Clostridium lentocellum DSM 5427 chromosome, complete genome. (NC_015275)=NC_015275,NC_015275.1,gi|326789139|ref|NC_015275.1| -Clostridium ljungdahlii DSM 13528 chromosome, complete genome. (NC_014328)=NC_014328,NC_014328.1,gi|300853232|ref|NC_014328.1| -Clostridium novyi NT chromosome, complete genome. (NC_008593)=NC_008593,NC_008593.1,gi|118442852|ref|NC_008593.1| -Clostridium perfringens str. 13 plasmid pCP13, complete sequence. (NC_003042)=NC_003042,NC_003042.1,gi|15081479|ref|NC_003042.1| -Clostridium perfringens str. 13, complete genome. (NC_003366)=NC_003366,NC_003366.1,gi|18308982|ref|NC_003366.1| -Clostridium perfringens ATCC 13124 chromosome, complete genome. (NC_008261)=NC_008261,NC_008261.1,gi|110798562|ref|NC_008261.1| -Clostridium perfringens SM101 chromosome, complete genome. (NC_008262)=NC_008262,NC_008262.1,gi|110801439|ref|NC_008262.1| -Clostridium perfringens SM101 plasmid pSM101A, complete sequence. (NC_008263)=NC_008263,NC_008263.1,gi|110803998|ref|NC_008263.1| -Clostridium perfringens SM101 plasmid pSM101B, complete sequence. (NC_008264)=NC_008264,NC_008264.1,gi|110804009|ref|NC_008264.1| -Clostridium phage phiSM101 chromosome, complete genome. (NC_008265)=NC_008265,NC_008265.1,gi|110804020|ref|NC_008265.1| -Clostridium phytofermentans ISDg chromosome, complete genome. (NC_010001)=NC_010001,NC_010001.1,gi|160878162|ref|NC_010001.1| -Clostridium saccharolyticum WM1 chromosome, complete genome. (NC_014376)=NC_014376,NC_014376.1,gi|302384444|ref|NC_014376.1| -Clostridium sticklandii DSM 519 chromosome, complete genome. (NC_014614)=NC_014614,NC_014614.1,gi|310657316|ref|NC_014614.1| -Clostridium tetani E88 chromosome, complete genome. (NC_004557)=NC_004557,NC_004557.1,gi|28209834|ref|NC_004557.1| -Clostridium tetani E88 plasmid pE88, complete sequence. (NC_004565)=NC_004565,NC_004565.1,gi|28373131|ref|NC_004565.1| -Clostridium thermocellum ATCC 27405 chromosome, complete genome. (NC_009012)=NC_009012,NC_009012.1,gi|125972525|ref|NC_009012.1| -Clostridium thermocellum DSM 1313 chromosome, complete genome. (NC_017304)=NC_017304,NC_017304.1,gi|385777386|ref|NC_017304.1| -Collimonas fungivorans Ter331 chromosome, complete genome. (NC_015856)=NC_015856,NC_015856.1,gi|340785197|ref|NC_015856.1| -Colwellia psychrerythraea 34H chromosome, complete genome. (NC_003910)=NC_003910,NC_003910.7,gi|71277742|ref|NC_003910.7| -Comamonas testosteroni CNB-2 chromosome, complete genome. (NC_013446)=NC_013446,NC_013446.1,gi|264676136|ref|NC_013446.1| -Conexibacter woesei DSM 14684 chromosome, complete genome. (NC_013739)=NC_013739,NC_013739.1,gi|284041471|ref|NC_013739.1| -Coprothermobacter proteolyticus DSM 5265 chromosome, complete (NC_011295)=NC_011295,NC_011295.1,gi|206895078|ref|NC_011295.1| -Coraliomargarita akajimensis DSM 45221 chromosome, complete genome. (NC_014008)=NC_014008,NC_014008.1,gi|294053541|ref|NC_014008.1| -Corallococcus coralloides DSM 2259 chromosome, complete genome. (NC_017030)=NC_017030,NC_017030.1,gi|383452024|ref|NC_017030.1| -Coriobacterium glomerans PW2 chromosome, complete genome. (NC_015389)=NC_015389,NC_015389.1,gi|328954613|ref|NC_015389.1| -Corynebacterium aurimucosum ATCC 700975 plasmid pET44827, complete (NC_010813)=NC_010813,NC_010813.1,gi|189458505|ref|NC_010813.1| -Corynebacterium aurimucosum ATCC 700975, complete genome. (NC_012590)=NC_012590,NC_012590.1,gi|227831830|ref|NC_012590.1| -Corynebacterium diphtheriae 241 chromosome, complete genome. (NC_016782)=NC_016782,NC_016782.1,gi|375289729|ref|NC_016782.1| -Corynebacterium diphtheriae 31A chromosome, complete genome. (NC_016799)=NC_016799,NC_016799.1,gi|376283503|ref|NC_016799.1| -Corynebacterium diphtheriae BH8 chromosome, complete genome. (NC_016800)=NC_016800,NC_016800.1,gi|376286528|ref|NC_016800.1| -Corynebacterium diphtheriae C7 (beta) chromosome, complete genome. (NC_016801)=NC_016801,NC_016801.1,gi|376289208|ref|NC_016801.1| -Corynebacterium diphtheriae CDCE 8392 chromosome, complete genome. (NC_016785)=NC_016785,NC_016785.1,gi|376241700|ref|NC_016785.1| -Corynebacterium diphtheriae HC01 chromosome, complete genome. (NC_016786)=NC_016786,NC_016786.1,gi|376244562|ref|NC_016786.1| -Corynebacterium diphtheriae HC02 chromosome, complete genome. (NC_016802)=NC_016802,NC_016802.1,gi|376292118|ref|NC_016802.1| -Corynebacterium diphtheriae HC03 chromosome, complete genome. (NC_016787)=NC_016787,NC_016787.1,gi|376250168|ref|NC_016787.1| -Corynebacterium diphtheriae HC04 chromosome, complete genome. (NC_016788)=NC_016788,NC_016788.1,gi|376247367|ref|NC_016788.1| -Corynebacterium diphtheriae INCA 402 chromosome, complete genome. (NC_016783)=NC_016783,NC_016783.1,gi|375291975|ref|NC_016783.1| -Corynebacterium diphtheriae NCTC 13129 chromosome, complete genome. (NC_002935)=NC_002935,NC_002935.2,gi|38232642|ref|NC_002935.2| -Corynebacterium diphtheriae PW8 chromosome, complete genome. (NC_016789)=NC_016789,NC_016789.1,gi|376253128|ref|NC_016789.1| -Corynebacterium diphtheriae VA01 chromosome, complete genome. (NC_016790)=NC_016790,NC_016790.1,gi|376256018|ref|NC_016790.1| -Corynebacterium efficiens YS-314 chromosome, complete genome. (NC_004369)=NC_004369,NC_004369.1,gi|25026556|ref|NC_004369.1| -Corynebacterium efficiens YS-314 plasmid pCE2, complete sequence. (NC_004319)=NC_004319,NC_004319.1,gi|23577970|ref|NC_004319.1| -Corynebacterium efficiens YS-314 plasmid pCE3, complete sequence. (NC_004320)=NC_004320,NC_004320.1,gi|23577986|ref|NC_004320.1| -Corynebacterium glutamicum ATCC 13032, complete genome. (NC_003450)=NC_003450,NC_003450.3,gi|58036263|ref|NC_003450.3| -Corynebacterium glutamicum ATCC 13032, complete genome. (NC_006958)=NC_006958,NC_006958.1,gi|62388892|ref|NC_006958.1| -Corynebacterium glutamicum R chromosome, complete genome. (NC_009342)=NC_009342,NC_009342.1,gi|145294042|ref|NC_009342.1| -Corynebacterium glutamicum R plasmid pCGR1, complete sequence. (NC_009343)=NC_009343,NC_009343.1,gi|145297095|ref|NC_009343.1| -Corynebacterium jeikeium K411 chromosome, complete genome. (NC_007164)=NC_007164,NC_007164.1,gi|68535062|ref|NC_007164.1| -Corynebacterium jeikeium K411 plasmid pKW4, complete sequence. (NC_003080)=NC_003080,NC_003080.1,gi|15320554|ref|NC_003080.1| -Corynebacterium kroppenstedtii DSM 44385 chromosome, complete (NC_012704)=NC_012704,NC_012704.1,gi|237784637|ref|NC_012704.1| -Corynebacterium pseudotuberculosis 1002 chromosome, complete (NC_017300)=NC_017300,NC_017300.1,gi|384503605|ref|NC_017300.1| -Corynebacterium pseudotuberculosis 1/06-A chromosome, complete (NC_017308)=NC_017308,NC_017308.1,gi|387139674|ref|NC_017308.1| -Corynebacterium pseudotuberculosis 258 chromosome, complete genome. (NC_017945)=NC_017945,NC_017945.1,gi|389849360|ref|NC_017945.1| -Corynebacterium pseudotuberculosis 267 chromosome, complete genome. (NC_017462)=NC_017462,NC_017462.1,gi|385806437|ref|NC_017462.1| -Corynebacterium pseudotuberculosis 316 chromosome, complete genome. (NC_016932)=NC_016932,NC_016932.1,gi|379714283|ref|NC_016932.1| -Corynebacterium pseudotuberculosis 31 chromosome, complete genome. (NC_017730)=NC_017730,NC_017730.1,gi|386739353|ref|NC_017730.1| -Corynebacterium pseudotuberculosis 3/99-5 chromosome, complete (NC_016781)=NC_016781,NC_016781.1,gi|375287586|ref|NC_016781.1| -Corynebacterium pseudotuberculosis 42/02-A chromosome, complete (NC_017306)=NC_017306,NC_017306.1,gi|387135561|ref|NC_017306.1| -Corynebacterium pseudotuberculosis C231 chromosome, complete (NC_017301)=NC_017301,NC_017301.1,gi|384505696|ref|NC_017301.1| -Corynebacterium pseudotuberculosis CIP 52.97 chromosome, complete (NC_017307)=NC_017307,NC_017307.1,gi|387137613|ref|NC_017307.1| -Corynebacterium pseudotuberculosis Cp162 chromosome, complete (NC_018019)=NC_018019,NC_018019.1,gi|392399583|ref|NC_018019.1| -Corynebacterium pseudotuberculosis FRC41 chromosome, complete (NC_014329)=NC_014329,NC_014329.1,gi|300857417|ref|NC_014329.1| -Corynebacterium pseudotuberculosis I19 chromosome, complete genome. (NC_017303)=NC_017303,NC_017303.1,gi|384507788|ref|NC_017303.1| -Corynebacterium pseudotuberculosis P54B96 chromosome, complete (NC_017031)=NC_017031,NC_017031.1,gi|383313191|ref|NC_017031.1| -Corynebacterium pseudotuberculosis PAT10 chromosome, complete (NC_017305)=NC_017305,NC_017305.1,gi|384509884|ref|NC_017305.1| -Corynebacterium resistens DSM 45100 chromosome, complete genome. (NC_015673)=NC_015673,NC_015673.1,gi|336324561|ref|NC_015673.1| -Corynebacterium ulcerans 0102, complete genome. (NC_018101)=NC_018101,NC_018101.1,gi|397652752|ref|NC_018101.1| -Corynebacterium ulcerans 809 chromosome, complete genome. (NC_017317)=NC_017317,NC_017317.1,gi|384514544|ref|NC_017317.1| -Corynebacterium ulcerans BR-AD22 chromosome, complete genome. (NC_015683)=NC_015683,NC_015683.1,gi|337289620|ref|NC_015683.1| -Corynebacterium urealyticum DSM 7109 chromosome, complete genome. (NC_010545)=NC_010545,NC_010545.1,gi|172039680|ref|NC_010545.1| -Corynebacterium variabile DSM 44702 chromosome, complete genome. (NC_015859)=NC_015859,NC_015859.1,gi|340792956|ref|NC_015859.1| -Coxiella burnetii CbuG_Q212 chromosome, complete genome. (NC_011527)=NC_011527,NC_011527.1,gi|212211668|ref|NC_011527.1| -Coxiella burnetii CbuK_Q154 chromosome, complete genome. (NC_011528)=NC_011528,NC_011528.1,gi|212217688|ref|NC_011528.1| -Coxiella burnetii CbuK_Q154 plasmid pQpRS_K_Q154, complete (NC_011526)=NC_011526,NC_011526.1,gi|212208405|ref|NC_011526.1| -Coxiella burnetii Dugway 5J108-111 chromosome, complete genome. (NC_009727)=NC_009727,NC_009727.1,gi|154705721|ref|NC_009727.1| -Coxiella burnetii Dugway 5J108-111 plasmid pQpDG, complete (NC_009726)=NC_009726,NC_009726.1,gi|154688247|ref|NC_009726.1| -Coxiella burnetii RSA 331 chromosome, complete genome. (NC_010117)=NC_010117,NC_010117.1,gi|161829703|ref|NC_010117.1| -Coxiella burnetii RSA 331 plasmid QpH1, complete sequence. (NC_010115)=NC_010115,NC_010115.1,gi|161789063|ref|NC_010115.1| -Coxiella burnetii RSA 493 chromosome, complete genome. (NC_002971)=NC_002971,NC_002971.3,gi|77358712|ref|NC_002971.3| -Coxiella burnetii RSA 493 plasmid pQpH1, complete sequence. (NC_004704)=NC_004704,NC_004704.1,gi|29648114|ref|NC_004704.1| -Croceibacter atlanticus HTCC2559 chromosome, complete genome. (NC_014230)=NC_014230,NC_014230.1,gi|298206591|ref|NC_014230.1| -Cronobacter sakazakii ATCC BAA-894 chromosome, complete genome. (NC_009778)=NC_009778,NC_009778.1,gi|156932229|ref|NC_009778.1| -Cronobacter sakazakii ATCC BAA-894 plasmid pESA2, complete (NC_009779)=NC_009779,NC_009779.1,gi|156936507|ref|NC_009779.1| -Cronobacter sakazakii ATCC BAA-894 plasmid pESA3, complete (NC_009780)=NC_009780,NC_009780.1,gi|156936546|ref|NC_009780.1| -Cronobacter sakazakii ES15 chromosome, complete genome. (NC_017933)=NC_017933,NC_017933.1,gi|389839000|ref|NC_017933.1| -Cronobacter turicensis z3032 chromosome, complete genome. (NC_013282)=NC_013282,NC_013282.2,gi|325295716|ref|NC_013282.2| -Cronobacter turicensis z3032 plasmid pCTU1, complete sequence. (NC_013283)=NC_013283,NC_013283.1,gi|260424375|ref|NC_013283.1| -Cronobacter turicensis z3032 plasmid pCTU2, complete sequence. (NC_013284)=NC_013284,NC_013284.1,gi|260585138|ref|NC_013284.1| -Cronobacter turicensis z3032 plasmid pCTU3, complete sequence. (NC_013285)=NC_013285,NC_013285.1,gi|260600006|ref|NC_013285.1| -Cryptobacterium curtum DSM 15641 chromosome, complete genome. (NC_013170)=NC_013170,NC_013170.1,gi|256826460|ref|NC_013170.1| -Cupriavidus metallidurans CH34 chromosome, complete genome. (NC_007973)=NC_007973,NC_007973.1,gi|94308945|ref|NC_007973.1| -Cupriavidus metallidurans CH34 megaplasmid, complete sequence. (NC_007974)=NC_007974,NC_007974.2,gi|291481467|ref|NC_007974.2| -Cupriavidus metallidurans CH34 plasmid pMOL28, complete sequence. (NC_007972)=NC_007972,NC_007972.2,gi|291434858|ref|NC_007972.2| -Cupriavidus metallidurans CH34 plasmid pMOL30, complete sequence. (NC_007971)=NC_007971,NC_007971.2,gi|291464753|ref|NC_007971.2| -Cupriavidus necator N-1 chromosome 1, complete sequence. (NC_015726)=NC_015726,NC_015726.1,gi|339324158|ref|NC_015726.1| -Cupriavidus necator N-1 chromosome 2, complete sequence. (NC_015723)=NC_015723,NC_015723.1,gi|339321330|ref|NC_015723.1| -Cupriavidus necator N-1 plasmid BB1p, complete sequence. (NC_015727)=NC_015727,NC_015727.1,gi|339327781|ref|NC_015727.1| -Cupriavidus necator N-1 plasmid BB2p, complete sequence. (NC_015724)=NC_015724,NC_015724.1,gi|339323774|ref|NC_015724.1| -Cupriavidus taiwanensis LMG 19424 chromosome 1, complete sequence. (NC_010528)=NC_010528,NC_010528.1,gi|188590795|ref|NC_010528.1| -Cupriavidus taiwanensis LMG 19424 chromosome 2, complete sequence. (NC_010530)=NC_010530,NC_010530.1,gi|188591847|ref|NC_010530.1| -Cupriavidus taiwanensis plasmid pRALTA, complete sequence. (NC_010529)=NC_010529,NC_010529.1,gi|188591327|ref|NC_010529.1| -Cyanothece sp. ATCC 51142 chromosome circular, complete sequence. (NC_010546)=NC_010546,NC_010546.1,gi|172034917|ref|NC_010546.1| -Cyanothece sp. ATCC 51142 chromosome linear, complete sequence. (NC_010547)=NC_010547,NC_010547.1,gi|172054853|ref|NC_010547.1| -Cyanothece sp. ATCC 51142 plasmid A, complete sequence. (NC_010539)=NC_010539,NC_010539.1,gi|172034820|ref|NC_010539.1| -Cyanothece sp. ATCC 51142 plasmid B, complete sequence. (NC_010541)=NC_010541,NC_010541.1,gi|172034859|ref|NC_010541.1| -Cyanothece sp. ATCC 51142 plasmid C, complete sequence. (NC_010542)=NC_010542,NC_010542.1,gi|172034885|ref|NC_010542.1| -Cyanothece sp. ATCC 51142 plasmid D, complete sequence. (NC_010543)=NC_010543,NC_010543.1,gi|172034905|ref|NC_010543.1| -Cyanothece sp. PCC 7424 chromosome, complete genome. (NC_011729)=NC_011729,NC_011729.1,gi|218437013|ref|NC_011729.1| -Cyanothece sp. PCC 7424 plasmid pP742401, complete sequence. (NC_011738)=NC_011738,NC_011738.1,gi|218442611|ref|NC_011738.1| -Cyanothece sp. PCC 7424 plasmid pP742402, complete sequence. (NC_011737)=NC_011737,NC_011737.1,gi|218442435|ref|NC_011737.1| -Cyanothece sp. PCC 7424 plasmid pP742403, complete sequence. (NC_011730)=NC_011730,NC_011730.1,gi|218442241|ref|NC_011730.1| -Cyanothece sp. PCC 7424 plasmid pP742404, complete sequence. (NC_011732)=NC_011732,NC_011732.1,gi|218442305|ref|NC_011732.1| -Cyanothece sp. PCC 7424 plasmid pP742405, complete sequence. (NC_011733)=NC_011733,NC_011733.1,gi|218442325|ref|NC_011733.1| -Cyanothece sp. PCC 7424 plasmid pP742406, complete sequence. (NC_011734)=NC_011734,NC_011734.1,gi|218442342|ref|NC_011734.1| -Cyanothece sp. PCC 7425 chromosome, complete genome. (NC_011884)=NC_011884,NC_011884.1,gi|220905643|ref|NC_011884.1| -Cyanothece sp. PCC 7425 plasmid pP742501, complete sequence. (NC_011880)=NC_011880,NC_011880.1,gi|219883096|ref|NC_011880.1| -Cyanothece sp. PCC 7425 plasmid pP742502, complete sequence. (NC_011885)=NC_011885,NC_011885.1,gi|220910610|ref|NC_011885.1| -Cyanothece sp. PCC 7425 plasmid pP742503, complete sequence. (NC_011882)=NC_011882,NC_011882.1,gi|219883409|ref|NC_011882.1| -Cyanothece sp. PCC 7822 chromosome, complete genome. (NC_014501)=NC_014501,NC_014501.1,gi|307149945|ref|NC_014501.1| -Cyanothece sp. PCC 7822 plasmid Cy782201, complete sequence. (NC_014533)=NC_014533,NC_014533.1,gi|307591951|ref|NC_014533.1| -Cyanothece sp. PCC 7822 plasmid Cy782202, complete sequence. (NC_014534)=NC_014534,NC_014534.1,gi|307591289|ref|NC_014534.1| -Cyanothece sp. PCC 7822 plasmid Cy782203, complete sequence. (NC_014502)=NC_014502,NC_014502.1,gi|307149708|ref|NC_014502.1| -Cyanothece sp. PCC 7822 plasmid Cy782204, complete sequence. (NC_014503)=NC_014503,NC_014503.1,gi|307149679|ref|NC_014503.1| -Cyanothece sp. PCC 7822 plasmid Cy782205, complete sequence. (NC_014504)=NC_014504,NC_014504.1,gi|307149645|ref|NC_014504.1| -Cyanothece sp. PCC 7822 plasmid Cy782206, complete sequence. (NC_014535)=NC_014535,NC_014535.1,gi|307591243|ref|NC_014535.1| -Cyanothece sp. PCC 8801 chromosome, complete genome. (NC_011726)=NC_011726,NC_011726.1,gi|218244892|ref|NC_011726.1| -Cyanothece sp. PCC 8801 plasmid pP880101, complete sequence. (NC_011721)=NC_011721,NC_011721.1,gi|218203844|ref|NC_011721.1| -Cyanothece sp. PCC 8801 plasmid pP880102, complete sequence. (NC_011723)=NC_011723,NC_011723.1,gi|218203933|ref|NC_011723.1| -Cyanothece sp. PCC 8801 plasmid pP880103, complete sequence. (NC_011727)=NC_011727,NC_011727.1,gi|218249153|ref|NC_011727.1| -Cyanothece sp. PCC 8802 chromosome, complete genome. (NC_013161)=NC_013161,NC_013161.1,gi|257057919|ref|NC_013161.1| -Cyanothece sp. PCC 8802 plasmid pP880201, complete sequence. (NC_013160)=NC_013160,NC_013160.1,gi|256818682|ref|NC_013160.1| -Cyanothece sp. PCC 8802 plasmid pP880202, complete sequence. (NC_013163)=NC_013163,NC_013163.1,gi|257062240|ref|NC_013163.1| -Cyanothece sp. PCC 8802 plasmid pP880203, complete sequence. (NC_013167)=NC_013167,NC_013167.1,gi|256823861|ref|NC_013167.1| -Cyanothece sp. PCC 8802 plasmid pP880204, complete sequence. (NC_013168)=NC_013168,NC_013168.1,gi|256823891|ref|NC_013168.1| -Cyclobacterium marinum DSM 745 chromosome, complete genome. (NC_015914)=NC_015914,NC_015914.1,gi|343082721|ref|NC_015914.1| -Cytophaga hutchinsonii ATCC 33406 chromosome, complete genome. (NC_008255)=NC_008255,NC_008255.1,gi|110636427|ref|NC_008255.1| -Dechloromonas aromatica RCB, complete genome. (NC_007298)=NC_007298,NC_007298.1,gi|71905642|ref|NC_007298.1| -Dechlorosoma suillum PS chromosome, complete genome. (NC_016616)=NC_016616,NC_016616.1,gi|372486701|ref|NC_016616.1| -Deferribacter desulfuricans SSM1 megaplasmid pDF308, complete (NC_013940)=NC_013940,NC_013940.1,gi|291280551|ref|NC_013940.1| -Deferribacter desulfuricans SSM1, complete genome. (NC_013939)=NC_013939,NC_013939.1,gi|291278433|ref|NC_013939.1| -Dehalococcoides sp. BAV1 chromosome, complete genome. (NC_009455)=NC_009455,NC_009455.1,gi|147668652|ref|NC_009455.1| -Dehalococcoides sp. CBDB1 chromosome, complete genome. (NC_007356)=NC_007356,NC_007356.1,gi|73747956|ref|NC_007356.1| -Dehalococcoides sp. GT chromosome, complete genome. (NC_013890)=NC_013890,NC_013890.1,gi|289431955|ref|NC_013890.1| -Dehalococcoides sp. VS chromosome, complete genome. (NC_013552)=NC_013552,NC_013552.1,gi|270307451|ref|NC_013552.1| -Dehalococcoides ethenogenes 195, complete genome. (NC_002936)=NC_002936,NC_002936.3,gi|57233530|ref|NC_002936.3| -Dehalogenimonas lykanthroporepellens BL-DC-9 chromosome, complete (NC_014314)=NC_014314,NC_014314.1,gi|300087139|ref|NC_014314.1| -Deinococcus deserti VCD115 chromosome, complete genome. (NC_012526)=NC_012526,NC_012526.1,gi|226354810|ref|NC_012526.1| -Deinococcus deserti VCD115 plasmid 1, complete sequence. (NC_012527)=NC_012527,NC_012527.1,gi|226357404|ref|NC_012527.1| -Deinococcus deserti VCD115 plasmid 2, complete sequence. (NC_012529)=NC_012529,NC_012529.1,gi|226358014|ref|NC_012529.1| -Deinococcus deserti VCD115 plasmid 3, complete sequence. (NC_012528)=NC_012528,NC_012528.1,gi|226357666|ref|NC_012528.1| -Deinococcus geothermalis DSM 11300 plasmid pDGEO01, complete (NC_008010)=NC_008010,NC_008010.2,gi|113706807|ref|NC_008010.2| -Deinococcus geothermalis DSM 11300 plasmid pDGEO02, complete (NC_009939)=NC_009939,NC_009939.1,gi|158421418|ref|NC_009939.1| -Deinococcus geothermalis DSM 11300, complete genome. (NC_008025)=NC_008025,NC_008025.1,gi|94984109|ref|NC_008025.1| -Deinococcus gobiensis I-0 chromosome, complete genome. (NC_017790)=NC_017790,NC_017790.1,gi|386855208|ref|NC_017790.1| -Deinococcus gobiensis I-0 plasmid P1, complete sequence. (NC_017805)=NC_017805,NC_017805.1,gi|386858239|ref|NC_017805.1| -Deinococcus gobiensis I-0 plasmid P2, complete sequence. (NC_017791)=NC_017791,NC_017791.1,gi|386854604|ref|NC_017791.1| -Deinococcus gobiensis I-0 plasmid P3, complete sequence. (NC_017771)=NC_017771,NC_017771.1,gi|386854276|ref|NC_017771.1| -Deinococcus gobiensis I-0 plasmid P4, complete sequence. (NC_017792)=NC_017792,NC_017792.1,gi|386858168|ref|NC_017792.1| -Deinococcus gobiensis I-0 plasmid P5, complete sequence. (NC_017806)=NC_017806,NC_017806.1,gi|386855128|ref|NC_017806.1| -Deinococcus gobiensis I-0 plasmid P6, complete sequence. (NC_017793)=NC_017793,NC_017793.1,gi|386854559|ref|NC_017793.1| -Deinococcus maricopensis DSM 21211 chromosome, complete genome. (NC_014958)=NC_014958,NC_014958.1,gi|320332618|ref|NC_014958.1| -Deinococcus proteolyticus MRP chromosome, complete genome. (NC_015161)=NC_015161,NC_015161.1,gi|325282255|ref|NC_015161.1| -Deinococcus proteolyticus MRP plasmid pDEIPR01, complete sequence. (NC_015169)=NC_015169,NC_015169.1,gi|325284551|ref|NC_015169.1| -Deinococcus proteolyticus MRP plasmid pDEIPR02, complete sequence. (NC_015162)=NC_015162,NC_015162.1,gi|325284231|ref|NC_015162.1| -Deinococcus proteolyticus MRP plasmid pDEIPR03, complete sequence. (NC_015170)=NC_015170,NC_015170.1,gi|325284806|ref|NC_015170.1| -Deinococcus proteolyticus MRP plasmid pDEIPR04, complete sequence. (NC_015163)=NC_015163,NC_015163.1,gi|325284457|ref|NC_015163.1| -Deinococcus radiodurans R1 chromosome 1, complete sequence. (NC_001263)=NC_001263,NC_001263.1,gi|15805042|ref|NC_001263.1| -Deinococcus radiodurans R1 chromosome 2, complete sequence. (NC_001264)=NC_001264,NC_001264.1,gi|15807672|ref|NC_001264.1| -Deinococcus radiodurans R1 plasmid CP1, complete sequence. (NC_000959)=NC_000959,NC_000959.1,gi|10957530|ref|NC_000959.1| -Deinococcus radiodurans R1 plasmid MP1, complete sequence. (NC_000958)=NC_000958,NC_000958.1,gi|10957398|ref|NC_000958.1| -Delftia sp. Cs1-4 chromosome, complete genome. (NC_015563)=NC_015563,NC_015563.1,gi|333911667|ref|NC_015563.1| -Delftia acidovorans SPH-1 chromosome, complete genome. (NC_010002)=NC_010002,NC_010002.1,gi|160895450|ref|NC_010002.1| -Denitrovibrio acetiphilus DSM 12809 chromosome, complete genome. (NC_013943)=NC_013943,NC_013943.1,gi|291285947|ref|NC_013943.1| -Desulfarculus baarsii DSM 2075 chromosome, complete genome. (NC_014365)=NC_014365,NC_014365.1,gi|302341444|ref|NC_014365.1| -Desulfatibacillum alkenivorans AK-01 chromosome, complete genome. (NC_011768)=NC_011768,NC_011768.1,gi|218777860|ref|NC_011768.1| -Desulfitobacterium dehalogenans ATCC 51507 chromosome, complete (NC_018017)=NC_018017,NC_018017.1,gi|392391692|ref|NC_018017.1| -Desulfitobacterium hafniense DCB-2 chromosome, complete genome. (NC_011830)=NC_011830,NC_011830.1,gi|219666071|ref|NC_011830.1| -Desulfitobacterium hafniense Y51, complete genome. (NC_007907)=NC_007907,NC_007907.1,gi|89892746|ref|NC_007907.1| -Desulfobacca acetoxidans DSM 11109 chromosome, complete genome. (NC_015388)=NC_015388,NC_015388.1,gi|328951746|ref|NC_015388.1| -Desulfobacterium autotrophicum HRM2 chromosome, complete genome. (NC_012108)=NC_012108,NC_012108.1,gi|224367124|ref|NC_012108.1| -Desulfobacterium autotrophicum HRM2 plasmid pHRM2a, complete (NC_012109)=NC_012109,NC_012109.1,gi|224371993|ref|NC_012109.1| -Desulfobulbus propionicus DSM 2032 chromosome, complete genome. (NC_014972)=NC_014972,NC_014972.1,gi|320352146|ref|NC_014972.1| -Desulfococcus oleovorans Hxd3 chromosome, complete genome. (NC_009943)=NC_009943,NC_009943.1,gi|158520017|ref|NC_009943.1| -Desulfohalobium retbaense DSM 5692 chromosome, complete genome. (NC_013223)=NC_013223,NC_013223.1,gi|258404138|ref|NC_013223.1| -Desulfohalobium retbaense DSM 5692 plasmid pDRET01, complete (NC_013224)=NC_013224,NC_013224.1,gi|258406618|ref|NC_013224.1| -Desulfomicrobium baculatum DSM 4028, complete genome. (NC_013173)=NC_013173,NC_013173.1,gi|256827818|ref|NC_013173.1| -Desulfomonile tiedjei DSM 6799 chromosome, complete genome. (NC_018025)=NC_018025,NC_018025.1,gi|392408409|ref|NC_018025.1| -Desulfomonile tiedjei DSM 6799 plasmid pDESTI.01, complete (NC_018026)=NC_018026,NC_018026.1,gi|392413879|ref|NC_018026.1| -Desulfosporosinus acidiphilus SJ4 chromosome, complete genome. (NC_018068)=NC_018068,NC_018068.1,gi|392423459|ref|NC_018068.1| -Desulfosporosinus acidiphilus SJ4 plasmid pDESACI.01, complete (NC_018066)=NC_018066,NC_018066.1,gi|392423388|ref|NC_018066.1| -Desulfosporosinus acidiphilus SJ4 plasmid pDESACI.02, complete (NC_018067)=NC_018067,NC_018067.1,gi|391738065|ref|NC_018067.1| -Desulfosporosinus orientis DSM 765 chromosome, complete genome. (NC_016584)=NC_016584,NC_016584.1,gi|374992780|ref|NC_016584.1| -Desulfotalea psychrophila LSv54 plasmid large, complete sequence. (NC_006139)=NC_006139,NC_006139.1,gi|51246971|ref|NC_006139.1| -Desulfotalea psychrophila LSv54 plasmid small, complete sequence. (NC_006140)=NC_006140,NC_006140.1,gi|51247073|ref|NC_006140.1| -Desulfotalea psychrophila LSv54, complete genome. (NC_006138)=NC_006138,NC_006138.1,gi|51243852|ref|NC_006138.1| -Desulfotomaculum acetoxidans DSM 771 chromosome, complete genome. (NC_013216)=NC_013216,NC_013216.1,gi|258513366|ref|NC_013216.1| -Desulfotomaculum carboxydivorans CO-1-SRB chromosome, complete (NC_015565)=NC_015565,NC_015565.1,gi|333922237|ref|NC_015565.1| -Desulfotomaculum kuznetsovii DSM 6115 chromosome, complete genome. (NC_015573)=NC_015573,NC_015573.1,gi|333977506|ref|NC_015573.1| -Desulfotomaculum reducens MI-1 chromosome, complete genome. (NC_009253)=NC_009253,NC_009253.1,gi|134297881|ref|NC_009253.1| -Desulfotomaculum ruminis DSM 2154 chromosome, complete genome. (NC_015589)=NC_015589,NC_015589.1,gi|334338613|ref|NC_015589.1| -Desulfovibrio aespoeensis Aspo-2 chromosome, complete genome. (NC_014844)=NC_014844,NC_014844.1,gi|317151727|ref|NC_014844.1| -Desulfovibrio africanus str. Walvis Bay chromosome, complete (NC_016629)=NC_016629,NC_016629.1,gi|374298386|ref|NC_016629.1| -Desulfovibrio alaskensis G20 chromosome, complete genome. (NC_007519)=NC_007519,NC_007519.1,gi|78355047|ref|NC_007519.1| -Desulfovibrio desulfuricans subsp. desulfuricans str. ATCC 27774 (NC_011883)=NC_011883,NC_011883.1,gi|220903286|ref|NC_011883.1| -Desulfovibrio desulfuricans ND132 chromosome, complete genome. (NC_016803)=NC_016803,NC_016803.1,gi|376294792|ref|NC_016803.1| -Desulfovibrio magneticus RS-1 plasmid pDMC1, complete sequence. (NC_012797)=NC_012797,NC_012797.1,gi|239835334|ref|NC_012797.1| -Desulfovibrio magneticus RS-1 plasmid pDMC2, complete sequence. (NC_012795)=NC_012795,NC_012795.1,gi|239828745|ref|NC_012795.1| -Desulfovibrio magneticus RS-1, complete genome. (NC_012796)=NC_012796,NC_012796.1,gi|239904639|ref|NC_012796.1| -Desulfovibrio salexigens DSM 2638 chromosome, complete genome. (NC_012881)=NC_012881,NC_012881.1,gi|242277482|ref|NC_012881.1| -Desulfovibrio vulgaris DP4 chromosome, complete genome. (NC_008751)=NC_008751,NC_008751.1,gi|120601051|ref|NC_008751.1| -Desulfovibrio vulgaris subsp. vulgaris DP4 plasmid pDVUL01, (NC_008741)=NC_008741,NC_008741.1,gi|120586808|ref|NC_008741.1| -Desulfovibrio vulgaris str. Hildenborough chromosome, complete (NC_002937)=NC_002937,NC_002937.3,gi|46562128|ref|NC_002937.3| -Desulfovibrio vulgaris str. Hildenborough plasmid pDV, complete (NC_005863)=NC_005863,NC_005863.1,gi|46562129|ref|NC_005863.1| -Desulfovibrio vulgaris RCH1 chromosome, complete genome. (NC_017310)=NC_017310,NC_017310.1,gi|387151873|ref|NC_017310.1| -Desulfovibrio vulgaris RCH1 plasmid pDEVAL01, complete sequence. (NC_017311)=NC_017311,NC_017311.1,gi|387133886|ref|NC_017311.1| -Desulfovibrio vulgaris str. 'Miyazaki F' chromosome, complete (NC_011769)=NC_011769,NC_011769.1,gi|218885109|ref|NC_011769.1| -Desulfurispirillum indicum S5 chromosome, complete genome. (NC_014836)=NC_014836,NC_014836.1,gi|317050199|ref|NC_014836.1| -Desulfurivibrio alkaliphilus AHT2 chromosome, complete genome. (NC_014216)=NC_014216,NC_014216.1,gi|297567992|ref|NC_014216.1| -Desulfurobacterium thermolithotrophum DSM 11699 chromosome, (NC_015185)=NC_015185,NC_015185.1,gi|325294206|ref|NC_015185.1| -Desulfurococcus fermentans DSM 16532 chromosome, complete genome. (NC_018001)=NC_018001,NC_018001.1,gi|390937752|ref|NC_018001.1| -Desulfurococcus kamchatkensis 1221n chromosome, complete genome. (NC_011766)=NC_011766,NC_011766.1,gi|218883314|ref|NC_011766.1| -Desulfurococcus mucosus DSM 2162 chromosome, complete genome. (NC_014961)=NC_014961,NC_014961.1,gi|320100209|ref|NC_014961.1| -Dichelobacter nodosus VCS1703A chromosome, complete genome. (NC_009446)=NC_009446,NC_009446.1,gi|146328629|ref|NC_009446.1| -Dickeya dadantii 3937 chromosome, complete genome. (NC_014500)=NC_014500,NC_014500.1,gi|307128764|ref|NC_014500.1| -Dickeya dadantii Ech586 chromosome, complete genome. (NC_013592)=NC_013592,NC_013592.1,gi|271498578|ref|NC_013592.1| -Dickeya dadantii Ech703 chromosome, complete genome. (NC_012880)=NC_012880,NC_012880.1,gi|242237460|ref|NC_012880.1| -Dickeya zeae Ech1591 chromosome, complete genome. (NC_012912)=NC_012912,NC_012912.1,gi|251787652|ref|NC_012912.1| -Dictyoglomus thermophilum H-6-12, complete genome. (NC_011297)=NC_011297,NC_011297.1,gi|206900094|ref|NC_011297.1| -Dictyoglomus turgidum DSM 6724 chromosome, complete genome. (NC_011661)=NC_011661,NC_011661.1,gi|217966449|ref|NC_011661.1| -Dinoroseobacter shibae DFL 12 chromosome, complete genome. (NC_009952)=NC_009952,NC_009952.1,gi|159042556|ref|NC_009952.1| -Dinoroseobacter shibae DFL 12 plasmid pDSHI01, complete sequence. (NC_009955)=NC_009955,NC_009955.1,gi|159046135|ref|NC_009955.1| -Dinoroseobacter shibae DFL 12 plasmid pDSHI02, complete sequence. (NC_009956)=NC_009956,NC_009956.1,gi|159046331|ref|NC_009956.1| -Dinoroseobacter shibae DFL 12 plasmid pDSHI03, complete sequence. (NC_009957)=NC_009957,NC_009957.1,gi|159046469|ref|NC_009957.1| -Dinoroseobacter shibae DFL 12 plasmid pDSHI04, complete sequence. (NC_009958)=NC_009958,NC_009958.1,gi|159046605|ref|NC_009958.1| -Dinoroseobacter shibae DFL 12 plasmid pDSHI05, complete sequence. (NC_009959)=NC_009959,NC_009959.1,gi|159046676|ref|NC_009959.1| -Dyadobacter fermentans DSM 18053 chromosome, complete genome. (NC_013037)=NC_013037,NC_013037.1,gi|255033817|ref|NC_013037.1| -Edwardsiella ictaluri 93-146 chromosome, complete genome. (NC_012779)=NC_012779,NC_012779.1,gi|238917983|ref|NC_012779.1| -Edwardsiella tarda EIB202 chromosome, complete genome. (NC_013508)=NC_013508,NC_013508.1,gi|269137358|ref|NC_013508.1| -Edwardsiella tarda EIB202 plasmid pEIB202, complete sequence. (NC_013509)=NC_013509,NC_013509.1,gi|268593652|ref|NC_013509.1| -Edwardsiella tarda FL6-60 chromosome, complete genome. (NC_017309)=NC_017309,NC_017309.1,gi|387866146|ref|NC_017309.1| -Edwardsiella tarda FL6-60 plasmid pFL6-60, complete sequence. (NC_017318)=NC_017318,NC_017318.1,gi|387134041|ref|NC_017318.1| -Eggerthella sp. YY7918, complete genome. (NC_015738)=NC_015738,NC_015738.1,gi|339443684|ref|NC_015738.1| -Eggerthella lenta DSM 2243 chromosome, complete genome. (NC_013204)=NC_013204,NC_013204.1,gi|257789778|ref|NC_013204.1| -Ehrlichia canis str. Jake chromosome, complete genome. (NC_007354)=NC_007354,NC_007354.1,gi|73666633|ref|NC_007354.1| -Ehrlichia chaffeensis str. Arkansas, complete genome. (NC_007799)=NC_007799,NC_007799.1,gi|88657561|ref|NC_007799.1| -Ehrlichia ruminantium str. Gardel, complete genome. (NC_006831)=NC_006831,NC_006831.1,gi|58616727|ref|NC_006831.1| -Ehrlichia ruminantium str. Welgevonden chromosome, complete genome. (NC_005295)=NC_005295,NC_005295.2,gi|57238731|ref|NC_005295.2| -Ehrlichia ruminantium str. Welgevonden, complete genome. (NC_006832)=NC_006832,NC_006832.1,gi|58578664|ref|NC_006832.1| -Elusimicrobium minutum Pei191 chromosome, complete genome. (NC_010644)=NC_010644,NC_010644.1,gi|187250423|ref|NC_010644.1| -Enterobacter sp. 638 plasmid pENTE01, complete sequence. (NC_009425)=NC_009425,NC_009425.1,gi|146284526|ref|NC_009425.1| -Enterobacter sp. 638, complete genome. (NC_009436)=NC_009436,NC_009436.1,gi|146309667|ref|NC_009436.1| -Enterobacter aerogenes KCTC 2190 chromosome, complete genome. (NC_015663)=NC_015663,NC_015663.1,gi|336246508|ref|NC_015663.1| -Enterobacter asburiae LF7a chromosome, complete genome. (NC_015968)=NC_015968,NC_015968.1,gi|345297184|ref|NC_015968.1| -Enterobacter asburiae LF7a plasmid pENTAS01, complete sequence. (NC_015963)=NC_015963,NC_015963.1,gi|345301597|ref|NC_015963.1| -Enterobacter asburiae LF7a plasmid pENTAS02, complete sequence. (NC_015969)=NC_015969,NC_015969.1,gi|345301759|ref|NC_015969.1| -Enterobacter cloacae subsp. cloacae ATCC 13047 chromosome, complete (NC_014121)=NC_014121,NC_014121.1,gi|296100371|ref|NC_014121.1| -Enterobacter cloacae subsp. cloacae ATCC 13047 plasmid pECL_A, (NC_014107)=NC_014107,NC_014107.1,gi|295697839|ref|NC_014107.1| -Enterobacter cloacae subsp. cloacae ATCC 13047 plasmid pECL_B, (NC_014108)=NC_014108,NC_014108.1,gi|295698114|ref|NC_014108.1| -Enterobacter cloacae EcWSU1 chromosome, complete genome. (NC_016514)=NC_016514,NC_016514.1,gi|365968300|ref|NC_016514.1| -Enterobacter cloacae EcWSU1 plasmid pEcWSU1_A, complete sequence. (NC_016515)=NC_016515,NC_016515.1,gi|365972835|ref|NC_016515.1| -Enterobacter cloacae SCF1 chromosome, complete genome. (NC_014618)=NC_014618,NC_014618.1,gi|311277332|ref|NC_014618.1| -Enterobacter cloacae subsp. dissolvens SDM chromosome, complete (NC_018079)=NC_018079,NC_018079.1,gi|392976867|ref|NC_018079.1| -Enterococcus faecalis 62 chromosome, complete genome. (NC_017312)=NC_017312,NC_017312.1,gi|384516725|ref|NC_017312.1| -Enterococcus faecalis 62 plasmid EF62pA, complete sequence. (NC_017314)=NC_017314,NC_017314.1,gi|384519687|ref|NC_017314.1| -Enterococcus faecalis 62 plasmid EF62pB, complete sequence. (NC_017313)=NC_017313,NC_017313.1,gi|384519623|ref|NC_017313.1| -Enterococcus faecalis 62 plasmid EF62pC, complete sequence. (NC_017315)=NC_017315,NC_017315.1,gi|384519696|ref|NC_017315.1| -Enterococcus phage EF62phi, complete genome. (NC_017732)=NC_017732,NC_017732.1,gi|384519756|ref|NC_017732.1| -Enterococcus faecalis D32 chromosome, complete genome. (NC_018221)=NC_018221,NC_018221.1,gi|397698583|ref|NC_018221.1| -Enterococcus faecalis D32 plasmid EFD32pA, complete sequence. (NC_018222)=NC_018222,NC_018222.1,gi|397698492|ref|NC_018222.1| -Enterococcus faecalis D32 plasmid EFD32pB, complete sequence. (NC_018223)=NC_018223,NC_018223.1,gi|397698507|ref|NC_018223.1| -Enterococcus faecalis OG1RF chromosome, complete genome. (NC_017316)=NC_017316,NC_017316.1,gi|384511964|ref|NC_017316.1| -Enterococcus faecalis V583 chromosome, complete genome. (NC_004668)=NC_004668,NC_004668.1,gi|29374661|ref|NC_004668.1| -Enterococcus faecalis V583 plasmid pTEF1, complete sequence. (NC_004669)=NC_004669,NC_004669.1,gi|29377803|ref|NC_004669.1| -Enterococcus faecalis V583 plasmid pTEF2, complete sequence. (NC_004671)=NC_004671,NC_004671.1,gi|29377895|ref|NC_004671.1| -Enterococcus faecalis V583 plasmid pTEF3, complete sequence. (NC_004670)=NC_004670,NC_004670.1,gi|29377876|ref|NC_004670.1| -Enterococcus faecium Aus0004 chromosome, complete genome. (NC_017022)=NC_017022,NC_017022.1,gi|383327320|ref|NC_017022.1| -Enterococcus faecium Aus0004 plasmid AUS0004_p1, complete sequence. (NC_017032)=NC_017032,NC_017032.1,gi|383315282|ref|NC_017032.1| -Enterococcus faecium Aus0004 plasmid AUS0004_p2, complete sequence. (NC_017023)=NC_017023,NC_017023.1,gi|383315346|ref|NC_017023.1| -Enterococcus faecium Aus0004 plasmid AUS0004_p3, complete sequence. (NC_017024)=NC_017024,NC_017024.1,gi|383315276|ref|NC_017024.1| -Enterococcus faecium DO chromosome, complete genome. (NC_017960)=NC_017960,NC_017960.1,gi|389867183|ref|NC_017960.1| -Enterococcus faecium DO plasmid 1, complete sequence. (NC_017961)=NC_017961,NC_017961.1,gi|389870257|ref|NC_017961.1| -Enterococcus faecium DO plasmid 2, complete sequence. (NC_017962)=NC_017962,NC_017962.1,gi|389870171|ref|NC_017962.1| -Enterococcus faecium DO plasmid 3, complete sequence. (NC_017963)=NC_017963,NC_017963.1,gi|389869887|ref|NC_017963.1| -Enterococcus hirae ATCC 9790 chromosome, complete genome. (NC_018081)=NC_018081,NC_018081.1,gi|392987295|ref|NC_018081.1| -Enterococcus hirae ATCC 9790 plasmid pTG9790, complete sequence. (NC_015845)=NC_015845,NC_015845.1,gi|340620745|ref|NC_015845.1| -Erwinia sp. Ejp617 chromosome, complete genome. (NC_017445)=NC_017445,NC_017445.1,gi|385785459|ref|NC_017445.1| -Erwinia sp. Ejp617 plasmid pJE01, complete sequence. (NC_017442)=NC_017442,NC_017442.1,gi|385785382|ref|NC_017442.1| -Erwinia sp. Ejp617 plasmid pJE02, complete sequence. (NC_017446)=NC_017446,NC_017446.1,gi|385785434|ref|NC_017446.1| -Erwinia sp. Ejp617 plasmid pJE03, complete sequence. (NC_017443)=NC_017443,NC_017443.1,gi|385785441|ref|NC_017443.1| -Erwinia sp. Ejp617 plasmid pJE04, complete sequence. (NC_017447)=NC_017447,NC_017447.1,gi|385785424|ref|NC_017447.1| -Erwinia sp. Ejp617 plasmid pJE05, complete sequence. (NC_017444)=NC_017444,NC_017444.1,gi|385785417|ref|NC_017444.1| -Erwinia amylovora ATCC 49946 chromosome, complete genome. (NC_013971)=NC_013971,NC_013971.1,gi|292897734|ref|NC_013971.1| -Erwinia amylovora ATCC 49946 plasmid 1, complete sequence. (NC_013972)=NC_013972,NC_013972.1,gi|293386373|ref|NC_013972.1| -Erwinia amylovora ATCC 49946 plasmid 2, complete sequence. (NC_013973)=NC_013973,NC_013973.1,gi|293386419|ref|NC_013973.1| -Erwinia amylovora CFBP1430 chromosome, complete genome. (NC_013961)=NC_013961,NC_013961.1,gi|292486492|ref|NC_013961.1| -Erwinia amylovora CFBP1430 plasmid pEA29, complete sequence. (NC_013957)=NC_013957,NC_013957.1,gi|291615522|ref|NC_013957.1| -Erwinia billingiae Eb661 chromosome, complete genome. (NC_014306)=NC_014306,NC_014306.1,gi|300714588|ref|NC_014306.1| -Erwinia billingiae Eb661 plasmid pEB102, complete sequence. (NC_014304)=NC_014304,NC_014304.1,gi|300781822|ref|NC_014304.1| -Erwinia billingiae Eb661 plasmid pEB170, complete sequence. (NC_014305)=NC_014305,NC_014305.1,gi|300713132|ref|NC_014305.1| -Erwinia pyrifoliae DSM 12163 plasmid pEP2.6, complete sequence. (NC_017391)=NC_017391,NC_017391.1,gi|384551513|ref|NC_017391.1| -Erwinia pyrifoliae DSM 12163 plasmid pEP3, complete sequence. (NC_017388)=NC_017388,NC_017388.1,gi|384551508|ref|NC_017388.1| -Erwinia pyrifoliae DSM 12163 plasmid pEP36, complete sequence. (NC_017392)=NC_017392,NC_017392.1,gi|387869341|ref|NC_017392.1| -Erwinia pyrifoliae DSM 12163 plasmid pEp5, complete sequence. (NC_017389)=NC_017389,NC_017389.1,gi|387873349|ref|NC_017389.1| -Erwinia pyrifoliae DSM 12163, complete genome. (NC_017390)=NC_017390,NC_017390.1,gi|387869382|ref|NC_017390.1| -Erwinia pyrifoliae Ep1/96 chromosome, complete genome. (NC_012214)=NC_012214,NC_012214.1,gi|259906682|ref|NC_012214.1| -Erwinia pyrifoliae Ep1/96 plasmid pEP03, complete sequence. (NC_013264)=NC_013264,NC_013264.1,gi|259647806|ref|NC_013264.1| -Erwinia pyrifoliae Ep1/96 plasmid pEP05, complete sequence. (NC_013265)=NC_013265,NC_013265.1,gi|259647811|ref|NC_013265.1| -Erwinia pyrifoliae Ep1/96 plasmid pEP2.6, complete sequence. (NC_013954)=NC_013954,NC_013954.1,gi|291575210|ref|NC_013954.1| -Erwinia pyrifoliae Ep1/96 plasmid pEP36, complete sequence. (NC_013263)=NC_013263,NC_013263.1,gi|259910328|ref|NC_013263.1| -Erwinia tasmaniensis Et1/99 chromosome, complete genome. (NC_010694)=NC_010694,NC_010694.1,gi|188532165|ref|NC_010694.1| -Erwinia tasmaniensis Et1/99 plasmid pET09, complete sequence. (NC_010695)=NC_010695,NC_010695.1,gi|188535903|ref|NC_010695.1| -Erwinia tasmaniensis Et1/99 plasmid pET35, complete sequence. (NC_010696)=NC_010696,NC_010696.1,gi|188535911|ref|NC_010696.1| -Erwinia tasmaniensis Et1/99 plasmid pET45, complete sequence. (NC_010699)=NC_010699,NC_010699.1,gi|188535954|ref|NC_010699.1| -Erwinia tasmaniensis Et1/99 plasmid pET46, complete sequence. (NC_010693)=NC_010693,NC_010693.1,gi|188535863|ref|NC_010693.1| -Erwinia tasmaniensis Et1/99 plasmid pET49, complete sequence. (NC_010697)=NC_010697,NC_010697.1,gi|189017121|ref|NC_010697.1| -Erysipelothrix rhusiopathiae str. Fujisawa chromosome, complete (NC_015601)=NC_015601,NC_015601.1,gi|336065242|ref|NC_015601.1| -Erythrobacter litoralis HTCC2594 chromosome, complete genome. (NC_007722)=NC_007722,NC_007722.1,gi|85372828|ref|NC_007722.1| -Escherichia blattae DSM 4481 chromosome, complete genome. (NC_017910)=NC_017910,NC_017910.1,gi|387887350|ref|NC_017910.1| -Escherichia coli 042 plasmid pAA, complete sequence. (NC_017627)=NC_017627,NC_017627.1,gi|387604868|ref|NC_017627.1| -Escherichia coli 042, complete genome. (NC_017626)=NC_017626,NC_017626.1,gi|387605479|ref|NC_017626.1| -Escherichia coli 536, complete genome. (NC_008253)=NC_008253,NC_008253.1,gi|110640213|ref|NC_008253.1| -Escherichia coli 55989 chromosome, complete genome. (NC_011748)=NC_011748,NC_011748.1,gi|218693476|ref|NC_011748.1| -Escherichia coli ABU 83972 chromosome, complete genome. (NC_017631)=NC_017631,NC_017631.1,gi|386637352|ref|NC_017631.1| -Escherichia coli ABU 83972 plasmid pABU, complete sequence. (NC_017629)=NC_017629,NC_017629.1,gi|386637348|ref|NC_017629.1| -Escherichia coli APEC O1 chromosome, complete genome. (NC_008563)=NC_008563,NC_008563.1,gi|117622295|ref|NC_008563.1| -Escherichia coli APEC O1 plasmid pAPEC-O1-ColBM, complete sequence. (NC_009837)=NC_009837,NC_009837.1,gi|157418083|ref|NC_009837.1| -Escherichia coli APEC O1 plasmid pAPEC-O1-R, complete sequence. (NC_009838)=NC_009838,NC_009838.1,gi|157412014|ref|NC_009838.1| -Escherichia coli ATCC 8739 chromosome, complete genome. (NC_010468)=NC_010468,NC_010468.1,gi|170018061|ref|NC_010468.1| -Escherichia coli BL21(DE3) chromosome, complete genome. (NC_012971)=NC_012971,NC_012971.2,gi|387825439|ref|NC_012971.2| -Escherichia coli BL21(DE3), complete genome. (NC_012892)=NC_012892,NC_012892.2,gi|387823261|ref|NC_012892.2| -Escherichia coli BW2952 chromosome, complete genome. (NC_012759)=NC_012759,NC_012759.1,gi|238899406|ref|NC_012759.1| -Escherichia coli B str. REL606 chromosome, complete genome. (NC_012967)=NC_012967,NC_012967.1,gi|254160123|ref|NC_012967.1| -Escherichia coli CFT073 chromosome, complete genome. (NC_004431)=NC_004431,NC_004431.1,gi|26245917|ref|NC_004431.1| -Escherichia coli DH1 chromosome, complete genome. (NC_017625)=NC_017625,NC_017625.1,gi|386593590|ref|NC_017625.1| -Escherichia coli DH1, complete genome. (NC_017638)=NC_017638,NC_017638.1,gi|387619774|ref|NC_017638.1| -Escherichia coli E24377A chromosome, complete genome. (NC_009801)=NC_009801,NC_009801.1,gi|157154711|ref|NC_009801.1| -Escherichia coli E24377A plasmid pETEC_35, complete sequence. (NC_009787)=NC_009787,NC_009787.1,gi|157149399|ref|NC_009787.1| -Escherichia coli E24377A plasmid pETEC_5, complete sequence. (NC_009791)=NC_009791,NC_009791.1,gi|157149574|ref|NC_009791.1| -Escherichia coli E24377A plasmid pETEC_6, complete sequence. (NC_009789)=NC_009789,NC_009789.1,gi|157149498|ref|NC_009789.1| -Escherichia coli E24377A plasmid pETEC_73, complete sequence. (NC_009788)=NC_009788,NC_009788.1,gi|157149429|ref|NC_009788.1| -Escherichia coli E24377A plasmid pETEC_74, complete sequence. (NC_009790)=NC_009790,NC_009790.1,gi|157149504|ref|NC_009790.1| -Escherichia coli E24377A plasmid pETEC_80, complete sequence. (NC_009786)=NC_009786,NC_009786.1,gi|157149330|ref|NC_009786.1| -Escherichia coli ED1a chromosome, complete genome. (NC_011745)=NC_011745,NC_011745.1,gi|218687878|ref|NC_011745.1| -Escherichia coli ETEC H10407 plasmid p52, complete sequence. (NC_017721)=NC_017721,NC_017721.1,gi|387615175|ref|NC_017721.1| -Escherichia coli ETEC H10407 plasmid p58, complete sequence. (NC_017723)=NC_017723,NC_017723.1,gi|387615182|ref|NC_017723.1| -Escherichia coli ETEC H10407 plasmid p666, complete sequence. (NC_017722)=NC_017722,NC_017722.1,gi|387610311|ref|NC_017722.1| -Escherichia coli ETEC H10407 plasmid p948, complete sequence. (NC_017724)=NC_017724,NC_017724.1,gi|387610385|ref|NC_017724.1| -Escherichia coli ETEC H10407, complete genome. (NC_017633)=NC_017633,NC_017633.1,gi|387610477|ref|NC_017633.1| -Escherichia coli HS, complete genome. (NC_009800)=NC_009800,NC_009800.1,gi|157159467|ref|NC_009800.1| -Escherichia coli IAI1 chromosome, complete genome. (NC_011741)=NC_011741,NC_011741.1,gi|218552585|ref|NC_011741.1| -Escherichia coli IAI39 chromosome, complete genome. (NC_011750)=NC_011750,NC_011750.1,gi|218698419|ref|NC_011750.1| -Escherichia coli IHE3034 chromosome, complete genome. (NC_017628)=NC_017628,NC_017628.1,gi|386597751|ref|NC_017628.1| -Escherichia coli KO11FL chromosome, complete genome. (NC_017660)=NC_017660,NC_017660.1,gi|386698504|ref|NC_017660.1| -Escherichia coli KO11FL plasmid pRK2, complete sequence. (NC_017661)=NC_017661,NC_017661.1,gi|386703202|ref|NC_017661.1| -Escherichia coli KO11FL chromosome, complete genome. (NC_016902)=NC_016902,NC_016902.1,gi|378710836|ref|NC_016902.1| -Escherichia coli KO11FL plasmid pEKO1101, complete sequence. (NC_016904)=NC_016904,NC_016904.1,gi|378715377|ref|NC_016904.1| -Escherichia coli KO11FL plasmid pEKO1102, complete sequence. (NC_016903)=NC_016903,NC_016903.1,gi|378715370|ref|NC_016903.1| -Escherichia coli str. K-12 substr. DH10B chromosome, complete (NC_010473)=NC_010473,NC_010473.1,gi|170079663|ref|NC_010473.1| -Escherichia coli str. K-12 substr. MG1655 chromosome, complete (NC_000913)=NC_000913,NC_000913.2,gi|49175990|ref|NC_000913.2| -Escherichia coli str. K-12 substr. W3110, complete genome. (NC_007779)=NC_007779,NC_007779.1,gi|388476123|ref|NC_007779.1| -Escherichia coli LF82, complete genome. (NC_011993)=NC_011993,NC_011993.1,gi|222154829|ref|NC_011993.1| -Escherichia coli NA114 chromosome, complete genome. (NC_017644)=NC_017644,NC_017644.1,gi|386617516|ref|NC_017644.1| -Escherichia coli O103:H2 str. 12009 plasmid pO103, complete (NC_013354)=NC_013354,NC_013354.1,gi|260718930|ref|NC_013354.1| -Escherichia coli O103:H2 str. 12009, complete genome. (NC_013353)=NC_013353,NC_013353.1,gi|260842239|ref|NC_013353.1| -Escherichia coli O111:H- str. 11128 plasmid pO111_1, complete (NC_013365)=NC_013365,NC_013365.1,gi|260752012|ref|NC_013365.1| -Escherichia coli O111:H- str. 11128 plasmid pO111_2, complete (NC_013370)=NC_013370,NC_013370.1,gi|260871126|ref|NC_013370.1| -Escherichia coli O111:H- str. 11128 plasmid pO111_3, complete (NC_013366)=NC_013366,NC_013366.1,gi|260751835|ref|NC_013366.1| -Escherichia coli O111:H- str. 11128 plasmid pO111_4, complete (NC_013367)=NC_013367,NC_013367.1,gi|260751908|ref|NC_013367.1| -Escherichia coli O111:H- str. 11128 plasmid pO111_5, complete (NC_013368)=NC_013368,NC_013368.1,gi|260751919|ref|NC_013368.1| -Escherichia coli O111:H- str. 11128, complete genome. (NC_013364)=NC_013364,NC_013364.1,gi|260866153|ref|NC_013364.1| -Escherichia coli O127:H6 str. E2348/69 chromosome, complete genome. (NC_011601)=NC_011601,NC_011601.1,gi|215485161|ref|NC_011601.1| -Escherichia coli O127:H6 str. E2348/69 plasmid pE2348-2, complete (NC_011602)=NC_011602,NC_011602.1,gi|215274578|ref|NC_011602.1| -Escherichia coli O127:H6 str. E2348/69 plasmid pMAR2, complete (NC_011603)=NC_011603,NC_011603.1,gi|215276192|ref|NC_011603.1| -Escherichia coli O157:H7 str. EC4115 chromosome, complete genome. (NC_011353)=NC_011353,NC_011353.1,gi|209395693|ref|NC_011353.1| -Escherichia coli O157:H7 str. EC4115 plasmid pEC4115, complete (NC_011351)=NC_011351,NC_011351.1,gi|209395638|ref|NC_011351.1| -Escherichia coli O157:H7 str. EC4115 plasmid pO157, complete (NC_011350)=NC_011350,NC_011350.1,gi|209395529|ref|NC_011350.1| -Escherichia coli O157:H7 EDL933 plasmid pO157, complete sequence. (NC_007414)=NC_007414,NC_007414.1,gi|75994447|ref|NC_007414.1| -Escherichia coli O157:H7 str. EDL933 chromosome, complete genome. (NC_002655)=NC_002655,NC_002655.2,gi|16445223|ref|NC_002655.2| -Escherichia coli O157:H7 str. Sakai chromosome, complete genome. (NC_002695)=NC_002695,NC_002695.1,gi|15829254|ref|NC_002695.1| -Escherichia coli O157:H7 str. Sakai plasmid pO157, complete (NC_002128)=NC_002128,NC_002128.1,gi|10955266|ref|NC_002128.1| -Escherichia coli O157:H7 str. Sakai plasmid pOSAK1, complete (NC_002127)=NC_002127,NC_002127.1,gi|10955262|ref|NC_002127.1| -Escherichia coli O157:H7 str. TW14359 chromosome, complete genome. (NC_013008)=NC_013008,NC_013008.1,gi|254791136|ref|NC_013008.1| -Escherichia coli O157:H7 str. TW14359 plasmid pO157, complete (NC_013010)=NC_013010,NC_013010.1,gi|254667448|ref|NC_013010.1| -Escherichia coli O26:H11 str. 11368 chromosome, complete genome. (NC_013361)=NC_013361,NC_013361.1,gi|260853213|ref|NC_013361.1| -Escherichia coli O26:H11 str. 11368 plasmid pO26_1, complete (NC_013369)=NC_013369,NC_013369.1,gi|260763802|ref|NC_013369.1| -Escherichia coli O26:H11 str. 11368 plasmid pO26_2, complete (NC_013362)=NC_013362,NC_013362.1,gi|260751930|ref|NC_013362.1| -Escherichia coli O26:H11 str. 11368 plasmid pO26_3, complete (NC_013363)=NC_013363,NC_013363.1,gi|260751828|ref|NC_013363.1| -Escherichia coli O26:H11 str. 11368 plasmid pO26_4, complete (NC_014543)=NC_014543,NC_014543.1,gi|307950758|ref|NC_014543.1| -Escherichia coli O55:H7 str. CB9615 chromosome, complete genome. (NC_013941)=NC_013941,NC_013941.1,gi|291280824|ref|NC_013941.1| -Escherichia coli O55:H7 str. CB9615 plasmid pO55, complete (NC_013942)=NC_013942,NC_013942.1,gi|291285839|ref|NC_013942.1| -Escherichia coli O55:H7 str. RM12579 chromosome, complete genome. (NC_017656)=NC_017656,NC_017656.1,gi|387504934|ref|NC_017656.1| -Escherichia coli O55:H7 str. RM12579 plasmid p12579_1, complete (NC_017653)=NC_017653,NC_017653.1,gi|387504721|ref|NC_017653.1| -Escherichia coli O55:H7 str. RM12579 plasmid p12579_2, complete (NC_017657)=NC_017657,NC_017657.1,gi|387504844|ref|NC_017657.1| -Escherichia coli O55:H7 str. RM12579 plasmid p12579_3, complete (NC_017654)=NC_017654,NC_017654.1,gi|387504828|ref|NC_017654.1| -Escherichia coli O55:H7 str. RM12579 plasmid p12579_4, complete (NC_017658)=NC_017658,NC_017658.1,gi|387504713|ref|NC_017658.1| -Escherichia coli O55:H7 str. RM12579 plasmid p12579_5, complete (NC_017655)=NC_017655,NC_017655.1,gi|387504924|ref|NC_017655.1| -Escherichia coli O7:K1 str. CE10 chromosome, complete genome. (NC_017646)=NC_017646,NC_017646.1,gi|386622414|ref|NC_017646.1| -Escherichia coli O7:K1 str. CE10 plasmid pCE10A, complete sequence. (NC_017647)=NC_017647,NC_017647.1,gi|386627436|ref|NC_017647.1| -Escherichia coli O7:K1 str. CE10 plasmid pCE10B, complete sequence. (NC_017648)=NC_017648,NC_017648.1,gi|386627431|ref|NC_017648.1| -Escherichia coli O7:K1 str. CE10 plasmid pCE10C, complete sequence. (NC_017649)=NC_017649,NC_017649.1,gi|386622390|ref|NC_017649.1| -Escherichia coli O7:K1 str. CE10 plasmid pCE10D, complete sequence. (NC_017650)=NC_017650,NC_017650.1,gi|386622393|ref|NC_017650.1| -Escherichia coli O83:H1 str. NRG 857C chromosome, complete genome. (NC_017634)=NC_017634,NC_017634.1,gi|387615344|ref|NC_017634.1| -Escherichia coli O83:H1 str. NRG 857C plasmid pO83_CORR, complete (NC_017659)=NC_017659,NC_017659.1,gi|387615190|ref|NC_017659.1| -Escherichia coli P12b chromosome, complete genome. (NC_017663)=NC_017663,NC_017663.1,gi|386703215|ref|NC_017663.1| -Escherichia coli S88 chromosome, complete genome. (NC_011742)=NC_011742,NC_011742.1,gi|218556939|ref|NC_011742.1| -Escherichia coli S88 plasmid pECOS88, complete sequence. (NC_011747)=NC_011747,NC_011747.1,gi|218534477|ref|NC_011747.1| -Escherichia coli SE11 chromosome, complete genome. (NC_011415)=NC_011415,NC_011415.1,gi|209917191|ref|NC_011415.1| -Escherichia coli SE11 plasmid pSE11-1, complete sequence. (NC_011419)=NC_011419,NC_011419.1,gi|209921952|ref|NC_011419.1| -Escherichia coli SE11 plasmid pSE11-2, complete sequence. (NC_011413)=NC_011413,NC_011413.1,gi|209916829|ref|NC_011413.1| -Escherichia coli SE11 plasmid pSE11-3, complete sequence. (NC_011416)=NC_011416,NC_011416.1,gi|209921875|ref|NC_011416.1| -Escherichia coli SE11 plasmid pSE11-4, complete sequence. (NC_011407)=NC_011407,NC_011407.1,gi|209916806|ref|NC_011407.1| -Escherichia coli SE11 plasmid pSE11-5, complete sequence. (NC_011408)=NC_011408,NC_011408.1,gi|209916817|ref|NC_011408.1| -Escherichia coli SE11 plasmid pSE11-6, complete sequence. (NC_011411)=NC_011411,NC_011411.1,gi|209916825|ref|NC_011411.1| -Escherichia coli SE15 plasmid pECSF1, complete sequence. (NC_013655)=NC_013655,NC_013655.1,gi|281427817|ref|NC_013655.1| -Escherichia coli SE15, complete genome. (NC_013654)=NC_013654,NC_013654.1,gi|387828053|ref|NC_013654.1| -Escherichia coli SMS-3-5 chromosome, complete genome. (NC_010498)=NC_010498,NC_010498.1,gi|170679574|ref|NC_010498.1| -Escherichia coli SMS-3-5 plasmid pSMS35_130, complete sequence. (NC_010488)=NC_010488,NC_010488.1,gi|170650760|ref|NC_010488.1| -Escherichia coli SMS-3-5 plasmid pSMS35_3, complete sequence. (NC_010487)=NC_010487,NC_010487.1,gi|170650756|ref|NC_010487.1| -Escherichia coli SMS-3-5 plasmid pSMS35_4, complete sequence. (NC_010486)=NC_010486,NC_010486.1,gi|170650751|ref|NC_010486.1| -Escherichia coli SMS-3-5 plasmid pSMS35_8, complete sequence. (NC_010485)=NC_010485,NC_010485.1,gi|170650740|ref|NC_010485.1| -Escherichia coli UM146 chromosome, complete genome. (NC_017632)=NC_017632,NC_017632.1,gi|386602643|ref|NC_017632.1| -Escherichia coli UM146 plasmid pUM146, complete sequence. (NC_017630)=NC_017630,NC_017630.1,gi|386602509|ref|NC_017630.1| -Escherichia coli UMN026 chromosome, complete genome. (NC_011751)=NC_011751,NC_011751.1,gi|218703261|ref|NC_011751.1| -Escherichia coli UMN026 plasmid p1ESCUM, complete sequence. (NC_011749)=NC_011749,NC_011749.1,gi|218692794|ref|NC_011749.1| -Escherichia coli UMN026 plasmid p2ESCUM, complete sequence. (NC_011739)=NC_011739,NC_011739.1,gi|218454959|ref|NC_011739.1| -Escherichia coli UMNK88 chromosome, complete genome. (NC_017641)=NC_017641,NC_017641.1,gi|386612163|ref|NC_017641.1| -Escherichia coli UMNK88 plasmid pUMNK88, complete sequence. (NC_017645)=NC_017645,NC_017645.1,gi|386617342|ref|NC_017645.1| -Escherichia coli UMNK88 plasmid pUMNK88_91, complete sequence. (NC_017642)=NC_017642,NC_017642.1,gi|386611903|ref|NC_017642.1| -Escherichia coli UMNK88 plasmid pUMNK88_Ent, complete sequence. (NC_017640)=NC_017640,NC_017640.1,gi|386612081|ref|NC_017640.1| -Escherichia coli UMNK88 plasmid pUMNK88_Hly, complete sequence. (NC_017643)=NC_017643,NC_017643.1,gi|386617281|ref|NC_017643.1| -Escherichia coli UMNK88 plasmid pUMNK88_K88, complete sequence. (NC_017639)=NC_017639,NC_017639.1,gi|386611993|ref|NC_017639.1| -Escherichia coli UTI89 chromosome, complete genome. (NC_007946)=NC_007946,NC_007946.1,gi|91209055|ref|NC_007946.1| -Escherichia coli UTI89 plasmid pUTI89, complete sequence. (NC_007941)=NC_007941,NC_007941.1,gi|91206245|ref|NC_007941.1| -Escherichia coli W chromosome, complete genome. (NC_017635)=NC_017635,NC_017635.1,gi|386607309|ref|NC_017635.1| -Escherichia coli W plasmid pRK1, complete sequence. (NC_017637)=NC_017637,NC_017637.1,gi|386611788|ref|NC_017637.1| -Escherichia coli W plasmid pRK2, complete sequence. (NC_017636)=NC_017636,NC_017636.1,gi|386607294|ref|NC_017636.1| -Escherichia coli W chromosome, complete genome. (NC_017664)=NC_017664,NC_017664.1,gi|386707734|ref|NC_017664.1| -Escherichia coli W plasmid pRK1, complete sequence. (NC_017665)=NC_017665,NC_017665.1,gi|386707622|ref|NC_017665.1| -Escherichia coli W plasmid pRK2, complete sequence. (NC_017662)=NC_017662,NC_017662.1,gi|386707609|ref|NC_017662.1| -Escherichia coli Xuzhou21 chromosome, complete genome. (NC_017906)=NC_017906,NC_017906.1,gi|387880559|ref|NC_017906.1| -Escherichia coli Xuzhou21 plasmid pO157, complete sequence. (NC_017907)=NC_017907,NC_017907.1,gi|387885599|ref|NC_017907.1| -Escherichia coli Xuzhou21 plasmid pO157_Sal, complete sequence. (NC_017903)=NC_017903,NC_017903.1,gi|387873357|ref|NC_017903.1| -Escherichia coli 'BL21-Gold(DE3)pLysS AG' chromosome, complete (NC_012947)=NC_012947,NC_012947.1,gi|253771435|ref|NC_012947.1| -Escherichia coli str. 'clone D i14' chromosome, complete genome. (NC_017652)=NC_017652,NC_017652.1,gi|386632422|ref|NC_017652.1| -Escherichia coli str. 'clone D i2' chromosome, complete genome. (NC_017651)=NC_017651,NC_017651.1,gi|386627502|ref|NC_017651.1| -Escherichia fergusonii ATCC 35469 chromosome, complete genome. (NC_011740)=NC_011740,NC_011740.1,gi|218547440|ref|NC_011740.1| -Escherichia fergusonii ATCC 35469 plasmid pEFER, complete sequence. (NC_011743)=NC_011743,NC_011743.1,gi|218561636|ref|NC_011743.1| -Ethanoligenens harbinense YUAN-3 chromosome, complete genome. (NC_014828)=NC_014828,NC_014828.1,gi|317131008|ref|NC_014828.1| -Eubacterium eligens ATCC 27750 chromosome, complete genome. (NC_012778)=NC_012778,NC_012778.1,gi|238915976|ref|NC_012778.1| -Eubacterium eligens ATCC 27750 plasmid unnamed, complete sequence. (NC_012780)=NC_012780,NC_012780.1,gi|238921767|ref|NC_012780.1| -Eubacterium eligens ATCC 27750 plasmid unnamed, complete sequence. (NC_012782)=NC_012782,NC_012782.1,gi|238909104|ref|NC_012782.1| -Eubacterium limosum KIST612 chromosome, complete genome. (NC_014624)=NC_014624,NC_014624.2,gi|365823354|ref|NC_014624.2| -Eubacterium rectale ATCC 33656, complete genome. (NC_012781)=NC_012781,NC_012781.1,gi|238922432|ref|NC_012781.1| -Exiguobacterium sp. AT1b chromosome, complete genome. (NC_012673)=NC_012673,NC_012673.1,gi|229915734|ref|NC_012673.1| -Exiguobacterium sibiricum 255-15 chromosome, complete genome. (NC_010556)=NC_010556,NC_010556.1,gi|172056045|ref|NC_010556.1| -Exiguobacterium sibiricum 255-15 plasmid pEXIG01, complete (NC_010549)=NC_010549,NC_010549.1,gi|172059053|ref|NC_010549.1| -Exiguobacterium sibiricum 255-15 plasmid pEXIG02, complete (NC_010550)=NC_010550,NC_010550.1,gi|172059059|ref|NC_010550.1| -Ferrimonas balearica DSM 9799 chromosome, complete genome. (NC_014541)=NC_014541,NC_014541.1,gi|308047722|ref|NC_014541.1| -Ferroglobus placidus DSM 10642 chromosome, complete genome. (NC_013849)=NC_013849,NC_013849.1,gi|288930407|ref|NC_013849.1| -Fervidicoccus fontis Kam940 chromosome, complete genome. (NC_017461)=NC_017461,NC_017461.1,gi|385805051|ref|NC_017461.1| -Fervidobacterium nodosum Rt17-B1 chromosome, complete genome. (NC_009718)=NC_009718,NC_009718.1,gi|154248705|ref|NC_009718.1| -Fervidobacterium pennivorans DSM 9078 chromosome, complete genome. (NC_017095)=NC_017095,NC_017095.1,gi|383785713|ref|NC_017095.1| -Fibrobacter succinogenes subsp. succinogenes S85 chromosome, (NC_017448)=NC_017448,NC_017448.1,gi|385789060|ref|NC_017448.1| -Fibrobacter succinogenes subsp. succinogenes S85 chromosome, (NC_013410)=NC_013410,NC_013410.1,gi|261414414|ref|NC_013410.1| -Filifactor alocis ATCC 35896 chromosome, complete genome. (NC_016630)=NC_016630,NC_016630.1,gi|374307319|ref|NC_016630.1| -Finegoldia magna ATCC 29328 chromosome, complete genome. (NC_010376)=NC_010376,NC_010376.1,gi|169823697|ref|NC_010376.1| -Finegoldia magna ATCC 29328 plasmid pFMC, complete sequence. (NC_010371)=NC_010371,NC_010371.1,gi|169823514|ref|NC_010371.1| -Flavobacteriaceae bacterium 3519-10, complete genome. (NC_013062)=NC_013062,NC_013062.1,gi|255534169|ref|NC_013062.1| -Maribacter sp. HTCC2170 chromosome, complete genome. (NC_014472)=NC_014472,NC_014472.1,gi|305664376|ref|NC_014472.1| -Flavobacterium branchiophilum FL-15, complete genome. (NC_016001)=NC_016001,NC_016001.1,gi|347534971|ref|NC_016001.1| -Flavobacterium columnare ATCC 49512 chromosome, complete genome. (NC_016510)=NC_016510,NC_016510.2,gi|386262266|ref|NC_016510.2| -Flavobacterium indicum GPTSA100-9, complete genome. (NC_017025)=NC_017025,NC_017025.1,gi|383449352|ref|NC_017025.1| -Flavobacterium johnsoniae UW101 chromosome, complete genome. (NC_009441)=NC_009441,NC_009441.1,gi|146297766|ref|NC_009441.1| -Flavobacterium psychrophilum JIP02/86 chromosome, complete genome. (NC_009613)=NC_009613,NC_009613.1,gi|150024114|ref|NC_009613.1| -Flexibacter litoralis DSM 6794 chromosome, complete genome. (NC_018018)=NC_018018,NC_018018.1,gi|392395704|ref|NC_018018.1| -Flexistipes sinusarabici DSM 4947 chromosome, complete genome. (NC_015672)=NC_015672,NC_015672.1,gi|336322299|ref|NC_015672.1| -Fluviicola taffensis DSM 16823 chromosome, complete genome. (NC_015321)=NC_015321,NC_015321.1,gi|327402011|ref|NC_015321.1| -Francisella sp. TX077308 chromosome, complete genome. (NC_015696)=NC_015696,NC_015696.1,gi|337754017|ref|NC_015696.1| -Francisella cf. novicida 3523 chromosome, complete genome. (NC_017449)=NC_017449,NC_017449.1,gi|387823583|ref|NC_017449.1| -Francisella cf. novicida Fx1 chromosome, complete genome. (NC_017450)=NC_017450,NC_017450.1,gi|385791932|ref|NC_017450.1| -Francisella noatunensis subsp. orientalis str. Toba 04 chromosome, (NC_017909)=NC_017909,NC_017909.1,gi|387885754|ref|NC_017909.1| -Francisella novicida U112 chromosome, complete genome. (NC_008601)=NC_008601,NC_008601.1,gi|118496615|ref|NC_008601.1| -Francisella philomiragia subsp. philomiragia ATCC 25017 chromosome, (NC_010336)=NC_010336,NC_010336.1,gi|167626225|ref|NC_010336.1| -Francisella philomiragia subsp. philomiragia ATCC 25017 plasmid (NC_010331)=NC_010331,NC_010331.1,gi|167626220|ref|NC_010331.1| -Francisella tularensis subsp. tularensis FSC198 chromosome, (NC_008245)=NC_008245,NC_008245.1,gi|110669657|ref|NC_008245.1| -Francisella tularensis subsp. tularensis NE061598 chromosome, (NC_017453)=NC_017453,NC_017453.1,gi|385793751|ref|NC_017453.1| -Francisella tularensis subsp. tularensis SCHU S4 chromosome, (NC_006570)=NC_006570,NC_006570.2,gi|255961454|ref|NC_006570.2| -Francisella tularensis subsp. tularensis TI0902 chromosome, (NC_016937)=NC_016937,NC_016937.1,gi|379725073|ref|NC_016937.1| -Francisella tularensis TIGB03 chromosome, complete genome. (NC_016933)=NC_016933,NC_016933.1,gi|379716390|ref|NC_016933.1| -Francisella tularensis subsp. tularensis WY96-3418 chromosome, (NC_009257)=NC_009257,NC_009257.1,gi|134301169|ref|NC_009257.1| -Francisella tularensis subsp. holarctica FTNF002-00 chromosome, (NC_009749)=NC_009749,NC_009749.1,gi|156501369|ref|NC_009749.1| -Francisella tularensis subsp. holarctica LVS chromosome, complete (NC_007880)=NC_007880,NC_007880.1,gi|89255449|ref|NC_007880.1| -Francisella tularensis subsp. holarctica OSU18 chromosome, complete (NC_008369)=NC_008369,NC_008369.1,gi|115313981|ref|NC_008369.1| -Francisella tularensis subsp. mediasiatica FSC147 chromosome, (NC_010677)=NC_010677,NC_010677.1,gi|187930913|ref|NC_010677.1| -Frankia sp. CcI3 chromosome, complete genome. (NC_007777)=NC_007777,NC_007777.1,gi|86738724|ref|NC_007777.1| -Frankia sp. EAN1pec chromosome, complete genome. (NC_009921)=NC_009921,NC_009921.1,gi|158311867|ref|NC_009921.1| -Frankia sp. EuI1c chromosome, complete genome. (NC_014666)=NC_014666,NC_014666.1,gi|312193897|ref|NC_014666.1| -Frankia alni ACN14a chromosome, complete genome. (NC_008278)=NC_008278,NC_008278.1,gi|111219505|ref|NC_008278.1| -Frankia symbiont of Datisca glomerata chromosome, complete genome. (NC_015656)=NC_015656,NC_015656.1,gi|336176139|ref|NC_015656.1| -Frankia symbiont of Datisca glomerata plasmid pFSYMDG01, complete (NC_015664)=NC_015664,NC_015664.1,gi|336176124|ref|NC_015664.1| -Frankia symbiont of Datisca glomerata plasmid pFSYMDG02, complete (NC_015657)=NC_015657,NC_015657.1,gi|336176136|ref|NC_015657.1| -Frateuria aurantia DSM 6220 chromosome, complete genome. (NC_017033)=NC_017033,NC_017033.1,gi|383315351|ref|NC_017033.1| -Fusobacterium nucleatum subsp. nucleatum ATCC 25586 chromosome, (NC_003454)=NC_003454,NC_003454.1,gi|19703352|ref|NC_003454.1| -Gallibacterium anatis UMN179 chromosome, complete genome. (NC_015460)=NC_015460,NC_015460.1,gi|332288085|ref|NC_015460.1| -Gallibacterium anatis UMN179 plasmid pUMN179, complete sequence. (NC_015461)=NC_015461,NC_015461.1,gi|332290580|ref|NC_015461.1| -Gallionella capsiferriformans ES-2 chromosome, complete genome. (NC_014394)=NC_014394,NC_014394.1,gi|302877245|ref|NC_014394.1| -Gardnerella vaginalis 409-05 chromosome, complete genome. (NC_013721)=NC_013721,NC_013721.1,gi|283782520|ref|NC_013721.1| -Gardnerella vaginalis ATCC 14019 chromosome, complete genome. (NC_014644)=NC_014644,NC_014644.1,gi|311113888|ref|NC_014644.1| -Gardnerella vaginalis HMP9231 chromosome, complete genome. (NC_017456)=NC_017456,NC_017456.1,gi|385800986|ref|NC_017456.1| -Gemmatimonas aurantiaca T-27, complete genome. (NC_012489)=NC_012489,NC_012489.1,gi|226225406|ref|NC_012489.1| -Geobacillus sp. C56-T3 chromosome, complete genome. (NC_014206)=NC_014206,NC_014206.1,gi|297528376|ref|NC_014206.1| -Geobacillus sp. WCH70 chromosome, complete genome. (NC_012793)=NC_012793,NC_012793.1,gi|239825584|ref|NC_012793.1| -Geobacillus sp. WCH70 plasmid pWCH7001, complete sequence. (NC_012794)=NC_012794,NC_012794.1,gi|239828713|ref|NC_012794.1| -Geobacillus sp. WCH70 plasmid pWCH7002, complete sequence. (NC_012790)=NC_012790,NC_012790.1,gi|239812973|ref|NC_012790.1| -Geobacillus sp. Y412MC52 chromosome, complete genome. (NC_014915)=NC_014915,NC_014915.1,gi|319765157|ref|NC_014915.1| -Geobacillus sp. Y412MC52 plasmid pGYMC5201, complete sequence. (NC_014916)=NC_014916,NC_014916.1,gi|319768578|ref|NC_014916.1| -Geobacillus sp. Y412MC61 chromosome, complete genome. (NC_013411)=NC_013411,NC_013411.1,gi|261417500|ref|NC_013411.1| -Geobacillus sp. Y412MC61 plasmid pGYMC6101, complete sequence. (NC_013412)=NC_013412,NC_013412.1,gi|261420908|ref|NC_013412.1| -Geobacillus sp. Y4.1MC1 chromosome, complete genome. (NC_014650)=NC_014650,NC_014650.1,gi|312109151|ref|NC_014650.1| -Geobacillus sp. Y4.1MC1 plasmid pGY4MC101, complete sequence. (NC_014651)=NC_014651,NC_014651.1,gi|312193406|ref|NC_014651.1| -Geobacillus kaustophilus HTA426 chromosome, complete genome. (NC_006510)=NC_006510,NC_006510.1,gi|56418535|ref|NC_006510.1| -Geobacillus kaustophilus HTA426 plasmid pHTA426, complete sequence. (NC_006509)=NC_006509,NC_006509.1,gi|56410437|ref|NC_006509.1| -Geobacillus thermodenitrificans NG80-2 chromosome, complete genome. (NC_009328)=NC_009328,NC_009328.1,gi|138893679|ref|NC_009328.1| -Geobacillus thermodenitrificans NG80-2 plasmid pLW1071, complete (NC_009329)=NC_009329,NC_009329.1,gi|138898339|ref|NC_009329.1| -Geobacillus thermoglucosidasius C56-YS93 chromosome, complete (NC_015660)=NC_015660,NC_015660.1,gi|336233546|ref|NC_015660.1| -Geobacillus thermoglucosidasius C56-YS93 plasmid pGEOTH01, complete (NC_015665)=NC_015665,NC_015665.1,gi|336233474|ref|NC_015665.1| -Geobacillus thermoglucosidasius C56-YS93 plasmid pGEOTH02, complete (NC_015661)=NC_015661,NC_015661.1,gi|336237224|ref|NC_015661.1| -Geobacillus thermoleovorans CCB_US3_UF5 chromosome, complete (NC_016593)=NC_016593,NC_016593.1,gi|375006802|ref|NC_016593.1| -Geobacter sp. FRC-32 chromosome, complete genome. (NC_011979)=NC_011979,NC_011979.1,gi|222053117|ref|NC_011979.1| -Geobacter sp. M18 chromosome, complete genome. (NC_014973)=NC_014973,NC_014973.1,gi|322417545|ref|NC_014973.1| -Geobacter sp. M21 chromosome, complete genome. (NC_012918)=NC_012918,NC_012918.1,gi|253698656|ref|NC_012918.1| -Geobacter bemidjiensis Bem chromosome, complete genome. (NC_011146)=NC_011146,NC_011146.1,gi|197116402|ref|NC_011146.1| -Geobacter lovleyi SZ chromosome, complete genome. (NC_010814)=NC_010814,NC_010814.1,gi|189423082|ref|NC_010814.1| -Geobacter lovleyi SZ plasmid pGLOV01, complete sequence. (NC_010815)=NC_010815,NC_010815.1,gi|189426689|ref|NC_010815.1| -Geobacter metallireducens GS-15 chromosome, complete genome. (NC_007517)=NC_007517,NC_007517.1,gi|78221228|ref|NC_007517.1| -Geobacter metallireducens GS-15 plasmid unnamed, complete sequence. (NC_007515)=NC_007515,NC_007515.1,gi|78214253|ref|NC_007515.1| -Geobacter sulfurreducens KN400 chromosome, complete genome. (NC_017454)=NC_017454,NC_017454.1,gi|385795588|ref|NC_017454.1| -Geobacter sulfurreducens PCA chromosome, complete genome. (NC_002939)=NC_002939,NC_002939.4,gi|39995111|ref|NC_002939.4| -Geobacter uraniireducens Rf4 chromosome, complete genome. (NC_009483)=NC_009483,NC_009483.1,gi|148262085|ref|NC_009483.1| -Geodermatophilus obscurus DSM 43160 chromosome, complete genome. (NC_013757)=NC_013757,NC_013757.1,gi|284988629|ref|NC_013757.1| -Glaciecola sp. 4H-3-7+YE-5 chromosome, complete genome. (NC_015497)=NC_015497,NC_015497.1,gi|332304386|ref|NC_015497.1| -Glaciecola sp. 4H-3-7+YE-5 plasmid pGLAAG01, complete sequence. (NC_015498)=NC_015498,NC_015498.1,gi|332308620|ref|NC_015498.1| -Glaciecola nitratireducens FR1064 chromosome, complete genome. (NC_016041)=NC_016041,NC_016041.1,gi|348027467|ref|NC_016041.1| -Gloeobacter violaceus PCC 7421 chromosome, complete genome. (NC_005125)=NC_005125,NC_005125.1,gi|37519569|ref|NC_005125.1| -Gluconacetobacter diazotrophicus PAl 5 chromosome, complete genome. (NC_011365)=NC_011365,NC_011365.1,gi|209542188|ref|NC_011365.1| -Gluconacetobacter diazotrophicus PAl 5 plasmid pGDIA01, complete (NC_011367)=NC_011367,NC_011367.1,gi|209542158|ref|NC_011367.1| -Gluconacetobacter diazotrophicus PAl 5 chromosome, complete genome. (NC_010125)=NC_010125,NC_010125.1,gi|162145846|ref|NC_010125.1| -Gluconacetobacter diazotrophicus PAl 5 plasmid pGDIPal5I, complete (NC_010124)=NC_010124,NC_010124.1,gi|161986673|ref|NC_010124.1| -Gluconacetobacter diazotrophicus PAl 5 plasmid pGDIPal5II, complete (NC_010123)=NC_010123,NC_010123.1,gi|161986651|ref|NC_010123.1| -Gluconacetobacter xylinus NBRC 3288 plasmid pGXY010, complete (NC_016037)=NC_016037,NC_016037.1,gi|347822692|ref|NC_016037.1| -Gluconacetobacter xylinus NBRC 3288 plasmid pGXY020, complete (NC_016021)=NC_016021,NC_016021.1,gi|347626458|ref|NC_016021.1| -Gluconacetobacter xylinus NBRC 3288 plasmid pGXY030, complete (NC_016028)=NC_016028,NC_016028.1,gi|347762033|ref|NC_016028.1| -Gluconacetobacter xylinus NBRC 3288 plasmid pGXY040, complete (NC_016022)=NC_016022,NC_016022.1,gi|347626537|ref|NC_016022.1| -Gluconacetobacter xylinus NBRC 3288 plasmid pGXY050, complete (NC_016029)=NC_016029,NC_016029.1,gi|347662274|ref|NC_016029.1| -Gluconacetobacter xylinus NBRC 3288 plasmid pGXY060, complete (NC_016900)=NC_016900,NC_016900.1,gi|377643906|ref|NC_016900.1| -Gluconacetobacter xylinus NBRC 3288 plasmid pGXY070, complete (NC_016030)=NC_016030,NC_016030.1,gi|347662280|ref|NC_016030.1| -Gluconacetobacter xylinus NBRC 3288, complete genome. (NC_016027)=NC_016027,NC_016027.1,gi|347759221|ref|NC_016027.1| -Gluconobacter oxydans 621H chromosome, complete genome. (NC_006677)=NC_006677,NC_006677.1,gi|58038491|ref|NC_006677.1| -Gluconobacter oxydans 621H plasmid pGOX1, complete sequence. (NC_006672)=NC_006672,NC_006672.1,gi|58038254|ref|NC_006672.1| -Gluconobacter oxydans 621H plasmid pGOX2, complete sequence. (NC_006673)=NC_006673,NC_006673.1,gi|58038418|ref|NC_006673.1| -Gluconobacter oxydans 621H plasmid pGOX3, complete sequence. (NC_006674)=NC_006674,NC_006674.1,gi|58038448|ref|NC_006674.1| -Gluconobacter oxydans 621H plasmid pGOX4, complete sequence. (NC_006675)=NC_006675,NC_006675.1,gi|58038467|ref|NC_006675.1| -Gluconobacter oxydans 621H plasmid pGOX5, complete sequence. (NC_006676)=NC_006676,NC_006676.1,gi|58038486|ref|NC_006676.1| -Gordonia bronchialis DSM 43247 chromosome, complete genome. (NC_013441)=NC_013441,NC_013441.1,gi|262200046|ref|NC_013441.1| -Gordonia bronchialis DSM 43247 plasmid pGBRO01, complete sequence. (NC_013442)=NC_013442,NC_013442.1,gi|262118100|ref|NC_013442.1| -Gordonia polyisoprenivorans VH2 chromosome, complete genome. (NC_016906)=NC_016906,NC_016906.1,gi|378715556|ref|NC_016906.1| -Gordonia polyisoprenivorans VH2 plasmid p174, complete sequence. (NC_016907)=NC_016907,NC_016907.1,gi|378720502|ref|NC_016907.1| -Gramella forsetii KT0803 chromosome, complete genome. (NC_008571)=NC_008571,NC_008571.1,gi|120434372|ref|NC_008571.1| -Granulibacter bethesdensis CGDNIH1 chromosome, complete genome. (NC_008343)=NC_008343,NC_008343.1,gi|114326664|ref|NC_008343.1| -Granulicella mallensis MP5ACTX8 chromosome, complete genome. (NC_016631)=NC_016631,NC_016631.1,gi|374308961|ref|NC_016631.1| -Haemophilus ducreyi 35000HP chromosome, complete genome. (NC_002940)=NC_002940,NC_002940.2,gi|33151282|ref|NC_002940.2| -Haemophilus influenzae 10810, complete genome. (NC_016809)=NC_016809,NC_016809.1,gi|378696079|ref|NC_016809.1| -Haemophilus influenzae 86-028NP chromosome, complete genome. (NC_007146)=NC_007146,NC_007146.2,gi|162960935|ref|NC_007146.2| -Haemophilus influenzae F3031 chromosome, complete genome. (NC_014920)=NC_014920,NC_014920.1,gi|319896422|ref|NC_014920.1| -Haemophilus influenzae F3047 chromosome, complete genome. (NC_014922)=NC_014922,NC_014922.1,gi|319774951|ref|NC_014922.1| -Haemophilus influenzae PittEE chromosome, complete genome. (NC_009566)=NC_009566,NC_009566.1,gi|148825133|ref|NC_009566.1| -Haemophilus influenzae PittGG chromosome, complete genome. (NC_009567)=NC_009567,NC_009567.1,gi|148826757|ref|NC_009567.1| -Haemophilus influenzae R2846 chromosome, complete genome. (NC_017452)=NC_017452,NC_017452.1,gi|386265029|ref|NC_017452.1| -Haemophilus influenzae R2866 chromosome, complete genome. (NC_017451)=NC_017451,NC_017451.1,gi|386263233|ref|NC_017451.1| -Haemophilus influenzae Rd KW20 chromosome, complete genome. (NC_000907)=NC_000907,NC_000907.1,gi|16271976|ref|NC_000907.1| -Haemophilus parainfluenzae T3T1, complete genome. (NC_015964)=NC_015964,NC_015964.1,gi|345428590|ref|NC_015964.1| -Haemophilus parasuis SH0165 chromosome, complete genome. (NC_011852)=NC_011852,NC_011852.1,gi|219870279|ref|NC_011852.1| -Haemophilus somnus 129PT chromosome, complete genome. (NC_008309)=NC_008309,NC_008309.1,gi|113460149|ref|NC_008309.1| -Haemophilus somnus 129PT plasmid pHS129, complete sequence. (NC_006298)=NC_006298,NC_006298.1,gi|52421262|ref|NC_006298.1| -Haemophilus somnus 2336 chromosome, complete genome. (NC_010519)=NC_010519,NC_010519.1,gi|170717206|ref|NC_010519.1| -Hahella chejuensis KCTC 2396 chromosome, complete genome. (NC_007645)=NC_007645,NC_007645.1,gi|83642913|ref|NC_007645.1| -Halalkalicoccus jeotgali B3 chromosome, complete genome. (NC_014297)=NC_014297,NC_014297.1,gi|300709370|ref|NC_014297.1| -Halalkalicoccus jeotgali B3 plasmid 1, complete sequence. (NC_014298)=NC_014298,NC_014298.1,gi|300712406|ref|NC_014298.1| -Halalkalicoccus jeotgali B3 plasmid 2, complete sequence. (NC_014299)=NC_014299,NC_014299.1,gi|300712769|ref|NC_014299.1| -Halalkalicoccus jeotgali B3 plasmid 3, complete sequence. (NC_014300)=NC_014300,NC_014300.1,gi|299883390|ref|NC_014300.1| -Halalkalicoccus jeotgali B3 plasmid 4, complete sequence. (NC_014301)=NC_014301,NC_014301.1,gi|299883432|ref|NC_014301.1| -Halalkalicoccus jeotgali B3 plasmid 5, complete sequence. (NC_014302)=NC_014302,NC_014302.1,gi|299883474|ref|NC_014302.1| -Halalkalicoccus jeotgali B3 plasmid 6, complete sequence. (NC_014303)=NC_014303,NC_014303.1,gi|299883499|ref|NC_014303.1| -Halanaerobium hydrogeniformans chromosome, complete genome. (NC_014654)=NC_014654,NC_014654.1,gi|312142408|ref|NC_014654.1| -Halanaerobium praevalens DSM 2228 chromosome, complete genome. (NC_017455)=NC_017455,NC_017455.1,gi|385798917|ref|NC_017455.1| -Haliangium ochraceum DSM 14365 chromosome, complete genome. (NC_013440)=NC_013440,NC_013440.1,gi|262193326|ref|NC_013440.1| -Haliscomenobacter hydrossis DSM 1100 chromosome, complete genome. (NC_015510)=NC_015510,NC_015510.1,gi|332661999|ref|NC_015510.1| -Haliscomenobacter hydrossis DSM 1100 plasmid pHALHY01, complete (NC_015511)=NC_015511,NC_015511.1,gi|332661768|ref|NC_015511.1| -Haliscomenobacter hydrossis DSM 1100 plasmid pHALHY02, complete (NC_015512)=NC_015512,NC_015512.1,gi|332661890|ref|NC_015512.1| -Haliscomenobacter hydrossis DSM 1100 plasmid pHALHY03, complete (NC_015513)=NC_015513,NC_015513.1,gi|332668451|ref|NC_015513.1| -Haloarcula hispanica ATCC 33960 chromosome I, complete sequence. (NC_015948)=NC_015948,NC_015948.1,gi|344210305|ref|NC_015948.1| -Haloarcula hispanica ATCC 33960 chromosome II, complete sequence. (NC_015943)=NC_015943,NC_015943.1,gi|344209485|ref|NC_015943.1| -Haloarcula hispanica ATCC 33960 plasmid pHH400, complete sequence. (NC_015944)=NC_015944,NC_015944.1,gi|344209942|ref|NC_015944.1| -Haloarcula marismortui ATCC 43049 chromosome I, complete sequence. (NC_006396)=NC_006396,NC_006396.1,gi|55376942|ref|NC_006396.1| -Haloarcula marismortui ATCC 43049 chromosome II, complete sequence. (NC_006397)=NC_006397,NC_006397.1,gi|55380074|ref|NC_006397.1| -Haloarcula marismortui ATCC 43049 plasmid pNG100, complete (NC_006389)=NC_006389,NC_006389.1,gi|55376107|ref|NC_006389.1| -Haloarcula marismortui ATCC 43049 plasmid pNG200, complete (NC_006390)=NC_006390,NC_006390.1,gi|55376144|ref|NC_006390.1| -Haloarcula marismortui ATCC 43049 plasmid pNG300, complete (NC_006391)=NC_006391,NC_006391.1,gi|55376187|ref|NC_006391.1| -Haloarcula marismortui ATCC 43049 plasmid pNG400, complete (NC_006392)=NC_006392,NC_006392.1,gi|55376228|ref|NC_006392.1| -Haloarcula marismortui ATCC 43049 plasmid pNG500, complete (NC_006393)=NC_006393,NC_006393.1,gi|55376280|ref|NC_006393.1| -Haloarcula marismortui ATCC 43049 plasmid pNG600, complete (NC_006394)=NC_006394,NC_006394.1,gi|55376412|ref|NC_006394.1| -Haloarcula marismortui ATCC 43049 plasmid pNG700, complete (NC_006395)=NC_006395,NC_006395.1,gi|55376579|ref|NC_006395.1| -Halobacillus halophilus DSM 2266 plasmid PL16, complete sequence. (NC_017669)=NC_017669,NC_017669.1,gi|386716456|ref|NC_017669.1| -Halobacillus halophilus DSM 2266 plasmid PL3, complete sequence. (NC_017670)=NC_017670,NC_017670.1,gi|386118364|ref|NC_017670.1| -Halobacillus halophilus DSM 2266, complete genome. (NC_017668)=NC_017668,NC_017668.1,gi|386712343|ref|NC_017668.1| -Halobacterium sp. NRC-1 chromosome, complete genome. (NC_002607)=NC_002607,NC_002607.1,gi|15789340|ref|NC_002607.1| -Halobacterium sp. NRC-1 plasmid pNRC100, complete sequence. (NC_001869)=NC_001869,NC_001869.1,gi|10803547|ref|NC_001869.1| -Halobacterium sp. NRC-1 plasmid pNRC200, complete sequence. (NC_002608)=NC_002608,NC_002608.1,gi|16119979|ref|NC_002608.1| -Halobacterium salinarum R1 plasmid PHS1, complete sequence. (NC_010366)=NC_010366,NC_010366.1,gi|169237160|ref|NC_010366.1| -Halobacterium salinarum R1 plasmid PHS2, complete sequence. (NC_010369)=NC_010369,NC_010369.1,gi|169237602|ref|NC_010369.1| -Halobacterium salinarum R1 plasmid PHS3, complete sequence. (NC_010368)=NC_010368,NC_010368.1,gi|169237353|ref|NC_010368.1| -Halobacterium salinarum R1 plasmid PHS4, complete sequence. (NC_010367)=NC_010367,NC_010367.1,gi|169237313|ref|NC_010367.1| -Halobacterium salinarum R1, complete genome. (NC_010364)=NC_010364,NC_010364.1,gi|169235049|ref|NC_010364.1| -Haloferax mediterranei ATCC 33500 chromosome, complete genome. (NC_017941)=NC_017941,NC_017941.1,gi|389845493|ref|NC_017941.1| -Haloferax mediterranei ATCC 33500 plasmid pHM100, complete (NC_017942)=NC_017942,NC_017942.1,gi|389848445|ref|NC_017942.1| -Haloferax mediterranei ATCC 33500 plasmid pHM300, complete (NC_017943)=NC_017943,NC_017943.1,gi|389848587|ref|NC_017943.1| -Haloferax mediterranei ATCC 33500 plasmid pHM500, complete (NC_017944)=NC_017944,NC_017944.1,gi|389848879|ref|NC_017944.1| -Haloferax volcanii DS2 chromosome, complete genome. (NC_013967)=NC_013967,NC_013967.1,gi|292654178|ref|NC_013967.1| -Haloferax volcanii DS2 plasmid pHV1, complete sequence. (NC_013968)=NC_013968,NC_013968.1,gi|292657124|ref|NC_013968.1| -Haloferax volcanii DS2 plasmid pHV2, complete sequence. (NC_013965)=NC_013965,NC_013965.1,gi|292494315|ref|NC_013965.1| -Haloferax volcanii DS2 plasmid pHV3, complete sequence. (NC_013964)=NC_013964,NC_013964.1,gi|292493938|ref|NC_013964.1| -Haloferax volcanii DS2 plasmid pHV4, complete sequence. (NC_013966)=NC_013966,NC_013966.1,gi|292653566|ref|NC_013966.1| -Halogeometricum borinquense DSM 11551 chromosome, complete genome. (NC_014729)=NC_014729,NC_014729.1,gi|313124788|ref|NC_014729.1| -Halogeometricum borinquense DSM 11551 plasmid pHBOR01, complete (NC_014735)=NC_014735,NC_014735.1,gi|313117184|ref|NC_014735.1| -Halogeometricum borinquense DSM 11551 plasmid pHBOR02, complete (NC_014731)=NC_014731,NC_014731.1,gi|313116827|ref|NC_014731.1| -Halogeometricum borinquense DSM 11551 plasmid pHBOR03, complete (NC_014736)=NC_014736,NC_014736.1,gi|313122549|ref|NC_014736.1| -Halogeometricum borinquense DSM 11551 plasmid pHBOR04, complete (NC_014732)=NC_014732,NC_014732.1,gi|313122369|ref|NC_014732.1| -Halogeometricum borinquense DSM 11551 plasmid pHBOR05, complete (NC_014737)=NC_014737,NC_014737.1,gi|313122739|ref|NC_014737.1| -Halomicrobium mukohataei DSM 12286 chromosome, complete genome. (NC_013202)=NC_013202,NC_013202.1,gi|257386085|ref|NC_013202.1| -Halomicrobium mukohataei DSM 12286 plasmid pHmuk01, complete (NC_013201)=NC_013201,NC_013201.1,gi|257372908|ref|NC_013201.1| -Halomonas elongata DSM 2581 chromosome, complete genome. (NC_014532)=NC_014532,NC_014532.1,gi|307543589|ref|NC_014532.1| -Halopiger xanaduensis SH-6 chromosome, complete genome. (NC_015666)=NC_015666,NC_015666.1,gi|336252096|ref|NC_015666.1| -Halopiger xanaduensis SH-6 plasmid pHALXA01, complete sequence. (NC_015658)=NC_015658,NC_015658.1,gi|336251750|ref|NC_015658.1| -Halopiger xanaduensis SH-6 plasmid pHALXA02, complete sequence. (NC_015667)=NC_015667,NC_015667.1,gi|336251560|ref|NC_015667.1| -Halopiger xanaduensis SH-6 plasmid pHALXA03, complete sequence. (NC_015659)=NC_015659,NC_015659.1,gi|336251460|ref|NC_015659.1| -Haloquadratum walsbyi C23 plasmid PL100, complete sequence. (NC_017457)=NC_017457,NC_017457.1,gi|385802304|ref|NC_017457.1| -Haloquadratum walsbyi C23 plasmid PL6A, complete sequence. (NC_017460)=NC_017460,NC_017460.1,gi|385805044|ref|NC_017460.1| -Haloquadratum walsbyi C23 plasmid PL6B, complete sequence. (NC_017458)=NC_017458,NC_017458.1,gi|385802375|ref|NC_017458.1| -Haloquadratum walsbyi C23, complete genome. (NC_017459)=NC_017459,NC_017459.1,gi|385802382|ref|NC_017459.1| -Haloquadratum walsbyi DSM 16790 plasmid PL47, complete sequence. (NC_008213)=NC_008213,NC_008213.1,gi|109644367|ref|NC_008213.1| -Haloquadratum walsbyi DSM 16790, complete genome. (NC_008212)=NC_008212,NC_008212.1,gi|110666976|ref|NC_008212.1| -Halorhabdus utahensis DSM 12940 chromosome, complete genome. (NC_013158)=NC_013158,NC_013158.1,gi|257051090|ref|NC_013158.1| -Halorhodospira halophila SL1 chromosome, complete genome. (NC_008789)=NC_008789,NC_008789.1,gi|121996810|ref|NC_008789.1| -Halorubrum lacusprofundi ATCC 49239 chromosome 1, complete genome. (NC_012029)=NC_012029,NC_012029.1,gi|222478439|ref|NC_012029.1| -Halorubrum lacusprofundi ATCC 49239 chromosome 2, complete genome. (NC_012028)=NC_012028,NC_012028.1,gi|222475682|ref|NC_012028.1| -Halorubrum lacusprofundi ATCC 49239 plasmid pHLAC01, complete (NC_012030)=NC_012030,NC_012030.1,gi|222481151|ref|NC_012030.1| -Haloterrigena turkmenica DSM 5511 chromosome, complete genome. (NC_013743)=NC_013743,NC_013743.1,gi|284163295|ref|NC_013743.1| -Haloterrigena turkmenica DSM 5511 plasmid pHTUR01, complete (NC_013744)=NC_013744,NC_013744.1,gi|284167035|ref|NC_013744.1| -Haloterrigena turkmenica DSM 5511 plasmid pHTUR02, complete (NC_013745)=NC_013745,NC_013745.1,gi|284172524|ref|NC_013745.1| -Haloterrigena turkmenica DSM 5511 plasmid pHTUR03, complete (NC_013746)=NC_013746,NC_013746.1,gi|284172854|ref|NC_013746.1| -Haloterrigena turkmenica DSM 5511 plasmid pHTUR04, complete (NC_013747)=NC_013747,NC_013747.1,gi|284176133|ref|NC_013747.1| -Haloterrigena turkmenica DSM 5511 plasmid pHTUR05, complete (NC_013748)=NC_013748,NC_013748.1,gi|284176293|ref|NC_013748.1| -Haloterrigena turkmenica DSM 5511 plasmid pHTUR06, complete (NC_013749)=NC_013749,NC_013749.1,gi|284176391|ref|NC_013749.1| -Halothermothrix orenii H 168 chromosome, complete genome. (NC_011899)=NC_011899,NC_011899.1,gi|220930850|ref|NC_011899.1| -Halothiobacillus neapolitanus c2 chromosome, complete genome. (NC_013422)=NC_013422,NC_013422.1,gi|261854630|ref|NC_013422.1| -Helicobacter acinonychis str. Sheeba chromosome, complete genome. (NC_008229)=NC_008229,NC_008229.1,gi|109946640|ref|NC_008229.1| -Helicobacter acinonychis str. Sheeba plasmid pHac1, complete (NC_008230)=NC_008230,NC_008230.1,gi|109948253|ref|NC_008230.1| -Helicobacter bizzozeronii CIII-1 plasmid phbz1, complete sequence. (NC_015670)=NC_015670,NC_015670.1,gi|336319056|ref|NC_015670.1| -Helicobacter bizzozeronii CIII-1, complete genome. (NC_015674)=NC_015674,NC_015674.1,gi|336452232|ref|NC_015674.1| -Helicobacter cetorum MIT 00-7128 chromosome, complete genome. (NC_017737)=NC_017737,NC_017737.1,gi|386748726|ref|NC_017737.1| -Helicobacter cetorum MIT 00-7128 plasmid pHCW, complete sequence. (NC_017738)=NC_017738,NC_017738.1,gi|386748711|ref|NC_017738.1| -Helicobacter cetorum MIT 99-5656 chromosome, complete genome. (NC_017735)=NC_017735,NC_017735.1,gi|386747036|ref|NC_017735.1| -Helicobacter cetorum MIT 99-5656 plasmid pHCD, complete sequence. (NC_017736)=NC_017736,NC_017736.1,gi|386747020|ref|NC_017736.1| -Helicobacter cinaedi PAGU611 plasmid pHci1, complete sequence. (NC_017762)=NC_017762,NC_017762.1,gi|386829695|ref|NC_017762.1| -Helicobacter cinaedi PAGU611, complete genome. (NC_017761)=NC_017761,NC_017761.1,gi|386760820|ref|NC_017761.1| -Helicobacter felis ATCC 49179 chromosome, complete genome. (NC_014810)=NC_014810,NC_014810.2,gi|332309247|ref|NC_014810.2| -Helicobacter hepaticus ATCC 51449 chromosome, complete genome. (NC_004917)=NC_004917,NC_004917.1,gi|32265499|ref|NC_004917.1| -Helicobacter mustelae 12198 chromosome, complete genome. (NC_013949)=NC_013949,NC_013949.1,gi|291276243|ref|NC_013949.1| -Helicobacter pylori 2017 chromosome, complete genome. (NC_017374)=NC_017374,NC_017374.1,gi|385223048|ref|NC_017374.1| -Helicobacter pylori 2018 chromosome, complete genome. (NC_017381)=NC_017381,NC_017381.1,gi|385230889|ref|NC_017381.1| -Helicobacter pylori 26695 chromosome, complete genome. (NC_000915)=NC_000915,NC_000915.1,gi|15644634|ref|NC_000915.1| -Helicobacter pylori 35A chromosome, complete genome. (NC_017360)=NC_017360,NC_017360.1,gi|384895178|ref|NC_017360.1| -Helicobacter pylori 51 chromosome, complete genome. (NC_017382)=NC_017382,NC_017382.1,gi|387781698|ref|NC_017382.1| -Helicobacter pylori 83 chromosome, complete genome. (NC_017375)=NC_017375,NC_017375.1,gi|385224642|ref|NC_017375.1| -Helicobacter pylori 908 chromosome, complete genome. (NC_017357)=NC_017357,NC_017357.1,gi|384890373|ref|NC_017357.1| -Helicobacter pylori B38 chromosome, complete genome. (NC_012973)=NC_012973,NC_012973.1,gi|254778738|ref|NC_012973.1| -Helicobacter pylori B8 chromosome, complete genome. (NC_014256)=NC_014256,NC_014256.1,gi|298735500|ref|NC_014256.1| -Helicobacter pylori B8 plasmid HPB8p, complete sequence. (NC_014257)=NC_014257,NC_014257.1,gi|298717635|ref|NC_014257.1| -Helicobacter pylori Cuz20 chromosome, complete genome. (NC_017358)=NC_017358,NC_017358.1,gi|384892008|ref|NC_017358.1| -Helicobacter pylori ELS37 chromosome, complete genome. (NC_017063)=NC_017063,NC_017063.1,gi|383749063|ref|NC_017063.1| -Helicobacter pylori ELS37 plasmid pHPELS37, complete sequence. (NC_017064)=NC_017064,NC_017064.1,gi|383750634|ref|NC_017064.1| -Helicobacter pylori F16, complete genome. (NC_017368)=NC_017368,NC_017368.1,gi|385216759|ref|NC_017368.1| -Helicobacter pylori F30 plasmid pHPF30, complete sequence. (NC_017369)=NC_017369,NC_017369.1,gi|385218260|ref|NC_017369.1| -Helicobacter pylori F30, complete genome. (NC_017365)=NC_017365,NC_017365.1,gi|384898367|ref|NC_017365.1| -Helicobacter pylori F32 plasmid pHPF32, complete sequence. (NC_017370)=NC_017370,NC_017370.1,gi|386262355|ref|NC_017370.1| -Helicobacter pylori F32, complete genome. (NC_017366)=NC_017366,NC_017366.1,gi|385215269|ref|NC_017366.1| -Helicobacter pylori F57, complete genome. (NC_017367)=NC_017367,NC_017367.1,gi|385248496|ref|NC_017367.1| -Helicobacter pylori G27 chromosome, complete genome. (NC_011333)=NC_011333,NC_011333.1,gi|208433976|ref|NC_011333.1| -Helicobacter pylori G27 plasmid pHPG27, complete sequence. (NC_011334)=NC_011334,NC_011334.1,gi|208435470|ref|NC_011334.1| -Helicobacter pylori Gambia94/24 chromosome, complete genome. (NC_017371)=NC_017371,NC_017371.1,gi|385218266|ref|NC_017371.1| -Helicobacter pylori Gambia94/24 plasmid unnamed, complete sequence. (NC_017364)=NC_017364,NC_017364.1,gi|385219871|ref|NC_017364.1| -Helicobacter pylori HPAG1 chromosome, complete genome. (NC_008086)=NC_008086,NC_008086.1,gi|108562424|ref|NC_008086.1| -Helicobacter pylori HPAG1 plasmid pHPAG1, complete sequence. (NC_008087)=NC_008087,NC_008087.1,gi|108564598|ref|NC_008087.1| -Helicobacter pylori HUP-B14 chromosome, complete genome. (NC_017733)=NC_017733,NC_017733.1,gi|386745526|ref|NC_017733.1| -Helicobacter pylori HUP-B14 plasmid pHPB14, complete sequence. (NC_017734)=NC_017734,NC_017734.1,gi|386745517|ref|NC_017734.1| -Helicobacter pylori India7 chromosome, complete genome. (NC_017372)=NC_017372,NC_017372.1,gi|385219873|ref|NC_017372.1| -Helicobacter pylori J99 chromosome, complete genome. (NC_000921)=NC_000921,NC_000921.1,gi|15611071|ref|NC_000921.1| -Helicobacter pylori Lithuania75 chromosome, complete genome. (NC_017362)=NC_017362,NC_017362.1,gi|384896752|ref|NC_017362.1| -Helicobacter pylori Lithuania75 plasmid unnamed, complete sequence. (NC_017363)=NC_017363,NC_017363.1,gi|384896665|ref|NC_017363.1| -Helicobacter pylori P12 chromosome, complete genome. (NC_011498)=NC_011498,NC_011498.1,gi|210134201|ref|NC_011498.1| -Helicobacter pylori P12 plasmid HPP12, complete sequence. (NC_011499)=NC_011499,NC_011499.1,gi|210135770|ref|NC_011499.1| -Helicobacter pylori PeCan18 chromosome, complete genome. (NC_017742)=NC_017742,NC_017742.1,gi|386755084|ref|NC_017742.1| -Helicobacter pylori PeCan4 chromosome, complete genome. (NC_014555)=NC_014555,NC_014555.1,gi|308182188|ref|NC_014555.1| -Helicobacter pylori PeCan4 plasmid pHPPC4, complete sequence. (NC_014556)=NC_014556,NC_014556.1,gi|308183744|ref|NC_014556.1| -Helicobacter pylori Puno120 chromosome, complete genome. (NC_017378)=NC_017378,NC_017378.1,gi|385227773|ref|NC_017378.1| -Helicobacter pylori Puno120 plasmid pHPPN120, complete sequence. (NC_017377)=NC_017377,NC_017377.1,gi|385229299|ref|NC_017377.1| -Helicobacter pylori Puno135 chromosome, complete genome. (NC_017379)=NC_017379,NC_017379.1,gi|385229315|ref|NC_017379.1| -Helicobacter pylori SJM180 chromosome, complete genome. (NC_014560)=NC_014560,NC_014560.1,gi|308183796|ref|NC_014560.1| -Helicobacter pylori SNT49 chromosome, complete genome. (NC_017376)=NC_017376,NC_017376.1,gi|385226252|ref|NC_017376.1| -Helicobacter pylori SNT49 plasmid pHPSNT, complete sequence. (NC_017380)=NC_017380,NC_017380.1,gi|385227768|ref|NC_017380.1| -Helicobacter pylori Sat464 chromosome, complete genome. (NC_017359)=NC_017359,NC_017359.1,gi|384893616|ref|NC_017359.1| -Helicobacter pylori Sat464 plasmid pHPSAT464, complete sequence. (NC_017356)=NC_017356,NC_017356.1,gi|384893581|ref|NC_017356.1| -Helicobacter pylori Shi112 chromosome, complete genome. (NC_017741)=NC_017741,NC_017741.1,gi|386753519|ref|NC_017741.1| -Helicobacter pylori Shi169 chromosome, complete genome. (NC_017740)=NC_017740,NC_017740.1,gi|386751993|ref|NC_017740.1| -Helicobacter pylori Shi417 chromosome, complete genome. (NC_017739)=NC_017739,NC_017739.1,gi|386750444|ref|NC_017739.1| -Helicobacter pylori Shi470 chromosome, complete genome. (NC_010698)=NC_010698,NC_010698.2,gi|209406223|ref|NC_010698.2| -Helicobacter pylori SouthAfrica7 chromosome, complete genome. (NC_017361)=NC_017361,NC_017361.1,gi|385221504|ref|NC_017361.1| -Helicobacter pylori SouthAfrica7 plasmid unnamed, complete (NC_017373)=NC_017373,NC_017373.1,gi|385221474|ref|NC_017373.1| -Helicobacter pylori XZ274 chromosome, complete genome. (NC_017926)=NC_017926,NC_017926.1,gi|387907368|ref|NC_017926.1| -Helicobacter pylori XZ274 plasmid pXZ274, complete sequence. (NC_017919)=NC_017919,NC_017919.1,gi|387908781|ref|NC_017919.1| -Helicobacter pylori 52 chromosome, complete genome. (NC_017354)=NC_017354,NC_017354.1,gi|384887043|ref|NC_017354.1| -Helicobacter pylori v225d chromosome, complete genome. (NC_017355)=NC_017355,NC_017355.1,gi|384888657|ref|NC_017355.1| -Helicobacter pylori v225d plasmid pHPv225d, complete sequence. (NC_017383)=NC_017383,NC_017383.1,gi|384888493|ref|NC_017383.1| -Heliobacterium modesticaldum Ice1 chromosome, complete genome. (NC_010337)=NC_010337,NC_010337.2,gi|255961476|ref|NC_010337.2| -Herbaspirillum seropedicae SmR1 chromosome, complete genome. (NC_014323)=NC_014323,NC_014323.1,gi|300309346|ref|NC_014323.1| -Herminiimonas arsenicoxydans chromosome, complete genome. (NC_009138)=NC_009138,NC_009138.1,gi|134093294|ref|NC_009138.1| -Herpetosiphon aurantiacus DSM 785 chromosome, complete genome. (NC_009972)=NC_009972,NC_009972.1,gi|159896533|ref|NC_009972.1| -Herpetosiphon aurantiacus DSM 785 plasmid pHAU01, complete (NC_009973)=NC_009973,NC_009973.1,gi|159901510|ref|NC_009973.1| -Herpetosiphon aurantiacus DSM 785 plasmid pHAU02, complete (NC_009974)=NC_009974,NC_009974.1,gi|159901742|ref|NC_009974.1| -Hippea maritima DSM 10411 chromosome, complete genome. (NC_015318)=NC_015318,NC_015318.1,gi|327398173|ref|NC_015318.1| -Hirschia baltica ATCC 49814 chromosome, complete genome. (NC_012982)=NC_012982,NC_012982.1,gi|254292376|ref|NC_012982.1| -Hirschia baltica ATCC 49814 plasmid pHbal01, complete sequence. (NC_012983)=NC_012983,NC_012983.1,gi|254295496|ref|NC_012983.1| -Hydrogenobacter thermophilus TK-6 chromosome, complete genome. (NC_017161)=NC_017161,NC_017161.1,gi|384128090|ref|NC_017161.1| -Hydrogenobacter thermophilus TK-6, complete genome. (NC_013799)=NC_013799,NC_013799.1,gi|288817321|ref|NC_013799.1| -Hydrogenobaculum sp. Y04AAS1 chromosome, complete genome. (NC_011126)=NC_011126,NC_011126.1,gi|195952380|ref|NC_011126.1| -Hyperthermus butylicus DSM 5456 chromosome, complete genome. (NC_008818)=NC_008818,NC_008818.1,gi|124026906|ref|NC_008818.1| -Hyphomicrobium sp. MC1, complete genome. (NC_015717)=NC_015717,NC_015717.1,gi|338736863|ref|NC_015717.1| -Hyphomicrobium denitrificans ATCC 51888 chromosome, complete (NC_014313)=NC_014313,NC_014313.1,gi|300021538|ref|NC_014313.1| -Hyphomonas neptunium ATCC 15444 chromosome, complete genome. (NC_008358)=NC_008358,NC_008358.1,gi|114797051|ref|NC_008358.1| -Idiomarina loihiensis L2TR chromosome, complete genome. (NC_006512)=NC_006512,NC_006512.1,gi|56459112|ref|NC_006512.1| -Ignavibacterium album JCM 16511 chromosome, complete genome. (NC_017464)=NC_017464,NC_017464.1,gi|385808586|ref|NC_017464.1| -Ignicoccus hospitalis KIN4/I chromosome, complete genome. (NC_009776)=NC_009776,NC_009776.1,gi|156936795|ref|NC_009776.1| -Ignisphaera aggregans DSM 17230 chromosome, complete genome. (NC_014471)=NC_014471,NC_014471.1,gi|305662445|ref|NC_014471.1| -Ilyobacter polytropus DSM 2926 chromosome, complete genome. (NC_014632)=NC_014632,NC_014632.1,gi|310777805|ref|NC_014632.1| -Ilyobacter polytropus DSM 2926 plasmid pILYOP01, complete sequence. (NC_014633)=NC_014633,NC_014633.1,gi|310779695|ref|NC_014633.1| -Ilyobacter polytropus DSM 2926 plasmid pILYOP02, complete sequence. (NC_014634)=NC_014634,NC_014634.1,gi|310780578|ref|NC_014634.1| -Intrasporangium calvum DSM 43043 chromosome, complete genome. (NC_014830)=NC_014830,NC_014830.1,gi|317123177|ref|NC_014830.1| -Isoptericola variabilis 225 chromosome, complete genome. (NC_015588)=NC_015588,NC_015588.1,gi|334335560|ref|NC_015588.1| -Isosphaera pallida ATCC 43644 chromosome, complete genome. (NC_014962)=NC_014962,NC_014962.1,gi|320101555|ref|NC_014962.1| -Isosphaera pallida ATCC 43644 plasmid pISOP01, complete sequence. (NC_014957)=NC_014957,NC_014957.1,gi|320041922|ref|NC_014957.1| -Jannaschia sp. CCS1 chromosome, complete genome. (NC_007802)=NC_007802,NC_007802.1,gi|89052491|ref|NC_007802.1| -Jannaschia sp. CCS1 plasmid1, complete sequence. (NC_007801)=NC_007801,NC_007801.1,gi|89057699|ref|NC_007801.1| -Janthinobacterium sp. Marseille chromosome, complete genome. (NC_009659)=NC_009659,NC_009659.1,gi|152979768|ref|NC_009659.1| -Jonesia denitrificans DSM 20603 chromosome, complete genome. (NC_013174)=NC_013174,NC_013174.1,gi|256831255|ref|NC_013174.1| -Kangiella koreensis DSM 16069 chromosome, complete genome. (NC_013166)=NC_013166,NC_013166.1,gi|256821228|ref|NC_013166.1| -Ketogulonicigenium vulgare Y25 chromosome, complete genome. (NC_014625)=NC_014625,NC_014625.1,gi|310814533|ref|NC_014625.1| -Ketogulonicigenium vulgare Y25 plasmid pYP1, complete sequence. (NC_014621)=NC_014621,NC_014621.1,gi|310639221|ref|NC_014621.1| -Ketogulonicigenium vulgare Y25 plasmid pYP12, complete sequence. (NC_014626)=NC_014626,NC_014626.1,gi|310830141|ref|NC_014626.1| -Ketogulonigenium vulgarum WSH-001 chromosome, complete genome. (NC_017384)=NC_017384,NC_017384.1,gi|385232493|ref|NC_017384.1| -Ketogulonigenium vulgarum WSH-001 plasmid 1, complete sequence. (NC_017386)=NC_017386,NC_017386.1,gi|385235306|ref|NC_017386.1| -Ketogulonigenium vulgarum WSH-001 plasmid 2, complete sequence. (NC_017385)=NC_017385,NC_017385.1,gi|385235090|ref|NC_017385.1| -Kineococcus radiotolerans SRS30216 chromosome, complete genome. (NC_009664)=NC_009664,NC_009664.2,gi|255961475|ref|NC_009664.2| -Kineococcus radiotolerans SRS30216 plasmid pKRAD01, complete (NC_009806)=NC_009806,NC_009806.1,gi|157283828|ref|NC_009806.1| -Kineococcus radiotolerans SRS30216 plasmid pKRAD02, complete (NC_009660)=NC_009660,NC_009660.1,gi|152963954|ref|NC_009660.1| -Kitasatospora setae KM-6054, complete genome. (NC_016109)=NC_016109,NC_016109.1,gi|357386972|ref|NC_016109.1| -Klebsiella oxytoca E718 chromosome, complete genome. (NC_018106)=NC_018106,NC_018106.1,gi|397655102|ref|NC_018106.1| -Klebsiella oxytoca E718 plasmid pKOX_R1, complete sequence. (NC_018107)=NC_018107,NC_018107.1,gi|397660804|ref|NC_018107.1| -Klebsiella oxytoca KCTC 1686 chromosome, complete genome. (NC_016612)=NC_016612,NC_016612.1,gi|375256816|ref|NC_016612.1| -Klebsiella pneumoniae 342 chromosome, complete genome. (NC_011283)=NC_011283,NC_011283.1,gi|206575712|ref|NC_011283.1| -Klebsiella pneumoniae 342 plasmid pKP187, complete sequence. (NC_011282)=NC_011282,NC_011282.1,gi|206575481|ref|NC_011282.1| -Klebsiella pneumoniae 342 plasmid pKP91, complete sequence. (NC_011281)=NC_011281,NC_011281.1,gi|206575367|ref|NC_011281.1| -Klebsiella pneumoniae subsp. pneumoniae HS11286 chromosome, (NC_016845)=NC_016845,NC_016845.1,gi|378976159|ref|NC_016845.1| -Klebsiella pneumoniae subsp. pneumoniae HS11286 plasmid pKPHS1, (NC_016838)=NC_016838,NC_016838.1,gi|378975690|ref|NC_016838.1| -Klebsiella pneumoniae subsp. pneumoniae HS11286 plasmid pKPHS2, (NC_016846)=NC_016846,NC_016846.1,gi|378975985|ref|NC_016846.1| -Klebsiella pneumoniae subsp. pneumoniae HS11286 plasmid pKPHS3, (NC_016839)=NC_016839,NC_016839.1,gi|378975832|ref|NC_016839.1| -Klebsiella pneumoniae subsp. pneumoniae HS11286 plasmid pKPHS4, (NC_016840)=NC_016840,NC_016840.1,gi|378976146|ref|NC_016840.1| -Klebsiella pneumoniae subsp. pneumoniae HS11286 plasmid pKPHS5, (NC_016847)=NC_016847,NC_016847.1,gi|378976153|ref|NC_016847.1| -Klebsiella pneumoniae subsp. pneumoniae HS11286 plasmid pKPHS6, (NC_016841)=NC_016841,NC_016841.1,gi|378976151|ref|NC_016841.1| -Klebsiella pneumoniae KCTC 2242 chromosome, complete genome. (NC_017540)=NC_017540,NC_017540.1,gi|386032579|ref|NC_017540.1| -Klebsiella pneumoniae KCTC 2242 plasmid pKCTC2242, complete (NC_017541)=NC_017541,NC_017541.1,gi|386037709|ref|NC_017541.1| -Klebsiella pneumoniae subsp. pneumoniae MGH 78578 chromosome, (NC_009648)=NC_009648,NC_009648.1,gi|152968582|ref|NC_009648.1| -Klebsiella pneumoniae subsp. pneumoniae MGH 78578 plasmid pKPN3, (NC_009649)=NC_009649,NC_009649.1,gi|152973416|ref|NC_009649.1| -Klebsiella pneumoniae subsp. pneumoniae MGH 78578 plasmid pKPN4, (NC_009650)=NC_009650,NC_009650.1,gi|152973607|ref|NC_009650.1| -Klebsiella pneumoniae subsp. pneumoniae MGH 78578 plasmid pKPN5, (NC_009651)=NC_009651,NC_009651.1,gi|152973731|ref|NC_009651.1| -Klebsiella pneumoniae subsp. pneumoniae MGH 78578 plasmid pKPN6, (NC_009652)=NC_009652,NC_009652.1,gi|152973830|ref|NC_009652.1| -Klebsiella pneumoniae subsp. pneumoniae MGH 78578 plasmid pKPN7, (NC_009653)=NC_009653,NC_009653.1,gi|152973836|ref|NC_009653.1| -Klebsiella pneumoniae NTUH-K2044 chromosome, complete genome. (NC_012731)=NC_012731,NC_012731.1,gi|238892256|ref|NC_012731.1| -Klebsiella pneumoniae NTUH-K2044 plasmid pK2044, complete sequence. (NC_006625)=NC_006625,NC_006625.1,gi|57639934|ref|NC_006625.1| -Klebsiella variicola At-22 chromosome, complete genome. (NC_013850)=NC_013850,NC_013850.1,gi|288932888|ref|NC_013850.1| -Kocuria rhizophila DC2201, complete genome. (NC_010617)=NC_010617,NC_010617.1,gi|184199646|ref|NC_010617.1| -Kosmotoga olearia TBF 19.5.1, complete genome. (NC_012785)=NC_012785,NC_012785.1,gi|239616411|ref|NC_012785.1| -Kribbella flavida DSM 17836 chromosome, complete genome. (NC_013729)=NC_013729,NC_013729.1,gi|284027999|ref|NC_013729.1| -Krokinobacter sp. 4H-3-7-5 chromosome, complete genome. (NC_015496)=NC_015496,NC_015496.1,gi|332290650|ref|NC_015496.1| -Kyrpidia tusciae DSM 2912 chromosome, complete genome. (NC_014098)=NC_014098,NC_014098.1,gi|295694686|ref|NC_014098.1| -Kytococcus sedentarius DSM 20547 chromosome, complete genome. (NC_013169)=NC_013169,NC_013169.1,gi|256823905|ref|NC_013169.1| -Lacinutrix sp. 5H-3-7-4 chromosome, complete genome. (NC_015638)=NC_015638,NC_015638.1,gi|336171143|ref|NC_015638.1| -Lactobacillus acidophilus 30SC chromosome, complete genome. (NC_015214)=NC_015214,NC_015214.1,gi|325955721|ref|NC_015214.1| -Lactobacillus acidophilus 30SC plasmid pRKC30SC1, complete (NC_015213)=NC_015213,NC_015213.1,gi|325955697|ref|NC_015213.1| -Lactobacillus acidophilus 30SC plasmid pRKC30SC2, complete (NC_015218)=NC_015218,NC_015218.1,gi|325955704|ref|NC_015218.1| -Lactobacillus acidophilus NCFM chromosome, complete genome. (NC_006814)=NC_006814,NC_006814.3,gi|159162017|ref|NC_006814.3| -Lactobacillus amylovorus GRL1118 chromosome, complete genome. (NC_017470)=NC_017470,NC_017470.1,gi|385816611|ref|NC_017470.1| -Lactobacillus amylovorus GRL1118 plasmid1, complete sequence. (NC_017471)=NC_017471,NC_017471.1,gi|385818454|ref|NC_017471.1| -Lactobacillus amylovorus GRL1118 plasmid2, complete sequence. (NC_017472)=NC_017472,NC_017472.1,gi|385818461|ref|NC_017472.1| -Lactobacillus amylovorus GRL 1112 chromosome, complete genome. (NC_014724)=NC_014724,NC_014724.1,gi|315037230|ref|NC_014724.1| -Lactobacillus amylovorus GRL 1112 plasmid1, complete sequence. (NC_015319)=NC_015319,NC_015319.1,gi|327399879|ref|NC_015319.1| -Lactobacillus amylovorus GRL 1112 plasmid2, complete sequence. (NC_015322)=NC_015322,NC_015322.1,gi|327399851|ref|NC_015322.1| -Lactobacillus brevis ATCC 367 plasmid 1, complete sequence. (NC_008498)=NC_008498,NC_008498.1,gi|116334867|ref|NC_008498.1| -Lactobacillus brevis ATCC 367 plasmid 2, complete sequence. (NC_008499)=NC_008499,NC_008499.1,gi|116334879|ref|NC_008499.1| -Lactobacillus brevis ATCC 367, complete genome. (NC_008497)=NC_008497,NC_008497.1,gi|116332681|ref|NC_008497.1| -Lactobacillus buchneri NRRL B-30929 chromosome, complete genome. (NC_015428)=NC_015428,NC_015428.1,gi|331700395|ref|NC_015428.1| -Lactobacillus buchneri NRRL B-30929 plasmid pLBUC01, complete (NC_015420)=NC_015420,NC_015420.1,gi|330818917|ref|NC_015420.1| -Lactobacillus buchneri NRRL B-30929 plasmid pLBUC02, complete (NC_015429)=NC_015429,NC_015429.1,gi|330370681|ref|NC_015429.1| -Lactobacillus buchneri NRRL B-30929 plasmid pLBUC03, complete (NC_015421)=NC_015421,NC_015421.1,gi|330370666|ref|NC_015421.1| -Lactobacillus casei ATCC 334 plasmid 1, complete sequence. (NC_008502)=NC_008502,NC_008502.1,gi|116326658|ref|NC_008502.1| -Lactobacillus casei ATCC 334, complete genome. (NC_008526)=NC_008526,NC_008526.1,gi|116493574|ref|NC_008526.1| -Lactobacillus casei BD-II chromosome, complete genome. (NC_017474)=NC_017474,NC_017474.1,gi|385821700|ref|NC_017474.1| -Lactobacillus casei BD-II plasmid pBD-II, complete sequence. (NC_017476)=NC_017476,NC_017476.1,gi|385824840|ref|NC_017476.1| -Lactobacillus casei BL23 chromosome, complete genome. (NC_010999)=NC_010999,NC_010999.1,gi|191636824|ref|NC_010999.1| -Lactobacillus casei LC2W chromosome, complete genome. (NC_017473)=NC_017473,NC_017473.1,gi|385818534|ref|NC_017473.1| -Lactobacillus casei LC2W plasmid pLC2W, complete sequence. (NC_017475)=NC_017475,NC_017475.1,gi|385821656|ref|NC_017475.1| -Lactobacillus casei str. Zhang chromosome, complete genome. (NC_014334)=NC_014334,NC_014334.1,gi|301065125|ref|NC_014334.1| -Lactobacillus casei str. Zhang plasmid plca36, complete sequence. (NC_011352)=NC_011352,NC_011352.1,gi|209401009|ref|NC_011352.1| -Lactobacillus crispatus ST1, complete genome. (NC_014106)=NC_014106,NC_014106.1,gi|295691862|ref|NC_014106.1| -Lactobacillus delbrueckii subsp. bulgaricus 2038 chromosome, (NC_017469)=NC_017469,NC_017469.1,gi|385814818|ref|NC_017469.1| -Lactobacillus delbrueckii subsp. bulgaricus ATCC 11842, complete (NC_008054)=NC_008054,NC_008054.1,gi|104773257|ref|NC_008054.1| -Lactobacillus delbrueckii subsp. bulgaricus ATCC BAA-365 (NC_008529)=NC_008529,NC_008529.1,gi|116513228|ref|NC_008529.1| -Lactobacillus delbrueckii subsp. bulgaricus ND02 chromosome, (NC_014727)=NC_014727,NC_014727.1,gi|313122775|ref|NC_014727.1| -Lactobacillus delbrueckii subsp. bulgaricus ND02 plasmid unnamed, (NC_014728)=NC_014728,NC_014728.1,gi|312984524|ref|NC_014728.1| -Lactobacillus fermentum CECT 5716 chromosome, complete genome. (NC_017465)=NC_017465,NC_017465.1,gi|385811786|ref|NC_017465.1| -Lactobacillus fermentum IFO 3956, complete genome. (NC_010610)=NC_010610,NC_010610.1,gi|184154476|ref|NC_010610.1| -Lactobacillus gasseri ATCC 33323, complete genome. (NC_008530)=NC_008530,NC_008530.1,gi|116628683|ref|NC_008530.1| -Lactobacillus helveticus DPC 4571, complete genome. (NC_010080)=NC_010080,NC_010080.1,gi|161506634|ref|NC_010080.1| -Lactobacillus helveticus H10 chromosome, complete genome. (NC_017467)=NC_017467,NC_017467.1,gi|385812838|ref|NC_017467.1| -Lactobacillus helveticus H10 plasmid pH10, complete sequence. (NC_017468)=NC_017468,NC_017468.1,gi|385814792|ref|NC_017468.1| -Lactobacillus johnsonii DPC 6026 chromosome, complete genome. (NC_017477)=NC_017477,NC_017477.1,gi|385824947|ref|NC_017477.1| -Lactobacillus johnsonii FI9785 chromosome, complete genome. (NC_013504)=NC_013504,NC_013504.1,gi|268318562|ref|NC_013504.1| -Lactobacillus johnsonii FI9785 plasmid p9785L, complete sequence. (NC_013505)=NC_013505,NC_013505.1,gi|268318538|ref|NC_013505.1| -Lactobacillus johnsonii FI9785 plasmid p9785S, complete sequence. (NC_012552)=NC_012552,NC_012552.1,gi|226526990|ref|NC_012552.1| -Lactobacillus johnsonii NCC 533, complete genome. (NC_005362)=NC_005362,NC_005362.1,gi|42518084|ref|NC_005362.1| -Lactobacillus kefiranofaciens ZW3 chromosome, complete genome. (NC_015602)=NC_015602,NC_015602.1,gi|336053510|ref|NC_015602.1| -Lactobacillus kefiranofaciens ZW3 plasmid pWW1, complete sequence. (NC_015598)=NC_015598,NC_015598.1,gi|336053279|ref|NC_015598.1| -Lactobacillus kefiranofaciens ZW3 plasmid pWW2, complete sequence. (NC_015603)=NC_015603,NC_015603.1,gi|336055419|ref|NC_015603.1| -Lactobacillus plantarum JDM1, complete genome. (NC_012984)=NC_012984,NC_012984.1,gi|254555169|ref|NC_012984.1| -Lactobacillus plantarum subsp. plantarum ST-III chromosome, (NC_014554)=NC_014554,NC_014554.1,gi|308179191|ref|NC_014554.1| -Lactobacillus plantarum subsp. plantarum ST-III plasmid pST-III, (NC_014558)=NC_014558,NC_014558.2,gi|344915391|ref|NC_014558.2| -Lactobacillus plantarum WCFS1 plasmid pWCFS101, complete sequence. (NC_006375)=NC_006375,NC_006375.1,gi|54307228|ref|NC_006375.1| -Lactobacillus plantarum WCFS1 plasmid pWCFS102, complete sequence. (NC_006376)=NC_006376,NC_006376.1,gi|54307232|ref|NC_006376.1| -Lactobacillus plantarum WCFS1 plasmid pWCFS103, complete sequence. (NC_006377)=NC_006377,NC_006377.1,gi|54307184|ref|NC_006377.1| -Lactobacillus plantarum WCFS1, complete genome. (NC_004567)=NC_004567,NC_004567.2,gi|380031102|ref|NC_004567.2| -Lactobacillus reuteri DSM 20016 chromosome, complete genome. (NC_009513)=NC_009513,NC_009513.1,gi|148543243|ref|NC_009513.1| -Lactobacillus reuteri JCM 1112, complete genome. (NC_010609)=NC_010609,NC_010609.1,gi|184152655|ref|NC_010609.1| -Lactobacillus reuteri SD2112 chromosome, complete genome. (NC_015697)=NC_015697,NC_015697.1,gi|338202359|ref|NC_015697.1| -Lactobacillus reuteri SD2112 plasmid pLR580, complete sequence. (NC_015699)=NC_015699,NC_015699.1,gi|338202351|ref|NC_015699.1| -Lactobacillus reuteri SD2112 plasmid pLR581, complete sequence. (NC_015700)=NC_015700,NC_015700.1,gi|338202319|ref|NC_015700.1| -Lactobacillus reuteri SD2112 plasmid pLR584, complete sequence. (NC_015701)=NC_015701,NC_015701.1,gi|338204606|ref|NC_015701.1| -Lactobacillus reuteri SD2112 plasmid pLR585, complete sequence. (NC_015698)=NC_015698,NC_015698.1,gi|338202336|ref|NC_015698.1| -Lactobacillus rhamnosus ATCC 8530 chromosome, complete genome. (NC_017491)=NC_017491,NC_017491.1,gi|385833938|ref|NC_017491.1| -Lactobacillus rhamnosus GG, complete genome. (NC_017482)=NC_017482,NC_017482.1,gi|385826720|ref|NC_017482.1| -Lactobacillus rhamnosus GG, complete genome. (NC_013198)=NC_013198,NC_013198.1,gi|258506995|ref|NC_013198.1| -Lactobacillus rhamnosus Lc 705 chromosome, complete genome. (NC_013199)=NC_013199,NC_013199.1,gi|258538191|ref|NC_013199.1| -Lactobacillus rhamnosus Lc 705 plasmid pLC1, complete sequence. (NC_013200)=NC_013200,NC_013200.1,gi|258509940|ref|NC_013200.1| -Lactobacillus ruminis ATCC 27782 chromosome, complete genome. (NC_015975)=NC_015975,NC_015975.1,gi|347524522|ref|NC_015975.1| -Lactobacillus sakei subsp. sakei 23K chromosome, complete genome. (NC_007576)=NC_007576,NC_007576.1,gi|81427616|ref|NC_007576.1| -Lactobacillus salivarius CECT 5713 chromosome, complete genome. (NC_017481)=NC_017481,NC_017481.1,gi|385839818|ref|NC_017481.1| -Lactobacillus salivarius CECT 5713 plasmid pHN1, complete sequence. (NC_017479)=NC_017479,NC_017479.1,gi|385839613|ref|NC_017479.1| -Lactobacillus salivarius CECT 5713 plasmid pHN2, complete sequence. (NC_017480)=NC_017480,NC_017480.1,gi|385839804|ref|NC_017480.1| -Lactobacillus salivarius CECT 5713 plasmid pHN3, complete sequence. (NC_017499)=NC_017499,NC_017499.1,gi|385839642|ref|NC_017499.1| -Lactobacillus salivarius UCC118 plasmid pMP118, complete sequence. (NC_007930)=NC_007930,NC_007930.1,gi|90962708|ref|NC_007930.1| -Lactobacillus salivarius UCC118 plasmid pSF118-20, complete (NC_006529)=NC_006529,NC_006529.1,gi|56707107|ref|NC_006529.1| -Lactobacillus salivarius UCC118 plasmid pSF118-44, complete (NC_006530)=NC_006530,NC_006530.1,gi|56707135|ref|NC_006530.1| -Lactobacillus salivarius UCC118, complete genome. (NC_007929)=NC_007929,NC_007929.1,gi|90960990|ref|NC_007929.1| -Lactobacillus sanfranciscensis TMW 1.1304 chromosome, complete (NC_015978)=NC_015978,NC_015978.1,gi|347533753|ref|NC_015978.1| -Lactobacillus sanfranciscensis TMW 1.1304 plasmid pLS1, complete (NC_015979)=NC_015979,NC_015979.1,gi|347533700|ref|NC_015979.1| -Lactobacillus sanfranciscensis TMW 1.1304 plasmid pLS2, complete (NC_015980)=NC_015980,NC_015980.1,gi|347533684|ref|NC_015980.1| -Lactococcus garvieae ATCC 49156, complete genome. (NC_015930)=NC_015930,NC_015930.1,gi|347520606|ref|NC_015930.1| -Lactococcus garvieae Lg2, complete genome. (NC_017490)=NC_017490,NC_017490.1,gi|385831969|ref|NC_017490.1| -Lactococcus lactis subsp. lactis CV56 chromosome, complete genome. (NC_017486)=NC_017486,NC_017486.1,gi|385829589|ref|NC_017486.1| -Lactococcus lactis subsp. lactis CV56 plasmid pCV56A, complete (NC_017483)=NC_017483,NC_017483.1,gi|385831891|ref|NC_017483.1| -Lactococcus lactis subsp. lactis CV56 plasmid pCV56B, complete (NC_017487)=NC_017487,NC_017487.1,gi|385831931|ref|NC_017487.1| -Lactococcus lactis subsp. lactis CV56 plasmid pCV56C, complete (NC_017484)=NC_017484,NC_017484.1,gi|385829559|ref|NC_017484.1| -Lactococcus lactis subsp. lactis CV56 plasmid pCV56D, complete (NC_017485)=NC_017485,NC_017485.1,gi|385831960|ref|NC_017485.1| -Lactococcus lactis subsp. lactis CV56 plasmid pCV56E, complete (NC_017488)=NC_017488,NC_017488.1,gi|385829555|ref|NC_017488.1| -Lactococcus lactis subsp. lactis Il1403, complete genome. (NC_002662)=NC_002662,NC_002662.1,gi|15671982|ref|NC_002662.1| -Lactococcus lactis subsp. lactis KF147 chromosome, complete genome. (NC_013656)=NC_013656,NC_013656.1,gi|281490498|ref|NC_013656.1| -Lactococcus lactis subsp. lactis KF147 plasmid pKF147A, complete (NC_013657)=NC_013657,NC_013657.1,gi|281427968|ref|NC_013657.1| -Lactococcus lactis subsp. cremoris A76 chromosome, complete genome. (NC_017492)=NC_017492,NC_017492.1,gi|385836969|ref|NC_017492.1| -Lactococcus lactis subsp. cremoris A76 plasmid pQA504, complete (NC_017497)=NC_017497,NC_017497.1,gi|385836922|ref|NC_017497.1| -Lactococcus lactis subsp. cremoris A76 plasmid pQA518, complete (NC_017495)=NC_017495,NC_017495.1,gi|385836839|ref|NC_017495.1| -Lactococcus lactis subsp. cremoris A76 plasmid pQA549, complete (NC_017493)=NC_017493,NC_017493.1,gi|385836926|ref|NC_017493.1| -Lactococcus lactis subsp. cremoris A76 plasmid pQA554, complete (NC_017496)=NC_017496,NC_017496.1,gi|385836852|ref|NC_017496.1| -Lactococcus lactis subsp. cremoris MG1363 chromosome, complete (NC_009004)=NC_009004,NC_009004.1,gi|125622882|ref|NC_009004.1| -Lactococcus lactis subsp. cremoris NZ9000 chromosome, complete (NC_017949)=NC_017949,NC_017949.1,gi|389853198|ref|NC_017949.1| -Lactococcus lactis subsp. cremoris SK11 plasmid 1, complete (NC_008503)=NC_008503,NC_008503.1,gi|116326529|ref|NC_008503.1| -Lactococcus lactis subsp. cremoris SK11 plasmid 2, complete (NC_008504)=NC_008504,NC_008504.1,gi|116326540|ref|NC_008504.1| -Lactococcus lactis subsp. cremoris SK11 plasmid 3, complete (NC_008505)=NC_008505,NC_008505.1,gi|116326547|ref|NC_008505.1| -Lactococcus lactis subsp. cremoris SK11 plasmid 4, complete (NC_008506)=NC_008506,NC_008506.1,gi|116326609|ref|NC_008506.1| -Lactococcus lactis subsp. cremoris SK11 plasmid 5, complete (NC_008507)=NC_008507,NC_008507.1,gi|116326645|ref|NC_008507.1| -Lactococcus lactis subsp. cremoris SK11, complete genome. (NC_008527)=NC_008527,NC_008527.1,gi|116510843|ref|NC_008527.1| -Laribacter hongkongensis HLHK9, complete genome. (NC_012559)=NC_012559,NC_012559.1,gi|226938934|ref|NC_012559.1| -Lawsonia intracellularis PHE/MN1-00 chromosome, complete genome. (NC_008011)=NC_008011,NC_008011.1,gi|94986445|ref|NC_008011.1| -Lawsonia intracellularis PHE/MN1-00 plasmid 1, complete sequence. (NC_008012)=NC_008012,NC_008012.1,gi|94972343|ref|NC_008012.1| -Lawsonia intracellularis PHE/MN1-00 plasmid 2, complete sequence. (NC_008013)=NC_008013,NC_008013.1,gi|94972373|ref|NC_008013.1| -Lawsonia intracellularis PHE/MN1-00 plasmid 3, complete sequence. (NC_008014)=NC_008014,NC_008014.1,gi|94972398|ref|NC_008014.1| -Leadbetterella byssophila DSM 17132 chromosome, complete genome. (NC_014655)=NC_014655,NC_014655.1,gi|312128809|ref|NC_014655.1| -Legionella longbeachae NSW150 chromosome, complete genome. (NC_013861)=NC_013861,NC_013861.1,gi|289163353|ref|NC_013861.1| -Legionella longbeachae NSW150 plasmid pLLO, complete sequence. (NC_014544)=NC_014544,NC_014544.1,gi|308051505|ref|NC_014544.1| -Legionella pneumophila 2300/99 Alcoy chromosome, complete genome. (NC_014125)=NC_014125,NC_014125.1,gi|296105497|ref|NC_014125.1| -Legionella pneumophila subsp. pneumophila ATCC 43290 chromosome, (NC_016811)=NC_016811,NC_016811.1,gi|378775961|ref|NC_016811.1| -Legionella pneumophila str. Corby chromosome, complete genome. (NC_009494)=NC_009494,NC_009494.2,gi|295815281|ref|NC_009494.2| -Legionella pneumophila subsp. pneumophila, complete genome. (NC_018140)=NC_018140,NC_018140.1,gi|397665626|ref|NC_018140.1| -Legionella pneumophila str. Lens plasmid pLPL, complete sequence. (NC_006366)=NC_006366,NC_006366.1,gi|54292907|ref|NC_006366.1| -Legionella pneumophila str. Lens, complete genome. (NC_006369)=NC_006369,NC_006369.1,gi|54292964|ref|NC_006369.1| -Legionella pneumophila subsp. pneumophila plasmid pLELO, complete (NC_018141)=NC_018141,NC_018141.1,gi|397668686|ref|NC_018141.1| -Legionella pneumophila subsp. pneumophila, complete genome. (NC_018139)=NC_018139,NC_018139.1,gi|397662556|ref|NC_018139.1| -Legionella pneumophila str. Paris plasmid pLPP, complete sequence. (NC_006365)=NC_006365,NC_006365.1,gi|54295843|ref|NC_006365.1| -Legionella pneumophila str. Paris, complete genome. (NC_006368)=NC_006368,NC_006368.1,gi|54295983|ref|NC_006368.1| -Legionella pneumophila subsp. pneumophila str. Philadelphia 1 (NC_002942)=NC_002942,NC_002942.5,gi|52840256|ref|NC_002942.5| -Leifsonia xyli subsp. xyli str. CTCB07 chromosome, complete genome. (NC_006087)=NC_006087,NC_006087.1,gi|50953925|ref|NC_006087.1| -Leptospira biflexa serovar Patoc strain 'Patoc 1 (Ames)' chromosome (NC_010842)=NC_010842,NC_010842.1,gi|189909570|ref|NC_010842.1| -Leptospira biflexa serovar Patoc strain 'Patoc 1 (Ames)' chromosome (NC_010845)=NC_010845,NC_010845.1,gi|189912848|ref|NC_010845.1| -Leptospira biflexa serovar Patoc strain 'Patoc 1 (Ames)' plasmid (NC_010846)=NC_010846,NC_010846.1,gi|189913115|ref|NC_010846.1| -Leptospira biflexa serovar Patoc strain 'Patoc 1 (Paris)' (NC_010602)=NC_010602,NC_010602.1,gi|183219427|ref|NC_010602.1| -Leptospira biflexa serovar Patoc strain 'Patoc 1 (Paris)' (NC_010843)=NC_010843,NC_010843.1,gi|189913173|ref|NC_010843.1| -Leptospira biflexa serovar Patoc strain 'Patoc 1 (Paris)' plasmid (NC_010844)=NC_010844,NC_010844.1,gi|189913450|ref|NC_010844.1| -Leptospira borgpetersenii serovar Hardjo-bovis JB197 chromosome (NC_008510)=NC_008510,NC_008510.1,gi|116329799|ref|NC_008510.1| -Leptospira borgpetersenii serovar Hardjo-bovis JB197 chromosome (NC_008511)=NC_008511,NC_008511.1,gi|116332445|ref|NC_008511.1| -Leptospira borgpetersenii serovar Hardjo-bovis L550 chromosome (NC_008508)=NC_008508,NC_008508.1,gi|116326852|ref|NC_008508.1| -Leptospira borgpetersenii serovar Hardjo-bovis L550 chromosome (NC_008509)=NC_008509,NC_008509.1,gi|116329556|ref|NC_008509.1| -Leptospira interrogans serovar Copenhageni str. Fiocruz L1-130 (NC_005823)=NC_005823,NC_005823.1,gi|45655914|ref|NC_005823.1| -Leptospira interrogans serovar Copenhageni str. Fiocruz L1-130 (NC_005824)=NC_005824,NC_005824.1,gi|45655585|ref|NC_005824.1| -Leptospira interrogans serovar Lai str. 56601 chromosome chromosome (NC_004342)=NC_004342,NC_004342.2,gi|294827553|ref|NC_004342.2| -Leptospira interrogans serovar Lai str. 56601 chromosome chromosome (NC_004343)=NC_004343,NC_004343.2,gi|294653513|ref|NC_004343.2| -Leptospira interrogans serovar Lai str. IPAV chromosome chromosome (NC_017551)=NC_017551,NC_017551.1,gi|386072488|ref|NC_017551.1| -Leptospira interrogans serovar Lai str. IPAV chromosome chromosome (NC_017552)=NC_017552,NC_017552.1,gi|386076037|ref|NC_017552.1| -Leptospirillum ferrooxidans C2-3, complete genome. (NC_017094)=NC_017094,NC_017094.1,gi|383783295|ref|NC_017094.1| -Leptothrix cholodnii SP-6 chromosome, complete genome. (NC_010524)=NC_010524,NC_010524.1,gi|171056692|ref|NC_010524.1| -Leptotrichia buccalis C-1013-b chromosome, complete genome. (NC_013192)=NC_013192,NC_013192.1,gi|257124814|ref|NC_013192.1| -Leuconostoc sp. C2 chromosome, complete genome. (NC_015734)=NC_015734,NC_015734.1,gi|339490182|ref|NC_015734.1| -Leuconostoc citreum KM20 plasmid pLCK1, complete sequence. (NC_010470)=NC_010470,NC_010470.1,gi|170016308|ref|NC_010470.1| -Leuconostoc citreum KM20 plasmid pLCK2, complete sequence. (NC_010466)=NC_010466,NC_010466.1,gi|170016236|ref|NC_010466.1| -Leuconostoc citreum KM20 plasmid pLCK3, complete sequence. (NC_010467)=NC_010467,NC_010467.1,gi|170016273|ref|NC_010467.1| -Leuconostoc citreum KM20 plasmid pLCK4, complete sequence. (NC_010469)=NC_010469,NC_010469.1,gi|170016294|ref|NC_010469.1| -Leuconostoc citreum KM20, complete genome. (NC_010471)=NC_010471,NC_010471.1,gi|170016358|ref|NC_010471.1| -Leuconostoc gasicomitatum LMG 18811, complete genome. (NC_014319)=NC_014319,NC_014319.1,gi|300172302|ref|NC_014319.1| -Leuconostoc kimchii IMSNU 11154 chromosome, complete genome. (NC_014136)=NC_014136,NC_014136.1,gi|296110131|ref|NC_014136.1| -Leuconostoc kimchii IMSNU 11154 plasmid LkipL4701, complete (NC_014131)=NC_014131,NC_014131.1,gi|295987464|ref|NC_014131.1| -Leuconostoc kimchii IMSNU 11154 plasmid LkipL4704, complete (NC_014132)=NC_014132,NC_014132.1,gi|296100146|ref|NC_014132.1| -Leuconostoc kimchii IMSNU 11154 plasmid LkipL4719, complete (NC_014133)=NC_014133,NC_014133.1,gi|296100281|ref|NC_014133.1| -Leuconostoc kimchii IMSNU 11154 plasmid LkipL4726, complete (NC_014134)=NC_014134,NC_014134.1,gi|296100303|ref|NC_014134.1| -Leuconostoc kimchii IMSNU 11154 plasmid LkipL48, complete sequence. (NC_014135)=NC_014135,NC_014135.1,gi|296005657|ref|NC_014135.1| -Leuconostoc mesenteroides subsp. mesenteroides ATCC 8293 plasmid (NC_008496)=NC_008496,NC_008496.1,gi|116326493|ref|NC_008496.1| -Leuconostoc mesenteroides subsp. mesenteroides ATCC 8293, complete (NC_008531)=NC_008531,NC_008531.1,gi|116617174|ref|NC_008531.1| -Leuconostoc mesenteroides subsp. mesenteroides J18 chromosome, (NC_016805)=NC_016805,NC_016805.1,gi|381335653|ref|NC_016805.1| -Leuconostoc mesenteroides subsp. mesenteroides J18 plasmid pKLE01, (NC_016827)=NC_016827,NC_016827.1,gi|379703889|ref|NC_016827.1| -Leuconostoc mesenteroides subsp. mesenteroides J18 plasmid pKLE02, (NC_016820)=NC_016820,NC_016820.1,gi|379703843|ref|NC_016820.1| -Leuconostoc mesenteroides subsp. mesenteroides J18 plasmid pKLE03, (NC_016821)=NC_016821,NC_016821.1,gi|381335622|ref|NC_016821.1| -Leuconostoc mesenteroides subsp. mesenteroides J18 plasmid pKLE04, (NC_016828)=NC_016828,NC_016828.1,gi|379987604|ref|NC_016828.1| -Leuconostoc mesenteroides subsp. mesenteroides J18 plasmid pKLE05, (NC_016806)=NC_016806,NC_016806.1,gi|381335651|ref|NC_016806.1| -Listeria innocua Clip11262 plasmid pLI100, complete sequence. (NC_003383)=NC_003383,NC_003383.1,gi|18450286|ref|NC_003383.1| -Listeria innocua Clip11262, complete genome. (NC_003212)=NC_003212,NC_003212.1,gi|16799079|ref|NC_003212.1| -Listeria ivanovii subsp. ivanovii PAM 55, complete genome. (NC_016011)=NC_016011,NC_016011.1,gi|347547510|ref|NC_016011.1| -Listeria monocytogenes 07PF0776 chromosome, complete genome. (NC_017728)=NC_017728,NC_017728.1,gi|386730761|ref|NC_017728.1| -Listeria monocytogenes 08-5923, complete genome. (NC_013768)=NC_013768,NC_013768.1,gi|284993440|ref|NC_013768.1| -Listeria monocytogenes 10403S chromosome, complete genome. (NC_017544)=NC_017544,NC_017544.1,gi|386042347|ref|NC_017544.1| -Listeria monocytogenes Clip81459, complete genome. (NC_012488)=NC_012488,NC_012488.1,gi|226222639|ref|NC_012488.1| -Listeria monocytogenes EGD-e, complete genome. (NC_003210)=NC_003210,NC_003210.1,gi|16802048|ref|NC_003210.1| -Listeria monocytogenes FSL R2-561 chromosome, complete genome. (NC_017546)=NC_017546,NC_017546.1,gi|386048930|ref|NC_017546.1| -Listeria monocytogenes Finland 1998 chromosome, complete genome. (NC_017547)=NC_017547,NC_017547.1,gi|386052273|ref|NC_017547.1| -Listeria monocytogenes HCC23 chromosome, complete genome. (NC_011660)=NC_011660,NC_011660.1,gi|217963303|ref|NC_011660.1| -Listeria monocytogenes J0161 chromosome, complete genome. (NC_017545)=NC_017545,NC_017545.1,gi|386045634|ref|NC_017545.1| -Listeria monocytogenes M7 chromosome, complete genome. (NC_017537)=NC_017537,NC_017537.1,gi|386025288|ref|NC_017537.1| -Listeria monocytogenes L99, complete genome. (NC_017529)=NC_017529,NC_017529.1,gi|386006713|ref|NC_017529.1| -Listeria monocytogenes serotype 4b str. F2365 chromosome, complete (NC_002973)=NC_002973,NC_002973.6,gi|85700163|ref|NC_002973.6| -Listeria monocytogenes 08-5578 chromosome, complete genome. (NC_013766)=NC_013766,NC_013766.1,gi|284800255|ref|NC_013766.1| -Listeria monocytogenes 08-5578 plasmid pLM5578, complete sequence. (NC_013767)=NC_013767,NC_013767.1,gi|284803266|ref|NC_013767.1| -Listeria seeligeri serovar 1/2b str. SLCC3954 chromosome, complete (NC_013891)=NC_013891,NC_013891.1,gi|289433373|ref|NC_013891.1| -Listeria welshimeri serovar 6b str. SLCC5334 chromosome, complete (NC_008555)=NC_008555,NC_008555.1,gi|116871422|ref|NC_008555.1| -Lysinibacillus sphaericus C3-41 chromosome, complete genome. (NC_010382)=NC_010382,NC_010382.1,gi|169825618|ref|NC_010382.1| -Lysinibacillus sphaericus C3-41 plasmid pBsph, complete sequence. (NC_010381)=NC_010381,NC_010381.1,gi|169825414|ref|NC_010381.1| -Macrococcus caseolyticus JCSC5402 plasmid pMCCL1, complete (NC_011995)=NC_011995,NC_011995.1,gi|222142561|ref|NC_011995.1| -Macrococcus caseolyticus JCSC5402 plasmid pMCCL2, complete (NC_011996)=NC_011996,NC_011996.1,gi|222142576|ref|NC_011996.1| -Macrococcus caseolyticus JCSC5402 plasmid pMCCL3, complete (NC_011997)=NC_011997,NC_011997.1,gi|222142646|ref|NC_011997.1| -Macrococcus caseolyticus JCSC5402 plasmid pMCCL4, complete (NC_011998)=NC_011998,NC_011998.1,gi|222142648|ref|NC_011998.1| -Macrococcus caseolyticus JCSC5402 plasmid pMCCL5, complete (NC_012000)=NC_012000,NC_012000.1,gi|222143325|ref|NC_012000.1| -Macrococcus caseolyticus JCSC5402 plasmid pMCCL6, complete (NC_012001)=NC_012001,NC_012001.1,gi|222143330|ref|NC_012001.1| -Macrococcus caseolyticus JCSC5402 plasmid pMCCL7, complete (NC_012002)=NC_012002,NC_012002.1,gi|222143513|ref|NC_012002.1| -Macrococcus caseolyticus JCSC5402 plasmid pMCCL8, complete (NC_012003)=NC_012003,NC_012003.1,gi|222143522|ref|NC_012003.1| -Macrococcus caseolyticus JCSC5402, complete genome. (NC_011999)=NC_011999,NC_011999.1,gi|222150250|ref|NC_011999.1| -Magnetococcus marinus MC-1 chromosome, complete genome. (NC_008576)=NC_008576,NC_008576.1,gi|117923318|ref|NC_008576.1| -Magnetospirillum magneticum AMB-1 chromosome, complete genome. (NC_007626)=NC_007626,NC_007626.1,gi|83309099|ref|NC_007626.1| -Mahella australiensis 50-1 BON chromosome, complete genome. (NC_015520)=NC_015520,NC_015520.1,gi|332980605|ref|NC_015520.1| -Mannheimia succiniciproducens MBEL55E chromosome, complete genome. (NC_006300)=NC_006300,NC_006300.1,gi|52424055|ref|NC_006300.1| -Maricaulis maris MCS10 chromosome, complete genome. (NC_008347)=NC_008347,NC_008347.1,gi|114568554|ref|NC_008347.1| -Marinithermus hydrothermalis DSM 14884 chromosome, complete genome. (NC_015387)=NC_015387,NC_015387.1,gi|328949540|ref|NC_015387.1| -Marinitoga piezophila KA3 chromosome, complete genome. (NC_016751)=NC_016751,NC_016751.1,gi|374339022|ref|NC_016751.1| -Marinitoga piezophila KA3 plasmid pMARPI01, complete sequence. (NC_016748)=NC_016748,NC_016748.1,gi|373231418|ref|NC_016748.1| -Marinobacter adhaerens HP15 chromosome, complete genome. (NC_017506)=NC_017506,NC_017506.1,gi|385329741|ref|NC_017506.1| -Marinobacter adhaerens HP15 plasmid pHP-187, complete sequence. (NC_017507)=NC_017507,NC_017507.1,gi|385333923|ref|NC_017507.1| -Marinobacter adhaerens HP15 plasmid pHP-42, complete sequence. (NC_017508)=NC_017508,NC_017508.1,gi|385334102|ref|NC_017508.1| -Marinobacter aquaeolei VT8 plasmid pMAQU01, complete sequence. (NC_008738)=NC_008738,NC_008738.1,gi|120536823|ref|NC_008738.1| -Marinobacter aquaeolei VT8 plasmid pMAQU02, complete sequence. (NC_008739)=NC_008739,NC_008739.1,gi|120537037|ref|NC_008739.1| -Marinobacter aquaeolei VT8, complete genome. (NC_008740)=NC_008740,NC_008740.1,gi|120552944|ref|NC_008740.1| -Marinobacter hydrocarbonoclasticus ATCC 49840, complete genome. (NC_017067)=NC_017067,NC_017067.1,gi|387812450|ref|NC_017067.1| -Marinomonas sp. MWYL1 chromosome, complete genome. (NC_009654)=NC_009654,NC_009654.1,gi|152994043|ref|NC_009654.1| -Marinomonas mediterranea MMB-1 chromosome, complete genome. (NC_015276)=NC_015276,NC_015276.1,gi|326793322|ref|NC_015276.1| -Marinomonas posidonica IVIA-Po-181 chromosome, complete genome. (NC_015559)=NC_015559,NC_015559.1,gi|333906402|ref|NC_015559.1| -Marivirga tractuosa DSM 4126 chromosome, complete genome. (NC_014759)=NC_014759,NC_014759.1,gi|313674129|ref|NC_014759.1| -Marivirga tractuosa DSM 4126 plasmid pFTRAC01, complete sequence. (NC_014750)=NC_014750,NC_014750.1,gi|313652076|ref|NC_014750.1| -Megasphaera elsdenii DSM 20460, complete genome. (NC_015873)=NC_015873,NC_015873.1,gi|348025247|ref|NC_015873.1| -Meiothermus ruber DSM 1279 chromosome, complete genome. (NC_013946)=NC_013946,NC_013946.1,gi|291294404|ref|NC_013946.1| -Meiothermus silvanus DSM 9946 chromosome, complete genome. (NC_014212)=NC_014212,NC_014212.1,gi|297564484|ref|NC_014212.1| -Meiothermus silvanus DSM 9946 plasmid pMESIL01, complete sequence. (NC_014213)=NC_014213,NC_014213.1,gi|297567557|ref|NC_014213.1| -Meiothermus silvanus DSM 9946 plasmid pMESIL02, complete sequence. (NC_014214)=NC_014214,NC_014214.1,gi|297567864|ref|NC_014214.1| -Melioribacter roseus P3M chromosome, complete genome. (NC_018178)=NC_018178,NC_018178.1,gi|397689003|ref|NC_018178.1| -Melissococcus plutonius ATCC 35311 plasmid pMP1, complete sequence. (NC_015517)=NC_015517,NC_015517.1,gi|332687277|ref|NC_015517.1| -Melissococcus plutonius ATCC 35311, complete genome. (NC_015516)=NC_015516,NC_015516.1,gi|332685534|ref|NC_015516.1| -Melissococcus plutonius DAT561 chromosome 1, complete genome. (NC_016938)=NC_016938,NC_016938.1,gi|379726618|ref|NC_016938.1| -Melissococcus plutonius DAT561 plasmid 1, complete sequence. (NC_018265)=NC_018265,NC_018265.1,gi|399140225|ref|NC_018265.1| -Mesoplasma florum L1 chromosome, complete genome. (NC_006055)=NC_006055,NC_006055.1,gi|50364815|ref|NC_006055.1| -Mesorhizobium ciceri biovar biserrulae WSM1271 chromosome, complete (NC_014923)=NC_014923,NC_014923.1,gi|319779749|ref|NC_014923.1| -Mesorhizobium ciceri biovar biserrulae WSM1271 plasmid pMESCI01, (NC_014918)=NC_014918,NC_014918.1,gi|319777789|ref|NC_014918.1| -Mesorhizobium loti MAFF303099 chromosome, complete genome. (NC_002678)=NC_002678,NC_002678.2,gi|57165207|ref|NC_002678.2| -Mesorhizobium loti MAFF303099 plasmid pMLa, complete sequence. (NC_002679)=NC_002679,NC_002679.1,gi|13488050|ref|NC_002679.1| -Mesorhizobium loti MAFF303099 plasmid pMLb, complete sequence. (NC_002682)=NC_002682,NC_002682.1,gi|13195732|ref|NC_002682.1| -Mesorhizobium opportunistum WSM2075 chromosome, complete genome. (NC_015675)=NC_015675,NC_015675.1,gi|337264537|ref|NC_015675.1| -Mesotoga prima MesG1.Ag.4.2 chromosome, complete genome. (NC_017934)=NC_017934,NC_017934.1,gi|389842920|ref|NC_017934.1| -Mesotoga prima MesG1.Ag.4.2 plasmid pTHEBA.01, complete sequence. (NC_017935)=NC_017935,NC_017935.1,gi|389842917|ref|NC_017935.1| -Metallosphaera cuprina Ar-4 chromosome, complete genome. (NC_015435)=NC_015435,NC_015435.1,gi|330833867|ref|NC_015435.1| -Metallosphaera sedula DSM 5348 chromosome, complete genome. (NC_009440)=NC_009440,NC_009440.1,gi|146302785|ref|NC_009440.1| -Methanobacterium sp. AL-21 chromosome, complete genome. (NC_015216)=NC_015216,NC_015216.1,gi|325957759|ref|NC_015216.1| -Methanobacterium sp. SWAN-1 chromosome, complete genome. (NC_015574)=NC_015574,NC_015574.1,gi|333986242|ref|NC_015574.1| -Methanobrevibacter ruminantium M1 chromosome, complete genome. (NC_013790)=NC_013790,NC_013790.1,gi|288559258|ref|NC_013790.1| -Methanobrevibacter smithii ATCC 35061 chromosome, complete genome. (NC_009515)=NC_009515,NC_009515.1,gi|148642060|ref|NC_009515.1| -Methanocaldococcus sp. FS406-22 chromosome, complete genome. (NC_013887)=NC_013887,NC_013887.1,gi|289191496|ref|NC_013887.1| -Methanocaldococcus sp. FS406-22 plasmid pFS01, complete sequence. (NC_013888)=NC_013888,NC_013888.1,gi|289193301|ref|NC_013888.1| -Methanocaldococcus fervens AG86 chromosome, complete genome. (NC_013156)=NC_013156,NC_013156.1,gi|256809973|ref|NC_013156.1| -Methanocaldococcus fervens AG86 plasmid pMEFER01, complete (NC_013157)=NC_013157,NC_013157.1,gi|256811520|ref|NC_013157.1| -Methanocaldococcus infernus ME chromosome, complete genome. (NC_014122)=NC_014122,NC_014122.1,gi|296108688|ref|NC_014122.1| -Methanocaldococcus jannaschii DSM 2661 chromosome, complete genome. (NC_000909)=NC_000909,NC_000909.1,gi|15668172|ref|NC_000909.1| -Methanocaldococcus jannaschii DSM 2661 plasmid large ECE, complete (NC_001732)=NC_001732,NC_001732.1,gi|10954488|ref|NC_001732.1| -Methanocaldococcus jannaschii DSM 2661 plasmid small ECE, complete (NC_001733)=NC_001733,NC_001733.1,gi|10954532|ref|NC_001733.1| -Methanocaldococcus vulcanius M7 chromosome, complete genome. (NC_013407)=NC_013407,NC_013407.1,gi|261402131|ref|NC_013407.1| -Methanocaldococcus vulcanius M7 plasmid pMETVU01, complete (NC_013408)=NC_013408,NC_013408.1,gi|261403859|ref|NC_013408.1| -Methanocaldococcus vulcanius M7 plasmid pMETVU02, complete (NC_013409)=NC_013409,NC_013409.1,gi|261403873|ref|NC_013409.1| -Methanocella conradii HZ254 chromosome, complete genome. (NC_017034)=NC_017034,NC_017034.1,gi|383318453|ref|NC_017034.1| -Methanocella paludicola SANAE chromosome, complete genome. (NC_013665)=NC_013665,NC_013665.1,gi|282162670|ref|NC_013665.1| -Methanococcoides burtonii DSM 6242, complete genome. (NC_007955)=NC_007955,NC_007955.1,gi|91772082|ref|NC_007955.1| -Methanococcus aeolicus Nankai-3 chromosome, complete genome. (NC_009635)=NC_009635,NC_009635.1,gi|150400439|ref|NC_009635.1| -Methanococcus maripaludis C5 chromosome, complete genome. (NC_009135)=NC_009135,NC_009135.1,gi|134045046|ref|NC_009135.1| -Methanococcus maripaludis C5 plasmid pMMC501, complete sequence. (NC_009136)=NC_009136,NC_009136.1,gi|134046898|ref|NC_009136.1| -Methanococcus maripaludis C6 chromosome, complete genome. (NC_009975)=NC_009975,NC_009975.1,gi|159904396|ref|NC_009975.1| -Methanococcus maripaludis C7 chromosome, complete genome. (NC_009637)=NC_009637,NC_009637.1,gi|150401930|ref|NC_009637.1| -Methanococcus maripaludis S2 chromosome, complete genome. (NC_005791)=NC_005791,NC_005791.1,gi|45357563|ref|NC_005791.1| -Methanococcus maripaludis X1 chromosome, complete genome. (NC_015847)=NC_015847,NC_015847.1,gi|340623184|ref|NC_015847.1| -Methanococcus vannielii SB chromosome, complete genome. (NC_009634)=NC_009634,NC_009634.1,gi|150398760|ref|NC_009634.1| -Methanococcus voltae A3 chromosome, complete genome. (NC_014222)=NC_014222,NC_014222.1,gi|297618528|ref|NC_014222.1| -Methanocorpusculum labreanum Z chromosome, complete genome. (NC_008942)=NC_008942,NC_008942.1,gi|124484829|ref|NC_008942.1| -Methanoculleus bourgensis MS2, complete genome. (NC_018227)=NC_018227,NC_018227.1,gi|397779166|ref|NC_018227.1| -Methanoculleus marisnigri JR1 chromosome, complete genome. (NC_009051)=NC_009051,NC_009051.1,gi|126177952|ref|NC_009051.1| -Methanohalobium evestigatum Z-7303 chromosome, complete genome. (NC_014253)=NC_014253,NC_014253.1,gi|298673978|ref|NC_014253.1| -Methanohalobium evestigatum Z-7303 plasmid pMETEV01, complete (NC_014254)=NC_014254,NC_014254.1,gi|298676127|ref|NC_014254.1| -Methanohalophilus mahii DSM 5219 chromosome, complete genome. (NC_014002)=NC_014002,NC_014002.1,gi|294494690|ref|NC_014002.1| -Methanoplanus petrolearius DSM 11571 chromosome, complete genome. (NC_014507)=NC_014507,NC_014507.1,gi|307352168|ref|NC_014507.1| -Methanopyrus kandleri AV19, complete genome. (NC_003551)=NC_003551,NC_003551.1,gi|20093440|ref|NC_003551.1| -Methanoregula boonei 6A8 chromosome, complete genome. (NC_009712)=NC_009712,NC_009712.1,gi|154149549|ref|NC_009712.1| -Methanosaeta concilii GP6 chromosome, complete genome. (NC_015416)=NC_015416,NC_015416.1,gi|330506319|ref|NC_015416.1| -Methanosaeta concilii GP6 plasmid pGP6, complete sequence. (NC_015430)=NC_015430,NC_015430.1,gi|330506028|ref|NC_015430.1| -Methanosaeta harundinacea 6Ac chromosome, complete genome. (NC_017527)=NC_017527,NC_017527.1,gi|386000717|ref|NC_017527.1| -Methanosaeta harundinacea 6Ac plasmid pH6Ac, complete sequence. (NC_016637)=NC_016637,NC_016637.1,gi|386003071|ref|NC_016637.1| -Methanosaeta thermophila PT chromosome, complete genome. (NC_008553)=NC_008553,NC_008553.1,gi|116753325|ref|NC_008553.1| -Methanosalsum zhilinae DSM 4017 chromosome, complete genome. (NC_015676)=NC_015676,NC_015676.1,gi|336475959|ref|NC_015676.1| -Methanosarcina acetivorans C2A chromosome, complete genome. (NC_003552)=NC_003552,NC_003552.1,gi|20088899|ref|NC_003552.1| -Methanosarcina barkeri str. Fusaro chromosome, complete genome. (NC_007355)=NC_007355,NC_007355.1,gi|73667559|ref|NC_007355.1| -Methanosarcina barkeri str. fusaro plasmid 1, complete sequence. (NC_007349)=NC_007349,NC_007349.1,gi|73663826|ref|NC_007349.1| -Methanosarcina mazei Go1 chromosome, complete genome. (NC_003901)=NC_003901,NC_003901.1,gi|21226102|ref|NC_003901.1| -Methanosphaera stadtmanae DSM 3091 chromosome, complete genome. (NC_007681)=NC_007681,NC_007681.1,gi|84488831|ref|NC_007681.1| -Methanosphaerula palustris E1-9c chromosome, complete genome. (NC_011832)=NC_011832,NC_011832.1,gi|219850687|ref|NC_011832.1| -Methanospirillum hungatei JF-1 chromosome, complete genome. (NC_007796)=NC_007796,NC_007796.1,gi|88601322|ref|NC_007796.1| -Methanothermobacter marburgensis str. Marburg chromosome, complete (NC_014408)=NC_014408,NC_014408.1,gi|304313778|ref|NC_014408.1| -Methanothermobacter marburgensis str. Marburg plasmid pMTBMA4, (NC_014409)=NC_014409,NC_014409.1,gi|304315532|ref|NC_014409.1| -Methanothermobacter thermautotrophicus str. Delta H chromosome, (NC_000916)=NC_000916,NC_000916.1,gi|15678031|ref|NC_000916.1| -Methanothermococcus okinawensis IH1 chromosome, complete genome. (NC_015636)=NC_015636,NC_015636.1,gi|336121001|ref|NC_015636.1| -Methanothermococcus okinawensis IH1 plasmid pMETOK01, complete (NC_015632)=NC_015632,NC_015632.1,gi|336120990|ref|NC_015632.1| -Methanothermus fervidus DSM 2088 chromosome, complete genome. (NC_014658)=NC_014658,NC_014658.1,gi|312136230|ref|NC_014658.1| -Methanotorris igneus Kol 5 chromosome, complete genome. (NC_015562)=NC_015562,NC_015562.1,gi|333909894|ref|NC_015562.1| -Methylacidiphilum infernorum V4, complete genome. (NC_010794)=NC_010794,NC_010794.1,gi|189218017|ref|NC_010794.1| -Methylibium petroleiphilum PM1 chromosome, complete genome. (NC_008825)=NC_008825,NC_008825.1,gi|124265193|ref|NC_008825.1| -Methylibium petroleiphilum PM1 plasmid RPME01, complete sequence. (NC_008826)=NC_008826,NC_008826.1,gi|124262546|ref|NC_008826.1| -Methylobacillus flagellatus KT, complete genome. (NC_007947)=NC_007947,NC_007947.1,gi|91774356|ref|NC_007947.1| -Methylobacterium sp. 4-46 chromosome, complete genome. (NC_010511)=NC_010511,NC_010511.1,gi|170738367|ref|NC_010511.1| -Methylobacterium sp. 4-46 plasmid pM44601, complete sequence. (NC_010373)=NC_010373,NC_010373.1,gi|169825329|ref|NC_010373.1| -Methylobacterium sp. 4-46 plasmid pM44602, complete sequence. (NC_010374)=NC_010374,NC_010374.1,gi|169825392|ref|NC_010374.1| -Methylobacterium chloromethanicum CM4 chromosome, complete genome. (NC_011757)=NC_011757,NC_011757.1,gi|218528082|ref|NC_011757.1| -Methylobacterium chloromethanicum CM4 plasmid pMCHL02, complete (NC_011760)=NC_011760,NC_011760.1,gi|218534717|ref|NC_011760.1| -methylobacterium chloromethanicum CM4 plasmid pMCHL01, complete (NC_011758)=NC_011758,NC_011758.1,gi|218533256|ref|NC_011758.1| -Methylobacterium extorquens AM1 megaplasmid, complete sequence. (NC_012811)=NC_012811,NC_012811.1,gi|240141776|ref|NC_012811.1| -Methylobacterium extorquens AM1 plasmid p1META1, complete sequence. (NC_012807)=NC_012807,NC_012807.1,gi|240111940|ref|NC_012807.1| -Methylobacterium extorquens AM1 plasmid p2META1, complete sequence. (NC_012809)=NC_012809,NC_012809.1,gi|240141741|ref|NC_012809.1| -Methylobacterium extorquens AM1 plasmid p3META1, complete sequence. (NC_012810)=NC_012810,NC_012810.1,gi|240114607|ref|NC_012810.1| -Methylobacterium extorquens AM1, complete genome. (NC_012808)=NC_012808,NC_012808.1,gi|240136783|ref|NC_012808.1| -Methylobacterium extorquens DM4 plasmid p1METDI, complete sequence. (NC_012987)=NC_012987,NC_012987.1,gi|254558118|ref|NC_012987.1| -Methylobacterium extorquens DM4 plasmid p2METDI, complete sequence. (NC_012989)=NC_012989,NC_012989.1,gi|254564253|ref|NC_012989.1| -Methylobacterium extorquens DM4, complete genome. (NC_012988)=NC_012988,NC_012988.1,gi|254558653|ref|NC_012988.1| -Methylobacterium extorquens PA1 chromosome, complete genome. (NC_010172)=NC_010172,NC_010172.1,gi|163849457|ref|NC_010172.1| -Methylobacterium nodulans ORS 2060 chromosome, complete genome. (NC_011894)=NC_011894,NC_011894.1,gi|220920054|ref|NC_011894.1| -Methylobacterium nodulans ORS 2060 plasmid pMNOD01, complete (NC_011892)=NC_011892,NC_011892.1,gi|220919597|ref|NC_011892.1| -Methylobacterium nodulans ORS 2060 plasmid pMNOD02, complete (NC_011887)=NC_011887,NC_011887.1,gi|220914669|ref|NC_011887.1| -Methylobacterium nodulans ORS 2060 plasmid pMNOD03, complete (NC_011893)=NC_011893,NC_011893.1,gi|220920000|ref|NC_011893.1| -Methylobacterium nodulans ORS 2060 plasmid pMNOD04, complete (NC_011895)=NC_011895,NC_011895.1,gi|220927410|ref|NC_011895.1| -Methylobacterium nodulans ORS 2060 plasmid pMNOD05, complete (NC_011888)=NC_011888,NC_011888.1,gi|220915079|ref|NC_011888.1| -Methylobacterium nodulans ORS 2060 plasmid pMNOD06, complete (NC_011889)=NC_011889,NC_011889.1,gi|220915101|ref|NC_011889.1| -Methylobacterium nodulans ORS 2060 plasmid pMNOD07, complete (NC_011890)=NC_011890,NC_011890.1,gi|220915115|ref|NC_011890.1| -Methylobacterium populi BJ001 chromosome, complete genome. (NC_010725)=NC_010725,NC_010725.1,gi|188579286|ref|NC_010725.1| -Methylobacterium populi BJ001 plasmid pMPOP01, complete sequence. (NC_010727)=NC_010727,NC_010727.1,gi|188584601|ref|NC_010727.1| -Methylobacterium populi BJ001 plasmid pMPOP02, complete sequence. (NC_010721)=NC_010721,NC_010721.1,gi|188579259|ref|NC_010721.1| -Methylobacterium radiotolerans JCM 2831 chromosome, complete (NC_010505)=NC_010505,NC_010505.1,gi|170746450|ref|NC_010505.1| -Methylobacterium radiotolerans JCM 2831 plasmid pMRAD01, complete (NC_010510)=NC_010510,NC_010510.1,gi|170745058|ref|NC_010510.1| -Methylobacterium radiotolerans JCM 2831 plasmid pMRAD02, complete (NC_010509)=NC_010509,NC_010509.1,gi|170745005|ref|NC_010509.1| -Methylobacterium radiotolerans JCM 2831 plasmid pMRAD03, complete (NC_010514)=NC_010514,NC_010514.1,gi|170745566|ref|NC_010514.1| -Methylobacterium radiotolerans JCM 2831 plasmid pMRAD04, complete (NC_010517)=NC_010517,NC_010517.1,gi|170752137|ref|NC_010517.1| -Methylobacterium radiotolerans JCM 2831 plasmid pMRAD05, complete (NC_010518)=NC_010518,NC_010518.1,gi|170752179|ref|NC_010518.1| -Methylobacterium radiotolerans JCM 2831 plasmid pMRAD06, complete (NC_010502)=NC_010502,NC_010502.1,gi|170745610|ref|NC_010502.1| -Methylobacterium radiotolerans JCM 2831 plasmid pMRAD07, complete (NC_010504)=NC_010504,NC_010504.1,gi|170745634|ref|NC_010504.1| -Methylobacterium radiotolerans JCM 2831 plasmid pMRAD08, complete (NC_010507)=NC_010507,NC_010507.1,gi|170744977|ref|NC_010507.1| -Methylocella silvestris BL2 chromosome, complete genome. (NC_011666)=NC_011666,NC_011666.1,gi|217976200|ref|NC_011666.1| -Methylococcus capsulatus str. Bath chromosome, complete genome. (NC_002977)=NC_002977,NC_002977.6,gi|77128441|ref|NC_002977.6| -Methylomicrobium alcaliphilum chromosome, complete genome. (NC_016112)=NC_016112,NC_016112.1,gi|357403388|ref|NC_016112.1| -Methylomonas methanica MC09 chromosome, complete genome. (NC_015572)=NC_015572,NC_015572.1,gi|333981747|ref|NC_015572.1| -Methylophaga sp. JAM1 chromosome, complete genome. (NC_017857)=NC_017857,NC_017857.1,gi|387125902|ref|NC_017857.1| -Methylophaga sp. JAM7 chromosome, complete genome. (NC_017856)=NC_017856,NC_017856.1,gi|387128982|ref|NC_017856.1| -Methylophaga sp. JAM7 plasmid unnamed, complete sequence. (NC_017858)=NC_017858,NC_017858.1,gi|387128925|ref|NC_017858.1| -Methylotenera versatilis 301 chromosome, complete genome. (NC_014207)=NC_014207,NC_014207.1,gi|297537197|ref|NC_014207.1| -Methylotenera mobilis JLW8 chromosome, complete genome. (NC_012968)=NC_012968,NC_012968.1,gi|253995374|ref|NC_012968.1| -Methylovorus sp. MP688 chromosome, complete genome. (NC_014733)=NC_014733,NC_014733.1,gi|313199777|ref|NC_014733.1| -Methylovorus glucosetrophus SIP3-4 chromosome, complete genome. (NC_012969)=NC_012969,NC_012969.1,gi|253997713|ref|NC_012969.1| -Methylovorus glucosetrophus SIP3-4 plasmid pMsip01, complete (NC_012970)=NC_012970,NC_012970.1,gi|254003128|ref|NC_012970.1| -Methylovorus glucosetrophus SIP3-4 plasmid pMsip02, complete (NC_012972)=NC_012972,NC_012972.1,gi|254028270|ref|NC_012972.1| -Micavibrio aeruginosavorus ARL-13 chromosome, complete genome. (NC_016026)=NC_016026,NC_016026.1,gi|347756788|ref|NC_016026.1| -Microbacterium testaceum StLB037, complete genome. (NC_015125)=NC_015125,NC_015125.1,gi|323356448|ref|NC_015125.1| -Micrococcus luteus NCTC 2665, complete genome. (NC_012803)=NC_012803,NC_012803.1,gi|239916571|ref|NC_012803.1| -Microcystis aeruginosa NIES-843 chromosome, complete genome. (NC_010296)=NC_010296,NC_010296.1,gi|166362741|ref|NC_010296.1| -Microlunatus phosphovorus NM-1, complete genome. (NC_015635)=NC_015635,NC_015635.1,gi|336115651|ref|NC_015635.1| -Micromonospora sp. L5 chromosome, complete genome. (NC_014815)=NC_014815,NC_014815.1,gi|315500818|ref|NC_014815.1| -Micromonospora aurantiaca ATCC 27029 chromosome, complete genome. (NC_014391)=NC_014391,NC_014391.1,gi|302864508|ref|NC_014391.1| -Mobiluncus curtisii ATCC 43063 chromosome, complete genome. (NC_014246)=NC_014246,NC_014246.1,gi|298345126|ref|NC_014246.1| -Modestobacter marinus, complete genome. (NC_017955)=NC_017955,NC_017955.1,gi|389861738|ref|NC_017955.1| -Moorella thermoacetica ATCC 39073 chromosome, complete genome. (NC_007644)=NC_007644,NC_007644.1,gi|83588874|ref|NC_007644.1| -Moraxella catarrhalis RH4 chromosome, complete genome. (NC_014147)=NC_014147,NC_014147.1,gi|296112228|ref|NC_014147.1| -Muricauda ruestringensis DSM 13258 chromosome, complete genome. (NC_015945)=NC_015945,NC_015945.1,gi|344201337|ref|NC_015945.1| -Mycobacterium sp. JDM601 chromosome, complete genome. (NC_015576)=NC_015576,NC_015576.1,gi|333988640|ref|NC_015576.1| -Mycobacterium sp. JLS chromosome, complete genome. (NC_009077)=NC_009077,NC_009077.1,gi|126432613|ref|NC_009077.1| -Mycobacterium sp. KMS chromosome, complete genome. (NC_008705)=NC_008705,NC_008705.1,gi|119866057|ref|NC_008705.1| -Mycobacterium sp. KMS plasmid pMKMS01, complete sequence. (NC_008703)=NC_008703,NC_008703.1,gi|119854889|ref|NC_008703.1| -Mycobacterium sp. KMS plasmid pMKMS02, complete sequence. (NC_008704)=NC_008704,NC_008704.1,gi|119855174|ref|NC_008704.1| -Mycobacterium sp. MCS chromosome, complete genome. (NC_008146)=NC_008146,NC_008146.1,gi|108796981|ref|NC_008146.1| -Mycobacterium sp. MCS plasmid1, complete sequence. (NC_008147)=NC_008147,NC_008147.1,gi|108802373|ref|NC_008147.1| -Mycobacterium sp. MOTT36Y chromosome, complete genome. (NC_017904)=NC_017904,NC_017904.1,gi|387873410|ref|NC_017904.1| -Mycobacterium abscessus ATCC 19977 chromosome 1, complete sequence. (NC_010397)=NC_010397,NC_010397.1,gi|169627108|ref|NC_010397.1| -Mycobacterium abscessus ATCC 19977 unnamed plasmid, complete (NC_010394)=NC_010394,NC_010394.1,gi|169786809|ref|NC_010394.1| -Mycobacterium africanum GM041182 chromosome, complete genome. (NC_015758)=NC_015758,NC_015758.1,gi|339630083|ref|NC_015758.1| -Mycobacterium avium 104, complete genome. (NC_008595)=NC_008595,NC_008595.1,gi|118462219|ref|NC_008595.1| -Mycobacterium avium subsp. paratuberculosis K-10, complete genome. (NC_002944)=NC_002944,NC_002944.2,gi|41406098|ref|NC_002944.2| -Mycobacterium bovis AF2122/97 chromosome, complete genome. (NC_002945)=NC_002945,NC_002945.3,gi|31791177|ref|NC_002945.3| -Mycobacterium bovis BCG str. Mexico chromosome, complete genome. (NC_016804)=NC_016804,NC_016804.1,gi|378769743|ref|NC_016804.1| -Mycobacterium bovis BCG str. Pasteur 1173P2 chromosome, complete (NC_008769)=NC_008769,NC_008769.1,gi|121635883|ref|NC_008769.1| -Mycobacterium bovis BCG str. Tokyo 172, complete genome. (NC_012207)=NC_012207,NC_012207.1,gi|224988383|ref|NC_012207.1| -Mycobacterium canettii CIPT 140010059, complete genome. (NC_015848)=NC_015848,NC_015848.1,gi|340625033|ref|NC_015848.1| -Mycobacterium chubuense NBB4 chromosome, complete genome. (NC_018027)=NC_018027,NC_018027.1,gi|392413905|ref|NC_018027.1| -Mycobacterium chubuense NBB4 plasmid pMYCCH.01, complete sequence. (NC_018022)=NC_018022,NC_018022.1,gi|392405727|ref|NC_018022.1| -Mycobacterium chubuense NBB4 plasmid pMYCCH.02, complete sequence. (NC_018023)=NC_018023,NC_018023.1,gi|392406268|ref|NC_018023.1| -Mycobacterium gilvum PYR-GCK chromosome, complete genome. (NC_009338)=NC_009338,NC_009338.1,gi|145220606|ref|NC_009338.1| -Mycobacterium gilvum PYR-GCK plasmid pMFLV01, complete sequence. (NC_009339)=NC_009339,NC_009339.1,gi|145225871|ref|NC_009339.1| -Mycobacterium gilvum PYR-GCK plasmid pMFLV02, complete sequence. (NC_009340)=NC_009340,NC_009340.1,gi|145226172|ref|NC_009340.1| -Mycobacterium gilvum PYR-GCK plasmid pMFLV03, complete sequence. (NC_009341)=NC_009341,NC_009341.1,gi|145226197|ref|NC_009341.1| -Mycobacterium gilvum Spyr1 chromosome, complete genome. (NC_014814)=NC_014814,NC_014814.1,gi|315441696|ref|NC_014814.1| -Mycobacterium gilvum Spyr1 plasmid pMSPYR101, complete sequence. (NC_014811)=NC_014811,NC_014811.1,gi|315441475|ref|NC_014811.1| -Mycobacterium gilvum Spyr1 plasmid pMSPYR102, complete sequence. (NC_014812)=NC_014812,NC_014812.1,gi|315441672|ref|NC_014812.1| -Mycobacterium intracellulare ATCC 13950 chromosome, complete (NC_016946)=NC_016946,NC_016946.1,gi|379744720|ref|NC_016946.1| -Mycobacterium intracellulare MOTT-02 chromosome, complete genome. (NC_016947)=NC_016947,NC_016947.1,gi|379752013|ref|NC_016947.1| -Mycobacterium intracellulare MOTT-64 chromosome, complete genome. (NC_016948)=NC_016948,NC_016948.1,gi|379759437|ref|NC_016948.1| -Mycobacterium leprae Br4923 chromosome, complete genome. (NC_011896)=NC_011896,NC_011896.1,gi|221229343|ref|NC_011896.1| -Mycobacterium leprae TN chromosome, complete genome. (NC_002677)=NC_002677,NC_002677.1,gi|15826865|ref|NC_002677.1| -Mycobacterium marinum M chromosome, complete genome. (NC_010612)=NC_010612,NC_010612.1,gi|183980035|ref|NC_010612.1| -Mycobacterium marinum M plasmid pMM23, complete sequence. (NC_010604)=NC_010604,NC_010604.1,gi|184152625|ref|NC_010604.1| -Mycobacterium massiliense str. GO 06 chromosome, complete genome. (NC_018150)=NC_018150,NC_018150.1,gi|397678256|ref|NC_018150.1| -Mycobacterium rhodesiae NBB3 chromosome, complete genome. (NC_016604)=NC_016604,NC_016604.1,gi|375137218|ref|NC_016604.1| -Mycobacterium smegmatis str. MC2 155 chromosome, complete genome. (NC_008596)=NC_008596,NC_008596.1,gi|118467340|ref|NC_008596.1| -Mycobacterium tuberculosis CCDC5079 chromosome, complete genome. (NC_017523)=NC_017523,NC_017523.1,gi|385993125|ref|NC_017523.1| -Mycobacterium tuberculosis CCDC5180 chromosome, complete genome. (NC_017522)=NC_017522,NC_017522.1,gi|385989534|ref|NC_017522.1| -Mycobacterium tuberculosis CDC1551 chromosome, complete genome. (NC_002755)=NC_002755,NC_002755.2,gi|50953765|ref|NC_002755.2| -Mycobacterium tuberculosis CTRI-2 chromosome, complete genome. (NC_017524)=NC_017524,NC_017524.1,gi|385996772|ref|NC_017524.1| -Mycobacterium tuberculosis F11, complete genome. (NC_009565)=NC_009565,NC_009565.1,gi|148821191|ref|NC_009565.1| -Mycobacterium tuberculosis H37Ra, complete genome. (NC_009525)=NC_009525,NC_009525.1,gi|148659757|ref|NC_009525.1| -Mycobacterium tuberculosis H37Rv chromosome, complete genome. (NC_018143)=NC_018143,NC_018143.1,gi|397671778|ref|NC_018143.1| -Mycobacterium tuberculosis H37Rv chromosome, complete genome. (NC_000962)=NC_000962,NC_000962.2,gi|57116681|ref|NC_000962.2| -Mycobacterium tuberculosis KZN 1435, complete genome. (NC_012943)=NC_012943,NC_012943.1,gi|253796915|ref|NC_012943.1| -Mycobacterium tuberculosis KZN 4207 chromosome, complete genome. (NC_016768)=NC_016768,NC_016768.1,gi|375294201|ref|NC_016768.1| -Mycobacterium tuberculosis KZN 605 chromosome, complete genome. (NC_018078)=NC_018078,NC_018078.1,gi|392430409|ref|NC_018078.1| -Mycobacterium tuberculosis RGTB327 chromosome, complete genome. (NC_017026)=NC_017026,NC_017026.1,gi|383305933|ref|NC_017026.1| -Mycobacterium tuberculosis RGTB423 chromosome, complete genome. (NC_017528)=NC_017528,NC_017528.1,gi|386003090|ref|NC_017528.1| -Mycobacterium tuberculosis UT205, complete genome. (NC_016934)=NC_016934,NC_016934.1,gi|392384721|ref|NC_016934.1| -Mycobacterium ulcerans AGY99 plasmid pMUM001, complete sequence. (NC_005916)=NC_005916,NC_005916.1,gi|49146084|ref|NC_005916.1| -Mycobacterium ulcerans Agy99 chromosome, complete genome. (NC_008611)=NC_008611,NC_008611.1,gi|118615919|ref|NC_008611.1| -Mycobacterium vanbaalenii PYR-1 chromosome, complete genome. (NC_008726)=NC_008726,NC_008726.1,gi|120401028|ref|NC_008726.1| -Mycoplasma agalactiae PG2, complete genome. (NC_009497)=NC_009497,NC_009497.1,gi|148377268|ref|NC_009497.1| -Mycoplasma agalactiae chromosome, complete genome. (NC_013948)=NC_013948,NC_013948.1,gi|291319937|ref|NC_013948.1| -Mycoplasma arthritidis 158L3-1, complete genome. (NC_011025)=NC_011025,NC_011025.1,gi|193082772|ref|NC_011025.1| -Mycoplasma bovis HB0801 chromosome, complete genome. (NC_018077)=NC_018077,NC_018077.1,gi|392429594|ref|NC_018077.1| -Mycoplasma bovis Hubei-1 chromosome, complete genome. (NC_015725)=NC_015725,NC_015725.1,gi|339320528|ref|NC_015725.1| -Mycoplasma bovis PG45 chromosome, complete genome. (NC_014760)=NC_014760,NC_014760.1,gi|313678134|ref|NC_014760.1| -Mycoplasma capricolum subsp. capricolum ATCC 27343 chromosome, (NC_007633)=NC_007633,NC_007633.1,gi|83319253|ref|NC_007633.1| -Mycoplasma conjunctivae HRC/581 chromosome, complete genome. (NC_012806)=NC_012806,NC_012806.1,gi|240047135|ref|NC_012806.1| -Mycoplasma crocodyli MP145 chromosome, complete genome. (NC_014014)=NC_014014,NC_014014.1,gi|294155300|ref|NC_014014.1| -Mycoplasma fermentans JER chromosome, complete genome. (NC_014552)=NC_014552,NC_014552.1,gi|308189587|ref|NC_014552.1| -Mycoplasma fermentans M64 chromosome, complete genome. (NC_014921)=NC_014921,NC_014921.1,gi|319776738|ref|NC_014921.1| -Mycoplasma gallisepticum str. F chromosome, complete genome. (NC_017503)=NC_017503,NC_017503.1,gi|385325853|ref|NC_017503.1| -Mycoplasma gallisepticum str. R(high) chromosome, complete genome. (NC_017502)=NC_017502,NC_017502.1,gi|385325086|ref|NC_017502.1| -Mycoplasma gallisepticum str. R(low) chromosome, complete genome. (NC_004829)=NC_004829,NC_004829.2,gi|294660180|ref|NC_004829.2| -Mycoplasma genitalium G37, complete genome. (NC_000908)=NC_000908,NC_000908.2,gi|108885074|ref|NC_000908.2| -Mycoplasma haemocanis str. Illinois chromosome, complete genome. (NC_016638)=NC_016638,NC_016638.1,gi|374317610|ref|NC_016638.1| -Mycoplasma haemofelis str. Langford 1, complete genome. (NC_014970)=NC_014970,NC_014970.1,gi|321309518|ref|NC_014970.1| -Mycoplasma haemofelis Ohio2 chromosome, complete genome. (NC_017520)=NC_017520,NC_017520.1,gi|385858893|ref|NC_017520.1| -Mycoplasma hominis ATCC 23114 chromosome, complete genome. (NC_013511)=NC_013511,NC_013511.1,gi|269114774|ref|NC_013511.1| -Mycoplasma hyopneumoniae 168 chromosome, complete genome. (NC_017509)=NC_017509,NC_017509.1,gi|385334155|ref|NC_017509.1| -Mycoplasma hyopneumoniae 232, complete genome. (NC_006360)=NC_006360,NC_006360.1,gi|54019969|ref|NC_006360.1| -Mycoplasma hyopneumoniae 7448 chromosome, complete genome. (NC_007332)=NC_007332,NC_007332.1,gi|72080342|ref|NC_007332.1| -Mycoplasma hyopneumoniae J chromosome, complete genome. (NC_007295)=NC_007295,NC_007295.1,gi|71893359|ref|NC_007295.1| -Mycoplasma hyorhinis GDL-1 chromosome, complete genome. (NC_016829)=NC_016829,NC_016829.1,gi|378835506|ref|NC_016829.1| -Mycoplasma hyorhinis HUB-1 chromosome, complete genome. (NC_014448)=NC_014448,NC_014448.1,gi|304372805|ref|NC_014448.1| -Mycoplasma hyorhinis MCLD chromosome, complete genome. (NC_017519)=NC_017519,NC_017519.1,gi|385858114|ref|NC_017519.1| -Mycoplasma leachii 99/014/6, complete genome. (NC_017521)=NC_017521,NC_017521.1,gi|392388518|ref|NC_017521.1| -Mycoplasma leachii PG50 chromosome, complete genome. (NC_014751)=NC_014751,NC_014751.1,gi|313664890|ref|NC_014751.1| -Mycoplasma mobile 163K, complete genome. (NC_006908)=NC_006908,NC_006908.1,gi|47458835|ref|NC_006908.1| -Mycoplasma mycoides subsp. mycoides SC str. PG1 chromosome, (NC_005364)=NC_005364,NC_005364.2,gi|127763381|ref|NC_005364.2| -Mycoplasma mycoides subsp. capri LC str. 95010 plasmid pMmc-95010, (NC_015407)=NC_015407,NC_015407.1,gi|330370665|ref|NC_015407.1| -Mycoplasma mycoides subsp. capri LC str. 95010, complete genome. (NC_015431)=NC_015431,NC_015431.1,gi|331703020|ref|NC_015431.1| -Mycoplasma penetrans HF-2, complete genome. (NC_004432)=NC_004432,NC_004432.1,gi|26553452|ref|NC_004432.1| -Mycoplasma pneumoniae 309, complete genome. (NC_016807)=NC_016807,NC_016807.1,gi|377822306|ref|NC_016807.1| -Mycoplasma pneumoniae FH chromosome, complete genome. (NC_017504)=NC_017504,NC_017504.1,gi|385326614|ref|NC_017504.1| -Mycoplasma pneumoniae M129, complete genome. (NC_000912)=NC_000912,NC_000912.1,gi|13507739|ref|NC_000912.1| -Mycoplasma pulmonis UAB CTIP, complete genome. (NC_002771)=NC_002771,NC_002771.1,gi|15828471|ref|NC_002771.1| -Mycoplasma putrefaciens KS1 chromosome, complete genome. (NC_015946)=NC_015946,NC_015946.1,gi|344204770|ref|NC_015946.1| -Mycoplasma suis str. Illinois chromosome, complete genome. (NC_015155)=NC_015155,NC_015155.1,gi|325972867|ref|NC_015155.1| -Mycoplasma suis KI3806, complete genome. (NC_015153)=NC_015153,NC_015153.1,gi|325989358|ref|NC_015153.1| -Mycoplasma synoviae 53, complete genome. (NC_007294)=NC_007294,NC_007294.1,gi|71894025|ref|NC_007294.1| -Mycoplasma wenyonii str. Massachusetts chromosome, complete genome. (NC_018149)=NC_018149,NC_018149.1,gi|397677603|ref|NC_018149.1| -Myxococcus fulvus HW-1 chromosome, complete genome. (NC_015711)=NC_015711,NC_015711.1,gi|338529680|ref|NC_015711.1| -Myxococcus xanthus DK 1622 chromosome, complete genome. (NC_008095)=NC_008095,NC_008095.1,gi|108756767|ref|NC_008095.1| -Nakamurella multipartita DSM 44233 chromosome, complete genome. (NC_013235)=NC_013235,NC_013235.1,gi|258650271|ref|NC_013235.1| -Nanoarchaeum equitans Kin4-M chromosome, complete genome. (NC_005213)=NC_005213,NC_005213.1,gi|38349555|ref|NC_005213.1| -Natranaerobius thermophilus JW/NM-WN-LF chromosome, complete (NC_010718)=NC_010718,NC_010718.1,gi|188584642|ref|NC_010718.1| -Natranaerobius thermophilus JW/NM-WN-LF plasmid pNTHE01, complete (NC_010715)=NC_010715,NC_010715.1,gi|188584627|ref|NC_010715.1| -Natranaerobius thermophilus JW/NM-WN-LF plasmid pNTHE02, complete (NC_010724)=NC_010724,NC_010724.1,gi|188587525|ref|NC_010724.1| -Natrialba magadii ATCC 43099 chromosome, complete genome. (NC_013922)=NC_013922,NC_013922.1,gi|289579696|ref|NC_013922.1| -Natrialba magadii ATCC 43099 plasmid pNMAG01, complete sequence. (NC_013923)=NC_013923,NC_013923.1,gi|289583311|ref|NC_013923.1| -Natrialba magadii ATCC 43099 plasmid pNMAG02, complete sequence. (NC_013924)=NC_013924,NC_013924.1,gi|289937459|ref|NC_013924.1| -Natrialba magadii ATCC 43099 plasmid pNMAG03, complete sequence. (NC_013925)=NC_013925,NC_013925.1,gi|289594273|ref|NC_013925.1| -Natrinema sp. J7-2 chromosome, complete genome. (NC_018224)=NC_018224,NC_018224.1,gi|397771790|ref|NC_018224.1| -Natrinema sp. J7-2 plasmid pJ7-1, complete sequence. (NC_018225)=NC_018225,NC_018225.1,gi|397771726|ref|NC_018225.1| -Natronomonas pharaonis DSM 2160 plasmid PL131, complete sequence. (NC_007427)=NC_007427,NC_007427.1,gi|76803367|ref|NC_007427.1| -Natronomonas pharaonis DSM 2160 plasmid PL23, complete sequence. (NC_007428)=NC_007428,NC_007428.1,gi|76803317|ref|NC_007428.1| -Natronomonas pharaonis DSM 2160, complete genome. (NC_007426)=NC_007426,NC_007426.1,gi|76800655|ref|NC_007426.1| -Nautilia profundicola AmH chromosome, complete genome. (NC_012115)=NC_012115,NC_012115.1,gi|224372070|ref|NC_012115.1| -Neisseria gonorrhoeae FA 1090, complete genome. (NC_002946)=NC_002946,NC_002946.2,gi|59800473|ref|NC_002946.2| -Neisseria gonorrhoeae NCCP11945 chromosome, complete genome. (NC_011035)=NC_011035,NC_011035.1,gi|194097589|ref|NC_011035.1| -Neisseria gonorrhoeae NCCP11945 plasmid pNGK, complete sequence. (NC_011034)=NC_011034,NC_011034.1,gi|194097576|ref|NC_011034.1| -Neisseria gonorrhoeae TCDC-NG08107 chromosome, complete genome. (NC_017511)=NC_017511,NC_017511.1,gi|385334895|ref|NC_017511.1| -Neisseria gonorrhoeae TCDC-NG08107 plasmid pNGTCDC08107, complete (NC_017510)=NC_017510,NC_017510.1,gi|385334849|ref|NC_017510.1| -Neisseria lactamica 020-06 chromosome, complete genome. (NC_014752)=NC_014752,NC_014752.1,gi|313667359|ref|NC_014752.1| -Neisseria meningitidis 053442 chromosome, complete genome. (NC_010120)=NC_010120,NC_010120.1,gi|161869018|ref|NC_010120.1| -Neisseria meningitidis 8013, complete genome. (NC_017501)=NC_017501,NC_017501.1,gi|385323172|ref|NC_017501.1| -Neisseria meningitidis FAM18 chromosome, complete genome. (NC_008767)=NC_008767,NC_008767.1,gi|121633901|ref|NC_008767.1| -Neisseria meningitidis G2136 chromosome, complete genome. (NC_017513)=NC_017513,NC_017513.1,gi|385339062|ref|NC_017513.1| -Neisseria meningitidis H44/76 chromosome, complete genome. (NC_017516)=NC_017516,NC_017516.1,gi|385852231|ref|NC_017516.1| -Neisseria meningitidis M01-240149 chromosome, complete genome. (NC_017514)=NC_017514,NC_017514.1,gi|385340991|ref|NC_017514.1| -Neisseria meningitidis M01-240355 chromosome, complete genome. (NC_017517)=NC_017517,NC_017517.1,gi|385854193|ref|NC_017517.1| -Neisseria meningitidis M04-240196 chromosome, complete genome. (NC_017515)=NC_017515,NC_017515.1,gi|385850283|ref|NC_017515.1| -Neisseria meningitidis MC58 chromosome, complete genome. (NC_003112)=NC_003112,NC_003112.2,gi|77358697|ref|NC_003112.2| -Neisseria meningitidis NZ-05/33 chromosome, complete genome. (NC_017518)=NC_017518,NC_017518.1,gi|385856165|ref|NC_017518.1| -Neisseria meningitidis WUE 2594, complete genome. (NC_017512)=NC_017512,NC_017512.1,gi|385337120|ref|NC_017512.1| -Neisseria meningitidis Z2491 chromosome, complete genome. (NC_003116)=NC_003116,NC_003116.1,gi|15793034|ref|NC_003116.1| -Neisseria meningitidis alpha14 chromosome, complete genome. (NC_013016)=NC_013016,NC_013016.1,gi|254804028|ref|NC_013016.1| -Neisseria meningitidis alpha710 chromosome, complete genome. (NC_017505)=NC_017505,NC_017505.1,gi|385327372|ref|NC_017505.1| -Neorickettsia risticii str. Illinois, complete genome. (NC_013009)=NC_013009,NC_013009.1,gi|254796400|ref|NC_013009.1| -Neorickettsia sennetsu str. Miyayama chromosome, complete genome. (NC_007798)=NC_007798,NC_007798.1,gi|88607955|ref|NC_007798.1| -Niastella koreensis GR20-10 chromosome, complete genome. (NC_016609)=NC_016609,NC_016609.1,gi|375143366|ref|NC_016609.1| -Nitratifractor salsuginis DSM 16511 chromosome, complete genome. (NC_014935)=NC_014935,NC_014935.1,gi|319955760|ref|NC_014935.1| -Nitratiruptor sp. SB155-2, complete genome. (NC_009662)=NC_009662,NC_009662.1,gi|152989753|ref|NC_009662.1| -Nitrobacter hamburgensis X14 chromosome, complete genome. (NC_007964)=NC_007964,NC_007964.1,gi|92115633|ref|NC_007964.1| -Nitrobacter hamburgensis X14 plasmid 1, complete sequence. (NC_007959)=NC_007959,NC_007959.1,gi|92109250|ref|NC_007959.1| -Nitrobacter hamburgensis X14 plasmid 2, complete sequence. (NC_007960)=NC_007960,NC_007960.1,gi|92109490|ref|NC_007960.1| -Nitrobacter hamburgensis X14 plasmid 3, complete sequence. (NC_007961)=NC_007961,NC_007961.1,gi|92109663|ref|NC_007961.1| -Nitrobacter winogradskyi Nb-255 chromosome, complete genome. (NC_007406)=NC_007406,NC_007406.1,gi|75674199|ref|NC_007406.1| -Nitrosococcus halophilus Nc4 chromosome, complete genome. (NC_013960)=NC_013960,NC_013960.1,gi|292490170|ref|NC_013960.1| -Nitrosococcus halophilus Nc4 plasmid pNHAL01, complete sequence. (NC_013958)=NC_013958,NC_013958.1,gi|291615453|ref|NC_013958.1| -Nitrosococcus oceani ATCC 19707 chromosome, complete genome. (NC_007484)=NC_007484,NC_007484.1,gi|77163561|ref|NC_007484.1| -Nitrosococcus oceani ATCC 19707 plasmid A, complete sequence. (NC_007483)=NC_007483,NC_007483.1,gi|77163517|ref|NC_007483.1| -Nitrosococcus watsoni C-113 plasmid pNWAT01, complete sequence. (NC_014316)=NC_014316,NC_014316.1,gi|300115607|ref|NC_014316.1| -Nitrosococcus watsoni C-113 plasmid pNWAT02, complete sequence. (NC_014317)=NC_014317,NC_014317.1,gi|300067537|ref|NC_014317.1| -Nitrosococcus watsonii C-113 chromosome, complete genome. (NC_014315)=NC_014315,NC_014315.1,gi|300112745|ref|NC_014315.1| -Nitrosomonas sp. AL212 chromosome, complete genome. (NC_015222)=NC_015222,NC_015222.1,gi|325980881|ref|NC_015222.1| -Nitrosomonas sp. AL212 plasmid pNAL21201, complete sequence. (NC_015223)=NC_015223,NC_015223.1,gi|325983714|ref|NC_015223.1| -Nitrosomonas sp. AL212 plasmid pNAL21202, complete sequence. (NC_015221)=NC_015221,NC_015221.1,gi|325980815|ref|NC_015221.1| -Nitrosomonas sp. Is79A3 chromosome, complete genome. (NC_015731)=NC_015731,NC_015731.1,gi|339481522|ref|NC_015731.1| -Nitrosomonas europaea ATCC 19718 chromosome, complete genome. (NC_004757)=NC_004757,NC_004757.1,gi|30248031|ref|NC_004757.1| -Nitrosomonas eutropha C91 chromosome, complete genome. (NC_008344)=NC_008344,NC_008344.1,gi|114330036|ref|NC_008344.1| -Nitrosomonas eutropha C91 plasmid1, complete sequence. (NC_008341)=NC_008341,NC_008341.1,gi|114326555|ref|NC_008341.1| -Nitrosomonas eutropha C91 plasmid2, complete sequence. (NC_008342)=NC_008342,NC_008342.1,gi|114326611|ref|NC_008342.1| -Nitrosopumilus maritimus SCM1 chromosome, complete genome. (NC_010085)=NC_010085,NC_010085.1,gi|161527512|ref|NC_010085.1| -Nitrosospira multiformis ATCC 25196 chromosome, complete genome. (NC_007614)=NC_007614,NC_007614.1,gi|82701135|ref|NC_007614.1| -Nitrosospira multiformis ATCC 25196 plasmid 1, complete sequence. (NC_007615)=NC_007615,NC_007615.1,gi|82703893|ref|NC_007615.1| -Nitrosospira multiformis ATCC 25196 plasmid 2, complete sequence. (NC_007616)=NC_007616,NC_007616.1,gi|82703911|ref|NC_007616.1| -Nitrosospira multiformis ATCC 25196 plasmid 3, complete sequence. (NC_007617)=NC_007617,NC_007617.1,gi|82703928|ref|NC_007617.1| -Nocardia cyriacigeorgica GUH-2, complete genome. (NC_016887)=NC_016887,NC_016887.1,gi|379706264|ref|NC_016887.1| -Nocardia farcinica IFM 10152 chromosome, complete genome. (NC_006361)=NC_006361,NC_006361.1,gi|54021964|ref|NC_006361.1| -Nocardia farcinica IFM 10152 plasmid pNF1, complete sequence. (NC_006362)=NC_006362,NC_006362.1,gi|54027648|ref|NC_006362.1| -Nocardia farcinica IFM 10152 plasmid pNF2, complete sequence. (NC_006363)=NC_006363,NC_006363.1,gi|54027809|ref|NC_006363.1| -Nocardioides sp. JS614 chromosome, complete genome. (NC_008699)=NC_008699,NC_008699.1,gi|119714272|ref|NC_008699.1| -Nocardioides sp. JS614 plasmid pNOCA01, complete sequence. (NC_008697)=NC_008697,NC_008697.1,gi|119714007|ref|NC_008697.1| -Nocardiopsis dassonvillei subsp. dassonvillei DSM 43111 chromosome, (NC_014210)=NC_014210,NC_014210.1,gi|297558985|ref|NC_014210.1| -Nocardiopsis dassonvillei subsp. dassonvillei DSM 43111 plasmid (NC_014211)=NC_014211,NC_014211.1,gi|297563784|ref|NC_014211.1| -Nostoc sp. PCC 7120 chromosome, complete genome. (NC_003272)=NC_003272,NC_003272.1,gi|17227497|ref|NC_003272.1| -Nostoc sp. PCC 7120 plasmid pCC7120alpha, complete sequence. (NC_003276)=NC_003276,NC_003276.1,gi|17233017|ref|NC_003276.1| -Nostoc sp. PCC 7120 plasmid pCC7120beta, complete sequence. (NC_003240)=NC_003240,NC_003240.1,gi|17158637|ref|NC_003240.1| -Nostoc sp. PCC 7120 plasmid pCC7120delta, complete sequence. (NC_003273)=NC_003273,NC_003273.1,gi|17232874|ref|NC_003273.1| -Nostoc sp. PCC 7120 plasmid pCC7120epsilon, complete sequence. (NC_003270)=NC_003270,NC_003270.1,gi|17227465|ref|NC_003270.1| -Nostoc sp. PCC 7120 plasmid pCC7120gamma, complete sequence. (NC_003267)=NC_003267,NC_003267.1,gi|17227374|ref|NC_003267.1| -Nostoc sp. PCC 7120 plasmid pCC7120zeta, complete sequence. (NC_003241)=NC_003241,NC_003241.1,gi|17158061|ref|NC_003241.1| -Nostoc punctiforme PCC 73102 chromosome, complete genome. (NC_010628)=NC_010628,NC_010628.1,gi|186680550|ref|NC_010628.1| -Nostoc punctiforme PCC 73102 plasmid pNPUN01, complete sequence. (NC_010631)=NC_010631,NC_010631.1,gi|186686738|ref|NC_010631.1| -Nostoc punctiforme PCC 73102 plasmid pNPUN02, complete sequence. (NC_010632)=NC_010632,NC_010632.1,gi|186687048|ref|NC_010632.1| -Nostoc punctiforme PCC 73102 plasmid pNPUN03, complete sequence. (NC_010630)=NC_010630,NC_010630.1,gi|186686664|ref|NC_010630.1| -Nostoc punctiforme PCC 73102 plasmid pNPUN04, complete sequence. (NC_010633)=NC_010633,NC_010633.1,gi|186686999|ref|NC_010633.1| -Nostoc punctiforme PCC 73102 plasmid pNPUN05, complete sequence. (NC_010629)=NC_010629,NC_010629.1,gi|186686638|ref|NC_010629.1| -Novosphingobium sp. PP1Y chromosome, complete genome. (NC_015580)=NC_015580,NC_015580.1,gi|334139601|ref|NC_015580.1| -Novosphingobium sp. PP1Y plasmid Lpl, complete sequence. (NC_015579)=NC_015579,NC_015579.1,gi|334133217|ref|NC_015579.1| -Novosphingobium sp. PP1Y plasmid Mpl, complete sequence. (NC_015583)=NC_015583,NC_015583.1,gi|334144765|ref|NC_015583.1| -Novosphingobium sp. PP1Y plasmid Spl, complete sequence. (NC_015582)=NC_015582,NC_015582.1,gi|334143044|ref|NC_015582.1| -Novosphingobium aromaticivorans DSM 12444 chromosome, complete (NC_007794)=NC_007794,NC_007794.1,gi|87198026|ref|NC_007794.1| -Novosphingobium aromaticivorans DSM 12444 plasmid pNL1, complete (NC_009426)=NC_009426,NC_009426.1,gi|146275443|ref|NC_009426.1| -Novosphingobium aromaticivorans DSM 12444 plasmid pNL2, complete (NC_009427)=NC_009427,NC_009427.1,gi|146275626|ref|NC_009427.1| -Oceanimonas sp. GK1 chromosome, complete genome. (NC_016745)=NC_016745,NC_016745.1,gi|374333820|ref|NC_016745.1| -Oceanimonas sp. GK1 plasmid pOCEGK01, complete sequence. (NC_016746)=NC_016746,NC_016746.1,gi|374337029|ref|NC_016746.1| -Oceanimonas sp. GK1 plasmid pOCEGK02, complete sequence. (NC_016747)=NC_016747,NC_016747.1,gi|374337039|ref|NC_016747.1| -Oceanithermus profundus DSM 14977 chromosome, complete genome. (NC_014761)=NC_014761,NC_014761.1,gi|313678900|ref|NC_014761.1| -Oceanithermus profundus DSM 14977 plasmid pOCEPR01, complete (NC_014753)=NC_014753,NC_014753.1,gi|313667214|ref|NC_014753.1| -Oceanobacillus iheyensis HTE831 chromosome, complete genome. (NC_004193)=NC_004193,NC_004193.1,gi|23097455|ref|NC_004193.1| -Ochrobactrum anthropi ATCC 49188 chromosome 1, complete sequence. (NC_009667)=NC_009667,NC_009667.1,gi|153007346|ref|NC_009667.1| -Ochrobactrum anthropi ATCC 49188 chromosome 2, complete sequence. (NC_009668)=NC_009668,NC_009668.1,gi|153010078|ref|NC_009668.1| -Ochrobactrum anthropi ATCC 49188 plasmid pOANT01, complete (NC_009669)=NC_009669,NC_009669.1,gi|153011772|ref|NC_009669.1| -Ochrobactrum anthropi ATCC 49188 plasmid pOANT02, complete (NC_009670)=NC_009670,NC_009670.1,gi|153011934|ref|NC_009670.1| -Ochrobactrum anthropi ATCC 49188 plasmid pOANT03, complete (NC_009671)=NC_009671,NC_009671.1,gi|153012026|ref|NC_009671.1| -Ochrobactrum anthropi ATCC 49188 plasmid pOANT04, complete (NC_009672)=NC_009672,NC_009672.1,gi|153012113|ref|NC_009672.1| -Odoribacter splanchnicus DSM 20712 chromosome, complete genome. (NC_015160)=NC_015160,NC_015160.1,gi|325278757|ref|NC_015160.1| -Oenococcus oeni PSU-1, complete genome. (NC_008528)=NC_008528,NC_008528.1,gi|116490126|ref|NC_008528.1| -Oligotropha carboxidovorans OM4 chromosome, complete genome. (NC_017538)=NC_017538,NC_017538.1,gi|386028266|ref|NC_017538.1| -Oligotropha carboxidovorans OM4 plasmid pHCG3B, complete sequence. (NC_017536)=NC_017536,NC_017536.1,gi|386031648|ref|NC_017536.1| -Oligotropha carboxidovorans OM4 plasmid pOC167B, complete sequence. (NC_017539)=NC_017539,NC_017539.1,gi|386031806|ref|NC_017539.1| -Oligotropha carboxidovorans OM5 chromosome, complete genome. (NC_011386)=NC_011386,NC_011386.1,gi|209883160|ref|NC_011386.1| -Oligotropha carboxidovorans OM5 chromosome, complete genome. (NC_015684)=NC_015684,NC_015684.1,gi|337739247|ref|NC_015684.1| -Oligotropha carboxidovorans OM5 plasmid pHCG3, complete sequence. (NC_015689)=NC_015689,NC_015689.1,gi|337739122|ref|NC_015689.1| -Oligotropha carboxidovorans OM5 plasmid pOC167, complete sequence. (NC_015685)=NC_015685,NC_015685.1,gi|337738957|ref|NC_015685.1| -Olsenella uli DSM 7084 chromosome, complete genome. (NC_014363)=NC_014363,NC_014363.1,gi|302334808|ref|NC_014363.1| -Onion yellows phytoplasma OY-M, complete genome. (NC_005303)=NC_005303,NC_005303.2,gi|255961248|ref|NC_005303.2| -Opitutus terrae PB90-1 chromosome, complete genome. (NC_010571)=NC_010571,NC_010571.1,gi|182411826|ref|NC_010571.1| -Orientia tsutsugamushi str. Boryong, complete genome. (NC_009488)=NC_009488,NC_009488.1,gi|148283997|ref|NC_009488.1| -Orientia tsutsugamushi str. Ikeda, complete genome. (NC_010793)=NC_010793,NC_010793.1,gi|189182907|ref|NC_010793.1| -Ornithobacterium rhinotracheale DSM 15997 chromosome, complete (NC_018016)=NC_018016,NC_018016.1,gi|392389424|ref|NC_018016.1| -Oscillibacter valericigenes Sjm18-20 plasmid pOBV01, complete (NC_016046)=NC_016046,NC_016046.1,gi|349703191|ref|NC_016046.1| -Oscillibacter valericigenes Sjm18-20, complete genome. (NC_016048)=NC_016048,NC_016048.1,gi|350268398|ref|NC_016048.1| -Owenweeksia hongkongensis DSM 17368 chromosome, complete genome. (NC_016599)=NC_016599,NC_016599.1,gi|375010684|ref|NC_016599.1| -Paenibacillus sp. JDR-2 chromosome, complete genome. (NC_012914)=NC_012914,NC_012914.1,gi|251794036|ref|NC_012914.1| -Paenibacillus sp. Y412MC10 chromosome, complete genome. (NC_013406)=NC_013406,NC_013406.1,gi|261403876|ref|NC_013406.1| -Paenibacillus mucilaginosus 3016 chromosome, complete genome. (NC_016935)=NC_016935,NC_016935.1,gi|379718015|ref|NC_016935.1| -Paenibacillus mucilaginosus K02 chromosome, complete genome. (NC_017672)=NC_017672,NC_017672.1,gi|386720569|ref|NC_017672.1| -Paenibacillus mucilaginosus KNP414 chromosome, complete genome. (NC_015690)=NC_015690,NC_015690.1,gi|337744364|ref|NC_015690.1| -Paenibacillus polymyxa E681 chromosome, complete genome. (NC_014483)=NC_014483,NC_014483.1,gi|308066838|ref|NC_014483.1| -Paenibacillus polymyxa M1 plasmid pPPM1a, complete sequence. (NC_017543)=NC_017543,NC_017543.1,gi|386037981|ref|NC_017543.1| -Paenibacillus polymyxa M1, complete genome. (NC_017542)=NC_017542,NC_017542.1,gi|386038690|ref|NC_017542.1| -Paenibacillus polymyxa SC2 chromosome, complete genome. (NC_014622)=NC_014622,NC_014622.1,gi|310639471|ref|NC_014622.1| -Paenibacillus polymyxa SC2 plasmid pSC2, complete sequence. (NC_014628)=NC_014628,NC_014628.1,gi|310830362|ref|NC_014628.1| -Paenibacillus terrae HPL-003 chromosome, complete genome. (NC_016641)=NC_016641,NC_016641.1,gi|374319880|ref|NC_016641.1| -Paludibacter propionicigenes WB4 chromosome, complete genome. (NC_014734)=NC_014734,NC_014734.1,gi|313202490|ref|NC_014734.1| -Pantoea sp. At-9b chromosome, complete genome. (NC_014837)=NC_014837,NC_014837.1,gi|317046238|ref|NC_014837.1| -Pantoea sp. At-9b plasmid pPAT9B01, complete sequence. (NC_014838)=NC_014838,NC_014838.1,gi|317053820|ref|NC_014838.1| -Pantoea sp. At-9b plasmid pPAT9B02, complete sequence. (NC_014839)=NC_014839,NC_014839.1,gi|317053479|ref|NC_014839.1| -Pantoea sp. At-9b plasmid pPAT9B03, complete sequence. (NC_014840)=NC_014840,NC_014840.1,gi|317053186|ref|NC_014840.1| -Pantoea sp. At-9b plasmid pPAT9B04, complete sequence. (NC_014841)=NC_014841,NC_014841.1,gi|317052891|ref|NC_014841.1| -Pantoea sp. At-9b plasmid pPAT9B05, complete sequence. (NC_014842)=NC_014842,NC_014842.1,gi|317052773|ref|NC_014842.1| -Pantoea ananatis AJ13355 plasmid pEA320, complete sequence. (NC_017533)=NC_017533,NC_017533.1,gi|386018361|ref|NC_017533.1| -Pantoea ananatis AJ13355, complete genome. (NC_017531)=NC_017531,NC_017531.1,gi|386014600|ref|NC_017531.1| -Pantoea ananatis LMG 20103 chromosome, complete genome. (NC_013956)=NC_013956,NC_013956.2,gi|332139403|ref|NC_013956.2| -Pantoea ananatis PA13 chromosome, complete genome. (NC_017554)=NC_017554,NC_017554.1,gi|386077236|ref|NC_017554.1| -Pantoea ananatis PA13 plasmid PAGR_p, complete sequence. (NC_017553)=NC_017553,NC_017553.1,gi|386076436|ref|NC_017553.1| -Pantoea ananatis LMG 5342 plasmid pPANA10, complete sequence. (NC_016817)=NC_016817,NC_016817.1,gi|378769296|ref|NC_016817.1| -Pantoea ananatis LMG 5342, complete genome. (NC_016816)=NC_016816,NC_016816.1,gi|378764971|ref|NC_016816.1| -Pantoea vagans C9-1 chromosome, complete genome. (NC_014562)=NC_014562,NC_014562.1,gi|308185541|ref|NC_014562.1| -Pantoea vagans C9-1 plasmid pPag1, complete sequence. (NC_014561)=NC_014561,NC_014561.1,gi|308185378|ref|NC_014561.1| -Pantoea vagans C9-1 plasmid pPag2, complete sequence. (NC_014563)=NC_014563,NC_014563.1,gi|308189206|ref|NC_014563.1| -Pantoea vagans C9-1 plasmid pPag3, complete sequence. (NC_014258)=NC_014258,NC_014258.1,gi|298717099|ref|NC_014258.1| -Parabacteroides distasonis ATCC 8503 chromosome, complete genome. (NC_009615)=NC_009615,NC_009615.1,gi|150006674|ref|NC_009615.1| -Parachlamydia acanthamoebae UV-7 chromosome, complete genome. (NC_015702)=NC_015702,NC_015702.1,gi|338173994|ref|NC_015702.1| -Paracoccus denitrificans PD1222 chromosome 1, complete sequence. (NC_008686)=NC_008686,NC_008686.1,gi|119382757|ref|NC_008686.1| -Paracoccus denitrificans PD1222 chromosome 2, complete sequence. (NC_008687)=NC_008687,NC_008687.1,gi|119385557|ref|NC_008687.1| -Paracoccus denitrificans PD1222 plasmid 1, complete sequence. (NC_008688)=NC_008688,NC_008688.1,gi|119387240|ref|NC_008688.1| -Parvibaculum lavamentivorans DS-1 chromosome, complete genome. (NC_009719)=NC_009719,NC_009719.1,gi|154250456|ref|NC_009719.1| -Parvularcula bermudensis HTCC2503 chromosome, complete genome. (NC_014414)=NC_014414,NC_014414.1,gi|304319677|ref|NC_014414.1| -Pasteurella multocida subsp. multocida str. 3480 chromosome, (NC_017764)=NC_017764,NC_017764.1,gi|386833612|ref|NC_017764.1| -Pasteurella multocida 36950 chromosome, complete genome. (NC_016808)=NC_016808,NC_016808.1,gi|378773696|ref|NC_016808.1| -Pasteurella multocida subsp. multocida str. HN06 chromosome, (NC_017027)=NC_017027,NC_017027.1,gi|383309625|ref|NC_017027.1| -Pasteurella multocida subsp. multocida str. HN06 plasmid unnamed, (NC_017035)=NC_017035,NC_017035.1,gi|383311884|ref|NC_017035.1| -Pasteurella multocida subsp. multocida str. Pm70 chromosome, (NC_002663)=NC_002663,NC_002663.1,gi|15601865|ref|NC_002663.1| -Pectobacterium atrosepticum SCRI1043 chromosome, complete genome. (NC_004547)=NC_004547,NC_004547.2,gi|50118965|ref|NC_004547.2| -Pectobacterium carotovorum subsp. carotovorum PC1, complete genome. (NC_012917)=NC_012917,NC_012917.1,gi|253686409|ref|NC_012917.1| -Pectobacterium wasabiae WPP163 chromosome, complete genome. (NC_013421)=NC_013421,NC_013421.1,gi|261819370|ref|NC_013421.1| -Pediococcus claussenii ATCC BAA-344 chromosome, complete genome. (NC_016605)=NC_016605,NC_016605.1,gi|377808793|ref|NC_016605.1| -Pediococcus claussenii ATCC BAA-344 plasmid pPECL-1, complete (NC_016635)=NC_016635,NC_016635.1,gi|381184504|ref|NC_016635.1| -Pediococcus claussenii ATCC BAA-344 plasmid pPECL-2, complete (NC_016606)=NC_016606,NC_016606.1,gi|381184514|ref|NC_016606.1| -Pediococcus claussenii ATCC BAA-344 plasmid pPECL-3, complete (NC_016636)=NC_016636,NC_016636.1,gi|377810572|ref|NC_016636.1| -Pediococcus claussenii ATCC BAA-344 plasmid pPECL-4, complete (NC_016607)=NC_016607,NC_016607.1,gi|381184517|ref|NC_016607.1| -Pediococcus claussenii ATCC BAA-344 plasmid pPECL-5, complete (NC_016608)=NC_016608,NC_016608.1,gi|377808757|ref|NC_016608.1| -Pediococcus claussenii ATCC BAA-344 plasmid pPECL-6, complete (NC_017017)=NC_017017,NC_017017.1,gi|381280264|ref|NC_017017.1| -Pediococcus claussenii ATCC BAA-344 plasmid pPECL-7, complete (NC_017018)=NC_017018,NC_017018.1,gi|381280317|ref|NC_017018.1| -Pediococcus claussenii ATCC BAA-344 plasmid pPECL-8, complete (NC_017019)=NC_017019,NC_017019.1,gi|381280286|ref|NC_017019.1| -Pediococcus pentosaceus ATCC 25745, complete genome. (NC_008525)=NC_008525,NC_008525.1,gi|116491818|ref|NC_008525.1| -Pedobacter heparinus DSM 2366 chromosome, complete genome. (NC_013061)=NC_013061,NC_013061.1,gi|255529916|ref|NC_013061.1| -Pedobacter saltans DSM 12145 chromosome, complete genome. (NC_015177)=NC_015177,NC_015177.1,gi|325102757|ref|NC_015177.1| -Pelagibacterium halotolerans B2 chromosome, complete genome. (NC_016078)=NC_016078,NC_016078.1,gi|357383074|ref|NC_016078.1| -Pelagibacterium halotolerans B2 plasmid pPHB2, complete sequence. (NC_016079)=NC_016079,NC_016079.1,gi|357383070|ref|NC_016079.1| -Pelobacter carbinolicus DSM 2380 chromosome, complete genome. (NC_007498)=NC_007498,NC_007498.2,gi|90960985|ref|NC_007498.2| -Pelobacter propionicus DSM 2379 chromosome, complete genome. (NC_008609)=NC_008609,NC_008609.1,gi|118578449|ref|NC_008609.1| -Pelobacter propionicus DSM 2379 plasmid pPRO1, complete sequence. (NC_008607)=NC_008607,NC_008607.1,gi|118577231|ref|NC_008607.1| -Pelobacter propionicus DSM 2379 plasmid pPRO2, complete sequence. (NC_008608)=NC_008608,NC_008608.1,gi|118577427|ref|NC_008608.1| -Pelodictyon phaeoclathratiforme BU-1 chromosome, complete genome. (NC_011060)=NC_011060,NC_011060.1,gi|194335182|ref|NC_011060.1| -Pelotomaculum thermopropionicum SI chromosome, complete genome. (NC_009454)=NC_009454,NC_009454.1,gi|147676335|ref|NC_009454.1| -Persephonella marina EX-H1 chromosome, complete genome. (NC_012440)=NC_012440,NC_012440.1,gi|225849564|ref|NC_012440.1| -Persephonella marina EX-H1 plasmid unnamed, complete sequence. (NC_012439)=NC_012439,NC_012439.1,gi|225685337|ref|NC_012439.1| -Petrotoga mobilis SJ95 chromosome, complete genome. (NC_010003)=NC_010003,NC_010003.1,gi|160901491|ref|NC_010003.1| -Phenylobacterium zucineum HLK1 chromosome, complete genome. (NC_011144)=NC_011144,NC_011144.1,gi|197103466|ref|NC_011144.1| -Phenylobacterium zucineum HLK1 plasmid unnamed, complete sequence. (NC_011143)=NC_011143,NC_011143.1,gi|197103140|ref|NC_011143.1| -Photobacterium profundum SS9 chromosome 1, complete genome. (NC_006370)=NC_006370,NC_006370.1,gi|54307237|ref|NC_006370.1| -Photobacterium profundum SS9 chromosome 2, complete sequence. (NC_006371)=NC_006371,NC_006371.1,gi|54301680|ref|NC_006371.1| -Photobacterium profundum SS9 plasmid pPBPR1, complete sequence. (NC_005871)=NC_005871,NC_005871.1,gi|47104025|ref|NC_005871.1| -Photorhabdus asymbiotica plasmid pPAU1, complete sequence. (NC_012961)=NC_012961,NC_012961.1,gi|253825511|ref|NC_012961.1| -Photorhabdus asymbiotica subsp. asymbiotica ATCC 43949 chromosome, (NC_012962)=NC_012962,NC_012962.1,gi|253987483|ref|NC_012962.1| -Photorhabdus luminescens subsp. laumondii TTO1, complete genome. (NC_005126)=NC_005126,NC_005126.1,gi|37524032|ref|NC_005126.1| -Phycisphaera mikurensis NBRC 102666 plasmid pPSMK1, complete (NC_017081)=NC_017081,NC_017081.1,gi|383087767|ref|NC_017081.1| -Phycisphaera mikurensis NBRC 102666, complete genome. (NC_017080)=NC_017080,NC_017080.1,gi|383765075|ref|NC_017080.1| -Picrophilus torridus DSM 9790 chromosome, complete genome. (NC_005877)=NC_005877,NC_005877.1,gi|48477072|ref|NC_005877.1| -Pirellula staleyi DSM 6068 chromosome, complete genome. (NC_013720)=NC_013720,NC_013720.1,gi|283777802|ref|NC_013720.1| -Planctomyces brasiliensis DSM 5305 chromosome, complete genome. (NC_015174)=NC_015174,NC_015174.1,gi|325106586|ref|NC_015174.1| -Planctomyces limnophilus DSM 3776 chromosome, complete genome. (NC_014148)=NC_014148,NC_014148.1,gi|296120274|ref|NC_014148.1| -Planctomyces limnophilus DSM 3776 plasmid pPLIM01, complete (NC_014149)=NC_014149,NC_014149.1,gi|296051576|ref|NC_014149.1| -Polaromonas sp. JS666 chromosome, complete genome. (NC_007948)=NC_007948,NC_007948.1,gi|91785913|ref|NC_007948.1| -Polaromonas sp. JS666 plasmid 1, complete sequence. (NC_007949)=NC_007949,NC_007949.1,gi|91790731|ref|NC_007949.1| -Polaromonas sp. JS666 plasmid 2, complete sequence. (NC_007950)=NC_007950,NC_007950.1,gi|91791058|ref|NC_007950.1| -Polaromonas naphthalenivorans CJ2 chromosome, complete genome. (NC_008781)=NC_008781,NC_008781.1,gi|121602919|ref|NC_008781.1| -Polaromonas naphthalenivorans CJ2 plasmid pPNAP01, complete (NC_008757)=NC_008757,NC_008757.1,gi|121582711|ref|NC_008757.1| -Polaromonas naphthalenivorans CJ2 plasmid pPNAP02, complete (NC_008758)=NC_008758,NC_008758.1,gi|121583017|ref|NC_008758.1| -Polaromonas naphthalenivorans CJ2 plasmid pPNAP03, complete (NC_008759)=NC_008759,NC_008759.1,gi|121583183|ref|NC_008759.1| -Polaromonas naphthalenivorans CJ2 plasmid pPNAP04, complete (NC_008760)=NC_008760,NC_008760.1,gi|121583343|ref|NC_008760.1| -Polaromonas naphthalenivorans CJ2 plasmid pPNAP05, complete (NC_008761)=NC_008761,NC_008761.1,gi|121583484|ref|NC_008761.1| -Polaromonas naphthalenivorans CJ2 plasmid pPNAP06, complete (NC_008762)=NC_008762,NC_008762.1,gi|121583543|ref|NC_008762.1| -Polaromonas naphthalenivorans CJ2 plasmid pPNAP07, complete (NC_008763)=NC_008763,NC_008763.1,gi|121583564|ref|NC_008763.1| -Polaromonas naphthalenivorans CJ2 plasmid pPNAP08, complete (NC_008764)=NC_008764,NC_008764.1,gi|121583582|ref|NC_008764.1| -Polymorphum gilvum SL003B-26A1 chromosome, complete genome. (NC_015259)=NC_015259,NC_015259.1,gi|328541624|ref|NC_015259.1| -Polymorphum gilvum SL003B-26A1 plasmid pSL003B, complete sequence. (NC_015258)=NC_015258,NC_015258.1,gi|328541554|ref|NC_015258.1| -Polynucleobacter necessarius subsp. necessarius STIR1 chromosome, (NC_010531)=NC_010531,NC_010531.1,gi|171462832|ref|NC_010531.1| -Polynucleobacter necessarius subsp. asymbioticus QLW-P1DMWA-1 (NC_009379)=NC_009379,NC_009379.1,gi|145588189|ref|NC_009379.1| -Porphyromonas asaccharolytica DSM 20707 chromosome, complete (NC_015501)=NC_015501,NC_015501.1,gi|332299201|ref|NC_015501.1| -Porphyromonas gingivalis ATCC 33277, complete genome. (NC_010729)=NC_010729,NC_010729.1,gi|188993864|ref|NC_010729.1| -Porphyromonas gingivalis TDC60, complete genome. (NC_015571)=NC_015571,NC_015571.1,gi|334145811|ref|NC_015571.1| -Porphyromonas gingivalis W83 chromosome, complete genome. (NC_002950)=NC_002950,NC_002950.2,gi|34539880|ref|NC_002950.2| -Prevotella denticola F0289 chromosome, complete genome. (NC_015311)=NC_015311,NC_015311.1,gi|327312315|ref|NC_015311.1| -Prevotella intermedia 17 chromosome chromosome I, complete (NC_017860)=NC_017860,NC_017860.1,gi|387131618|ref|NC_017860.1| -Prevotella intermedia 17 chromosome chromosome II, complete (NC_017861)=NC_017861,NC_017861.1,gi|387132089|ref|NC_017861.1| -Prevotella melaninogenica ATCC 25845 chromosome I, complete (NC_014370)=NC_014370,NC_014370.1,gi|302344773|ref|NC_014370.1| -Prevotella melaninogenica ATCC 25845 chromosome II, complete (NC_014371)=NC_014371,NC_014371.1,gi|302346166|ref|NC_014371.1| -Prevotella ruminicola 23 chromosome, complete genome. (NC_014033)=NC_014033,NC_014033.1,gi|294672793|ref|NC_014033.1| -Prochlorococcus marinus str. AS9601, complete genome. (NC_008816)=NC_008816,NC_008816.1,gi|123967536|ref|NC_008816.1| -Prochlorococcus marinus subsp. marinus str. CCMP1375 chromosome, (NC_005042)=NC_005042,NC_005042.1,gi|33239452|ref|NC_005042.1| -Prochlorococcus marinus str. MIT 9211, complete genome. (NC_009976)=NC_009976,NC_009976.1,gi|159902540|ref|NC_009976.1| -Prochlorococcus marinus str. MIT 9215 chromosome, complete genome. (NC_009840)=NC_009840,NC_009840.1,gi|157412338|ref|NC_009840.1| -Prochlorococcus marinus str. MIT 9301, complete genome. (NC_009091)=NC_009091,NC_009091.1,gi|126695337|ref|NC_009091.1| -Prochlorococcus marinus str. MIT 9303 chromosome, complete genome. (NC_008820)=NC_008820,NC_008820.1,gi|124021714|ref|NC_008820.1| -Prochlorococcus marinus str. MIT 9312, complete genome. (NC_007577)=NC_007577,NC_007577.1,gi|78778385|ref|NC_007577.1| -Prochlorococcus marinus str. MIT 9313 chromosome, complete genome. (NC_005071)=NC_005071,NC_005071.1,gi|33862273|ref|NC_005071.1| -Prochlorococcus marinus str. MIT 9515, complete genome. (NC_008817)=NC_008817,NC_008817.1,gi|123965234|ref|NC_008817.1| -Prochlorococcus marinus str. NATL1A, complete genome. (NC_008819)=NC_008819,NC_008819.1,gi|124024712|ref|NC_008819.1| -Prochlorococcus marinus str. NATL2A chromosome, complete genome. (NC_007335)=NC_007335,NC_007335.2,gi|162958048|ref|NC_007335.2| -Prochlorococcus marinus subsp. pastoris str. CCMP1986 chromosome, (NC_005072)=NC_005072,NC_005072.1,gi|33860560|ref|NC_005072.1| -Propionibacterium acnes 266 chromosome, complete genome. (NC_017534)=NC_017534,NC_017534.1,gi|386022942|ref|NC_017534.1| -Propionibacterium acnes 6609 chromosome, complete genome. (NC_017535)=NC_017535,NC_017535.1,gi|387502364|ref|NC_017535.1| -Propionibacterium acnes ATCC 11828 chromosome, complete genome. (NC_017550)=NC_017550,NC_017550.1,gi|386069650|ref|NC_017550.1| -Propionibacterium acnes KPA171202, complete genome. (NC_006085)=NC_006085,NC_006085.1,gi|50841496|ref|NC_006085.1| -Propionibacterium acnes SK137 chromosome, complete genome. (NC_014039)=NC_014039,NC_014039.1,gi|295129529|ref|NC_014039.1| -Propionibacterium acnes TypeIA2 P.acn17 chromosome, complete (NC_016512)=NC_016512,NC_016512.1,gi|365963975|ref|NC_016512.1| -Propionibacterium acnes TypeIA2 P.acn31 chromosome, complete (NC_016511)=NC_016511,NC_016511.1,gi|365961730|ref|NC_016511.1| -Propionibacterium acnes TypeIA2 P.acn33 chromosome, complete (NC_016516)=NC_016516,NC_016516.1,gi|365972921|ref|NC_016516.1| -Propionibacterium freudenreichii subsp. shermanii CIRM-BIA1 (NC_014215)=NC_014215,NC_014215.1,gi|297625198|ref|NC_014215.1| -Propionibacterium propionicum F0230a chromosome, complete genome. (NC_018142)=NC_018142,NC_018142.1,gi|397668839|ref|NC_018142.1| -Prosthecochloris aestuarii DSM 271 chromosome, complete genome. (NC_011059)=NC_011059,NC_011059.1,gi|194332853|ref|NC_011059.1| -Prosthecochloris aestuarii DSM 271 plasmid pPAES01, complete (NC_011061)=NC_011061,NC_011061.1,gi|194335117|ref|NC_011061.1| -Proteus mirabilis HI4320 chromosome, complete genome. (NC_010554)=NC_010554,NC_010554.1,gi|197283915|ref|NC_010554.1| -Proteus mirabilis plasmid pHI4320, complete sequence. (NC_010555)=NC_010555,NC_010555.1,gi|172055989|ref|NC_010555.1| -Providencia stuartii MRSN 2154 chromosome, complete genome. (NC_017731)=NC_017731,NC_017731.1,gi|386741417|ref|NC_017731.1| -Pseudoalteromonas sp. SM9913 chromosome I, complete sequence. (NC_014803)=NC_014803,NC_014803.1,gi|315125111|ref|NC_014803.1| -Pseudoalteromonas sp. SM9913 chromosome II, complete sequence. (NC_014800)=NC_014800,NC_014800.1,gi|315122943|ref|NC_014800.1| -Pseudoalteromonas atlantica T6c chromosome, complete genome. (NC_008228)=NC_008228,NC_008228.1,gi|109896332|ref|NC_008228.1| -Pseudoalteromonas haloplanktis TAC125 chromosome I, complete (NC_007481)=NC_007481,NC_007481.1,gi|77358982|ref|NC_007481.1| -Pseudoalteromonas haloplanktis TAC125 chromosome II, complete (NC_007482)=NC_007482,NC_007482.1,gi|77361923|ref|NC_007482.1| -Pseudogulbenkiania sp. NH8B, complete genome. (NC_016002)=NC_016002,NC_016002.1,gi|347537839|ref|NC_016002.1| -Pseudomonas putida ND6 chromosome, complete genome. (NC_017986)=NC_017986,NC_017986.1,gi|395443650|ref|NC_017986.1| -Pseudomonas aeruginosa DK2 chromosome, complete genome. (NC_018080)=NC_018080,NC_018080.1,gi|392981410|ref|NC_018080.1| -Pseudomonas aeruginosa LESB58 chromosome, complete genome. (NC_011770)=NC_011770,NC_011770.1,gi|218888746|ref|NC_011770.1| -Pseudomonas aeruginosa M18 chromosome, complete genome. (NC_017548)=NC_017548,NC_017548.1,gi|386056071|ref|NC_017548.1| -Pseudomonas aeruginosa NCGM2.S1 chromosome 1, complete genome. (NC_017549)=NC_017549,NC_017549.1,gi|386062973|ref|NC_017549.1| -Pseudomonas aeruginosa PA7 chromosome, complete genome. (NC_009656)=NC_009656,NC_009656.1,gi|152983466|ref|NC_009656.1| -Pseudomonas aeruginosa PAO1 chromosome, complete genome. (NC_002516)=NC_002516,NC_002516.2,gi|110645304|ref|NC_002516.2| -Pseudomonas aeruginosa UCBPP-PA14 chromosome, complete genome. (NC_008463)=NC_008463,NC_008463.1,gi|116048575|ref|NC_008463.1| -Pseudomonas brassicacearum subsp. brassicacearum NFM421 chromosome, (NC_015379)=NC_015379,NC_015379.1,gi|330806657|ref|NC_015379.1| -Pseudomonas entomophila L48 chromosome, complete genome. (NC_008027)=NC_008027,NC_008027.1,gi|104779316|ref|NC_008027.1| -Pseudomonas fluorescens A506 chromosome, complete genome. (NC_017911)=NC_017911,NC_017911.1,gi|387891255|ref|NC_017911.1| -Pseudomonas fluorescens F113 chromosome, complete genome. (NC_016830)=NC_016830,NC_016830.1,gi|378947941|ref|NC_016830.1| -Pseudomonas fluorescens Pf0-1 chromosome, complete genome. (NC_007492)=NC_007492,NC_007492.2,gi|255961261|ref|NC_007492.2| -Pseudomonas fluorescens Pf-5 chromosome, complete genome. (NC_004129)=NC_004129,NC_004129.6,gi|70728250|ref|NC_004129.6| -Pseudomonas fluorescens SBW25 chromosome, complete genome. (NC_012660)=NC_012660,NC_012660.1,gi|229587578|ref|NC_012660.1| -Pseudomonas fulva 12-X chromosome, complete genome. (NC_015556)=NC_015556,NC_015556.1,gi|333898208|ref|NC_015556.1| -Pseudomonas mendocina NK-01 chromosome, complete genome. (NC_015410)=NC_015410,NC_015410.1,gi|330500914|ref|NC_015410.1| -Pseudomonas mendocina ymp chromosome, complete genome. (NC_009439)=NC_009439,NC_009439.1,gi|146305042|ref|NC_009439.1| -Pseudomonas putida BIRD-1 chromosome, complete genome. (NC_017530)=NC_017530,NC_017530.1,gi|386009639|ref|NC_017530.1| -Pseudomonas putida DOT-T1E chromosome, complete genome. (NC_018220)=NC_018220,NC_018220.1,gi|397692770|ref|NC_018220.1| -Pseudomonas putida F1 chromosome, complete genome. (NC_009512)=NC_009512,NC_009512.1,gi|148545259|ref|NC_009512.1| -Pseudomonas putida GB-1 chromosome, complete genome. (NC_010322)=NC_010322,NC_010322.1,gi|167031021|ref|NC_010322.1| -Pseudomonas putida KT2440 chromosome, complete genome. (NC_002947)=NC_002947,NC_002947.3,gi|26986745|ref|NC_002947.3| -Pseudomonas putida S16 chromosome, complete genome. (NC_015733)=NC_015733,NC_015733.1,gi|339484941|ref|NC_015733.1| -Pseudomonas putida W619 chromosome, complete genome. (NC_010501)=NC_010501,NC_010501.1,gi|170719187|ref|NC_010501.1| -Pseudomonas stutzeri A1501 chromosome, complete genome. (NC_009434)=NC_009434,NC_009434.1,gi|146280397|ref|NC_009434.1| -Pseudomonas stutzeri ATCC 17588 = LMG 11199 chromosome, complete (NC_015740)=NC_015740,NC_015740.1,gi|339492077|ref|NC_015740.1| -Pseudomonas stutzeri CCUG 29243 chromosome, complete genome. (NC_018028)=NC_018028,NC_018028.1,gi|392419087|ref|NC_018028.1| -Pseudomonas stutzeri DSM 10701 chromosome, complete genome. (NC_018177)=NC_018177,NC_018177.1,gi|397685123|ref|NC_018177.1| -Pseudomonas stutzeri DSM 4166 chromosome, complete genome. (NC_017532)=NC_017532,NC_017532.1,gi|386018640|ref|NC_017532.1| -Pseudomonas syringae pv. syringae B728a chromosome, complete (NC_007005)=NC_007005,NC_007005.1,gi|66043271|ref|NC_007005.1| -Pseudomonas syringae pv. phaseolicola 1448A chromosome, complete (NC_005773)=NC_005773,NC_005773.3,gi|71733195|ref|NC_005773.3| -Pseudomonas syringae pv. phaseolicola 1448A large plasmid, complete (NC_007274)=NC_007274,NC_007274.1,gi|71725141|ref|NC_007274.1| -Pseudomonas syringae pv. phaseolicola 1448A small plasmid, complete (NC_007275)=NC_007275,NC_007275.1,gi|71725269|ref|NC_007275.1| -Pseudomonas syringae pv. tomato str. DC3000 chromosome, complete (NC_004578)=NC_004578,NC_004578.1,gi|28867243|ref|NC_004578.1| -Pseudomonas syringae pv. tomato str. DC3000 plasmid pDC3000A, (NC_004633)=NC_004633,NC_004633.1,gi|29171478|ref|NC_004633.1| -Pseudomonas syringae pv. tomato str. DC3000 plasmid pDC3000B, (NC_004632)=NC_004632,NC_004632.1,gi|29171546|ref|NC_004632.1| -Pseudonocardia dioxanivorans CB1190 chromosome, complete genome. (NC_015312)=NC_015312,NC_015312.1,gi|331693899|ref|NC_015312.1| -Pseudonocardia dioxanivorans CB1190 plasmid pPSED01, complete (NC_015314)=NC_015314,NC_015314.1,gi|327309749|ref|NC_015314.1| -Pseudonocardia dioxanivorans CB1190 plasmid pPSED02, complete (NC_016600)=NC_016600,NC_016600.1,gi|375129061|ref|NC_016600.1| -Pseudonocardia dioxanivorans CB1190 plasmid pPSED02, complete (NC_016601)=NC_016601,NC_016601.1,gi|375129105|ref|NC_016601.1| -Pseudonocardia dioxanivorans CB1190 plasmid pPSED02, complete (NC_017772)=NC_017772,NC_017772.1,gi|386644976|ref|NC_017772.1| -Pseudonocardia dioxanivorans CB1190 plasmid pPSED03, complete (NC_015313)=NC_015313,NC_015313.1,gi|327309734|ref|NC_015313.1| -Pseudovibrio sp. FO-BEG1 chromosome, complete genome. (NC_016642)=NC_016642,NC_016642.1,gi|374328350|ref|NC_016642.1| -Pseudovibrio sp. FO-BEG1 plasmid unnamed, complete sequence. (NC_016646)=NC_016646,NC_016646.1,gi|374333421|ref|NC_016646.1| -Pseudoxanthomonas spadix BD-a59 chromosome, complete genome. (NC_016147)=NC_016147,NC_016147.2,gi|371486894|ref|NC_016147.2| -Pseudoxanthomonas suwonensis 11-1 chromosome, complete genome. (NC_014924)=NC_014924,NC_014924.1,gi|319785620|ref|NC_014924.1| -Psychrobacter sp. PRwf-1 chromosome, complete genome. (NC_009524)=NC_009524,NC_009524.1,gi|148651817|ref|NC_009524.1| -Psychrobacter sp. PRwf-1 plasmid pRWF101, complete sequence. (NC_009516)=NC_009516,NC_009516.1,gi|148641524|ref|NC_009516.1| -Psychrobacter sp. PRwf-1 plasmid pRWF102, complete sequence. (NC_009517)=NC_009517,NC_009517.1,gi|148641539|ref|NC_009517.1| -Psychrobacter arcticus 273-4 chromosome, complete genome. (NC_007204)=NC_007204,NC_007204.1,gi|71064581|ref|NC_007204.1| -Psychrobacter cryohalolentis K5 chromosome, complete genome. (NC_007969)=NC_007969,NC_007969.1,gi|93004831|ref|NC_007969.1| -Psychrobacter cryohalolentis K5 plasmid 1, complete sequence. (NC_007968)=NC_007968,NC_007968.1,gi|93004786|ref|NC_007968.1| -Psychromonas ingrahamii 37 chromosome, complete genome. (NC_008709)=NC_008709,NC_008709.1,gi|119943794|ref|NC_008709.1| -Pusillimonas sp. T7-7 chromosome, complete genome. (NC_015458)=NC_015458,NC_015458.1,gi|332283253|ref|NC_015458.1| -Pusillimonas sp. T7-7 plasmid unnamed, complete sequence. (NC_015459)=NC_015459,NC_015459.1,gi|332283175|ref|NC_015459.1| -Pyrobaculum sp. 1860 chromosome, complete genome. (NC_016645)=NC_016645,NC_016645.1,gi|374325525|ref|NC_016645.1| -Pyrobaculum aerophilum str. IM2 chromosome, complete genome. (NC_003364)=NC_003364,NC_003364.1,gi|18311643|ref|NC_003364.1| -Pyrobaculum arsenaticum DSM 13514 chromosome, complete genome. (NC_009376)=NC_009376,NC_009376.1,gi|145590267|ref|NC_009376.1| -Pyrobaculum calidifontis JCM 11548 chromosome, complete genome. (NC_009073)=NC_009073,NC_009073.1,gi|126458628|ref|NC_009073.1| -Pyrobaculum islandicum DSM 4184 chromosome, complete genome. (NC_008701)=NC_008701,NC_008701.1,gi|119871520|ref|NC_008701.1| -Pyrobaculum oguniense TE7 chromosome, complete genome. (NC_016885)=NC_016885,NC_016885.1,gi|379002962|ref|NC_016885.1| -Pyrobaculum oguniense TE7 extrachromosomal element, complete (NC_016886)=NC_016886,NC_016886.1,gi|379005763|ref|NC_016886.1| -Pyrococcus sp. NA2 chromosome, complete genome. (NC_015474)=NC_015474,NC_015474.1,gi|332157643|ref|NC_015474.1| -Pyrococcus sp. ST04 chromosome, complete genome. (NC_017946)=NC_017946,NC_017946.1,gi|389851449|ref|NC_017946.1| -Pyrococcus abyssi GE5 chromosome, complete genome. (NC_000868)=NC_000868,NC_000868.1,gi|14518450|ref|NC_000868.1| -Pyrococcus abyssi GE5 plasmid pGT5, complete sequence. (NC_001773)=NC_001773,NC_001773.1,gi|10954552|ref|NC_001773.1| -Pyrococcus furiosus COM1 chromosome, complete genome. (NC_018092)=NC_018092,NC_018092.1,gi|397650687|ref|NC_018092.1| -Pyrococcus furiosus DSM 3638 chromosome, complete genome. (NC_003413)=NC_003413,NC_003413.1,gi|18976372|ref|NC_003413.1| -Pyrococcus horikoshii OT3 chromosome, complete genome. (NC_000961)=NC_000961,NC_000961.1,gi|14589963|ref|NC_000961.1| -Pyrococcus yayanosii CH1 chromosome, complete genome. (NC_015680)=NC_015680,NC_015680.1,gi|337283511|ref|NC_015680.1| -Pyrolobus fumarii 1A chromosome, complete genome. (NC_015931)=NC_015931,NC_015931.1,gi|347522554|ref|NC_015931.1| -Rahnella sp. Y9602 chromosome, complete genome. (NC_015061)=NC_015061,NC_015061.1,gi|322830733|ref|NC_015061.1| -Rahnella sp. Y9602 plasmid pRAHAQ01, complete sequence. (NC_015062)=NC_015062,NC_015062.1,gi|322835126|ref|NC_015062.1| -Rahnella sp. Y9602 plasmid pRAHAQ02, complete sequence. (NC_015063)=NC_015063,NC_015063.1,gi|322836370|ref|NC_015063.1| -Rahnella aquatilis CIP 78.65 = ATCC 33071 chromosome, complete (NC_016818)=NC_016818,NC_016818.1,gi|383187966|ref|NC_016818.1| -Rahnella aquatilis CIP 78.65 = ATCC 33071 plasmid pRahaq201, (NC_016835)=NC_016835,NC_016835.1,gi|379703932|ref|NC_016835.1| -Rahnella aquatilis CIP 78.65 = ATCC 33071 plasmid pRahaq202, (NC_016819)=NC_016819,NC_016819.1,gi|383192311|ref|NC_016819.1| -Rahnella aquatilis CIP 78.65 = ATCC 33071 plasmid pRahaq203, (NC_017092)=NC_017092,NC_017092.1,gi|383192418|ref|NC_017092.1| -Rahnella aquatilis HX2 chromosome, complete genome. (NC_017047)=NC_017047,NC_017047.1,gi|384255905|ref|NC_017047.1| -Rahnella aquatilis HX2 plasmid PRA1, complete sequence. (NC_017060)=NC_017060,NC_017060.1,gi|384527587|ref|NC_017060.1| -Rahnella aquatilis HX2 plasmid PRA2, complete sequence. (NC_017773)=NC_017773,NC_017773.1,gi|386844997|ref|NC_017773.1| -Rahnella aquatilis HX2 plasmid PRA2, complete sequence. (NC_017807)=NC_017807,NC_017807.1,gi|386844947|ref|NC_017807.1| -Ralstonia eutropha H16 chromosome 1, complete genome. (NC_008313)=NC_008313,NC_008313.1,gi|113866031|ref|NC_008313.1| -Ralstonia eutropha H16 chromosome 2, complete sequence. (NC_008314)=NC_008314,NC_008314.1,gi|116693960|ref|NC_008314.1| -Ralstonia eutropha H16 megaplasmid pHG1, complete sequence. (NC_005241)=NC_005241,NC_005241.1,gi|38637668|ref|NC_005241.1| -Ralstonia eutropha JMP134 chromosome 1, complete sequence. (NC_007347)=NC_007347,NC_007347.1,gi|73539706|ref|NC_007347.1| -Ralstonia eutropha JMP134 chromosome 2, complete sequence. (NC_007348)=NC_007348,NC_007348.1,gi|73537298|ref|NC_007348.1| -Ralstonia eutropha JMP134 megaplasmid, complete sequence. (NC_007336)=NC_007336,NC_007336.1,gi|72383731|ref|NC_007336.1| -Ralstonia eutropha JMP134 plasmid 1, complete sequence. (NC_007337)=NC_007337,NC_007337.1,gi|72384244|ref|NC_007337.1| -Ralstonia pickettii 12D chromosome 1, complete sequence. (NC_012856)=NC_012856,NC_012856.1,gi|241661625|ref|NC_012856.1| -Ralstonia pickettii 12D chromosome 2, complete sequence. (NC_012857)=NC_012857,NC_012857.1,gi|241665037|ref|NC_012857.1| -Ralstonia pickettii 12D plasmid pRp12D01, complete sequence. (NC_012855)=NC_012855,NC_012855.1,gi|241589533|ref|NC_012855.1| -Ralstonia pickettii 12D plasmid pRp12D02, complete sequence. (NC_012849)=NC_012849,NC_012849.1,gi|241114100|ref|NC_012849.1| -Ralstonia pickettii 12D plasmid pRp12D03, complete sequence. (NC_012851)=NC_012851,NC_012851.1,gi|241258150|ref|NC_012851.1| -Ralstonia pickettii 12J chromosome 1, complete sequence. (NC_010682)=NC_010682,NC_010682.1,gi|187927112|ref|NC_010682.1| -Ralstonia pickettii 12J chromosome 2, complete sequence. (NC_010678)=NC_010678,NC_010678.1,gi|187925958|ref|NC_010678.1| -Ralstonia pickettii 12J plasmid pRPIC01, complete sequence. (NC_010683)=NC_010683,NC_010683.1,gi|187930822|ref|NC_010683.1| -Ralstonia solanacearum CFBP2957 chromosome, complete genome. (NC_014307)=NC_014307,NC_014307.1,gi|300702374|ref|NC_014307.1| -Ralstonia solanacearum GMI1000 chromosome, complete genome. (NC_003295)=NC_003295,NC_003295.1,gi|17544719|ref|NC_003295.1| -Ralstonia solanacearum GMI1000 plasmid pGMI1000MP, complete (NC_003296)=NC_003296,NC_003296.1,gi|17548221|ref|NC_003296.1| -Ralstonia solanacearum PSI07 chromosome, complete genome. (NC_014311)=NC_014311,NC_014311.1,gi|300689714|ref|NC_014311.1| -Ralstonia solanacearum PSI07 megaplasmid, complete sequence. (NC_014310)=NC_014310,NC_014310.1,gi|300693042|ref|NC_014310.1| -Ralstonia solanacearum Po82 chromosome, complete genome. (NC_017574)=NC_017574,NC_017574.1,gi|386331671|ref|NC_017574.1| -Ralstonia solanacearum Po82 megaplasmid, complete sequence. (NC_017575)=NC_017575,NC_017575.1,gi|386335008|ref|NC_017575.1| -Ramlibacter tataouinensis TTB310 chromosome, complete genome. (NC_015677)=NC_015677,NC_015677.1,gi|337277607|ref|NC_015677.1| -Renibacterium salmoninarum ATCC 33209 chromosome, complete genome. (NC_010168)=NC_010168,NC_010168.1,gi|163838769|ref|NC_010168.1| -Sinorhizobium fredii NGR234 chromosome, complete genome. (NC_012587)=NC_012587,NC_012587.1,gi|227820587|ref|NC_012587.1| -Sinorhizobium fredii NGR234 plasmid pNGR234a, complete sequence. (NC_000914)=NC_000914,NC_000914.2,gi|255767010|ref|NC_000914.2| -Sinorhizobium fredii NGR234 plasmid pNGR234b, complete sequence. (NC_012586)=NC_012586,NC_012586.1,gi|227818258|ref|NC_012586.1| -Rhizobium etli CFN 42 plasmid p42a, complete sequence. (NC_007762)=NC_007762,NC_007762.1,gi|86359705|ref|NC_007762.1| -Rhizobium etli CFN 42 plasmid p42b, complete sequence. (NC_007763)=NC_007763,NC_007763.1,gi|86359881|ref|NC_007763.1| -Rhizobium etli CFN 42 plasmid p42c, complete sequence. (NC_007764)=NC_007764,NC_007764.1,gi|86360045|ref|NC_007764.1| -Rhizobium etli CFN 42 plasmid p42e, complete sequence. (NC_007765)=NC_007765,NC_007765.1,gi|86360278|ref|NC_007765.1| -Rhizobium etli CFN 42 plasmid p42f, complete sequence. (NC_007766)=NC_007766,NC_007766.1,gi|86360734|ref|NC_007766.1| -Rhizobium etli CFN 42 symbiotic plasmid p42d, complete sequence. (NC_004041)=NC_004041,NC_004041.2,gi|89255298|ref|NC_004041.2| -Rhizobium etli CFN 42, complete genome. (NC_007761)=NC_007761,NC_007761.1,gi|86355669|ref|NC_007761.1| -Rhizobium etli CIAT 652 chromosome, complete genome. (NC_010994)=NC_010994,NC_010994.1,gi|190889639|ref|NC_010994.1| -Rhizobium etli CIAT 652 plasmid pA, complete sequence. (NC_010998)=NC_010998,NC_010998.1,gi|190895317|ref|NC_010998.1| -Rhizobium etli CIAT 652 plasmid pB, complete sequence. (NC_010996)=NC_010996,NC_010996.1,gi|190893983|ref|NC_010996.1| -Rhizobium etli CIAT 652 plasmid pC, complete sequence. (NC_010997)=NC_010997,NC_010997.1,gi|190894340|ref|NC_010997.1| -Rhizobium leguminosarum bv. trifolii WSM1325 chromosome, complete (NC_012850)=NC_012850,NC_012850.1,gi|241202755|ref|NC_012850.1| -Rhizobium leguminosarum bv. trifolii WSM1325 plasmid pR132501, (NC_012848)=NC_012848,NC_012848.1,gi|241113003|ref|NC_012848.1| -Rhizobium leguminosarum bv. trifolii WSM1325 plasmid pR132502, (NC_012858)=NC_012858,NC_012858.1,gi|241666492|ref|NC_012858.1| -Rhizobium leguminosarum bv. trifolii WSM1325 plasmid pR132503, (NC_012853)=NC_012853,NC_012853.1,gi|241518161|ref|NC_012853.1| -Rhizobium leguminosarum bv. trifolii WSM1325 plasmid pR132504, (NC_012852)=NC_012852,NC_012852.1,gi|241258599|ref|NC_012852.1| -Rhizobium leguminosarum bv. trifolii WSM1325 plasmid pR132505, (NC_012854)=NC_012854,NC_012854.1,gi|241554070|ref|NC_012854.1| -Rhizobium leguminosarum bv. trifolii WSM2304 chromosome, complete (NC_011369)=NC_011369,NC_011369.1,gi|209547612|ref|NC_011369.1| -Rhizobium leguminosarum bv. trifolii WSM2304 plasmid pRLG201, (NC_011368)=NC_011368,NC_011368.1,gi|209546450|ref|NC_011368.1| -Rhizobium leguminosarum bv. trifolii WSM2304 plasmid pRLG202, (NC_011366)=NC_011366,NC_011366.1,gi|209545999|ref|NC_011366.1| -Rhizobium leguminosarum bv. trifolii WSM2304 plasmid pRLG203, (NC_011370)=NC_011370,NC_011370.1,gi|209551938|ref|NC_011370.1| -Rhizobium leguminosarum bv. trifolii WSM2304 plasmid pRLG204, (NC_011371)=NC_011371,NC_011371.1,gi|209552195|ref|NC_011371.1| -Rhizobium leguminosarum bv. viciae 3841 chromosome, complete (NC_008380)=NC_008380,NC_008380.1,gi|116249766|ref|NC_008380.1| -Rhizobium leguminosarum bv. viciae 3841 plasmid pRL10, complete (NC_008381)=NC_008381,NC_008381.1,gi|116254467|ref|NC_008381.1| -Rhizobium leguminosarum bv. viciae 3841 plasmid pRL11, complete (NC_008384)=NC_008384,NC_008384.1,gi|116255200|ref|NC_008384.1| -Rhizobium leguminosarum bv. viciae 3841 plasmid pRL12, complete (NC_008378)=NC_008378,NC_008378.1,gi|116248676|ref|NC_008378.1| -Rhizobium leguminosarum bv. viciae 3841 plasmid pRL7, complete (NC_008382)=NC_008382,NC_008382.1,gi|116254910|ref|NC_008382.1| -Rhizobium leguminosarum bv. viciae 3841 plasmid pRL8, complete (NC_008383)=NC_008383,NC_008383.1,gi|116255067|ref|NC_008383.1| -Rhizobium leguminosarum bv. viciae 3841 plasmid pRL9, complete (NC_008379)=NC_008379,NC_008379.1,gi|116249460|ref|NC_008379.1| -Rhodobacter capsulatus SB 1003 chromosome, complete genome. (NC_014034)=NC_014034,NC_014034.1,gi|294675557|ref|NC_014034.1| -Rhodobacter capsulatus SB 1003 plasmid pRCB133, complete sequence. (NC_014035)=NC_014035,NC_014035.1,gi|294679055|ref|NC_014035.1| -Rhodobacter sphaeroides 2.4.1 chromosome 1, complete sequence. (NC_007493)=NC_007493,NC_007493.1,gi|77461965|ref|NC_007493.1| -Rhodobacter sphaeroides 2.4.1 chromosome 2, complete sequence. (NC_007494)=NC_007494,NC_007494.1,gi|77464988|ref|NC_007494.1| -Rhodobacter sphaeroides 2.4.1 plasmid A, partial sequence. (NC_009007)=NC_009007,NC_009007.1,gi|125654605|ref|NC_009007.1| -Rhodobacter sphaeroides 2.4.1 plasmid B, complete sequence. (NC_007488)=NC_007488,NC_007488.1,gi|77404592|ref|NC_007488.1| -Rhodobacter sphaeroides 2.4.1 plasmid C, complete sequence. (NC_007489)=NC_007489,NC_007489.1,gi|77404693|ref|NC_007489.1| -Rhodobacter sphaeroides 2.4.1 plasmid D, complete sequence. (NC_007490)=NC_007490,NC_007490.1,gi|77404776|ref|NC_007490.1| -Rhodobacter sphaeroides 2.4.1 plasmid E, complete sequence. (NC_009008)=NC_009008,NC_009008.1,gi|125654693|ref|NC_009008.1| -Rhodobacter sphaeroides ATCC 17025 chromosome, complete genome. (NC_009428)=NC_009428,NC_009428.1,gi|146276058|ref|NC_009428.1| -Rhodobacter sphaeroides ATCC 17025 plasmid pRSPA01, complete (NC_009429)=NC_009429,NC_009429.1,gi|146279170|ref|NC_009429.1| -Rhodobacter sphaeroides ATCC 17025 plasmid pRSPA02, complete (NC_009430)=NC_009430,NC_009430.1,gi|146279973|ref|NC_009430.1| -Rhodobacter sphaeroides ATCC 17025 plasmid pRSPA03, complete (NC_009431)=NC_009431,NC_009431.1,gi|146280242|ref|NC_009431.1| -Rhodobacter sphaeroides ATCC 17025 plasmid pRSPA04, complete (NC_009432)=NC_009432,NC_009432.1,gi|146280352|ref|NC_009432.1| -Rhodobacter sphaeroides ATCC 17025 plasmid pRSPA05, complete (NC_009433)=NC_009433,NC_009433.1,gi|146280384|ref|NC_009433.1| -Rhodobacter sphaeroides ATCC 17029 chromosome 1, complete sequence. (NC_009049)=NC_009049,NC_009049.1,gi|126460778|ref|NC_009049.1| -Rhodobacter sphaeroides ATCC 17029 chromosome 2, complete sequence. (NC_009050)=NC_009050,NC_009050.1,gi|126463752|ref|NC_009050.1| -Rhodobacter sphaeroides ATCC 17029 plasmid pRSPH01, complete (NC_009040)=NC_009040,NC_009040.1,gi|126464805|ref|NC_009040.1| -Rhodobacter sphaeroides KD131 chromosome 1, complete sequence. (NC_011963)=NC_011963,NC_011963.1,gi|221638099|ref|NC_011963.1| -Rhodobacter sphaeroides KD131 chromosome 2, complete sequence. (NC_011958)=NC_011958,NC_011958.1,gi|221368938|ref|NC_011958.1| -Rhodobacter sphaeroides KD131 plasmid pRSKD131A, complete sequence. (NC_011962)=NC_011962,NC_011962.1,gi|221218192|ref|NC_011962.1| -Rhodobacter sphaeroides KD131 plasmid pRSKD131B, complete sequence. (NC_011960)=NC_011960,NC_011960.1,gi|221634492|ref|NC_011960.1| -Rhodococcus equi 103S, complete genome. (NC_014659)=NC_014659,NC_014659.1,gi|312137514|ref|NC_014659.1| -Rhodococcus erythropolis PR4 plasmid pREC1, complete sequence. (NC_007486)=NC_007486,NC_007486.1,gi|77404485|ref|NC_007486.1| -Rhodococcus erythropolis PR4 plasmid pREC2, complete sequence. (NC_007487)=NC_007487,NC_007487.1,gi|77404588|ref|NC_007487.1| -Rhodococcus erythropolis PR4 plasmid pREL1, complete sequence. (NC_007491)=NC_007491,NC_007491.1,gi|77454567|ref|NC_007491.1| -Rhodococcus erythropolis PR4, complete genome. (NC_012490)=NC_012490,NC_012490.1,gi|226303489|ref|NC_012490.1| -Rhodococcus jostii RHA1 chromosome, complete genome. (NC_008268)=NC_008268,NC_008268.1,gi|111017022|ref|NC_008268.1| -Rhodococcus jostii RHA1 plasmid pRHL1, complete sequence. (NC_008269)=NC_008269,NC_008269.1,gi|111024785|ref|NC_008269.1| -Rhodococcus jostii RHA1 plasmid pRHL2, complete sequence. (NC_008270)=NC_008270,NC_008270.1,gi|111026068|ref|NC_008270.1| -Rhodococcus jostii RHA1 plasmid pRHL3, complete sequence. (NC_008271)=NC_008271,NC_008271.1,gi|111026827|ref|NC_008271.1| -Rhodococcus opacus B4 plasmid pKNR, complete sequence. (NC_012523)=NC_012523,NC_012523.1,gi|226334772|ref|NC_012523.1| -Rhodococcus opacus B4 plasmid pKNR01, complete sequence. (NC_006969)=NC_006969,NC_006969.2,gi|226315872|ref|NC_006969.2| -Rhodococcus opacus B4 plasmid pKNR02, complete sequence. (NC_006970)=NC_006970,NC_006970.2,gi|226316799|ref|NC_006970.2| -Rhodococcus opacus B4 plasmid pROB01, complete sequence. (NC_012520)=NC_012520,NC_012520.1,gi|226349237|ref|NC_012520.1| -Rhodococcus opacus B4 plasmid pROB02, complete sequence. (NC_012521)=NC_012521,NC_012521.1,gi|226349831|ref|NC_012521.1| -Rhodococcus opacus B4, complete genome. (NC_012522)=NC_012522,NC_012522.1,gi|226359415|ref|NC_012522.1| -Rhodoferax ferrireducens T118 chromosome, complete genome. (NC_007908)=NC_007908,NC_007908.1,gi|89898822|ref|NC_007908.1| -Rhodoferax ferrireducens T118 plasmid1, complete sequence. (NC_007901)=NC_007901,NC_007901.1,gi|89885732|ref|NC_007901.1| -Rhodomicrobium vannielii ATCC 17100 chromosome, complete genome. (NC_014664)=NC_014664,NC_014664.1,gi|312112794|ref|NC_014664.1| -Rhodopirellula baltica SH 1 chromosome, complete genome. (NC_005027)=NC_005027,NC_005027.1,gi|32470666|ref|NC_005027.1| -Rhodopseudomonas palustris BisA53 chromosome, complete genome. (NC_008435)=NC_008435,NC_008435.1,gi|115522030|ref|NC_008435.1| -Rhodopseudomonas palustris BisB18 chromosome, complete genome. (NC_007925)=NC_007925,NC_007925.1,gi|90421528|ref|NC_007925.1| -Rhodopseudomonas palustris BisB5 chromosome, complete genome. (NC_007958)=NC_007958,NC_007958.1,gi|91974482|ref|NC_007958.1| -Rhodopseudomonas palustris CGA009 chromosome, complete genome. (NC_005296)=NC_005296,NC_005296.1,gi|39933080|ref|NC_005296.1| -Rhodopseudomonas palustris CGA009 plasmid pRPA, complete sequence. (NC_005297)=NC_005297,NC_005297.1,gi|39840937|ref|NC_005297.1| -Rhodopseudomonas palustris DX-1 chromosome, complete genome. (NC_014834)=NC_014834,NC_014834.1,gi|316931396|ref|NC_014834.1| -Rhodopseudomonas palustris HaA2 chromosome, complete genome. (NC_007778)=NC_007778,NC_007778.1,gi|86747127|ref|NC_007778.1| -Rhodopseudomonas palustris TIE-1 chromosome, complete genome. (NC_011004)=NC_011004,NC_011004.1,gi|192288433|ref|NC_011004.1| -Rhodospirillum centenum SW chromosome, complete genome. (NC_011420)=NC_011420,NC_011420.2,gi|289546492|ref|NC_011420.2| -Rhodospirillum photometricum DSM 122, complete genome. (NC_017059)=NC_017059,NC_017059.1,gi|384260349|ref|NC_017059.1| -Rhodospirillum rubrum ATCC 11170 chromosome, complete genome. (NC_007643)=NC_007643,NC_007643.1,gi|83591340|ref|NC_007643.1| -Rhodospirillum rubrum ATCC 11170 plasmid unnamed, complete (NC_007641)=NC_007641,NC_007641.1,gi|83582730|ref|NC_007641.1| -Rhodospirillum rubrum F11 chromosome, complete genome. (NC_017584)=NC_017584,NC_017584.1,gi|386348020|ref|NC_017584.1| -Rhodothermus marinus DSM 4252 chromosome, complete genome. (NC_013501)=NC_013501,NC_013501.1,gi|268315578|ref|NC_013501.1| -Rhodothermus marinus DSM 4252 plasmid pRMAR01, complete sequence. (NC_013502)=NC_013502,NC_013502.1,gi|268318345|ref|NC_013502.1| -Rhodothermus marinus SG0.5JP17-172 chromosome, complete genome. (NC_015966)=NC_015966,NC_015966.1,gi|345301888|ref|NC_015966.1| -Rhodothermus marinus SG0.5JP17-172 plasmid pRHOM17201, complete (NC_015970)=NC_015970,NC_015970.1,gi|345301799|ref|NC_015970.1| -Rhodothermus marinus SG0.5JP17-172 plasmid pRHOM17202, complete (NC_015967)=NC_015967,NC_015967.1,gi|345301886|ref|NC_015967.1| -Rickettsia africae ESF-5 chromosome, complete genome. (NC_012633)=NC_012633,NC_012633.1,gi|229586230|ref|NC_012633.1| -Rickettsia africae ESF-5 plasmid pRAF, complete sequence. (NC_012634)=NC_012634,NC_012634.1,gi|228478451|ref|NC_012634.1| -Rickettsia akari str. Hartford chromosome, complete genome. (NC_009881)=NC_009881,NC_009881.1,gi|157825125|ref|NC_009881.1| -Rickettsia australis str. Cutlack chromosome, complete genome. (NC_017058)=NC_017058,NC_017058.1,gi|383500935|ref|NC_017058.1| -Rickettsia australis str. Cutlack plasmid pMC5_1, complete (NC_017041)=NC_017041,NC_017041.1,gi|383479184|ref|NC_017041.1| -Rickettsia bellii OSU 85-389 chromosome, complete genome. (NC_009883)=NC_009883,NC_009883.1,gi|157826385|ref|NC_009883.1| -Rickettsia bellii RML369-C chromosome, complete genome. (NC_007940)=NC_007940,NC_007940.1,gi|91204815|ref|NC_007940.1| -Rickettsia canadensis str. CA410 chromosome, complete genome. (NC_016929)=NC_016929,NC_016929.1,gi|379022404|ref|NC_016929.1| -Rickettsia canadensis str. McKiel, complete genome. (NC_009879)=NC_009879,NC_009879.1,gi|157803189|ref|NC_009879.1| -Rickettsia conorii str. Malish 7, complete genome. (NC_003103)=NC_003103,NC_003103.1,gi|15891923|ref|NC_003103.1| -Rickettsia felis URRWXCal2 chromosome, complete genome. (NC_007109)=NC_007109,NC_007109.1,gi|67458392|ref|NC_007109.1| -Rickettsia felis URRWXCal2 plasmid pRF, complete sequence. (NC_007110)=NC_007110,NC_007110.1,gi|67459793|ref|NC_007110.1| -Rickettsia felis URRWXCal2 plasmid pRFdelta, complete sequence. (NC_007111)=NC_007111,NC_007111.1,gi|67459862|ref|NC_007111.1| -Rickettsia heilongjiangensis 054 chromosome, complete genome. (NC_015866)=NC_015866,NC_015866.1,gi|341583222|ref|NC_015866.1| -Rickettsia japonica YH, complete genome. (NC_016050)=NC_016050,NC_016050.1,gi|350273053|ref|NC_016050.1| -Rickettsia massiliae str. AZT80 chromosome, complete genome. (NC_016931)=NC_016931,NC_016931.1,gi|379713087|ref|NC_016931.1| -Rickettsia massiliae str. AZT80 plasmid pRMB, complete sequence. (NC_016939)=NC_016939,NC_016939.1,gi|378750097|ref|NC_016939.1| -Rickettsia massiliae MTU5 chromosome, complete genome. (NC_009900)=NC_009900,NC_009900.1,gi|157964072|ref|NC_009900.1| -Rickettsia massiliae MTU5 plasmid pRMA, complete sequence. (NC_009897)=NC_009897,NC_009897.1,gi|157954006|ref|NC_009897.1| -Rickettsia montanensis str. OSU 85-930 chromosome, complete genome. (NC_017043)=NC_017043,NC_017043.1,gi|383482123|ref|NC_017043.1| -Rickettsia parkeri str. Portsmouth chromosome, complete genome. (NC_017044)=NC_017044,NC_017044.1,gi|383483341|ref|NC_017044.1| -Rickettsia peacockii str. Rustic plasmid pRPR, complete sequence. (NC_012732)=NC_012732,NC_012732.1,gi|238651159|ref|NC_012732.1| -Rickettsia peacockii str. Rustic, complete genome. (NC_012730)=NC_012730,NC_012730.1,gi|238650213|ref|NC_012730.1| -Rickettsia philipii str. 364D chromosome, complete genome. (NC_016930)=NC_016930,NC_016930.1,gi|379711742|ref|NC_016930.1| -Rickettsia prowazekii str. BuV67-CWPP chromosome, complete genome. (NC_017056)=NC_017056,NC_017056.1,gi|383499256|ref|NC_017056.1| -Rickettsia prowazekii str. Chernikova chromosome, complete genome. (NC_017049)=NC_017049,NC_017049.1,gi|383487432|ref|NC_017049.1| -Rickettsia prowazekii str. Dachau chromosome, complete genome. (NC_017051)=NC_017051,NC_017051.1,gi|383489123|ref|NC_017051.1| -Rickettsia prowazekii str. GvV257 chromosome, complete genome. (NC_017048)=NC_017048,NC_017048.1,gi|383486602|ref|NC_017048.1| -Rickettsia prowazekii str. Katsinyian chromosome, complete genome. (NC_017050)=NC_017050,NC_017050.1,gi|383488278|ref|NC_017050.1| -Rickettsia prowazekii str. Madrid E chromosome, complete genome. (NC_000963)=NC_000963,NC_000963.1,gi|15603881|ref|NC_000963.1| -Rickettsia prowazekii Rp22 chromosome, complete genome. (NC_017560)=NC_017560,NC_017560.1,gi|386081834|ref|NC_017560.1| -Rickettsia prowazekii str. RpGvF24 chromosome, complete genome. (NC_017057)=NC_017057,NC_017057.1,gi|383500100|ref|NC_017057.1| -Rickettsia rhipicephali str. 3-7-female6-CWPP chromosome, complete (NC_017042)=NC_017042,NC_017042.1,gi|383480870|ref|NC_017042.1| -Rickettsia rhipicephali str. 3-7-female6-CWPP plasmid pMCC_1, (NC_017055)=NC_017055,NC_017055.1,gi|381356294|ref|NC_017055.1| -Rickettsia rickettsii str. Arizona chromosome, complete genome. (NC_016909)=NC_016909,NC_016909.1,gi|378722019|ref|NC_016909.1| -Rickettsia rickettsii str. Brazil chromosome, complete genome. (NC_016913)=NC_016913,NC_016913.1,gi|379015834|ref|NC_016913.1| -Rickettsia rickettsii str. Colombia chromosome, complete genome. (NC_016908)=NC_016908,NC_016908.1,gi|378720668|ref|NC_016908.1| -Rickettsia rickettsii str. Hauke chromosome, complete genome. (NC_016911)=NC_016911,NC_016911.1,gi|378723377|ref|NC_016911.1| -Rickettsia rickettsii str. Hino chromosome, complete genome. (NC_016914)=NC_016914,NC_016914.1,gi|379017167|ref|NC_016914.1| -Rickettsia rickettsii str. Hlp#2 chromosome, complete genome. (NC_016915)=NC_016915,NC_016915.1,gi|379018503|ref|NC_016915.1| -Rickettsia rickettsii str. Iowa chromosome, complete genome. (NC_010263)=NC_010263,NC_010263.2,gi|319717301|ref|NC_010263.2| -Rickettsia rickettsii str. 'Sheila Smith' chromosome, complete (NC_009882)=NC_009882,NC_009882.1,gi|157827862|ref|NC_009882.1| -Rickettsia slovaca 13-B chromosome, complete genome. (NC_016639)=NC_016639,NC_016639.1,gi|374318767|ref|NC_016639.1| -Rickettsia slovaca str. D-CWPP chromosome, complete genome. (NC_017065)=NC_017065,NC_017065.1,gi|383750641|ref|NC_017065.1| -Rickettsia typhi str. B9991CWPP chromosome, complete genome. (NC_017062)=NC_017062,NC_017062.1,gi|383842824|ref|NC_017062.1| -Rickettsia typhi str. TH1527 chromosome, complete genome. (NC_017066)=NC_017066,NC_017066.1,gi|383751989|ref|NC_017066.1| -Rickettsia typhi str. Wilmington, complete genome. (NC_006142)=NC_006142,NC_006142.1,gi|51473215|ref|NC_006142.1| -Riemerella anatipestifer ATCC 11845 = DSM 15868 chromosome, (NC_017045)=NC_017045,NC_017045.1,gi|383484660|ref|NC_017045.1| -Riemerella anatipestifer DSM 15868 chromosome, complete genome. (NC_014738)=NC_014738,NC_014738.1,gi|313205511|ref|NC_014738.1| -Riemerella anatipestifer RA-GD chromosome, complete genome. (NC_017569)=NC_017569,NC_017569.1,gi|386320386|ref|NC_017569.1| -Robiginitalea biformata HTCC2501 chromosome, complete genome. (NC_013222)=NC_013222,NC_013222.1,gi|260060589|ref|NC_013222.1| -Roseburia hominis A2-183 chromosome, complete genome. (NC_015977)=NC_015977,NC_015977.1,gi|347530298|ref|NC_015977.1| -Roseiflexus sp. RS-1 chromosome, complete genome. (NC_009523)=NC_009523,NC_009523.1,gi|148654188|ref|NC_009523.1| -Roseiflexus castenholzii DSM 13941 chromosome, complete genome. (NC_009767)=NC_009767,NC_009767.1,gi|156740028|ref|NC_009767.1| -Roseobacter denitrificans OCh 114 chromosome, complete genome. (NC_008209)=NC_008209,NC_008209.1,gi|110677421|ref|NC_008209.1| -Roseobacter denitrificans plasmid pTB1, complete sequence. (NC_008386)=NC_008386,NC_008386.1,gi|115345530|ref|NC_008386.1| -Roseobacter denitrificans plasmid pTB2, complete sequence. (NC_008387)=NC_008387,NC_008387.1,gi|115345636|ref|NC_008387.1| -Roseobacter denitrificans plasmid pTB3, complete sequence. (NC_008388)=NC_008388,NC_008388.1,gi|115345694|ref|NC_008388.1| -Roseobacter denitrificans plasmid pTB4, complete sequence. (NC_008389)=NC_008389,NC_008389.1,gi|115345712|ref|NC_008389.1| -Roseobacter litoralis Och 149 chromosome, complete genome. (NC_015730)=NC_015730,NC_015730.1,gi|339501577|ref|NC_015730.1| -Roseobacter litoralis Och 149 plasmid pRLO149_63, complete (NC_015729)=NC_015729,NC_015729.1,gi|339501435|ref|NC_015729.1| -Roseobacter litoralis Och 149 plasmid pRLO149_83, complete (NC_015728)=NC_015728,NC_015728.1,gi|339501483|ref|NC_015728.1| -Roseobacter litoralis Och 149 plasmid pRLO149_94, complete (NC_015741)=NC_015741,NC_015741.1,gi|339505889|ref|NC_015741.1| -Rothia dentocariosa ATCC 17931 chromosome, complete genome. (NC_014643)=NC_014643,NC_014643.1,gi|311111670|ref|NC_014643.1| -Rothia mucilaginosa DY-18 chromosome, complete genome. (NC_013715)=NC_013715,NC_013715.1,gi|283457089|ref|NC_013715.1| -Rubrivivax gelatinosus IL144, complete genome. (NC_017075)=NC_017075,NC_017075.1,gi|383755859|ref|NC_017075.1| -Rubrobacter xylanophilus DSM 9941 chromosome, complete genome. (NC_008148)=NC_008148,NC_008148.1,gi|108802856|ref|NC_008148.1| -Ruegeria sp. TM1040 chromosome, complete genome. (NC_008044)=NC_008044,NC_008044.1,gi|99079841|ref|NC_008044.1| -Ruegeria sp. TM1040 mega plasmid, complete sequence. (NC_008043)=NC_008043,NC_008043.1,gi|99078009|ref|NC_008043.1| -Ruegeria sp. TM1040 plasmid unnamed, complete sequence. (NC_008042)=NC_008042,NC_008042.1,gi|99077902|ref|NC_008042.1| -Ruegeria pomeroyi DSS-3 chromosome, complete genome. (NC_003911)=NC_003911,NC_003911.11,gi|56694928|ref|NC_003911.11| -Ruegeria pomeroyi DSS-3 megaplasmid, complete sequence. (NC_006569)=NC_006569,NC_006569.1,gi|56708791|ref|NC_006569.1| -Ruminococcus albus 7 chromosome, complete genome. (NC_014833)=NC_014833,NC_014833.1,gi|317054731|ref|NC_014833.1| -Ruminococcus albus 7 plasmid pRUMAL01, complete sequence. (NC_014824)=NC_014824,NC_014824.1,gi|317133719|ref|NC_014824.1| -Ruminococcus albus 7 plasmid pRUMAL02, complete sequence. (NC_014825)=NC_014825,NC_014825.1,gi|319788691|ref|NC_014825.1| -Ruminococcus albus 7 plasmid pRUMAL03, complete sequence. (NC_014826)=NC_014826,NC_014826.1,gi|315630409|ref|NC_014826.1| -Ruminococcus albus 7 plasmid pRUMAL04, complete sequence. (NC_014827)=NC_014827,NC_014827.1,gi|317133710|ref|NC_014827.1| -Runella slithyformis DSM 19594 chromosome, complete genome. (NC_015703)=NC_015703,NC_015703.1,gi|338209545|ref|NC_015703.1| -Runella slithyformis DSM 19594 plasmid pRUNSL01, complete sequence. (NC_015693)=NC_015693,NC_015693.1,gi|338209372|ref|NC_015693.1| -Runella slithyformis DSM 19594 plasmid pRUNSL02, complete sequence. (NC_015704)=NC_015704,NC_015704.1,gi|338215079|ref|NC_015704.1| -Runella slithyformis DSM 19594 plasmid pRUNSL03, complete sequence. (NC_015694)=NC_015694,NC_015694.1,gi|338209457|ref|NC_015694.1| -Runella slithyformis DSM 19594 plasmid pRUNSL04, complete sequence. (NC_015705)=NC_015705,NC_015705.1,gi|338215037|ref|NC_015705.1| -Runella slithyformis DSM 19594 plasmid pRUNSL05, complete sequence. (NC_015695)=NC_015695,NC_015695.1,gi|338215004|ref|NC_015695.1| -Saccharomonospora viridis DSM 43017 chromosome, complete genome. (NC_013159)=NC_013159,NC_013159.1,gi|257054089|ref|NC_013159.1| -Saccharophagus degradans 2-40 chromosome, complete genome. (NC_007912)=NC_007912,NC_007912.1,gi|90019649|ref|NC_007912.1| -Saccharopolyspora erythraea NRRL 2338 chromosome, complete genome. (NC_009142)=NC_009142,NC_009142.1,gi|134096620|ref|NC_009142.1| -Salinibacter ruber DSM 13855 chromosome, complete genome. (NC_007677)=NC_007677,NC_007677.1,gi|83814055|ref|NC_007677.1| -Salinibacter ruber DSM 13855 plasmid pSR35, complete sequence. (NC_007678)=NC_007678,NC_007678.1,gi|83816857|ref|NC_007678.1| -Salinibacter ruber M8 chromosome, complete genome. (NC_014032)=NC_014032,NC_014032.1,gi|294505815|ref|NC_014032.1| -Salinibacter ruber M8 plasmid pSR11, complete sequence. (NC_014026)=NC_014026,NC_014026.1,gi|294508902|ref|NC_014026.1| -Salinibacter ruber M8 plasmid pSR56, complete sequence. (NC_014028)=NC_014028,NC_014028.1,gi|294502069|ref|NC_014028.1| -Salinibacter ruber M8 plasmid pSR61, complete sequence. (NC_014030)=NC_014030,NC_014030.1,gi|294505653|ref|NC_014030.1| -Salinibacter ruber M8 plasmid pSR84, complete sequence. (NC_014157)=NC_014157,NC_014157.1,gi|296137679|ref|NC_014157.1| -Salinispora arenicola CNS-205 chromosome, complete genome. (NC_009953)=NC_009953,NC_009953.1,gi|159035674|ref|NC_009953.1| -Salinispora tropica CNB-440 chromosome, complete genome. (NC_009380)=NC_009380,NC_009380.1,gi|145592566|ref|NC_009380.1| -Salmonella bongori NCTC 12419, complete genome. (NC_015761)=NC_015761,NC_015761.1,gi|339998036|ref|NC_015761.1| -Salmonella enterica subsp. arizonae serovar 62:z4,z23:-- str. (NC_010067)=NC_010067,NC_010067.1,gi|161501984|ref|NC_010067.1| -Salmonella enterica subsp. enterica serovar Agona str. SL483 (NC_011148)=NC_011148,NC_011148.1,gi|197247299|ref|NC_011148.1| -Salmonella enterica subsp. enterica serovar Agona str. SL483 (NC_011149)=NC_011149,NC_011149.1,gi|197247352|ref|NC_011149.1| -Salmonella enterica subsp. enterica serovar Choleraesuis str. (NC_006855)=NC_006855,NC_006855.1,gi|60115462|ref|NC_006855.1| -Salmonella enterica subsp. enterica serovar Choleraesuis str. (NC_006856)=NC_006856,NC_006856.1,gi|60115514|ref|NC_006856.1| -Salmonella enterica subsp. enterica serovar Choleraesuis str. (NC_006905)=NC_006905,NC_006905.1,gi|62178570|ref|NC_006905.1| -Salmonella enterica subsp. enterica serovar Dublin str. CT_02021853 (NC_011204)=NC_011204,NC_011204.1,gi|198241636|ref|NC_011204.1| -Salmonella enterica subsp. enterica serovar Dublin str. CT_02021853 (NC_011205)=NC_011205,NC_011205.1,gi|198241740|ref|NC_011205.1| -Salmonella enterica subsp. enterica serovar Enteritidis str. (NC_011294)=NC_011294,NC_011294.1,gi|207855516|ref|NC_011294.1| -Salmonella enterica subsp. enterica serovar Gallinarum str. 287/91 (NC_011274)=NC_011274,NC_011274.1,gi|205351346|ref|NC_011274.1| -Salmonella enterica subsp. enterica serovar Gallinarum/pullorum (NC_016831)=NC_016831,NC_016831.1,gi|378953804|ref|NC_016831.1| -Salmonella enterica subsp. enterica serovar Heidelberg str. B182 (NC_017623)=NC_017623,NC_017623.1,gi|386589256|ref|NC_017623.1| -Salmonella enterica subsp. enterica serovar Heidelberg str. B182 (NC_017624)=NC_017624,NC_017624.1,gi|386593545|ref|NC_017624.1| -Salmonella enterica subsp. enterica serovar Heidelberg str. SL476 (NC_011081)=NC_011081,NC_011081.1,gi|194447175|ref|NC_011081.1| -Salmonella enterica subsp. enterica serovar Heidelberg str. SL476 (NC_011082)=NC_011082,NC_011082.1,gi|194447301|ref|NC_011082.1| -Salmonella enterica subsp. enterica serovar Heidelberg str. SL476 (NC_011083)=NC_011083,NC_011083.1,gi|194447306|ref|NC_011083.1| -Salmonella enterica subsp. enterica serovar Newport str. SL254 (NC_009140)=NC_009140,NC_009140.1,gi|134047083|ref|NC_009140.1| -Salmonella enterica subsp. enterica serovar Newport str. SL254 (NC_011079)=NC_011079,NC_011079.1,gi|194442198|ref|NC_011079.1| -Salmonella enterica subsp. enterica serovar Newport str. SL254 (NC_011080)=NC_011080,NC_011080.1,gi|194442203|ref|NC_011080.1| -Salmonella enterica subsp. enterica serovar Paratyphi A str. (NC_011147)=NC_011147,NC_011147.1,gi|197361212|ref|NC_011147.1| -Salmonella enterica subsp. enterica serovar Paratyphi A str. ATCC (NC_006511)=NC_006511,NC_006511.1,gi|56412276|ref|NC_006511.1| -Salmonella enterica subsp. enterica serovar Paratyphi B str. SPB7 (NC_010102)=NC_010102,NC_010102.1,gi|161612313|ref|NC_010102.1| -Salmonella enterica subsp. enterica serovar Paratyphi C strain (NC_012124)=NC_012124,NC_012124.1,gi|224504235|ref|NC_012124.1| -Salmonella enterica subsp. enterica serovar Paratyphi C strain (NC_012125)=NC_012125,NC_012125.1,gi|224581838|ref|NC_012125.1| -Salmonella enterica subsp. enterica serovar Schwarzengrund str. (NC_011092)=NC_011092,NC_011092.1,gi|194733773|ref|NC_011092.1| -Salmonella enterica subsp. enterica serovar Schwarzengrund str. (NC_011093)=NC_011093,NC_011093.1,gi|194733896|ref|NC_011093.1| -Salmonella enterica subsp. enterica serovar Schwarzengrund str. (NC_011094)=NC_011094,NC_011094.1,gi|194733902|ref|NC_011094.1| -Salmonella enterica subsp. enterica serovar Typhi str. CT18 (NC_003198)=NC_003198,NC_003198.1,gi|16758993|ref|NC_003198.1| -Salmonella enterica subsp. enterica serovar Typhi str. CT18 plasmid (NC_003384)=NC_003384,NC_003384.1,gi|18466424|ref|NC_003384.1| -Salmonella enterica subsp. enterica serovar Typhi str. CT18 plasmid (NC_003385)=NC_003385,NC_003385.1,gi|18466665|ref|NC_003385.1| -Salmonella enterica subsp. enterica serovar Typhi str. P-stx-12 (NC_016825)=NC_016825,NC_016825.1,gi|378962821|ref|NC_016825.1| -Salmonella enterica subsp. enterica serovar Typhi str. P-stx-12 (NC_016832)=NC_016832,NC_016832.1,gi|378958130|ref|NC_016832.1| -Salmonella enterica subsp. enterica serovar Typhi str. Ty2 (NC_004631)=NC_004631,NC_004631.1,gi|29140543|ref|NC_004631.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. 14028S (NC_016855)=NC_016855,NC_016855.1,gi|378448040|ref|NC_016855.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. 14028S (NC_016856)=NC_016856,NC_016856.1,gi|378448274|ref|NC_016856.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. 798 (NC_017046)=NC_017046,NC_017046.1,gi|383494824|ref|NC_017046.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. 798 (NC_017054)=NC_017054,NC_017054.1,gi|383499151|ref|NC_017054.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. LT2 (NC_003197)=NC_003197,NC_003197.1,gi|16763390|ref|NC_003197.1| -Salmonella typhimurium LT2 plasmid pSLT, complete sequence. (NC_003277)=NC_003277,NC_003277.1,gi|17233403|ref|NC_003277.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. (NC_016810)=NC_016810,NC_016810.1,gi|378697983|ref|NC_016810.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. SL1344 (NC_017718)=NC_017718,NC_017718.1,gi|386730549|ref|NC_017718.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. SL1344 (NC_017719)=NC_017719,NC_017719.1,gi|386730646|ref|NC_017719.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. SL1344 (NC_017720)=NC_017720,NC_017720.1,gi|386730659|ref|NC_017720.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. ST4/74 (NC_016857)=NC_016857,NC_016857.1,gi|379699217|ref|NC_016857.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. ST4/74 (NC_016858)=NC_016858,NC_016858.1,gi|379699100|ref|NC_016858.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. ST4/74 (NC_016859)=NC_016859,NC_016859.1,gi|386730537|ref|NC_016859.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. ST4/74 (NC_017675)=NC_017675,NC_017675.1,gi|386730446|ref|NC_017675.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. (NC_016860)=NC_016860,NC_016860.1,gi|378982542|ref|NC_016860.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. (NC_016861)=NC_016861,NC_016861.1,gi|378987264|ref|NC_016861.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. (NC_016862)=NC_016862,NC_016862.1,gi|377542923|ref|NC_016862.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. UK-1 (NC_016863)=NC_016863,NC_016863.1,gi|378987404|ref|NC_016863.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. UK-1 (NC_016864)=NC_016864,NC_016864.1,gi|378991860|ref|NC_016864.1| -Salmonella enterica subsp. enterica serovar Typhimurium str. (NC_016854)=NC_016854,NC_016854.1,gi|378443454|ref|NC_016854.1| -Sanguibacter keddieii DSM 10542 chromosome, complete genome. (NC_013521)=NC_013521,NC_013521.1,gi|269793358|ref|NC_013521.1| -Saprospira grandis str. Lewin chromosome, complete genome. (NC_016940)=NC_016940,NC_016940.1,gi|379728134|ref|NC_016940.1| -Saprospira grandis str. Lewin plasmid unnamed, complete sequence. (NC_016936)=NC_016936,NC_016936.1,gi|379732330|ref|NC_016936.1| -Sebaldella termitidis ATCC 33386 chromosome, complete genome. (NC_013517)=NC_013517,NC_013517.1,gi|269118642|ref|NC_013517.1| -Sebaldella termitidis ATCC 33386 plasmid pSTERM01, complete (NC_013518)=NC_013518,NC_013518.1,gi|268793183|ref|NC_013518.1| -Sebaldella termitidis ATCC 33386 plasmid pSTERM02, complete (NC_013519)=NC_013519,NC_013519.1,gi|268796558|ref|NC_013519.1| -Segniliparus rotundus DSM 44985 chromosome, complete genome. (NC_014168)=NC_014168,NC_014168.1,gi|296392440|ref|NC_014168.1| -Selenomonas ruminantium subsp. lactilytica TAM6421 plasmid pSRC1, (NC_017078)=NC_017078,NC_017078.1,gi|383760688|ref|NC_017078.1| -Selenomonas ruminantium subsp. lactilytica TAM6421 plasmid pSRC2, (NC_017076)=NC_017076,NC_017076.1,gi|383760553|ref|NC_017076.1| -Selenomonas ruminantium subsp. lactilytica TAM6421 plasmid pSRC3, (NC_017073)=NC_017073,NC_017073.1,gi|383755757|ref|NC_017073.1| -Selenomonas ruminantium subsp. lactilytica TAM6421 plasmid pSRC4, (NC_017069)=NC_017069,NC_017069.1,gi|383755655|ref|NC_017069.1| -Selenomonas ruminantium subsp. lactilytica TAM6421 plasmid pSRC5, (NC_017074)=NC_017074,NC_017074.1,gi|383080718|ref|NC_017074.1| -Selenomonas ruminantium subsp. lactilytica TAM6421 plasmid pSRC6, (NC_017070)=NC_017070,NC_017070.1,gi|383080676|ref|NC_017070.1| -Selenomonas ruminantium subsp. lactilytica TAM6421 plasmid pSRC7, (NC_017077)=NC_017077,NC_017077.1,gi|383760671|ref|NC_017077.1| -Selenomonas ruminantium subsp. lactilytica TAM6421 plasmid pSRC8, (NC_017071)=NC_017071,NC_017071.1,gi|383080708|ref|NC_017071.1| -Selenomonas ruminantium subsp. lactilytica TAM6421 plasmid pSRC9, (NC_017072)=NC_017072,NC_017072.1,gi|383080713|ref|NC_017072.1| -Selenomonas ruminantium subsp. lactilytica TAM6421, complete (NC_017068)=NC_017068,NC_017068.1,gi|383752828|ref|NC_017068.1| -Selenomonas sputigena ATCC 35185 chromosome, complete genome. (NC_015437)=NC_015437,NC_015437.1,gi|330837866|ref|NC_015437.1| -Serratia sp. AS12 chromosome, complete genome. (NC_015566)=NC_015566,NC_015566.1,gi|333924895|ref|NC_015566.1| -Serratia sp. AS13 chromosome, complete genome. (NC_017573)=NC_017573,NC_017573.1,gi|386326719|ref|NC_017573.1| -Serratia sp. AS9 chromosome, complete genome. (NC_015567)=NC_015567,NC_015567.1,gi|333929848|ref|NC_015567.1| -Serratia proteamaculans 568 chromosome, complete genome. (NC_009832)=NC_009832,NC_009832.1,gi|157368249|ref|NC_009832.1| -Serratia proteamaculans 568 plasmid pSPRO01, complete sequence. (NC_009829)=NC_009829,NC_009829.1,gi|157362818|ref|NC_009829.1| -Serratia symbiotica str. 'Cinara cedri' chromosome, complete (NC_016632)=NC_016632,NC_016632.1,gi|374313777|ref|NC_016632.1| -Shewanella sp. ANA-3 chromosome 1, complete sequence. (NC_008577)=NC_008577,NC_008577.1,gi|117918459|ref|NC_008577.1| -Shewanella sp. ANA-3 plasmid 1, complete sequence. (NC_008573)=NC_008573,NC_008573.1,gi|117676079|ref|NC_008573.1| -Shewanella sp. MR-4 chromosome, complete genome. (NC_008321)=NC_008321,NC_008321.1,gi|113968346|ref|NC_008321.1| -Shewanella sp. MR-7 chromosome, complete genome. (NC_008322)=NC_008322,NC_008322.1,gi|114045513|ref|NC_008322.1| -Shewanella sp. MR-7 plasmid1, complete sequence. (NC_008320)=NC_008320,NC_008320.1,gi|113951722|ref|NC_008320.1| -Shewanella sp. W3-18-1 chromosome, complete genome. (NC_008750)=NC_008750,NC_008750.1,gi|120596833|ref|NC_008750.1| -Shewanella amazonensis SB2B chromosome, complete genome. (NC_008700)=NC_008700,NC_008700.1,gi|119773142|ref|NC_008700.1| -Shewanella baltica BA175 chromosome, complete genome. (NC_017571)=NC_017571,NC_017571.1,gi|386322495|ref|NC_017571.1| -Shewanella baltica BA175 plasmid pSBAL17501, complete sequence. (NC_017570)=NC_017570,NC_017570.1,gi|386322427|ref|NC_017570.1| -Shewanella baltica BA175 plasmid pSBAL17502, complete sequence. (NC_017572)=NC_017572,NC_017572.1,gi|386322372|ref|NC_017572.1| -Shewanella baltica OS117 chromosome, complete genome. (NC_017579)=NC_017579,NC_017579.1,gi|386338936|ref|NC_017579.1| -Shewanella baltica OS117 plasmid pSBAL11701, complete sequence. (NC_017577)=NC_017577,NC_017577.1,gi|386343408|ref|NC_017577.1| -Shewanella baltica OS117 plasmid pSBAL11702, complete sequence. (NC_017580)=NC_017580,NC_017580.1,gi|386343312|ref|NC_017580.1| -Shewanella baltica OS117 plasmid pSBAL11703, complete sequence. (NC_017578)=NC_017578,NC_017578.1,gi|386343535|ref|NC_017578.1| -Shewanella baltica OS155 chromosome, complete genome. (NC_009052)=NC_009052,NC_009052.1,gi|126172257|ref|NC_009052.1| -Shewanella baltica OS155 plasmid pSbal01, complete sequence. (NC_009035)=NC_009035,NC_009035.1,gi|126090118|ref|NC_009035.1| -Shewanella baltica OS155 plasmid pSbal02, complete sequence. (NC_009036)=NC_009036,NC_009036.1,gi|126090236|ref|NC_009036.1| -Shewanella baltica OS155 plasmid pSbal03, complete sequence. (NC_009037)=NC_009037,NC_009037.1,gi|126090319|ref|NC_009037.1| -Shewanella baltica OS155 plasmid pSbal04, complete sequence. (NC_009038)=NC_009038,NC_009038.1,gi|126090338|ref|NC_009038.1| -Shewanella baltica OS185 chromosome, complete genome. (NC_009665)=NC_009665,NC_009665.1,gi|152998555|ref|NC_009665.1| -Shewanella baltica OS185 plasmid pS18501, complete sequence. (NC_009661)=NC_009661,NC_009661.1,gi|152998483|ref|NC_009661.1| -Shewanella baltica OS195 chromosome, complete genome. (NC_009997)=NC_009997,NC_009997.1,gi|160873126|ref|NC_009997.1| -Shewanella baltica OS195 plasmid pS19501, complete sequence. (NC_009998)=NC_009998,NC_009998.1,gi|160872934|ref|NC_009998.1| -Shewanella baltica OS195 plasmid pS19502, complete sequence. (NC_009999)=NC_009999,NC_009999.1,gi|160873002|ref|NC_009999.1| -Shewanella baltica OS195 plasmid pS19503, complete sequence. (NC_010000)=NC_010000,NC_010000.1,gi|160873076|ref|NC_010000.1| -Shewanella baltica OS223 chromosome, complete genome. (NC_011663)=NC_011663,NC_011663.1,gi|217971216|ref|NC_011663.1| -Shewanella baltica OS223 plasmid pS22301, complete sequence. (NC_011664)=NC_011664,NC_011664.1,gi|217975547|ref|NC_011664.1| -Shewanella baltica OS223 plasmid pS22302, complete sequence. (NC_011668)=NC_011668,NC_011668.1,gi|217980264|ref|NC_011668.1| -Shewanella baltica OS223 plasmid pS22303, complete sequence. (NC_011665)=NC_011665,NC_011665.1,gi|217975697|ref|NC_011665.1| -Shewanella baltica OS678 chromosome, complete genome. (NC_016901)=NC_016901,NC_016901.1,gi|378706362|ref|NC_016901.1| -Shewanella baltica OS678 plasmid pSBAL67801, complete sequence. (NC_016905)=NC_016905,NC_016905.1,gi|378715492|ref|NC_016905.1| -Shewanella denitrificans OS217, complete genome. (NC_007954)=NC_007954,NC_007954.1,gi|91791369|ref|NC_007954.1| -Shewanella frigidimarina NCIMB 400 chromosome, complete genome. (NC_008345)=NC_008345,NC_008345.1,gi|114561188|ref|NC_008345.1| -Shewanella halifaxensis HAW-EB4 chromosome, complete genome. (NC_010334)=NC_010334,NC_010334.1,gi|167621941|ref|NC_010334.1| -Shewanella loihica PV-4 chromosome, complete genome. (NC_009092)=NC_009092,NC_009092.1,gi|127510935|ref|NC_009092.1| -Shewanella oneidensis MR-1 chromosome, complete genome. (NC_004347)=NC_004347,NC_004347.1,gi|24371600|ref|NC_004347.1| -Shewanella oneidensis MR-1 plasmid megaplasmid, complete sequence. (NC_004349)=NC_004349,NC_004349.1,gi|24376231|ref|NC_004349.1| -Shewanella pealeana ATCC 700345 chromosome, complete genome. (NC_009901)=NC_009901,NC_009901.1,gi|157959830|ref|NC_009901.1| -Shewanella piezotolerans WP3 chromosome, complete genome. (NC_011566)=NC_011566,NC_011566.1,gi|212632911|ref|NC_011566.1| -Shewanella putrefaciens 200 chromosome, complete genome. (NC_017566)=NC_017566,NC_017566.1,gi|386311792|ref|NC_017566.1| -Shewanella putrefaciens CN-32 chromosome, complete genome. (NC_009438)=NC_009438,NC_009438.1,gi|146291111|ref|NC_009438.1| -Shewanella sediminis HAW-EB3 chromosome, complete genome. (NC_009831)=NC_009831,NC_009831.1,gi|157373141|ref|NC_009831.1| -Shewanella violacea DSS12 chromosome, complete genome. (NC_014012)=NC_014012,NC_014012.1,gi|294138771|ref|NC_014012.1| -Shewanella woodyi ATCC 51908 chromosome, complete genome. (NC_010506)=NC_010506,NC_010506.1,gi|170724370|ref|NC_010506.1| -Shigella boydii CDC 3083-94 chromosome, complete genome. (NC_010658)=NC_010658,NC_010658.1,gi|187730020|ref|NC_010658.1| -Shigella boydii CDC 3083-94 plasmid pBS512_2, complete sequence. (NC_010656)=NC_010656,NC_010656.1,gi|187729963|ref|NC_010656.1| -Shigella boydii CDC 3083-94 plasmid pBS512_211, complete sequence. (NC_010660)=NC_010660,NC_010660.1,gi|187734273|ref|NC_010660.1| -Shigella boydii CDC 3083-94 plasmid pBS512_33, complete sequence. (NC_010657)=NC_010657,NC_010657.1,gi|187729967|ref|NC_010657.1| -Shigella boydii CDC 3083-94 plasmid pBS512_5, complete sequence. (NC_010659)=NC_010659,NC_010659.1,gi|187734267|ref|NC_010659.1| -Shigella boydii CDC 3083-94 plasmid pBS512_7, complete sequence. (NC_010672)=NC_010672,NC_010672.1,gi|187918703|ref|NC_010672.1| -Shigella boydii Sb227 chromosome, complete genome. (NC_007613)=NC_007613,NC_007613.1,gi|82542618|ref|NC_007613.1| -Shigella boydii Sb227 plasmid pSB4_227, complete sequence. (NC_007608)=NC_007608,NC_007608.1,gi|82524664|ref|NC_007608.1| -Shigella dysenteriae Sd197 plasmid pSD197_spA, complete sequence. (NC_009344)=NC_009344,NC_009344.1,gi|145294016|ref|NC_009344.1| -Shigella dysenteriae Sd197 plasmid pSD1_197, complete sequence. (NC_007607)=NC_007607,NC_007607.1,gi|82524407|ref|NC_007607.1| -Shigella dysenteriae Sd197, complete genome. (NC_007606)=NC_007606,NC_007606.1,gi|82775382|ref|NC_007606.1| -Shigella flexneri 2002017 chromosome, complete genome. (NC_017328)=NC_017328,NC_017328.1,gi|384541581|ref|NC_017328.1| -Shigella flexneri 2002017 plasmid pSFxv_1, complete sequence. (NC_017319)=NC_017319,NC_017319.1,gi|384545966|ref|NC_017319.1| -Shigella flexneri 2002017 plasmid pSFxv_2, complete sequence. (NC_017320)=NC_017320,NC_017320.1,gi|384541569|ref|NC_017320.1| -Shigella flexneri 2002017 plasmid pSFxv_3, complete sequence. (NC_017329)=NC_017329,NC_017329.1,gi|384541560|ref|NC_017329.1| -Shigella flexneri 2002017 plasmid pSFxv_4, complete sequence. (NC_017321)=NC_017321,NC_017321.1,gi|384545954|ref|NC_017321.1| -Shigella flexneri 2002017 plasmid pSFxv_5, complete sequence. (NC_017330)=NC_017330,NC_017330.1,gi|384545959|ref|NC_017330.1| -Shigella flexneri 2a str. 2457T, complete genome. (NC_004741)=NC_004741,NC_004741.1,gi|30061571|ref|NC_004741.1| -Shigella flexneri 2a str. 301 chromosome, complete genome. (NC_004337)=NC_004337,NC_004337.2,gi|344915202|ref|NC_004337.2| -Shigella flexneri 2a str. 301 plasmid pCP301, complete sequence. (NC_004851)=NC_004851,NC_004851.1,gi|31983523|ref|NC_004851.1| -Shigella flexneri 5 str. 8401 chromosome, complete genome. (NC_008258)=NC_008258,NC_008258.1,gi|110804074|ref|NC_008258.1| -Shigella sonnei 53G plasmid A, complete sequence. (NC_016833)=NC_016833,NC_016833.1,gi|377549524|ref|NC_016833.1| -Shigella sonnei 53G plasmid B, complete sequence. (NC_016823)=NC_016823,NC_016823.1,gi|377520097|ref|NC_016823.1| -Shigella sonnei 53G plasmid C, complete sequence. (NC_016824)=NC_016824,NC_016824.1,gi|377520098|ref|NC_016824.1| -Shigella sonnei 53G plasmid E, complete sequence. (NC_016834)=NC_016834,NC_016834.1,gi|377549525|ref|NC_016834.1| -Shigella sonnei 53G, complete genome. (NC_016822)=NC_016822,NC_016822.1,gi|377520096|ref|NC_016822.1| -Shigella sonnei Ss046 chromosome, complete genome. (NC_007384)=NC_007384,NC_007384.1,gi|74310614|ref|NC_007384.1| -Shigella sonnei Ss046 plasmid pSS046_spA, complete sequence. (NC_009345)=NC_009345,NC_009345.1,gi|145294025|ref|NC_009345.1| -Shigella sonnei Ss046 plasmid pSS046_spB, complete sequence. (NC_009346)=NC_009346,NC_009346.1,gi|145294031|ref|NC_009346.1| -Shigella sonnei Ss046 plasmid pSS046_spC, complete sequence. (NC_009347)=NC_009347,NC_009347.1,gi|145294040|ref|NC_009347.1| -Shigella sonnei Ss046 plasmid pSS_046, complete sequence. (NC_007385)=NC_007385,NC_007385.1,gi|74314838|ref|NC_007385.1| -Sideroxydans lithotrophicus ES-1 chromosome, complete genome. (NC_013959)=NC_013959,NC_013959.1,gi|291612472|ref|NC_013959.1| -Simkania negevensis Z chromosome chromosome gsn.131, complete (NC_015713)=NC_015713,NC_015713.1,gi|338731896|ref|NC_015713.1| -Simkania negevensis Z plasmid pSn, complete sequence. (NC_015710)=NC_015710,NC_015710.1,gi|338731758|ref|NC_015710.1| -Sinorhizobium fredii HH103 plasmid pSfHH103a, complete sequence. (NC_016813)=NC_016813,NC_016813.1,gi|378828553|ref|NC_016813.1| -Sinorhizobium fredii HH103 plasmid pSfHH103b, complete sequence. (NC_016836)=NC_016836,NC_016836.1,gi|378828572|ref|NC_016836.1| -Sinorhizobium fredii HH103 plasmid pSfHH103c, complete sequence. (NC_016814)=NC_016814,NC_016814.1,gi|378775795|ref|NC_016814.1| -Sinorhizobium fredii HH103 plasmid pSfHH103e, complete sequence. (NC_016815)=NC_016815,NC_016815.1,gi|378762851|ref|NC_016815.1| -Sinorhizobium fredii HH103, complete genome. (NC_016812)=NC_016812,NC_016812.1,gi|378824597|ref|NC_016812.1| -Sinorhizobium fredii USDA 257 chromosome, complete genome. (NC_018000)=NC_018000,NC_018000.1,gi|398349897|ref|NC_018000.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018182)=NC_018182,NC_018182.1,gi|398356013|ref|NC_018182.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018183)=NC_018183,NC_018183.1,gi|398356025|ref|NC_018183.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018184)=NC_018184,NC_018184.1,gi|398356040|ref|NC_018184.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018185)=NC_018185,NC_018185.1,gi|398356048|ref|NC_018185.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018186)=NC_018186,NC_018186.1,gi|398356063|ref|NC_018186.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018187)=NC_018187,NC_018187.1,gi|398356072|ref|NC_018187.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018188)=NC_018188,NC_018188.1,gi|398356080|ref|NC_018188.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018189)=NC_018189,NC_018189.1,gi|398356087|ref|NC_018189.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018190)=NC_018190,NC_018190.1,gi|398356091|ref|NC_018190.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018191)=NC_018191,NC_018191.1,gi|398356092|ref|NC_018191.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018192)=NC_018192,NC_018192.1,gi|398356314|ref|NC_018192.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018193)=NC_018193,NC_018193.1,gi|398356354|ref|NC_018193.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018194)=NC_018194,NC_018194.1,gi|398356370|ref|NC_018194.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018195)=NC_018195,NC_018195.1,gi|397701677|ref|NC_018195.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018196)=NC_018196,NC_018196.1,gi|398356381|ref|NC_018196.1| -Sinorhizobium fredii USDA 257 plasmid pUSDA257, complete sequence. (NC_018197)=NC_018197,NC_018197.1,gi|398356390|ref|NC_018197.1| -Sinorhizobium medicae WSM419 chromosome, complete genome. (NC_009636)=NC_009636,NC_009636.1,gi|150395228|ref|NC_009636.1| -Sinorhizobium medicae WSM419 plasmid pSMED01, complete sequence. (NC_009620)=NC_009620,NC_009620.1,gi|150375726|ref|NC_009620.1| -Sinorhizobium medicae WSM419 plasmid pSMED02, complete sequence. (NC_009621)=NC_009621,NC_009621.1,gi|150377168|ref|NC_009621.1| -Sinorhizobium medicae WSM419 plasmid pSMED03, complete sequence. (NC_009622)=NC_009622,NC_009622.1,gi|150378263|ref|NC_009622.1| -Sinorhizobium meliloti 1021 plasmid pSymA, complete sequence. (NC_003037)=NC_003037,NC_003037.1,gi|16262453|ref|NC_003037.1| -Sinorhizobium meliloti 1021 plasmid pSymB, complete sequence. (NC_003078)=NC_003078,NC_003078.1,gi|16263748|ref|NC_003078.1| -Sinorhizobium meliloti 1021, complete genome. (NC_003047)=NC_003047,NC_003047.1,gi|15963753|ref|NC_003047.1| -Sinorhizobium meliloti AK83 chromosome 1, complete sequence. (NC_015590)=NC_015590,NC_015590.1,gi|334314770|ref|NC_015590.1| -Sinorhizobium meliloti AK83 chromosome 2, complete sequence. (NC_015596)=NC_015596,NC_015596.1,gi|334319652|ref|NC_015596.1| -Sinorhizobium meliloti AK83 chromosome 3, complete sequence. (NC_015591)=NC_015591,NC_015591.1,gi|334318456|ref|NC_015591.1| -Sinorhizobium meliloti AK83 plasmid pSINME01, complete sequence. (NC_015597)=NC_015597,NC_015597.1,gi|334321232|ref|NC_015597.1| -Sinorhizobium meliloti AK83 plasmid pSINME02, complete sequence. (NC_015592)=NC_015592,NC_015592.1,gi|334321156|ref|NC_015592.1| -Sinorhizobium meliloti BL225C chromosome, complete genome. (NC_017322)=NC_017322,NC_017322.1,gi|384528107|ref|NC_017322.1| -Sinorhizobium meliloti BL225C plasmid pSINMEB01, complete sequence. (NC_017324)=NC_017324,NC_017324.1,gi|384531523|ref|NC_017324.1| -Sinorhizobium meliloti BL225C plasmid pSINMEB02, complete sequence. (NC_017323)=NC_017323,NC_017323.1,gi|384532946|ref|NC_017323.1| -Sinorhizobium meliloti SM11 chromosome, complete genome. (NC_017325)=NC_017325,NC_017325.1,gi|384534464|ref|NC_017325.1| -Sinorhizobium meliloti SM11 plasmid pSmeSM11c, complete sequence. (NC_017327)=NC_017327,NC_017327.1,gi|384539799|ref|NC_017327.1| -Sinorhizobium meliloti SM11 plasmid pSmeSM11d, complete sequence. (NC_017326)=NC_017326,NC_017326.1,gi|384538250|ref|NC_017326.1| -Slackia heliotrinireducens DSM 20476 chromosome, complete genome. (NC_013165)=NC_013165,NC_013165.1,gi|257062754|ref|NC_013165.1| -Sodalis glossinidius str. 'morsitans' chromosome, complete genome. (NC_007712)=NC_007712,NC_007712.1,gi|85057978|ref|NC_007712.1| -Sodalis glossinidius str. 'morsitans' plasmid pSG1, complete (NC_007713)=NC_007713,NC_007713.1,gi|85060411|ref|NC_007713.1| -Sodalis glossinidius str. 'morsitans' plasmid pSG2, complete (NC_007714)=NC_007714,NC_007714.1,gi|85060466|ref|NC_007714.1| -Sodalis glossinidius str. 'morsitans' plasmid pSG3, complete (NC_007715)=NC_007715,NC_007715.1,gi|85060490|ref|NC_007715.1| -Solibacillus silvestris StLB046 plasmid pSSIL1, complete sequence. (NC_018069)=NC_018069,NC_018069.1,gi|393202538|ref|NC_018069.1| -Solibacillus silvestris StLB046, complete genome. (NC_018065)=NC_018065,NC_018065.1,gi|393198727|ref|NC_018065.1| -Solitalea canadensis DSM 3403 chromosome, complete genome. (NC_017770)=NC_017770,NC_017770.1,gi|387789281|ref|NC_017770.1| -Sorangium cellulosum 'So ce 56' chromosome, complete genome. (NC_010162)=NC_010162,NC_010162.1,gi|162448269|ref|NC_010162.1| -Sphaerobacter thermophilus DSM 20745 chromosome 1, complete (NC_013523)=NC_013523,NC_013523.1,gi|269836033|ref|NC_013523.1| -Sphaerobacter thermophilus DSM 20745 chromosome 2, complete (NC_013524)=NC_013524,NC_013524.1,gi|269928379|ref|NC_013524.1| -Sphaerochaeta pleomorpha str. Grapes chromosome, complete genome. (NC_016633)=NC_016633,NC_016633.1,gi|374314450|ref|NC_016633.1| -Sphingobacterium sp. 21 chromosome, complete genome. (NC_015277)=NC_015277,NC_015277.1,gi|326797444|ref|NC_015277.1| -Sphingobium sp. SYK-6 chromosome, complete genome. (NC_015976)=NC_015976,NC_015976.1,gi|347526385|ref|NC_015976.1| -Sphingobium sp. SYK-6 plasmid pSLPG, complete sequence. (NC_015974)=NC_015974,NC_015974.1,gi|347430512|ref|NC_015974.1| -Sphingobium chlorophenolicum L-1 chromosome 1, complete sequence. (NC_015593)=NC_015593,NC_015593.1,gi|334343657|ref|NC_015593.1| -Sphingobium chlorophenolicum L-1 chromosome 2, complete sequence. (NC_015594)=NC_015594,NC_015594.1,gi|334342451|ref|NC_015594.1| -Sphingobium chlorophenolicum L-1 plasmid pSPHCH01, complete (NC_015595)=NC_015595,NC_015595.1,gi|334346522|ref|NC_015595.1| -Sphingobium japonicum UT26S chromosome 1, complete genome. (NC_014006)=NC_014006,NC_014006.1,gi|294009986|ref|NC_014006.1| -Sphingobium japonicum UT26S chromosome 2, complete genome. (NC_014013)=NC_014013,NC_014013.1,gi|294146429|ref|NC_014013.1| -Sphingobium japonicum UT26S plasmid pCHQ1, complete sequence. (NC_014007)=NC_014007,NC_014007.1,gi|294023656|ref|NC_014007.1| -Sphingobium japonicum UT26S plasmid pUT1, complete sequence. (NC_014005)=NC_014005,NC_014005.1,gi|293980644|ref|NC_014005.1| -Sphingobium japonicum UT26S plasmid pUT2, complete sequence. (NC_014009)=NC_014009,NC_014009.1,gi|294057975|ref|NC_014009.1| -Sphingomonas wittichii RW1 chromosome, complete genome. (NC_009511)=NC_009511,NC_009511.1,gi|148552929|ref|NC_009511.1| -Sphingomonas wittichii RW1 plasmid pSWIT01, complete sequence. (NC_009507)=NC_009507,NC_009507.1,gi|148550551|ref|NC_009507.1| -Sphingomonas wittichii RW1 plasmid pSWIT02, complete sequence. (NC_009508)=NC_009508,NC_009508.1,gi|148550845|ref|NC_009508.1| -Sphingopyxis alaskensis RB2256 F plasmid, complete sequence. (NC_008036)=NC_008036,NC_008036.1,gi|98152871|ref|NC_008036.1| -Sphingopyxis alaskensis RB2256 chromosome, complete genome. (NC_008048)=NC_008048,NC_008048.1,gi|103485498|ref|NC_008048.1| -Spirochaeta sp. Buddy chromosome, complete genome. (NC_015152)=NC_015152,NC_015152.1,gi|325969849|ref|NC_015152.1| -Spirochaeta africana DSM 8902 chromosome, complete genome. (NC_017098)=NC_017098,NC_017098.1,gi|383789243|ref|NC_017098.1| -Spirochaeta caldaria DSM 7334 chromosome, complete genome. (NC_015732)=NC_015732,NC_015732.1,gi|339498645|ref|NC_015732.1| -Spirochaeta coccoides DSM 17374 chromosome, complete genome. (NC_015436)=NC_015436,NC_015436.1,gi|330835983|ref|NC_015436.1| -Spirochaeta smaragdinae DSM 11293 chromosome, complete genome. (NC_014364)=NC_014364,NC_014364.1,gi|302336548|ref|NC_014364.1| -Spirochaeta thermophila DSM 6192 chromosome, complete genome. (NC_014484)=NC_014484,NC_014484.1,gi|307717717|ref|NC_014484.1| -Spirochaeta thermophila DSM 6578 chromosome, complete genome. (NC_017583)=NC_017583,NC_017583.1,gi|386345755|ref|NC_017583.1| -Spirosoma linguale DSM 74 chromosome, complete genome. (NC_013730)=NC_013730,NC_013730.1,gi|284034943|ref|NC_013730.1| -Spirosoma linguale DSM 74 plasmid pSLIN01, complete sequence. (NC_013731)=NC_013731,NC_013731.1,gi|284005577|ref|NC_013731.1| -Spirosoma linguale DSM 74 plasmid pSLIN02, complete sequence. (NC_013732)=NC_013732,NC_013732.1,gi|284005755|ref|NC_013732.1| -Spirosoma linguale DSM 74 plasmid pSLIN03, complete sequence. (NC_013733)=NC_013733,NC_013733.1,gi|284005898|ref|NC_013733.1| -Spirosoma linguale DSM 74 plasmid pSLIN04, complete sequence. (NC_013734)=NC_013734,NC_013734.1,gi|284005939|ref|NC_013734.1| -Spirosoma linguale DSM 74 plasmid pSLIN05, complete sequence. (NC_013735)=NC_013735,NC_013735.1,gi|284005954|ref|NC_013735.1| -Spirosoma linguale DSM 74 plasmid pSLIN06, complete sequence. (NC_013736)=NC_013736,NC_013736.1,gi|284005967|ref|NC_013736.1| -Spirosoma linguale DSM 74 plasmid pSLIN07, complete sequence. (NC_013737)=NC_013737,NC_013737.1,gi|284005992|ref|NC_013737.1| -Spirosoma linguale DSM 74 plasmid pSLIN08, complete sequence. (NC_013738)=NC_013738,NC_013738.1,gi|284006004|ref|NC_013738.1| -Stackebrandtia nassauensis DSM 44728 chromosome, complete genome. (NC_013947)=NC_013947,NC_013947.1,gi|291297538|ref|NC_013947.1| -Staphylococcus aureus 04-02981 chromosome, complete genome. (NC_017340)=NC_017340,NC_017340.1,gi|387149188|ref|NC_017340.1| -Staphylococcus aureus subsp. aureus 11819-97 chromosome, complete (NC_017351)=NC_017351,NC_017351.1,gi|385780298|ref|NC_017351.1| -Staphylococcus aureus subsp. aureus 11819-97 plasmid p11819-97, (NC_017350)=NC_017350,NC_017350.1,gi|385782932|ref|NC_017350.1| -Staphylococcus aureus subsp. aureus 71193 chromosome, complete (NC_017673)=NC_017673,NC_017673.1,gi|386727822|ref|NC_017673.1| -Staphylococcus aureus subsp. aureus COL chromosome, complete (NC_002951)=NC_002951,NC_002951.2,gi|57650036|ref|NC_002951.2| -Staphylococcus aureus subsp. aureus COL plasmid pT181, complete (NC_006629)=NC_006629,NC_006629.2,gi|77102894|ref|NC_006629.2| -Staphylococcus aureus subsp. aureus ECT-R 2 plasmid pLUH01, (NC_017346)=NC_017346,NC_017346.1,gi|384863394|ref|NC_017346.1| -Staphylococcus aureus subsp. aureus ECT-R 2 plasmid pLUH02, (NC_017344)=NC_017344,NC_017344.1,gi|384863363|ref|NC_017344.1| -Staphylococcus aureus subsp. aureus ECT-R 2, complete genome. (NC_017343)=NC_017343,NC_017343.1,gi|384863396|ref|NC_017343.1| -Staphylococcus aureus subsp. aureus ED133 chromosome, complete (NC_017337)=NC_017337,NC_017337.1,gi|384546269|ref|NC_017337.1| -Staphylococcus aureus subsp. aureus ED98 plasmid pAVX, complete (NC_013453)=NC_013453,NC_013453.1,gi|262260515|ref|NC_013453.1| -Staphylococcus aureus subsp. aureus ED98 plasmid pAVY, complete (NC_013451)=NC_013451,NC_013451.1,gi|262225764|ref|NC_013451.1| -Staphylococcus aureus subsp. aureus ED98 plasmid pT181, complete (NC_013452)=NC_013452,NC_013452.1,gi|262225767|ref|NC_013452.1| -Staphylococcus aureus subsp. aureus ED98, complete genome. (NC_013450)=NC_013450,NC_013450.1,gi|269201690|ref|NC_013450.1| -Staphylococcus aureus subsp. aureus HO 5096 0412, complete genome. (NC_017763)=NC_017763,NC_017763.1,gi|386829725|ref|NC_017763.1| -Staphylococcus aureus subsp. aureus JH1 chromosome, complete (NC_009632)=NC_009632,NC_009632.1,gi|150392480|ref|NC_009632.1| -Staphylococcus aureus subsp. aureus JH1 plasmid pSJH101, complete (NC_009619)=NC_009619,NC_009619.1,gi|150375692|ref|NC_009619.1| -Staphylococcus aureus subsp. aureus JH9 chromosome, complete (NC_009487)=NC_009487,NC_009487.1,gi|148266447|ref|NC_009487.1| -Staphylococcus aureus subsp. aureus JH9 plasmid pSJH901, complete (NC_009477)=NC_009477,NC_009477.1,gi|148244139|ref|NC_009477.1| -Staphylococcus aureus subsp. aureus str. JKD6008 chromosome, (NC_017341)=NC_017341,NC_017341.1,gi|384860682|ref|NC_017341.1| -Staphylococcus aureus subsp. aureus JKD6159 chromosome, complete (NC_017338)=NC_017338,NC_017338.1,gi|384548923|ref|NC_017338.1| -Staphylococcus aureus subsp. aureus JKD6159 plasmid pSaa6159, (NC_017339)=NC_017339,NC_017339.1,gi|384551479|ref|NC_017339.1| -Staphylococcus aureus subsp. aureus LGA251 plasmid pLGA251, (NC_017348)=NC_017348,NC_017348.1,gi|387781658|ref|NC_017348.1| -Staphylococcus aureus subsp. aureus LGA251, complete genome. (NC_017349)=NC_017349,NC_017349.1,gi|387779217|ref|NC_017349.1| -Staphylococcus aureus subsp. aureus M013 chromosome, complete (NC_016928)=NC_016928,NC_016928.1,gi|379019812|ref|NC_016928.1| -Staphylococcus aureus subsp. aureus MRSA252 chromosome, complete (NC_002952)=NC_002952,NC_002952.2,gi|49482253|ref|NC_002952.2| -Staphylococcus aureus subsp. aureus MSHR1132 plasmid pST75, (NC_016942)=NC_016942,NC_016942.1,gi|379793806|ref|NC_016942.1| -Staphylococcus aureus subsp. aureus MSHR1132, complete genome. (NC_016941)=NC_016941,NC_016941.1,gi|379794527|ref|NC_016941.1| -Staphylococcus aureus subsp. aureus MSSA476 chromosome, complete (NC_002953)=NC_002953,NC_002953.3,gi|49484912|ref|NC_002953.3| -Staphylococcus aureus subsp. aureus MSSA476 plasmid pSAS, complete (NC_005951)=NC_005951,NC_005951.1,gi|49398098|ref|NC_005951.1| -Staphylococcus aureus subsp. aureus MW2, complete genome. (NC_003923)=NC_003923,NC_003923.1,gi|21281729|ref|NC_003923.1| -Staphylococcus aureus subsp. aureus Mu3, complete genome. (NC_009782)=NC_009782,NC_009782.1,gi|156978331|ref|NC_009782.1| -Staphylococcus aureus subsp. aureus Mu50 chromosome, complete (NC_002758)=NC_002758,NC_002758.2,gi|57634611|ref|NC_002758.2| -Staphylococcus aureus subsp. aureus Mu50 plasmid VRSAp, complete (NC_002774)=NC_002774,NC_002774.1,gi|14141823|ref|NC_002774.1| -Staphylococcus aureus subsp. aureus N315 plasmid pN315, complete (NC_003140)=NC_003140,NC_003140.1,gi|16119200|ref|NC_003140.1| -Staphylococcus aureus subsp. aureus N315, complete genome. (NC_002745)=NC_002745,NC_002745.2,gi|29165615|ref|NC_002745.2| -Staphylococcus aureus subsp. aureus NCTC 8325 chromosome, complete (NC_007795)=NC_007795,NC_007795.1,gi|88193823|ref|NC_007795.1| -Staphylococcus aureus subsp. aureus str. Newman chromosome, (NC_009641)=NC_009641,NC_009641.1,gi|151220212|ref|NC_009641.1| -Staphylococcus aureus RF122, complete genome. (NC_007622)=NC_007622,NC_007622.1,gi|82749777|ref|NC_007622.1| -Staphylococcus aureus subsp. aureus S0385, complete genome. (NC_017333)=NC_017333,NC_017333.1,gi|387601291|ref|NC_017333.1| -Staphylococcus aureus subsp. aureus ST398 plasmid pS0385-1, (NC_017334)=NC_017334,NC_017334.1,gi|387603991|ref|NC_017334.1| -Staphylococcus aureus subsp. aureus ST398 plasmid pS0385-2, (NC_017335)=NC_017335,NC_017335.1,gi|384551502|ref|NC_017335.1| -Staphylococcus aureus subsp. aureus ST398 plasmid pS0385-3, (NC_017336)=NC_017336,NC_017336.1,gi|387603996|ref|NC_017336.1| -Staphylococcus aureus subsp. aureus T0131 chromosome, complete (NC_017347)=NC_017347,NC_017347.1,gi|384868588|ref|NC_017347.1| -Staphylococcus aureus subsp. aureus TCH60 chromosome, complete (NC_017342)=NC_017342,NC_017342.1,gi|384865886|ref|NC_017342.1| -Staphylococcus aureus subsp. aureus TCH60 plasmid unnamed, complete (NC_017345)=NC_017345,NC_017345.1,gi|384868560|ref|NC_017345.1| -Staphylococcus aureus subsp. aureus TW20 plasmid pTW20_1, complete (NC_017352)=NC_017352,NC_017352.1,gi|387144420|ref|NC_017352.1| -Staphylococcus aureus subsp. aureus TW20 plasmid pTW20_2, complete (NC_017332)=NC_017332,NC_017332.1,gi|387144417|ref|NC_017332.1| -Staphylococcus aureus subsp. aureus TW20, complete genome. (NC_017331)=NC_017331,NC_017331.1,gi|387141638|ref|NC_017331.1| -Staphylococcus aureus subsp. aureus USA300_FPR3757 chromosome, (NC_007793)=NC_007793,NC_007793.1,gi|87159884|ref|NC_007793.1| -Staphylococcus aureus subsp. aureus USA300_FPR3757 plasmid pUSA01, (NC_007790)=NC_007790,NC_007790.1,gi|87159837|ref|NC_007790.1| -Staphylococcus aureus subsp. aureus USA300_FPR3757 plasmid pUSA02, (NC_007791)=NC_007791,NC_007791.1,gi|87159843|ref|NC_007791.1| -Staphylococcus aureus subsp. aureus USA300_FPR3757 plasmid pUSA03, (NC_007792)=NC_007792,NC_007792.1,gi|87159847|ref|NC_007792.1| -Staphylococcus aureus subsp. aureus USA300_TCH1516 chromosome, (NC_010079)=NC_010079,NC_010079.1,gi|161508266|ref|NC_010079.1| -Staphylococcus aureus subsp. aureus USA300_TCH1516 plasmid (NC_010063)=NC_010063,NC_010063.1,gi|161510924|ref|NC_010063.1| -Staphylococcus aureus subsp. aureus USA300_TCH1516 plasmid (NC_012417)=NC_012417,NC_012417.1,gi|225631039|ref|NC_012417.1| -Staphylococcus aureus subsp. aureus VC40 chromosome, complete (NC_016912)=NC_016912,NC_016912.1,gi|379013365|ref|NC_016912.1| -Staphylococcus carnosus subsp. carnosus TM300 chromosome, complete (NC_012121)=NC_012121,NC_012121.1,gi|224475494|ref|NC_012121.1| -Staphylococcus epidermidis ATCC 12228 chromosome, complete genome. (NC_004461)=NC_004461,NC_004461.1,gi|27466918|ref|NC_004461.1| -Staphylococcus epidermidis ATCC 12228 plasmid pSE-12228-01, (NC_005008)=NC_005008,NC_005008.1,gi|32470588|ref|NC_005008.1| -Staphylococcus epidermidis ATCC 12228 plasmid pSE-12228-02, (NC_005007)=NC_005007,NC_005007.1,gi|32470581|ref|NC_005007.1| -Staphylococcus epidermidis ATCC 12228 plasmid pSE-12228-03, (NC_005006)=NC_005006,NC_005006.1,gi|32470572|ref|NC_005006.1| -Staphylococcus epidermidis ATCC 12228 plasmid pSE-12228-04, (NC_005005)=NC_005005,NC_005005.1,gi|32470555|ref|NC_005005.1| -Staphylococcus epidermidis ATCC 12228 plasmid pSE-12228-05, (NC_005004)=NC_005004,NC_005004.1,gi|32470532|ref|NC_005004.1| -Staphylococcus epidermidis ATCC 12228 plasmid pSE-12228-06, (NC_005003)=NC_005003,NC_005003.1,gi|32470520|ref|NC_005003.1| -Staphylococcus epidermidis RP62A plasmid pSERP, complete sequence. (NC_006663)=NC_006663,NC_006663.1,gi|57854744|ref|NC_006663.1| -Staphylococcus epidermidis RP62A, complete genome. (NC_002976)=NC_002976,NC_002976.3,gi|57865352|ref|NC_002976.3| -Staphylococcus haemolyticus JCSC1435 chromosome, complete genome. (NC_007168)=NC_007168,NC_007168.1,gi|70725001|ref|NC_007168.1| -Staphylococcus haemolyticus JCSC1435 plasmid pSHaeA, complete (NC_007169)=NC_007169,NC_007169.1,gi|68535043|ref|NC_007169.1| -Staphylococcus haemolyticus JCSC1435 plasmid pSHaeB, complete (NC_007170)=NC_007170,NC_007170.1,gi|68535047|ref|NC_007170.1| -Staphylococcus haemolyticus JCSC1435 plasmid pSHaeC, complete (NC_007171)=NC_007171,NC_007171.1,gi|68535050|ref|NC_007171.1| -Staphylococcus lugdunensis HKU09-01 chromosome, complete genome. (NC_013893)=NC_013893,NC_013893.1,gi|289549371|ref|NC_013893.1| -Staphylococcus lugdunensis N920143, complete genome. (NC_017353)=NC_017353,NC_017353.1,gi|385782956|ref|NC_017353.1| -Staphylococcus pseudintermedius ED99 chromosome, complete genome. (NC_017568)=NC_017568,NC_017568.1,gi|386318029|ref|NC_017568.1| -Staphylococcus pseudintermedius HKU10-03 chromosome, complete (NC_014925)=NC_014925,NC_014925.1,gi|319891290|ref|NC_014925.1| -Staphylococcus saprophyticus subsp. saprophyticus ATCC 15305 (NC_007351)=NC_007351,NC_007351.1,gi|73663756|ref|NC_007351.1| -Staphylococcus saprophyticus subsp. saprophyticus ATCC 15305 (NC_007352)=NC_007352,NC_007352.1,gi|73663802|ref|NC_007352.1| -Staphylococcus saprophyticus subsp. saprophyticus ATCC 15305, (NC_007350)=NC_007350,NC_007350.1,gi|73661309|ref|NC_007350.1| -Staphylothermus hellenicus DSM 12710 chromosome, complete genome. (NC_014205)=NC_014205,NC_014205.1,gi|297526028|ref|NC_014205.1| -Staphylothermus marinus F1 chromosome, complete genome. (NC_009033)=NC_009033,NC_009033.1,gi|126464913|ref|NC_009033.1| -Starkeya novella DSM 506 chromosome, complete genome. (NC_014217)=NC_014217,NC_014217.1,gi|298290017|ref|NC_014217.1| -Stenotrophomonas maltophilia D457, complete genome. (NC_017671)=NC_017671,NC_017671.1,gi|386716467|ref|NC_017671.1| -Stenotrophomonas maltophilia JV3 chromosome, complete genome. (NC_015947)=NC_015947,NC_015947.1,gi|344205421|ref|NC_015947.1| -Stenotrophomonas maltophilia K279a chromosome, complete genome. (NC_010943)=NC_010943,NC_010943.1,gi|190572091|ref|NC_010943.1| -Stenotrophomonas maltophilia R551-3 chromosome, complete genome. (NC_011071)=NC_011071,NC_011071.1,gi|194363778|ref|NC_011071.1| -Stigmatella aurantiaca DW4/3-1 chromosome, complete genome. (NC_014623)=NC_014623,NC_014623.1,gi|310817278|ref|NC_014623.1| -Streptobacillus moniliformis DSM 12112 chromosome, complete genome. (NC_013515)=NC_013515,NC_013515.1,gi|269122800|ref|NC_013515.1| -Streptobacillus moniliformis DSM 12112 plasmid pSMON01, complete (NC_013516)=NC_013516,NC_013516.1,gi|268687599|ref|NC_013516.1| -Streptococcus agalactiae 2603V/R chromosome, complete genome. (NC_004116)=NC_004116,NC_004116.1,gi|22536185|ref|NC_004116.1| -Streptococcus agalactiae A909 chromosome, complete genome. (NC_007432)=NC_007432,NC_007432.1,gi|76786714|ref|NC_007432.1| -Streptococcus agalactiae NEM316, complete genome. (NC_004368)=NC_004368,NC_004368.1,gi|25010075|ref|NC_004368.1| -Streptococcus dysgalactiae subsp. equisimilis ATCC 12394 (NC_017567)=NC_017567,NC_017567.1,gi|386315972|ref|NC_017567.1| -Streptococcus dysgalactiae subsp. equisimilis GGS_124 chromosome 1, (NC_012891)=NC_012891,NC_012891.1,gi|251781468|ref|NC_012891.1| -Streptococcus equi subsp. equi 4047, complete genome. (NC_012471)=NC_012471,NC_012471.1,gi|225869487|ref|NC_012471.1| -Streptococcus equi subsp. zooepidemicus ATCC 35246 chromosome, (NC_017582)=NC_017582,NC_017582.1,gi|386345754|ref|NC_017582.1| -Streptococcus equi subsp. zooepidemicus MGCS10565, complete genome. (NC_011134)=NC_011134,NC_011134.1,gi|195977156|ref|NC_011134.1| -Streptococcus equi subsp. zooepidemicus, complete genome. (NC_012470)=NC_012470,NC_012470.1,gi|225867617|ref|NC_012470.1| -Streptococcus gallolyticus subsp. gallolyticus ATCC 43143, complete (NC_017576)=NC_017576,NC_017576.1,gi|386336689|ref|NC_017576.1| -Streptococcus gallolyticus subsp. gallolyticus ATCC BAA-2069 (NC_015219)=NC_015219,NC_015219.1,gi|325926838|ref|NC_015219.1| -Streptococcus gallolyticus subsp. gallolyticus ATCC BAA-2069, (NC_015215)=NC_015215,NC_015215.1,gi|325977200|ref|NC_015215.1| -Streptococcus gallolyticus UCN34, complete genome. (NC_013798)=NC_013798,NC_013798.1,gi|288904223|ref|NC_013798.1| -Streptococcus gordonii str. Challis substr. CH1 chromosome, (NC_009785)=NC_009785,NC_009785.1,gi|157149651|ref|NC_009785.1| -Streptococcus infantarius subsp. infantarius CJ18 chromosome, (NC_016826)=NC_016826,NC_016826.1,gi|379704392|ref|NC_016826.1| -Streptococcus infantarius subsp. infantarius CJ18 plasmid (NC_016837)=NC_016837,NC_016837.1,gi|379704341|ref|NC_016837.1| -Streptococcus intermedius JTH08, complete genome. (NC_018073)=NC_018073,NC_018073.1,gi|392427891|ref|NC_018073.1| -Streptococcus macedonicus ACA-DC 198, complete genome. (NC_016749)=NC_016749,NC_016749.1,gi|374337044|ref|NC_016749.1| -Streptococcus macedonicus plasmid pSMA198, complete sequence. (NC_016750)=NC_016750,NC_016750.1,gi|373248555|ref|NC_016750.1| -Streptococcus mitis B6, complete genome. (NC_013853)=NC_013853,NC_013853.1,gi|289166909|ref|NC_013853.1| -Streptococcus mutans GS-5 chromosome, complete genome. (NC_018089)=NC_018089,NC_018089.1,gi|397648808|ref|NC_018089.1| -Streptococcus mutans LJ23, complete genome. (NC_017768)=NC_017768,NC_017768.1,gi|387785181|ref|NC_017768.1| -Streptococcus mutans NN2025, complete genome. (NC_013928)=NC_013928,NC_013928.1,gi|290579526|ref|NC_013928.1| -Streptococcus mutans UA159 chromosome, complete genome. (NC_004350)=NC_004350,NC_004350.2,gi|347750429|ref|NC_004350.2| -Streptococcus oralis Uo5, complete genome. (NC_015291)=NC_015291,NC_015291.1,gi|331265438|ref|NC_015291.1| -Streptococcus parasanguinis ATCC 15912 chromosome, complete genome. (NC_015678)=NC_015678,NC_015678.1,gi|337281488|ref|NC_015678.1| -Streptococcus parasanguinis FW213 chromosome, complete genome. (NC_017905)=NC_017905,NC_017905.1,gi|387878539|ref|NC_017905.1| -Streptococcus parauberis KCTC 11537 chromosome, complete genome. (NC_015558)=NC_015558,NC_015558.1,gi|333904249|ref|NC_015558.1| -Streptococcus pasteurianus ATCC 43144, complete genome. (NC_015600)=NC_015600,NC_015600.1,gi|336063372|ref|NC_015600.1| -Streptococcus pneumoniae 670-6B chromosome, complete genome. (NC_014498)=NC_014498,NC_014498.1,gi|307126151|ref|NC_014498.1| -Streptococcus pneumoniae 70585, complete genome. (NC_012468)=NC_012468,NC_012468.1,gi|225857809|ref|NC_012468.1| -Streptococcus pneumoniae AP200 chromosome, complete genome. (NC_014494)=NC_014494,NC_014494.1,gi|307066636|ref|NC_014494.1| -Streptococcus pneumoniae ATCC 700669, complete genome. (NC_011900)=NC_011900,NC_011900.1,gi|221230948|ref|NC_011900.1| -Streptococcus pneumoniae CGSP14 chromosome, complete genome. (NC_010582)=NC_010582,NC_010582.1,gi|182682970|ref|NC_010582.1| -Streptococcus pneumoniae D39 chromosome, complete genome. (NC_008533)=NC_008533,NC_008533.1,gi|116515308|ref|NC_008533.1| -Streptococcus pneumoniae G54 chromosome, complete genome. (NC_011072)=NC_011072,NC_011072.1,gi|194396645|ref|NC_011072.1| -Streptococcus pneumoniae Hungary19A-6, complete genome. (NC_010380)=NC_010380,NC_010380.1,gi|169832377|ref|NC_010380.1| -Streptococcus pneumoniae INV104, complete genome. (NC_017591)=NC_017591,NC_017591.1,gi|387625543|ref|NC_017591.1| -Streptococcus pneumoniae INV200, complete genome. (NC_017593)=NC_017593,NC_017593.1,gi|387758384|ref|NC_017593.1| -Streptococcus pneumoniae JJA, complete genome. (NC_012466)=NC_012466,NC_012466.1,gi|225853611|ref|NC_012466.1| -Streptococcus pneumoniae OXC141, complete genome. (NC_017592)=NC_017592,NC_017592.1,gi|387756560|ref|NC_017592.1| -Streptococcus pneumoniae P1031, complete genome. (NC_012467)=NC_012467,NC_012467.1,gi|225855735|ref|NC_012467.1| -Streptococcus pneumoniae R6, complete genome. (NC_003098)=NC_003098,NC_003098.1,gi|15902044|ref|NC_003098.1| -Streptococcus pneumoniae ST556 chromosome, complete genome. (NC_017769)=NC_017769,NC_017769.1,gi|387787130|ref|NC_017769.1| -Streptococcus pneumoniae TCH8431/19A chromosome, complete genome. (NC_014251)=NC_014251,NC_014251.1,gi|298501502|ref|NC_014251.1| -Streptococcus pneumoniae TIGR4 chromosome, complete genome. (NC_003028)=NC_003028,NC_003028.3,gi|194172857|ref|NC_003028.3| -Streptococcus pneumoniae Taiwan19F-14, complete genome. (NC_012469)=NC_012469,NC_012469.1,gi|225860012|ref|NC_012469.1| -Streptococcus pseudopneumoniae IS7493 chromosome, complete genome. (NC_015875)=NC_015875,NC_015875.1,gi|342162671|ref|NC_015875.1| -Streptococcus pseudopneumoniae IS7493 plasmid pDRPIS7493, complete (NC_015876)=NC_015876,NC_015876.1,gi|342164902|ref|NC_015876.1| -Streptococcus pyogenes Alab49 chromosome, complete genome. (NC_017596)=NC_017596,NC_017596.1,gi|386361880|ref|NC_017596.1| -Streptococcus pyogenes M1 GAS chromosome, complete genome. (NC_002737)=NC_002737,NC_002737.1,gi|15674250|ref|NC_002737.1| -Streptococcus pyogenes MGAS10270 chromosome, complete genome. (NC_008022)=NC_008022,NC_008022.1,gi|94989509|ref|NC_008022.1| -Streptococcus pyogenes MGAS10394 chromosome, complete genome. (NC_006086)=NC_006086,NC_006086.1,gi|50913346|ref|NC_006086.1| -Streptococcus pyogenes MGAS10750 chromosome, complete genome. (NC_008024)=NC_008024,NC_008024.1,gi|94993396|ref|NC_008024.1| -Streptococcus pyogenes MGAS15252 chromosome, complete genome. (NC_017040)=NC_017040,NC_017040.1,gi|383479207|ref|NC_017040.1| -Streptococcus pyogenes MGAS1882 chromosome, complete genome. (NC_017053)=NC_017053,NC_017053.1,gi|383493132|ref|NC_017053.1| -Streptococcus pyogenes MGAS2096 chromosome, complete genome. (NC_008023)=NC_008023,NC_008023.1,gi|94991497|ref|NC_008023.1| -Streptococcus pyogenes MGAS315 chromosome, complete genome. (NC_004070)=NC_004070,NC_004070.1,gi|21909536|ref|NC_004070.1| -Streptococcus pyogenes MGAS5005 chromosome, complete genome. (NC_007297)=NC_007297,NC_007297.1,gi|71909814|ref|NC_007297.1| -Streptococcus pyogenes MGAS6180 chromosome, complete genome. (NC_007296)=NC_007296,NC_007296.1,gi|71902667|ref|NC_007296.1| -Streptococcus pyogenes MGAS8232 chromosome, complete genome. (NC_003485)=NC_003485,NC_003485.1,gi|19745201|ref|NC_003485.1| -Streptococcus pyogenes MGAS9429 chromosome, complete genome. (NC_008021)=NC_008021,NC_008021.1,gi|94987631|ref|NC_008021.1| -Streptococcus pyogenes str. Manfredo chromosome, complete genome. (NC_009332)=NC_009332,NC_009332.1,gi|139472888|ref|NC_009332.1| -Streptococcus pyogenes NZ131 chromosome, complete genome. (NC_011375)=NC_011375,NC_011375.1,gi|209558587|ref|NC_011375.1| -Streptococcus pyogenes SSI-1 chromosome, complete genome. (NC_004606)=NC_004606,NC_004606.1,gi|28894912|ref|NC_004606.1| -Streptococcus salivarius 57.I chromosome, complete genome. (NC_017594)=NC_017594,NC_017594.1,gi|387760314|ref|NC_017594.1| -Streptococcus salivarius CCHSS3, complete genome. (NC_015760)=NC_015760,NC_015760.1,gi|340397867|ref|NC_015760.1| -Streptococcus salivarius JIM8777, complete genome. (NC_017595)=NC_017595,NC_017595.1,gi|387783149|ref|NC_017595.1| -Streptococcus sanguinis SK36 chromosome, complete genome. (NC_009009)=NC_009009,NC_009009.1,gi|125716887|ref|NC_009009.1| -Streptococcus suis 05ZYH33, complete genome. (NC_009442)=NC_009442,NC_009442.1,gi|146317663|ref|NC_009442.1| -Streptococcus suis 98HAH33, complete genome. (NC_009443)=NC_009443,NC_009443.1,gi|146319850|ref|NC_009443.1| -Streptococcus suis A7 chromosome, complete genome. (NC_017622)=NC_017622,NC_017622.1,gi|386587281|ref|NC_017622.1| -Streptococcus suis BM407 chromosome, complete genome. (NC_012926)=NC_012926,NC_012926.1,gi|253754647|ref|NC_012926.1| -Streptococcus suis BM407 plasmid pBM407, complete sequence. (NC_012923)=NC_012923,NC_012923.1,gi|253750612|ref|NC_012923.1| -Streptococcus suis D12 chromosome, complete genome. (NC_017621)=NC_017621,NC_017621.1,gi|386585202|ref|NC_017621.1| -Streptococcus suis D9 chromosome, complete genome. (NC_017620)=NC_017620,NC_017620.1,gi|386583127|ref|NC_017620.1| -Streptococcus suis GZ1 chromosome, complete genome. (NC_017617)=NC_017617,NC_017617.1,gi|386577002|ref|NC_017617.1| -Streptococcus suis JS14 chromosome, complete genome. (NC_017618)=NC_017618,NC_017618.1,gi|386578980|ref|NC_017618.1| -Streptococcus suis P1/7, complete genome. (NC_012925)=NC_012925,NC_012925.1,gi|253752822|ref|NC_012925.1| -Streptococcus suis SC84, complete genome. (NC_012924)=NC_012924,NC_012924.1,gi|253750923|ref|NC_012924.1| -Streptococcus suis SS12 chromosome, complete genome. (NC_017619)=NC_017619,NC_017619.1,gi|386581047|ref|NC_017619.1| -Streptococcus suis ST1 chromosome, complete genome. (NC_017950)=NC_017950,NC_017950.1,gi|389855709|ref|NC_017950.1| -Streptococcus suis ST3 chromosome, complete genome. (NC_015433)=NC_015433,NC_015433.1,gi|330831849|ref|NC_015433.1| -Streptococcus thermophilus CNRZ1066 chromosome, complete genome. (NC_006449)=NC_006449,NC_006449.1,gi|55821993|ref|NC_006449.1| -Streptococcus thermophilus JIM 8232, complete genome. (NC_017581)=NC_017581,NC_017581.1,gi|386343608|ref|NC_017581.1| -Streptococcus thermophilus LMD-9 plasmid 1, complete sequence. (NC_008500)=NC_008500,NC_008500.1,gi|116326679|ref|NC_008500.1| -Streptococcus thermophilus LMD-9 plasmid 2, complete sequence. (NC_008501)=NC_008501,NC_008501.1,gi|116326684|ref|NC_008501.1| -Streptococcus thermophilus LMD-9, complete genome. (NC_008532)=NC_008532,NC_008532.1,gi|116626972|ref|NC_008532.1| -Streptococcus thermophilus LMG 18311 chromosome, complete genome. (NC_006448)=NC_006448,NC_006448.1,gi|55820103|ref|NC_006448.1| -Streptococcus thermophilus MN-ZLW-002 chromosome, complete genome. (NC_017927)=NC_017927,NC_017927.1,gi|387908808|ref|NC_017927.1| -Streptococcus thermophilus ND03 chromosome, complete genome. (NC_017563)=NC_017563,NC_017563.1,gi|386085705|ref|NC_017563.1| -Streptococcus uberis 0140J chromosome, complete genome. (NC_012004)=NC_012004,NC_012004.1,gi|222152201|ref|NC_012004.1| -Streptomyces sp. SirexAA-E chromosome, complete genome. (NC_015953)=NC_015953,NC_015953.1,gi|344997652|ref|NC_015953.1| -Streptomyces avermitilis MA-4680 plasmid SAP1, complete sequence. (NC_004719)=NC_004719,NC_004719.1,gi|29826443|ref|NC_004719.1| -Streptomyces avermitilis MA-4680, complete genome. (NC_003155)=NC_003155,NC_003155.4,gi|162960844|ref|NC_003155.4| -Streptomyces bingchenggensis BCW-1 chromosome, complete genome. (NC_016582)=NC_016582,NC_016582.1,gi|374982757|ref|NC_016582.1| -Streptomyces cattleya NRRL 8057 = DSM 46488 chromosome, complete (NC_017586)=NC_017586,NC_017586.1,gi|386353647|ref|NC_017586.1| -Streptomyces cattleya NRRL 8057 = DSM 46488 plasmid pSCATT, (NC_017585)=NC_017585,NC_017585.1,gi|386351899|ref|NC_017585.1| -Streptomyces cattleya NRRL 8057 plasmid pSCAT, complete sequence. (NC_016113)=NC_016113,NC_016113.1,gi|357407371|ref|NC_016113.1| -Streptomyces cattleya NRRL 8057, complete genome. (NC_016111)=NC_016111,NC_016111.1,gi|357397620|ref|NC_016111.1| -Streptomyces coelicolor A3(2) chromosome, complete genome. (NC_003888)=NC_003888,NC_003888.3,gi|32141095|ref|NC_003888.3| -Streptomyces coelicolor A3(2) plasmid SCP1, complete sequence. (NC_003903)=NC_003903,NC_003903.1,gi|21233999|ref|NC_003903.1| -Streptomyces coelicolor A3(2) plasmid SCP2, complete sequence. (NC_003904)=NC_003904,NC_003904.1,gi|21233964|ref|NC_003904.1| -Streptomyces flavogriseus ATCC 33331 chromosome, complete genome. (NC_016114)=NC_016114,NC_016114.1,gi|357409266|ref|NC_016114.1| -Streptomyces flavogriseus ATCC 33331 plasmid pSFLA01, complete (NC_016110)=NC_016110,NC_016110.1,gi|357409092|ref|NC_016110.1| -Streptomyces flavogriseus ATCC 33331 plasmid pSFLA02, complete (NC_016115)=NC_016115,NC_016115.1,gi|357415565|ref|NC_016115.1| -Streptomyces griseus subsp. griseus NBRC 13350 chromosome, complete (NC_010572)=NC_010572,NC_010572.1,gi|182433793|ref|NC_010572.1| -Streptomyces hygroscopicus subsp. jinggangensis 5008 chromosome, (NC_017765)=NC_017765,NC_017765.1,gi|386836097|ref|NC_017765.1| -Streptomyces hygroscopicus subsp. jinggangensis 5008 plasmid (NC_016972)=NC_016972,NC_016972.1,gi|386836021|ref|NC_016972.1| -Streptomyces hygroscopicus subsp. jinggangensis 5008 plasmid (NC_017766)=NC_017766,NC_017766.1,gi|386835836|ref|NC_017766.1| -Streptomyces scabiei 87.22 chromosome, complete genome. (NC_013929)=NC_013929,NC_013929.1,gi|290954631|ref|NC_013929.1| -Streptomyces violaceusniger Tu 4113 chromosome, complete genome. (NC_015957)=NC_015957,NC_015957.1,gi|345007964|ref|NC_015957.1| -Streptomyces violaceusniger Tu 4113 plasmid pSTRVI01, complete (NC_015951)=NC_015951,NC_015951.1,gi|345007457|ref|NC_015951.1| -Streptomyces violaceusniger Tu 4113 plasmid pSTRVI02, complete (NC_015952)=NC_015952,NC_015952.1,gi|345007715|ref|NC_015952.1| -Streptosporangium roseum DSM 43021 chromosome, complete genome. (NC_013595)=NC_013595,NC_013595.1,gi|271961609|ref|NC_013595.1| -Streptosporangium roseum DSM 43021 plasmid pSROS01, complete (NC_013596)=NC_013596,NC_013596.1,gi|271972120|ref|NC_013596.1| -Sulfobacillus acidophilus DSM 10332 chromosome, complete genome. (NC_016884)=NC_016884,NC_016884.1,gi|379005799|ref|NC_016884.1| -Sulfobacillus acidophilus DSM 10332 plasmid unnamed, complete (NC_016888)=NC_016888,NC_016888.1,gi|379009184|ref|NC_016888.1| -Sulfobacillus acidophilus TPY chromosome, complete genome. (NC_015757)=NC_015757,NC_015757.1,gi|339626328|ref|NC_015757.1| -Sulfolobus acidocaldarius DSM 639 chromosome, complete genome. (NC_007181)=NC_007181,NC_007181.1,gi|70605853|ref|NC_007181.1| -Sulfolobus islandicus HVE10/4 chromosome, complete genome. (NC_017275)=NC_017275,NC_017275.1,gi|385772020|ref|NC_017275.1| -Sulfolobus islandicus L.D.8.5 chromosome, complete genome. (NC_013769)=NC_013769,NC_013769.1,gi|284996407|ref|NC_013769.1| -Sulfolobus islandicus L.D.8.5 plasmid pLD8501, complete sequence. (NC_013770)=NC_013770,NC_013770.1,gi|284807103|ref|NC_013770.1| -Sulfolobus islandicus L.S.2.15 chromosome, complete genome. (NC_012589)=NC_012589,NC_012589.1,gi|227829020|ref|NC_012589.1| -Sulfolobus islandicus M.14.25 chromosome, complete genome. (NC_012588)=NC_012588,NC_012588.1,gi|227826411|ref|NC_012588.1| -Sulfolobus islandicus M.16.27 chromosome, complete genome. (NC_012632)=NC_012632,NC_012632.1,gi|229583573|ref|NC_012632.1| -Sulfolobus islandicus M.16.4 chromosome, complete genome. (NC_012726)=NC_012726,NC_012726.1,gi|238618479|ref|NC_012726.1| -Sulfolobus islandicus REY15A chromosome, complete genome. (NC_017276)=NC_017276,NC_017276.1,gi|385774741|ref|NC_017276.1| -Sulfolobus islandicus Y.G.57.14 chromosome, complete genome. (NC_012622)=NC_012622,NC_012622.1,gi|229577818|ref|NC_012622.1| -Sulfolobus islandicus Y.N.15.51 chromosome, complete genome. (NC_012623)=NC_012623,NC_012623.1,gi|229580722|ref|NC_012623.1| -Sulfolobus islandicus Y.N.15.51 plasmid pYN01, complete sequence. (NC_012624)=NC_012624,NC_012624.1,gi|228288719|ref|NC_012624.1| -Sulfolobus solfataricus 98/2 chromosome, complete genome. (NC_017274)=NC_017274,NC_017274.1,gi|384432549|ref|NC_017274.1| -Sulfolobus solfataricus P2 chromosome, complete genome. (NC_002754)=NC_002754,NC_002754.1,gi|15896971|ref|NC_002754.1| -Sulfolobus tokodaii str. 7 chromosome, complete genome. (NC_003106)=NC_003106,NC_003106.2,gi|24473558|ref|NC_003106.2| -Sulfuricurvum kujiense DSM 16994 chromosome, complete genome. (NC_014762)=NC_014762,NC_014762.1,gi|313681130|ref|NC_014762.1| -Sulfuricurvum kujiense DSM 16994 plasmid pSULKU01, complete (NC_014754)=NC_014754,NC_014754.1,gi|313669332|ref|NC_014754.1| -Sulfuricurvum kujiense DSM 16994 plasmid pSULKU02, complete (NC_014755)=NC_014755,NC_014755.1,gi|313669445|ref|NC_014755.1| -Sulfuricurvum kujiense DSM 16994 plasmid pSULKU03, complete (NC_014756)=NC_014756,NC_014756.1,gi|313669532|ref|NC_014756.1| -Sulfuricurvum kujiense DSM 16994 plasmid pSULKU04, complete (NC_014763)=NC_014763,NC_014763.1,gi|313569999|ref|NC_014763.1| -Sulfurihydrogenibium sp. YO3AOP1 chromosome, complete genome. (NC_010730)=NC_010730,NC_010730.1,gi|188995955|ref|NC_010730.1| -Sulfurihydrogenibium azorense Az-Fu1 chromosome, complete genome. (NC_012438)=NC_012438,NC_012438.1,gi|225847840|ref|NC_012438.1| -Sulfurimonas autotrophica DSM 16294 chromosome, complete genome. (NC_014506)=NC_014506,NC_014506.1,gi|307719921|ref|NC_014506.1| -Sulfurimonas denitrificans DSM 1251 chromosome, complete genome. (NC_007575)=NC_007575,NC_007575.1,gi|78776201|ref|NC_007575.1| -Sulfurospirillum barnesii SES-3 chromosome, complete genome. (NC_018002)=NC_018002,NC_018002.1,gi|390939174|ref|NC_018002.1| -Sulfurospirillum deleyianum DSM 6946 chromosome, complete genome. (NC_013512)=NC_013512,NC_013512.1,gi|268678642|ref|NC_013512.1| -Sulfurovum sp. NBC37-1 chromosome, complete genome. (NC_009663)=NC_009663,NC_009663.1,gi|152991597|ref|NC_009663.1| -Symbiobacterium thermophilum IAM 14863 chromosome, complete genome. (NC_006177)=NC_006177,NC_006177.1,gi|51891138|ref|NC_006177.1| -Synechococcus sp. CC9311, complete genome. (NC_008319)=NC_008319,NC_008319.1,gi|113952711|ref|NC_008319.1| -Synechococcus sp. CC9605, complete genome. (NC_007516)=NC_007516,NC_007516.1,gi|78211558|ref|NC_007516.1| -Synechococcus sp. CC9902 chromosome, complete genome. (NC_007513)=NC_007513,NC_007513.1,gi|78183584|ref|NC_007513.1| -Synechococcus sp. JA-2-3B'a(2-13) chromosome, complete genome. (NC_007776)=NC_007776,NC_007776.1,gi|86607503|ref|NC_007776.1| -Synechococcus sp. JA-3-3Ab chromosome, complete genome. (NC_007775)=NC_007775,NC_007775.1,gi|86604733|ref|NC_007775.1| -Synechococcus sp. PCC 7002 chromosome, complete genome. (NC_010475)=NC_010475,NC_010475.1,gi|170076636|ref|NC_010475.1| -Synechococcus sp. PCC 7002 plasmid pAQ1, complete sequence. (NC_010476)=NC_010476,NC_010476.1,gi|170079460|ref|NC_010476.1| -Synechococcus sp. PCC 7002 plasmid pAQ3, complete sequence. (NC_010477)=NC_010477,NC_010477.1,gi|170079464|ref|NC_010477.1| -Synechococcus sp. PCC 7002 plasmid pAQ4, complete sequence. (NC_010478)=NC_010478,NC_010478.1,gi|170079482|ref|NC_010478.1| -Synechococcus sp. PCC 7002 plasmid pAQ5, complete sequence. (NC_010479)=NC_010479,NC_010479.1,gi|170079513|ref|NC_010479.1| -Synechococcus sp. PCC 7002 plasmid pAQ6, complete sequence. (NC_010480)=NC_010480,NC_010480.1,gi|170079553|ref|NC_010480.1| -Synechococcus sp. PCC 7002 plasmid pAQ7, complete sequence. (NC_010474)=NC_010474,NC_010474.1,gi|170076470|ref|NC_010474.1| -Synechococcus sp. RCC307 chromosome, complete genome. (NC_009482)=NC_009482,NC_009482.1,gi|148241099|ref|NC_009482.1| -Synechococcus sp. WH 7803 chromosome, complete genome. (NC_009481)=NC_009481,NC_009481.1,gi|148238336|ref|NC_009481.1| -Synechococcus sp. WH 8102, complete genome. (NC_005070)=NC_005070,NC_005070.1,gi|33864539|ref|NC_005070.1| -Synechococcus elongatus PCC 6301 chromosome, complete genome. (NC_006576)=NC_006576,NC_006576.1,gi|56750010|ref|NC_006576.1| -Synechococcus elongatus PCC 7942 chromosome, complete genome. (NC_007604)=NC_007604,NC_007604.1,gi|81298811|ref|NC_007604.1| -Synechococcus elongatus PCC 7942 plasmid 1, complete sequence. (NC_007595)=NC_007595,NC_007595.1,gi|81230333|ref|NC_007595.1| -Synechocystis sp. PCC 6803 substr. PCC-N, complete genome. (NC_017052)=NC_017052,NC_017052.1,gi|383489963|ref|NC_017052.1| -Synechocystis sp. PCC 6803 substr. PCC-P, complete genome. (NC_017039)=NC_017039,NC_017039.1,gi|383324079|ref|NC_017039.1| -Synechocystis sp. PCC 6803 substr. GT-I, complete genome. (NC_017038)=NC_017038,NC_017038.1,gi|383320909|ref|NC_017038.1| -Synechocystis sp. PCC 6803, complete genome. (NC_017277)=NC_017277,NC_017277.1,gi|384435229|ref|NC_017277.1| -Synechocystis sp. PCC 6803 chromosome, complete genome. (NC_000911)=NC_000911,NC_000911.1,gi|16329170|ref|NC_000911.1| -Synechocystis sp. PCC 6803 plasmid pSYSA, complete sequence. (NC_005230)=NC_005230,NC_005230.1,gi|38505668|ref|NC_005230.1| -Synechocystis sp. PCC 6803 plasmid pSYSG, complete sequence. (NC_005231)=NC_005231,NC_005231.1,gi|38505775|ref|NC_005231.1| -Synechocystis sp. PCC 6803 plasmid pSYSM, complete sequence. (NC_005229)=NC_005229,NC_005229.1,gi|38505535|ref|NC_005229.1| -Synechocystis sp. PCC 6803 plasmid pSYSX, complete sequence. (NC_005232)=NC_005232,NC_005232.1,gi|38505825|ref|NC_005232.1| -Syntrophobacter fumaroxidans MPOB chromosome, complete genome. (NC_008554)=NC_008554,NC_008554.1,gi|116747452|ref|NC_008554.1| -Syntrophobotulus glycolicus DSM 8271 chromosome, complete genome. (NC_015172)=NC_015172,NC_015172.1,gi|325288201|ref|NC_015172.1| -Syntrophomonas wolfei subsp. wolfei str. Goettingen chromosome, (NC_008346)=NC_008346,NC_008346.1,gi|114565576|ref|NC_008346.1| -Syntrophothermus lipocalidus DSM 12680 chromosome, complete genome. (NC_014220)=NC_014220,NC_014220.1,gi|297616214|ref|NC_014220.1| -Syntrophus aciditrophicus SB chromosome, complete genome. (NC_007759)=NC_007759,NC_007759.1,gi|85857845|ref|NC_007759.1| -Tannerella forsythia ATCC 43037 chromosome, complete genome. (NC_016610)=NC_016610,NC_016610.1,gi|375253814|ref|NC_016610.1| -Taylorella asinigenitalis MCE3 chromosome, complete genome. (NC_016043)=NC_016043,NC_016043.1,gi|348589352|ref|NC_016043.1| -Taylorella equigenitalis ATCC 35865 chromosome, complete genome. (NC_018108)=NC_018108,NC_018108.1,gi|397661013|ref|NC_018108.1| -Taylorella equigenitalis MCE9 chromosome, complete genome. (NC_014914)=NC_014914,NC_014914.1,gi|319778189|ref|NC_014914.1| -Tepidanaerobacter sp. Re1 chromosome, complete genome. (NC_015519)=NC_015519,NC_015519.1,gi|332798023|ref|NC_015519.1| -Teredinibacter turnerae T7901 chromosome, complete genome. (NC_012997)=NC_012997,NC_012997.1,gi|254784273|ref|NC_012997.1| -Terriglobus roseus DSM 18391 chromosome, complete genome. (NC_018014)=NC_018014,NC_018014.1,gi|390955930|ref|NC_018014.1| -Terriglobus saanensis SP1PR4 chromosome, complete genome. (NC_014963)=NC_014963,NC_014963.1,gi|320105246|ref|NC_014963.1| -Tetragenococcus halophilus NBRC 12172, complete genome. (NC_016052)=NC_016052,NC_016052.1,gi|352516173|ref|NC_016052.1| -Thauera sp. MZ1T chromosome, complete genome. (NC_011662)=NC_011662,NC_011662.2,gi|237653092|ref|NC_011662.2| -Thauera sp. MZ1T plasmid pTha01, complete sequence. (NC_011667)=NC_011667,NC_011667.1,gi|217980115|ref|NC_011667.1| -Thermaerobacter marianensis DSM 12885 chromosome, complete genome. (NC_014831)=NC_014831,NC_014831.1,gi|317120849|ref|NC_014831.1| -Thermanaerovibrio acidaminovorans DSM 6589 chromosome, complete (NC_013522)=NC_013522,NC_013522.1,gi|269791619|ref|NC_013522.1| -Thermincola potens JR chromosome, complete genome. (NC_014152)=NC_014152,NC_014152.1,gi|296131550|ref|NC_014152.1| -Thermoanaerobacter sp. X513 chromosome, complete genome. (NC_014538)=NC_014538,NC_014538.1,gi|307723218|ref|NC_014538.1| -Thermoanaerobacter sp. X514 chromosome, complete genome. (NC_010320)=NC_010320,NC_010320.1,gi|167038675|ref|NC_010320.1| -Thermoanaerobacter brockii subsp. finnii Ako-1 chromosome, complete (NC_014964)=NC_014964,NC_014964.1,gi|320114857|ref|NC_014964.1| -Thermoanaerobacter italicus Ab9 chromosome, complete genome. (NC_013921)=NC_013921,NC_013921.1,gi|289577265|ref|NC_013921.1| -Thermoanaerobacter mathranii subsp. mathranii str. A3 chromosome, (NC_014209)=NC_014209,NC_014209.1,gi|297543498|ref|NC_014209.1| -Thermoanaerobacter pseudethanolicus ATCC 33223 chromosome, complete (NC_010321)=NC_010321,NC_010321.1,gi|167036431|ref|NC_010321.1| -Thermoanaerobacter tengcongensis MB4, complete genome. (NC_003869)=NC_003869,NC_003869.1,gi|20806542|ref|NC_003869.1| -Thermoanaerobacter wiegelii Rt8.B1 chromosome, complete genome. (NC_015958)=NC_015958,NC_015958.1,gi|345016447|ref|NC_015958.1| -Thermoanaerobacterium thermosaccharolyticum DSM 571 chromosome, (NC_014410)=NC_014410,NC_014410.1,gi|304315537|ref|NC_014410.1| -Thermoanaerobacterium xylanolyticum LX-11 chromosome, complete (NC_015555)=NC_015555,NC_015555.1,gi|333895862|ref|NC_015555.1| -Thermobaculum terrenum ATCC BAA-798 chromosome 1, complete (NC_013525)=NC_013525,NC_013525.1,gi|269925123|ref|NC_013525.1| -Thermobaculum terrenum ATCC BAA-798 chromosome 2, complete (NC_013526)=NC_013526,NC_013526.1,gi|269838913|ref|NC_013526.1| -Thermobifida fusca YX chromosome, complete genome. (NC_007333)=NC_007333,NC_007333.1,gi|72160406|ref|NC_007333.1| -Thermobispora bispora DSM 43833 chromosome, complete genome. (NC_014165)=NC_014165,NC_014165.1,gi|296267998|ref|NC_014165.1| -Thermococcus sp. 4557 chromosome, complete genome. (NC_015865)=NC_015865,NC_015865.1,gi|341581088|ref|NC_015865.1| -Thermococcus sp. AM4 chromosome, complete genome. (NC_016051)=NC_016051,NC_016051.1,gi|350525682|ref|NC_016051.1| -Thermococcus sp. CL1 chromosome, complete genome. (NC_018015)=NC_018015,NC_018015.1,gi|390960176|ref|NC_018015.1| -Thermococcus barophilus MP chromosome, complete genome. (NC_014804)=NC_014804,NC_014804.1,gi|315229765|ref|NC_014804.1| -Thermococcus barophilus MP plasmid pTBMP1, complete sequence. (NC_015471)=NC_015471,NC_015471.1,gi|331746790|ref|NC_015471.1| -Thermococcus gammatolerans EJ3 chromosome, complete genome. (NC_012804)=NC_012804,NC_012804.1,gi|240102057|ref|NC_012804.1| -Thermococcus kodakarensis KOD1 chromosome, complete genome. (NC_006624)=NC_006624,NC_006624.1,gi|57639935|ref|NC_006624.1| -Thermococcus onnurineus NA1 chromosome, complete genome. (NC_011529)=NC_011529,NC_011529.1,gi|212223144|ref|NC_011529.1| -Thermococcus sibiricus MM 739, complete genome. (NC_012883)=NC_012883,NC_012883.1,gi|242397997|ref|NC_012883.1| -Thermocrinis albus DSM 14484 chromosome, complete genome. (NC_013894)=NC_013894,NC_013894.1,gi|289547777|ref|NC_013894.1| -Thermodesulfatator indicus DSM 15286 chromosome, complete genome. (NC_015681)=NC_015681,NC_015681.1,gi|337285377|ref|NC_015681.1| -Thermodesulfobacterium sp. OPB45 chromosome, complete genome. (NC_015682)=NC_015682,NC_015682.1,gi|337287573|ref|NC_015682.1| -Thermodesulfobium narugense DSM 14796 chromosome, complete genome. (NC_015499)=NC_015499,NC_015499.1,gi|332294861|ref|NC_015499.1| -Thermodesulfovibrio yellowstonii DSM 11347, complete genome. (NC_011296)=NC_011296,NC_011296.1,gi|206889172|ref|NC_011296.1| -Thermofilum pendens Hrk 5 chromosome, complete genome. (NC_008698)=NC_008698,NC_008698.1,gi|119718918|ref|NC_008698.1| -Thermofilum pendens Hrk 5 plasmid pTPEN01, complete sequence. (NC_008696)=NC_008696,NC_008696.1,gi|119709757|ref|NC_008696.1| -Thermogladius sp. 1633 chromosome, complete genome. (NC_017954)=NC_017954,NC_017954.1,gi|389860324|ref|NC_017954.1| -Thermomicrobium roseum DSM 5159 chromosome, complete genome. (NC_011959)=NC_011959,NC_011959.1,gi|221632037|ref|NC_011959.1| -Thermomicrobium roseum DSM 5159 plasmid unnamed, complete sequence. (NC_011961)=NC_011961,NC_011961.1,gi|221635406|ref|NC_011961.1| -Thermomonospora curvata DSM 43183 chromosome, complete genome. (NC_013510)=NC_013510,NC_013510.1,gi|269124277|ref|NC_013510.1| -Thermoplasma acidophilum DSM 1728 chromosome, complete genome. (NC_002578)=NC_002578,NC_002578.1,gi|16081186|ref|NC_002578.1| -Thermoplasma volcanium GSS1 chromosome, complete genome. (NC_002689)=NC_002689,NC_002689.2,gi|13540831|ref|NC_002689.2| -Thermoproteus neutrophilus V24Sta chromosome, complete genome. (NC_010525)=NC_010525,NC_010525.1,gi|171184485|ref|NC_010525.1| -Thermoproteus tenax Kra 1, complete genome. (NC_016070)=NC_016070,NC_016070.1,gi|352681234|ref|NC_016070.1| -Thermoproteus uzoniensis 768-20 chromosome, complete genome. (NC_015315)=NC_015315,NC_015315.1,gi|327309922|ref|NC_015315.1| -Thermosediminibacter oceani DSM 16646 chromosome, complete genome. (NC_014377)=NC_014377,NC_014377.1,gi|302388599|ref|NC_014377.1| -Thermosipho africanus TCF52B, complete genome. (NC_011653)=NC_011653,NC_011653.1,gi|217076133|ref|NC_011653.1| -Thermosipho melanesiensis BI429 chromosome, complete genome. (NC_009616)=NC_009616,NC_009616.1,gi|150019913|ref|NC_009616.1| -Thermosphaera aggregans DSM 11486 chromosome, complete genome. (NC_014160)=NC_014160,NC_014160.1,gi|296241748|ref|NC_014160.1| -Thermosynechococcus elongatus BP-1 chromosome, complete genome. (NC_004113)=NC_004113,NC_004113.1,gi|22297544|ref|NC_004113.1| -Thermotoga sp. RQ2 chromosome, complete genome. (NC_010483)=NC_010483,NC_010483.1,gi|170287807|ref|NC_010483.1| -Thermotoga lettingae TMO chromosome, complete genome. (NC_009828)=NC_009828,NC_009828.1,gi|157362870|ref|NC_009828.1| -Thermotoga maritima MSB8 chromosome, complete genome. (NC_000853)=NC_000853,NC_000853.1,gi|15642775|ref|NC_000853.1| -Thermotoga naphthophila RKU-10, complete genome. (NC_013642)=NC_013642,NC_013642.1,gi|281411444|ref|NC_013642.1| -Thermotoga neapolitana DSM 4359, complete genome. (NC_011978)=NC_011978,NC_011978.1,gi|222098974|ref|NC_011978.1| -Thermotoga petrophila RKU-1 chromosome, complete genome. (NC_009486)=NC_009486,NC_009486.1,gi|148269145|ref|NC_009486.1| -Thermotoga thermarum DSM 5069 chromosome, complete genome. (NC_015707)=NC_015707,NC_015707.1,gi|338729812|ref|NC_015707.1| -Thermovibrio ammonificans HB-1 chromosome, complete genome. (NC_014926)=NC_014926,NC_014926.1,gi|319788982|ref|NC_014926.1| -Thermovibrio ammonificans HB-1 plasmid pTHEAM01, complete sequence. (NC_014917)=NC_014917,NC_014917.1,gi|319774848|ref|NC_014917.1| -Thermovirga lienii DSM 17291 chromosome, complete genome. (NC_016148)=NC_016148,NC_016148.1,gi|357418851|ref|NC_016148.1| -Thermovirga lienii DSM 17291 plasmid pTLIE01, complete sequence. (NC_016149)=NC_016149,NC_016149.1,gi|357418824|ref|NC_016149.1| -Thermus sp. CCB_US3_UF1 chromosome, complete genome. (NC_017278)=NC_017278,NC_017278.1,gi|384438400|ref|NC_017278.1| -Thermus sp. CCB_US3_UF1 plasmid pTCCB09, complete sequence. (NC_016634)=NC_016634,NC_016634.1,gi|384440648|ref|NC_016634.1| -Thermus scotoductus SA-01 chromosome, complete genome. (NC_014974)=NC_014974,NC_014974.1,gi|320449106|ref|NC_014974.1| -Thermus scotoductus SA-01 plasmid pTSC8, complete sequence. (NC_014975)=NC_014975,NC_014975.1,gi|320449093|ref|NC_014975.1| -Thermus thermophilus HB27 plasmid pTT27, complete sequence. (NC_005838)=NC_005838,NC_005838.1,gi|46255071|ref|NC_005838.1| -Thermus thermophilus HB27, complete genome. (NC_005835)=NC_005835,NC_005835.1,gi|46198308|ref|NC_005835.1| -Thermus thermophilus HB8 chromosome, complete genome. (NC_006461)=NC_006461,NC_006461.1,gi|55979969|ref|NC_006461.1| -Thermus thermophilus HB8 plasmid pTT27, complete sequence. (NC_006462)=NC_006462,NC_006462.1,gi|55978183|ref|NC_006462.1| -Thermus thermophilus HB8 plasmid pTT8, complete sequence. (NC_006463)=NC_006463,NC_006463.1,gi|55978435|ref|NC_006463.1| -Thermus thermophilus JL-18 chromosome, complete genome. (NC_017587)=NC_017587,NC_017587.1,gi|386359470|ref|NC_017587.1| -Thermus thermophilus JL-18 plasmid pTTJL1801, complete sequence. (NC_017588)=NC_017588,NC_017588.1,gi|386361452|ref|NC_017588.1| -Thermus thermophilus JL-18 plasmid pTTJL1802, complete sequence. (NC_017590)=NC_017590,NC_017590.1,gi|386361711|ref|NC_017590.1| -Thermus thermophilus SG0.5JP17-16 chromosome, complete genome. (NC_017272)=NC_017272,NC_017272.1,gi|384430208|ref|NC_017272.1| -Thermus thermophilus SG0.5JP17-16 plasmid pTHTHE1601, complete (NC_017273)=NC_017273,NC_017273.1,gi|384432129|ref|NC_017273.1| -Thioalkalimicrobium cyclicum ALM1 chromosome, complete genome. (NC_015581)=NC_015581,NC_015581.1,gi|334143099|ref|NC_015581.1| -Thioalkalivibrio sp. K90mix chromosome, complete genome. (NC_013889)=NC_013889,NC_013889.1,gi|289207187|ref|NC_013889.1| -Thioalkalivibrio sp. K90mix plasmid pTK9001, complete sequence. (NC_013930)=NC_013930,NC_013930.1,gi|290242889|ref|NC_013930.1| -Thioalkalivibrio sulfidophilus HL-EbGr7 chromosome, complete (NC_011901)=NC_011901,NC_011901.1,gi|220933193|ref|NC_011901.1| -Thiobacillus denitrificans ATCC 25259 chromosome, complete genome. (NC_007404)=NC_007404,NC_007404.1,gi|74316018|ref|NC_007404.1| -Thiocystis violascens DSM 198 chromosome, complete genome. (NC_018012)=NC_018012,NC_018012.1,gi|390948458|ref|NC_018012.1| -Thiomicrospira crunogena XCL-2 chromosome, complete genome. (NC_007520)=NC_007520,NC_007520.2,gi|118139508|ref|NC_007520.2| -Thiomonas intermedia K12 chromosome, complete genome. (NC_014153)=NC_014153,NC_014153.1,gi|296134504|ref|NC_014153.1| -Thiomonas intermedia K12 plasmid pTINT01, complete sequence. (NC_014154)=NC_014154,NC_014154.1,gi|296137611|ref|NC_014154.1| -thiomonas intermedia K12 plasmid pTINT02, complete sequence. (NC_014155)=NC_014155,NC_014155.1,gi|296137655|ref|NC_014155.1| -Tistrella mobilis KA081020-065 chromosome, complete genome. (NC_017956)=NC_017956,NC_017956.1,gi|389875858|ref|NC_017956.1| -Tistrella mobilis KA081020-065 plasmid pTM1, complete sequence. (NC_017957)=NC_017957,NC_017957.1,gi|389875252|ref|NC_017957.1| -Tistrella mobilis KA081020-065 plasmid pTM2, complete sequence. (NC_017966)=NC_017966,NC_017966.1,gi|389879423|ref|NC_017966.1| -Tistrella mobilis KA081020-065 plasmid pTM3, complete sequence. (NC_017958)=NC_017958,NC_017958.1,gi|389874236|ref|NC_017958.1| -Tistrella mobilis KA081020-065 plasmid pTM4, complete sequence. (NC_017959)=NC_017959,NC_017959.1,gi|389875179|ref|NC_017959.1| -Tolumonas auensis DSM 9187 chromosome, complete genome. (NC_012691)=NC_012691,NC_012691.1,gi|237806776|ref|NC_012691.1| -Treponema azotonutricium ZAS-9 chromosome, complete genome. (NC_015577)=NC_015577,NC_015577.1,gi|333992987|ref|NC_015577.1| -Treponema brennaborense DSM 12168 chromosome, complete genome. (NC_015500)=NC_015500,NC_015500.1,gi|332296669|ref|NC_015500.1| -Treponema denticola ATCC 35405 chromosome, complete genome. (NC_002967)=NC_002967,NC_002967.9,gi|42516522|ref|NC_002967.9| -Treponema pallidum subsp. pallidum str. Chicago chromosome, (NC_017268)=NC_017268,NC_017268.1,gi|384421554|ref|NC_017268.1| -Treponema pallidum subsp. pallidum DAL-1 chromosome, complete (NC_016844)=NC_016844,NC_016844.1,gi|378974633|ref|NC_016844.1| -Treponema pallidum subsp. pallidum str. Nichols chromosome, (NC_000919)=NC_000919,NC_000919.1,gi|15638995|ref|NC_000919.1| -Treponema pallidum subsp. pallidum SS14, complete genome. (NC_010741)=NC_010741,NC_010741.1,gi|189025236|ref|NC_010741.1| -Treponema pallidum subsp. pertenue str. CDC2 chromosome, complete (NC_016848)=NC_016848,NC_016848.1,gi|378981476|ref|NC_016848.1| -Treponema pallidum subsp. pertenue str. Gauthier chromosome, (NC_016843)=NC_016843,NC_016843.1,gi|378973567|ref|NC_016843.1| -Treponema pallidum subsp. pertenue str. SamoaD chromosome, complete (NC_016842)=NC_016842,NC_016842.1,gi|378972501|ref|NC_016842.1| -Treponema paraluiscuniculi Cuniculi A chromosome, complete genome. (NC_015714)=NC_015714,NC_015714.1,gi|338705982|ref|NC_015714.1| -Treponema primitia ZAS-2 chromosome, complete genome. (NC_015578)=NC_015578,NC_015578.1,gi|333996462|ref|NC_015578.1| -Treponema succinifaciens DSM 2489 chromosome, complete genome. (NC_015385)=NC_015385,NC_015385.1,gi|328946930|ref|NC_015385.1| -Treponema succinifaciens DSM 2489 plasmid pTRESU01, complete (NC_015386)=NC_015386,NC_015386.1,gi|328949383|ref|NC_015386.1| -Trichodesmium erythraeum IMS101 chromosome, complete genome. (NC_008312)=NC_008312,NC_008312.1,gi|113473942|ref|NC_008312.1| -Tropheryma whipplei TW08/27, complete genome. (NC_004551)=NC_004551,NC_004551.1,gi|28572175|ref|NC_004551.1| -Tropheryma whipplei str. Twist, complete genome. (NC_004572)=NC_004572,NC_004572.3,gi|32447382|ref|NC_004572.3| -Truepera radiovictrix DSM 17093 chromosome, complete genome. (NC_014221)=NC_014221,NC_014221.1,gi|297622252|ref|NC_014221.1| -Tsukamurella paurometabola DSM 20162 chromosome, complete genome. (NC_014158)=NC_014158,NC_014158.1,gi|296137750|ref|NC_014158.1| -Tsukamurella paurometabola DSM 20162 plasmid pTpau01, complete (NC_014159)=NC_014159,NC_014159.1,gi|296141908|ref|NC_014159.1| -Turneriella parva DSM 21527 chromosome, complete genome. (NC_018020)=NC_018020,NC_018020.1,gi|392401586|ref|NC_018020.1| -Turneriella parva DSM 21527 plasmid pTURPA.01, complete sequence. (NC_018021)=NC_018021,NC_018021.1,gi|392405697|ref|NC_018021.1| -Ureaplasma parvum serovar 3 str. ATCC 27815 chromosome, complete (NC_010503)=NC_010503,NC_010503.1,gi|170761847|ref|NC_010503.1| -Ureaplasma parvum serovar 3 str. ATCC 700970, complete genome. (NC_002162)=NC_002162,NC_002162.1,gi|13357558|ref|NC_002162.1| -Ureaplasma urealyticum serovar 10 str. ATCC 33699 chromosome, (NC_011374)=NC_011374,NC_011374.1,gi|209553988|ref|NC_011374.1| -Variovorax paradoxus EPS chromosome, complete genome. (NC_014931)=NC_014931,NC_014931.1,gi|319790694|ref|NC_014931.1| -Variovorax paradoxus S110 chromosome 1, complete sequence. (NC_012791)=NC_012791,NC_012791.1,gi|239813019|ref|NC_012791.1| -Variovorax paradoxus S110 chromosome 2, complete genome. (NC_012792)=NC_012792,NC_012792.1,gi|239819985|ref|NC_012792.1| -Veillonella parvula DSM 2008 chromosome, complete genome. (NC_013520)=NC_013520,NC_013520.1,gi|269797069|ref|NC_013520.1| -Verminephrobacter eiseniae EF01-2 chromosome, complete genome. (NC_008786)=NC_008786,NC_008786.1,gi|121607004|ref|NC_008786.1| -Verminephrobacter eiseniae EF01-2 plasmid pVEIS01, complete (NC_008771)=NC_008771,NC_008771.1,gi|121583590|ref|NC_008771.1| -Verrucosispora maris AB-18-032 chromosome, complete genome. (NC_015434)=NC_015434,NC_015434.1,gi|330464883|ref|NC_015434.1| -Verrucosispora maris AB-18-032 plasmid pVMKU, complete sequence. (NC_015409)=NC_015409,NC_015409.1,gi|330464829|ref|NC_015409.1| -Vibrio sp. EJY3 chromosome 1, complete sequence. (NC_016613)=NC_016613,NC_016613.1,gi|375264031|ref|NC_016613.1| -Vibrio sp. EJY3 chromosome 2, complete sequence. (NC_016614)=NC_016614,NC_016614.1,gi|375262319|ref|NC_016614.1| -Vibrio sp. Ex25 chromosome 1, complete sequence. (NC_013456)=NC_013456,NC_013456.1,gi|262392383|ref|NC_013456.1| -Vibrio sp. Ex25 chromosome 2, complete genome. (NC_013457)=NC_013457,NC_013457.1,gi|262395299|ref|NC_013457.1| -Vibrio anguillarum 775 chromosome I, complete sequence. (NC_015633)=NC_015633,NC_015633.1,gi|336122587|ref|NC_015633.1| -Vibrio anguillarum 775 chromosome II, complete sequence. (NC_015637)=NC_015637,NC_015637.1,gi|336125405|ref|NC_015637.1| -Vibrio cholerae IEC224 chromosome I, complete sequence. (NC_016944)=NC_016944,NC_016944.1,gi|379739908|ref|NC_016944.1| -Vibrio cholerae IEC224 chromosome II, complete sequence. (NC_016945)=NC_016945,NC_016945.1,gi|379743460|ref|NC_016945.1| -Vibrio cholerae LMA3984-4 chromosome chromosome I, complete (NC_017270)=NC_017270,NC_017270.1,gi|384423362|ref|NC_017270.1| -Vibrio cholerae LMA3984-4 chromosome chromosome II, complete (NC_017269)=NC_017269,NC_017269.1,gi|384422536|ref|NC_017269.1| -Vibrio cholerae M66-2 chromosome I, complete sequence. (NC_012578)=NC_012578,NC_012578.1,gi|227080237|ref|NC_012578.1| -Vibrio cholerae M66-2 chromosome II, complete genome. (NC_012580)=NC_012580,NC_012580.1,gi|227811634|ref|NC_012580.1| -Vibrio cholerae MJ-1236 chromosome 1, complete sequence. (NC_012668)=NC_012668,NC_012668.1,gi|229606122|ref|NC_012668.1| -Vibrio cholerae MJ-1236 chromosome 2, complete genome. (NC_012667)=NC_012667,NC_012667.1,gi|229605062|ref|NC_012667.1| -Vibrio cholerae O1 str. 2010EL-1786 chromosome 1, complete (NC_016445)=NC_016445,NC_016445.1,gi|360034408|ref|NC_016445.1| -Vibrio cholerae O1 str. 2010EL-1786 chromosome 2, complete (NC_016446)=NC_016446,NC_016446.1,gi|360037214|ref|NC_016446.1| -Vibrio cholerae O1 biovar El Tor str. N16961 chromosome chromosome (NC_002505)=NC_002505,NC_002505.1,gi|15640032|ref|NC_002505.1| -Vibrio cholerae O1 biovar eltor str. N16961 chromosome II, complete (NC_002506)=NC_002506,NC_002506.1,gi|15600771|ref|NC_002506.1| -Vibrio cholerae O395 chromosome chromosome I, complete sequence. (NC_012582)=NC_012582,NC_012582.1,gi|227116370|ref|NC_012582.1| -Vibrio cholerae O395 chromosome chromosome II, complete sequence. (NC_012583)=NC_012583,NC_012583.1,gi|227119188|ref|NC_012583.1| -Vibrio cholerae O395 chromosome 1, complete sequence. (NC_009456)=NC_009456,NC_009456.1,gi|147671401|ref|NC_009456.1| -Vibrio cholerae O395 chromosome 2, complete sequence. (NC_009457)=NC_009457,NC_009457.1,gi|147673035|ref|NC_009457.1| -Vibrio fischeri ES114 chromosome I, complete sequence. (NC_006840)=NC_006840,NC_006840.2,gi|172087630|ref|NC_006840.2| -Vibrio fischeri ES114 chromosome II, complete sequence. (NC_006841)=NC_006841,NC_006841.2,gi|172087787|ref|NC_006841.2| -Vibrio fischeri ES114 plasmid pES100, complete sequence. (NC_006842)=NC_006842,NC_006842.1,gi|59714356|ref|NC_006842.1| -Vibrio fischeri MJ11 chromosome I, complete sequence. (NC_011184)=NC_011184,NC_011184.1,gi|197333880|ref|NC_011184.1| -Vibrio fischeri MJ11 chromosome II, complete sequence. (NC_011186)=NC_011186,NC_011186.1,gi|197336667|ref|NC_011186.1| -Vibrio fischeri MJ11 plasmid pMJ100, complete sequence. (NC_011185)=NC_011185,NC_011185.1,gi|197336471|ref|NC_011185.1| -Vibrio furnissii NCTC 11218 chromosome 1, complete sequence. (NC_016602)=NC_016602,NC_016602.1,gi|375129161|ref|NC_016602.1| -Vibrio furnissii NCTC 11218 chromosome 2, complete sequence. (NC_016628)=NC_016628,NC_016628.1,gi|375132168|ref|NC_016628.1| -Vibrio harveyi ATCC BAA-1116 chromosome I, complete sequence. (NC_009783)=NC_009783,NC_009783.1,gi|156972381|ref|NC_009783.1| -Vibrio harveyi ATCC BAA-1116 chromosome II, complete sequence. (NC_009784)=NC_009784,NC_009784.1,gi|156975952|ref|NC_009784.1| -Vibrio harveyi ATCC BAA-1116 plasmid pVIBHAR, complete sequence. (NC_009777)=NC_009777,NC_009777.1,gi|156936674|ref|NC_009777.1| -Vibrio parahaemolyticus RIMD 2210633 chromosome 1, complete (NC_004603)=NC_004603,NC_004603.1,gi|28896774|ref|NC_004603.1| -Vibrio parahaemolyticus RIMD 2210633 chromosome 2, complete (NC_004605)=NC_004605,NC_004605.1,gi|28899855|ref|NC_004605.1| -Vibrio splendidus LGP32 chromosome 1, complete sequence. (NC_011753)=NC_011753,NC_011753.2,gi|294514841|ref|NC_011753.2| -Vibrio splendidus LGP32 chromosome 2, complete sequence. (NC_011744)=NC_011744,NC_011744.2,gi|294510242|ref|NC_011744.2| -Vibrio vulnificus CMCP6 chromosome I, complete sequence. (NC_004459)=NC_004459,NC_004459.3,gi|326423644|ref|NC_004459.3| -Vibrio vulnificus CMCP6 chromosome II, complete sequence. (NC_004460)=NC_004460,NC_004460.2,gi|326424156|ref|NC_004460.2| -Vibrio vulnificus MO6-24/O chromosome I, complete sequence. (NC_014965)=NC_014965,NC_014965.1,gi|320154846|ref|NC_014965.1| -Vibrio vulnificus MO6-24/O chromosome II, complete sequence. (NC_014966)=NC_014966,NC_014966.1,gi|320157827|ref|NC_014966.1| -Vibrio vulnificus YJ016 chromosome I, complete sequence. (NC_005139)=NC_005139,NC_005139.1,gi|37678184|ref|NC_005139.1| -Vibrio vulnificus YJ016 chromosome II, complete sequence. (NC_005140)=NC_005140,NC_005140.1,gi|37675660|ref|NC_005140.1| -Vibrio vulnificus YJ016 plasmid pYJ016, complete sequence. (NC_005128)=NC_005128,NC_005128.1,gi|37595821|ref|NC_005128.1| -Vulcanisaeta distributa DSM 14429 chromosome, complete genome. (NC_014537)=NC_014537,NC_014537.1,gi|307594149|ref|NC_014537.1| -Vulcanisaeta moutnovskia 768-28 chromosome, complete genome. (NC_015151)=NC_015151,NC_015151.1,gi|325967528|ref|NC_015151.1| -Waddlia chondrophila WSU 86-1044 chromosome, complete genome. (NC_014225)=NC_014225,NC_014225.1,gi|297620246|ref|NC_014225.1| -Waddlia chondrophila WSU 86-1044 plasmid pWc, complete sequence. (NC_014226)=NC_014226,NC_014226.1,gi|297660606|ref|NC_014226.1| -Weeksella virosa DSM 16922 chromosome, complete genome. (NC_015144)=NC_015144,NC_015144.1,gi|325953647|ref|NC_015144.1| -Weissella koreensis KACC 15510 chromosome, complete genome. (NC_015759)=NC_015759,NC_015759.1,gi|339633914|ref|NC_015759.1| -Weissella koreensis KACC 15510 plasmid WKp2903, complete sequence. (NC_015756)=NC_015756,NC_015756.1,gi|339635250|ref|NC_015756.1| -Wigglesworthia glossinidia endosymbiont of Glossina brevipalpis (NC_003425)=NC_003425,NC_003425.1,gi|19225058|ref|NC_003425.1| -Wigglesworthia glossinidia endosymbiont of Glossina brevipalpis (NC_004344)=NC_004344,NC_004344.2,gi|32490749|ref|NC_004344.2| -Wigglesworthia glossinidia endosymbiont of Glossina morsitans (NC_016893)=NC_016893,NC_016893.1,gi|379009272|ref|NC_016893.1| -Wolbachia endosymbiont strain TRS of Brugia malayi, complete (NC_006833)=NC_006833,NC_006833.1,gi|58584261|ref|NC_006833.1| -Wolbachia endosymbiont of Culex quinquefasciatus Pel chromosome, (NC_010981)=NC_010981,NC_010981.1,gi|190570478|ref|NC_010981.1| -Wolbachia endosymbiont of Drosophila melanogaster, complete genome. (NC_002978)=NC_002978,NC_002978.6,gi|42519920|ref|NC_002978.6| -Wolbachia sp. wRi, complete genome. (NC_012416)=NC_012416,NC_012416.1,gi|225629872|ref|NC_012416.1| -Wolinella succinogenes DSM 1740 chromosome, complete genome. (NC_005090)=NC_005090,NC_005090.1,gi|34556458|ref|NC_005090.1| -Xanthobacter autotrophicus Py2 chromosome, complete genome. (NC_009720)=NC_009720,NC_009720.1,gi|154243958|ref|NC_009720.1| -Xanthobacter autotrophicus Py2 plasmid pXAUT01, complete sequence. (NC_009717)=NC_009717,NC_009717.1,gi|154243668|ref|NC_009717.1| -Xanthomonas albilineans GPE PC73 chromosome, complete genome. (NC_013722)=NC_013722,NC_013722.1,gi|285016821|ref|NC_013722.1| -Xanthomonas axonopodis pv. citri str. 306 chromosome, complete (NC_003919)=NC_003919,NC_003919.1,gi|21240774|ref|NC_003919.1| -Xanthomonas axonopodis pv. citri str. 306 plasmid pXAC33, complete (NC_003921)=NC_003921,NC_003921.3,gi|58033143|ref|NC_003921.3| -Xanthomonas axonopodis pv. citri str. 306 plasmid pXAC64, complete (NC_003922)=NC_003922,NC_003922.1,gi|21264228|ref|NC_003922.1| -Xanthomonas axonopodis pv. citrumelo F1 chromosome, complete (NC_016010)=NC_016010,NC_016010.1,gi|346722940|ref|NC_016010.1| -Xanthomonas campestris pv. campestris str. 8004 chromosome, (NC_007086)=NC_007086,NC_007086.1,gi|66766352|ref|NC_007086.1| -Xanthomonas campestris pv. campestris str. ATCC 33913 chromosome, (NC_003902)=NC_003902,NC_003902.1,gi|21229478|ref|NC_003902.1| -Xanthomonas campestris pv. campestris str. B100 chromosome, (NC_010688)=NC_010688,NC_010688.1,gi|188989396|ref|NC_010688.1| -Xanthomonas campestris pv. raphani 756C chromosome, complete (NC_017271)=NC_017271,NC_017271.1,gi|384425691|ref|NC_017271.1| -Xanthomonas campestris pv. vesicatoria str. 85-10 chromosome, (NC_007508)=NC_007508,NC_007508.1,gi|78045556|ref|NC_007508.1| -Xanthomonas campestris pv. vesicatoria str. 85-10 plasmid pXCV183, (NC_007507)=NC_007507,NC_007507.1,gi|78045309|ref|NC_007507.1| -Xanthomonas campestris pv. vesicatoria str. 85-10 plasmid pXCV19, (NC_007505)=NC_007505,NC_007505.1,gi|78045242|ref|NC_007505.1| -Xanthomonas campestris pv. vesicatoria str. 85-10 plasmid pXCV2, (NC_007504)=NC_007504,NC_007504.1,gi|78045239|ref|NC_007504.1| -Xanthomonas campestris pv. vesicatoria str. 85-10 plasmid pXCV38, (NC_007506)=NC_007506,NC_007506.1,gi|78045265|ref|NC_007506.1| -Xanthomonas oryzae pv. oryzae KACC10331 chromosome, complete (NC_006834)=NC_006834,NC_006834.1,gi|58579623|ref|NC_006834.1| -Xanthomonas oryzae pv. oryzae MAFF 311018 chromosome, complete (NC_007705)=NC_007705,NC_007705.1,gi|84621657|ref|NC_007705.1| -Xanthomonas oryzae pv. oryzae PXO99A chromosome, complete genome. (NC_010717)=NC_010717,NC_010717.1,gi|188574270|ref|NC_010717.1| -Xanthomonas oryzae pv. oryzicola BLS256 chromosome, complete (NC_017267)=NC_017267,NC_017267.1,gi|384417079|ref|NC_017267.1| -Xenorhabdus bovienii SS-2004 chromosome, complete genome. (NC_013892)=NC_013892,NC_013892.1,gi|290473094|ref|NC_013892.1| -Xenorhabdus nematophila ATCC 19061 chromosome, complete genome. (NC_014228)=NC_014228,NC_014228.1,gi|300721089|ref|NC_014228.1| -Xenorhabdus nematophila ATCC 19061 plasmid XNC1_p, complete (NC_014170)=NC_014170,NC_014170.1,gi|296491824|ref|NC_014170.1| -Xylanimonas cellulosilytica DSM 15894 chromosome, complete genome. (NC_013530)=NC_013530,NC_013530.1,gi|269954810|ref|NC_013530.1| -Xylanimonas cellulosilytica DSM 15894 plasmid pXCEL01, complete (NC_013531)=NC_013531,NC_013531.1,gi|269958148|ref|NC_013531.1| -Xylella fastidiosa 9a5c chromosome, complete genome. (NC_002488)=NC_002488,NC_002488.3,gi|57014152|ref|NC_002488.3| -Xylella fastidiosa 9a5c plasmid pXF1.3, complete sequence. (NC_002489)=NC_002489,NC_002489.3,gi|56968324|ref|NC_002489.3| -Xylella fastidiosa 9a5c plasmid pXF51, complete sequence. (NC_002490)=NC_002490,NC_002490.1,gi|10956711|ref|NC_002490.1| -Xylella fastidiosa subsp. fastidiosa GB514 chromosome, complete (NC_017562)=NC_017562,NC_017562.1,gi|386083114|ref|NC_017562.1| -Xylella fastidiosa subsp. fastidiosa GB514 plasmid unnamed, (NC_017561)=NC_017561,NC_017561.1,gi|386085388|ref|NC_017561.1| -Xylella fastidiosa M12 chromosome, complete genome. (NC_010513)=NC_010513,NC_010513.1,gi|170729251|ref|NC_010513.1| -Xylella fastidiosa M23 chromosome, complete genome. (NC_010577)=NC_010577,NC_010577.1,gi|182680572|ref|NC_010577.1| -Xylella fastidiosa M23 plasmid pXFAS01, complete sequence. (NC_010579)=NC_010579,NC_010579.1,gi|182682734|ref|NC_010579.1| -Xylella fastidiosa Temecula1 chromosome, complete genome. (NC_004556)=NC_004556,NC_004556.1,gi|28197945|ref|NC_004556.1| -Xylella fastidiosa Temecula1 plasmid pXFPD1.3, complete sequence. (NC_004554)=NC_004554,NC_004554.1,gi|28191370|ref|NC_004554.1| -Yersinia enterocolitica subsp. enterocolitica 8081 chromosome, (NC_008800)=NC_008800,NC_008800.1,gi|123440403|ref|NC_008800.1| -Yersinia enterocolitica subsp. enterocolitica 8081 plasmid (NC_008791)=NC_008791,NC_008791.1,gi|122815790|ref|NC_008791.1| -Yersinia enterocolitica subsp. palearctica 105.5R(r) chromosome, (NC_015224)=NC_015224,NC_015224.1,gi|332159624|ref|NC_015224.1| -Yersinia enterocolitica subsp. palearctica 105.5R(r) plasmid (NC_015475)=NC_015475,NC_015475.1,gi|332163560|ref|NC_015475.1| -Yersinia enterocolitica subsp. palearctica Y11 plasmid pYV03, (NC_017565)=NC_017565,NC_017565.1,gi|386307331|ref|NC_017565.1| -Yersinia enterocolitica subsp. palearctica Y11, complete genome. (NC_017564)=NC_017564,NC_017564.1,gi|386307442|ref|NC_017564.1| -Yersinia pestis A1122 chromosome, complete genome. (NC_017168)=NC_017168,NC_017168.1,gi|384137007|ref|NC_017168.1| -Yersinia pestis A1122 plasmid unnamed, complete sequence. (NC_017169)=NC_017169,NC_017169.1,gi|384141139|ref|NC_017169.1| -Yersinia pestis A1122 plasmid unnamed, complete sequence. (NC_017170)=NC_017170,NC_017170.1,gi|384136996|ref|NC_017170.1| -Yersinia pestis Angola chromosome, complete genome. (NC_010159)=NC_010159,NC_010159.1,gi|162418099|ref|NC_010159.1| -Yersinia pestis Angola plasmid new_pCD, complete sequence. (NC_010157)=NC_010157,NC_010157.1,gi|162417732|ref|NC_010157.1| -Yersinia pestis Angola plasmid pMT-pPCP, complete sequence. (NC_010158)=NC_010158,NC_010158.1,gi|162417821|ref|NC_010158.1| -Yersinia pestis Antiqua chromosome, complete genome. (NC_008150)=NC_008150,NC_008150.1,gi|108805998|ref|NC_008150.1| -Yersinia pestis Antiqua plasmid pCD, complete sequence. (NC_008122)=NC_008122,NC_008122.1,gi|108793642|ref|NC_008122.1| -Yersinia pestis Antiqua plasmid pMT, complete sequence. (NC_008120)=NC_008120,NC_008120.1,gi|108793532|ref|NC_008120.1| -Yersinia pestis Antiqua plasmid pPCP, complete sequence. (NC_008121)=NC_008121,NC_008121.1,gi|108793632|ref|NC_008121.1| -Yersinia pestis CO92 chromosome, complete genome. (NC_003143)=NC_003143,NC_003143.1,gi|16120353|ref|NC_003143.1| -Yersinia pestis CO92 plasmid pCD1, complete sequence. (NC_003131)=NC_003131,NC_003131.1,gi|16082691|ref|NC_003131.1| -Yersinia pestis CO92 plasmid pMT1, complete sequence. (NC_003134)=NC_003134,NC_003134.1,gi|16082781|ref|NC_003134.1| -Yersinia pestis CO92 plasmid pPCP1, complete sequence. (NC_003132)=NC_003132,NC_003132.1,gi|16082679|ref|NC_003132.1| -Yersinia pestis D106004 chromosome, complete genome. (NC_017154)=NC_017154,NC_017154.1,gi|384120592|ref|NC_017154.1| -Yersinia pestis D106004 plasmid pCD1, complete sequence. (NC_017153)=NC_017153,NC_017153.1,gi|384120524|ref|NC_017153.1| -Yersinia pestis D106004 plasmid pMT1, complete sequence. (NC_017155)=NC_017155,NC_017155.1,gi|384124222|ref|NC_017155.1| -Yersinia pestis D106004 plasmid pPCY1, complete sequence. (NC_017156)=NC_017156,NC_017156.1,gi|384124299|ref|NC_017156.1| -Yersinia pestis D182038 chromosome, complete genome. (NC_017160)=NC_017160,NC_017160.1,gi|384124469|ref|NC_017160.1| -Yersinia pestis D182038 plasmid pCD1, complete sequence. (NC_017157)=NC_017157,NC_017157.1,gi|384124319|ref|NC_017157.1| -Yersinia pestis D182038 plasmid pMT1, complete sequence. (NC_017158)=NC_017158,NC_017158.1,gi|384124388|ref|NC_017158.1| -Yersinia pestis D182038 plasmid pPCP1, complete sequence. (NC_017159)=NC_017159,NC_017159.1,gi|384124309|ref|NC_017159.1| -Yersinia pestis KIM 10 chromosome, complete genome. (NC_004088)=NC_004088,NC_004088.1,gi|22123922|ref|NC_004088.1| -Yersinia pestis KIM plasmid pMT-1, complete sequence. (NC_004838)=NC_004838,NC_004838.1,gi|31795333|ref|NC_004838.1| -Yersinia pestis Nepal516 chromosome, complete genome. (NC_008149)=NC_008149,NC_008149.1,gi|108810166|ref|NC_008149.1| -Yersinia pestis Nepal516 plasmid pMT, complete sequence. (NC_008118)=NC_008118,NC_008118.1,gi|108793732|ref|NC_008118.1| -Yersinia pestis Nepal516 plasmid pPCP, complete sequence. (NC_008119)=NC_008119,NC_008119.1,gi|108793837|ref|NC_008119.1| -Yersinia pestis Pestoides F chromosome, complete genome. (NC_009381)=NC_009381,NC_009381.1,gi|145597324|ref|NC_009381.1| -Yersinia pestis Pestoides F plasmid CD, complete sequence. (NC_009377)=NC_009377,NC_009377.1,gi|145597103|ref|NC_009377.1| -Yersinia pestis Pestoides F plasmid MT, complete sequence. (NC_009378)=NC_009378,NC_009378.1,gi|145597192|ref|NC_009378.1| -Yersinia pestis Z176003 chromosome, complete genome. (NC_014029)=NC_014029,NC_014029.1,gi|294502110|ref|NC_014029.1| -Yersinia pestis Z176003 plasmid pCD1, complete sequence. (NC_014017)=NC_014017,NC_014017.1,gi|294496807|ref|NC_014017.1| -Yersinia pestis Z176003 plasmid pMT1, complete sequence. (NC_014022)=NC_014022,NC_014022.1,gi|294501992|ref|NC_014022.1| -Yersinia pestis Z176003 plasmid pPCP1, complete sequence. (NC_014027)=NC_014027,NC_014027.1,gi|294509193|ref|NC_014027.1| -Yersinia pestis biovar Medievalis str. Harbin 35 chromosome, (NC_017265)=NC_017265,NC_017265.1,gi|384412706|ref|NC_017265.1| -Yersinia pestis biovar Medievalis str. Harbin 35 plasmid pCD, (NC_017263)=NC_017263,NC_017263.1,gi|384412639|ref|NC_017263.1| -Yersinia pestis biovar Medievalis str. Harbin 35 plasmid pMT, (NC_017266)=NC_017266,NC_017266.1,gi|384416964|ref|NC_017266.1| -Yersinia pestis biovar Medievalis str. Harbin 35 plasmid pPCP, (NC_017264)=NC_017264,NC_017264.1,gi|384412693|ref|NC_017264.1| -Yersinia pestis biovar Microtus str. 91001 chromosome, complete (NC_005810)=NC_005810,NC_005810.1,gi|45439865|ref|NC_005810.1| -Yersinia pestis biovar Microtus str. 91001 plasmid pCD1, complete (NC_005813)=NC_005813,NC_005813.1,gi|45478502|ref|NC_005813.1| -Yersinia pestis biovar Microtus str. 91001 plasmid pCRY, complete (NC_005814)=NC_005814,NC_005814.1,gi|45476499|ref|NC_005814.1| -Yersinia pestis biovar Microtus str. 91001 plasmid pMT1, complete (NC_005815)=NC_005815,NC_005815.1,gi|45478588|ref|NC_005815.1| -Yersinia pestis biovar Microtus str. 91001 plasmid pPCP1, complete (NC_005816)=NC_005816,NC_005816.1,gi|45478711|ref|NC_005816.1| -Yersinia pseudotuberculosis IP 31758 chromosome, complete genome. (NC_009708)=NC_009708,NC_009708.1,gi|153946813|ref|NC_009708.1| -Yersinia pseudotuberculosis IP 31758 plasmid_153kb, complete (NC_009705)=NC_009705,NC_009705.1,gi|153930630|ref|NC_009705.1| -Yersinia pseudotuberculosis IP 31758 plasmid_59kb, complete (NC_009704)=NC_009704,NC_009704.1,gi|153930562|ref|NC_009704.1| -Yersinia pseudotuberculosis IP 32953 chromosome, complete genome. (NC_006155)=NC_006155,NC_006155.1,gi|51594359|ref|NC_006155.1| -Yersinia pseudotuberculosis IP 32953 plasmid pYV, complete (NC_006153)=NC_006153,NC_006153.2,gi|113911685|ref|NC_006153.2| -Yersinia pseudotuberculosis IP 32953 plasmid pYptb32953, complete (NC_006154)=NC_006154,NC_006154.1,gi|51593942|ref|NC_006154.1| -Yersinia pseudotuberculosis PB1/+ chromosome, complete genome. (NC_010634)=NC_010634,NC_010634.1,gi|186893344|ref|NC_010634.1| -Yersinia pseudotuberculosis PB1/+ plasmid pYPTS01, complete (NC_010635)=NC_010635,NC_010635.1,gi|186897495|ref|NC_010635.1| -Yersinia pseudotuberculosis YPIII chromosome, complete genome. (NC_010465)=NC_010465,NC_010465.1,gi|170022262|ref|NC_010465.1| -Zobellia galactanivorans, complete genome. (NC_015844)=NC_015844,NC_015844.1,gi|340616011|ref|NC_015844.1| -Zunongwangia profunda SM-A87 chromosome, complete genome. (NC_014041)=NC_014041,NC_014041.1,gi|295131884|ref|NC_014041.1| -Zymomonas mobilis subsp. mobilis ATCC 10988 chromosome, complete (NC_017262)=NC_017262,NC_017262.1,gi|384410943|ref|NC_017262.1| -Zymomonas mobilis subsp. mobilis ATCC 10988 plasmid pZMOB01, (NC_017180)=NC_017180,NC_017180.1,gi|384410829|ref|NC_017180.1| -Zymomonas mobilis subsp. mobilis ATCC 10988 plasmid pZMOB02, (NC_017183)=NC_017183,NC_017183.1,gi|384410887|ref|NC_017183.1| -Zymomonas mobilis subsp. mobilis ATCC 10988 plasmid pZMOB03, (NC_017181)=NC_017181,NC_017181.1,gi|384410858|ref|NC_017181.1| -Zymomonas mobilis subsp. mobilis ATCC 10988 plasmid pZMOB04, (NC_017184)=NC_017184,NC_017184.1,gi|384410912|ref|NC_017184.1| -Zymomonas mobilis subsp. mobilis ATCC 10988 plasmid pZMOB05, (NC_017182)=NC_017182,NC_017182.1,gi|384410883|ref|NC_017182.1| -Zymomonas mobilis subsp. mobilis ATCC 10988 plasmid pZMOBP6, (NC_017185)=NC_017185,NC_017185.1,gi|384410940|ref|NC_017185.1| -Zymomonas mobilis subsp. mobilis ATCC 29191 chromosome, complete (NC_018145)=NC_018145,NC_018145.1,gi|397675890|ref|NC_018145.1| -Zymomonas mobilis subsp. mobilis ATCC 29191 plasmid pZZ6.01, (NC_018146)=NC_018146,NC_018146.1,gi|397677586|ref|NC_018146.1| -Zymomonas mobilis subsp. mobilis ATCC 29191 plasmid pZZ6.02, (NC_018147)=NC_018147,NC_018147.1,gi|397677566|ref|NC_018147.1| -Zymomonas mobilis subsp. mobilis ATCC 29191 plasmid pZZ6.03, (NC_018148)=NC_018148,NC_018148.1,gi|397677555|ref|NC_018148.1| -Zymomonas mobilis subsp. mobilis NCIB 11163 plasmid pZA1001, (NC_013356)=NC_013356,NC_013356.1,gi|260712883|ref|NC_013356.1| -Zymomonas mobilis subsp. mobilis NCIB 11163 plasmid pZA1002, (NC_013357)=NC_013357,NC_013357.1,gi|260738802|ref|NC_013357.1| -Zymomonas mobilis subsp. mobilis NCIB 11163 plasmid pZA1003, (NC_013358)=NC_013358,NC_013358.1,gi|260738835|ref|NC_013358.1| -Zymomonas mobilis subsp. mobilis NCIMB 11163 chromosome, complete (NC_013355)=NC_013355,NC_013355.1,gi|260752245|ref|NC_013355.1| -Zymomonas mobilis subsp. mobilis ZM4 chromosome, complete genome. (NC_006526)=NC_006526,NC_006526.2,gi|283856168|ref|NC_006526.2| -Zymomonas mobilis subsp. pomaceae ATCC 29192 chromosome, complete (NC_015709)=NC_015709,NC_015709.1,gi|338706993|ref|NC_015709.1| -Zymomonas mobilis subsp. pomaceae ATCC 29192 plasmid pZYMOP01, (NC_015715)=NC_015715,NC_015715.1,gi|338708677|ref|NC_015715.1| -Zymomonas mobilis subsp. pomaceae ATCC 29192 plasmid pZYMOP02, (NC_015716)=NC_015716,NC_015716.1,gi|338708711|ref|NC_015716.1| -Cellvibrio gilvus ATCC 13127 chromosome, complete genome. (NC_015671)=NC_015671,NC_015671.1,gi|336319134|ref|NC_015671.1| -'Nostoc azollae' 0708 chromosome, complete genome. (NC_014248)=NC_014248,NC_014248.1,gi|298489614|ref|NC_014248.1| -'Nostoc azollae' 0708 plasmid pAzo01, complete sequence. (NC_014249)=NC_014249,NC_014249.1,gi|298501383|ref|NC_014249.1| -'Nostoc azollae' 0708 plasmid pAzo02, complete sequence. (NC_014250)=NC_014250,NC_014250.1,gi|298501435|ref|NC_014250.1| -Cyanobacterium UCYN-A, complete genome. (NC_013771)=NC_013771,NC_013771.1,gi|284928601|ref|NC_013771.1| -Gamma proteobacterium HdN1 chromosome, complete genome. (NC_014366)=NC_014366,NC_014366.1,gi|304309652|ref|NC_014366.1| -Halophilic archaeon DL31 chromosome, complete genome. (NC_015954)=NC_015954,NC_015954.1,gi|345004010|ref|NC_015954.1| -Halophilic archaeon DL31 plasmid phalar01, complete sequence. (NC_015955)=NC_015955,NC_015955.1,gi|345006827|ref|NC_015955.1| -Halophilic archaeon DL31 plasmid phalar02, complete sequence. (NC_015959)=NC_015959,NC_015959.1,gi|345133531|ref|NC_015959.1| -Uncultured Termite group 1 bacterium phylotype Rs-D17 plasmid (NS_000192)=NS_000192,NS_000192.1,gi|189485765|ref|NS_000192.1| -Uncultured Termite group 1 bacterium phylotype Rs-D17 plasmid (NS_000193)=NS_000193,NS_000193.1,gi|189485775|ref|NS_000193.1| -Uncultured Termite group 1 bacterium phylotype Rs-D17 plasmid (NS_000194)=NS_000194,NS_000194.1,gi|189485779|ref|NS_000194.1| -Uncultured Termite group 1 bacterium phylotype Rs-D17, complete (NS_000191)=NS_000191,NS_000191.1,gi|189485003|ref|NS_000191.1| -Uncultured methanogenic archaeon RC-I chromosome, complete genome. (NC_009464)=NC_009464,NC_009464.1,gi|147918682|ref|NC_009464.1| diff --git a/src/org/apache/commons/collections/iterators/AbstractEmptyIterator.java b/src/org/apache/commons/collections/iterators/AbstractEmptyIterator.java deleted file mode 100644 index 6446146..0000000 --- a/src/org/apache/commons/collections/iterators/AbstractEmptyIterator.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.collections.iterators; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -/** - * Provides an implementation of an empty iterator. - * - * @since Commons Collections 3.1 - * @version $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $ - * - * @author Stephen Colebourne - */ -abstract class AbstractEmptyIterator implements Iterator { - - /** - * Constructor. - */ - protected AbstractEmptyIterator() { - super(); - } - - public boolean hasNext() { - return false; - } - - public Object next() { - throw new NoSuchElementException("Iterator contains no elements"); - } - - public boolean hasPrevious() { - return false; - } - - public Object previous() { - throw new NoSuchElementException("Iterator contains no elements"); - } - - public int nextIndex() { - return 0; - } - - public int previousIndex() { - return -1; - } - - public void add(Object obj) { - throw new UnsupportedOperationException("add() not supported for empty Iterator"); - } - - public void set(Object obj) { - throw new IllegalStateException("Iterator contains no elements"); - } - - public void remove() { - throw new IllegalStateException("Iterator contains no elements"); - } - - public Object getKey() { - throw new IllegalStateException("Iterator contains no elements"); - } - - public Object getValue() { - throw new IllegalStateException("Iterator contains no elements"); - } - - public Object setValue(Object value) { - throw new IllegalStateException("Iterator contains no elements"); - } - - public void reset() { - // do nothing - } - -} diff --git a/src/org/apache/commons/collections/iterators/EmptyIterator.java b/src/org/apache/commons/collections/iterators/EmptyIterator.java deleted file mode 100644 index 65f7f83..0000000 --- a/src/org/apache/commons/collections/iterators/EmptyIterator.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.collections.iterators; - -import java.util.Iterator; - -/** - * Provides an implementation of an empty iterator. - *

- * This class provides an implementation of an empty iterator. - * This class provides for binary compatability between Commons Collections - * 2.1.1 and 3.1 due to issues with IteratorUtils. - * - * @since Commons Collections 2.1.1 and 3.1 - * @version $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $ - * - * @author Stephen Colebourne - */ -public class EmptyIterator extends AbstractEmptyIterator { - - - /** - * Singleton instance of the iterator. - * @since Commons Collections 2.1.1 and 3.1 - */ - public static final Iterator INSTANCE = new EmptyIterator(); - - /** - * Constructor. - */ - protected EmptyIterator() { - super(); - } - -} diff --git a/src/org/apache/commons/collections/map/Flat3Map.java b/src/org/apache/commons/collections/map/Flat3Map.java deleted file mode 100644 index 015fcbd..0000000 --- a/src/org/apache/commons/collections/map/Flat3Map.java +++ /dev/null @@ -1,1130 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.collections.map; - -import java.util.AbstractCollection; -import java.util.AbstractSet; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Set; - -import org.apache.commons.collections.iterators.EmptyIterator; - -/** - * A Map implementation that stores data in simple fields until - * the size is greater than 3. - *

- * This map is designed for performance and can outstrip HashMap. - * It also has good garbage collection characteristics. - *

    - *
  • Optimised for operation at size 3 or less. - *
  • Still works well once size 3 exceeded. - *
  • Gets at size 3 or less are about 0-10% faster than HashMap, - *
  • Puts at size 3 or less are over 4 times faster than HashMap. - *
  • Performance 5% slower than HashMap once size 3 exceeded once. - *
- * The design uses two distinct modes of operation - flat and delegate. - * While the map is size 3 or less, operations map straight onto fields using - * switch statements. Once size 4 is reached, the map switches to delegate mode - * and only switches back when cleared. In delegate mode, all operations are - * forwarded straight to a HashMap resulting in the 5% performance loss. - *

- * The performance gains on puts are due to not needing to create a Map Entry - * object. This is a large saving not only in performance but in garbage collection. - *

- * Whilst in flat mode this map is also easy for the garbage collector to dispatch. - * This is because it contains no complex objects or arrays which slow the progress. - *

- * Do not use Flat3Map if the size is likely to grow beyond 3. - *

- * Note that Flat3Map is not synchronized and is not thread-safe. - * If you wish to use this map from multiple threads concurrently, you must use - * appropriate synchronization. The simplest approach is to wrap this map - * using {@link java.util.Collections#synchronizedMap(Map)}. This class may throw - * exceptions when accessed by concurrent threads without synchronization. - * - * @since Commons Collections 3.0 - * @version $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $ - * - * - * @author Stephen Colebourne - * - * Modifications to make it stand-alone outside the commons-collections package. - * - * @author Thomas Abeel - */ -public class Flat3Map implements Map { - - - private static final long serialVersionUID = 1000575239286061094L; - /** The size of the map, used while in flat mode */ - private transient int size; - /** Hash, used while in flat mode */ - private transient int hash1; - /** Hash, used while in flat mode */ - private transient int hash2; - /** Hash, used while in flat mode */ - private transient int hash3; - /** Key, used while in flat mode */ - private transient K key1; - /** Key, used while in flat mode */ - private transient K key2; - /** Key, used while in flat mode */ - private transient K key3; - /** Value, used while in flat mode */ - private transient V value1; - /** Value, used while in flat mode */ - private transient V value2; - /** Value, used while in flat mode */ - private transient V value3; - /** Map, used while in delegate mode */ - private transient HashMap delegateMap; - - /** - * Constructor. - */ - public Flat3Map() { - super(); - } - - /** - * Constructor copying elements from another map. - * - * @param map the map to copy - * @throws NullPointerException if the map is null - */ - public Flat3Map(Map map) { - super(); - putAll(map); - } - - //----------------------------------------------------------------------- - /** - * Gets the value mapped to the key specified. - * - * @param key the key - * @return the mapped value, null if no match - */ - public V get(Object key) { - if (delegateMap != null) { - return delegateMap.get(key); - } - if (key == null) { - switch (size) { - // drop through - case 3: - if (key3 == null) return value3; - case 2: - if (key2 == null) return value2; - case 1: - if (key1 == null) return value1; - } - } else { - if (size > 0) { - int hashCode = key.hashCode(); - switch (size) { - // drop through - case 3: - if (hash3 == hashCode && key.equals(key3)) return value3; - case 2: - if (hash2 == hashCode && key.equals(key2)) return value2; - case 1: - if (hash1 == hashCode && key.equals(key1)) return value1; - } - } - } - return null; - } - - /** - * Gets the size of the map. - * - * @return the size - */ - public int size() { - if (delegateMap != null) { - return delegateMap.size(); - } - return size; - } - - /** - * Checks whether the map is currently empty. - * - * @return true if the map is currently size zero - */ - public boolean isEmpty() { - return (size() == 0); - } - - //----------------------------------------------------------------------- - /** - * Checks whether the map contains the specified key. - * - * @param key the key to search for - * @return true if the map contains the key - */ - public boolean containsKey(Object key) { - if (delegateMap != null) { - return delegateMap.containsKey(key); - } - if (key == null) { - switch (size) { // drop through - case 3: - if (key3 == null) return true; - case 2: - if (key2 == null) return true; - case 1: - if (key1 == null) return true; - } - } else { - if (size > 0) { - int hashCode = key.hashCode(); - switch (size) { // drop through - case 3: - if (hash3 == hashCode && key.equals(key3)) return true; - case 2: - if (hash2 == hashCode && key.equals(key2)) return true; - case 1: - if (hash1 == hashCode && key.equals(key1)) return true; - } - } - } - return false; - } - - /** - * Checks whether the map contains the specified value. - * - * @param value the value to search for - * @return true if the map contains the key - */ - public boolean containsValue(Object value) { - if (delegateMap != null) { - return delegateMap.containsValue(value); - } - if (value == null) { // drop through - switch (size) { - case 3: - if (value3 == null) return true; - case 2: - if (value2 == null) return true; - case 1: - if (value1 == null) return true; - } - } else { - switch (size) { // drop through - case 3: - if (value.equals(value3)) return true; - case 2: - if (value.equals(value2)) return true; - case 1: - if (value.equals(value1)) return true; - } - } - return false; - } - - //----------------------------------------------------------------------- - /** - * Puts a key-value mapping into this map. - * - * @param key the key to add - * @param value the value to add - * @return the value previously mapped to this key, null if none - */ - public V put(K key, V value) { - if (delegateMap != null) { - return delegateMap.put(key, value); - } - // change existing mapping - if (key == null) { - switch (size) { // drop through - case 3: - if (key3 == null) { - V old = value3; - value3 = value; - return old; - } - case 2: - if (key2 == null) { - V old = value2; - value2 = value; - return old; - } - case 1: - if (key1 == null) { - V old = value1; - value1 = value; - return old; - } - } - } else { - if (size > 0) { - int hashCode = key.hashCode(); - switch (size) { // drop through - case 3: - if (hash3 == hashCode && key.equals(key3)) { - V old = value3; - value3 = value; - return old; - } - case 2: - if (hash2 == hashCode && key.equals(key2)) { - V old = value2; - value2 = value; - return old; - } - case 1: - if (hash1 == hashCode && key.equals(key1)) { - V old = value1; - value1 = value; - return old; - } - } - } - } - - // add new mapping - switch (size) { - default: - convertToMap(); - delegateMap.put(key, value); - return null; - case 2: - hash3 = (key == null ? 0 : key.hashCode()); - key3 = key; - value3 = value; - break; - case 1: - hash2 = (key == null ? 0 : key.hashCode()); - key2 = key; - value2 = value; - break; - case 0: - hash1 = (key == null ? 0 : key.hashCode()); - key1 = key; - value1 = value; - break; - } - size++; - return null; - } - - /** - * Puts all the values from the specified map into this map. - * - * @param map the map to add - * @throws NullPointerException if the map is null - */ - public void putAll(Map map) { - int size = map.size(); - if (size == 0) { - return; - } - if (delegateMap != null) { - delegateMap.putAll(map); - return; - } - if (size < 4) { - for (Iterator it = map.entrySet().iterator(); it.hasNext();) { - Map.Entry entry = (Map.Entry) it.next(); - put((K)entry.getKey(), (V)entry.getValue()); - } - } else { - convertToMap(); - delegateMap.putAll(map); - } - } - - /** - * Converts the flat map data to a map. - */ - private void convertToMap() { - delegateMap = new HashMap(); - switch (size) { // drop through - case 3: - delegateMap.put(key3, value3); - case 2: - delegateMap.put(key2, value2); - case 1: - delegateMap.put(key1, value1); - } - - size = 0; - hash1 = hash2 = hash3 = 0; - key1 = key2 = key3 = null; - value1 = value2 = value3 = null; - } - -// /** -// * Create an instance of the map used for storage when in delegation mode. -// *

-// * This can be overridden by subclasses to provide a different map implementation. -// * Not every AbstractHashedMap is suitable, identity and reference based maps -// * would be poor choices. -// * -// * @return a new AbstractHashedMap or subclass -// * @since Commons Collections 3.1 -// */ -// protected AbstractHashedMap createDelegateMap() { -// return new HashedMap(); -// } - - /** - * Removes the specified mapping from this map. - * - * @param key the mapping to remove - * @return the value mapped to the removed key, null if key not in map - */ - public V remove(Object key) { - if (delegateMap != null) { - return delegateMap.remove(key); - } - if (size == 0) { - return null; - } - if (key == null) { - switch (size) { // drop through - case 3: - if (key3 == null) { - V old = value3; - hash3 = 0; - key3 = null; - value3 = null; - size = 2; - return old; - } - if (key2 == null) { - V old = value3; - hash2 = hash3; - key2 = key3; - value2 = value3; - hash3 = 0; - key3 = null; - value3 = null; - size = 2; - return old; - } - if (key1 == null) { - V old = value3; - hash1 = hash3; - key1 = key3; - value1 = value3; - hash3 = 0; - key3 = null; - value3 = null; - size = 2; - return old; - } - return null; - case 2: - if (key2 == null) { - V old = value2; - hash2 = 0; - key2 = null; - value2 = null; - size = 1; - return old; - } - if (key1 == null) { - V old = value2; - hash1 = hash2; - key1 = key2; - value1 = value2; - hash2 = 0; - key2 = null; - value2 = null; - size = 1; - return old; - } - return null; - case 1: - if (key1 == null) { - V old = value1; - hash1 = 0; - key1 = null; - value1 = null; - size = 0; - return old; - } - } - } else { - if (size > 0) { - int hashCode = key.hashCode(); - switch (size) { // drop through - case 3: - if (hash3 == hashCode && key.equals(key3)) { - V old = value3; - hash3 = 0; - key3 = null; - value3 = null; - size = 2; - return old; - } - if (hash2 == hashCode && key.equals(key2)) { - V old = value3; - hash2 = hash3; - key2 = key3; - value2 = value3; - hash3 = 0; - key3 = null; - value3 = null; - size = 2; - return old; - } - if (hash1 == hashCode && key.equals(key1)) { - V old = value3; - hash1 = hash3; - key1 = key3; - value1 = value3; - hash3 = 0; - key3 = null; - value3 = null; - size = 2; - return old; - } - return null; - case 2: - if (hash2 == hashCode && key.equals(key2)) { - V old = value2; - hash2 = 0; - key2 = null; - value2 = null; - size = 1; - return old; - } - if (hash1 == hashCode && key.equals(key1)) { - V old = value2; - hash1 = hash2; - key1 = key2; - value1 = value2; - hash2 = 0; - key2 = null; - value2 = null; - size = 1; - return old; - } - return null; - case 1: - if (hash1 == hashCode && key.equals(key1)) { - V old = value1; - hash1 = 0; - key1 = null; - value1 = null; - size = 0; - return old; - } - } - } - } - return null; - } - - /** - * Clears the map, resetting the size to zero and nullifying references - * to avoid garbage collection issues. - */ - public void clear() { - if (delegateMap != null) { - delegateMap.clear(); // should aid gc - delegateMap = null; // switch back to flat mode - } else { - size = 0; - hash1 = hash2 = hash3 = 0; - key1 = key2 = key3 = null; - value1 = value2 = value3 = null; - } - } - -// //----------------------------------------------------------------------- -// /** -// * Gets an iterator over the map. -// * Changes made to the iterator affect this map. -// *

-// * A MapIterator returns the keys in the map. It also provides convenient -// * methods to get the key and value, and set the value. -// * It avoids the need to create an entrySet/keySet/values object. -// * It also avoids creating the Map Entry object. -// * -// * @return the map iterator -// */ -// public MapIterator mapIterator() { -// if (delegateMap != null) { -// return delegateMap.mapIterator(); -// } -// if (size == 0) { -// return EmptyMapIterator.INSTANCE; -// } -// return new FlatMapIterator(this); -// } - -// /** -// * FlatMapIterator -// */ -// static class FlatMapIterator implements MapIterator, ResettableIterator { -// private final Flat3Map parent; -// private int nextIndex = 0; -// private boolean canRemove = false; -// -// FlatMapIterator(Flat3Map parent) { -// super(); -// this.parent = parent; -// } -// -// public boolean hasNext() { -// return (nextIndex < parent.size); -// } -// -// public Object next() { -// if (hasNext() == false) { -// throw new NoSuchElementException(AbstractHashedMap.NO_NEXT_ENTRY); -// } -// canRemove = true; -// nextIndex++; -// return getKey(); -// } -// -// public void remove() { -// if (canRemove == false) { -// throw new IllegalStateException(AbstractHashedMap.REMOVE_INVALID); -// } -// parent.remove(getKey()); -// nextIndex--; -// canRemove = false; -// } -// -// public Object getKey() { -// if (canRemove == false) { -// throw new IllegalStateException(AbstractHashedMap.GETKEY_INVALID); -// } -// switch (nextIndex) { -// case 3: -// return parent.key3; -// case 2: -// return parent.key2; -// case 1: -// return parent.key1; -// } -// throw new IllegalStateException("Invalid map index"); -// } -// -// public Object getValue() { -// if (canRemove == false) { -// throw new IllegalStateException(AbstractHashedMap.GETVALUE_INVALID); -// } -// switch (nextIndex) { -// case 3: -// return parent.value3; -// case 2: -// return parent.value2; -// case 1: -// return parent.value1; -// } -// throw new IllegalStateException("Invalid map index"); -// } -// -// public Object setValue(Object value) { -// if (canRemove == false) { -// throw new IllegalStateException(AbstractHashedMap.SETVALUE_INVALID); -// } -// Object old = getValue(); -// switch (nextIndex) { -// case 3: -// parent.value3 = value; -// case 2: -// parent.value2 = value; -// case 1: -// parent.value1 = value; -// } -// return old; -// } -// -// public void reset() { -// nextIndex = 0; -// canRemove = false; -// } -// -// public String toString() { -// if (canRemove) { -// return "Iterator[" + getKey() + "=" + getValue() + "]"; -// } else { -// return "Iterator[]"; -// } -// } -// } - - /** - * Gets the entrySet view of the map. - * Changes made to the view affect this map. - * The Map Entry is not an independent object and changes as the - * iterator progresses. - * To simply iterate through the entries, use {@link #mapIterator()}. - * - * @return the entrySet view - */ - public Set entrySet() { - if (delegateMap != null) { - return delegateMap.entrySet(); - } - return new EntrySet(this); - } - - /** - * EntrySet - */ - static class EntrySet extends AbstractSet { - private final Flat3Map parent; - - EntrySet(Flat3Map parent) { - super(); - this.parent = parent; - } - - public int size() { - return parent.size(); - } - - public void clear() { - parent.clear(); - } - - public boolean remove(Object obj) { - if (obj instanceof Map.Entry == false) { - return false; - } - Map.Entry entry = (Map.Entry) obj; - Object key = entry.getKey(); - boolean result = parent.containsKey(key); - parent.remove(key); - return result; - } - - public Iterator iterator() { - if (parent.delegateMap != null) { - return parent.delegateMap.entrySet().iterator(); - } - if (parent.size() == 0) { - return EmptyIterator.INSTANCE; - } - return new EntrySetIterator(parent); - } - } - - /** - * EntrySetIterator and MapEntry - */ - static class EntrySetIterator implements Iterator, Map.Entry { - private final Flat3Map parent; - private int nextIndex = 0; - private boolean canRemove = false; - - EntrySetIterator(Flat3Map parent) { - super(); - this.parent = parent; - } - - public boolean hasNext() { - return (nextIndex < parent.size); - } - - public Object next() { - if (hasNext() == false) { - throw new NoSuchElementException("No more entries"); - } - canRemove = true; - nextIndex++; - return this; - } - - public void remove() { - if (canRemove == false) { - throw new IllegalStateException("Cannot remove items from Flat3Map"); - } - parent.remove(getKey()); - nextIndex--; - canRemove = false; - } - - public Object getKey() { - if (canRemove == false) { - throw new IllegalStateException("Invalid getKey"); - } - switch (nextIndex) { - case 3: - return parent.key3; - case 2: - return parent.key2; - case 1: - return parent.key1; - } - throw new IllegalStateException("Invalid map index"); - } - - public Object getValue() { - if (canRemove == false) { - throw new IllegalStateException("Invalid getValue"); - } - switch (nextIndex) { - case 3: - return parent.value3; - case 2: - return parent.value2; - case 1: - return parent.value1; - } - throw new IllegalStateException("Invalid map index"); - } - - public Object setValue(Object value) { - if (canRemove == false) { - throw new IllegalStateException("Invalid setKey"); - } - Object old = getValue(); - switch (nextIndex) { - case 3: - parent.value3 = value; - case 2: - parent.value2 = value; - case 1: - parent.value1 = value; - } - return old; - } - - public boolean equals(Object obj) { - if (canRemove == false) { - return false; - } - if (obj instanceof Map.Entry == false) { - return false; - } - Map.Entry other = (Map.Entry) obj; - Object key = getKey(); - Object value = getValue(); - return (key == null ? other.getKey() == null : key.equals(other.getKey())) && - (value == null ? other.getValue() == null : value.equals(other.getValue())); - } - - public int hashCode() { - if (canRemove == false) { - return 0; - } - Object key = getKey(); - Object value = getValue(); - return (key == null ? 0 : key.hashCode()) ^ - (value == null ? 0 : value.hashCode()); - } - - public String toString() { - if (canRemove) { - return getKey() + "=" + getValue(); - } else { - return ""; - } - } - } - - /** - * Gets the keySet view of the map. - * Changes made to the view affect this map. - * To simply iterate through the keys, use {@link #mapIterator()}. - * - * @return the keySet view - */ - public Set keySet() { - if (delegateMap != null) { - return delegateMap.keySet(); - } - return new KeySet(this); - } - - /** - * KeySet - */ - static class KeySet extends AbstractSet { - private final Flat3Map parent; - - KeySet(Flat3Map parent) { - super(); - this.parent = parent; - } - - public int size() { - return parent.size(); - } - - public void clear() { - parent.clear(); - } - - public boolean contains(Object key) { - return parent.containsKey(key); - } - - public boolean remove(Object key) { - boolean result = parent.containsKey(key); - parent.remove(key); - return result; - } - - public Iterator iterator() { - if (parent.delegateMap != null) { - return parent.delegateMap.keySet().iterator(); - } - if (parent.size() == 0) { - return EmptyIterator.INSTANCE; - } - return new KeySetIterator(parent); - } - } - - /** - * KeySetIterator - */ - static class KeySetIterator extends EntrySetIterator { - - KeySetIterator(Flat3Map parent) { - super(parent); - } - - public Object next() { - super.next(); - return getKey(); - } - } - - /** - * Gets the values view of the map. - * Changes made to the view affect this map. - * To simply iterate through the values, use {@link #mapIterator()}. - * - * @return the values view - */ - public Collection values() { - if (delegateMap != null) { - return delegateMap.values(); - } - return new Values(this); - } - - /** - * Values - */ - static class Values extends AbstractCollection { - private final Flat3Map parent; - - Values(Flat3Map parent) { - super(); - this.parent = parent; - } - - public int size() { - return parent.size(); - } - - public void clear() { - parent.clear(); - } - - public boolean contains(Object value) { - return parent.containsValue(value); - } - - public Iterator iterator() { - if (parent.delegateMap != null) { - return parent.delegateMap.values().iterator(); - } - if (parent.size() == 0) { - return EmptyIterator.INSTANCE; - } - return new ValuesIterator(parent); - } - } - - /** - * ValuesIterator - */ - static class ValuesIterator extends EntrySetIterator { - - ValuesIterator(Flat3Map parent) { - super(parent); - } - - public Object next() { - super.next(); - return getValue(); - } - } - -// //----------------------------------------------------------------------- -// /** -// * Write the map out using a custom routine. -// */ -// private void writeObject(ObjectOutputStream out) throws IOException { -// out.defaultWriteObject(); -// out.writeInt(size()); -// for (MapIterator it = mapIterator(); it.hasNext();) { -// out.writeObject(it.next()); // key -// out.writeObject(it.getValue()); // value -// } -// } -// -// /** -// * Read the map in using a custom routine. -// */ -// private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { -// in.defaultReadObject(); -// int count = in.readInt(); -// if (count > 3) { -// delegateMap = new HashMap(); -// } -// for (int i = count; i > 0; i--) { -// put(in.readObject(), in.readObject()); -// } -// } - -// //----------------------------------------------------------------------- -// /** -// * Clones the map without cloning the keys or values. -// * -// * @return a shallow clone -// * @since Commons Collections 3.1 -// */ -// public Object clone() { -// try { -// Flat3Map cloned = (Flat3Map) super.clone(); -// if (cloned.delegateMap != null) { -// cloned.delegateMap = (HashMap) cloned.delegateMap.clone(); -// } -// return cloned; -// } catch (CloneNotSupportedException ex) { -// throw new InternalError(); -// } -// } - - /** - * Compares this map with another. - * - * @param obj the object to compare to - * @return true if equal - */ - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (delegateMap != null) { - return delegateMap.equals(obj); - } - if (obj instanceof Map == false) { - return false; - } - Map other = (Map) obj; - if (size != other.size()) { - return false; - } - if (size > 0) { - Object otherValue = null; - switch (size) { // drop through - case 3: - if (other.containsKey(key3) == false) { - return false; - } - otherValue = other.get(key3); - if (value3 == null ? otherValue != null : !value3.equals(otherValue)) { - return false; - } - case 2: - if (other.containsKey(key2) == false) { - return false; - } - otherValue = other.get(key2); - if (value2 == null ? otherValue != null : !value2.equals(otherValue)) { - return false; - } - case 1: - if (other.containsKey(key1) == false) { - return false; - } - otherValue = other.get(key1); - if (value1 == null ? otherValue != null : !value1.equals(otherValue)) { - return false; - } - } - } - return true; - } - - /** - * Gets the standard Map hashCode. - * - * @return the hash code defined in the Map interface - */ - public int hashCode() { - if (delegateMap != null) { - return delegateMap.hashCode(); - } - int total = 0; - switch (size) { // drop through - case 3: - total += (hash3 ^ (value3 == null ? 0 : value3.hashCode())); - case 2: - total += (hash2 ^ (value2 == null ? 0 : value2.hashCode())); - case 1: - total += (hash1 ^ (value1 == null ? 0 : value1.hashCode())); - } - return total; - } - - /** - * Gets the map as a String. - * - * @return a string version of the map - */ - public String toString() { - if (delegateMap != null) { - return delegateMap.toString(); - } - if (size == 0) { - return "{}"; - } - StringBuffer buf = new StringBuffer(128); - buf.append('{'); - switch (size) { // drop through - case 3: - buf.append((key3 == this ? "(this Map)" : key3)); - buf.append('='); - buf.append((value3 == this ? "(this Map)" : value3)); - buf.append(','); - case 2: - buf.append((key2 == this ? "(this Map)" : key2)); - buf.append('='); - buf.append((value2 == this ? "(this Map)" : value2)); - buf.append(','); - case 1: - buf.append((key1 == this ? "(this Map)" : key1)); - buf.append('='); - buf.append((value1 == this ? "(this Map)" : value1)); - } - buf.append('}'); - return buf.toString(); - } - -} diff --git a/src/org/apache/commons/math/stat/AbstractUnivariateStatistic.java b/src/org/apache/commons/math/stat/AbstractUnivariateStatistic.java deleted file mode 100644 index 7e4c6d9..0000000 --- a/src/org/apache/commons/math/stat/AbstractUnivariateStatistic.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.math.stat; - -import java.io.Serializable; - -/** - * Abstract base class for all implementations of the - * {@link UnivariateStatistic} interface. - *

- * Provides a default implementation of evaluate(double[]), - * delegating to evaluate(double[], int, int) in the natural way. - *

- *

- * Also includes a test method that performs generic parameter - * validation for the evaluate methods.

- * - * @version $Revision$ $Date$ - */ -public abstract class AbstractUnivariateStatistic - implements Serializable { - - /** Serialization UID */ - private static final long serialVersionUID = -8007759382851708045L; - - /** - * @see org.apache.commons.math.stat.descriptive.UnivariateStatistic#evaluate(double[]) - */ - public double evaluate(final double[] values) { - test(values, 0, 0); - return evaluate(values, 0, values.length); - } - - /** - * @see org.apache.commons.math.stat.descriptive.UnivariateStatistic#evaluate(double[], int, int) - */ - public abstract double evaluate(final double[] values, final int begin, final int length); - - /** - * This method is used by evaluate(double[], int, int) methods - * to verify that the input parameters designate a subarray of positive length. - *

- *

    - *
  • returns true iff the parameters designate a subarray of - * positive length
  • - *
  • throws IllegalArgumentException if the array is null or - * or the indices are invalid
  • - *
  • returns false
  • if the array is non-null, but - * length is 0. - *

- * - * @param values the input array - * @param begin index of the first array element to include - * @param length the number of elements to include - * @return true if the parameters are valid and designate a subarray of positive length - * @throws IllegalArgumentException if the indices are invalid or the array is null - */ - protected boolean test( - final double[] values, - final int begin, - final int length) { - - if (values == null) { - throw new IllegalArgumentException("input value array is null"); - } - - if (begin < 0) { - throw new IllegalArgumentException("start position cannot be negative"); - } - - if (length < 0) { - throw new IllegalArgumentException("length cannot be negative"); - } - - if (begin + length > values.length) { - throw new IllegalArgumentException( - "begin + length > values.length"); - } - - if (length == 0) { - return false; - } - - return true; - - } -} diff --git a/src/org/apache/commons/math/stat/Percentile.java b/src/org/apache/commons/math/stat/Percentile.java deleted file mode 100644 index cd1db43..0000000 --- a/src/org/apache/commons/math/stat/Percentile.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.math.stat; - -import java.io.Serializable; -import java.util.Arrays; - -/** - * Provides percentile computation. - *

- * There are several commonly used methods for estimating percentiles (a.k.a. - * quantiles) based on sample data. For large samples, the different methods - * agree closely, but when sample sizes are small, different methods will give - * significantly different results. The algorithm implemented here works as follows: - *

    - *
  1. Let n be the length of the (sorted) array and - * 0 < p <= 100 be the desired percentile.
  2. - *
  3. If n = 1 return the unique array element (regardless of - * the value of p); otherwise
  4. - *
  5. Compute the estimated percentile position - * pos = p * (n + 1) / 100 and the difference, d - * between pos and floor(pos) (i.e. the fractional - * part of pos). If pos >= n return the largest - * element in the array; otherwise
  6. - *
  7. Let lower be the element in position - * floor(pos) in the array and let upper be the - * next element in the array. Return lower + d * (upper - lower) - *
  8. - *

- *

- * To compute percentiles, the data must be (totally) ordered. Input arrays - * are copied and then sorted using {@link java.util.Arrays#sort(double[])}. - * The ordering used by Arrays.sort(double[]) is the one determined - * by {@link java.lang.Double#compareTo(Double)}. This ordering makes - * Double.NaN larger than any other value (including - * Double.POSITIVE_INFINITY). Therefore, for example, the median - * (50th percentile) of - * {0, 1, 2, 3, 4, Double.NaN} evaluates to 2.5.

- *

- * Since percentile estimation usually involves interpolation between array - * elements, arrays containing NaN or infinite values will often - * result in NaN or infinite values returned.

- *

- * Note that this implementation is not synchronized. If - * multiple threads access an instance of this class concurrently, and at least - * one of the threads invokes the increment() or - * clear() method, it must be synchronized externally.

- * - * @version $Revision$ $Date$ - */ -public class Percentile extends AbstractUnivariateStatistic implements Serializable { - - /** Serializable version identifier */ - private static final long serialVersionUID = -8091216485095130416L; - - /** Determines what percentile is computed when evaluate() is activated - * with no quantile argument */ - private double quantile = 0.0; - - /** - * Constructs a Percentile with a default quantile - * value of 50.0. - */ - public Percentile() { - this(50.0); - } - - /** - * Constructs a Percentile with the specific quantile value. - * @param p the quantile - * @throws IllegalArgumentException if p is not greater than 0 and less - * than or equal to 100 - */ - public Percentile(final double p) { - setQuantile(p); - } - - /** - * Returns an estimate of the pth percentile of the values - * in the values array. - *

- * Calls to this method do not modify the internal quantile - * state of this statistic.

- *

- *

    - *
  • Returns Double.NaN if values has length - * 0
  • - *
  • Returns (for any value of p) values[0] - * if values has length 1
  • - *
  • Throws IllegalArgumentException if values - * is null or p is not a valid quantile value (p must be greater than 0 - * and less than or equal to 100)
  • - *

- *

- * See {@link Percentile} for a description of the percentile estimation - * algorithm used.

- * - * @param values input array of values - * @param p the percentile value to compute - * @return the percentile value or Double.NaN if the array is empty - * @throws IllegalArgumentException if values is null - * or p is invalid - */ - public double evaluate(final double[] values, final double p) { - test(values, 0, 0); - return evaluate(values, 0, values.length, p); - } - - /** - * Returns an estimate of the quantileth percentile of the - * designated values in the values array. The quantile - * estimated is determined by the quantile property. - *

- *

    - *
  • Returns Double.NaN if length = 0
  • - *
  • Returns (for any value of quantile) - * values[begin] if length = 1
  • - *
  • Throws IllegalArgumentException if values - * is null, or start or length - * is invalid
  • - *

- *

- * See {@link Percentile} for a description of the percentile estimation - * algorithm used.

- * - * @param values the input array - * @param start index of the first array element to include - * @param length the number of elements to include - * @return the percentile value - * @throws IllegalArgumentException if the parameters are not valid - * - */ - public double evaluate( final double[] values, final int start, final int length) { - return evaluate(values, start, length, quantile); - } - - /** - * Returns an estimate of the pth percentile of the values - * in the values array, starting with the element in (0-based) - * position begin in the array and including length - * values. - *

- * Calls to this method do not modify the internal quantile - * state of this statistic.

- *

- *

    - *
  • Returns Double.NaN if length = 0
  • - *
  • Returns (for any value of p) values[begin] - * if length = 1
  • - *
  • Throws IllegalArgumentException if values - * is null , begin or length is invalid, or - * p is not a valid quantile value (p must be greater than 0 - * and less than or equal to 100)
  • - *

- *

- * See {@link Percentile} for a description of the percentile estimation - * algorithm used.

- * - * @param values array of input values - * @param p the percentile to compute - * @param begin the first (0-based) element to include in the computation - * @param length the number of array elements to include - * @return the percentile value - * @throws IllegalArgumentException if the parameters are not valid or the - * input array is null - */ - public double evaluate(final double[] values, final int begin, - final int length, final double p) { - - test(values, begin, length); - - if ((p > 100) || (p <= 0)) { - throw new IllegalArgumentException("invalid quantile value: " + p); - } - if (length == 0) { - return Double.NaN; - } - if (length == 1) { - return values[begin]; // always return single value for n = 1 - } - double n = (double) length; - double pos = p * (n + 1) / 100; - double fpos = Math.floor(pos); - int intPos = (int) fpos; - double dif = pos - fpos; - double[] sorted = new double[length]; - System.arraycopy(values, begin, sorted, 0, length); - Arrays.sort(sorted); - - if (pos < 1) { - return sorted[0]; - } - if (pos >= n) { - return sorted[length - 1]; - } - double lower = sorted[intPos - 1]; - double upper = sorted[intPos]; - return lower + dif * (upper - lower); - } - - /** - * Returns the value of the quantile field (determines what percentile is - * computed when evaluate() is called with no quantile argument). - * - * @return quantile - */ - public double getQuantile() { - return quantile; - } - - /** - * Sets the value of the quantile field (determines what percentile is - * computed when evaluate() is called with no quantile argument). - * - * @param p a value between 0 < p <= 100 - * @throws IllegalArgumentException if p is not greater than 0 and less - * than or equal to 100 - */ - public void setQuantile(final double p) { - if (p <= 0 || p > 100) { - throw new IllegalArgumentException("Illegal quantile value: " + p); - } - quantile = p; - } - -} diff --git a/src/org/broad/LRUCache.java b/src/org/broad/LRUCache.java deleted file mode 100644 index 637d3e2..0000000 --- a/src/org/broad/LRUCache.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ -package org.broad; - -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.logging.Logger; - -/** - * - * - * @author jrobinso - * @author Thomas Abeel - */ -public class LRUCache extends LinkedHashMap { - - private static final long serialVersionUID = 3108325620729125294L; - - private Logger log = Logger.getLogger(LRUCache.class.getCanonicalName()); - - private int maxEntries = 100; - - public LRUCache(int maxEntries) { - super(maxEntries,0.75f,true); - this.maxEntries = maxEntries; - } - - @Override - protected boolean removeEldestEntry(Map.Entry eldest) { - if (size() > maxEntries) { - return true; - } else if (getAvailableMemoryFraction() < 0.1) { - log.info("Memory low. Free cache entry"); - return true; - } else { - return false; - } - } - public double getAvailableMemoryFraction() { - Runtime runtime = Runtime.getRuntime(); - long maxMemory = runtime.maxMemory(); - long allocatedMemory = runtime.totalMemory(); - long freeMemory = runtime.freeMemory(); - return (double) ((freeMemory + (maxMemory - allocatedMemory))) / maxMemory; - - } -} - diff --git a/src/org/broad/igv/bbfile/BBCompressionUtils.java b/src/org/broad/igv/bbfile/BBCompressionUtils.java deleted file mode 100644 index 7372119..0000000 --- a/src/org/broad/igv/bbfile/BBCompressionUtils.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ -package org.broad.igv.bbfile; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.logging.Logger; -import java.util.zip.Deflater; -import java.util.zip.Inflater; - - -/* - * Compression/Decompression Utillity adapted to BigBed/BigWig Compression formats. - * - * Note: modified from igv CompressionUtil - * - * */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BBCompressionUtils { - - private static Logger log = Logger.getLogger(BBCompressionUtils.class.getCanonicalName()); - - /* - * Decompress ZLIB commpressed data into a buffer - * - * Parameters: data - data buffer, where data.length indicates requested - * number of decompressed bytes. uncompressBufSize - recommended size for - * decompression chunks, or can be full byte size for the compressed region - * - * Return: buffer of uncompressed byte data - */ - public static byte[] decompress(byte[] data, int uncompressBufSize) { - - // mpd: new code - byte[] inbuf = data; // input is first assigned to full data - int rem = data.length; - int count = 0; - int off = 0; - - // Create an expandable byte array to hold the decompressed data - ByteArrayOutputStream bos = new ByteArrayOutputStream((int) (1.5 * inbuf.length)); - - // Decompress the data - byte[] outbuf = new byte[uncompressBufSize]; - - while (rem > 0) { - - // Create the decompressor and give it the data to compress - Inflater decompressor = new Inflater(); - decompressor.setInput(inbuf); - - try { - // byte[] outbuf = new byte[uncompressBufSize]; - uncompressBufSize = outbuf.length; - count = decompressor.inflate(outbuf, 0, uncompressBufSize); - - rem = decompressor.getRemaining(); - if (rem > 0) { - off += inbuf.length - rem; - inbuf = new byte[rem]; - System.arraycopy(data, off, inbuf, 0, rem); - uncompressBufSize -= count; - } - - bos.write(outbuf, 0, count); - - // } catch (DataFormatException e) { - } catch (Exception e) { - log.severe(e.getMessage()); - } - } - - try { - bos.close(); - } catch (IOException e) { - } - - // Get the decompressed data - return bos.toByteArray(); - } - - /* - * */ - public static byte[] compress(byte[] data, int compressBufSize) { - Deflater compressor = new Deflater(); - compressor.setLevel(Deflater.DEFAULT_COMPRESSION); - - // Give the compressor the data to compress - compressor.setInput(data); - compressor.finish(); - - // Create an expandable byte array to hold the compressed data. - // You cannot use an array that's the same size as the orginal because - // there is no guarantee that the compressed data will be smaller than - // the uncompressed data. - ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); - - // Compress the data - byte[] buf = new byte[compressBufSize]; - while (!compressor.finished()) { - int count = compressor.deflate(buf); - bos.write(buf, 0, count); - } - try { - bos.close(); - } catch (IOException e) { - } - - byte[] compressedData = bos.toByteArray(); - return compressedData; - - } - -} diff --git a/src/org/broad/igv/bbfile/BBFileHeader.java b/src/org/broad/igv/bbfile/BBFileHeader.java deleted file mode 100644 index 34d7dce..0000000 --- a/src/org/broad/igv/bbfile/BBFileHeader.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -/** - * Created by IntelliJ IDEA. - * User: martind - * Date: Nov 20, 2009 - * Time: 3:49:14 PM - * To change this template use File | Settings | File Templates. - */ - -/** - * Container class defines the header information for BigBed and BigWig files - */ -package org.broad.igv.bbfile; - - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.logging.Logger; - -import net.sf.samtools.seekablestream.SeekableStream; - -import org.broad.tribble.LittleEndianInputStream; -import org.broad.tribble.SeekableStreamUtils; - - -/* -* Container class for holding the BBFile header information, Table C . -**/ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BBFileHeader { - - private static Logger log = Logger.getLogger(BBFileHeader.class.getCanonicalName()); - - // defines bigBed/bigwig Header Format types - static public final int BBFILE_HEADER_SIZE = 64; - - static public final int BIGWIG_MAGIC_LTH = 0x888FFC26; // BigWig Magic Low to High - static public final int BIGWIG_MAGIC_HTL = 0x26FC8F66; // BigWig Magic High to Low - - static public final int BIGBED_MAGIC_LTH = 0x8789F2EB; // BigBed Magic Low to High - static public final int BIGBED_MAGIC_HTL = 0xEBF28987; // BigBed Magic High to Low - - // defines the bigBed/bigWig source file access -// private String path; // bigBed file/pathname - private SeekableStream fis; // BBFile I/O stream handle - private long fileHeaderOffset; // file offset for file header - - private boolean isHeaderOK; // File header read correctly? - private boolean isLowToHigh; // flag indicates values represented low to high bytes - private boolean isBigBed; // flag indicates file is BigBed format - private boolean isBigWig; // flag indicates file is BigWig format; - - // BBFile Header items - Table C: - // mMagic number (4 bytes) indicates file type and byte order : - // 0x888FFC26 for bigWig, little endian if swapped - // 0x8789F2EB for bigBed, little endian if swapped - private int magic; // 4 byte mMagic Number - private short version; // 2 byte version ID; currently 3 - private short nZoomLevels; // 2 byte count of zoom sumary levels - private long chromTreeOffset; // 8 byte offset to mChromosome B+ Tree index - private long fullDataOffset; // 8 byte offset to unzoomed data dataCount - private long fullIndexOffset; // 8 byte offset to R+ Tree index of items - private short fieldCount; // 2 byte number of fields in bed. (0 for bigWig) - private short definedFieldCount; // 2 byte number of fields that are bed fields - private long autoSqlOffset; // 8 byte offset to 0 terminated string with .as spec - private long totalSummaryOffset; // 8 byte offset to file summary data block - private int uncompressBuffSize; // 4 byte maximum size for decompressed buffer - private long reserved; // 8 bytes reserved for future expansion. Currently 0 - - // constructor reads BBFile header from an input stream - public BBFileHeader(SeekableStream fis, long fileOffset) { - - - // save the path and seekable file handle -// this.path = path; - this.fis = fis; - fileHeaderOffset = fileOffset; - - // read in BBFile header - isHeaderOK = readBBFileHeader(fileHeaderOffset); - - } - - /* - * Constructor loads BBFile header class from parameter specifications. - * - * Parameters: (as defined above) - * */ - public BBFileHeader( - int magic, - short version, - short zoomLevels, - long chromTreeOffset, - long fullDataOffset, - long fullIndexOffset, - short fieldCount, - short definedFieldCount, - long autoSqlOffset, - long totalSummaryOffset, - int uncompressBuffSize, - long reserved) { - - this.magic = magic; - - // Note: may want to validate the rest of the fields as well - if (isBigWig() || isBigBed()) - this.isHeaderOK = true; - - this.version = version; - this.nZoomLevels = zoomLevels; - this.chromTreeOffset = chromTreeOffset; - this.fullDataOffset = fullDataOffset; - this.fullIndexOffset = fullIndexOffset; - this.fieldCount = fieldCount; - this.definedFieldCount = definedFieldCount; - this.autoSqlOffset = autoSqlOffset; - this.totalSummaryOffset = totalSummaryOffset; - this.uncompressBuffSize = uncompressBuffSize; - this.uncompressBuffSize = uncompressBuffSize; - this.reserved = reserved; - } - -// public String getPath() { -// return path; -// } - - - public boolean isHeaderOK() { - return isHeaderOK; - } - - - public boolean isLowToHigh() { - return isLowToHigh; - } - - public boolean isBigBed() { - return isBigBed; - } - - public boolean isBigWig() { - return isBigWig; - } - - public int getFileHeaderSize() { - return BBFILE_HEADER_SIZE; - } - - // ************* return header items **************** - - public int getMagic() { - return magic; - } - - public short getVersion() { - return version; - } - - public short getZoomLevels() { - return nZoomLevels; - } - - public long getChromosomeTreeOffset() { - return chromTreeOffset; - } - - public long getFullDataOffset() { - return fullDataOffset; - } - - public long getFullIndexOffset() { - return fullIndexOffset; - } - - public short getFieldCount() { - return fieldCount; - } - - public short getDefinedFieldCount() { - return definedFieldCount; - } - - public long getAutoSqlOffset() { - return autoSqlOffset; - } - - public long getTotalSummaryOffset() { - return totalSummaryOffset; - } - - public int getUncompressBuffSize() { - return uncompressBuffSize; - } - - -// public void print() { -// -// if (isHeaderOK) { -// if (isBigWig()) -// System.out.println("BigWig file " + path + ", file header at location " + fileHeaderOffset); -// else if (isBigBed()) -// System.out.println("BigBed file " + path + ", file header at location " + fileHeaderOffset); -// } else { -// System.out.println("BBFile " + path + " with bad magic = " + magic + -// " from file header location " + fileHeaderOffset); -// return; // bad read - remaining header items not interpreted -// } -// -// -// // header fields -// System.out.println("BBFile header magic = " + magic); -// System.out.println("Version = " + version); -// System.out.println("Zoom Levels = " + nZoomLevels); -// System.out.println("Chromosome Info B+ tree offset = " + chromTreeOffset); -// System.out.println("Data Block offset = " + fullDataOffset); -// System.out.println("Chromosome Data R+ tree offset = " + fullIndexOffset); -// System.out.println("Bed fields count = " + fieldCount); -// System.out.println("Bed defined fields count = " + definedFieldCount); -// System.out.println("AutoSql Offset = " + autoSqlOffset); -// System.out.println("Total Summary offset = " + totalSummaryOffset); -// System.out.println("Maximum uncompressed buffer size = " + uncompressBuffSize); -// System.out.println("m_reserved = " + reserved); -// } - - /* - * Reads in BBFile header information. - * - * Returns: - * Success status flag is true for successfully read header, - * or is false for a read error. - **/ - private boolean readBBFileHeader(long fileOffset) { - - BBFileHeader bbHeader = null; - LittleEndianInputStream lbdis = null; - DataInputStream bdis = null; - - byte[] buffer = new byte[BBFILE_HEADER_SIZE]; - - - try { - // Read bigBed header into a buffer - fis.seek(fileOffset); -// fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - - - // decode header - determine byte order from first 4 bytes - // first assume byte order is low to high - isLowToHigh = true; - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(buffer)); - magic = lbdis.readInt(); - - // check for a valid bigBed or bigWig file - if (magic == BIGWIG_MAGIC_LTH) - isBigWig = true; - else if (magic == BIGBED_MAGIC_LTH) - isBigBed = true; - - // try high to low byte order - else { - bdis = new DataInputStream(new ByteArrayInputStream(buffer)); - magic = bdis.readInt(); - - // check for a valid bigBed or bigWig file - if (magic == BIGWIG_MAGIC_HTL) - isBigWig = true; - else if (magic == BIGBED_MAGIC_HTL) - isBigBed = true; - - else - return false; // can't identify BBFile type - - // success - set order high to low - isLowToHigh = false; - } - - // Get header information - if (isLowToHigh) { - version = lbdis.readShort(); - nZoomLevels = lbdis.readShort(); - chromTreeOffset = lbdis.readLong(); - fullDataOffset = lbdis.readLong(); - fullIndexOffset = lbdis.readLong(); - fieldCount = lbdis.readShort(); - definedFieldCount = lbdis.readShort(); - autoSqlOffset = lbdis.readLong(); - totalSummaryOffset = lbdis.readLong(); - uncompressBuffSize = lbdis.readInt(); - reserved = lbdis.readLong(); - } else { - version = bdis.readShort(); - nZoomLevels = bdis.readShort(); - chromTreeOffset = bdis.readLong(); - fullDataOffset = bdis.readLong(); - fullIndexOffset = bdis.readLong(); - fieldCount = bdis.readShort(); - definedFieldCount = bdis.readShort(); - autoSqlOffset = bdis.readLong(); - totalSummaryOffset = bdis.readLong(); - uncompressBuffSize = bdis.readInt(); - reserved = bdis.readLong(); - } - - } catch (IOException ex) { - throw new RuntimeException("Error reading file header ", ex); - } - - // file header was read properly - return true; - } - -} // mEndBase of class BBFileHeader diff --git a/src/org/broad/igv/bbfile/BBFileReader.java b/src/org/broad/igv/bbfile/BBFileReader.java deleted file mode 100644 index c817969..0000000 --- a/src/org/broad/igv/bbfile/BBFileReader.java +++ /dev/null @@ -1,912 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -/** +- - * Created by IntelliJ IDEA. - * User: martind - * Date: Nov 20, 2009 - * Time: 3:43:04 PM - * To change this template use File | Settings | File Templates. - */ -package org.broad.igv.bbfile; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.logging.Logger; - -import org.broad.tribble.SeekableStreamUtils; - -import org.broad.tribble.LittleEndianInputStream; - -import net.sf.jannot.source.Locator; - -import net.sf.samtools.seekablestream.SeekableFileStream; -import net.sf.samtools.seekablestream.SeekableStream; - -/* - * Broad Institute Interactive Genome Viewer Big Binary File (BBFile) Reader - * - File reader for UCSC BigWig and BigBed file types. - * - * Notes: Table entries refer to Jim Kent of UCSC's document description: - * "BigWig and BigBed: Enabling Browsing of Large Distributed Data Sets", - * November 2009. - * - * The overall binary file layout is defined in Table B of the document. - * - * BBFile Reader sequences through this binary file layout: - * - * 1) Reads in BBFile Header Table C and determine if file is a valid Big Bed or Big Wig - * binary file type. - * - * 2) Reads in Zoom Header Tables D if zoom data is present, as defined by zoomLevels - * in Table C, one for each zoom level. - * - * 3) Reads in the AutoSQL block Table B if present, as referenced by autoSqlOffset in Table C. - * - * 4) Reads in Total Summary Block Table DD if present, as referenced by - * TotalSummaryOffset in Table C. - * - * 5) Reads in B+ Tree Header Chromosome Index Header Table E, as referenced - * by chromosomeTreeOffset in Table C. - * - * 6)Reads in B+ Tree Nodes indexing mChromosome ID's for mChromosome regions; - * Table F for node type (leaf/child), Table G for leaf items, - * Table H for child node items. - * - * 7) Reads in R+ Tree Chromosome ID Index Header Table K. - * - * 8) Reads in R+ Tree Nodes indexing of data arranged by mChromosome ID's; - * Table L for node type (leaf or child), Table M for leaf items, - * Table N for child node items. - * - * 9) Verifies Data Count of data records, as referenced by fullDataOffset in Table C - * - * 10) References data count records of data size defined in Table M of R+ Tree index - * for all leaf items in the tree. - * - * 11) Reads in zoom level format Table O for each zoom level comprised of - * zoom record count followed by that many Table P zoom statistics records, - * followed by an R+ tree of zoom data locations indexed as in Tables L, M, and N. - * - * 12) Returns information on chromosome name keys and chromosome data regions. - * - * 13) Provides iterators using chromosome names and data regions to extract - * zoom data, Wig data, and Bed data. - * - * */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BBFileReader { - - public static final long BBFILE_HEADER_OFFSET = 0; - - private static Logger log = Logger.getLogger(BBFileReader.class.getCanonicalName()); - - // Defines the Big Binary File (BBFile) access - private Locator path; // BBFile source file/pathname - private SeekableStream fis; // BBFile input stream handle - private long fileOffset; // file offset for next item to be read - - private BBFileHeader fileHeader; // Big Binary file header - private int dataCount; // Number of data records in the file - Table BB - private boolean isLowToHigh; // BBFile binary data format: low to high or - // high to low - private int uncompressBufSize; // buffer byte size for data decompression; 0 - // for uncompressed - - // AutoSQL String defines custom BigBed formats - private long autoSqlOffset; - private String autoSqlFormat; - - // This section defines the zoom items if zoom data exists - private int zoomLevelCount; // number of zoom levels defined - private long zoomLevelOffset; // file offset to zoom level headers - private BBZoomLevels zoomLevels; // zoom level headers and data locations - - // Total Summary Block - file statistical info - private long mTotalSummaryBlockOffset; - private BBTotalSummaryBlock totalSummaryBlock; - - // B+ tree - private long chromIDTreeOffset; // file offset to mChromosome index B+ tree - private BPTree chromosomeIDTree; // Container for the mChromosome index B+ - // tree - - // R+ tree - private long chromDataTreeOffset; // file offset to mChromosome data R+ tree - private RPTree chromosomeDataTree; // Container for the mChromosome data R+ - // tree - - public BBFileReader(String path) throws IOException { - this(new Locator(path), new SeekableFileStream(new File(path))); - - } - - public BBFileReader(Locator path, SeekableStream stream) { - - log.info("Opening BBFile source " + path); - this.path = path; - fis = stream; - - // read in file header - fileOffset = BBFILE_HEADER_OFFSET; - fileHeader = new BBFileHeader(fis, fileOffset); - // fileHeader.print(); - - if (!fileHeader.isHeaderOK()) { - log.severe("BBFile header is unrecognized type, header magic = " + fileHeader.getMagic()); - throw new RuntimeException("Error reading BBFile header for: " + path); - } - - // get data characteristics - isLowToHigh = fileHeader.isLowToHigh(); - uncompressBufSize = fileHeader.getUncompressBuffSize(); - - // update file offset past BBFile header - fileOffset += BBFileHeader.BBFILE_HEADER_SIZE; - - // get zoom level count from file header - zoomLevelCount = fileHeader.getZoomLevels(); - - // extract zoom level headers and zoom data records - // Note: zoom headers Table D immediately follow the BBFile Header - if (zoomLevelCount > 0) { - - zoomLevelOffset = fileOffset; - - zoomLevels = new BBZoomLevels(fis, zoomLevelOffset, zoomLevelCount, isLowToHigh, uncompressBufSize); - - // end of zoom level headers - compare with next BBFile item - // location - fileOffset += zoomLevelCount * BBZoomLevelHeader.ZOOM_LEVEL_HEADER_SIZE; - } - - // get the AutoSQL custom BigBed fields - autoSqlOffset = fileHeader.getAutoSqlOffset(); - if (autoSqlOffset != 0) { - // read in .as entry - // mFileOffset = mAutoSqlOffset + sizeof(.as format field); - } - - // get the Total Summary Block (Table DD) - fileOffset = fileHeader.getTotalSummaryOffset(); - if (fileHeader.getVersion() >= 2 && fileOffset > 0) { - totalSummaryBlock = new BBTotalSummaryBlock(fis, fileOffset, isLowToHigh); - fileOffset += BBTotalSummaryBlock.TOTAL_SUMMARY_BLOCK_SIZE; - } - - // get Chromosome Data B+ Tree (Table E, F, G, H) : should always exist - chromIDTreeOffset = fileHeader.getChromosomeTreeOffset(); - if (chromIDTreeOffset != 0) { - fileOffset = chromIDTreeOffset; - chromosomeIDTree = new BPTree(fis, fileOffset, isLowToHigh); - } - - // get number of data records indexed by the R+ chromosome data location - // tree - fileOffset = fileHeader.getFullDataOffset(); - dataCount = getDataCount(fis, fileOffset); - - } - -// /* -// * Method returns the Big Binary File pathname. -// * -// * Returns: Big Binary File pathname -// */ -// -// public String getBBFilePath() { -// return path; -// } - - /* - * Method returns the Big Binary File input stream handle. - * - * Returns: Big Binary File input stream handle - */ - - public SeekableStream getBBFis() { - return fis; - } - - /* - * Method returns the Big Binary File header which identifies the file type - * and content. - * - * Returns: Big Binary File header (Table C) - */ - - public BBFileHeader getBBFileHeader() { - return fileHeader; - } - - /* - * Method returns if the Big Binary File is BigBed. - * - * Returns: Boolean identifies if Big Binary File is BigBed (recognized from - * magic number in file header Table C) - */ - - public boolean isBigBedFile() { - return fileHeader.isBigBed(); - } - - /* - * Method returns if the Big Binary File is BigWig - * - * Returns: Boolean identifies if Big Binary File is BigWig (recognized from - * magic number in file header Table C) - */ - - public boolean isBigWigFile() { - return fileHeader.isBigWig(); - } - - /* - * Method returns the total number of data records in the file. - * - * Returns: Count of the total number of compressed/uncompressed data - * records: which for BigBed is the number of bed features, and for BiGWifg - * is the number of wig sections. - */ - - public int getDataCount() { - return dataCount; - } - - /* - * Method returns the number of chromosomes/contigs in the file. - * - * Note: This is itemCount from B+ tree header BBFile Table E. - * - * Returns: Count of the total number of chromosomes/contigs in the file. - */ - - public long getChromosomeNameCount() { - return chromosomeIDTree.getItemCount(); - } - - /* - * Method returns the number of chromosome/contig regions in the file. - * - * Note: This is itemCount from R+ tree header BBFile Table K. - * - * Returns: Count of the total number of chromosome/contig regions in the - * file. - */ - - public long getChromosomeRegionCount() { - return chromosomeDataTree.getItemCount(); - } - - /* - * Method returns the Big Binary File decompressed buffer size. - * - * Returns: Largest required buffer size for decompressed data chunks (from - * Table C) - */ - - public int getDecompressionBufSize() { - return uncompressBufSize; - } - - /* - * Method returns if the Big Binary File is written with a low to high byte - * order for formatted data. - * - * Returns: Boolean identifies if Big Binary File is low to high byte order - * (recognized from magic number in file header Table C); else is high to - * low byte order if false. - */ - - public boolean isLowToHigh() { - return isLowToHigh; - } - - /* - * Method returns the total summary block for the Big Binary File. - * - * Returns: Total summary block data statistics for the whole file (Table - * DD) - */ - - public BBTotalSummaryBlock getTotalSummaryBlock() { - return totalSummaryBlock; - } - - /* - * Method returns the B+ Chromosome Index Tree. - * - * Returns: B+ Chromosome Index Tree (includes Tables E, F, G, H) - */ - - public BPTree getChromosomeIDTree() { - return chromosomeIDTree; - } - - /* - * Method returns the R+ Chromosome Data Locations Tree. - * - * Returns: R+ Chromosome Data Locations Tree (includes Tables K, L, M, N) - */ - - public RPTree getChromosomeDataTree() { - return chromosomeDataTree; - } - - /* - * Method returns number of zoom level data is included in the file. - * - * Returns: Number of zoom levels (from Table C) - */ - - public int getZoomLevelCount() { - return zoomLevelCount; - } - - /* - * Method returns the zoom levels in the Big Binary File. - * - * Returns: Zoom level object containing zoom level headers and R+ zoom data - * locations tree (includes Tables D, O) - */ - - public BBZoomLevels getZoomLevels() { - return zoomLevels; - } - - /* - * Method finds the zoom data bounds in R+ tree for a chromosome ID range. - * - * Parameters: zoomLevel - zoom level startChromID - start chromosome for - * the region endChromID - end chromosome for the region - * - * Returns: Chromosome region bounds for chromosome ID range - */ - - public RPChromosomeRegion getZoomLevelBounds(int zoomLevel, int startChromID, int endChromID) { - - RPChromosomeRegion chromosomeBounds = zoomLevels.getZoomLevelRPTree(zoomLevel).getChromosomeRegion( - startChromID, endChromID); - - return chromosomeBounds; - } - - /* - * Method finds chromosome bounds for entire chromosome ID range in the zoom - * level R+ tree. - * - * Parameters: zoomLevel - zoom level - * - * Returns: Chromosome bounds for the entire chromosome ID range in the R+ - * tree. - */ - - public RPChromosomeRegion getZoomLevelBounds(int zoomLevel) { - - RPChromosomeRegion chromosomeBounds = zoomLevels.getZoomLevelRPTree(zoomLevel).getChromosomeBounds(); - - return chromosomeBounds; - } - - /* - * Method returns the zoom record count for the zoom level. - * - * Parameters: zoomLevel - zoom level - * - * Returns: Chromosome bounds for the entire chromosome ID range in the R+ - * tree. - */ - - public int getZoomLevelRecordCount(int zoomLevel) { - - return zoomLevels.getZoomLevelFormats().get(zoomLevel - 1).getZoomRecordCount(); - } - - /* - * Method finds chromosome key name for the associated chromosome ID in the - * B+ tree. - * - * Returns: chromosome key name for associated chromosome ID. - */ - - public String getChromosomeName(int chromID) { - - String chromosomeName = chromosomeIDTree.getChromosomeName(chromID); - return chromosomeName; - } - - /* - * Method finds chromosome names in the B+ chromosome index tree. - * - * Returns: LIst of all chromosome key names in the B+ tree. - */ - - public ArrayList getChromosomeNames() { - - ArrayList chromosomeList = chromosomeIDTree.getChromosomeNames(); - return chromosomeList; - } - - /* - * Returns a chromosome ID which can be used to search for a corresponding - * data section in the R+ tree for data. - * - * Parameters: chromosomeKey - chromosome name of valid key size. - * - * - * Note: A chromosomeID of -1 means chromosome name not included in B+ tree. - */ - - public int getChromosomeID(String chromosomeKey) { - - int chromosomeID = chromosomeIDTree.getChromosomeID(chromosomeKey); - - return chromosomeID; - } - - /* - * Method finds the chromosome bounding region in R+ tree for a chromosome - * ID range. - * - * Parameters: startChromID - start chromosome for the region endChromID - - * end chromosome for the region - * - * Returns: Chromosome region bounds for chromosome ID range - */ - - public RPChromosomeRegion getChromosomeBounds(int startChromID, int endChromID) { -// assert chromosomeDataTree != null; - initChromosomeDataTree(); - RPChromosomeRegion chromosomeBounds = chromosomeDataTree.getChromosomeRegion(startChromID, endChromID); - - return chromosomeBounds; - } - - /* - * Method finds the chromosome bounds for the entire chromosome ID range in - * the R+ tree. - * - * Returns: chromosome bounds for the entire chromosome ID range in the R+ - * tree. - */ - - public RPChromosomeRegion getChromosomeBounds() { - initChromosomeDataTree(); -// assert chromosomeDataTree != null; - RPChromosomeRegion chromosomeBounds = chromosomeDataTree.getChromosomeBounds(); - - return chromosomeBounds; - } - - private void initChromosomeDataTree() { - if (chromosomeDataTree == null) { - // get R+ chromosome data location tree (Tables K, L, M, N) - chromDataTreeOffset = fileHeader.getFullIndexOffset(); - if (chromDataTreeOffset != 0) { - fileOffset = chromDataTreeOffset; - chromosomeDataTree = new RPTree(fis, fileOffset, isLowToHigh, uncompressBufSize); - } - - } - - } - - /* - * Method finds all chromosome data regions in the R+ tree. - * - * Returns: List of chromosome ID's and regions. - */ - public ArrayList getChromosomeRegions() { - assert chromosomeDataTree != null; - ArrayList regionList = chromosomeDataTree.getAllChromosomeRegions(); - - return regionList; - } - - /* - * Method finds all zoom level data regions in the R+ tree. - * - * Parameters: int zoomLevel - zoom level Returns: List of chromosome ID's - * and regions for the zoom level. - */ - - public ArrayList getZoomLevelRegions(int zoomLevel) { - assert zoomLevels != null; - ArrayList regionList = zoomLevels.getZoomLevelRPTree(zoomLevel).getAllChromosomeRegions(); - - return regionList; - } - - /** - * Returns an iterator for BigBed features which occupy a chromosome - * selection region. - *

- * Note: the BBFile type should be BigBed; else a null iterator is returned. - *

- * Parameters: startChromosome - name of start chromosome startBase - - * starting base position for features endChromosome - name of end - * chromosome endBase - ending base position for feature contained - flag - * specifies bed features must be contained in the specified base region if - * true; else can intersect the region if false - *

- * Returns: Iterator to provide BedFeature(s) for the requested chromosome - * region. Error conditions: 1) An empty iterator is returned if region has - * no data available 2) A null object is returned if the file is not - * BigBed.(see isBigBedFile method) - */ - public BigBedIterator getBigBedIterator(String startChromosome, int startBase, String endChromosome, int endBase, - boolean contained) { - - if (!isBigBedFile()) - return null; - - initChromosomeDataTree(); - // if (chromosomeDataTree == null) { - // // get R+ chromosome data location tree (Tables K, L, M, N) - // chromDataTreeOffset = fileHeader.getFullIndexOffset(); - // if (chromDataTreeOffset != 0) { - // fileOffset = chromDataTreeOffset; - // chromosomeDataTree = new RPTree(fis, fileOffset, isLowToHigh, - // uncompressBufSize); - // } - // - // } - // go from chromosome names to chromosome ID region - RPChromosomeRegion selectionRegion = getChromosomeBounds(startChromosome, startBase, endChromosome, endBase); - - // check for valid selection region - if (selectionRegion == null) - return new BigBedIterator(); // an empty iterator - - // compose an iterator - BigBedIterator bedIterator = new BigBedIterator(fis, chromosomeIDTree, chromosomeDataTree, selectionRegion, - contained); - - return bedIterator; - } - - /** - * Returns an iterator for BigBed features for all chromosome regions. - *

- * Note: the BBFile type should be BigBed; else a null iterator is returned. - *

- * Returns: Iterator to provide BedFeature(s) for all chromosome regions. - * Error conditions: 1) An empty iterator is returned if region has no data - * available 2) A null object is returned if the file is not BigBed.(see - * isBigBedFile method) - */ - public BigBedIterator getBigBedIterator() { - - if (!isBigBedFile()) - return null; - - if (chromosomeDataTree == null) { - // get R+ chromosome data location tree (Tables K, L, M, N) - chromDataTreeOffset = fileHeader.getFullIndexOffset(); - if (chromDataTreeOffset != 0) { - fileOffset = chromDataTreeOffset; - chromosomeDataTree = new RPTree(fis, fileOffset, isLowToHigh, uncompressBufSize); - } - - } - - // get all region bounds - RPChromosomeRegion selectionRegion = chromosomeDataTree.getChromosomeBounds(); - - // compose an iterator - boolean contained = true; // / all regions are contained - BigBedIterator bedIterator = new BigBedIterator(fis, chromosomeIDTree, chromosomeDataTree, selectionRegion, - contained); - - return bedIterator; - } - - /** - * Returns an iterator for BigWig values which occupy the specified - * startChromosome region. - *

- * Note: the BBFile type should be BigWig; else a null iterator is returned. - *

- * Parameters: startChromosome - name of start chromosome startBase - - * starting base position for features endChromosome - name of end - * chromosome endBase - ending base position for feature contained - flag - * specifies bed features must be contained in the specified base region if - * true; else can intersect the region if false - *

- * Returns: Iterator to provide BedFeature(s) for the requested chromosome - * region. Error conditions: 1) An empty iterator is returned if region has - * no data available 2) A null object is returned if the file is not - * BigWig.(see isBigWigFile method) - */ - public BigWigIterator getBigWigIterator(String startChromosome, int startBase, String endChromosome, int endBase, - boolean contained) { - - if (chromosomeDataTree == null) { - // get R+ chromosome data location tree (Tables K, L, M, N) - chromDataTreeOffset = fileHeader.getFullIndexOffset(); - if (chromDataTreeOffset != 0) { - fileOffset = chromDataTreeOffset; - chromosomeDataTree = new RPTree(fis, fileOffset, isLowToHigh, uncompressBufSize); - } - - } - - if (!isBigWigFile()) - return null; - - // go from chromosome names to chromosome ID region - RPChromosomeRegion selectionRegion = getChromosomeBounds(startChromosome, startBase, endChromosome, endBase); - - // check for valid selection region - if (selectionRegion == null) - return new BigWigIterator(); - - // compose an iterator - BigWigIterator wigIterator = new BigWigIterator(fis, chromosomeIDTree, chromosomeDataTree, selectionRegion, - contained); - - return wigIterator; - } - - /** - * Returns an iterator for BigWig values for all chromosome regions. - *

- * Note: the BBFile type should be BigWig; else a null iterator is returned. - *

- * Returns: Iterator to provide BedFeature(s) for all chromosome regions. - * Error conditions: 1) An empty iterator is returned if region has no data - * available 2) A null object is returned if the file is not BigWig.(see - * isBigWigFile method) - */ - public BigWigIterator getBigWigIterator() { - - if (!isBigWigFile()) - return null; - - if (chromosomeDataTree == null) { - // get R+ chromosome data location tree (Tables K, L, M, N) - chromDataTreeOffset = fileHeader.getFullIndexOffset(); - if (chromDataTreeOffset != 0) { - fileOffset = chromDataTreeOffset; - chromosomeDataTree = new RPTree(fis, fileOffset, isLowToHigh, uncompressBufSize); - } - - } - // get all regions bounds - RPChromosomeRegion selectionRegion = chromosomeDataTree.getChromosomeBounds(); - - // compose an iterator - boolean contained = true; // all regions are contained - BigWigIterator wigIterator = new BigWigIterator(fis, chromosomeIDTree, chromosomeDataTree, selectionRegion, - contained); - - return wigIterator; - } - - /** - * Returns an iterator for zoom level records for the chromosome selection - * region. - *

- * Note: the BBFile can be BigBed or BigWig. - *

- * Parameters: zoomLevel - zoom level for data extraction; levels start at 1 - * startChromosome - start chromosome name startBase - staring base position - * for features endChromosome - end chromosome name endBase - ending base - * position for feature contained - flag specifies bed features must be - * contained in the specified base region if true; else can intersect the - * region if false - *

- * Returns: Iterator to provide BedFeature(s) for the requested chromosome - * region. Error conditions: 1) An empty iterator is returned if region has - * no data available - */ - public ZoomLevelIterator getZoomLevelIterator(int zoomLevel, String startChromosome, int startBase, - String endChromosome, int endBase, boolean contained) { - // check for valid zoom level - if (zoomLevel < 1 || zoomLevel > zoomLevelCount) - throw new RuntimeException("Error: ZoomLevelIterator zoom level is out of range\n"); - - // get the appropriate zoom level R+ zoom data index tree - RPTree zoomDataTree = zoomLevels.getZoomLevelRPTree(zoomLevel); - - // go from chromosome names to chromosome ID region - RPChromosomeRegion selectionRegion = getChromosomeBounds(startChromosome, startBase, endChromosome, endBase); - - // check for valid selection region - if (selectionRegion == null) { - return ZoomLevelIterator.EmptyIterator.theInstance; - } - - // / compose an iterator - ZoomLevelIterator zoomIterator = new ZoomLevelIterator(fis, chromosomeIDTree, zoomDataTree, zoomLevel, - selectionRegion, contained); - - return zoomIterator; - } - - /** - * Returns an iterator for zoom level records for all chromosome regions. - *

- * Note: the BBFile can be BigBed or BigWig. - *

- * Parameters: zoomLevel - zoom level for data extraction; levels start at 1 - *

- * Returns: Iterator to provide BedFeature(s) for the requested chromosome - * region. Error conditions: 1) An empty iterator is returned if region has - * no data available - */ - public ZoomLevelIterator getZoomLevelIterator(int zoomLevel) { - - // check for valid zoom level - if (zoomLevel < 1 || zoomLevel > zoomLevelCount) - throw new RuntimeException("Error: ZoomLevelIterator zoom level is out of range\n"); - - // get the appropriate zoom level R+ zoom data index tree - RPTree zoomDataTree = zoomLevels.getZoomLevelRPTree(zoomLevel); - - // get all regions bounds - RPChromosomeRegion selectionRegion = zoomDataTree.getChromosomeBounds(); - - // compose an iterator - boolean contained = true; // all regions are contained - ZoomLevelIterator zoomIterator = new ZoomLevelIterator(fis, chromosomeIDTree, zoomDataTree, zoomLevel, - selectionRegion, contained); - - return zoomIterator; - } - - /** - * Returns an iterator for zoom level records for the chromosome selection - * region. - *

- * Note: the BBFile can be BigBed or BigWig. - *

- * Parameters: zoomLevel - zoom level for data extraction; levels start at 1 - * selectionRegion - chromosome selection region consists of: startChromID - - * ID of starting chromosome startBase - staring base position for features - * endChromID - ID of endind chromosome endBase - ending base position for - * feature contained - flag specifies bed features must be contained in the - * specified base region if true; else can intersect the region if false - *

- * Returns: Iterator to provide BedFeature(s) for the requested chromosome - * region. Error conditions: 1) An empty iterator is returned if region has - * no data available - */ - public ZoomLevelIterator getZoomLevelIterator(int zoomLevel, RPChromosomeRegion selectionRegion, boolean contained) { - // check for valid zoom level - if (zoomLevel < 1 || zoomLevel > zoomLevelCount) - throw new RuntimeException("Error: ZoomLevelIterator zoom level is out of range\n"); - - // get the appropriate zoom level R+ zoom data index tree - RPTree zoomDataTree = zoomLevels.getZoomLevelRPTree(zoomLevel); - - // / compose an iterator - ZoomLevelIterator zoomIterator = new ZoomLevelIterator(fis, chromosomeIDTree, zoomDataTree, zoomLevel, - selectionRegion, contained); - - return zoomIterator; - } - - /* - * Method generates a chromosome bounds region for the supplied chromosome - * region name. - * - * Note: No attempt is made to verify the region exists in the file data, - * nor which data is being examined. - * - * Parameters: startChromosome - name of start chromosome startBase - - * starting base position for region endChromosome - name of end chromosome - * endBase - ending base position for region - * - * Returns: Chromosome bounds of a named chromosome region for data - * extraction; or null for regions not found in the B+ chromosome index - * tree. - */ - - private RPChromosomeRegion getChromosomeBounds(String startChromosome, int startBase, String endChromosome, - int endBase) { - - // If the chromosome name length is > the key size we can't distinguish - // it - if (startChromosome.length() > chromosomeIDTree.getKeySize()) { - return null; - } - - // find the chromosome ID's using the name to get a valid name key, then - // associated ID - String startChromKey = chromosomeIDTree.getChromosomeKey(startChromosome); - int startChromID = chromosomeIDTree.getChromosomeID(startChromKey); - if (startChromID < 0) // mChromosome not in data? - return null; - - String endChromKey = chromosomeIDTree.getChromosomeKey(endChromosome); - int endChromID = chromosomeIDTree.getChromosomeID(endChromKey); - if (endChromID < 0) // mChromosome not in data? - return null; - - // create the bounding mChromosome region - RPChromosomeRegion chromBounds = new RPChromosomeRegion(startChromID, startBase, endChromID, endBase); - - return chromBounds; - } - - /* - * Method reads data count which heads the data section of the BBFile. - * - * Returns: Data count of the number of data records: number of Bed features - * for BigBed number of Wig sections for BigWig - */ - - private int getDataCount(SeekableStream fis, long fileOffset) { - int dataCount; - LittleEndianInputStream lbdis = null; - DataInputStream bdis = null; - - // Note: dataCount in BBFile is simply a 4 byte int - // positioned at fullDataOffset in Table C - byte[] buffer = new byte[4]; - - try { - // read dataCount into a buffer - fis.seek(fileOffset); - // fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - - // decode data count with proper byte stream reader - // first assume byte order is low to high - if (isLowToHigh) { - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(buffer)); - dataCount = lbdis.readInt(); - } else { - bdis = new DataInputStream(new ByteArrayInputStream(buffer)); - dataCount = bdis.readInt(); - } - } catch (IOException ex) { - throw new RuntimeException("Error reading data count for all data", ex); - } - - // data count was read properly - return dataCount; - } - - public Locator getLocator() { - return path; - } - -} // end of BBFileReader diff --git a/src/org/broad/igv/bbfile/BBTotalSummaryBlock.java b/src/org/broad/igv/bbfile/BBTotalSummaryBlock.java deleted file mode 100644 index 7339879..0000000 --- a/src/org/broad/igv/bbfile/BBTotalSummaryBlock.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.samtools.seekablestream.SeekableStream; - -import org.broad.tribble.LittleEndianInputStream; -import org.broad.tribble.SeekableStreamUtils; - -/* -* Containeer class for file statistics - BBFile Table DD -* -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BBTotalSummaryBlock { - - private static Logger log = Logger.getLogger(BBTotalSummaryBlock.class.getCanonicalName()); - - public static final int TOTAL_SUMMARY_BLOCK_SIZE = 40; - - // defines the R+ Tree access - private SeekableStream fis; // BBFile handle - private long summaryBlockOffset; // file offset to TotalSummaryBlock - - // File data statistics for calculating mean and standard deviation - private long basesCovered; // number of bases with data - private float minVal; // minimum value for file data - private float maxVal; // maximum value for file data - private float sumData; // sum of all squares of file data values - private float sumSquares; // sum of all squares of file data values - - /* - * Constructor for reading in TotalSummaryBlock from BBFile - * - * Parameters: - * fis - file input stream handle - * fileOffset - file offset to TotalSummaryBlock - * isLowToHigh - indicates byte order is low to high if true, else is high to low - * */ - public BBTotalSummaryBlock(SeekableStream fis, long fileOffset, boolean isLowToHigh) - { - - LittleEndianInputStream lbdis = null; - DataInputStream bdis = null; - - byte[] buffer = new byte[TOTAL_SUMMARY_BLOCK_SIZE]; - - // save the seekable file handle and B+ Tree file offset - this.fis = fis; - summaryBlockOffset = fileOffset; - - try { - // Read TotalSummaryBlock header into a buffer - fis.seek(fileOffset); - //fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - // decode header - if(isLowToHigh) - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(buffer)); - else - bdis = new DataInputStream(new ByteArrayInputStream(buffer)); - - // Get TotalSummaryBlcok information - if(isLowToHigh){ - basesCovered = lbdis.readLong(); - minVal = lbdis.readFloat(); - maxVal = lbdis.readFloat(); - sumData = lbdis.readFloat(); - sumSquares = lbdis.readFloat(); - } - else { - basesCovered = bdis.readLong(); - minVal = bdis.readFloat(); - maxVal = bdis.readFloat(); - sumData = bdis.readFloat(); - sumSquares = bdis.readFloat(); - } - - }catch(IOException ex) { - log.log(Level.SEVERE,"Error reading Total Summary Block ", ex); - throw new RuntimeException("Error reading Total Summary Block", ex); - } - - } - - /* - * Constructor for filling in TotalSummaryBlock - * */ - public BBTotalSummaryBlock(long basesCovered, float minVal, float maxVal, - float sumData, float sumSquares){ - - this.basesCovered = basesCovered; - this.minVal = minVal; - this.maxVal = maxVal; - this.sumData = sumData; - this.sumSquares = sumSquares; - - } - - public static int getSummaryBlockSize() { - return TOTAL_SUMMARY_BLOCK_SIZE; - } - - public SeekableStream getMBBFis() { - return fis; - } - - public long getSummaryBlockOffset() { - return summaryBlockOffset; - } - - public long getBasesCovered() { - return basesCovered; - } - - public float getMinVal() { - return minVal; - } - - public float getMaxVal() { - return maxVal; - } - - public float getSumData() { - return sumData; - } - - public float getSumSquares() { - return sumSquares; - } - - public void printTotalSummaryBlock(){ - - // Table D - Zoom Level Header information - log.info("BBFile TotalSummaryBlock (Table DD):"); - log.info("Number of bases covered= " + basesCovered); - log.info("MinVal = " + minVal); - log.info("MaxVal = " + maxVal); - log.info("Sum of data values = "+ sumData); - log.info("Sum of squares values = " + sumSquares); - } - -} diff --git a/src/org/broad/igv/bbfile/BBZoomLevelFormat.java b/src/org/broad/igv/bbfile/BBZoomLevelFormat.java deleted file mode 100644 index 6ea6412..0000000 --- a/src/org/broad/igv/bbfile/BBZoomLevelFormat.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.broad.tribble.LittleEndianInputStream; -import net.sf.samtools.seekablestream.SeekableStream; - -import org.broad.tribble.SeekableStreamUtils; - - -/* -* Container class for holding zoom level format information, BBFile Table O. -* -* Note: The header section corresponds to Table O and the file location for -* zoomCount is identified by the dataOffset entry in BBFile zoom level headers -* Table D. -* -* The zoomCount field in Table O is uncompressed, but the zoomData section is compressed. -* -* Note: -* Table P describes the zoom data record format. It contain statistics for -* mChromosome regions in the zoom data. There are Table O zoomCount data records -* read into the ZoomDataRecords array. -* -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BBZoomLevelFormat { - - private static Logger log = Logger.getLogger(BBZoomLevelFormat.class.getCanonicalName()); - - // size of zoom level format header is 4 byte; only accounts for zoomCount of Table O - public static final int ZOOM_FORMAT_HEADER_SIZE = 4; - - // Perhaps there is a better way to know the top permitted record count - public static final int MAX_ZOOM_DATA_RECORDS = 100000000; - - // defines the zoom data file access - private int zoomLevel; // zoom level for data - private SeekableStream fis; // BBFile handle - private long zoomFormatOffset; // BBFile zoom level data format offset - private long zoomDataOffset; // BBFile zoom level data offset - private long zoomIndexOffset; // BBFile zoom level R+ tree offset - - // data reader members - private boolean isLowToHigh; // zoom data low to high byte order if true; else high to low - - // zoom level data - BBFile Table O - private int zoomRecordCount; // number of data records; zoomCount in Table O - private long zoomDataSize; // number of (compressed) zoom level data bytes - - /* - * constructor - reads zoom level format (but not the data) for a zoom level. - * - * Parameters: - * zoomLevel - zoom level; from 1 to zoomLevels in Table C File Header - * fis - input stream reader handle - * fileOffset - file location for the zoom format table - * ` datasize - byte size of (compressed/uncompressed) zoom data block - * isLowToHigh - boolean flag indicates if buffer data is arranged low to high byte - * uncompressBufSize - buffer size for decompressed data; or 0 for uncompressed - * - * Note: Zoom level data Table O is arranged as: - * zoomCount - 4 bytes - * zoomData - dataSize bytes - * R+ zoom index starts at fileOffset + dataSize - * */ - public BBZoomLevelFormat(int zoomLevel, SeekableStream fis, long fileOffset, - long dataSize, boolean isLowToHigh, int uncompressBufSize) { - - // store file access info - this.zoomLevel = zoomLevel; - this.fis = fis; - zoomFormatOffset = fileOffset; - zoomDataSize = dataSize; - this.isLowToHigh = isLowToHigh; - - // Note: a bad zoom data header will result in a 0 count returned - // or an IOException - - // size of buffer is ZOOM_FORMAT_HEADER_SIZE to get the record count - byte[] buffer = new byte[ZOOM_FORMAT_HEADER_SIZE]; - - try { - - // Read zoom level data format into a buffer - fis.seek(zoomFormatOffset); -// fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - // decode header - or fail - if(this.isLowToHigh) { - LittleEndianInputStream lbdis = new LittleEndianInputStream(new ByteArrayInputStream(buffer)); - zoomRecordCount = lbdis.readInt(); - } - else { - DataInputStream bdis = new DataInputStream(new ByteArrayInputStream(buffer)); - zoomRecordCount = bdis.readInt(); - } - - } catch (IOException ex) { - log.log(Level.SEVERE,"Error reading zoom level data records (Table O) ", ex); - throw new RuntimeException("Error reading zoom level data records (Table O)", ex); - } - - // integrity check - should be > 0 or less than a max like 100M records? - // Note: if trouble reading zoom data records, readAllZoomLevelRecords returns 0 - if(zoomRecordCount < 0 || zoomRecordCount > MAX_ZOOM_DATA_RECORDS) - return; // terminate if bad zoom level data encountered - - // Position file offset past the current zoom level header to pick up - // the zoom data records which immediately follow. - zoomDataOffset = zoomFormatOffset + ZOOM_FORMAT_HEADER_SIZE; - - // calculate the position of the R+ zoom index tree - zoomIndexOffset = zoomDataOffset + zoomDataSize; - } - - /* - * Method returns the zoom level for zoom data. - * - * Returns: - * zoom level for zoom data - * */ - public int getZoomLevel() { - return zoomLevel; - } - - /* - * Method returns the file input stream handle. - * - * Returns: - * file input stream handle - * */ - public SeekableStream getBBFis() { - return fis; - } - - /* - * Method returns the file location for zoom data format. - * - * Returns: - * file location for zoom data format - * */ - public long getZoomFormatLocation() { - return zoomFormatOffset; - } - - /* - * Method returns the zoom count found in the zoom level format header . - * - * Note: Zoom count is zoomCount in Table O. - * - * Returns: - * file location for zoom level R+ data records - * */ - public int getZoomRecordCount() { - return zoomRecordCount; - } - - /* - * Method returns the file location for zoom level data. - * - * Note: ZoomFormatOffset (Table D dataOffset) + zoom data header size - * - * Returns: - * file location for zoom level R+ data records - * */ - public long getZoomDataOffset() { - return zoomDataOffset; - } - - /* - * Method returns the calculated compressed zoom level data byte size. - * - * Note: Compressed data size is calculated from Table D - * (indexOffset - dataOffset) and is provided by the constructor. - * - * Returns: - * calculated compressed zoom level data byte size - * */ - public long getZoomDataSize() { - return zoomDataSize; - } - - /* - * Method returns the calculated file location for zoom level R+ tree. - * - * Note: should be equal to indexOffset in zoom level header - Table D - * - * Returns: - * file location for zoom level R+ tree - * */ - public long getZoomIndexOffset() { - return zoomIndexOffset; - } - - - public void print(){ - - // identify the zoom level and record count - log.info("Zoom level " + zoomLevel + " format Table O found at " - + zoomFormatOffset); - log.info("Zoom record count is " + zoomRecordCount); - log.info("Zoom data location is " + zoomDataOffset); - log.info("Zoom data size is " + zoomDataOffset); - log.info("Zoom index tree location is " + zoomIndexOffset); - } - -} diff --git a/src/org/broad/igv/bbfile/BBZoomLevelHeader.java b/src/org/broad/igv/bbfile/BBZoomLevelHeader.java deleted file mode 100644 index 4296792..0000000 --- a/src/org/broad/igv/bbfile/BBZoomLevelHeader.java +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.broad.tribble.SeekableStreamUtils; - -import org.broad.tribble.LittleEndianInputStream; -import net.sf.samtools.seekablestream.SeekableStream; - - -/* -* Container class for holding zoom level header information, BBFile Table D. -* -* Constructed either from BBFile read or by load of header values. -* -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BBZoomLevelHeader { - - private static Logger log = Logger.getLogger(BBZoomLevelHeader.class.getCanonicalName()); - - static public final int ZOOM_LEVEL_HEADER_SIZE = 24; - - // Defines the Big Binary File (BBFile) access - private SeekableStream fis; // BBFile input stream handle - private long zoomLevelHeaderOffset; // file location for zoom level header - int zoomLevel; // the zoom level for this information - - // zoom level header information - BBFile Table D - private int reductionLevel; // number of bases summerized - private int reserved; // reserved, currently 0 - private long dataOffset; // file position of zoom data - private long indexOffset; // file position for index of zoomed data - - /* - * Constructor reads zoom level header - * - * Parameters: - * fis - File input stream handle - * fileOffset - file byte position for zoom header - * zoomLevel - level of zoom - * isLowToHigh - indicates byte order is low to high, else is high to low - * */ - public BBZoomLevelHeader(SeekableStream fis, long fileOffset, int zoomLevel, - boolean isLowToHigh){ - - this.fis = fis; - zoomLevelHeaderOffset = fileOffset; - this.zoomLevel = zoomLevel; - - readZoomLevelHeader(zoomLevelHeaderOffset, this.zoomLevel, isLowToHigh); - } - /* - * Constructor loads zoom level header according to parameter specification. - * - * Parameters: (as defined above) - * */ - public BBZoomLevelHeader(int zoomLevel, int reductionLevel, int reserved, - long dataOffset, long indexOffset){ - this.zoomLevel = zoomLevel; - this.reductionLevel = reductionLevel; - this.reserved = reserved; - this.dataOffset = dataOffset; - this.indexOffset = indexOffset; - } - - /* - * Method returns the zoom level. - * - * Returns: - * zoom level - * */ - public int getZoomLevel() { - return zoomLevel; - } - - /* - * Method returns the reduction level for the zoom level. - * - * Returns: - * reduction level - * * */ - public int getReductionLevel() { - return reductionLevel; - } - - /* - * Method returns the reserved value. - * - * Returns: - * reserved value - * * */ - public int getReserved() { - return reserved; - } - - /* - * Method returns the zoom level data file location. - * - * Returns: - * zoom level data file location - * */ - public long getDataOffset() { - return dataOffset; - } - - /* - * Method returns the zoom level R+ index tree file location. - * - * Returns: - * R+ index tree file location - * */ - public long getIndexOffset() { - return indexOffset; - } - - /* - * Method prints the zoom level header info. - * */ - public void print(){ - - // Table D - Zoom Level Header information - System.out.println("Zoom level " + zoomLevel + " header Table D: "); - System.out.println("Number of zoom level bases = " + reductionLevel); - System.out.println("Reserved = " + reserved); - System.out.println("Zoom data offset = " + dataOffset); - System.out.println("Zoom index offset = " + indexOffset); - } - - /* - * Reads zoom level header information into class data members. - * - * Parameters: - * fileOffset - Byte position in fle for zoom header - * zoomLevel - level of zoom - * isLowToHigh - indicate byte order is low to high, else is high to low - * */ - private void readZoomLevelHeader(long fileOffset, int zoomLevel, boolean isLowToHigh) { - - LittleEndianInputStream lbdis = null; - DataInputStream bdis = null; - - byte[] buffer = new byte[ZOOM_LEVEL_HEADER_SIZE]; - - try { - - // Read zoom header into a buffer - fis.seek(fileOffset); - // fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - // decode header - if(isLowToHigh) - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(buffer)); - else - bdis = new DataInputStream(new ByteArrayInputStream(buffer)); - - // Get zoom level information - if(isLowToHigh){ - reductionLevel = lbdis.readInt(); - reserved = lbdis.readInt(); - dataOffset = lbdis.readLong(); - indexOffset = lbdis.readLong(); - } - else { - reductionLevel = bdis.readInt(); - reserved = bdis.readInt(); - dataOffset = bdis.readLong(); - indexOffset = bdis.readLong(); - } - - }catch(IOException ex) { - log.log(Level.SEVERE,"Error reading zoom level header: " + zoomLevel, ex); - throw new RuntimeException("Error reading zoom header " + zoomLevel, ex); - } - } - - -} diff --git a/src/org/broad/igv/bbfile/BBZoomLevels.java b/src/org/broad/igv/bbfile/BBZoomLevels.java deleted file mode 100644 index 1078b25..0000000 --- a/src/org/broad/igv/bbfile/BBZoomLevels.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.ArrayList; -import java.util.logging.Logger; - -import net.sf.samtools.seekablestream.SeekableStream; - - - -/* -* Container class which reads BBFile zoom information into ArrayLists. -* -* 1) Reads in Zoom Level Header Table D into Zoom Headers and -* loads them into the ZoomLevelHeader array, one for each zoom level. -* -* 2) Reads in Table O overall zoom level format as referenced -* by dataOffset in Table D. -* -* Note: Zoom levels count from Table C is validated by BBZoomLevelHeader, -* which will throw a RuntimeException if header is not found. -* -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BBZoomLevels { - - private static Logger log = Logger.getLogger(BBZoomLevels.class.getCanonicalName()); - - // defines the zoom headers access - //private SeekableStream fis; // BBFile handle - private long zoomHeadersOffset; // BBFile first zoom header offset - private int zoomLevelsCount; // BB File header Table C specified zoom levels - - // zoom level headers - Table D , one for each zoom level - // Note: array size determines how many zoom levels actually read - private ArrayList zoomLevelHeaders; // zoom level headers - - // zoom level data formats - BBFile Table O - private ArrayList zoomLevelFormatList; - - // zoom level R+ trees - one per level - private ArrayList zoomLevelRPTree; - - /* - * constructor - reads zoom level headers and data format from file I/O stream - * for all zoom levels and acts as a container for zoom data records. - * - * Parameters: - * fis - file input stream handle - * fileOffset - file byte location for zoom level headers - * zoomLevels - count of zoom levels from BBFile Table C - * isLowToHigh - boolean flag indicates if values are arranged low to high bytes. - * uncompressBufSize - byte size of the buffer to use for decompression - * */ - - public BBZoomLevels(SeekableStream fis, long fileOffset, int zoomLevels, - boolean isLowToHigh, int uncompressBufSize){ - int zoomLevel; - int zoomHeadersRead; - long zoomDataOffset; - long zoomIndexOffset; - - // save the seekable file handle and zoom zoomLevel headers file offset - //this.fis = fis; - zoomHeadersOffset = fileOffset; - zoomLevelsCount = zoomLevels; - - // Note: a bad zoom header will result in a 0 count returned - zoomHeadersRead = readZoomHeaders(fis, zoomHeadersOffset, zoomLevels, isLowToHigh); - - if(zoomHeadersRead > 0){ - - // create zoom level data format containers - zoomLevelFormatList = new ArrayList(); - - // for each zoom zoomLevel, get associated zoom data format - for(int index = 0; index < zoomHeadersRead; ++index) { - - zoomLevel = index + 1; - - // Zoom dataOffset (from Table D) is file location for zoomCount (Table O) - // Note: This dataOffset is zoomFormatLocation in BBZoomLevelFormat. - zoomDataOffset = zoomLevelHeaders.get(index).getDataOffset(); - - // R+ zoom index offset (Table D) marks end of zoom data in the - // zoom level format (Table O) - long dataSize = zoomLevelHeaders.get(index).getIndexOffset() - zoomDataOffset - - BBZoomLevelFormat.ZOOM_FORMAT_HEADER_SIZE; - - // get zoom zoomLevel data records - zoomDataOffset references zoomCount in Table O - // Note: zoom zoomLevel data records read their own data - BBZoomLevelFormat zoomLevelData = new BBZoomLevelFormat(zoomLevel, fis, zoomDataOffset, - dataSize, isLowToHigh, uncompressBufSize); - - zoomLevelFormatList.add(zoomLevelData); - } - - // create zoom level R+ tree containers - zoomLevelRPTree = new ArrayList(); - - // for each zoom zoomLevel, get associated R+ tree - for(int index = 0; index < zoomHeadersRead; ++index) { - - // Zoom indexOffset (from Table D) is file location - // for Table O zoomIndex for R+ tree zoom data - zoomIndexOffset = zoomLevelHeaders.get(index).getIndexOffset(); - - // get Zoom Data R+ Tree (Tables K, L, M, N): exists for zoom levels - RPTree zoomRPTree = new RPTree(fis, zoomIndexOffset, isLowToHigh, uncompressBufSize); - - if(zoomRPTree.getNodeCount() > 0) - zoomLevelRPTree.add(zoomRPTree); - } - } - } - - /* - * Method returns the BBFile's first zoom header file offset. - * - * Note zoom headers immediately follow the BBFile header (Table C) - * - * Returns: - * first zoom header file offset - * */ - public long getZoomHeadersOffset() { - return zoomHeadersOffset; - } - - /* - * Method returns the number of zoom level headers found. - * - * Note Should match zoomLevels in the BBFile header (Table C) - * - * Returns: - * number of zoom level headers found - * */ - public int getZoomHeaderCount() { - return zoomLevelHeaders.size(); - } - - /* - * Method returns the zoom level headers. - * - * Returns: - * zoom level headers - * */ - public ArrayList getZoomLevelHeaders() { - return zoomLevelHeaders; - } - - /* - * Method returns the zoom level header for specified level. - * - * Parameters: - * level - zoom level; level starts at 1 - * - * Returns: - * Zoom level header for specified level; or null for bad zoom level. - * */ - public BBZoomLevelHeader getZoomLevelHeader(int level) { - if(level < 1 || level > zoomLevelsCount) - return null; - - return zoomLevelHeaders.get(level - 1); - } - - /* - * Method returns the zoom level formats for zoom data. - * - * Returns: - * zoom level formats for zoom data - * */ - public ArrayList getZoomLevelFormats(){ - return zoomLevelFormatList; - } - - /* - * Method returns the R+ index tree for the specified zoom level. - * - * Parameters: - * level - zoom level; level starts at 1 - * - * Returns: - * R+ index tree for the specified zoom level; or null for bad zoom level - * */ - public RPTree getZoomLevelRPTree(int level) { - if(level < 1 || level > zoomLevelsCount) - return null; - - return zoomLevelRPTree.get(level - 1); - } - - // prints out the zoom level header information - public void printZoomHeaders() { - - // note if successfully read - should always be correct - if(zoomLevelHeaders.size() == zoomLevelsCount) - log.info("Zoom level headers read for " + zoomLevelsCount + " levels:"); - - else - log.severe("Zoom level headers not successfully read for " - + zoomLevelsCount + "levels."); - - for( int index = 0; index < zoomLevelHeaders.size(); ++index) { - - // zoom level headers print themselves - zoomLevelHeaders.get(index).print(); - } - - } - - /* - * Reads in all the Zoom Headers. - * - * Parameters: - * fileOffset - File byte location for first zoom level header - * zoomLevels - count of zoom levels to read in - * isLowToHigh - indicate byte order is lwo to high, else is high to low - * - * Returns: - * Count of zoom levels headers read, or 0 for failure to find the - * header information. - * */ - private int readZoomHeaders(SeekableStream fis, long fileOffset, int zoomLevels, boolean isLowToHigh) { - int level = 0; - BBZoomLevelHeader zoomLevelHeader; - - if(zoomLevels < 1) - return 0; - - // create zoom headers and data containers - zoomLevelHeaders = new ArrayList(); - - // get zoom header information for each zoom levelsRead - for(int index = 0; index < zoomLevels; ++index) { - level = index + 1; - - // read zoom level header - read error is returned as Runtime Exception - zoomLevelHeader = new BBZoomLevelHeader(fis, fileOffset, level, isLowToHigh); - - zoomLevelHeaders.add(zoomLevelHeader); - - fileOffset += BBZoomLevelHeader.ZOOM_LEVEL_HEADER_SIZE; - } - - return level; - } - -} diff --git a/src/org/broad/igv/bbfile/BPTree.java b/src/org/broad/igv/bbfile/BPTree.java deleted file mode 100644 index 3289b28..0000000 --- a/src/org/broad/igv/bbfile/BPTree.java +++ /dev/null @@ -1,705 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Logger; - -import org.broad.tribble.SeekableStreamUtils; - -import org.broad.tribble.LittleEndianInputStream; -import net.sf.samtools.seekablestream.SeekableStream; - - -/* -* B+ Tree class will construct a B+ tree from a binary Bed/Wig BBFile. -* (or by insertion of tree nodes - TBD see insert method) -* -* 1) BPTree will first read in the B+ tree header with BPTreeHeader class. -* -* 2) Starting with the root node, the readBPTreeNode method will read in the -* node format, determine if the node contains child nodes (isLeaf = false) -* or leaf items (isLeaf = true). -* -* 3) If node is a leaf node, all leaf items are read in to the node's leaf array. -* -* 4) If node is a child node, readBPTreeNode will be called recursively, -* until the leaf node is encountered, where step 3 is performed. -* -* 5) The child nodes will be populated with their child node items in reverse order -* of recursion from step 4, until the tree is completely populated -* back up to the root node. -* -* 6) The getChromosomeKey is provided to construct a valid key for B+ -* chromosome tree searches, and getChromosomeID returns a chromosome ID for -* searches in the R+ index tree. -* -**/ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BPTree { - - private static Logger log = Logger.getLogger(BPTree.class.getCanonicalName()); - - public static final int BPTREE_NODE_FORMAT_SIZE = 4; // node format size - public static final int BPTREE_NODE_ITEM_SIZE = 8; // Plus keySize to be added - - // B+ tree access variables - for reading in B+ tree nodes from a file - private SeekableStream fis; // file handle - BBFile input stream - private long treeOffset; // mChromosome B+ tree file offset - private BPTreeHeader treeHeader; // B+ tree header (Table E for BBFile) - - // B+ tree organizational variables - derived from Table E - private int blockSize; // number of children per block - private int keySize; // character size of primary key - private int valueSize; // number of bytes in value being indexed - private long itemCount; // number of contig/mChromosome items in tree - - // B+ tree nodal variables - private BPTreeNode rootNode; // B+ tree root node - private long nodeCount; // number of nodes defined in the B+ tree - private long leafCount; // number of leaves in the B+ tree - - /* - * Constructor for reading in a B+ tree from a BBFile/input stream. - * - * Parameters: - * fis - file input stream handle - * fileOffset - file offset to the B+ tree header - * isLowToHigh - indicates byte order is low to high, else is high to low - * */ - public BPTree(SeekableStream fis, long fileOffset, boolean isLowToHigh) { - - // Save the seekable file handle and B+ Tree file offset - // Note: the offset is the B+ Tree Header Table E file location - this.fis = fis; - treeOffset = fileOffset; - - // read in B+ tree header - verify the B+ tree info exits - treeHeader = new BPTreeHeader(this.fis, treeOffset, isLowToHigh); - - // log error if header not found and throw exception - if(!treeHeader.isHeaderOK()){ - int badMagic = treeHeader.getMagic(); - log.severe("Error reading B+ tree header: bad magic = " + badMagic); - throw new RuntimeException("Error reading B+ tree header: bad magic = " - + badMagic); - } - - // assign B+ tree specifications from the header - blockSize = treeHeader.getBlockSize(); - keySize = treeHeader.getKeySize(); - valueSize = treeHeader.getValSize(); - itemCount = treeHeader.getItemCount(); - - // populate the tree - read in the nodes - long nodeOffset = treeOffset + treeHeader.BPTREE_HEADER_SIZE; - BPTreeNode parentNode = null; // parent node of the root is itself, or null - - // get the root node - which recursively populates the remaining nodes - rootNode = readBPTreeNode(this.fis, nodeOffset, parentNode, isLowToHigh); - - } - - /* - * Method returns the file input stream handle - * */ - public SeekableStream getFis() { - return fis; - } - - /* - * Method returns the B+ tree file location - * */ - public long getBPTreeOffset() { - return treeOffset; - } - - /* - * Method returns the B+ tree header (Table E). - * */ - public BPTreeHeader getTreeHeader(){ - return treeHeader; - } - - /* - * Method returns the node block size (B+ order). - * */ - public int getBlockSize() { - return blockSize; - } - - /* - * Method returns the chromosome name key size, which is - * the number of valid characters for chromosome name. - * */ - public int getKeySize() { - return keySize; - } - - /* - * Method returns the indexing value size (currently 8). - * */ - public int getValueSize() { - return valueSize; - } - - /* - * Method returns the number of chromosome/contig names. - * */ - public long getItemCount() { - return itemCount; - } - - /* - * Method returns the number of nodes in the B+ tree. - * */ - public long getNodeCount() { - return nodeCount; - } - - /* - * Method returns the root node, from which all other nodes - * can be extracted. - * - * Returns: - * Root node - * */ - public BPTreeNode getRootNode() { - return rootNode; - } - - - Map chromosomeKeyCache = new HashMap(); - /* - * Returns a search key for the mChromosome region which can - * be used to search for a corresponding section in the B+ tree. - * - * According the the spec the key is the "first keySize characters of chromosome name, padded with zeroes if needed. - * */ - public String getChromosomeKey(String chromosome) { - - String key = chromosomeKeyCache.get(chromosome); - if(key == null) { - char [] keyChars = new char[keySize]; - char [] chrChars = chromosome.toCharArray(); - System.arraycopy(chrChars, 0, keyChars, 0, Math.min(keySize, chrChars.length)); - key = new String(keyChars); - chromosomeKeyCache.put(chromosome, key); - } - return key; - } - - /* - * Returns a chromosome ID which can be used to search for a - * corresponding data section in the R+ tree for data. - * - Parameters: - * chromKey - chromosome name of valid key size. - * - * - * Note: A chromosomeID of -1 means chromosome name not included in B+ tree. - * - * */ - public int getChromosomeID(String chromKey) { - int chromosomeID; - - // Search the B+ tree to extract the Chromosome ID. - BPTreeNode thisNode = rootNode; - - chromosomeID = findChromosomeID(thisNode, chromKey); - - return chromosomeID; - } - - /* - * Returns a chromosome name which is the B+ key for returning the - * chromosome ID for lookup in the R+ tree for data. - * - * Parameters: - * chromID - chromosome ID expected in B+ tree - * - * Returns: - * Chromosome name key; a null string means chromosome ID not found. - * - * */ - public String getChromosomeName(int chromID) { - String chromKey; - - // Search the B+ tree to extract the Chromosome ID. - BPTreeNode thisNode = rootNode; - - chromKey = findChromosomeName(thisNode, chromID); - - return chromKey; - } - - /* - * Method returns all chromosome key names in B+ tree. - * - * Returns: - * Collection of all (chromosome ID, chromosome name)entries - * */ - public ArrayList getChromosomeNames(){ - - // Search the B+ tree to extract the chromosome ID. - BPTreeNode thisNode = rootNode; - - ArrayList chromosomeList = new ArrayList(); - - findAllChromosomeNames(thisNode, chromosomeList); - - return chromosomeList; - } - - /* - * Method returns all chromosome name, chromosome ID pairs for a given ID range. - * - * Parameters: - * startChromID - starting ID for chromosome range expected in B+ tree - * endChromID - ending ID for chromosome range expected in B+ tree - * - * Returns: - * Collection of (chromosome ID, chromosome name key) hash items; - * where an empty collection means ID range was not found. - * - * */ - public HashMap getChromosomeIDMap(int startChromID, int endChromID){ - - // Search the B+ tree to extract the chromosome ID. - BPTreeNode thisNode = rootNode; - - HashMap chromosomeIDMap = new HashMap(); - - findChromosomeMap(thisNode, startChromID, endChromID, chromosomeIDMap); - - return chromosomeIDMap; - } - - // prints out the B+ Tree nodes and leaves - public void print() { - - // check if read in - if(!treeHeader.isHeaderOK()){ - int badMagic = treeHeader.getMagic(); - log.severe("Error reading B+ tree header: bad magic = " + badMagic); - return; - } - - // print B+ tree header - treeHeader.print(); - - // print B+ tree node and leaf items - recursively - if(rootNode != null) - rootNode.printItems(); - } - - /* - * Method finds and returns the chromosome ID for the specified chromosome key. - * - * Note: This method recursively calls itself, traversing the full B+ tree until - * either the chromosome name key is found and returns a valid chromosome ID, - * or exits with a -1 value. - * - * Parameters: - * thisNode - tree node to start search - * chromKey - chromosome name key of valid key size. - * - * Returns: - * Valid chromosome ID if >= 0; else -1 for not found. - * */ - private int findChromosomeID( BPTreeNode thisNode, String chromKey){ - int chromID = -1; // until found - - // search down the tree recursively starting with the root node - if(thisNode.isLeaf()) - { - int nLeaves = thisNode.getItemCount(); - for(int index = 0; index < nLeaves; ++index){ - BPTreeLeafNodeItem leaf = (BPTreeLeafNodeItem)thisNode.getItem(index); - if(leaf == null){ - log.severe("Error finding B+ tree leaf nodes, corruption suspected"); - throw new RuntimeException("Error reading B+ tree leaf nodes, corruption suspected"); - } - - // test chromosome key match - if(leaf.chromKeysMatch(chromKey)){ - chromID = leaf.getChromID(); - break; - } - // else check next leaf - } - } - else { - // check all child nodes - int nNodes = thisNode.getItemCount(); - for(int index = 0; index < nNodes; ++index){ - - BPTreeChildNodeItem childItem = (BPTreeChildNodeItem)thisNode.getItem(index); - BPTreeNode childNode = childItem.getChildNode(); - - // check if key is in the node range - String lowestKey = childNode.getLowestChromKey(); - String highestKey = childNode.getHighestChromKey(); - - // test name key against key range - if(chromKey.compareTo(lowestKey) >= 0 - && chromKey.compareTo(highestKey) <= 0) { - - // keep going until leaf items are checked - chromID = findChromosomeID(childNode, chromKey); - - // check for chromKey match - if(chromID >= 0) - break; - } - } - } - - return chromID; - } - - /* - * Method finds and returns the chromosome name for the specified chromosome ID. - * - * Parameters: - * thisNode - tree node to start search - * chromID - B+ tree chromosome ID supplied for the chromosome key - * - * Returns: - * chromosome name if found; else a null string. - * */ - private String findChromosomeName( BPTreeNode thisNode, int chromID){ - - String chromKey = null; // mark unfound condition as an empty string - - // search down the tree recursively starting with the root node - if(thisNode.isLeaf()) - { - int nLeaves = thisNode.getItemCount(); - for(int index = 0; index < nLeaves; ++index){ - BPTreeLeafNodeItem leaf = (BPTreeLeafNodeItem)thisNode.getItem(index); - - if(leaf.getChromID() == chromID){ // mChromosome key match - chromKey = leaf.getChromKey(); - break; - } - // else check next leaf - } - } - else { - // check all child nodes - int nNodes = thisNode.getItemCount(); - for(int index = 0; index < nNodes; ++index){ - - BPTreeChildNodeItem childItem = (BPTreeChildNodeItem)thisNode.getItem(index); - BPTreeNode childNode = childItem.getChildNode(); - - // check if key is in the node range - int lowestID = childNode.getLowestChromID(); - int highestID = childNode.getHighestChromID(); - - // test chromosome ID against node ID range - if(chromID >= lowestID && chromID <= highestID) { - - // keep going until leaf items are checked - chromKey = findChromosomeName(childNode, chromID); - - // check for chromosome ID match - if(chromKey != null) - break; - } - } - } - - return chromKey; - } - - /* - * Method finds and returns all chromosome names in the B+ tree. - * - * Note: This method calls itself recursively until the full B+ tree is traversed. - * - * Parameters: - * thisNode - tree node to start search - * chromosomeList - list of all chromosome names found. - * - * Returns: - * Chromosome names found are added to the chromosome list passed in. - * */ - public void findAllChromosomeNames( BPTreeNode thisNode, ArrayList chromosomeList){ - - // search down the tree recursively starting with the root node - if(thisNode.isLeaf()) - { - // add all leaf names - int nLeaves = thisNode.getItemCount(); - for(int index = 0; index < nLeaves; ++index){ - - BPTreeLeafNodeItem leaf = (BPTreeLeafNodeItem)thisNode.getItem(index); - chromosomeList.add(leaf.getChromKey()); - } - } - else { - // get all child nodes - int nNodes = thisNode.getItemCount(); - for(int index = 0; index < nNodes; ++index){ - - BPTreeChildNodeItem childItem = (BPTreeChildNodeItem)thisNode.getItem(index); - BPTreeNode childNode = childItem.getChildNode(); - - // keep going until leaf items are extracted - findAllChromosomeNames(childNode, chromosomeList); - } - } - } - - /* - * Method finds and returns (chromosome ID, chromosome key name) pairs for the specified ID range. - * - * Parameters: - * thisNode - tree node to start search - * startChromID - starting chromosome ID for the chromosome range - * endChromID - ending chromosome ID for the chromosome range - * - * Returns: - * (chromosome ID, chromosome key name) items are added to the collection passed in. - * */ - private void findChromosomeMap( BPTreeNode thisNode, int startChromID, int endChromID, - HashMap chromosomeMap){ - int chromID; - int lowestID; - int highestID; - - // check if node is disjoint - lowestID = thisNode.getLowestChromID(); - if(lowestID > endChromID) - return; - - highestID = thisNode.getHighestChromID(); - if(highestID < startChromID) - return; - - // search down the tree recursively starting with the root node - if(thisNode.isLeaf()) - { - int nLeaves = thisNode.getItemCount(); - for(int index = 0; index < nLeaves; ++index){ - - BPTreeLeafNodeItem leaf = (BPTreeLeafNodeItem)thisNode.getItem(index); - chromID = leaf.getChromID(); - - // check for chromosome range match - if( chromID >= startChromID && chromID <= endChromID ){ - chromosomeMap.put(chromID, leaf.getChromKey()); - } - // leaf ID's are in ascending order; check for going out of range - else if(chromID > endChromID) - break; - } - } - else { - // check all child nodes - int nNodes = thisNode.getItemCount(); - for(int index = 0; index < nNodes; ++index){ - - BPTreeChildNodeItem childItem = (BPTreeChildNodeItem)thisNode.getItem(index); - BPTreeNode childNode = childItem.getChildNode(); - - // check if keys are in the node range - lowestID = childNode.getLowestChromID(); - highestID = childNode.getHighestChromID(); - - // test for chromosome range intersections - if( lowestID <= endChromID && highestID >= startChromID ) - findChromosomeMap(childNode, startChromID, endChromID, chromosomeMap); - - // test node ID range which is always in ascending order going out of range - else if(lowestID > endChromID) - break; // - } - } - } - - /* - * Method reads in the B+ tree nodes from the file, recursively. - * - * Parameters: - * fis - file input stream handle - * fileOffset - file offset for B+ tree header - * keySize - chromosome name key size in characters - * parent - parent node - * isLowToHigh - if true, indicates byte order is low to high; else is high to low - * - * Returns: - * Boolean which indicates if the B+ tree header was read correctly, with - * true for success, false for failure to find the header information. - * */ - private BPTreeNode readBPTreeNode(SeekableStream fis, long fileOffset, - BPTreeNode parent, boolean isLowToHigh){ - - LittleEndianInputStream lbdis = null; // low to high byte reader - DataInputStream bdis = null; // high to low byte reader - - // set up for node format - byte[] buffer = new byte[BPTREE_NODE_FORMAT_SIZE]; - BPTreeNode thisNode = null; - BPTreeNode childNode = null; - - byte type; - byte bval; - int itemCount; - int itemSize; - boolean isLeaf; - - try { - - // Read node format into a buffer - fis.seek(fileOffset); -// fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - - if(isLowToHigh) - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(buffer)); - else - bdis = new DataInputStream(new ByteArrayInputStream(buffer)); - - // find node type - if(isLowToHigh) - type = lbdis.readByte(); - else - type = bdis.readByte(); - - // create the B+ tree node - if(type == 1) { - isLeaf = true; - thisNode = new BPTreeLeafNode(++nodeCount); - } - else { - isLeaf = false; - thisNode = new BPTreeChildNode(++nodeCount); - } - - if(isLowToHigh) { - bval = lbdis.readByte(); // reserved - not currently used - itemCount = lbdis.readShort(); - } - else { - bval = bdis.readByte(); // reserved - not currently used - itemCount = bdis.readShort(); - } - - // Note: B+ tree node item size is the same for leaf and child items - itemSize = BPTREE_NODE_ITEM_SIZE + this.keySize; - int totalSize = itemSize * itemCount; - byte[] itemBuffer = new byte[totalSize]; -// fis.readFully(itemBuffer); - SeekableStreamUtils.readFully(itemBuffer, fis); - - if(isLowToHigh) - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(itemBuffer)); - else - bdis = new DataInputStream(new ByteArrayInputStream(itemBuffer)); - - // get the node items - leaves or child nodes - for(int item = 0; item < itemCount; ++item) { - - // always extract the key from the node format - char[] keychars = new char[keySize]; // + 1 for 0 byte - int index; - for(index = 0; index < keySize; ++index) { - - if(isLowToHigh) - bval = lbdis.readByte(); - else - bval = bdis.readByte(); - - keychars[index] = (char)bval; - } - - String key = new String(keychars).trim(); - - int chromID; - int chromSize; - long childOffset; - - if(isLeaf) { - if(isLowToHigh) { - chromID = lbdis.readInt(); - chromSize = lbdis.readInt(); - } - else { - chromID = bdis.readInt(); - chromSize = bdis.readInt(); - } - - // insert leaf items - BPTreeLeafNodeItem leafItem = new BPTreeLeafNodeItem(++leafCount, key, chromID, chromSize); - thisNode.insertItem(leafItem); - } - else { - // get the child node pointed to in the node item - if(isLowToHigh) - childOffset = lbdis.readLong(); - else - childOffset = bdis.readLong(); - - childNode = readBPTreeNode(this.fis, childOffset, thisNode, isLowToHigh); - - // insert child node item - BPTreeChildNodeItem childItem = new BPTreeChildNodeItem(item, key, childNode); - thisNode.insertItem(childItem); - } - - fileOffset += itemSize; - } - - }catch(IOException ex) { - log.severe("Error reading B+ tree node " + ex); - throw new RuntimeException("Error reading B+ tree node \n ", ex); - } - - // success: return node - return thisNode; - } - - -} \ No newline at end of file diff --git a/src/org/broad/igv/bbfile/BPTreeChildNode.java b/src/org/broad/igv/bbfile/BPTreeChildNode.java deleted file mode 100644 index 3e595a3..0000000 --- a/src/org/broad/igv/bbfile/BPTreeChildNode.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.ArrayList; -import java.util.logging.Logger; - - - -/* -* Container class for B+ Tree Child (Non-Leaf) Node. -* -* Note: Key is a property of node items and BPTreeNode methods -* getLowestKeyItem() and getHighestKeyItem() can be used -* to check node key range. -* -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BPTreeChildNode implements BPTreeNode{ - - private static Logger log = Logger.getLogger(BPTreeChildNode.class.getCanonicalName()); - private final boolean isLeafNode = false; - - private long nodeIndex; // index for node in B+ tree organization - String lowestChromKey; // lowest chromosome/contig key name - String highestChromKey; // highest chromosome/contig key name - int lowestChromID; // lowest chromosome ID corresponds to lowest key - int highestChromID; // highest chromosome ID corresponds to highest key - private ArrayList childItems; // child node items - - /* - * Constructor for the B+ tree child (non-leaf) node. - * - * Parameters: - * nodeIndex - index assigned to the node - * parent - parent node (object) - * - * Note: Inserted child items contain child/leaf nodes assigned. - * */ - public BPTreeChildNode(long nodeIndex){ - - this.nodeIndex = nodeIndex; - childItems = new ArrayList(); - } - - /* - * Method returns the node index in the B+ tree organization. - * - * Returns: - * node index in B+ tree - * */ - public long getNodeIndex(){ - return nodeIndex; - } - - /* - * Method identifies the node as a leaf node or a child (non-leaf) node. - * - * Returns: - * true, if leaf node; false if child node - * */ - public boolean isLeaf() { - return isLeafNode; - } - - /* - * Method inserts the node item appropriate to the item's key value. - * - * Returns: - * Node item inserted successfully. - * */ - public boolean insertItem(BPTreeNodeItem item){ - - // Quick implementation: assumes all keys are inserted in rank order - // todo: verify if need to compare key and insert at rank location - childItems.add((BPTreeChildNodeItem)item ); - - BPTreeNode childNode = ((BPTreeChildNodeItem)item).getChildNode(); - - // Note: assumes rank order insertions - if(childItems.size() == 1 ){ - lowestChromKey = childNode.getLowestChromKey(); - lowestChromID = childNode.getLowestChromID(); - } - else { - highestChromKey = childNode.getHighestChromKey(); - highestChromID = childNode.getHighestChromID(); - } - - - return true; // success - } - - /* - * Method deletes the node item appropriate to the item's index. - * - * Returns: - * Node item deleted successfully. - * */ - public boolean deleteItem(int index){ - - // unacceptable index - if(index < 0 || index >= getItemCount()) - return false; - - childItems.remove(index); - return true; // success - } - - /* - * Method returns the number of items assigned to the node. - * - * Returns: - * Count of node items contained in the node - * */ - public int getItemCount() { - return childItems.size(); - } - - /* - * Method returns the indexed node item. - * - * Returns: - * node index in B+ tree - * */ - public BPTreeNodeItem getItem(int index){ - int itemCount = getItemCount(); - - if(index >= itemCount) - return null; - - return childItems.get(index); - } - - /* - * Method returns the lowest chromosome key value belonging to the node. - * - * Returns: - * Lowest contig/chromosome name key value; or null if no node items - * */ - public String getLowestChromKey(){ - if(childItems.size() > 0) - return lowestChromKey; - else - return null; - } - - /* - * Method returns the highest chromosome key value belonging to the node. - * - * Returns: - * Highest contig/chromosome name key value; or null if no node items - * */ - public String getHighestChromKey(){ - if(childItems.size() > 0) - return highestChromKey; - else - return null; - } - - /* - * Method returns the lowest chromosome ID belonging to the node. - * - * Returns: - * Lowest key contig/chromosome ID; or -1 if no node items - * */ - public int getLowestChromID(){ - if(childItems.size() > 0) - return lowestChromID; - else - return -1; - } - - /* - * Method returns the highest chromosome ID belonging to the node. - * - * Returns: - * Highest key contig/chromosome ID; or -1 if no node items - * */ - public int getHighestChromID(){ - if(childItems.size() > 0) - return highestChromID; - else - return -1; - } - - /* - * Method prints the nodes items and sub-node items. - * Node item deleted successfully. - * */ - public void printItems(){ - int itemCount = getItemCount(); - - log.info("Child node " + nodeIndex + " contains " + itemCount + " child items:"); - for(int item = 0; item < itemCount; ++item){ - - // recursively will print all node items below this node - childItems.get(item).print(); - } - } - - // *********** BPTreeChildNode specific methods ************* - /* - * Method returns all child items mContained by this child node. - * - * Returns: - * List of child items contained by this node - * */ - public ArrayList getChildItems(){ - return childItems; - } - -} diff --git a/src/org/broad/igv/bbfile/BPTreeChildNodeItem.java b/src/org/broad/igv/bbfile/BPTreeChildNodeItem.java deleted file mode 100644 index 435ea60..0000000 --- a/src/org/broad/igv/bbfile/BPTreeChildNodeItem.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.logging.Logger; - - -/* - Container class for B+ Tree child node format - */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BPTreeChildNodeItem implements BPTreeNodeItem { - - private static Logger log = Logger.getLogger(BPTreeChildNodeItem.class.getCanonicalName()); - private final boolean isLeafItem = false; - private long itemIndex; // item index in child node list - - // B+ Tree Child Node Item entities - BBFile Table H - // Note the childOffset entity is replaced with the actual instance - // of the child note it points to in the file. - private String chromKey; // mChromosome/contig name; of keysize chars - private BPTreeNode childNode; // child node - - /* - * Constructs a B+ tree child node item with the supplied information. - * - * Parameters: - * itemIndex - node item index - * chromKey - chromosome name key - * childNode - assigned child node object - * */ - public BPTreeChildNodeItem(int itemIndex, String chromKey, BPTreeNode childNode){ - this.itemIndex = itemIndex; - this.chromKey = chromKey; - this.childNode = childNode; - } - - /* - * Method returns the index assigned to this node item. - * - * Returns: - * index assigned to this node item - * */ - public long getItemIndex() { - return itemIndex; - } - - /* - * Method returns if this node is a leaf item. - * - * Returns: - * false because node is a child (non-leaf) item - * */ - public boolean isLeafItem() { - return isLeafItem; - } - - /* - * Method returns the chromosome name key assigned to this node item. - * - * Returns: - * chromosome name key assigned to this node item - * */ - public String getChromKey() { - return chromKey; - } - - /* - * Method compares supplied chromosome key with leaf node key. - * - * Parameters: - * chromKey - chromosome name ley to compare - * - * Returns: - * true, if keys are equal; false if keys are different - * */ - public boolean chromKeysMatch(String chromKey) { - String thisKey = this.chromKey; - String thatKey = chromKey; - - // Note: must have the same length to compare chromosome names - int thisKeyLength = thisKey.length(); - int thatKeyLength = thatKey.length(); - - // check if need to truncate the larger string - if(thisKeyLength > thatKeyLength) - thisKey = thisKey.substring(0,thatKeyLength); - else if(thatKeyLength > thisKeyLength) - thatKey = thatKey.substring(0,thisKeyLength); - - if (thisKey.compareTo(thatKey) == 0) - return true; - else - return false; - } - - public void print() { - - log.info("B+ Tree child node " + itemIndex); - log.info("Key value = " + chromKey); - - // recursively print chid node items - childNode.printItems(); - } - - // BPTreeLeafNodeItem specific methods - public BPTreeNode getChildNode() { - return childNode; - } - -} diff --git a/src/org/broad/igv/bbfile/BPTreeHeader.java b/src/org/broad/igv/bbfile/BPTreeHeader.java deleted file mode 100644 index a8858d8..0000000 --- a/src/org/broad/igv/bbfile/BPTreeHeader.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.logging.Logger; - -import org.broad.tribble.SeekableStreamUtils; - -import org.broad.tribble.LittleEndianInputStream; -import net.sf.samtools.seekablestream.SeekableStream; - -/* - * Container class for BBFile B+ Tree header. - * B+ Tree Header can be constructed by reading values in from a BBFile - * ( Table E), or by assigning the values in a constructor. - * - * */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BPTreeHeader { - - private static Logger log = Logger.getLogger(BPTreeHeader.class.getCanonicalName()); - - static public final int BPTREE_HEADER_SIZE = 32; - - static public final int BPTREE_MAGIC_LTH = 0x78CA8C91; - static public final int BPTREE_MAGIC_HTL = 0x918CCA78; - - private long headerOffset; // BBFile file offset for mChromosome tree - private boolean headerOK; // B+ Tree header OK? - - // Chromosome B+ Tree Header - Table E - private int magic; // magic number identifies it as B+ header - private int blockSize; // number of children per block - private int keySize; // min # of charcter bytes for mChromosome name - private int valSize; // size of (bigWig) values - currently 8 - private long itemCount; // number of chromosomes/contigs in B+ tree - private long reserved; // Currently 0 - - /* - * Constructor for reading in a B+ tree header a from a file input stream. - * - * Parameters: - * fis - file input handle - * fileOffset - file offset to the B+ tree header - * isLowToHigh - indicates byte order is low to high, else is high to low - * */ - public BPTreeHeader(SeekableStream fis, long fileOffset, boolean isLowToHigh) { - - long itemsCount; - - // save the seekable file handle and B+ Tree file offset - headerOffset = fileOffset; - - // Note: a bad B+ Tree header will result in false returned - headerOK = readHeader(fis, headerOffset, isLowToHigh); - } - - - - public static int getHeaderSize() { - return BPTREE_HEADER_SIZE; - } - - public long getHeaderOffset() { - return headerOffset; - } - - public boolean isHeaderOK() { - return headerOK; - } - - public int getMagic() { - return magic; - } - - public int getBlockSize() { - return blockSize; - } - - public int getKeySize() { - return keySize; - } - - public int getValSize() { - return valSize; - } - - public long getItemCount() { - return itemCount; - } - - public long getReserved() { - return reserved; - } - - // prints out the B+ Tree Header - public void print() { - - // Chromosome B+ Tree Header - BBFile Table E - if(headerOK) - log.info("B+ Tree Header was read from file location " + headerOffset); - log.info(" Magic ID =" + magic); - log.info(" Block size = " + blockSize); - log.info(" Key size = " + keySize); - log.info(" Indexed value size = " + valSize); - log.info(" Item Count = " + itemCount); - log.info(" Reserved = " + reserved); - } - - /* - * Reads in the B+ Tree Header. - * Returns status of B+ tree header read; true if read, false if not. - * */ - private boolean readHeader(SeekableStream fis, long fileOffset, boolean isLowToHigh) { - - LittleEndianInputStream lbdis; - DataInputStream bdis; - - byte[] buffer = new byte[BPTREE_HEADER_SIZE]; - int bytesRead; - - try { - // Read B+ tree header into a buffer - fis.seek(fileOffset); -// fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - - // decode header - if(isLowToHigh){ - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(buffer)); - - // check for a valid B+ Tree Header - magic = lbdis.readInt(); - - if(magic != BPTREE_MAGIC_LTH) - return false; - - // Get mChromosome B+ header information - blockSize = lbdis.readInt(); - keySize = lbdis.readInt(); - valSize = lbdis.readInt(); - itemCount = lbdis.readLong(); - reserved = lbdis.readLong(); - } - else { - bdis = new DataInputStream(new ByteArrayInputStream(buffer)); - - // check for a valid B+ Tree Header - magic = bdis.readInt(); - - if(magic != BPTREE_MAGIC_HTL) - return false; - - // Get mChromosome B+ header information - blockSize = bdis.readInt(); - keySize = bdis.readInt(); - valSize = bdis.readInt(); - itemCount = bdis.readLong(); - reserved = bdis.readLong(); - - } - - }catch(IOException ex) { - log.severe("Error reading B+ tree header " + ex); - throw new RuntimeException("Error reading B+ tree header \n", ex); - } - - // success - return true; - } - -} - diff --git a/src/org/broad/igv/bbfile/BPTreeLeafNode.java b/src/org/broad/igv/bbfile/BPTreeLeafNode.java deleted file mode 100644 index c766ba3..0000000 --- a/src/org/broad/igv/bbfile/BPTreeLeafNode.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.ArrayList; -import java.util.logging.Logger; - - -/* -* Container class for B+ Tree Leaf Node. -* -* Note: Key is a property of node items and BPTreeNode methods -* getLowestKeyItem() and getHighestKeyItem() can be used -* to check node key range. -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BPTreeLeafNode implements BPTreeNode{ - - private static Logger log = Logger.getLogger(BPTreeLeafNode.class.getCanonicalName()); - private final boolean isLeafNode = true; - - private long nodeIndex; // index for node in B+ tree organization - String lowestChromKey; // lowest chromosome/contig key name - String highestChromKey; // highest chromosome/contig key name - int lowestChromID; // lowest chromosome ID corresponds to lowest key - int highestChromID; // highest chromosome ID corresponds to highest key - private ArrayList leafItems; // array for leaf items - - /* - * Constructor for the B+ tree leaf (terminal) node. - * - * Parameters: - * nodeIndex - index assigned to the node - * parent - parent node (object) - * - * Note: Inserted leaf items contain associated name key/chromosome ID. - * */ - public BPTreeLeafNode(long nodeIndex){ - - this.nodeIndex = nodeIndex; - leafItems = new ArrayList(); - } - - /* - * Method returns the node index in the B+ tree organization. - * - * Returns: - * node index in B+ tree - * */ - public long getNodeIndex(){ - return nodeIndex; - } - - /* - * Method identifies the node as a leaf node or a child (non-leaf) node. - * - * Returns: - * true, if leaf node; false if child node - * */ - public boolean isLeaf() { - return isLeafNode; - } - - /* - * Method inserts the node item appropriate to the item's key value. - * - * Returns: - * Node item inserted successfully. - * */ - public boolean insertItem(BPTreeNodeItem item){ - - // Quick implementation: assumes all keys are inserted in rank order - // todo: verify if need to compare key and insert at rank location - leafItems.add((BPTreeLeafNodeItem)item ); - - // Note: assumes rank order insertions - if(leafItems.size() == 1 ){ - lowestChromKey = item.getChromKey(); - lowestChromID = ((BPTreeLeafNodeItem)item).getChromID(); - } - else { - highestChromKey = item.getChromKey(); - highestChromID = ((BPTreeLeafNodeItem)item).getChromID(); - } - - // success - return true; - } - - /* - * Method deletes the node item appropriate to the item's index. - * - * Returns: - * Node item deleted successfully. - * */ - public boolean deleteItem(int index){ - - // unacceptable index - if(index < 0 || index >= getItemCount()) - return false; - - leafItems.remove(index); - return true; // success - } - - /* - * Method returns the number of items assigned to the node. - * - * Returns: - * Count of node items contained in the node - * */ - public int getItemCount() { - return leafItems.size(); - } - - /* - * Method returns the indexed node item. - * - * Returns: - * Indexed node item. - * */ - public BPTreeNodeItem getItem(int index){ - if(getItemCount() > 0 && index < getItemCount()) - return leafItems.get(index); - else - return null; - } - - /* - * Method returns the lowest key value belonging to the node. - * - * Returns: - * Lowest key contig/chromosome name value - * */ - public String getLowestChromKey(){ - if(leafItems.size() > 0) - return lowestChromKey; - else - return null; - } - - /* - * Method returns the highest key value belonging to the node. - * - * Returns: - * Highest key contig/chromosome name value - * */ - public String getHighestChromKey(){ - if(leafItems.size() > 0) - return highestChromKey; - else - return null; - } - - /* - * Method returns the lowest chromosome ID belonging to the node. - * - * Returns: - * Lowest key contig/chromosome ID; or -1 if no node items - * */ - public int getLowestChromID(){ - if(leafItems.size() > 0) - return lowestChromID; - else - return -1; - } - - /* - * Method returns the highest chromosome ID belonging to the node. - * - * Returns: - * Highest key contig/chromosome ID; or -1 if no node items - * */ - public int getHighestChromID(){ - if(leafItems.size() > 0) - return highestChromID; - else - return -1; - } - - /* - * Method prints the nodes items and sub-node items. - * Node item deleted successfully. - * */ - public void printItems(){ - int itemCount = getItemCount(); - - log.info("Leaf node " + nodeIndex + "contains " + itemCount + " leaf items:"); - for(int item = 0; item < itemCount; ++item){ - leafItems.get(item).print(); - } - } - - // ************** BPTreeLeafNode specific methods *********** - /* - * Method returns all leaf items mContained by this leaf node. - * - * Returns: - * List of leaf items contained by this node - * */ - public ArrayList getLeafItems() { - return leafItems; - } - -} \ No newline at end of file diff --git a/src/org/broad/igv/bbfile/BPTreeLeafNodeItem.java b/src/org/broad/igv/bbfile/BPTreeLeafNodeItem.java deleted file mode 100644 index 9f5ed33..0000000 --- a/src/org/broad/igv/bbfile/BPTreeLeafNodeItem.java +++ /dev/null @@ -1,148 +0,0 @@ - -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -/** - * Created by IntelliJ IDEA. - * User: martind - * Date: Dec 20, 2009 - * Time: 10:37:43 PM - * To change this template use File | Settings | File Templates. - */ - package org.broad.igv.bbfile; - -import java.util.logging.Logger; - -/* - * Container class for B+ tree leaf node. -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BPTreeLeafNodeItem implements BPTreeNodeItem { - - private static Logger log = Logger.getLogger(BPTreeLeafNodeItem.class.getCanonicalName()); - private final boolean isLeafItem = true; - private long leafIndex; // leaf index in B+ tree item list - - // B+ Tree Leaf Node Item entities - BBFile Table G - private String chromKey; // B+ tree node item is associated by key - private int chromID; // numeric mChromosome/contig ID - private int chromSize; // number of bases in mChromosome/contig - - /* - * Constructs a B+ tree leaf node item with the supplied information. - * - * Parameters: - * leafIndex - leaf item index - * chromKey - chromosome/contig name key - * chromID - chromosome ID assigned to the chromosome name key - * chromsize - number of bases in the chromosome/contig - * */ - public BPTreeLeafNodeItem(long leafIndex, String chromKey, int chromID, int chromSize){ - - this.leafIndex = leafIndex; - this.chromKey = chromKey; - this.chromID = chromID; - this.chromSize = chromSize; - } - - /* - * Method returns the index assigned to this node item. - * - * Returns: - * index assigned to this node item - * */ - public long getItemIndex(){ - return leafIndex; - } - - /* - * Method returns if this node is a leaf item. - * - * Returns: - * true because node is a leaf item - * */ - public boolean isLeafItem() { - return isLeafItem; - } - - /* - * Method returns the chromosome name key assigned to this node item. - * - * Returns: - * chromosome name key assigned to this node item - * */ - public String getChromKey() { - return chromKey; - } - - /* - * Method compares supplied chromosome key with leaf node key. - * - * Parameters: - * chromKey - chromosome name ley to compare - * - * Returns: - * true, if keys are equal; false if keys are different - * */ - - public boolean chromKeysMatch(String chromKey) { - String thisKey = this.chromKey; - String thatKey = chromKey; - - if (thisKey.compareTo(thatKey) == 0) - return true; - else - return false; - } - - public void print() { - - log.info("B+ tree leaf node item number " + leafIndex); - log.info("Key value = " + chromKey); - log.info("ChromID = " + chromID); - log.info("Chromsize = " + chromSize); - } - - // *** BPTreeLeafNodeItem specific methods *** - public int getChromID() { - return chromID; - } - - public int getChromSize() { - return chromSize; - } - -} diff --git a/src/org/broad/igv/bbfile/BPTreeNode.java b/src/org/broad/igv/bbfile/BPTreeNode.java deleted file mode 100644 index 6af1e46..0000000 --- a/src/org/broad/igv/bbfile/BPTreeNode.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - - /* - * Interface defining the B+ Tree Node behavior -* -* Note: Key is a property of node items and BPTreeNode methods -* getLowestChromKey() and getHighestChromKey() can be used -* to check node key range. -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public interface BPTreeNode { - - /* - * Method returns the node index in the B+ tree organization. - * - * Returns: - * node index in B+ tree - * */ - public long getNodeIndex(); - - - /* - * Method identifies the node as a leaf node or a child (non-leaf) node. - * - * Returns: - * true, if leaf node; false if child node - * */ - public boolean isLeaf(); - - /* - * Method inserts the node item appropriate to the item's key value. - * - * Returns: - * Node item inserted successfully. - * */ - public boolean insertItem(BPTreeNodeItem item); - - /* - * Method deletes the node item appropriate to the item's index. - * - * Returns: - * Node item deleted successfully. - * */ - public boolean deleteItem(int index); - - /* - * Method returns the number of items assigned to the node. - * - * Returns: - * Count of node items contained in the node - * */ - public int getItemCount(); - - /* - * Method returns the indexed node item. - * - * Returns: - * Indexed node item. - * */ - public BPTreeNodeItem getItem(int index); - - /* - * Method returns the lowest chromosome name key belonging to the node. - * - * Returns: - * Lowest contig/chromosome name key; or null for no node items. - * */ - public String getLowestChromKey(); - - /* - * Method returns the highest chromosome name key belonging to the node. - * - * Returns: - * Highest contig/chromosome name key; or null for no node items. - * */ - public String getHighestChromKey(); - - /* - * Method returns the lowest chromosome ID belonging to the node. - * - * Returns: - * Lowest contig/chromosome ID; or -1 for no node items. - * */ - public int getLowestChromID(); - - /* - * Method returns the highest chromosome ID belonging to the node. - * - * Returns: - * Highest contig/chromosome ID; or -1 for no node items. - * */ - public int getHighestChromID(); - - /* - * Method prints the nodes items and sub-node items. - * Node item deleted successfully. - * */ - public void printItems(); - -} diff --git a/src/org/broad/igv/bbfile/BPTreeNodeItem.java b/src/org/broad/igv/bbfile/BPTreeNodeItem.java deleted file mode 100644 index f02abd0..0000000 --- a/src/org/broad/igv/bbfile/BPTreeNodeItem.java +++ /dev/null @@ -1,72 +0,0 @@ - -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -/** - * Created by IntelliJ IDEA. - * User: martind - * Date: Dec 23, 2009 - * Time: 11:43:43 AM - * To change this template use File | Settings | File Templates. - */ -package org.broad.igv.bbfile; - -import java.lang.Comparable; - -/* -* BPTreeNodeItem interface for storage of B+ tree node item information. -* -* Note: The alpha-numeric key string is used for positional insertion of -* node items and searching of the B+ tree. -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -interface BPTreeNodeItem { - - // Returns the child node item or leaf item index in the B+ tree. - long getItemIndex(); - - // Identifies the item as a leaf item or a child node item. - boolean isLeafItem(); - - // Returns key used to position the item in parent node item list. - String getChromKey(); - - // Returns true if keys match, returns false if keys do not match. - boolean chromKeysMatch(String chromKey); - - // Prints the tree node items. - void print(); -} diff --git a/src/org/broad/igv/bbfile/BedFeature.java b/src/org/broad/igv/bbfile/BedFeature.java deleted file mode 100644 index 0461f1e..0000000 --- a/src/org/broad/igv/bbfile/BedFeature.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.logging.Logger; - - -/* -* Container class for BigBed features. -* -* Note: required BigBed data items are: -* mChromosome (name) -* mChromosome mStartBase (starting base) -* mChromosome mEndBase (ending base) -* plus String "rest of fields" for custom fileds -* -* Custom fields can follow any of the predefined fields which normally -* follow the three required fields. Predefined fileds must be maintained -* up to the point of customization. (See BBFile Table A) -* -* The predefined fields are: -* name - name of feature -* score - value betwenn 0 and 1000 defining viewing darkness -* strand - "+" or "-", or "." for unknown -* thickstart - base where item thickens, used for CDS mStartBase of genes -* thickEnd - base where thick item ends -* itemRGB - comma seperated R,G,B valuse from 0 to 255 -* blockCount - number of multi-part blocks; number of exons for genes -* blockSizes - blockCount comma seperated list of blocks -* blockStarts - blockCount comma seperated mStartBase locations (relative to mChromosome mStartBase) -* -* Custom field dimensions are defined by the following fileds in BBFile Tab;e C: - * field count - number of fields in Bed format - * defined field count - number of fields that are of predefied type as shown above -* -* Custom fields: -* restOfFields (String contains the predefined and custom fields) -* -* The custom fields are described by .as dictionary terms which are -* provided by the autoSQL section of the BigBed file. (See BBFile Table B example) -* -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BedFeature { - - private static Logger log = Logger.getLogger(BedFeature.class.getCanonicalName()); - - private int itemIndex; // data record index - - // BBFile Table I - BigBed data format - private String chromosome; // mChromosome/contig name - private int startBase; // starting base for item - private int endBase; // ending base for item - private String[] restOfFields; // string containing custom fields - - public BedFeature(int itemIndex, String chromosome, int startBase, int endBase, String restOfFieldsString){ - - this.itemIndex = itemIndex; - this.chromosome = chromosome; - this.startBase = startBase; - this.endBase = endBase; - restOfFields = restOfFieldsString == null ? null : restOfFieldsString.split("\t"); - } - - // returns the data record index - public int getItemIndex() { - return itemIndex; - } - - // returns the mChromosome ID (0, 1, etc.) - public String getChromosome() { - return chromosome; - } - - // returns the mChromosome mStartBase base position - public int getStartBase(){ - return startBase; - } - - // returns the mChromosome mEndBase base position - public int getEndBase() { - return endBase; - } - - public String[] getRestOfFields(){ - return restOfFields; - } - - public void print(){ - - System.out.println("BigBed feature item " + itemIndex); - System.out.println("mChromosome name: " + chromosome); - System.out.println("mChromosome start base= " + startBase); - log.info("mChromosome end base = " + endBase); - System.out.println("Rest of fields: \n" + restOfFields); - } -} diff --git a/src/org/broad/igv/bbfile/BigBedDataBlock.java b/src/org/broad/igv/bbfile/BigBedDataBlock.java deleted file mode 100644 index aecc342..0000000 --- a/src/org/broad/igv/bbfile/BigBedDataBlock.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.samtools.seekablestream.SeekableStream; - -import org.broad.tribble.LittleEndianInputStream; -import org.broad.tribble.SeekableStreamUtils; - - - -/* -* Container class for reading and storing a block of bed data items. -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BigBedDataBlock { - - private static Logger log = Logger.getLogger(BigBedDataBlock.class.getCanonicalName()); - - // Bed data block access variables - for reading in bed records from a file - private SeekableStream fis; // file input stream handle - private long fileOffset; // Bed data block file offset - private long dataBlockSize; // byte size for data block specified in the R+ leaf - private boolean isLowToHigh; // if true, data is low to high byte order; else high to low - - // defines the bigBed/bigWig source chromosomes - private HashMap chromosomeMap; // map of chromosome ID's and corresponding names - private RPTreeLeafNodeItem leafHitItem; // R+ tree leaf item containing data block location - - // Provides uncompressed byte stream data reader - private byte[] bedBuffer; // buffer containing leaf block data uncompressed - private int remDataSize; // number of unread data bytes - private long dataSizeRead; // number of bytes read from the decompressed mWigBuffer - - // byte stream readers - private LittleEndianInputStream lbdis; // low to high byte stream reader - private DataInputStream dis; // high to low byte stream reader - - // Bed data extraction members - private ArrayList bedFeatureList; // array of BigBed data - private int nItemsSelected; // number of Bed features selected from this section - - /* - * Constructor for Bed data block reader. - * - * Parameters: - * fis - file input stream handle - * leafItem - R+ tree leaf item containing chromosome region and file data location - * chromIDTree - B+ chromosome index tree returns chromosome ID's for names - * isLowToHigh - byte order is low to high if true; else high to low - * uncompressBufSize - byte size for decompression buffer; else 0 for uncompressed - * */ - public BigBedDataBlock(SeekableStream fis, RPTreeLeafNodeItem leafHitItem, - HashMap chromosomeMap, boolean isLowToHigh, int uncompressBufSize){ - this.fis = fis; - this.leafHitItem = leafHitItem; - this.chromosomeMap = chromosomeMap; - this.isLowToHigh = isLowToHigh; - - dataBlockSize = this.leafHitItem.geDataSize(); - byte[] buffer = new byte[(int) dataBlockSize]; - - fileOffset = this.leafHitItem.getDataOffset(); - - // read Bed data block into a buffer - try { - fis.seek(fileOffset); -// fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - // decompress if necessary - the buffer size is 0 for uncompressed data - // Note: BBFile Table C specifies a decompression buffer size - if(uncompressBufSize > 0) - bedBuffer = BBCompressionUtils.decompress(buffer, uncompressBufSize); - else - bedBuffer = buffer; // use uncompressed read buffer directly - - }catch(IOException ex) { - String error = String.format("Error reading Bed data for leaf item %d \n"); - log.log(Level.SEVERE,error, ex); - throw new RuntimeException(error, ex); - } - - // wrap the bed buffer as an input stream - if(this.isLowToHigh) - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(bedBuffer)); - else - dis = new DataInputStream(new ByteArrayInputStream(bedBuffer)); - - // initialize unread data size - remDataSize = bedBuffer.length; - - // use methods getBedData or getNextFeature to extract block data - } - - /* - * Method returns all Bed features within the decompressed block buffer - * - * Parameters: - * selectionRegion - chromosome region for selecting Bed features - * contained - indicates selected data must be contained in selection region - * if true, else may intersect selection region - * - * Returns: - * Bed feature items in the data block - * - * Note: Remaining bytes to data block are used to determine end of reading - * since a zoom record count for the data block is not known. - * */ - public ArrayList getBedData(RPChromosomeRegion selectionRegion, - boolean contained) { - int itemNumber = 0; - int chromID, chromStart, chromEnd; - String restOfFields; - int itemHitValue; - - // chromID + chromStart + chromEnd + rest 0 byte - // 0 byte for "restOfFields" is always present for bed data - int minItemSize = 3 * 4 + 1; - - // allocate the bed feature array list - bedFeatureList = new ArrayList(); - - // check if all leaf items are selection hits - RPChromosomeRegion itemRegion = new RPChromosomeRegion( leafHitItem.getChromosomeBounds()); - int leafHitValue = itemRegion.compareRegions(selectionRegion); - - try { - for(int index = 0; remDataSize > 0; ++index) { - itemNumber = index + 1; - - // read in BigBed item fields - BBFile Table I - if(isLowToHigh){ - chromID = lbdis.readInt(); - chromStart= lbdis.readInt(); - chromEnd = lbdis.readInt(); - restOfFields = lbdis.readString(); - } - else{ - chromID = dis.readInt(); - chromStart= dis.readInt(); - chromEnd = dis.readInt(); - restOfFields = dis.readUTF(); - } - - if(leafHitValue == 0) { // contained leaf region items always added - String chromosome = chromosomeMap.get(chromID); - BedFeature bbItem = new BedFeature(itemNumber, chromosome, - chromStart, chromEnd, restOfFields); - bedFeatureList.add(bbItem); - } - else { // test for hit - itemRegion = new RPChromosomeRegion(chromID, chromStart, chromID, chromEnd); - itemHitValue = itemRegion.compareRegions(selectionRegion); - - // abs(itemHitValue) == 1 for intersection; itemHitValue == 0 for contained - if(!contained && Math.abs(itemHitValue) < 2 || - itemHitValue == 0) { - // add bed feature to item selection list - String chromosome = chromosomeMap.get(chromID); - BedFeature bbItem = new BedFeature(itemNumber, chromosome, - chromStart, chromEnd, restOfFields); - bedFeatureList.add(bbItem); - } - } - - // compute data block remainder from size of item read - // todo: check that restOfFields.length() does not also include 0 byte terminator - remDataSize -= minItemSize + restOfFields.length(); - } - - }catch(IOException ex) { - log.severe("Read error for Bed data item " + itemNumber); - - // accept this as an end of block condition unless no items were read - if(itemNumber == 1) - throw new RuntimeException("Read error for Bed data item " + itemNumber); - } - - return bedFeatureList; - } - - public void print() { - - log.info("BigBed data for " + bedFeatureList.size() + " items"); - - for(int index = 0; index <= bedFeatureList.size(); ++index) { - // BigBed data items print themselves - bedFeatureList.get(index).print(); - } - } -} diff --git a/src/org/broad/igv/bbfile/BigBedIterator.java b/src/org/broad/igv/bbfile/BigBedIterator.java deleted file mode 100644 index ff49098..0000000 --- a/src/org/broad/igv/bbfile/BigBedIterator.java +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.logging.Logger; - -import net.sf.samtools.seekablestream.SeekableStream; - -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BigBedIterator implements Iterator { - - private static Logger log = Logger.getLogger(BigBedIterator.class.getCanonicalName()); - - //specification of chromosome selection region - private RPChromosomeRegion selectionRegion; // selection region for iterator - private boolean isContained; // if true, features must be fully contained by extraction region - private RPChromosomeRegion hitRegion; // hit selection region for iterator - - // File access variables for reading Bed data block - private SeekableStream fis; // file input stream handle - private BPTree chromIDTree; // B+ chromosome index tree - private RPTree chromDataTree; // R+ chromosome data location tree - - // chromosome region extraction items - private ArrayList leafHitList; // array of leaf hits for selection region items - private HashMap chromosomeMap; // map of chromosome ID's and corresponding names - private int leafItemIndex; // index of current leaf item being processed from leaf hit list - RPTreeLeafNodeItem leafHitItem; // leaf item being processed by next - - // current data block processing members - private BigBedDataBlock bedDataBlock; // Bed data block with Bed records decompressed - private boolean dataBlockRead; // flag indicates successful read of data block - private ArrayList bedFeatureList; // array of selected Bed features - private int bedFeatureIndex; // index of next Bed feature from the list - - boolean empty = false; - - /** - * Constructor for a BigBed iterator over the specified chromosome region - *

- * Parameters: - * fis - file input stream handle - * chromIDTree - B+ index tree returns chromomosme ID's for chromosome names - * chromDataTree - R+ chromosome data locations tree - * selectionRegion - chromosome region for selection of Bed feature extraction - * consists of: - * startChromID - ID of start chromosome - * startBase - starting base position for features - * endChromID - ID of end chromosome - * endBase - starting base position for features - * contained - specifies bed features must be contained by region, if true; - * else return any intersecting region features - */ - public BigBedIterator(SeekableStream fis, BPTree chromIDTree, RPTree chromDataTree, - RPChromosomeRegion selectionRegion, boolean contained) { - - // check for valid selection region - if (selectionRegion == null) - throw new RuntimeException("Error: BigBedIterator selection region is null\n"); - - this.fis = fis; - this.chromIDTree = chromIDTree; - this.chromDataTree = chromDataTree; - this.selectionRegion = selectionRegion; - isContained = contained; - - // set up hit list and first data block read - int hitCount = getHitRegion(selectionRegion, contained); - if (hitCount == 0) { // no hits - no point in fetching data - empty = true; - } - - // Ready for next() data extraction - - } - - - public BigBedIterator() { - empty = true; - } - - - /* - * Method returns status on a "next item" being available. - * - * Return: - * True if a "next item" exists; else false. - * - * Note: If "next" method is called for a false condition, - * an UnsupportedOperationException will be thrown. - * */ - - public boolean hasNext() { - - if(empty) return false; - - // first check if current data block can be read for next - if (bedFeatureIndex < bedFeatureList.size()) - return true; - - // need to fetch next data block - else if (leafItemIndex < leafHitList.size()) - return true; - - else - return false; - } - - /** - * Method returns the current bed feature and advances to the next bed record. - *

- * Returns: - * Bed feature for current BigBed data record. - *

- * Note: If "next" method is called when a "next item" does not exist, - * an UnsupportedOperationException will be thrown. - */ - public BedFeature next() { - - // Is there a need to fetch next data block? - if (bedFeatureIndex < bedFeatureList.size()) - return (bedFeatureList.get(bedFeatureIndex++)); - - // attempt to get next leaf item data block - else { - int nHits = getHitRegion(selectionRegion, isContained); - - if (nHits > 0) { - // Note: getDataBlock initializes bed feature index to 0 - return (bedFeatureList.get(bedFeatureIndex++)); // return 1st Data Block item - } else { - String result = String.format("Failed to find data for bed region (%d,%d,%d,%d)\n", - hitRegion.getStartChromID(), hitRegion.getStartBase(), - hitRegion.getEndChromID(), hitRegion.getEndBase()); - log.severe(result); - - return null; - //throw new NoSuchElementException(result); - } - } - } - - public void remove() { - throw new UnsupportedOperationException("Remove iterator item is not supported yet."); - } - - // ************ BigBedIterator specific methods ******************* - - /* - * Method returns the iterator selection region. - * */ - - public RPChromosomeRegion getSelectionRegion() { - return selectionRegion; - } - - /* - * Method provides the iterator with a new selection region. - * - * Parameters: - * selectionRegion - chromosome region for selection of Bed feature extraction - * consists of: - * startChromID - ID of start chromosome - * startBase - starting base position for features - * endChromID - ID of end chromosome - * endBase - starting base position for features - * contained - specifies bed features must be contained by region, if true; - * else return any intersecting region features - * - * Returns: - * number of chromosome regions found in the selection region - * */ - - public int setSelectionRegion(RPChromosomeRegion selectionRegion, - boolean contained) { - this.selectionRegion = selectionRegion; - isContained = contained; - - // set up hit list and first data block read - leafHitList = null; // Must nullify existing hit list first! - int hitCount = getHitRegion(selectionRegion, contained); - return hitCount; - } - - /* - * Method returns if bed items must be completely contained in - * the selection region. - * - * Returns: - * Boolean indicates items must be contained in selection region if true, - * else may intersect the selection region if false - * */ - - public boolean isContained() { - return isContained; - } - - /* - * Method returns the BigBed file input stream handle. - * - * Returns: - * File input stream handle - * */ - - public SeekableStream getBBFis() { - return fis; - } - - /* - * Method returns the B+ chromosome index tree used for identifying - * chromosome ID's used to specify R+ chromosome data locations. - * - * Returns: - * B+ chromosome index tree - * */ - - public BPTree getChromosomeIDTree() { - return chromIDTree; - } - - /* - * Method returns the R+ chromosome data tree used for identifying - * chromosome data locations for the selection region. - * - * Returns: - * R+ chromosome data locations tree - * */ - - public RPTree getChromosomeDataTree() { - return chromDataTree; - } - - /* - * Method returns leaf items for the chromosome selection region. - * - * Returns: - * List of leaf items with data locations for the selection region. - * */ - - public ArrayList getLeafItems() { - return leafHitList; - } - - /* - * Method finds the chromosome data hit items for the current hit selection region, - * and loads first hit data. - * - * Parameters: - * hitRegion - selection region for extracting hit items - * contained - indicates hit items must contained in selection region if true; - * and if false, may intersect selection region - * Note: The selection region will be limited to accommodate mMaxLeafHits; which terminates - * selection at the leaf node at which maxLeafHits is reached. Total number of selected - * items may exceed maxLeafHits, but only by the number of leaves in the cutoff leaf node. - * - * Returns: - * number of R+ chromosome data hits - * */ - - private int getHitRegion(RPChromosomeRegion hitRegion, boolean contained) { - - int hitCount = 0; - - // check if new hit list is needed - if (leafHitList == null) { - hitCount = getHitList(hitRegion, contained); - if (hitCount == 0) - return 0; // no hit data found - } else { - hitCount = leafHitList.size() - leafItemIndex; - if (hitCount == 0) - return 0; // hit list exhausted - } - - // Perform a block read for starting base of selection region - use first leaf hit - dataBlockRead = getDataBlock(leafItemIndex++); - - // try next item - probably intersection issue - // Note: recursive call until a block is valid or hit list exhuasted - if (!dataBlockRead) - hitCount = getHitRegion(hitRegion, contained); - - return hitCount; - } - - /* - * Method finds the chromosome data tree hit items for the current hit selection region. - * - * Parameters: - * hitRegion - selection region for extracting hit items - * contained - indicates hit items must contained in selection region if true; - * and if false, may intersect selection region - * - * Note: The selection region will be limited to accommodate mMaxLeafHits; which terminates - * selection at the leaf node at which maxLeafHits is reached. Total number of selected - * items may exceed maxLeafHits, but only by the number of leaves in the cutoff leaf node. - * - * Returns: - * number of R+ chromosome data hits - * */ - - private int getHitList(RPChromosomeRegion hitRegion, boolean contained) { - - // hit list for hit region; subject to mMaxLeafHits limitation - leafHitList = chromDataTree.getChromosomeDataHits(hitRegion, contained); - - // check if any leaf items were selected - int nHits = leafHitList.size(); - if (nHits == 0) - return 0; // no data hits found - else - leafItemIndex = 0; // reset hit item index to start of list - - // find hit bounds - int startChromID = leafHitList.get(0).getChromosomeBounds().getStartChromID(); - int startBase = leafHitList.get(0).getChromosomeBounds().getStartBase(); - int endChromID = leafHitList.get(nHits - 1).getChromosomeBounds().getEndChromID(); - int endBase = leafHitList.get(nHits - 1).getChromosomeBounds().getEndBase(); - - // save hit region definition; not currently used but useful for debug - this.hitRegion = new RPChromosomeRegion(startChromID, startBase, endChromID, endBase); - - return nHits; - } - - /* - * Method sets up a decompressed data block of big bed features for iteration. - * - * Parameters: - * leafItemIndex - leaf item index in the hit list referencing the data block - * - * Returns: - * Successful Bed feature data block set up: true or false. - * */ - - private boolean getDataBlock(int leafItemIndex) { - - // check for valid data block - if (leafItemIndex >= leafHitList.size()) - return false; - - // Perform a block read for indexed leaf item - leafHitItem = leafHitList.get(leafItemIndex); - - // get the chromosome names associated with the hit region ID's - int startChromID = leafHitItem.getChromosomeBounds().getStartChromID(); - int endChromID = leafHitItem.getChromosomeBounds().getEndChromID(); - chromosomeMap = chromIDTree.getChromosomeIDMap(startChromID, endChromID); - - boolean isLowToHigh = chromDataTree.isIsLowToHigh(); - int uncompressBufSize = chromDataTree.getUncompressBuffSize(); - - // decompress leaf item data block for feature extraction - bedDataBlock = new BigBedDataBlock(fis, leafHitItem, chromosomeMap, isLowToHigh, - uncompressBufSize); - - // get data block Bed feature list and set next index to first item - bedFeatureList = bedDataBlock.getBedData(selectionRegion, isContained); - bedFeatureIndex = 0; - - // data block items available for iterator - if (bedFeatureList.size() > 0) - return true; - else - return false; - } - -} diff --git a/src/org/broad/igv/bbfile/BigWigDataBlock.java b/src/org/broad/igv/bbfile/BigWigDataBlock.java deleted file mode 100644 index 56d6cc2..0000000 --- a/src/org/broad/igv/bbfile/BigWigDataBlock.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.broad.tribble.SeekableStreamUtils; - -import net.sf.samtools.seekablestream.SeekableStream; - -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BigWigDataBlock { - - private static Logger log = Logger.getLogger(BigWigDataBlock.class.getCanonicalName()); - - // BigWig data types sizes - final int FIXED_STEP_ITEM_SIZE = 4; - final int VAR_STEP_ITEM_SIZE = 8; - final int BED_GRAPH_ITEM_SIZE = 12; - - // Bed data block access variables - for reading in bed records from a file - private long fileOffset; // Wig data block file offset - private long leafDataSize; // byte size for data block specified in the R+ leaf - private boolean isLowToHigh; // if true, data is low to high byte order; else high to low - - // defines the bigWig data source - private HashMap chromosomeMap; // map of chromosome ID's and corresponding names - private RPTreeLeafNodeItem leafHitItem; // R+ leaf item containing data block location - - // uncompressed byte stream buffer and readers - private byte[] wigBuffer; // buffer containing leaf block data uncompressed - private int remDataSize; // number of uncompressed data bytes not extracted - - // Wig data extraction members - private ArrayList wigItemList; // array of Wig section items - - /* - * Constructor for Wig data block reader. - * - * Parameters: - * fis - file input stream handle - * leafHitItem - R+ tree leaf hit item containing data block file location and hit status - * chromIDTree - B+ chromosome index tree returns chromosome ID's for names - * isLowToHigh - byte order is low to high if true; else high to low - * uncompressBufSize - byte size for decompression buffer; else 0 for uncompressed - * - * */ - public BigWigDataBlock(SeekableStream fis, RPTreeLeafNodeItem leafHitItem, - HashMap chromosomeMap, boolean isLowToHigh, int uncompressBufSize){ - this.leafHitItem = leafHitItem; - this.chromosomeMap = chromosomeMap; - this.isLowToHigh = isLowToHigh; - - fileOffset = this.leafHitItem.getDataOffset(); - leafDataSize = this.leafHitItem.geDataSize(); - byte[] buffer = new byte[(int) leafDataSize]; - - // read Wig data block into a buffer - try { - fis.seek(fileOffset); - // fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - - // decompress if necessary - the buffer size is 0 for uncompressed data - // Note: BBFile Table C specifies a decompression buffer size - if(uncompressBufSize > 0) - wigBuffer = BBCompressionUtils.decompress(buffer, uncompressBufSize); - else - wigBuffer = buffer; // use uncompressed read buffer directly - }catch(IOException ex) { - log.log(Level.SEVERE,"Error reading Wig section for leaf item ", ex); - String error = String.format("Error reading Wig section for leaf item %d\n"); - throw new RuntimeException(error, ex); - } - - // initialize unread data size - remDataSize = wigBuffer.length; - - // use getWigData to extract data block items - } - - /* - * Method reads all Wig data sections within the decompressed block buffer - * and returns those items in the chromosome selection region. - * - * Parameters: - * selectionRegion - chromosome region for selecting Wig values - * contained - indicates selected data must be contained in selection region - * if true, else may intersect selection region - * - * Returns: - * Wig sections in selected from the data block; else null for none selected. - * - * */ - public ArrayList getWigData(RPChromosomeRegion selectionRegion, - boolean contained){ - - wigItemList = new ArrayList(); - - for(int index = 0; remDataSize > 0; ++index) { - - // extract items in the Wig data section - // Note: A RuntimeException is thrown if wig section is not read properly - BigWigSection wigSection = new BigWigSection(wigBuffer, chromosomeMap, isLowToHigh, leafHitItem); - - // get wig section items and section bytes read - int sectionBytes = wigSection.getSectionData(selectionRegion, contained, wigItemList); - - // adjust remaining data block size - remDataSize -= sectionBytes; - } - - return wigItemList; - } - - public void print() { - - log.info("Wig section data referenced by leaf item "); - - for(int index = 0; index <= wigItemList.size(); ++index) { - // BigWig sections print themselves - wigItemList.get(index).print(); - } - } - - -} diff --git a/src/org/broad/igv/bbfile/BigWigIterator.java b/src/org/broad/igv/bbfile/BigWigIterator.java deleted file mode 100644 index 1b63066..0000000 --- a/src/org/broad/igv/bbfile/BigWigIterator.java +++ /dev/null @@ -1,399 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.logging.Logger; - -import net.sf.samtools.seekablestream.SeekableStream; - -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BigWigIterator implements Iterator { - - private static Logger log = Logger.getLogger(BigWigIterator.class.getCanonicalName()); - - boolean empty = false; - - //specification of chromosome selection region - private RPChromosomeRegion selectionRegion; // selection region for iterator - private boolean isContained; // if true, features must be fully contained by selection region - - // File access variables for reading Bed data block - private SeekableStream fis; // file input stream handle - private BPTree chromIDTree; // B+ chromosome index tree - private RPTree chromDataTree; // R+ chromosome data location tree - - // chromosome region extraction items - private ArrayList leafHitList; // array of leaf hits for selection region items - private HashMap chromosomeMap; // map of chromosome ID's and corresponding names - private int leafItemIndex; // index of current leaf item being processed from leaf hit list - RPTreeLeafNodeItem leafHitItem; // leaf item being processed by next - private RPChromosomeRegion hitRegion; // hit selection region for iterator - - // current data block processing members - private BigWigDataBlock wigDataBlock; // Wig data block with Wig records decompressed - private boolean dataBlockRead; // indicates successful read of data block - private ArrayList wigItemList; // array of selected Wig values - private int wigItemIndex; // index of next Wig data item from the list - - /** - * Constructor for a BigWig iterator over the specified chromosome region - *

- * Parameters: - * fis - file input stream handle - * chromIDTree - B+ chromosome index tree provides chromosome ID's for chromosome names - * chromDataTree - R+ chromosome data locations tree - * selectionRegion - chromosome region for selection of Wig feature extraction - * consists of: - * startChromID - ID of start chromosome - * startBase - starting base position for values - * endChromID - ID of end chromosome - * endBase - ending base position for values - * contained - specifies wig values must be contained by region, if true; - * else return any intersecting region values - */ - public BigWigIterator(SeekableStream fis, BPTree chromIDTree, RPTree chromDataTree, - RPChromosomeRegion selectionRegion, boolean contained) { - - // check for valid selection region - if (selectionRegion == null) - throw new RuntimeException("Error: BigWigIterator selection region is null\n"); - - this.fis = fis; - this.chromIDTree = chromIDTree; - this.chromDataTree = chromDataTree; - this.selectionRegion = new RPChromosomeRegion(selectionRegion); - isContained = contained; - - // set up hit list and first data block read - int hitCount = getHitRegion(selectionRegion, contained); - if (hitCount == 0) { - empty = true; - } - - // Ready for next() data extraction - } - - /** - * Constructor for an empty iterator - */ - public BigWigIterator() { - empty = true; - } - - /* - * Method returns status on a "next item" being available. - * - * Return: - * True if a "next item" exists; else false. - * - * Note: If "next" method is called for a false condition, - * an NoSuchElementException will be thrown. - * */ - - public boolean hasNext() { - - if (empty) return false; - - // first check if current segment can be read for next Wig item - if (wigItemIndex < wigItemList.size()) - return true; - - // need to fetch next data block - else if (leafItemIndex < leafHitList.size()) - return true; - - else - return false; - } - - /** - * Method returns the current Wig item and advances to the next Wig record. - *

- * Returns: - * Wig item for current BigWig data record. - *

- * Note: If "next" method is called when a "next item" does not exist, - * an NoSuchElementException will be thrown. - */ - public WigItem next() { - - // return next Wig item in list - if (wigItemIndex < wigItemList.size()) - return (wigItemList.get(wigItemIndex++)); - - // attempt to get next leaf item data block - else { - int nHits = getHitRegion(selectionRegion, isContained); - - if (nHits > 0) { - // Note: getDataBlock initializes bed feature index to 0 - return (wigItemList.get(wigItemIndex++)); // return 1st Data Block item - } else { - String result = String.format("Failed to find data for wig region (%d,%d,%d,%d)\n", - hitRegion.getStartChromID(), hitRegion.getStartBase(), - hitRegion.getEndChromID(), hitRegion.getEndBase()); - log.severe(result); - - return null; - //throw new NoSuchElementException(result); - } - } - } - - public void remove() { - throw new UnsupportedOperationException("Remove iterator item is not supported yet."); - } - - // ************ BigBedIterator specific methods ******************* - - /* - * Method returns the iterator selection region. - * */ - - public RPChromosomeRegion getSelectionRegion() { - return selectionRegion; - } - -/* - * Method provides the iterator with a new selection region. - * - * Parameters: - * selectionRegion - chromosome region for selection of Bed feature extraction - * consists of: - * startChromID - ID of start chromosome - * startBase - starting base position for features - * endChromID - ID of end chromosome - * endBase - starting base position for features - * contained - specifies bed features must be contained by region, if true; - * else return any intersecting region features - * - * Returns: - * number of chromosome regions found in the selection region - * */ - - public int setSelectionRegion(RPChromosomeRegion selectionRegion, - boolean contained) { - this.selectionRegion = selectionRegion; - isContained = contained; - - // set up hit list and first data block read - leafHitList = null; // Must nullify existing hit list first! - int hitCount = getHitRegion(selectionRegion, contained); - if (hitCount == 0) // no hits - no point in fetching data - throw new RuntimeException("No wig data found in the selection region"); - - // Ready for next() data extraction - - return hitCount; - } - - /* - * Method returns if bed items must be completely contained in - * the selection region. - * - * Returns: - * Boolean indicates items must be contained in selection region if true, - * else may intersect the selection region if false - * */ - - public boolean isContained() { - return isContained; - } - - /* - * Method returns the BigBed file input stream handle. - * - * Returns: - * File input stream handle - * */ - - public SeekableStream getBBFis() { - return fis; - } - - /* - * Method returns the B+ chromosome index tree used for identifying - * chromosome ID's used to specify R+ chromosome data locations. - * - * Returns: - * B+ chromosome index tree - * */ - - public BPTree getChromosomeIDTree() { - return chromIDTree; - } - - /* - * Method returns the R+ chromosome data tree used for identifying - * chromosome data locations for the selection region. - * - * Returns: - * R+ chromosome data locations tree - * */ - - public RPTree getChromosomeDataTree() { - return chromDataTree; - } - - /* - * Method finds the chromosome data hit items for the current hit selection region, - * and loads first hit data. - * - * Parameters: - * hitRegion - selection region for extracting hit items - * contained - indicates hit items must contained in selection region if true; - * and if false, may intersect selection region - * Note: The selection region will be limited to accommodate mMaxLeafHits; which terminates - * selection at the leaf node at which maxLeafHits is reached. Total number of selected - * items may exceed maxLeafHits, but only by the number of leaves in the cutoff leaf node. - * - * Returns: - * number of R+ chromosome data hits - * */ - - private int getHitRegion(RPChromosomeRegion hitRegion, boolean contained) { - - int hitCount = 0; - - // check if new hit list is needed - if (leafHitList == null) { - hitCount = getHitList(hitRegion, contained); - if (hitCount == 0) - return 0; // no hit data found - } else { - hitCount = leafHitList.size() - leafItemIndex; - if (hitCount == 0) - return 0; // hit list exhausted - } - - // Perform a block read for starting base of selection region - use first leaf hit - dataBlockRead = getDataBlock(leafItemIndex++); - - // try next item - probably intersection issue - // Note: recursive call until a block is valid or hit list exhuasted - if (!dataBlockRead) - hitCount = getHitRegion(hitRegion, contained); - - return hitCount; - } - - /* - * Method finds the chromosome data tree hit items for the current hit selection region. - * - * Parameters: - * hitRegion - selection region for extracting hit items - * contained - indicates hit items must contained in selection region if true; - * and if false, may intersect selection region - * - * Note: The selection region will be limited to accommodate mMaxLeafHits; which terminates - * selection at the leaf node at which maxLeafHits is reached. Total number of selected - * items may exceed maxLeafHits, but only by the number of leaves in the cutoff leaf node. - * - * Returns: - * number of R+ chromosome data hits - * */ - - private int getHitList(RPChromosomeRegion hitRegion, boolean contained) { - - // hit list for hit region; subject to mMaxLeafHits limitation - leafHitList = chromDataTree.getChromosomeDataHits(hitRegion, contained); - - // check if any leaf items were selected - int nHits = leafHitList.size(); - if (nHits == 0) - return 0; - else - leafItemIndex = 0; // reset hit item index to start of list - - // find hit bounds from first and last hit items - int startChromID = leafHitList.get(0).getChromosomeBounds().getStartChromID(); - int startBase = leafHitList.get(0).getChromosomeBounds().getStartBase(); - int endChromID = leafHitList.get(nHits - 1).getChromosomeBounds().getEndChromID(); - int endBase = leafHitList.get(nHits - 1).getChromosomeBounds().getEndBase(); - - // save hit region; not currently used but useful for debug - this.hitRegion = new RPChromosomeRegion(startChromID, startBase, endChromID, endBase); - - return nHits; - } - - /* - * Method sets up a decompressed data block of big bed features for iteration. - * - * Parameters: - * leafIteIndex - leaf item index in the hit list referencing the data block - * - * Returns: - * Successful Bed feature data block set up: true or false. - * */ - - private boolean getDataBlock(int leafItemIndex) { - - // check for valid data block - if (leafItemIndex >= leafHitList.size()) - return false; - - // Perform a block read for indexed leaf item - leafHitItem = leafHitList.get(leafItemIndex); - - // get the chromosome names associated with the hit region ID's - int startChromID = leafHitItem.getChromosomeBounds().getStartChromID(); - int endChromID = leafHitItem.getChromosomeBounds().getEndChromID(); - chromosomeMap = chromIDTree.getChromosomeIDMap(startChromID, endChromID); - - boolean isLowToHigh = chromDataTree.isIsLowToHigh(); - int uncompressBufSize = chromDataTree.getUncompressBuffSize(); - - // decompress leaf item data block for feature extraction - wigDataBlock = new BigWigDataBlock(fis, leafHitItem, chromosomeMap, isLowToHigh, - uncompressBufSize); - - // get section Wig item list and set next index to first item - wigItemList = wigDataBlock.getWigData(selectionRegion, isContained); - wigItemIndex = 0; - - // data block items available for iterator - if (wigItemList.size() > 0) - return true; - else - return false; - } - -} diff --git a/src/org/broad/igv/bbfile/BigWigSection.java b/src/org/broad/igv/bbfile/BigWigSection.java deleted file mode 100644 index 6434c38..0000000 --- a/src/org/broad/igv/bbfile/BigWigSection.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.logging.Logger; - -import org.broad.tribble.LittleEndianInputStream; - -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BigWigSection { - - private static Logger log = Logger.getLogger(BigWigSection.class.getCanonicalName()); - - private boolean isLowToHigh; // byte order is low to high if true; else high to low - private LittleEndianInputStream lbdis; // input stream reader for low to high byte ordered data - private DataInputStream dis; // input stream reader for high to low byte ordered data - - private RPTreeLeafNodeItem leafHitItem; // leaf item defines chromosome region and file data location - private int sectionDataSize; // byte size of decompressed data for this section - private HashMap chromosomeMap; // map of chromosome ID's and corresponding names - private BigWigSectionHeader wigSectionHeader; // wig section header - - /* - * Constructor for a BigWig data section which includes the section header - * and Wig data items. - * - * Parameters: - * sectionBuffer - buffer contains decompressed Wig section header + data - * sectionIndex - wig section index for leaf data block - * chromIDTree - B+ chromosome index tree returns chromosome names for ID's - * isLowToHigh - if true, data byte order is low to high ; else is high to low - * leafHitItem - contains leaf node information for testing against selection region - * - * */ - public BigWigSection(byte[] sectionBuffer, HashMap chromosomeMap, - boolean isLowToHigh, RPTreeLeafNodeItem leafHitItem){ - - this.chromosomeMap = chromosomeMap; - this.isLowToHigh = isLowToHigh; - this.leafHitItem = leafHitItem; - - // wrap the Wig section buffer as an input stream and get the section header - // Note: A RuntimeException is thrown if header is not read properly - if(this.isLowToHigh) { - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(sectionBuffer)); - wigSectionHeader = new BigWigSectionHeader(lbdis); - - } - else { - dis = new DataInputStream(new ByteArrayInputStream(sectionBuffer)); - wigSectionHeader = new BigWigSectionHeader(dis); - } - - // check for valid Wig item type - if(wigSectionHeader.getItemType() == BigWigSectionHeader.WigItemType.Unknown){ - throw new RuntimeException("Read error on wig section leaf index "); - } - - // include header in data segment size accounting - sectionDataSize = wigSectionHeader.SECTION_HEADER_SIZE; - - // use method getSectionData to extract section data - } - - /* - * Method returns the if the Wig items defined in this section are valid. - * - * Note: Use BigWigSectionHeader to obtain more information on - * Wig section data specifications. - * - * Returns: - * Specifies if Wig section has a valid data item type. - * */ - public boolean isValidSectionType(){ - return wigSectionHeader.IsValidType(); - } - - /* - * Method returns the Wig Section Header - * - * Returns: - * Wig section header - * */ - public int getItemCount() { - return wigSectionHeader.getItemCount(); - } - - /* - * Method returns the Wig Section Header - * - * Returns: - * Wig section header - * */ - public BigWigSectionHeader getSectionHeader() { - return wigSectionHeader; - } - - /* - * Method returns the number bytes of decompressed data in this section. - * - * Returns: - * Number of uncompressed bytes read for the Wig data section - * */ - public int getSectionDataSize() { - return sectionDataSize; - } - - /* - * Method reads Wig data items within the decompressed block buffer for the selection region. - * - * Parameters: - * selectionRegion - chromosome selection region for item extraction - * contained - indicates select region must be contained in value region - * if true, else may intersect selection region for extraction - * - * Returns: - * Size in bytes for the wig data section. - * Items read in the wig segment data block are added to the wig item list . - * - * Note: Unlike ZoomLevel and BigBed formats, the Wig Section data block header contains - * an item count used to determine the end of data read. - * */ - public int getSectionData(RPChromosomeRegion selectionRegion, boolean contained, - ArrayList wigItemList) { - - // get the section's data item specifications - // Note: A RuntimeException is thrown if wig section header is not read properly - int chromID = wigSectionHeader.getChromID(); - String chromosome = chromosomeMap.get(chromID); - int itemCount = wigSectionHeader.getItemCount(); - int chromStart = wigSectionHeader.getChromosomeStart(); - int chromEnd = wigSectionHeader.getChromosomeEnd(); - int itemStep = wigSectionHeader.getItemStep(); - int itemSpan = wigSectionHeader.getItemSpan(); - int itemIndex = 0; - int startBase = 0; - int endBase = 0; - float value = 0.0f; - - // find Wig data type - BBFile Table J item type - BigWigSectionHeader.WigItemType itemType = wigSectionHeader.getItemType(); - - // check if all leaf items are selection hits - RPChromosomeRegion itemRegion = new RPChromosomeRegion(chromID, chromStart, - chromID, chromEnd); - int leafHitValue = itemRegion.compareRegions(selectionRegion); - - - // extract Wig data records - // Note: the buffer input stream is positioned past section header - try { - for(int index = 0; index < itemCount; ++index) { - ++itemIndex; - if(isLowToHigh){ - if(itemType == BigWigSectionHeader.WigItemType.FixedStep){ - startBase = chromStart; - endBase = startBase + itemSpan; - value = lbdis.readFloat(); - chromStart = startBase + itemStep; - sectionDataSize += BigWigSectionHeader.FIXEDSTEP_ITEM_SIZE; - } - else if(itemType == BigWigSectionHeader.WigItemType.VarStep){ - - startBase = lbdis.readInt(); - endBase = startBase + itemSpan; - value = lbdis.readFloat(); - sectionDataSize += BigWigSectionHeader.VARSTEP_ITEM_SIZE; - } - else if(itemType == BigWigSectionHeader.WigItemType.BedGraph){ - startBase = lbdis.readInt(); - endBase = lbdis.readInt(); - value = lbdis.readFloat(); - sectionDataSize += BigWigSectionHeader.BEDGRAPH_ITEM_SIZE; - } - } - else { // byte order is high to low - if(itemType == BigWigSectionHeader.WigItemType.FixedStep){ - startBase = chromStart; - endBase = startBase + itemSpan; - value = dis.readFloat(); - chromStart = startBase + itemStep; - sectionDataSize += BigWigSectionHeader.FIXEDSTEP_ITEM_SIZE; - } - else if(itemType == BigWigSectionHeader.WigItemType.VarStep){ - startBase = dis.readInt(); - endBase = startBase + itemSpan; - value = dis.readFloat(); - sectionDataSize += BigWigSectionHeader.VARSTEP_ITEM_SIZE; - } - else if(itemType == BigWigSectionHeader.WigItemType.BedGraph){ - startBase = dis.readInt(); - endBase = dis.readInt(); - value = dis.readFloat(); - sectionDataSize += BigWigSectionHeader.BEDGRAPH_ITEM_SIZE; - } - } - - // contained leaf region items are always added - otherwise test conditions - if(leafHitValue == 0) { - WigItem bbItem = new WigItem(itemIndex, chromosome, startBase, endBase, value); - wigItemList.add(bbItem); - } - else { - itemRegion = new RPChromosomeRegion(chromID, startBase, chromID, endBase); - int itemHitValue = itemRegion.compareRegions(selectionRegion); - - // hitValue < 2 needed for intersection; hitValue < 1 needed for contained = true - if(itemHitValue == 0 || !contained && Math.abs(itemHitValue) < 2) { - WigItem bbItem = new WigItem(itemIndex, chromosome, startBase, endBase, value); - wigItemList.add(bbItem); - } - } - - } - - }catch(IOException ex) { - log.severe("Read error for Wig section item " + itemIndex); - throw new RuntimeException("Read error for Wig section item " + itemIndex); - } - - return sectionDataSize; - } - - /* - * Method prints out the data items for this Wig section. - * */ - public void print() { - log.info("Wig section for leaf item has a data size = " + sectionDataSize); - wigSectionHeader.print(); - } - -} diff --git a/src/org/broad/igv/bbfile/BigWigSectionHeader.java b/src/org/broad/igv/bbfile/BigWigSectionHeader.java deleted file mode 100644 index 67e312e..0000000 --- a/src/org/broad/igv/bbfile/BigWigSectionHeader.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.DataInputStream; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.broad.tribble.LittleEndianInputStream; - - -/* -* Container class for BigWig section header class for data items - BBFile Table J -* -* Note: appropriate WIG data formats are accomodated -* according to WIG type in Table J -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class BigWigSectionHeader { - - public enum WigItemType { - BedGraph, - VarStep, - FixedStep, - Unknown // bad value - } - - private static Logger log = Logger.getLogger(BigWigSectionHeader.class.getCanonicalName()); - - public static final int SECTION_HEADER_SIZE = 24; - public static final int FIXEDSTEP_ITEM_SIZE = 4; - public static final int VARSTEP_ITEM_SIZE = 8; - public static final int BEDGRAPH_ITEM_SIZE = 12; - - private int chromID; // Chromosome/contig Numerical ID from BBFile Chromosome B+ tree - private int chromStart; // starting base position - private int chromEnd; // ending base position - private int itemStep; // number of base spaces between fixed items - private int itemSpan; // number of bases in fixed step items - private WigItemType itemType; // type of data items: 1 = bedGraph, 2 = varStep, 3 = fixedStep - private byte reserved; // reserved; currently = 0 - private short itemCount; // number of data items in this chromosome section - - private boolean isValidType; // indicates a if a valid Wig item type was read - private String itemDescription; // string representation of item type. - - /* - * Constructor creates a Wig Section Header (Table J) from uncompressed buffer. - * - * Parameters: - * mLbdis - // buffer stream containing section header arranged low to high bytes - * */ - public BigWigSectionHeader(LittleEndianInputStream lbdis) { - - byte type; - - // get Wig Section Header - try { - chromID = lbdis.readInt(); - chromStart = lbdis.readInt(); - chromEnd = lbdis.readInt(); - itemStep = lbdis.readInt(); - itemSpan = lbdis.readInt(); - type = lbdis.readByte(); - reserved = lbdis.readByte(); - itemCount = lbdis.readShort(); - }catch(IOException ex) { - log.log(Level.SEVERE,"Error reading wig section header ", ex); - throw new RuntimeException("Error reading wig section header", ex); - } - - // tag as valid - isValidType = getItemType(type); - } - - /* - * Constructor creates a Wig Section Header (Table J) from uncompressed buffer. - * - * Parameters: - * mLbdis - // buffer stream containing section header arranged high to low bytes - * */ - public BigWigSectionHeader(DataInputStream bdis) { - - byte type; - - // get Wig Section Header - try { - chromID = bdis.readInt(); - chromStart = bdis.readInt(); - chromEnd = bdis.readInt(); - itemStep = bdis.readInt(); - itemSpan = bdis.readInt(); - type = bdis.readByte(); - reserved = bdis.readByte(); - itemCount = bdis.readShort(); - }catch(IOException ex) { - log.log(Level.SEVERE,"Error reading wig section header ", ex); - throw new RuntimeException("Error reading wig section header", ex); - } - - // tag as valid - isValidType = getItemType(type); - } - - /* - * Method returns the chromosome ID - * - * Returns: - * Chromosome ID for the section's region - * */ - public int getChromID() { - return chromID; - } - - /* - * Method returns the chromosome starting base - * - * Returns: - * Chromosome start base for the section's region - * */ - public int getChromosomeStart() { - return chromStart; - } - - /* - * Method returns the chromosome ending base - * - * Returns: - * Chromosome end base for the section's region - * */ - public int getChromosomeEnd() { - return chromEnd; - } - - /* - * Method returns the base pairs step between items. - * - * Returns: - * Chromosome base step between fixed step sections - * */ - public int getItemStep() { - return itemStep; - } - - /* - * Method returns the base pairs span in items. - * - * Returns: - * Chromosome base span for fixed and variable step sections - * */ - public int getItemSpan() { - return itemSpan; - } - - /* - * Method returns the item type for the section's Wig data. - * - * Returns: - * Section item type for Wig data - * */ - public WigItemType getItemType() { - return itemType; - } - - /* - * Method returns if the section's data item type is valid. - * - * Returns: - * Specifies if section's data iytem type is valid - * */ - public boolean IsValidType() { - return isValidType; - } - - /* - * Method returns the number of section items. - * - * Returns: - * Number of items defined for the section - * */ - public short getItemCount() { - return itemCount; - } - - /* - * Method returns the reserved value for the section. - * - * Returns: - * Reserved byte for the section (should always be 0) - * */ - public byte getReserved() { - return reserved; - } - - public void print(){ - log.info(" BigWig section header " - + " for "+ itemDescription + " data"); - log.info("Chromosome ID = " + chromID); - log.info("ChromStart = " + chromStart); - log.info("ChromEnd = " + chromEnd); - log.info("ItemStep = " + itemStep); - log.info("ItemSpan = " + itemSpan); - log.info("ItemType = " + itemType); - log.info("mReserved = " + reserved); - log.info("mItemCount = " + itemCount); - } - - /* - * Method determines the Wig data type. - * - * Parameters: - * byte type read from Wig section header - * - * Returns: - * Indicates if type is a valid Wig item type - * */ - private boolean getItemType(byte type){ - boolean isValid; - - if(type == 1){ - itemType = WigItemType.BedGraph; - itemDescription = "Wig Bed Graph"; - isValid = true; - } - else if(type == 2){ - itemType = WigItemType.VarStep; - itemDescription = "Wig Variable Step"; - isValid = true; - } - else if(type == 3){ - itemType = WigItemType.FixedStep; - itemDescription = "Wig Fixed Step"; - isValid = true; - } - else { - itemType = WigItemType.Unknown; - itemDescription = "Wig Type Unknown"; - isValid = false; - } - - return isValid; - } - -} diff --git a/src/org/broad/igv/bbfile/RPChromosomeRegion.java b/src/org/broad/igv/bbfile/RPChromosomeRegion.java deleted file mode 100644 index e1ef462..0000000 --- a/src/org/broad/igv/bbfile/RPChromosomeRegion.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.logging.Logger; - - -/* -* Container class for R+ Tree bounding rectangle regions -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class RPChromosomeRegion { - - private static Logger log = Logger.getLogger(RPChromosomeRegion.class.getCanonicalName()); - - private int startChromID; // starting mChromosome in item - private int startBase; // starting base pair in item - private int endChromID; // ending mChromosome in item - private int endBase; // ending base pair in item - - /* - * Construct region from a specification. - * */ - - public RPChromosomeRegion(int startChromID, int startBase, - int endChromID, int endBase) { - - this.startChromID = startChromID; - this.startBase = startBase; - this.endChromID = endChromID; - this.endBase = endBase; - } - - /* - * Construct region from an existing region. - * */ - - public RPChromosomeRegion(RPChromosomeRegion region) { - - startChromID = region.startChromID; - startBase = region.startBase; - endChromID = region.endChromID; - endBase = region.endBase; - } - - /* - * Null region constructor for setting region members. - **/ - - public RPChromosomeRegion() { - // members auto-inited - } - - public int getStartChromID() { - return startChromID; - } - - public int getStartBase() { - return startBase; - } - - - public int getEndChromID() { - return endChromID; - } - - - public int getEndBase() { - return endBase; - } - - - public void print() { - - log.info("Chromosome bounds:"); - log.info("StartChromID = " + startChromID); - log.info("StartBase = " + startBase); - log.info("EndChromID = " + endChromID); - log.info("EndBase = " + endBase); - } - - /* - * Comparator for mChromosome bounds is used to find relevant intervals and - * rank placement of node items. Returned value indicates relative - * positioning to supplied chromosome test region , and expands on normal - * comparator by indicating partial overlap in the extremes. - * - * Returns: - * - 2 indicates that this region is completely disjoint below the test region - * -1 indicates this region intersects the test region from below - * 0 indicates that this region is inclusive to the test region - * 1 indicates this region intersects the test region from above - * 2 indicates that this region is completely disjoint above the test region - * - * Note: additional tests can be applied to determine intersection from above - * or below the test region and disjoint above or below the test region cases. - * */ - - public int compareRegions(RPChromosomeRegion testRegion) { - - // test if this region is contained by (i.e. subset of) testRegion region - if (this.containedIn(testRegion)) - return 0; - - // test if testRegion region is disjoint from above or below - else if (this.disjointBelow(testRegion)) - return -2; - else if (this.disjointAbove(testRegion)) - return 2; - - // Otherwise this region must intersect - else if (this.intersectsBelow(testRegion)) - return -1; - else if (this.intersectsAbove(testRegion)) - return 1; - - // unexpected condition is unknown - return 3; - } - - /* - * Method checks if test region matches this region - * - * Parameters: - * testRegion - chromosome selection region - * - * Returns: - * This region equals the test region: true or false - * */ - - public boolean equals(RPChromosomeRegion testRegion) { - - if (startChromID == testRegion.startChromID && startBase == testRegion.startBase && - endChromID == testRegion.endChromID && endBase == testRegion.endBase) - return true; - else - return false; - } - - /* - * Method checks if test region contains this region; - * (i.e this region is subset oftest region). - * - * Parameters: - * testRegion - chromosome selection region - * - * Returns: - * This region is contained in the test region: true or false - * */ - - public boolean containedIn(RPChromosomeRegion testRegion) { - - if (startChromID > testRegion.startChromID || - (startChromID == testRegion.startChromID && startBase >= testRegion.startBase)) { - if (endChromID < testRegion.endChromID || - (endChromID == testRegion.endChromID && endBase <= testRegion.endBase)) - return true; - else - return false; - } else - return false; - } - - /* - * Method checks if this region intersects test region from below - * - * Note: To be true, this region must have some part outside the test region - * - * Parameters: - * testRegion - chromosome selection region - * - * Returns: - * This region intersects the test region from below: true or false - * */ - - public boolean intersectsBelow(RPChromosomeRegion testRegion) { - - // Only need to test if some part of this region is below and some within test region. - if (startChromID < testRegion.startChromID || - (startChromID == testRegion.startChromID && startBase < testRegion.startBase)) { - if (endChromID > testRegion.startChromID || - (endChromID == testRegion.startChromID && endBase > testRegion.startBase)) - return true; - else - return false; - } else - return false; - } - - /* - * Method checks if this region intersects test region from above. - * - * Note: To be true, this region must have some part outside the test region - * - * Parameters: - * testRegion - chromosome selection region - * - * Returns: - * This region intersects the test region from above: true or false - * */ - - public boolean intersectsAbove(RPChromosomeRegion testRegion) { - - // Only need to test if some part of this region is above and some within test region. - if (endChromID > testRegion.endChromID || - (endChromID == testRegion.endChromID && endBase > testRegion.endBase)) { - if (startChromID < testRegion.endChromID || - (startChromID == testRegion.endChromID && startBase < testRegion.endBase)) - return true; - else - return false; - } else - return false; - } - - /* - * Method checks if this region is completely below test region. - * - * Parameters: - * testRegion - chromosome selection region - * - * Returns: - * This region is disjoint below the test region: true or false - * */ - - public boolean disjointBelow(RPChromosomeRegion testRegion) { - - if (endChromID < testRegion.startChromID || - endChromID == testRegion.startChromID && endBase <= testRegion.startBase) - return true; - else - return false; - } - - /* - * Method checks if this region region is completely above test region. - * - * Parameters: - * testRegion - chromosome selection region - * - * Returns: - * This region is disjoint above the test region: true or false - * */ - - public boolean disjointAbove(RPChromosomeRegion testRegion) { - - if (startChromID > testRegion.endChromID || - startChromID == testRegion.endChromID && startBase >= testRegion.endBase) - return true; - else - return false; - } - - /* - * Method computes the extremes between this region and the test region - * - * Parameters: - * testRegion - chromosome region to compare against this region - * - * Returns: - * new chromosome region of extremes - * */ - - public RPChromosomeRegion getExtremes(RPChromosomeRegion testRegion) { - RPChromosomeRegion newRegion = new RPChromosomeRegion(this); - - // update node bounds - if (testRegion.startChromID < newRegion.startChromID || - (testRegion.startChromID == newRegion.startChromID && - testRegion.startBase < newRegion.startBase)) { - newRegion.startChromID = testRegion.startChromID; - newRegion.startBase = testRegion.startBase; - } - - if (testRegion.endChromID > newRegion.endChromID || - (testRegion.endChromID == newRegion.endChromID && - testRegion.endBase > newRegion.endBase)) { - newRegion.endChromID = testRegion.endChromID; - newRegion.endBase = testRegion.endBase; - } - - return newRegion; - } - - public void expand(RPChromosomeRegion testRegion) { - if (testRegion.startChromID < startChromID || - (testRegion.startChromID == startChromID && - testRegion.startBase < startBase)) { - startChromID = testRegion.startChromID; - startBase = testRegion.startBase; - } - - if (testRegion.endChromID > endChromID || - (testRegion.endChromID == endChromID && - testRegion.endBase > endBase)) { - endChromID = testRegion.endChromID; - endBase = testRegion.endBase; - } - - - } - - -} diff --git a/src/org/broad/igv/bbfile/RPTree.java b/src/org/broad/igv/bbfile/RPTree.java deleted file mode 100644 index e98da8f..0000000 --- a/src/org/broad/igv/bbfile/RPTree.java +++ /dev/null @@ -1,674 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.logging.Logger; - -import org.broad.tribble.SeekableStreamUtils; - -import org.broad.tribble.LittleEndianInputStream; -import net.sf.samtools.seekablestream.SeekableStream; - - -/* -* RPTree class will construct a R+ tree from a binary Bed/Wig BBFile. -* (or by insertion of tree nodes - TBD see insert method) -* -* 1) RPTree will first read in the R+ tree header with RPTreeHeader class. -* -* 2) Starting with the root node, the readRPTreeNode method will read in the -* node format, determine if the node contains child nodes (isLeaf = false) -* or leaf items (isLeaf = true). -* -* 3) If the node is a leaf node, all leaf items are read in to the node's leaf array. -* -* 4) If node is a child node, readRPTreeNode will be called recursively, -* until a leaf node is encountered, where step 3 is performed. -* -* 5) The child nodes will be populated with their child node items in reverse order -* of recursion from step 4, until the tree is completely populated -* back up to the root node. -* -* 6) The getChromosomeKey is provided to construct a valid key for B+ -* chromosome tree searches, and getChromosomeID returns a chromosome ID for -* searches in the R+ index tree. -* -**/ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class RPTree { - - private static Logger log = Logger.getLogger(RPTree.class.getCanonicalName()); - - public final int RPTREE_NODE_FORMAT_SIZE = 4; // node format size - public final int RPTREE_NODE_LEAF_ITEM_SIZE = 32; // leaf item size - public final int RPTREE_NODE_CHILD_ITEM_SIZE = 24; // child item size - - // R+ tree access variables - for reading in R+ tree nodes from a file - private int uncompressBuffSize; // decompression buffer size; or 0 for uncompressed data - private boolean isLowToHigh; // binary data low to high if true; else high to low - private long rpTreeOffset; // file offset to the R+ tree - - // R+ tree index header - Table K - private RPTreeHeader rpTreeHeader; // R+ tree header (Table K for BBFile) - - // R+ tree bounds - private RPChromosomeRegion chromosomeBounds; // R+ tree's bounding chromosome region - - // R+ tree nodal variables - private int order; // R+ tree order: maximum number of leaves per node - private RPTreeNode rootNode; // root node for R+ tree - private long nodeCount; // number of nodes defined in the R+ tree - private long leafCount; // number of leaves in the R+ tree - - - /* - * Constructor for reading in a B+ tree from a BBFile/input stream. - * */ - /* - * Constructor for R+ chromosome data locator tree - * - * Parameters: - * fis - file input stream handle - * fileOffset - location for R+ tree header - * isLowToHigh - binary values are low to high if true; else high to low - * uncompressBuffSize - buffer size for decompression; else 0 for uncompressed data - * */ - public RPTree(SeekableStream fis, long fileOffset, boolean isLowToHigh, int uncompressBuffSize) { - - // save the seekable file handle and B+ Tree file offset - // Note: the offset is the file position just after the B+ Tree Header - // mBBFis = fis; - rpTreeOffset = fileOffset; - this.uncompressBuffSize = uncompressBuffSize; - this.isLowToHigh = isLowToHigh; - - // read in R+ tree header - verify the R+ tree info exits - rpTreeHeader = new RPTreeHeader(fis, rpTreeOffset,isLowToHigh); - - // log error if header not found and throw exception - if(!rpTreeHeader.isHeaderOK()){ - int badMagic = rpTreeHeader.getMagic(); - log.severe("Error reading R+ tree header: bad magic = " + badMagic); - throw new RuntimeException("Error reading R+ tree header: bad magic = " + badMagic); - } - - // assigns R+ tree organization from the header - order = rpTreeHeader.getBlockSize(); - chromosomeBounds = new RPChromosomeRegion(rpTreeHeader.getStartChromID(), rpTreeHeader.getStartBase(), - rpTreeHeader.getEndChromID(), rpTreeHeader.getEndBase()); - - // populate the tree - read in the nodes - long nodeOffset = rpTreeOffset + rpTreeHeader.getHeaderSize(); - RPTreeNode parentNode = null; // parent node of the root is itself, or null - - // start constructing the R+ tree - get the root node - rootNode = readRPTreeNode(fis, nodeOffset, isLowToHigh); - } - - /* - * Constructs an R+ Tree which conforms to the supplied information - * order - the items per node factor, sometimes called the m factor, - * where any node must have at least m/2 items and no more than m items. - * keySize - the number of significant bytes in a item key. - * */ - public RPTree(int order) { - - // R+ tree node specification - this.order = order; - - // Note: acknowledge no bounds specified as a null object - chromosomeBounds = null; - - } - - /* - * Method returns size of buffer required for data decompression. - * - * Returns: - * Data decompression buffer size in bytes; else 0 for uncompressed data in file. - * */ - public int getUncompressBuffSize() { - return uncompressBuffSize; - } - - /* - * Method returns if file contains formatted data in low to high byte order. - * - * Returns: - * Returns true if data ordered in low to high byte order; false if high to low. - * */ - public boolean isIsLowToHigh() { - return isLowToHigh; - } - - /* - * Method returns the R+ tree order, the maximum number of leaf items per node. - * - * Returns: - * Maximum number of leaf items per node.. - * */ - public int getOrder() { - return order; - } - - /* - * Method returns the R+ tree index header. - * - * Returns: - * R+ tree index header. - * */ - public RPTreeHeader getRPTreeHeader() { - return rpTreeHeader; - } - - /* - * Method returns the total number of chromosomes or contigs in the R+ tree. - * - * Returns: - * Total number of chromosomes or contigs in the R+ tree. - * */ - public long getItemCount() { - return rpTreeHeader.getItemCount(); - } - - /* - * Method returns the chromosome bounding region for all R+ tree data. - * - * Returns: - * chromosome bounding region for all R+ tree data - * */ - public RPChromosomeRegion getChromosomeBounds() { - return chromosomeBounds; - } - - /* - * Method returns the total node count for the R+ tree. - * - * Returns: - * Node count for R+ tree; or 0 if tree was constructed without nodes. - * */ - public long getNodeCount() { - return nodeCount; - } - - /* - * Method finds the bounding chromosome region in R+ tree for a chromosome ID range. - * - * Parameters: - * startChromID - start chromosome for the region - * endChromID - end chromosome for the region - * - * Returns: - * Region which bounds the extremes of chromosome ID range - * */ - public RPChromosomeRegion getChromosomeRegion(int startChromID, int endChromID){ - - RPChromosomeRegion region; - - // Search the R+ tree to extract the chromosome region. - RPTreeNode thisNode = rootNode; - RPChromosomeRegion seedRegion = null; // null until a chromosome match - - region = findChromosomeRegion(thisNode, startChromID, endChromID, seedRegion); - - return region; - } - - /* - * Method returns list of all chromosome regions found for the chromosome ID range. - * - * Returns: - * List of all chromosome regions in the chromosome ID range. - * */ - public ArrayList getAllChromosomeRegions(){ - - // Search the R+ tree to extract the chromosome regions - RPTreeNode thisNode = rootNode; - - ArrayList regionList = new ArrayList(); - - findAllChromosomeRegions(thisNode, regionList); - - return regionList; - } - - /* - * Method extracts a hit list of chromosome data file locations for a specified chromosome region. - * - * Parameters: - * chromosomeRegion - chromosome region for feature extraction consists of: - * startChromID - start chromosome ID for region - * mStartBase - starting base for data extraction - * endChromID - end chromosome ID for region - * mEndBase - ending base for data extraction - * contained - if true indicates all returned data must be - * completely contained within the extraction region; - * else if false, returns all intersecting region features - * - * Note: The selection region will be limited to accommodate maxLeafHits; which terminates - * selection at the leaf node at which maxLeafHits is reached. Total number of selected - * items may exceed maxLeafHits, but only by the number of leaves in the cutoff leaf node. - * - * Returns: - * List of chromosome leaf items which identify file locations for bed data - * of a chromosome region, or a sub-region subject to maxLeafHits. - * - * Check returned leaf item bounds for cutoff limits on selection region due to maxLeafHits. - * */ - public ArrayList getChromosomeDataHits(RPChromosomeRegion selectionRegion, - boolean contained) { - - ArrayList leafHitItems = new ArrayList(); - - // check for valid selection region - return empty collection if null - if(selectionRegion == null) - return leafHitItems; - - // limit the hit list size - /* - if(maxLeafHits > 0) - mMaxLeafHits = maxLeafHits; - else - mMaxLeafHits = mRPTreeHeader.getBlockSize(); - */ - - - findChromosomeRegionItems(rootNode, selectionRegion, leafHitItems); - - return leafHitItems; - } - - // prints out the R+ tree header, nodes, and leaves - public void print() { - - // check if read in - if(!rpTreeHeader.isHeaderOK()){ - int badMagic = rpTreeHeader.getMagic(); - log.severe("Error reading R+ tree header: bad magic = " + badMagic); - return; - } - - // print R+ tree header - rpTreeHeader.print(); - - // print R+ tree node and leaf items - recursively - if(rootNode != null) - rootNode.printItems(); - - } - - /* - * Method finds and returns the bounding chromosome region for the specified - * chromosome ID range. - * - * Parameters: - * thisNode - tree node to start search - * startChromID - start chromosome ID for region - * endChromID - end chromosome ID for region - * region - leaf region contains extremes for given chromosome ID range - * - * Note: region grows recursively to match the extremes found for the - * specified chromosome ID range. Starting base comes from the startChromID - * match and ending base comes form the endChromID match. - * - * Returns: - * Chromosome region if found in the R+ tree node passed in; - * else null region - * */ - private RPChromosomeRegion findChromosomeRegion(RPTreeNode thisNode, - int startChromID, int endChromID, RPChromosomeRegion region){ - - int hitValue; - RPChromosomeRegion bounds; - - // search down the tree recursively starting with the root node - if(thisNode.isLeaf()) - { - int nLeaves = thisNode.getItemCount(); - for(int index = 0; index < nLeaves; ++index){ - - RPTreeLeafNodeItem leaf = (RPTreeLeafNodeItem)thisNode.getItem(index); - - // get leaf region bounds - bounds = leaf.getChromosomeBounds(); - - // test this leaf's chromosome ID's for chromosome hit, then include its base bounds - if(startChromID >= bounds.getStartChromID() && startChromID <= bounds.getEndChromID() || - endChromID >= bounds.getStartChromID() && endChromID <= bounds.getEndChromID() ){ - - // Note: need a start region before comparing other regions for extremes - if(region == null) - region = new RPChromosomeRegion(bounds); // seed extreme region - else - region = region.getExtremes(bounds); // update seed extreme region - } - } - } - else { - // check all child nodes - int nNodes = thisNode.getItemCount(); - for(int index = 0; index < nNodes; ++index){ - - RPTreeChildNodeItem childItem = (RPTreeChildNodeItem)thisNode.getItem(index); - - // get bounding region and compare chromosome ID's - bounds = childItem.getChromosomeBounds(); - - // test node chromosome ID range for any leaf hits for either startChromID or endChromID - if(startChromID >= bounds.getStartChromID() && startChromID <= bounds.getEndChromID() || - endChromID >= bounds.getStartChromID() && endChromID <= bounds.getEndChromID() ){ - - RPTreeNode childNode = childItem.getChildNode(); - region = findChromosomeRegion(childNode, startChromID, endChromID, region); - } - - // check next node - } - } - - return region; - } - - /* - * Method finds and returns all chromosome regions in the R+ chromosome data tree. - * - * parameters: - * thisNode - tree node to start search - * chromosomeList - list of all chromosome names found. - * - * Returns: - * Adds chromosome regions if found in the chromosome region list passed in. - * */ - private void findAllChromosomeRegions(RPTreeNode thisNode, - ArrayList regionList){ - - // search down the tree recursively starting with the root node - if(thisNode.isLeaf()) - { - int nLeaves = thisNode.getItemCount(); - for(int index = 0; index < nLeaves; ++index){ - - RPTreeLeafNodeItem leaf = (RPTreeLeafNodeItem)thisNode.getItem(index); - - // add all leaf regions - RPChromosomeRegion region = leaf.getChromosomeBounds(); - regionList.add(region); - } - } - else { - // get all child nodes - int nNodes = thisNode.getItemCount(); - for(int index = 0; index < nNodes; ++index){ - - RPTreeChildNodeItem childItem = (RPTreeChildNodeItem)thisNode.getItem(index); - RPTreeNode childNode = childItem.getChildNode(); - - findAllChromosomeRegions(childNode, regionList); - } - } - - } - - /* - * Method returns an array of chromosome leaf items for the chromosome test region. - * - * Note: At the leaf item level, any hit is valid. Use of contained is exercised - * when the leaf item data region is examined. - * Parameters: - * - * thisNode - tree node to start search - * testRegion - bounding region for feature extraction consists of: - * start chromosome ID for region - * starting base for data extraction - * end chromosome ID for region - * ending base for data extraction - * leafHitItems - array containing previous leaf hit items - * - * Note: leaf hit items will be limited to leaves in the current leaf node, - * once the maximum number of leaf hits mMaxLeafHits is reached. - * - * Returns: - * ArrayList of leaf hit items containing updated hit regions and data offsets; - * else an empty array if hit regions not found. - * */ - private void findChromosomeRegionItems( RPTreeNode thisNode, RPChromosomeRegion selectionRegion, - ArrayListleafHitItems){ - - int hitValue; - - // check for valid selection region - ignore request if null - if(selectionRegion == null) - return; - - // check if node is disjoint - hitValue = thisNode.compareRegions(selectionRegion); - if(Math.abs(hitValue) >= 2) - return; - - // search down the tree recursively starting with the root node - if(thisNode.isLeaf()) - { - int nLeaves = thisNode.getItemCount(); - for(int index = 0; index < nLeaves; ++index){ - RPTreeLeafNodeItem leafItem = (RPTreeLeafNodeItem)thisNode.getItem(index); - - // compute the region hit value - hitValue = leafItem.compareRegions(selectionRegion); - - // select contained or intersected leaf regions - item selection is by iterator - if(Math.abs(hitValue) < 2){ - leafHitItems.add(leafItem); - } - - // ascending regions will continue to be disjoint so terminate nodal search - else if(hitValue > 1) - break; - - // check next leaf - } - } - else { - // check all child nodes - int nNodes = thisNode.getItemCount(); - for(int index = 0; index < nNodes; ++index){ - RPTreeChildNodeItem childItem = (RPTreeChildNodeItem)thisNode.getItem(index); - - // check for region intersection at the node level - hitValue = childItem.compareRegions(selectionRegion); - - // test this node and get any leaf hits; intersections and containing - if(Math.abs(hitValue) < 2){ - RPTreeNode childNode = childItem.getChildNode(); - findChromosomeRegionItems(childNode, selectionRegion, leafHitItems); - } - - // ascending regions will continue to be disjoint so terminate nodal search - else if(hitValue > 1) - break; - } - } - } - - /* - * Method reads in the R+ tree nodes recursively. - * - * Note: If node is a child node, the node is examined recursively, - * until the leaves are found. - * - * Parameters: - * fis - file input stream handle - * fileOffset - file location for node specification (Table L) - * parent - parent node of this node - * isLowToHigh - indicates formatted data is low to high byte order if true; - * else is high to low byte order - * - * Returns: - * A tree node, for success, or null for failure to find the node information. - - * */ - private RPTreeNode readRPTreeNode(SeekableStream fis, long fileOffset, boolean isLowToHigh){ - - LittleEndianInputStream lbdis = null; // low o high byte stream reader - DataInputStream bdis = null; // high to low byte stream reader - - byte[] buffer = new byte[RPTREE_NODE_FORMAT_SIZE]; - RPTreeNode thisNode = null; - RPTreeNode childNode = null; - byte type; - - - boolean isLeaf; - byte bval; - int itemCount; - int itemSize; - long dataOffset; - long dataSize; - - try { - - // Read node format into a buffer - fis.seek(fileOffset); -// fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - - if(isLowToHigh) - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(buffer)); - else - bdis = new DataInputStream(new ByteArrayInputStream(buffer)); - - // find node type - if(isLowToHigh) - type = lbdis.readByte(); - else - type = bdis.readByte(); - - if(type == 1) { - isLeaf = true; - itemSize = RPTREE_NODE_LEAF_ITEM_SIZE; - thisNode = new RPTreeLeafNode(); - } - else { - isLeaf = false; - itemSize = RPTREE_NODE_CHILD_ITEM_SIZE; - thisNode = new RPTreeChildNode(); - } - nodeCount++; - - if(isLowToHigh){ - bval = lbdis.readByte(); // reserved - not currently used - itemCount = lbdis.readShort(); - } - else { - bval = bdis.readByte(); // reserved - not currently used - itemCount = bdis.readShort(); - } - - int itemBlockSize = itemCount * itemSize; - buffer = new byte[itemBlockSize]; // allocate buffer for item sisze -// fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - if(isLowToHigh) - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(buffer)); - else - bdis = new DataInputStream(new ByteArrayInputStream(buffer)); - - // get the node items - leaves or child nodes - int startChromID, endChromID; - int startBase, endBase; - for(int item = 0; item < itemCount; ++item) { - - - // always extract the bounding rectangle - if(isLowToHigh){ - startChromID = lbdis.readInt(); - startBase = lbdis.readInt(); - endChromID = lbdis.readInt(); - endBase = lbdis.readInt(); - } - else { - startChromID = bdis.readInt(); - startBase = bdis.readInt(); - endChromID = bdis.readInt(); - endBase = bdis.readInt(); - } - - if(isLeaf) { - if(isLowToHigh) { - dataOffset = lbdis.readLong(); - dataSize = lbdis.readLong(); - } - else { - dataOffset = bdis.readLong(); - dataSize = bdis.readLong(); - } - - // insert leaf node items - RPTreeLeafNodeItem leafItem = new RPTreeLeafNodeItem(startChromID, startBase, - endChromID, endBase, dataOffset, dataSize); - thisNode.insertItem(leafItem); - } - else { - // get the child node pointed to in the node item - if(isLowToHigh) - dataOffset = lbdis.readLong(); - else - dataOffset = bdis.readLong(); - - childNode = readRPTreeNode(fis, dataOffset, isLowToHigh); - - // insert child node item - RPTreeChildNodeItem childItem = new RPTreeChildNodeItem(startChromID, startBase, - endChromID, endBase, childNode); - thisNode.insertItem(childItem); - } - - fileOffset += itemSize; - } - - }catch(IOException ex) { - log.severe("Error reading in R+ tree nodes: " + ex); - throw new RuntimeException("Error reading R+ tree nodes: \n", ex); - } - - // return success - return thisNode; - } -} diff --git a/src/org/broad/igv/bbfile/RPTreeChildNode.java b/src/org/broad/igv/bbfile/RPTreeChildNode.java deleted file mode 100644 index 6f4c04d..0000000 --- a/src/org/broad/igv/bbfile/RPTreeChildNode.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.ArrayList; -import java.util.logging.Logger; - - -/** - * Container class for R+ tree leaf or child node format - * Note: RPTreeNode interface supports leaf and child node formats - */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class RPTreeChildNode implements RPTreeNode { - - - private static Logger log = Logger.getLogger(RPTreeChildNode.class.getCanonicalName()); - - private RPChromosomeRegion chromosomeBounds; // chromosome bounds for entire node - private ArrayList childItems; // array for child items - - public RPTreeChildNode() { - - childItems = new ArrayList(); - - // Note: Chromosome bounds are null until a valid region is specified - } - - // *** BPTreeNode interface implementation *** - - - public RPChromosomeRegion getChromosomeBounds() { - return chromosomeBounds; - } - - public int compareRegions(RPChromosomeRegion chromosomeRegion) { - - // test leaf item bounds for hit - int value = chromosomeBounds.compareRegions(chromosomeRegion); - return value; - } - - public boolean isLeaf() { - return false; - } - - public int getItemCount() { - return childItems.size(); - } - - public RPTreeNodeItem getItem(int index) { - - if (index < 0 || index >= childItems.size()) - return null; - else { - RPTreeChildNodeItem item = childItems.get(index); - return (RPTreeNodeItem) item; - } - } - - public boolean insertItem(RPTreeNodeItem item) { - - RPTreeChildNodeItem newItem = (RPTreeChildNodeItem) item; - - // Quick implementation: assumes all keys are inserted in rank order - // todo: or compare key and insert at rank location - childItems.add(newItem); - - // Update node bounds or start node chromosome bounds with first entry - if (chromosomeBounds == null) - chromosomeBounds = new RPChromosomeRegion(newItem.getChromosomeBounds()); - else - chromosomeBounds = chromosomeBounds.getExtremes(newItem.getChromosomeBounds()); - - // success - return true; - } - - public boolean deleteItem(int index) { - - int itemCount = getItemCount(); - - // unacceptable index - reject - if (index < 0 || index >= itemCount) - return false; - - // delete indexed entry - childItems.remove(index); - - // successful delete - return true; - } - - public void printItems() { - - for (int item = 0; item < childItems.size(); ++item) { - childItems.get(item).print(); - } - } - - -} diff --git a/src/org/broad/igv/bbfile/RPTreeChildNodeItem.java b/src/org/broad/igv/bbfile/RPTreeChildNodeItem.java deleted file mode 100644 index 4a21ec0..0000000 --- a/src/org/broad/igv/bbfile/RPTreeChildNodeItem.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.logging.Logger; - - - -/* - Container class for R+ Tree Child format - */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class RPTreeChildNodeItem implements RPTreeNodeItem { - - private static Logger log = Logger.getLogger(RPTreeChildNodeItem.class.getCanonicalName()); - private final boolean isLeafItem = false; - - // R+ child (non-leaf) node item entries: BBFile Table N - private RPChromosomeRegion chromosomeBounds; // chromosome bounds for item - private RPTreeNode childNode; // child node assigned to node item - - /* Constructor for child node items. - * - * Parameters: - * itemIndex - index of item belonging to a child node - * startChromID - starting chromosome/contig for item - * startBase - starting base for item - * endChromID - ending chromosome/contig for item - * endBase - ending base for item - * childNode - child node item assigned to child node - * - * */ - public RPTreeChildNodeItem(int startChromID, int startBase, - int endChromID, int endBase, RPTreeNode childNode){ - - - chromosomeBounds = new RPChromosomeRegion(startChromID, startBase, endChromID, endBase); - this.childNode = childNode; - } - - public RPChromosomeRegion getChromosomeBounds() { - return chromosomeBounds; - } - - public RPTreeNode getChildNode() { - return childNode; - } - - public int compareRegions(RPChromosomeRegion chromosomeRegion){ - - int value = chromosomeBounds.compareRegions(chromosomeRegion); - return value; - } - - public void print(){ - - log.info("Child node item :\n"); - log.info(" StartChromID = " + chromosomeBounds.getStartChromID() + "\n"); - log.info(" StartBase = " + chromosomeBounds.getStartBase() + "\n"); - log.info(" EndChromID = " + chromosomeBounds.getEndChromID() + "\n"); - log.info(" EndBase = " + chromosomeBounds.getEndBase() + "\n"); - - // child node specific entries - childNode.printItems(); - } - -} - diff --git a/src/org/broad/igv/bbfile/RPTreeHeader.java b/src/org/broad/igv/bbfile/RPTreeHeader.java deleted file mode 100644 index 0c00ec4..0000000 --- a/src/org/broad/igv/bbfile/RPTreeHeader.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.EOFException; -import java.io.IOException; -import java.util.logging.Logger; - -import org.broad.tribble.SeekableStreamUtils; - -import org.broad.tribble.LittleEndianInputStream; -import net.sf.samtools.seekablestream.SeekableStream; - -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class RPTreeHeader { - - private static Logger log = Logger.getLogger(RPTreeHeader.class.getCanonicalName()); - - public final int RPTREE_HEADER_SIZE = 48; - - public final int RPTREE_MAGIC_LTH = 0x2468ACE0; - public final int RPTREE_MAGIC_HTL = 0xE0AC6824; - - // defines the R+ Tree access - - private long rpTreeOffset; // BBFile file offset for mChromosome region tree - private boolean headerOK; // R+ Tree header read OK - - // R+ Tree header - Table K - private int magic; // magic number identifies it as B+ header - private int blockSize; // number of children per block - private long itemCount; // number of chromosomes/contigs in B+ tree - private int startChromID; // ID of the first mChromosome in item - private int startBase; // Position of first base in item - private int endChromID; // ID of the first mChromosome in item - private int endBase; // Position of first base in item - private long endFileOffset; // file position marking mEndBase of data - private int itemsPerSlot; // number of items per leaf - private long reserved; // Currently 0 - - // constructor - reads from file input stream - /* - * Constructor - * - * Parameters: - * fis - file input stream handle - * fileOffset - file offset to the RP tree header - * isLowToHigh - if true, indicates low to high byte order, else high to low - * */ - public RPTreeHeader(SeekableStream fis, long fileOffset, boolean isLowToHigh) { - - long itemsCount; - - rpTreeOffset = fileOffset; - - // Note: a bad R+ Tree header will result in false returned - headerOK = readHeader(fis, rpTreeOffset, isLowToHigh); - - } - - public boolean isHeaderOK() { - return headerOK; - } - - public int getHeaderSize() { - return RPTREE_HEADER_SIZE; - } - - public long getTreeOffset() { - return rpTreeOffset; - } - - public int getMagic() { - return magic; - } - - public int getBlockSize() { - return blockSize; - } - - public long getItemCount() { - return itemCount; - } - - public int getStartChromID() { - return startChromID; - } - - public int getStartBase() { - return startBase; - } - - public int getEndChromID() { - return endChromID; - } - - public int getEndBase() { - return endBase; - } - - public long getMEndFileOffset() { - return endFileOffset; - } - - public int getItemsPerSlot() { - return itemsPerSlot; - } - - public long getReserved() { - return reserved; - } - -// prints out the B+ Tree Header -public void print() { - - // note if read successfully - if(headerOK){ - log.info("R+ tree header has " + RPTREE_HEADER_SIZE + " bytes."); - log.info("R+ tree header magic = " + magic); - } - else { - log.info("R+ Tree header is unrecognized type, header magic = " + magic); - return; - } - - // Table E - Chromosome B+ Tree Header - log.info("R+ Tree file offset = " + rpTreeOffset); - log.info("magic = " + magic); - log.info("Block size = " + blockSize); - log.info("ItemCount = " + itemCount); - log.info("StartChromID = " + startChromID); - log.info("StartBase = " + startBase); - log.info("EndChromID = " + endChromID); - log.info("EndBase = " + endBase); - log.info("EndFileOffset = " + endFileOffset); - log.info("ItemsPerSlot = " + itemsPerSlot); - log.info("Reserved = " + reserved); - } - - /* - * Reads in the R+ Tree Header. - * - * Returns status of for tree header read; true if read, false if not. - * */ - private boolean readHeader(SeekableStream fis, long fileOffset, boolean isLowToHigh){ - - LittleEndianInputStream lbdis; - DataInputStream bdis; - - byte[] buffer = new byte[RPTREE_HEADER_SIZE]; - - try { - // Read R+ tree header into a buffer - fis.seek(fileOffset); - //fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - - // decode header - if(isLowToHigh){ - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(buffer)); - magic = lbdis.readInt(); - - // check for a valid B+ Tree Header - if(magic != RPTREE_MAGIC_LTH) - return false; - - // Get mChromosome B+ header information - blockSize = lbdis.readInt(); - itemCount = lbdis.readLong(); - startChromID = lbdis.readInt(); - startBase = lbdis.readInt(); - endChromID = lbdis.readInt(); - endBase = lbdis.readInt(); - endFileOffset = lbdis.readLong(); - itemsPerSlot = lbdis.readInt(); - reserved = lbdis.readInt(); - } - else { - bdis = new DataInputStream(new ByteArrayInputStream(buffer)); - - // check for a valid B+ Tree Header - magic = bdis.readInt(); - - if(magic != RPTREE_MAGIC_HTL) - return false; - - // Get mChromosome B+ header information - blockSize = bdis.readInt(); - itemCount = bdis.readLong(); - startChromID = bdis.readInt(); - startBase = bdis.readInt(); - endChromID = bdis.readInt(); - endBase = bdis.readInt(); - endFileOffset = bdis.readLong(); - itemsPerSlot = bdis.readInt(); - reserved = bdis.readInt(); - } - - }catch(IOException ex) { - log.severe("Error reading R+ tree header " + ex); - throw new RuntimeException("Error reading R+ tree header ", ex); - } - - // success - return true; - } - - -} diff --git a/src/org/broad/igv/bbfile/RPTreeLeafNode.java b/src/org/broad/igv/bbfile/RPTreeLeafNode.java deleted file mode 100644 index 1cdb05f..0000000 --- a/src/org/broad/igv/bbfile/RPTreeLeafNode.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.ArrayList; -import java.util.logging.Logger; - -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class RPTreeLeafNode implements RPTreeNode{ - - private static Logger log = Logger.getLogger(RPTreeLeafNode.class.getCanonicalName()); - - private RPChromosomeRegion chromosomeBounds; // bounds for entire node - private ArrayList leafItems; // array for leaf items - - public RPTreeLeafNode(){ - - leafItems = new ArrayList(); - - // init with null bounds - chromosomeBounds = new RPChromosomeRegion(); - } - - public boolean isLeaf() { - return true; - } - - public RPChromosomeRegion getChromosomeBounds(){ - return chromosomeBounds; - } - - public int compareRegions(RPChromosomeRegion chromosomeRegion){ - - int value = chromosomeBounds.compareRegions(chromosomeRegion); - return value; - } - - public int getItemCount() { - return leafItems.size(); - } - - public RPTreeNodeItem getItem(int index){ - - if(index < 0 || index >= leafItems.size()) - return null; - else - return leafItems.get(index); - } - - public boolean insertItem(RPTreeNodeItem item){ - - RPTreeLeafNodeItem newItem = (RPTreeLeafNodeItem)item; - - // Note: assumes all keys are inserted in rank order - leafItems.add(newItem); - - // todo: compare region and insert at appropriate indexed rank location - // mLeafHitItem.add( index, (RPTreeLeafNodeItem)item ); - - // update leaf node chromosome bounds - use extremes - // Update node bounds or start node chromosome bounds with first entry - if(chromosomeBounds == null) - chromosomeBounds = new RPChromosomeRegion(newItem.getChromosomeBounds()); - else - chromosomeBounds = chromosomeBounds.getExtremes(newItem.getChromosomeBounds()); - - // successful insert - return true; - } - - public boolean deleteItem(int index){ - - int itemCount = getItemCount(); - - // unacceptable index - reject - if(index < 0 || index >= itemCount) - return false; - - // delete indexed entry - leafItems.remove(index); - - // successful delete - return true; - } - - public void printItems(){ - - log.info("Leaf Node contains " + leafItems.size() + " items:"); - - for(int item = 0; item < leafItems.size(); ++item){ - leafItems.get(item).print(); - } - } - -} diff --git a/src/org/broad/igv/bbfile/RPTreeLeafNodeItem.java b/src/org/broad/igv/bbfile/RPTreeLeafNodeItem.java deleted file mode 100644 index 73d5852..0000000 --- a/src/org/broad/igv/bbfile/RPTreeLeafNodeItem.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.logging.Logger; - - -/* - Container class for R+ tree leaf node data locator. -* -* Note: Determination of data item as BigWig data or BigBed data -* depends on whether the file is BigWig of Table J format -* or BigBed of Tble I format. - */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class RPTreeLeafNodeItem extends RPChromosomeRegion implements RPTreeNodeItem { - - private static Logger log = Logger.getLogger(RPTreeLeafNodeItem.class.getCanonicalName()); - - private long dataOffset; // file offset to data item - private long dataSize; // size of data item - - /* Constructor for leaf node items. - * - * Parameters: - * itemIndex - index of item belonging to a leaf node - * startChromID - starting chromosome/contig for item - * startBase - starting base for item - * endChromID - ending chromosome/contig for item - * endBase - ending base for item - * dataOffset - file location for leaf chromosome/contig data - * dataSize - size of (compressed) leaf data region in bytes - * - * */ - - public RPTreeLeafNodeItem(int startChromID, int startBase, - int endChromID, int endBase, long dataOffset, long dataSize) { - super(startChromID, startBase, endChromID, endBase); - this.dataOffset = dataOffset; - this.dataSize = dataSize; - } - - - public RPChromosomeRegion getChromosomeBounds() { - return this; - } - - public void print() { - - log.info("R+ tree leaf node data item "); - log.info("StartChromID = " + getStartChromID()); - log.info("StartBase = " + getStartBase()); - log.info("EndChromID = " + getEndChromID()); - log.info("EndBase = " + getEndBase()); - - // leaf node specific entries - log.info("DataOffset = " + dataOffset); - log.info("DataSize = " + dataSize); - } - - // *** RPTreeLeafNodeItem specific methods *** - - public long getDataOffset() { - return dataOffset; - } - - public long geDataSize() { - return dataSize; - } - -} diff --git a/src/org/broad/igv/bbfile/RPTreeNode.java b/src/org/broad/igv/bbfile/RPTreeNode.java deleted file mode 100644 index e972568..0000000 --- a/src/org/broad/igv/bbfile/RPTreeNode.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public interface RPTreeNode { - - // Identifies the node as a leaf node or a child (non-leaf) node. - public boolean isLeaf(); - - // Returns the chromosome bounds belonging to the entire node. - public RPChromosomeRegion getChromosomeBounds(); - - // Note: compareRegions returns the following values: - // -2 indicates chromosome region is completely below node region - // -1 indicates that chromosome region intersect node region from below - // 0 means that chromosome region is inclusive to node region - // 1 indicates chromosome region intersects node region from above - // 2 indicates that this region is completely above that region - public int compareRegions(RPChromosomeRegion chromosomeRegion); - - // Returns the number of items assigned to the node. - public int getItemCount(); - - // Returns the indexed node item. - public RPTreeNodeItem getItem(int index); - - // Inserts new node item according to bounds rank - public boolean insertItem(RPTreeNodeItem item); - - // Deletes indexed node item - public boolean deleteItem(int index); - - // prints the node items - public void printItems(); -} diff --git a/src/org/broad/igv/bbfile/RPTreeNodeItem.java b/src/org/broad/igv/bbfile/RPTreeNodeItem.java deleted file mode 100644 index 9ced858..0000000 --- a/src/org/broad/igv/bbfile/RPTreeNodeItem.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - - -/* -* RPTreeNodeItem interface for storage of R+ tree node item information. -* -* Note: The bounding 1D rectangle defined by: -* (mStartBase mChromosome, mStartBase base) to (mEndBase mChromosome, mEndBase base) -* is used as a key for insertion and searches on the R+ tree. -* -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -interface RPTreeNodeItem { - - - // returns the chromosome boundary for the item - public RPChromosomeRegion getChromosomeBounds(); - - // Note: compareRegions returns the following values: - // -2 indicates chromosome region is completely below node region - // -1 indicates that chromosome region intersect node region from below - // 0 means that chromosome region is inclusive to node region - // 1 indicates chromosome region intersects node region from above - // 2 indicates that this region is completely above that region - public int compareRegions(RPChromosomeRegion chromosomeRegion); - - // Prints the tree node item. - void print(); -} diff --git a/src/org/broad/igv/bbfile/WigItem.java b/src/org/broad/igv/bbfile/WigItem.java deleted file mode 100644 index 2d66443..0000000 --- a/src/org/broad/igv/bbfile/WigItem.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.logging.Logger; - -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class WigItem { - - private static Logger log = Logger.getLogger(WigItem.class.getCanonicalName()); - - private int itemIndex; // wig section item index number - private String chromosome; // mChromosome name - private int startBase; // mStartBase base position for feature - private int endBase; // mEndBase base position for feature - private float wigValue; // wig value - - public WigItem(int itemIndex, String chromosome, int startBase, int endBase, float wigValue){ - - this.itemIndex = itemIndex; - this.chromosome = chromosome; - this.startBase = startBase; - this.endBase = endBase; - this.wigValue = wigValue; - } - - public int getItemNumber(){ - return itemIndex; - } - - public String getChromosome() { - return chromosome; - } - - public int getStartBase() { - return startBase; - } - - public int getEndBase() { - return endBase; - } - - public float getWigValue() { - return wigValue; - } - - public void print(){ - log.info("Wig item index " + itemIndex); - log.info("mChromosome name: " + chromosome); - log.info("mChromosome start base = " + startBase); - log.info("mChromosome end base = " + endBase); - log.info("Wig value: \n" + wigValue); - } -} diff --git a/src/org/broad/igv/bbfile/ZoomDataBlock.java b/src/org/broad/igv/bbfile/ZoomDataBlock.java deleted file mode 100644 index 1523f61..0000000 --- a/src/org/broad/igv/bbfile/ZoomDataBlock.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.io.ByteArrayInputStream; -import java.io.DataInputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.broad.tribble.SeekableStreamUtils; - -import org.broad.tribble.LittleEndianInputStream; -import net.sf.samtools.seekablestream.SeekableStream; - - -/* -* Container class for reading and storing a block of zoom level data records. -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class ZoomDataBlock { - - private static Logger log = Logger.getLogger(ZoomDataBlock.class.getCanonicalName()); - - // Bed data block access variables - for reading in bed records from a file - private long fileOffset; // data block file offset - private long dataBlockSize; // byte size for data block specified in the R+ leaf - private boolean isLowToHigh; // if true, data is low to high byte order; else high to low - - // defines the zoom level source chromosomes - private int zoomLevel; // zoom level for the R+ chromosome data location tree - private HashMap chromosomeMap; // map of chromosome ID's and corresponding names - private RPTreeLeafNodeItem leafHitItem; //R+ leaf item with chromosome region and file data location - - // Provides uncompressed byte stream data reader - private byte[] zoomBuffer; // buffer containing leaf block data uncompressed - private int remDataSize; // number of unread decompressed data bytes - - // byte stream readers - private LittleEndianInputStream lbdis = null; // low to high byte stream reader - private DataInputStream dis = null; // high to low byte stream reader - - // Bed data extraction members - private ArrayList zoomDataList; // array of zoom level data - - /* - * Constructor for Bed data block reader. - * - * Parameters: - * zoomLevel - zoom level for data block - * fis - file input stream handle - * leafItem - R+ tree leaf item containing block data file location - * chromIDTree - B+ chromosome index tree returns chromosome ID's for names - * isLowToHigh - byte order is low to high if true; else high to low - * uncompressBufSize - byte size for decompression buffer; else 0 for uncompressed - * */ - - public ZoomDataBlock(int zoomLevel, SeekableStream fis, RPTreeLeafNodeItem leafHitItem, - HashMap chromosomeMap, boolean isLowToHigh, int uncompressBufSize) { - - this.zoomLevel = zoomLevel; - this.leafHitItem = leafHitItem; - this.chromosomeMap = chromosomeMap; - this.isLowToHigh = isLowToHigh; - - fileOffset = this.leafHitItem.getDataOffset(); - dataBlockSize = this.leafHitItem.geDataSize(); - byte[] buffer = new byte[(int) dataBlockSize]; - - // read Bed data block into a buffer - try { - fis.seek(fileOffset); - // fis.readFully(buffer); - SeekableStreamUtils.readFully(buffer, fis); - - // decompress if necessary - the buffer size is 0 for uncomressed data - // Note: BBFile Table C specifies a decompression buffer size - if (uncompressBufSize > 0) - zoomBuffer = BBCompressionUtils.decompress(buffer, uncompressBufSize); - else - zoomBuffer = buffer; // use uncompressed read buffer directly - - } catch (IOException ex) { - log.log(Level.SEVERE,"Error reading Zoom level " + this.zoomLevel + " data for leaf item ", ex); - String error = String.format("Error reading zoom level %d data for leaf item %d\n", this.zoomLevel); - throw new RuntimeException(error, ex); - } - - // wrap the bed buffer as an input stream - if (this.isLowToHigh) - lbdis = new LittleEndianInputStream(new ByteArrayInputStream(zoomBuffer)); - else - dis = new DataInputStream(new ByteArrayInputStream(zoomBuffer)); - - // initialize unread data size - remDataSize = zoomBuffer.length; - - // use method getZoomData to extract block data - } - - /* - * Method returns all zoom level data within the decompressed block buffer - * - * Parameters: - * selectionRegion - chromosome region for selecting zoom level data records - * contained - indicates selected data must be contained in selection region - * if true, else may intersect selection region - * - * Returns: - * zoom data records in the data block - * - * Note: Remaining bytes to data block are used to determine end of reading - * since a zoom record count for the data block is not known. - * */ - - public ArrayList getZoomData(RPChromosomeRegion selectionRegion, - boolean contained) { - - int chromID, chromStart, chromEnd, validCount; - float minVal, maxVal, sumData, sumSquares; - int itemHitValue; - int recordNumber = 0; - - // allocate the bed feature array list - zoomDataList = new ArrayList(); - - // check if all leaf items are selection hits - RPChromosomeRegion itemRegion = new RPChromosomeRegion(leafHitItem.getChromosomeBounds()); - int leafHitValue = itemRegion.compareRegions(selectionRegion); - - try { - //for(int index = 0; mRemDataSize >= ZoomDataRecord.RECORD_SIZE; ++index) { - for (int index = 0; remDataSize > 0; ++index) { - recordNumber = index + 1; - - if (isLowToHigh) { // buffer stream arranged low to high bytes - chromID = lbdis.readInt(); - chromStart = lbdis.readInt(); - chromEnd = lbdis.readInt(); - validCount = lbdis.readInt(); - minVal = lbdis.readFloat(); - maxVal = lbdis.readFloat(); - sumData = lbdis.readFloat(); - sumSquares = lbdis.readFloat(); - } else { // buffer stream arranged high to low bytes - chromID = dis.readInt(); - chromStart = dis.readInt(); - chromEnd = dis.readInt(); - validCount = dis.readInt(); - minVal = dis.readFloat(); - maxVal = dis.readFloat(); - sumData = dis.readFloat(); - sumSquares = dis.readFloat(); - } - - if (leafHitValue == 0) { // contained leaf region always a hit - String chromName = chromosomeMap.get(chromID); - ZoomDataRecord zoomRecord = new ZoomDataRecord(zoomLevel, recordNumber, chromName, - chromID, chromStart, chromEnd, validCount, minVal, maxVal, sumData, sumSquares); - zoomDataList.add(zoomRecord); - } else { // test for hit - itemRegion = new RPChromosomeRegion(chromID, chromStart, chromID, chromEnd); - itemHitValue = itemRegion.compareRegions(selectionRegion); - - // itemHitValue < 2 for intersection; itemHitValue == 0 for is contained - if (!contained && Math.abs(itemHitValue) < 2 || itemHitValue == 0) { - String chromName = chromosomeMap.get(chromID); - ZoomDataRecord zoomRecord = new ZoomDataRecord(zoomLevel, recordNumber, chromName, - chromID, chromStart, chromEnd, validCount, minVal, maxVal, sumData, sumSquares); - zoomDataList.add(zoomRecord); - } - } - - // compute data block remainder fom size item read - remDataSize -= ZoomDataRecord.RECORD_SIZE; - } - - } catch (IOException ex) { - log.severe("Read error for zoom level " + zoomLevel + " leaf item " ); - - // accept this as an end of block condition unless no items were read - if (recordNumber == 1) - throw new RuntimeException("Read error for zoom level " + zoomLevel + " leaf item "); - } - - return zoomDataList; - } - - public void print() { - log.info("Zoom Level " + zoomLevel + "data for leaf item :"); - - for (int index = 0; index <= zoomDataList.size(); ++index) { - // zoom data records print themselves - zoomDataList.get(index).print(); - } - } - -} diff --git a/src/org/broad/igv/bbfile/ZoomDataRecord.java b/src/org/broad/igv/bbfile/ZoomDataRecord.java deleted file mode 100644 index c9eecbf..0000000 --- a/src/org/broad/igv/bbfile/ZoomDataRecord.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.logging.Logger; - - -/* -* Container class for holding zoom level statistics, BBFile Table P. -* -* */ -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class ZoomDataRecord { - - private static Logger log = Logger.getLogger(ZoomDataRecord.class.getCanonicalName()); - - public static final int RECORD_SIZE = 32; - - private int zoomLevel; // zoom level associated with data - private int recordNumber; // record number - - // chromosome region statistics (useful for calculating mean and standard deviation) - private String chromName; // chromosome/contig name - private int chromId; // Numerical ID for mChromosome/contig - private int chromStart; // starting base position (from 0) - private int chromEnd; // ending base position - private int basesCovered; // number of bases with data - private float minVal; // minimum value for file data - private float maxVal; // maximum value for file data - private float sumData; // sum of all squares of file data values - private float sumSquares; // sum of squares of file data values - - /* - * Constructor for filling in zoom data record class. - * - * Parameters: - * zoomLevel - level of zoom - * recordNumber - record sequence number of multiple zoom level records - * chromName - chromosome/contig name - * chromId - mChromosome ID - * chromstart - starting base for zoom data region - * chromEnd - ending base for zoom data region - * validCount - number of bases in the region for which there is data - * minVal - minimum value in region - * maxVal - maximum value in region - * sumData - sum of all region data - * sumSquares - sum of the squares of all region data - * - * */ - public ZoomDataRecord(int zoomLevel, int recordNumber, String chromName, int chromId, int chromStart, int chromEnd, - int validCount, float minVal, float maxVal, float sumData, float sumSquares ){ - - this.zoomLevel = zoomLevel; - this.recordNumber = recordNumber; - this.chromName = chromName; - this.chromId = chromId; - this.chromStart = chromStart; - this.chromEnd = chromEnd; - this.basesCovered = validCount; - this.minVal = minVal; - this.maxVal = maxVal; - this.sumData = sumData; - this.sumSquares = sumSquares; - } - - public int getZoomLevel() { - return zoomLevel; - } - - public int getRecordNumber() { - return recordNumber; - } - - public String getChromName() { - return chromName; - } - - public int getChromId() { - return chromId; - } - - public int getChromStart() { - return chromStart; - } - - public int getChromEnd() { - return chromEnd; - } - - public int getBasesCovered() { - return basesCovered; - } - - public float getMinVal() { - return minVal; - } - - public float getMaxVal() { - return maxVal; - } - - public float getSumData() { - return sumData; - } - - public float getMeanVal() { - return basesCovered == 0 ? 0 : sumData / basesCovered; - } - - public float getSumSquares() { - return sumSquares; - } - - public void print(){ - - // Table P - zoom data record - log.info("Zoom data record (Table DD) number " + recordNumber + - " for zoom level " + zoomLevel); - log.info("ChromName = " + chromName); - log.info("ChromId = " + chromId); - log.info("ChromStart = " + chromStart); - log.info("ChromEnd = " + chromEnd); - log.info("ValidCount = " + basesCovered); - log.info("MinVal = " + minVal); - log.info("MaxVal = " + maxVal); - log.info("Sum of data values = " + sumData); - log.info("Sum of squares values = " + sumSquares); - } -} - diff --git a/src/org/broad/igv/bbfile/ZoomLevelIterator.java b/src/org/broad/igv/bbfile/ZoomLevelIterator.java deleted file mode 100644 index c854527..0000000 --- a/src/org/broad/igv/bbfile/ZoomLevelIterator.java +++ /dev/null @@ -1,429 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), - * Version 2.1 which is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR - * WARRANTES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, - * WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR - * PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER - * OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR RESPECTIVE - * TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES - * OF ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, - * ECONOMIC DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER - * THE BROAD OR MIT SHALL BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT - * SHALL KNOW OF THE POSSIBILITY OF THE FOREGOING. - */ - -package org.broad.igv.bbfile; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.logging.Logger; - -import net.sf.samtools.seekablestream.SeekableStream; - -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class ZoomLevelIterator { - - private static Logger log = Logger.getLogger(ZoomDataBlock.class.getCanonicalName()); - - - private boolean empty = false; - - // zoom level for zoom data - private int zoomLevel; - - //specification of chromosome selection region - private RPChromosomeRegion selectionRegion; // selection region for iterator - private boolean isContained; // if true, features must be fully contained by extraction region - private RPChromosomeRegion hitRegion; // hit selection region for iterator - - // File access variables for reading zoom level data block - private SeekableStream fis; // file input stream handle - private BPTree chromIDTree; // B+ chromosome index tree - private RPTree zoomDataTree; // R+ zoom data locations tree - - // chromosome region extraction items - private ArrayList leafHitList; // array of leaf hits for selection region items - private HashMap chromosomeMap; // map of chromosome ID's and corresponding names - private int leafItemIndex; // index of current leaf item being processed from leaf hit list - RPTreeLeafNodeItem leafHitItem; // leaf item being processed by next - - // current zoom level block being processed - ZoomDataBlock zoomDataBlock; // holds data block of zoom level records decompressed - private boolean dataBlockRead; // flag indicates successful read of data block for current leaf item - ArrayList zoomRecordList; // array of selected zoom data records - private int zoomRecordIndex; // index of next zoom data record from the list - - /** - * Default constructor. This is provided to support return of a subclassed "empty" iterator - */ - public ZoomLevelIterator() { - - } - - /** - * Constructs a zoom level iterator over the specified chromosome region - *

- * Parameters: - * fis - file input stream handle - * chromIDTree - B+ index tree returns chromId for chromosome name key - * zoomLevelTree - zoom level R+ chromosome index tree - * zoomLevel - zoom level represented by the R+ tree - * selectionRegion - chromosome region for selection of Bed feature extraction - * consists of: - * startChromID - ID of start chromosome - * startBase - starting base position for features - * endChromID - ID of end chromosome - * endBase - starting base position for features - * contained - specifies bed features must be contained by region, if true; - * else return any intersecting region features - */ - public ZoomLevelIterator(SeekableStream fis, BPTree chromIDTree, RPTree zoomDataTree, - int zoomLevel, RPChromosomeRegion selectionRegion, boolean contained) { - - // check for valid selection region - if (selectionRegion == null) - throw new RuntimeException("Error: ZoomLevelIterator selection region is null\n"); - - this.fis = fis; - this.chromIDTree = chromIDTree; - this.zoomDataTree = zoomDataTree; - this.zoomLevel = zoomLevel; - this.selectionRegion = selectionRegion; - isContained = contained; - - // set up hit list and read in the first data block - int hitCount = getHitRegion(selectionRegion, contained); - if (hitCount == 0) { - empty = true; - } - - // Ready for next() data extraction - } - - /* - * Method returns status on a "next record" being available. - * - * Return: - * true if a "next record" exists; else false. - * - * Note: If "next" method is called for a false condition, - * an UnsupportedOperationException will be thrown. - * */ - - public boolean hasNext() { - - if (empty) - return false; - - // first check if current data block can be read for next - if (zoomRecordIndex < zoomRecordList.size()) - return true; - - // need to fetch next data block - else if (leafItemIndex < leafHitList.size()) - return true; - - else - return false; - } - - /** - * Method returns the current bed feature and advances to the next bed record. - *

- * Returns: - * Bed feature for current BigBed data record. - *

- * Note: If "next" method is called when a "next item" does not exist, - * an UnsupportedOperationException will be thrown. - */ - public ZoomDataRecord next() { - - // Is there a need to fetch next data block? - if (zoomRecordIndex < zoomRecordList.size()) - return (zoomRecordList.get(zoomRecordIndex++)); - - // attempt to get next leaf item data block - else { - int nHits = getHitRegion(selectionRegion, isContained); - - if (nHits > 0) { - // Note: getDataBlock initializes bed feature index to 0 - return (zoomRecordList.get(zoomRecordIndex++)); // return 1st Data Block item - } else { - String result = String.format("Failed to find data for zoom region (%d,%d,%d,%d)\n", - hitRegion.getStartChromID(), hitRegion.getStartBase(), - hitRegion.getEndChromID(), hitRegion.getEndBase()); - log.severe(result); - - return null; - //throw new NoSuchElementException(result); - } - } - - } - - public void remove() { - throw new UnsupportedOperationException("Remove iterator item is not supported yet."); - } - - // ************ ZoomLevelIterator specific methods ******************* - /* - * Method returns the zoom level assigned to the iterator. - * - * Returns: - * Number of leaf node hits allowed at a time - * */ - - public int getZoomLevel() { - return zoomLevel; - } - - /* - * Method returns the iterator selection region. - * */ - - public RPChromosomeRegion getSelectionRegion() { - return selectionRegion; - } - -/* - * Method provides the iterator with a new selection region. - * - * Parameters: - * selectionRegion - chromosome region for selection of Bed feature extraction - * consists of: - * startChromID - ID of start chromosome - * startBase - starting base position for features - * endChromID - ID of end chromosome - * endBase - starting base position for features - * contained - specifies bed features must be contained by region, if true; - * else return any intersecting region features - * - * Returns: - * number of chromosome regions found in the selection region - * */ - - public int setSelectionRegion(RPChromosomeRegion selectionRegion, - boolean contained) { - this.selectionRegion = selectionRegion; - isContained = contained; - - // set up hit list and first data block read - leafHitList = null; // Must nullify existing hit list first! - int hitCount = getHitRegion(selectionRegion, contained); - if (hitCount == 0) // no hits - no point in fetching data - throw new RuntimeException("No wig data found in the selection region"); - - // Ready for next() data extraction - - return hitCount; - } - - - /* - * Method returns if bed items must be completely contained in - * the selection region. - * - * Returns: - * Boolean indicates items must be contained in selection region if true, - * else may intersect the selection region if false - * */ - - public boolean isContained() { - return isContained; - } - - /* - * Method returns the Big Binary file input stream handle. - * - * Returns: - * File input stream handle - * */ - - public SeekableStream getBBFis() { - return fis; - } - - /* - * Method returns the B+ chromosome index tree used for identifying - * chromosome ID's used to specify R+ chromosome data locations. - * - * Returns: - * B+ chromosome index tree - * */ - - public BPTree getChromosomeIDTree() { - return chromIDTree; - } - - /* - * Method returns the R+ zoom data data tree used for identifying - * chromosome data locations for the selection region. - * - * Returns: - * R+ chromosome data locations tree - * */ - - public RPTree getZoomDataTree() { - return zoomDataTree; - } - - /* - * Method finds the chromosome data hit items for the current hit selection region, - * and loads first hit data. - * - * Parameters: - * hitRegion - selection region for extracting hit items - * contained - indicates hit items must contained in selection region if true; - * and if false, may intersect selection region - * Note: The selection region will be limited to accommodate mMaxLeafHits; which terminates - * selection at the leaf node at which maxLeafHits is reached. Total number of selected - * items may exceed maxLeafHits, but only by the number of leaves in the cutoff leaf node. - * - * Returns: - * number of R+ chromosome data hits - * */ - - private int getHitRegion(RPChromosomeRegion hitRegion, boolean contained) { - - int hitCount = 0; - - // check if new hit list is needed - // Note: getHitList will reset mLeafItemIndex to 0, the beginning of new hit list - if (leafHitList == null) { //|| mLeafItemIndex >= mLeafHitList.size()){ - hitCount = getHitList(hitRegion, contained); - if (hitCount == 0) - return 0; // no hit data found - } else { - hitCount = leafHitList.size() - leafItemIndex; - if (hitCount == 0) - return 0; // hit list exhausted - } - - // Perform a block read for starting base of selection region - use first leaf hit - dataBlockRead = getDataBlock(leafItemIndex++); - - // try next item - probably intersection issue - // Note: recursive call until a block is valid or hit list exhuasted - if (!dataBlockRead) - hitCount = getHitRegion(hitRegion, contained); - - return hitCount; - } - - /* - * Method finds the R+ chromosome data tree items for the hit region. - * - * Parameters: - * hitRegion - selection region for extracting hit items - * contained - indicates hit items must contained in selection region if true; - * and if false, may intersect selection region - * - * Note: The selection region will be limited to accommodate mMaxLeafHits; which terminates - * selection at the leaf node at which maxLeafHits is reached. Total number of selected - * items may exceed maxLeafHits, but only by the number of leaves in the cutoff leaf node. - * - * Returns: - * number of R+ chromosome data hits - * */ - - private int getHitList(RPChromosomeRegion hitRegion, boolean contained) { - - // hit list for hit region; subject to mMaxLeafHits limitation - leafHitList = zoomDataTree.getChromosomeDataHits(hitRegion, contained); - - // check if any leaf items were selected - int nHits = leafHitList.size(); - if (nHits == 0) - return 0; // no data hits found - else - leafItemIndex = 0; // reset hit item index to start of list - - // find hit bounds - int startChromID = leafHitList.get(0).getChromosomeBounds().getStartChromID(); - int startBase = leafHitList.get(0).getChromosomeBounds().getStartBase(); - int endChromID = leafHitList.get(nHits - 1).getChromosomeBounds().getEndChromID(); - int endBase = leafHitList.get(nHits - 1).getChromosomeBounds().getEndBase(); - - // save hit region definition; not currently used but useful for debug - this.hitRegion = new RPChromosomeRegion(startChromID, startBase, endChromID, endBase); - - return nHits; - } - -/* - * Method sets up a decompressed data block of zoom data records for iteration. - * - * Parameters: - * leafItemIndex - leaf item index in the hit list referencing the data block - * - * Returns: - * Successful Zoom data block set up: true or false. - * */ - - private boolean getDataBlock(int leafItemIndex) { - - // check for valid data block - if (leafHitList == null || leafItemIndex >= leafHitList.size()) - return false; - - // Perform a block read for indexed leaf item - leafHitItem = leafHitList.get(leafItemIndex); - - // get the chromosome names associated with the hit region ID's - int startChromID = leafHitItem.getChromosomeBounds().getStartChromID(); - int endChromID = leafHitItem.getChromosomeBounds().getEndChromID(); - chromosomeMap = chromIDTree.getChromosomeIDMap(startChromID, endChromID); - - boolean isLowToHigh = zoomDataTree.isIsLowToHigh(); - int uncompressBufSize = zoomDataTree.getUncompressBuffSize(); - - // decompress leaf item data block for feature extraction - zoomDataBlock = new ZoomDataBlock(zoomLevel, fis, leafHitItem, chromosomeMap, - isLowToHigh, uncompressBufSize); - - // get data block zoom data record list and set next index to first item - zoomRecordList = zoomDataBlock.getZoomData(selectionRegion, isContained); - zoomRecordIndex = 0; - - // data block items available for iterator - if (zoomRecordList.size() > 0) - return true; - else - return false; - } - - - public static class EmptyIterator extends ZoomLevelIterator { - - static EmptyIterator theInstance = new EmptyIterator(); - - @Override - public boolean hasNext() { - return false; - } - } - -} diff --git a/src/org/broad/igv/data/BasicScore.java b/src/org/broad/igv/data/BasicScore.java deleted file mode 100644 index 9142c03..0000000 --- a/src/org/broad/igv/data/BasicScore.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.data; - -import org.broad.igv.feature.LocusScore; -import org.broad.igv.track.WindowFunction; - -/** - * @author jrobinso - */ -public class BasicScore implements LocusScore { - - String chr; - int start; - int end; - float score; - - public BasicScore(String chromosome, int start, int end, float score) { - this.chr = chromosome; - this.start = start; - this.end = end; - this.score = score; - } - - public BasicScore(BasicScore bs) { - this.chr = bs.chr; - this.start = bs.start; - this.end = bs.end; - this.score = bs.score; - } - - public BasicScore copy() { - return new BasicScore(this); - } - - public String getChromosome() { - return chr; - } - - public String getChr() { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - public int getStart() { - return start; - } - - public float getScore() { - return score; - } - - public void setStart(int start) { - this.start = start; - } - - public int getEnd() { - return end; - } - - public void setEnd(int end) { - this.end = end; - } - - public void setConfidence(float confidence) { - // Ignored - } - - public float getConfidence() { - return 1.0f; - } - - public String getValueString(double position, WindowFunction windowFunction) { - return "Value: " + score; - //throw new UnsupportedOperationException("Not supported yet."); - } - - public int getExtendedStart() { - return getStart(); - } - - public int getExtendedEnd() { - return getEnd(); - } -} diff --git a/src/org/broad/igv/data/DataSource.java b/src/org/broad/igv/data/DataSource.java deleted file mode 100644 index 00e1279..0000000 --- a/src/org/broad/igv/data/DataSource.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package org.broad.igv.data; - -import java.util.Collection; -import java.util.List; - -import org.broad.igv.feature.LocusScore; -import org.broad.igv.track.WindowFunction; - -/** - * @author jrobinso - */ -public interface DataSource { - - double getDataMax(); - - double getDataMin(); - - List getSummaryScoresForRange(String chr, int startLocation, int endLocation, int zoom); - - void setWindowFunction(WindowFunction statType); - - boolean isLogNormalized(); - - void refreshData(long timestamp); - - public WindowFunction getWindowFunction(); - - public Collection getAvailableWindowFunctions(); - -} diff --git a/src/org/broad/igv/feature/LocusScore.java b/src/org/broad/igv/feature/LocusScore.java deleted file mode 100644 index cc825b8..0000000 --- a/src/org/broad/igv/feature/LocusScore.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.feature; - -import org.broad.igv.track.WindowFunction; -import org.broad.tribble.Feature; - -/** - * @author jrobinso - */ -public interface LocusScore extends Feature { - - //public int getStart(); - - // public int getEnd(); - - public void setStart(int start); - - public void setEnd(int end); - - public float getScore(); - - public void setConfidence(float confidence); - - public float getConfidence(); - - public LocusScore copy(); - - /** - * Return a string to be used for popup text. The WindowFunction is passed - * in so it can be used t annotate the value. The LocusScore object itself - * does not "know" from what window function it was derived - * - * @param windowFunction - * @return - */ - public String getValueString(double position, WindowFunction windowFunction); -} diff --git a/src/org/broad/igv/tdf/BufferedByteWriter.java b/src/org/broad/igv/tdf/BufferedByteWriter.java deleted file mode 100644 index 6c74fdc..0000000 --- a/src/org/broad/igv/tdf/BufferedByteWriter.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tdf; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; - -/* - * - */ -public class BufferedByteWriter { - - /** - * Reports the total number of bytes written - */ - - ByteArrayOutputStream buffer; - - - public BufferedByteWriter() { - this(8192); - } - - - public BufferedByteWriter(int size) { - if (size <= 0) { - throw new IllegalArgumentException("Buffer size <= 0"); - } - buffer = new ByteArrayOutputStream(size); - } - - public byte [] getBytes() { - return buffer.toByteArray(); - } - - public int bytesWritten() { - return buffer.size(); - } - - /** - * Writes the specified byte to this buffered output stream. - * - * @param b the byte to be written. - * @throws IOException if an I/O error occurs. - */ - public void put(int b) throws IOException { - buffer.write(b); - } - - public void put(byte b[]) throws IOException { - buffer.write(b); - } - - /** - * Writes len bytes from the specified byte array - * starting at offset off to this buffered output stream. - * - * @param b the data. - * @param off the start offset in the data. - * @param len the number of bytes to write. - * @throws IOException if an I/O error occurs. - */ - public void put(byte b[], int off, int len) throws IOException { - buffer.write(b, off, len); - } - - public void putInt(int v) throws IOException { - buffer.write((v >>> 0) & 0xFF); - buffer.write((v >>> 8) & 0xFF); - buffer.write((v >>> 16) & 0xFF); - buffer.write((v >>> 24) & 0xFF); - } - - public void putFloat(float f) throws IOException { - int v = Float.floatToIntBits(f); - putInt(v); - } - - /** - * Writes a long to the underlying output stream as eight - * bytes, little endian. In no exception is thrown, the counter - * written is incremented by 8. - * - * @param v a long to be written. - * @throws IOException if an I/O error occurs. - * @see java.io.FilterOutputStream#out - */ - public void putLong(long v) throws IOException { - buffer.write((byte) (v >>> 0)); - buffer.write((byte) (v >>> 8)); - buffer.write((byte) (v >>> 16)); - buffer.write((byte) (v >>> 24)); - buffer.write((byte) (v >>> 32)); - buffer.write((byte) (v >>> 40)); - buffer.write((byte) (v >>> 48)); - buffer.write((byte) (v >>> 56)); - } - - public void putNullTerminatedString(String s) throws IOException { - buffer.write(s.getBytes()); - buffer.write((byte) 0); - } - -} diff --git a/src/org/broad/igv/tdf/TDFBedTile.java b/src/org/broad/igv/tdf/TDFBedTile.java deleted file mode 100644 index b73454e..0000000 --- a/src/org/broad/igv/tdf/TDFBedTile.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tdf; - -import java.io.IOException; -import java.nio.ByteBuffer; - -import org.broad.igv.util.StringUtils; - -/** - * @author jrobinso - */ -public class TDFBedTile implements TDFTile { - - int tileStart; - int[] start; - int[] end; - float[][] data; - String[] name; - - public TDFBedTile(ByteBuffer byteBuffer, int nSamples, TDFTile.Type type) throws IOException { - this.fill(byteBuffer, nSamples, type); - } - - public TDFBedTile(int tileStart, int[] start, int[] end, float[][] data) { - this.tileStart = tileStart; - this.start = start; - this.end = end; - this.data = data; - } - - public TDFBedTile(int tileStart, int[] start, int[] end, float[][] data, String[] name) { - this(tileStart, start, end, data); - this.name = name; - } - - public int getSize() { - return start.length; - } - - public int getTileStart() { - return tileStart; - } - - public int getTileEnd() { - return getSize() == 0 ? 0 : getEndPosition(getSize() - 1); - } - - public int getStartPosition(int idx) { - return start[idx]; - } - - public int getEndPosition(int idx) { - return end[idx]; - } - - public String getName(int idx) { - return name == null ? null : name[idx]; - } - - public float getValue(int row, int idx) { - return data[row][idx]; - } - - public void writeTo(BufferedByteWriter fos) throws IOException { - - // File type - TDFTile.Type type = name == null ? TDFTile.Type.bed : TDFTile.Type.bedWithName; - fos.putNullTerminatedString(type.toString()); - - int nPositions = start.length; - int nSamples = data.length; - - - fos.putInt(nPositions); - - for (int i = 0; i < nPositions; i++) { - fos.putInt(start[i]); - } - for (int i = 0; i < nPositions; i++) { - fos.putInt(end[i]); - } - - fos.putInt(nSamples); - for (int i = 0; i < data.length; i++) { - for (int j = 0; j < data[i].length; j++) { - fos.putFloat(data[i][j]); - } - } - - // Optionally record feature names - if (type == TDFTile.Type.bedWithName) { - for (int i = 0; i < nPositions; i++) { - fos.putNullTerminatedString(name[i]); - } - } - - - } - - private void fill(ByteBuffer byteBuffer, int nSamples, TDFTile.Type type) throws IOException { - - int nPositions = byteBuffer.getInt(); - start = new int[nPositions]; - for (int i = 0; i < nPositions; i++) { - start[i] = byteBuffer.getInt(); - } - end = new int[nPositions]; - for (int i = 0; i < nPositions; i++) { - end[i] = byteBuffer.getInt(); - ; - } - - int nS = byteBuffer.getInt(); - ; - assert (nS == nSamples); - - data = new float[nS][nPositions]; - for (int row = 0; row < nS; row++) { - data[row] = new float[nPositions]; - for (int i = 0; i < nPositions; i++) { - data[row][i] = byteBuffer.getFloat(); - } - } - - // Optionally read feature names - if (type == TDFTile.Type.bedWithName) { - name = new String[nPositions]; - for (int i = 0; i < nPositions; i++) { - name[i] = StringUtils.readString(byteBuffer); - } - - } - - } - - /* (non-Javadoc) - * @see org.broad.igv.tdf.TDFTile#noValues() - */ - @Override - public int noValues() { - return data.length; - } -} diff --git a/src/org/broad/igv/tdf/TDFDataset.java b/src/org/broad/igv/tdf/TDFDataset.java deleted file mode 100644 index 1171cbd..0000000 --- a/src/org/broad/igv/tdf/TDFDataset.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tdf; - - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.broad.LRUCache; -import org.broad.igv.util.StringUtils; - - -/** - * Represents the data for a particular chromosome and zoom level - * - * @author jrobinso - */ -public class TDFDataset extends TDFEntity { - - public enum DataType { - - BYTE, SHORT, INT, FLOAT, DOUBLE, STRING - } - - ; - DataType dataType; - int tileWidth; - long[] tilePositions; - int[] tileSizes; - int nTiles; - LRUCache cache = new LRUCache(20); - // TODO -- refactor this dependency out - TDFReader reader; - - public TDFDataset(String name, DataType dataType, int tileWidth, int nTiles) { - super(name); - this.dataType = dataType; - this.tileWidth = tileWidth; - this.nTiles = nTiles; - this.tilePositions = new long[nTiles]; - this.tileSizes = new int[nTiles]; - - // Initialize tile positions to -1. This indicates a blank tile and is the default - Arrays.fill(tilePositions, -1); - - } - - public TDFDataset(String name, ByteBuffer byteBuffer, TDFReader reader) throws IOException { - super(name); - this.reader = reader; - fill(byteBuffer); - } - - public void write(BufferedByteWriter dos) throws IOException { - - writeAttributes(dos); - - writeString(dos, dataType.toString()); - dos.putFloat(tileWidth); - // dos.writeFloat(binWidth); - dos.putInt(tilePositions.length); - for (int i = 0; i < tilePositions.length; i++) { - dos.putLong(tilePositions[i]); - dos.putInt(tileSizes[i]); - } - - } - - private void fill(ByteBuffer byteBuffer) throws IOException { - - // Attributes - readAttributes(byteBuffer); - - String typeString = StringUtils.readString(byteBuffer); - dataType = TDFDataset.DataType.valueOf(typeString); - - // TODO -- change tileWidth to int ? - tileWidth = (int) byteBuffer.getFloat(); - - - nTiles = byteBuffer.getInt(); - tilePositions = new long[nTiles]; - tileSizes = new int[nTiles]; - - for (int i = 0; i < nTiles; i++) { - tilePositions[i] = byteBuffer.getLong(); - tileSizes[i] = byteBuffer.getInt(); - } - - } - - // TODO -- this uses an implied linear index. Abstract index or replace - // with general interval index - // TODO -- gather all non-cached tiles and read in one chunk. See BAM - // alignment reader class - public List getTiles(int startLocation, int endLocation) { - - List tiles = new ArrayList(); - int startTile = (int) (startLocation / tileWidth); - int endTile = (int) (endLocation / tileWidth); - for (int t = startTile; t <= endTile; t++) { - TDFTile tile = getTile(t); - if (tile != null && tile.getSize() > 0) { - tiles.add(tile); - } - } - return tiles; - - } - - // TDFTile computeTile(TDFDataset ds, int t, List scores, String chr) - public synchronized TDFTile getTile(int t) { - String key = getName() + "_" + t; - - TDFTile tile = null; - if (!cache.containsKey(key)) { - tile = reader.readTile(this, t); - cache.put(key, tile); - } else { - tile = cache.get(key); - } - return tile; - } - /** - * @return - */ - public int getNumberOfTiles() { - return nTiles; - } - - /** - * @return - */ - public int getTileWidth() { - return tileWidth; - } - -} diff --git a/src/org/broad/igv/tdf/TDFEntity.java b/src/org/broad/igv/tdf/TDFEntity.java deleted file mode 100644 index f6a6258..0000000 --- a/src/org/broad/igv/tdf/TDFEntity.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tdf; - -import org.broad.igv.util.StringUtils; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -/** - * @author jrobinso - */ -public class TDFEntity { - - Map attributes; - - private String name; - - public TDFEntity(String name) { - this.name = name; - this.attributes = new HashMap(); - } - - public TDFEntity(String name, Map attributes) { - this.name = name; - this.attributes = attributes; - } - - public Set getAttributeNames() { - return attributes.keySet(); - } - - public String getAttribute(String name) { - return attributes.get(name); - } - - public void setAttribute(String name, String value) { - attributes.put(name, value); - } - - void writeAttributes(BufferedByteWriter dos) throws IOException { - dos.putInt(attributes.size()); - for (Map.Entry entry : attributes.entrySet()) { - writeString(dos, entry.getKey()); - writeString(dos, entry.getValue()); - } - } - - void readAttributes(ByteBuffer byteBuffer) throws IOException { - int nAttributes = byteBuffer.getInt(); - while (nAttributes-- > 0) { - String key = StringUtils.readString(byteBuffer); - String value = StringUtils.readString(byteBuffer); - setAttribute(key, value); - } - } - - /** - * Write a string as a null terminated character sequence. - *

- * IGV requires all strings to be ascii, so single byte storaged is enough - * - * @param dos - * @param s - * @throws java.io.IOException - */ - public void writeString(BufferedByteWriter dos, String s) throws IOException { - dos.putNullTerminatedString(s); - } - - /** - * @return the name - */ - public String getName() { - return name; - } -} diff --git a/src/org/broad/igv/tdf/TDFFixedTile.java b/src/org/broad/igv/tdf/TDFFixedTile.java deleted file mode 100644 index e74d1ed..0000000 --- a/src/org/broad/igv/tdf/TDFFixedTile.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tdf; - -import java.io.IOException; -import java.nio.ByteBuffer; - -/** - * @author jrobinso - */ -public class TDFFixedTile implements TDFTile { - /* (non-Javadoc) - * @see org.broad.igv.tdf.TDFTile#noValues() - */ - @Override - public int noValues() { - return data.length; - } - int tileStart; - float span; - int start; - float[][] data; - - public TDFFixedTile(ByteBuffer byteBuffer, int nSamples) throws IOException { - this.fill(byteBuffer, nSamples); - } - - public TDFFixedTile(int tileStart, int start, float span, float[][] data) { - this.tileStart = tileStart; - this.span = span; - this.data = data; - this.start = start; - } - - public int getTileStart() { - return start; - } - - public int getTileEnd() { - return getSize() == 0 ? 0 : getEndPosition(getSize() - 1); - } - - public int getStartPosition(int idx) { - return start + (int) (idx * span); - } - - public int getEndPosition(int idx) { - return start + (int) ((idx + 1) * span); - } - - public String getName(int idx) { - return null; //To change body of implemented methods use File | Settings | File Templates. - } - - public float getValue(int row, int idx) { - return data[row][idx]; - } - - public int getSize() { - return (data == null ? 0 : data[0].length); - } - - - // TODO -- record "type", extent (longest feature), other stuff - - public void writeTo(BufferedByteWriter fos) throws IOException { - - fos.putNullTerminatedString(TDFTile.Type.fixedStep.toString()); - fos.putInt(getSize()); - fos.putInt(start); - fos.putFloat(span); - for (int i = 0; i < data.length; i++) { - for (int j = 0; j < data[i].length; j++) { - fos.putFloat(data[i][j]); - } - } - - } - - public void fill(ByteBuffer byteBuffer, int nSamples) throws IOException { - - int nPositions = byteBuffer.getInt(); - start = byteBuffer.getInt(); - span = byteBuffer.getFloat(); - - data = new float[nSamples][nPositions]; - for (int sample = 0; sample < nSamples; sample++) { - data[sample] = new float[nPositions]; - for (int i = 0; i < nPositions; i++) { - data[sample][i] = byteBuffer.getFloat(); - } - } - - } -} diff --git a/src/org/broad/igv/tdf/TDFGroup.java b/src/org/broad/igv/tdf/TDFGroup.java deleted file mode 100644 index 4349a42..0000000 --- a/src/org/broad/igv/tdf/TDFGroup.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tdf; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.Map; - -/** - * @author jrobinso - */ -public class TDFGroup extends TDFEntity { - - public static final String USE_PERCENTILE_AUTOSCALING = "userPercentileAutoscaling"; - - - TDFGroup(String name) { - super(name); - } - - TDFGroup(String name, Map attributes) { - super(name, attributes); - } - - public TDFGroup(String name, ByteBuffer byteBuffer) throws IOException { - super(name); - fill(byteBuffer); - } - - void write(BufferedByteWriter dos) throws IOException { - - writeAttributes(dos); - } - - void fill(ByteBuffer byteBuffer) throws IOException { - readAttributes(byteBuffer); - } -} diff --git a/src/org/broad/igv/tdf/TDFReader.java b/src/org/broad/igv/tdf/TDFReader.java deleted file mode 100644 index 263e7a2..0000000 --- a/src/org/broad/igv/tdf/TDFReader.java +++ /dev/null @@ -1,463 +0,0 @@ -/* - * Copyright (c) 2007-2011 by The Broad Institute of MIT and Harvard. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -package org.broad.igv.tdf; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.zip.DataFormatException; - -import net.sf.samtools.seekablestream.SeekableStream; - -import org.broad.LRUCache; -import org.broad.igv.track.WindowFunction; -import org.broad.igv.util.CompressionUtils; -import org.broad.igv.util.StringUtils; - -/** - * @author jrobinso - * @author Thomas Abeel - */ -public class TDFReader { - - static final Logger log = Logger.getLogger(TDFReader.class.getCanonicalName()); - public static final int GZIP_FLAG = 0x1; - - // Cache to insure there is only 1 reader per file - static Map readerCache = new HashMap(); - - private SeekableStream seekableStream = null; - private int version; - private int maxZoom = -1; - private Map datasetIndex; - private Map groupIndex; - private String trackType; - private String trackLine; - private String[] trackNames; - private LRUCache groupCache = new LRUCache(20); - private LRUCache datasetCache = new LRUCache(20); - - private Map valueCache = new HashMap(); - private List windowFunctions; - private String locator; - - boolean compressed = false; - - // private String path; - - public static TDFReader getReader(SeekableStream locator) throws URISyntaxException { - - TDFReader reader = readerCache.get(locator.getSource()); - if (reader == null) { - reader = new TDFReader(locator); - readerCache.put(locator.getSource(), reader); - } - return reader; - } - - private TDFReader(SeekableStream locator) throws URISyntaxException { - this.seekableStream = locator; - this.locator = locator.getSource(); - try { - readHeader(); - - } catch (IOException ex) { - log.log(Level.SEVERE, "Error loading file: " + locator, ex); - throw new RuntimeException("Error loading file: " + ex.toString() + locator); - } - } - - public void close() { - try { - seekableStream.close(); - readerCache.remove(locator); - datasetCache.clear(); - datasetCache = null; - groupCache.clear(); - groupCache = null; - valueCache.clear(); - valueCache = null; - } catch (IOException e) { - log.log(Level.SEVERE, "Error closing reader for: " + locator, e); - } - } - - // public String getPath() { - // return locator.getPath(); - // } - - private void readHeader() throws IOException { - - // Buffer for the magic number, version, index position, and index - // byte count + header byte count (4 + 4 + 8 + 4 + 4) - // byte[] buffer = new byte[24]; - // readFully(buffer); - byte[] buffer = readBytes(0, 24); - ByteBuffer byteBuffer = ByteBuffer.wrap(buffer); - byteBuffer.order(ByteOrder.LITTLE_ENDIAN); - - int magicNumber = byteBuffer.getInt(); - - byte[] magicBytes = new byte[4]; - System.arraycopy(buffer, 0, magicBytes, 0, 4); - String magicString = new String(magicBytes); - - if (!(magicString.startsWith("TDF") || !magicString.startsWith("IBF"))) { - String msg = "Error reading header: bad magic number."; - // throw new DataLoadException(msg, locator.getPath()); - } - - version = byteBuffer.getInt(); - long idxPosition = byteBuffer.getLong(); - log.info("TDF-Reading master: " + idxPosition); - int idxByteCount = byteBuffer.getInt(); - int nHeaderBytes = byteBuffer.getInt(); - - byte[] bytes = readBytes(24, nHeaderBytes); - byteBuffer = ByteBuffer.wrap(bytes); - byteBuffer.order(ByteOrder.LITTLE_ENDIAN); - - if (version >= 2) { - int nWFs = byteBuffer.getInt(); - this.windowFunctions = new ArrayList(nWFs); - for (int i = 0; i < nWFs; i++) { - String wfName = StringUtils.readString(byteBuffer); - try { - windowFunctions.add(WindowFunction.valueOf(wfName)); - } catch (Exception e) { - log.log(Level.SEVERE, "Error creating window function: " + wfName, e); - } - } - } else { - windowFunctions = Arrays.asList(WindowFunction.mean); - } - - // Track type - try { - // trackType = TrackType.valueOf(); - trackType = StringUtils.readString(byteBuffer); - log.info("TDF TRACK TYPE: " + trackType); - - } catch (Exception e) { - // trackType = TrackType.OTHER; - log.info("TDF TRACK TYPE: no clue"); - } - - // Track line - trackLine = StringUtils.readString(byteBuffer).trim(); - - int nTracks = byteBuffer.getInt(); - trackNames = new String[nTracks]; - for (int i = 0; i < nTracks; i++) { - trackNames[i] = StringUtils.readString(byteBuffer); - } - - // Flags - if (version > 2) { - String genomeId = StringUtils.readString(byteBuffer); - int flags = byteBuffer.getInt(); - compressed = (flags & GZIP_FLAG) != 0; - } else { - compressed = false; - } - - readMasterIndex(idxPosition, idxByteCount); - - } - - private void readMasterIndex(long idxPosition, int nBytes) throws IOException { - - // fis.seek(idxPosition); - // byte[] bytes = new byte[nBytes]; - // readFully(bytes); - byte[] bytes = readBytes(idxPosition, nBytes); - ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); - byteBuffer.order(ByteOrder.LITTLE_ENDIAN); - - int nDatasets = byteBuffer.getInt(); - - datasetIndex = new LinkedHashMap(nDatasets); - for (int i = 0; i < nDatasets; i++) { - String name = StringUtils.readString(byteBuffer); - String[] arr = name.split("/"); - if (arr[2].charAt(0) == 'z') { - int cZoom = Integer.parseInt(arr[2].substring(1)); - if (cZoom > maxZoom) - maxZoom = cZoom; - } - long fPosition = byteBuffer.getLong(); - int n = byteBuffer.getInt(); - datasetIndex.put(name, new IndexEntry(fPosition, n)); - } - - int nGroups = byteBuffer.getInt(); - groupIndex = new LinkedHashMap(nGroups); - for (int i = 0; i < nGroups; i++) { - String name = StringUtils.readString(byteBuffer); - long fPosition = byteBuffer.getLong(); - int n = byteBuffer.getInt(); - groupIndex.put(name, new IndexEntry(fPosition, n)); - } - } - - public TDFDataset getDataset(String chr, int zoom, WindowFunction windowFunction) { - if (windowFunction == null) - windowFunction = WindowFunction.mean; - // Version 1 only had mean - String wf = getVersion() < 2 ? "" : "/" + windowFunction.toString(); - - String dsName = null; - if (zoom >= 0) - dsName = "/" + chr + "/z" + zoom + wf; - else - dsName = "/" + chr + "/raw"; - - log.finest("TDF-DSQUERY: " + dsName); - TDFDataset ds = getDataset(dsName); - - return ds; - } - - public synchronized TDFDataset getDataset(String name) { - - if (datasetCache.containsKey(name)) { - return datasetCache.get(name); - } - - try { - if (datasetIndex.containsKey(name)) { - IndexEntry ie = datasetIndex.get(name); - long position = ie.position; - int nBytes = ie.nBytes; - - // fis.seek(position); - // byte[] buffer = new byte[nBytes]; - // readFully(buffer); - byte[] buffer = readBytes(position, nBytes); - ByteBuffer byteBuffer = ByteBuffer.wrap(buffer); - byteBuffer.order(ByteOrder.LITTLE_ENDIAN); - - TDFDataset ds = new TDFDataset(name, byteBuffer, this); - datasetCache.put(name, ds); - return ds; - } else { - return null; - } - - } catch (IOException ex) { - log.log(Level.SEVERE, "Error reading dataset: " + name, ex); - throw new RuntimeException("System error occured while reading dataset: " + name); - } - } - - public Collection getDatasetNames() { - return datasetIndex.keySet(); - } - - public Collection getGroupNames() { - return groupIndex.keySet(); - } - - public synchronized TDFGroup getGroup(String name) { - if (groupCache.containsKey(name)) { - return groupCache.get(name); - } - - try { - IndexEntry ie = groupIndex.get(name); - long position = ie.position; - int nBytes = ie.nBytes; - - // fis.seek(position); - // byte[] buffer = new byte[nBytes]; - // readFully(buffer); - byte[] buffer = readBytes(position, nBytes); - ByteBuffer byteBuffer = ByteBuffer.wrap(buffer); - byteBuffer.order(ByteOrder.LITTLE_ENDIAN); - - TDFGroup group = new TDFGroup(name, byteBuffer); - - groupCache.put(name, group); - - return group; - - } catch (IOException ex) { - log.log(Level.SEVERE, "Error reading group: " + name, ex); - throw new RuntimeException("System error occured while reading group: " + name); - } - } - - // TODO -- move to dataset class - - public synchronized TDFTile readTile(TDFDataset ds, int tileNumber) { - - try { - if (tileNumber >= ds.tilePositions.length) { - // TODO - return empty tile - return null; - } - - long position = ds.tilePositions[tileNumber]; - if (position < 0) { - - // Indicates empty tile - // TODO -- return an empty tile? - return null; - } - - int nBytes = ds.tileSizes[tileNumber]; - // fis.seek(position); - // byte[] buffer = new byte[nBytes]; - // readFully(buffer); - byte[] buffer = readBytes(position, nBytes); - if (compressed) { - buffer = CompressionUtils.decompress(buffer); - - } - - return TileFactory.createTile(buffer, trackNames.length); - } catch (Exception ex) { - String tileName = ds.getName() + "[" + tileNumber + "]"; - log.log(Level.SEVERE, "Error reading data tile: " + tileName, ex); - throw new RuntimeException("System error occured while reading tile: " + tileName); - } - } - - /** - * @return the version - */ - public int getVersion() { - return version; - } - - /** - * @return the trackType - */ - public String getTrackType() { - return trackType; - } - - /** - * @return the trackLine - */ - public String getTrackLine() { - return trackLine; - } - - /** - * @return the trackNames - */ - public String[] getTrackNames() { - return trackNames; - } - - private Double getValue(WindowFunction wf) { - if (!valueCache.containsKey(wf)) { - TDFGroup rootGroup = getGroup("/"); - String maxString = rootGroup.getAttribute(wf.getDisplayName()); - try { - valueCache.put(wf, Double.parseDouble(maxString)); - } catch (Exception e) { - log.info("Warning: value '" + wf.toString() + "' not found in tdf value " + locator); - valueCache.put(wf, null); - } - } - return valueCache.get(wf); - } - - /** - * Return the default upper value for the data range. A check is made to see - * if both upper and lower limits are equal to zero, within a tolerance. If - * they are the upper limit is arbitrarily set to "100". This is protection - * against the pathological case that can occur with datasets consisting of - * largely zero values. - * - * @return - */ - public double getUpperLimit() { - Double val = getValue(WindowFunction.percentile98); - double upperLimit = val == null ? getDataMax() : val; - if (upperLimit < 1.0e-30 && getLowerLimit() < 1.0e-30) { - upperLimit = 100; - } - return upperLimit; - } - - public double getLowerLimit() { - Double val = getValue(WindowFunction.percentile2); - return val == null ? getDataMin() : val; - } - - public double getDataMax() { - Double val = getValue(WindowFunction.max); - return val == null ? 100 : val; - } - - public double getDataMin() { - Double val = getValue(WindowFunction.min); - return val == null ? 0 : val; - } - - public byte[] readBytes(long position, int nBytes) throws IOException { - // System.out.println("Seeking: " + position); - seekableStream.seek(position); - byte[] buffer = new byte[nBytes]; - seekableStream.read(buffer, 0, nBytes); - return buffer; - } - - /** - * @return the windowFunctions - */ - public List getWindowFunctions() { - return windowFunctions; - } - - class IndexEntry { - - long position; - int nBytes; - - public IndexEntry(long position, int nBytes) { - this.position = position; - this.nBytes = nBytes; - } - } - - /** - * @return - */ - public String getLocator() { - return locator; - } - - public int getMaxZoom() { - return maxZoom; - } -} diff --git a/src/org/broad/igv/tdf/TDFTile.java b/src/org/broad/igv/tdf/TDFTile.java deleted file mode 100644 index b154aee..0000000 --- a/src/org/broad/igv/tdf/TDFTile.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package org.broad.igv.tdf; - -import java.io.IOException; - -/** - * @author jrobinso - * @author Thomas Abeel - */ -public interface TDFTile { - - enum Type { - fixedStep, variableStep, bed, bedWithName - } - - ; - - public int getTileStart(); - - public int getSize(); - - public int getStartPosition(int idx); - - public int getEndPosition(int idx); - - public String getName(int idx); - - public float getValue(int row, int idx); - - public void writeTo(BufferedByteWriter fos) throws IOException; - - /** - * Returns the number of values that are available for each position in - * this Tile. - * - * @param i - * @return - */ - public int noValues(); - -} diff --git a/src/org/broad/igv/tdf/TDFUtils.java b/src/org/broad/igv/tdf/TDFUtils.java deleted file mode 100644 index d9d5d41..0000000 --- a/src/org/broad/igv/tdf/TDFUtils.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tdf; - -import java.io.File; -import java.io.FileNotFoundException; -import java.net.URISyntaxException; -import java.util.Map; - - - -import net.sf.samtools.seekablestream.SeekableFileStream; - -import org.broad.igv.track.WindowFunction; - -/** - * @author jrobinso - */ -public class TDFUtils { - - public static void dumpRootAttributes(String ibfFile) throws URISyntaxException, FileNotFoundException { - TDFReader reader = TDFReader.getReader(new SeekableFileStream(new File(ibfFile))); - System.out.println("Track line = " + reader.getTrackLine()); - TDFGroup group = reader.getGroup("/"); - for (Map.Entry entries : group.attributes.entrySet()) { - System.out.println(entries.getKey() + " = " + entries.getValue()); - } - - System.out.println(reader.getTrackLine()); - } - - public static void dumpDatasets(String ibfFile) throws URISyntaxException, FileNotFoundException { - TDFReader reader = TDFReader.getReader(new SeekableFileStream(new File(ibfFile))); - System.out.println("DATASETS"); - for (String dsName : reader.getDatasetNames()) { - System.out.println(dsName); - TDFDataset ds = reader.getDataset(dsName); - - System.out.println("Attributes"); - for (Map.Entry entry : ds.attributes.entrySet()) { - System.out.println("\t" + entry.getKey() + " = " + entry.getValue()); - } - System.out.println(); - - System.out.println("Tile Positions"); - for (int i = 0; i < ds.nTiles; i++) { - System.out.print("\t" + ds.tilePositions[i]); - } - System.out.println(); - - } - } - - public static void dumpAllTiles(String ibfFile) throws URISyntaxException, FileNotFoundException { - TDFReader reader = TDFReader.getReader(new SeekableFileStream(new File(ibfFile))); - System.out.println("DATASETS"); - for (String dsName : reader.getDatasetNames()) { - System.out.println(dsName); - TDFDataset ds = reader.getDataset(dsName); - - for (int i = 0; i < ds.nTiles; i++) { - TDFTile tile = ds.getTile(i); - if (tile != null) { - System.out.println("Tile: " + i); - dumpTileData(reader, tile); - } - } - } - } - - public static void dumpTile(String ibfFile, String dsName, int tileNumber) throws URISyntaxException, FileNotFoundException { - - TDFReader reader = TDFReader.getReader(new SeekableFileStream(new File(ibfFile))); - TDFDataset ds = reader.getDataset(dsName); - TDFTile tile = reader.readTile(ds, tileNumber); - if (tile == null) { - System.out.println("Null tile: " + dsName + " [" + tileNumber + "]"); - } else { - dumpTileData(reader, tile); - } - } - - private static void dumpTileData(TDFReader reader, TDFTile tile) { - int nTracks = reader.getTrackNames().length; - int nBins = tile.getSize(); - if (nBins > 0) { - for (int b = 0; b < nBins; b++) { - System.out.print(tile.getStartPosition(b)); - System.out.print("\t" + tile.getEndPosition(b)); - System.out.print("\t" + tile.getName(b)); - for (int t = 0; t < nTracks; t++) { - System.out.print("\t" + tile.getValue(t, b)); - } - System.out.println(); - } - } - } - - public static void dumpRange(String ibfFile, String dsName, int startLocation, int endLocation) - throws URISyntaxException, FileNotFoundException { - TDFReader reader = TDFReader.getReader(new SeekableFileStream(new File(ibfFile))); - TDFDataset ds = reader.getDataset(dsName); - - int tileWidth = ds.tileWidth; - int startTile = startLocation / tileWidth; - int endTile = endLocation / tileWidth; - - for (int tileNumber = startTile; tileNumber <= endTile; tileNumber++) { - TDFTile tile = reader.readTile(ds, tileNumber); - if (tile == null) { - System.out.println("Null tile: " + dsName + " [" + tileNumber + "]"); - } else { - int nTracks = reader.getTrackNames().length; - int nBins = tile.getSize(); - if (nBins > 0) { - for (int b = 0; b < nBins; b++) { - int start = tile.getStartPosition(b); - int end = tile.getEndPosition(b); - if (start > endLocation) { - break; - } - if (end >= startLocation) { - System.out.print(tile.getStartPosition(b)); - for (int t = 0; t < nTracks; t++) { - System.out.print("\t" + tile.getValue(t, b)); - } - System.out.println(); - } - } - } - } - - } - } - - /* - * magic number (4 bytes) version index position index size (bytes) # of - * window functions [window functions] track type (string) track line - * (string) # of tracks [track names] - */ - public static void dumpSummary(String ibfFile) throws URISyntaxException, FileNotFoundException { - - TDFReader reader = TDFReader.getReader(new SeekableFileStream(new File(ibfFile))); - - System.out.println("Version: " + reader.getVersion()); - System.out.println("Window Functions"); - for (WindowFunction wf : reader.getWindowFunctions()) { - System.out.println("\t" + wf.toString()); - } - - System.out.println("Tracks"); - String[] trackNames = reader.getTrackNames(); - for (String trackName : trackNames) { - System.out.println(trackName); - } - System.out.println(); - - System.out.println("DATASETS"); - for (String dsName : reader.getDatasetNames()) { - System.out.println(dsName); - TDFDataset ds = reader.getDataset(dsName); - - System.out.println("Attributes"); - for (Map.Entry entry : ds.attributes.entrySet()) { - System.out.println("\t" + entry.getKey() + " = " + entry.getValue()); - } - System.out.println(); - - System.out.println("Tiles"); - - int nTracks = trackNames.length; - int tracksToShow = Math.min(4, nTracks); - - for (int i = 0; i < ds.nTiles; i++) { - TDFTile tile = reader.readTile(ds, i); - if (tile != null) { - System.out.print(" " + i); - /* - * int nBins = tile.getSize(); int binsToShow = Math.min(4, - * nBins); for (int b = 0; b < binsToShow; b++) { - * System.out.print(tile.getStartPosition(b)); for (int t = - * 0; t < tracksToShow; t++) { float value = - * tile.getValue(0, b); if (!Float.isNaN(value)) { - * System.out.print("\t" + tile.getValue(t, b)); } } - * System.out.println(); } - */ - } - } - System.out.println(); - System.out.println(); - } - - System.out.println("GROUPS"); - for (String name : reader.getGroupNames()) { - System.out.println(name); - TDFGroup group = reader.getGroup(name); - - System.out.println("Attributes"); - for (Map.Entry entry : group.attributes.entrySet()) { - System.out.println("\t" + entry.getKey() + " = " + entry.getValue()); - } - System.out.println(); - - } - } - - /* - * chr1:241356465-241356657 chr1:241358198-241358223 - * chr1:241359291-241359329 - * - * chr4:119691730-119691768 chr4:119692843-119692868 - * chr4:119694419-119694611 - */ -} diff --git a/src/org/broad/igv/tdf/TDFVaryTile.java b/src/org/broad/igv/tdf/TDFVaryTile.java deleted file mode 100644 index 2012fc7..0000000 --- a/src/org/broad/igv/tdf/TDFVaryTile.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tdf; - -import java.io.IOException; -import java.nio.ByteBuffer; - -/** - * @author jrobinso - */ -public class TDFVaryTile implements TDFTile { - /* (non-Javadoc) - * @see org.broad.igv.tdf.TDFTile#noValues() - */ - @Override - public int noValues() { - return data.length; - } - int tileStart; - float span; - int[] start; - float[][] data; - - public TDFVaryTile(ByteBuffer byteBuffer, int nSamples) throws IOException { - this.fill(byteBuffer, nSamples); - } - - public TDFVaryTile(int tileStart, float span, int[] start, float[][] data) { - this.tileStart = tileStart; - this.span = span; - this.start = start; - this.data = data; - } - - - public int getSize() { - return start.length; - } - - public int getTileStart() { - return tileStart; - } - - public int getStartPosition(int idx) { - return start[idx]; - } - - public int getEndPosition(int idx) { - return (int) (start[idx] + span); - } - - public String getName(int idx) { - return null; - } - - public float getValue(int row, int idx) { - return data[row][idx]; - } - - public void writeTo(BufferedByteWriter fos) throws IOException { - - // File type - fos.putNullTerminatedString(TDFTile.Type.variableStep.toString()); - - fos.putInt(tileStart); - fos.putFloat(span); - - int nPositions = start.length; - int nSamples = data.length; - - fos.putInt(nPositions); - - for (int i = 0; i < nPositions; i++) { - fos.putInt(start[i]); - } - - fos.putInt(nSamples); - for (int i = 0; i < data.length; i++) { - for (int j = 0; j < data[i].length; j++) { - fos.putFloat(data[i][j]); - } - } - } - - public void fill(ByteBuffer byteBuffer, int nSamples) throws IOException { - - tileStart = byteBuffer.getInt(); - span = byteBuffer.getFloat(); - - int nPositions = byteBuffer.getInt(); - start = new int[nPositions]; - for (int i = 0; i < nPositions; i++) { - start[i] = byteBuffer.getInt(); - } - - int nS = byteBuffer.getInt(); - assert (nS == nSamples); - - data = new float[nS][nPositions]; - for (int row = 0; row < nS; row++) { - data[row] = new float[nPositions]; - for (int i = 0; i < nPositions; i++) { - data[row][i] = byteBuffer.getFloat(); - } - } - - } - -} diff --git a/src/org/broad/igv/tdf/TDFWriter.java b/src/org/broad/igv/tdf/TDFWriter.java deleted file mode 100644 index 76e6b32..0000000 --- a/src/org/broad/igv/tdf/TDFWriter.java +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tdf; - -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.RandomAccessFile; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.broad.igv.tdf.TDFWriter.IndexEntry; -import org.broad.igv.track.WindowFunction; -import org.broad.igv.util.CompressionUtils; - -/** - * Assumptions - *

- * Little endian is used throughout Strings are null terminated ascii (single - * byte - * - * @author Thomas Abeel - * @author jrobinso - */ -public class TDFWriter { - - static private Logger log = Logger.getLogger(TDFWriter.class.getCanonicalName()); - static private int version = 3; - private OutputStream fos = null; - private long bytesWritten = 0; - - private File file; - private Map groupCache = new LinkedHashMap(); - private Map datasetCache = new LinkedHashMap(); - private Map datasetIndex = new LinkedHashMap(); - private Map groupIndex = new LinkedHashMap(); - private long indexPositionPosition; - private boolean compressed; - - public TDFWriter(File f, String genomeId, String trackType, String trackLine, String[] trackNames, - Collection windowFunctions, boolean compressed) { - - if (f.getName().endsWith(".tdf")) { - this.file = f; - } else { - this.file = new File(f.getAbsolutePath() + ".tdf"); - } - this.compressed = compressed; - - try { - fos = new BufferedOutputStream(new FileOutputStream(file)); - writeHeader(genomeId, trackType, trackLine, trackNames, windowFunctions); - - TDFGroup rootGroup = new TDFGroup("/"); - groupCache.put(rootGroup.getName(), rootGroup); - - } catch (IOException ex) { - // log.error("Error creating file: " + file.getAbsolutePath(), ex); - throw new RuntimeException("Error creating file" + file.getAbsolutePath()); - } - - } - - // public TDFWriter(File f, String genomeId, - // - // String trackLine, String[] trackNames, Collection - // windowFunctions, boolean compressed) { - // - // if (f.getName().endsWith(".tdf")) { - // this.file = f; - // } else { - // this.file = new File(f.getAbsolutePath() + ".tdf"); - // } - // this.compressed = compressed; - // - // try { - // fos = new BufferedOutputStream(new FileOutputStream(file)); - // writeHeader(genomeId, trackLine, trackNames, windowFunctions); - // - // TDFGroup rootGroup = new TDFGroup("/"); - // groupCache.put(rootGroup.getName(), rootGroup); - // - // } catch (IOException ex) { - // log.log(Level.SEVERE,"Error creating file: " + file.getAbsolutePath(), - // ex); - // throw new RuntimeException("Error creating file" + - // file.getAbsolutePath()); - // } - // - // } - - private void writeHeader(String genomeId, String trackType, String trackLine, String[] trackNames, - Collection windowFunctions) throws IOException { - - // Magic number -- 4 bytes - byte[] magicNumber = new byte[] { 'T', 'D', 'F', '3' }; - - BufferedByteWriter buffer = new BufferedByteWriter(24); - buffer.put(magicNumber); - buffer.putInt(version); - // Reserve space for the master index pointer and byte count. - // The actual values will be written at the end - indexPositionPosition = buffer.bytesWritten(); - buffer.putLong(0l); - buffer.putInt(0); - write(buffer.getBytes()); - - buffer = new BufferedByteWriter(24); - // Window function definition - buffer.putInt(windowFunctions.size()); - - for (WindowFunction wf : windowFunctions) { - buffer.putNullTerminatedString(wf.toString()); - } - - // Track type - buffer.putNullTerminatedString(trackType.toString()); - - // Reserved space for the track line - byte[] trackLineBuffer = bufferString(trackLine, 1024); - buffer.put(trackLineBuffer); - - // Track names - buffer.putInt(trackNames.length); - for (String nm : trackNames) { - buffer.putNullTerminatedString(nm); - } - - // Fields below added in version 3 - // Genome id - buffer.putNullTerminatedString(genomeId); - - // Flags - int flags = 0; - if (compressed) { - flags |= TDFReader.GZIP_FLAG; - } else { - flags &= ~TDFReader.GZIP_FLAG; - } - buffer.putInt(flags); - - byte[] bytes = buffer.getBytes(); - - writeInt(bytes.length); - write(buffer.getBytes()); - } - - /** - * Write out the group and dataset index and close the underlying file. - */ - public void closeFile() { - - try { - writeDatasets(); - writeGroups(); - - long indexPosition = bytesWritten; - writeIndex(); - int nbytes = (int) (bytesWritten - indexPosition); - - fos.close(); - - writeIndexPosition(indexPosition, nbytes); - - } catch (IOException ex) { - log.log(Level.SEVERE, "Error closing file"); - } - } - - private void writeIndexPosition(long indexPosition, int nbytes) { - try { - RandomAccessFile raf = new RandomAccessFile(file, "rw"); - raf.getChannel().position(indexPositionPosition); - - System.out.println("Index position position: "+indexPositionPosition); - System.out.println("Index position: "+indexPosition); - System.out.println("nBytes: "+nbytes); - // Write as little endian - BufferedByteWriter buffer = new BufferedByteWriter(); - buffer.putLong(indexPosition); - buffer.putInt(nbytes); - raf.write(buffer.getBytes()); - raf.close(); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - - public TDFGroup getGroup(String name) { - return groupCache.get(name); - } - - public TDFGroup getRootGroup() { - if (!groupCache.containsKey("/")) { - groupCache.put("/", new TDFGroup("/")); - } - return groupCache.get("/"); - } - - public TDFGroup createGroup(String name) { - if (groupCache.containsKey(name)) { - throw new RuntimeException("Group: " + name + " already exists"); - } - TDFGroup group = new TDFGroup(name); - groupCache.put(name, group); - return group; - } - - public TDFDataset createDataset(String name, TDFDataset.DataType dataType, int tileWidth, int nTiles) { - - if (datasetCache.containsKey(name)) { - throw new RuntimeException("Dataset: " + name + " already exists"); - } - - TDFDataset ds = new TDFDataset(name, dataType, tileWidth, nTiles); - datasetCache.put(name, ds); - return ds; - } - - // Note this will only work for "fixed step" format. Others need location - // arrays - // Tile layout - - public void writeTile(String dsId, int tileNumber, TDFTile tile) throws IOException { - - TDFDataset dataset = datasetCache.get(dsId); - if (dataset == null) { - throw new java.lang.NoSuchFieldError("Dataset: " + dsId + " doese not exist. " - + "Call createDataset first"); - } - long pos = bytesWritten; - - if (tileNumber < dataset.tilePositions.length) { - dataset.tilePositions[tileNumber] = pos; - - // Write the tile contents to a byte buffer first, so we can - // optionally gzip it - - BufferedByteWriter buffer = new BufferedByteWriter(); - tile.writeTo(buffer); - - byte[] bytes = buffer.getBytes(); - if (compressed) { - bytes = CompressionUtils.compress(bytes); - } - - write(bytes); - int nBytes = bytes.length; - - // tile.writeTo(fos); - // int nBytes = (int) (fos.bytesWritten() - pos); // bytes.length; - - dataset.tileSizes[tileNumber] = nBytes; - } else { - // The occasional tile number == tile array size is expected, but - // tile - // numbers larger than that are not - if (tileNumber > dataset.tilePositions.length) { - System.out.println("Unexpected tile number: " + tileNumber + " (max of " + dataset.tilePositions.length - + " expected)."); - } - - } - - } - - private void writeGroups() throws IOException { - for (TDFGroup group : groupCache.values()) { - long position = bytesWritten; - - BufferedByteWriter buffer = new BufferedByteWriter(); - group.write(buffer); - write(buffer.getBytes()); - - int nBytes = (int) (bytesWritten - position); - groupIndex.put(group.getName(), new IndexEntry(position, nBytes)); - } - } - - private void writeDatasets() throws IOException { - for (TDFDataset dataset : datasetCache.values()) { - long position = bytesWritten; - - BufferedByteWriter buffer = new BufferedByteWriter(); - dataset.write(buffer); - write(buffer.getBytes()); - - int nBytes = (int) (bytesWritten - position); - datasetIndex.put(dataset.getName(), new IndexEntry(position, nBytes)); - - } - } - - private void writeIndex() throws IOException { - - BufferedByteWriter buffer = new BufferedByteWriter(); - - // Now write out dataset index - buffer.putInt(datasetIndex.size()); - for (Map.Entry entry : datasetIndex.entrySet()) { - buffer.putNullTerminatedString(entry.getKey()); - buffer.putLong(entry.getValue().position); - buffer.putInt(entry.getValue().nBytes); - } - - // group index - System.out.println("Group idx: " + groupIndex.size()); - buffer.putInt(groupIndex.size()); - for (Map.Entry entry : groupIndex.entrySet()) { - buffer.putNullTerminatedString(entry.getKey()); - buffer.putLong(entry.getValue().position); - buffer.putInt(entry.getValue().nBytes); - } - - byte[] bytes = buffer.getBytes(); - - write(bytes); - } - - private byte[] bufferString(String str, int bufferSize) throws IOException { - byte[] buffer = new byte[bufferSize]; - Arrays.fill(buffer, (byte) ' '); - buffer[bufferSize - 1] = 0; - if (str != null) { - int len = Math.min(bufferSize, str.length()); - System.arraycopy(str.getBytes(), 0, buffer, 0, len); - } - return buffer; - - } - - private void writeInt(int v) throws IOException { - fos.write((v >>> 0) & 0xFF); - fos.write((v >>> 8) & 0xFF); - fos.write((v >>> 16) & 0xFF); - fos.write((v >>> 24) & 0xFF); - bytesWritten += 4; - } - - private void write(byte[] bytes) throws IOException { - fos.write(bytes); - bytesWritten += bytes.length; - } - - class IndexEntry { - - long position; - int nBytes; - - public IndexEntry(long position, int nBytes) { - this.position = position; - this.nBytes = nBytes; - } - } -} diff --git a/src/org/broad/igv/tdf/TileFactory.java b/src/org/broad/igv/tdf/TileFactory.java deleted file mode 100644 index 3e77dd4..0000000 --- a/src/org/broad/igv/tdf/TileFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tdf; - - -import org.broad.igv.util.StringUtils; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * @author jrobinso - */ -public class TileFactory { - - public static TDFTile createTile(byte[] buffer, int nSamples) throws IOException { - - ByteBuffer byteBuffer = ByteBuffer.wrap(buffer); - byteBuffer.order(ByteOrder.LITTLE_ENDIAN); - - String typeString = StringUtils.readString(byteBuffer); - TDFTile.Type type = TDFTile.Type.valueOf(typeString); - - switch (type) { - case fixedStep: - return new TDFFixedTile(byteBuffer, nSamples); - case variableStep: - return new TDFVaryTile(byteBuffer, nSamples); - case bed: - case bedWithName: - return new TDFBedTile(byteBuffer, nSamples, type); - default: - throw new RuntimeException("Unknown tile type: " + type.toString()); - } - } - - -} diff --git a/src/org/broad/igv/tdf/TileManager.java b/src/org/broad/igv/tdf/TileManager.java deleted file mode 100644 index 626a01f..0000000 --- a/src/org/broad/igv/tdf/TileManager.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tdf; - -import org.broad.igv.track.WindowFunction; - -import java.util.List; - -/** - * @author jrobinso - */ -public class TileManager { - - TDFReader reader; - - public TileManager(TDFReader reader) { - this.reader = reader; - } - - public List getTiles(String chr, int start, int end, int zoom) { - - TDFDataset ds = reader.getDataset(chr, zoom, WindowFunction.mean); - if (ds != null) { - return ds.getTiles(start, end); - } - return null; - } - - /* - private TDFTile computeTile(String chr, int start, int end, int zoom) { - String dsName = "/" + chr + "/raw"; - - TDFDataset ds = reader.getDataset(dsName); - if (ds != null) { - - double binSize = tileWidth / 700; - int binSizeInt = (int) binSize; - - List tiles = ds.getTiles(startLocation, endLocation); - if (tiles.size() > 0) { - - for (TDFTile tile : tiles) { - // Tile of raw data - if (tile != null && tile.getSize() > 0) { - - int lastBin = -1; - int nPts = 0; - float[] sum = new float[nTracks]; - for (int i = 0; i < tile.getSize(); i++) { - int s = tile.getStartPosition(i); - int e = tile.getEndPosition(i); - int bin = (int) (s / binSize); - - for (int t = 0; i < nTracks; t++) { - - // TODO -- that overlap and span multiple bins - if ((e - s) >= binSizeInt) { - } else { - if (lastBin < 0 || bin == lastBin) { - sum[t] = sum[t] + tile.getValue(t, i); - nPts++; - } else { - // On to a new bin. Record previous one and start over - // Note we're only doing the mean here, should use the "window function" - float mean = sum[t] / nPts; - int binStart = (int) (lastBin * binSize); - int binEnd = (int) Math.max(binStart + 1, (lastBin + 1) * binSize); - //scores.add(new BasicScore(chr, binStart, binEnd, mean)); - - sum[t] = v[t]; - nPts = 1; - } - } - lastBin = bin; - } - } - } - } - } - } - } - * */ -} diff --git a/src/org/broad/igv/tdf/notes.txt b/src/org/broad/igv/tdf/notes.txt deleted file mode 100644 index 404d09a..0000000 --- a/src/org/broad/igv/tdf/notes.txt +++ /dev/null @@ -1,77 +0,0 @@ - - General layout - [Header] - [Tiles] - [Datasets] - [Groups] - [Master Index] - - Header - ------ - magic number (32 bit int) - version (32 bit int - index position (64 bit long) - index size (bytes) (32 bit int) - header size (bytes) (32 bit int -- # of bytes for rest of header). - # of window functions - [window functions] - track type (string) - track line (string) - # of tracks - [track names] - - FixedTile - --------- - Type - # Positions - Start location - Span - Data - - Features - --------- - magic number (32 bit int) <= 'F','E', 'A', 'T' - format (string) <= bed, gff, other - [chr (string) - start (int) - rest of record (string)] - - FeatureIndex - ------------ - - - Dataset - ------- - # attributes - [attribute key (string) - attribute value (string] - data type - tile width - # tiles - [tile position - tile size (bytes)] <= THIS IS NOT NECCESSARY - - Group - ------ - # attributes - [attribute key (string) - attribute value (string] - - Master Index - ----------- - feature index position (long) (-1 if no features) - # datasets - [dataset name (string) - position (long) - size in bytes (int)] <= THIS IS NOT NECCESSARY - # groups - [group name - position (long) - size in bytes (int)] <= THIS IS NOT NECCESSARY - - - - -seek(long position) -read(buffer, offset, length) -length() <== Only used for testing end of file diff --git a/src/org/broad/igv/tools/Accumulator.java b/src/org/broad/igv/tools/Accumulator.java deleted file mode 100644 index 10c13a5..0000000 --- a/src/org/broad/igv/tools/Accumulator.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.igv.tools; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.apache.commons.math.stat.Percentile; -import org.broad.igv.track.WindowFunction; -import org.broad.igv.util.collections.DoubleArrayList; - - -/** - * Estimating percentiles -- weighted average of multiple estimates - * - * @author jrobinso - * @author Thomas Abeel - */ -public class Accumulator { - - static Set PERCENTILE_WINDOW_FUNCTIONS = new HashSet(); - public static int MAX_VALUE_COUNT = 100000; - private static Logger log = Logger.getLogger(Accumulator.class.getCanonicalName()); - - static { - PERCENTILE_WINDOW_FUNCTIONS.add(WindowFunction.median); - PERCENTILE_WINDOW_FUNCTIONS.add(WindowFunction.percentile2); - PERCENTILE_WINDOW_FUNCTIONS.add(WindowFunction.percentile10); - PERCENTILE_WINDOW_FUNCTIONS.add(WindowFunction.percentile90); - PERCENTILE_WINDOW_FUNCTIONS.add(WindowFunction.percentile98); - } - - - boolean isFinished = false; - - List windowFunctions; - List quantileFunctions; - DoubleArrayList values = null; - float sum = 0.0f; - int nPts = 0; - - - Map> percentiles = new HashMap(); - - - float min = Float.NaN; - float max = Float.NaN; - float mean = Float.NaN; - float median = Float.NaN; - float percentile2 = Float.NaN; - float percentile10 = Float.NaN; - float percentile90 = Float.NaN; - float percentile98 = Float.NaN; - - - public Accumulator(Collection windowFunctions) { - this.windowFunctions = new ArrayList(windowFunctions); - quantileFunctions = new ArrayList(); - for (WindowFunction wf : windowFunctions) { - if (PERCENTILE_WINDOW_FUNCTIONS.contains(wf)) { - quantileFunctions.add(wf); - if (values == null) { - values = new DoubleArrayList(); - } - } - } - } - - public void add(float v) { - if (!Float.isNaN(v)) { - min = Float.isNaN(min) ? v : Math.min(min, v); - max = Float.isNaN(max) ? v : Math.max(max, v); - sum += v; - nPts++; - if (values != null) { - values.add(v); - if (values.size() > MAX_VALUE_COUNT) { - computePercentiles(); - values.clear(); - } - } - } - } - - - public void finish() { - - if (isFinished) { - return; - } - - mean = Float.isNaN(sum) ? Float.NaN : sum / nPts; - - if (values != null) { - if (nPts == 1) { - for (WindowFunction wf : quantileFunctions) { - setValue(wf, mean); - } - } else { - if (values.size() > 1) { - computePercentiles(); - } - for (WindowFunction wf : quantileFunctions) { - - List pList = percentiles.get(wf); - float v = Float.NaN; // <= Default, - if (pList != null && pList.size() > 0) { - double weightedSum = 0; - double sumOfWeights = 0; - for (PercentileValue pv : pList) { - double weight = (double) pv.nPoints / nPts; - sumOfWeights += weight; - weightedSum += weight * pv.value; - } - v = (float) (weightedSum / sumOfWeights); - } - setValue(wf, v); - - } - - } - } - values = null; - isFinished = true; - - } - - private Percentile percentile=new Percentile(); - private void computePercentiles() { - if (values != null) { - double[] valueArray = values.toArray(); - for (WindowFunction wf : quantileFunctions) { - double p = this.getPercentile(wf); - if (p > 0) { - float v=(float)percentile.evaluate(valueArray, p); -// float v = (float) StatUtils.percentile(valueArray, p); - if (Float.isInfinite(v)) { - log.log(Level.SEVERE,"Infinite percentile (" + wf + ")"); - } else { - List pList = percentiles.get(wf); - if (pList == null) { - pList = new ArrayList(); - percentiles.put(wf, pList); - } - pList.add(new PercentileValue(valueArray.length, v)); - } - } - } - } - - } - - private void setValue(WindowFunction wf, float value) { - switch (wf) { - case mean: - mean = value; - break; - case median: - median = value; - break; - case min: - min = value; - break; - case max: - max = value; - break; - case percentile2: - percentile2 = value; - break; - case percentile10: - percentile10 = value; - break; - case percentile90: - percentile90 = value; - break; - case percentile98: - percentile98 = value; - break; - default: - System.err.println("Unexpected window function: " + wf.toString()); - } - - - } - - public float getValue(WindowFunction wf) { - - switch (wf) { - case mean: - return mean; - case median: - return median; - case min: - return min; - case max: - return max; - case percentile2: - return percentile2; - case percentile10: - return percentile10; - case percentile90: - return percentile90; - case percentile98: - return percentile98; - case count: - return nPts; - default: - System.err.println("Unexpected window function: " + wf.toString()); - - } - return Float.NaN; - - } - - - public double getPercentile(WindowFunction wf) { - switch (wf) { - case percentile2: - return 2; - case percentile10: - return 10; - case percentile90: - return 90; - case percentile98: - return 98; - case median: - return 50; - default: - return -1.0; - } - } - - - class PercentileValue { - int nPoints; - double value; - - PercentileValue(int nPoints, double value) { - this.nPoints = nPoints; - this.value = value; - } - } - -} diff --git a/src/org/broad/igv/track/WindowFunction.java b/src/org/broad/igv/track/WindowFunction.java deleted file mode 100644 index 9e61b0e..0000000 --- a/src/org/broad/igv/track/WindowFunction.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package org.broad.igv.track; - -/** - * @author jrobinso - */ -public enum WindowFunction { - - mean("Mean"), - median("Median"), - min("Minimum"), - max("Maximum"), - percentile2("2nd Percentile"), - percentile10("10th Percentile"), - percentile90("90th Percentile"), - percentile98("98th Percentile"), -// stddev("Standard Deviation"), - count("Count"); -// density("Density"); - - private String displayName = ""; - - WindowFunction(String displayName) { - this.displayName = displayName; - } - - public String getDisplayName() { - return displayName; - } - - static public WindowFunction getWindowFunction(String name) { - - WindowFunction windowFunction = null; - if (WindowFunction.mean.name().equalsIgnoreCase(name)) { - windowFunction = WindowFunction.mean; - } else if (WindowFunction.median.name().equalsIgnoreCase(name)) { - windowFunction = WindowFunction.median; - } else if (WindowFunction.min.name().equalsIgnoreCase(name)) { - windowFunction = WindowFunction.min; - } else if (WindowFunction.max.name().equalsIgnoreCase(name)) { - windowFunction = WindowFunction.max; - } else if (WindowFunction.percentile10.name().equalsIgnoreCase(name)) { - windowFunction = WindowFunction.percentile10; - } else if (WindowFunction.percentile90.name().equalsIgnoreCase(name)) { - windowFunction = WindowFunction.percentile90; - } else if (WindowFunction.percentile98.name().equalsIgnoreCase(name)) { - windowFunction = WindowFunction.percentile98; -// } else if (WindowFunction.stddev.name().equals(name)) { -// windowFunction = WindowFunction.stddev; - } else if (WindowFunction.count.name().equalsIgnoreCase(name)) { - windowFunction = WindowFunction.count; -// } else if (WindowFunction.density.name().equals(name)) { -// windowFunction = WindowFunction.density; - } - return windowFunction; - } -} diff --git a/src/org/broad/igv/util/CompressionUtils.java b/src/org/broad/igv/util/CompressionUtils.java deleted file mode 100644 index 63cdcb2..0000000 --- a/src/org/broad/igv/util/CompressionUtils.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -package org.broad.igv.util; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.zip.DataFormatException; -import java.util.zip.Deflater; -import java.util.zip.Inflater; - -/** - * Created by IntelliJ IDEA. - * User: jrobinso, mdecautis - * Date: Dec 13, 2009 - * Time: 4:16:42 PM - * To change this template use File | Settings | File Templates. - */ -public class CompressionUtils { - - private static Logger log = Logger.getLogger(CompressionUtils.class.getCanonicalName()); - - public static byte[] decompress(byte[] data) throws DataFormatException { - return decompress(data, data.length * 4); - } - - /** - * @param data -- the data to decompress - * @param uncompressedChunkSize -- an estimate of the uncompressed chunk size. This need not be exact. - * @return - * @throws DataFormatException - */ - public static byte[] decompress(byte[] data, int uncompressedChunkSize) throws DataFormatException { - - // mpd: new code - int rem = data.length; - - // Create an expandable byte array to hold the decompressed data - ByteArrayOutputStream bos = new ByteArrayOutputStream(uncompressedChunkSize); - - // Decompress the data - byte[] outbuf = new byte[uncompressedChunkSize]; - - Inflater decompressor = new Inflater(); - decompressor.setInput(data); - while (rem > 0) { - - // If we are finished with the current chunk start a new one - if (decompressor.finished()) { - decompressor = new Inflater(); - int offset = data.length - rem; - decompressor.setInput(data, offset, rem); - } - -// try { - int count = decompressor.inflate(outbuf, 0, outbuf.length); - rem = decompressor.getRemaining(); - bos.write(outbuf, 0, count); - -// } catch (Exception e) { -// e.printStackTrace(); -// } - } - - try { - bos.close(); - } catch (IOException e) { - // Ignore -- no resources open - } - decompressor.end(); - // Return the decompressed data - return bos.toByteArray(); - } - - - public static byte[] compress(byte[] data) { - - Deflater compressor = new Deflater(); - compressor.setLevel(Deflater.DEFAULT_COMPRESSION); - // Give the compressor the data to compress - compressor.setInput(data); - compressor.finish(); - - // Create an expandable byte array to hold the compressed data. - // You cannot use an array that's the same size as the orginal because - // there is no guarantee that the compressed data will be smaller than - // the uncompressed data. - ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); - - // Compress the data - byte[] buf = new byte[1024]; - while (!compressor.finished()) { - int count = compressor.deflate(buf); - bos.write(buf, 0, count); - } - try { - bos.close(); - } catch (IOException e) { - log.log(Level.SEVERE,"Error clossing ByteArrayOutputStream", e); - } - - compressor.end(); - byte[] compressedData = bos.toByteArray(); - return compressedData; - - } - - public static byte[] compress(byte[] data, int chunkSize) { - - ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); - - int bytesRemaining = data.length; - while (bytesRemaining > 0) { - int sz = Math.min(bytesRemaining, chunkSize); - int position = data.length - bytesRemaining; - byte[] chunk = new byte[sz]; - System.arraycopy(data, position, chunk, 0, sz); - - byte[] compressedChunk = compress(chunk); - bos.write(compressedChunk, 0, compressedChunk.length); - - bytesRemaining -= sz; - } - - byte[] compressedData = bos.toByteArray(); - return compressedData; - - } -} diff --git a/src/org/broad/igv/util/StringUtils.java b/src/org/broad/igv/util/StringUtils.java deleted file mode 100644 index 2cf2a79..0000000 --- a/src/org/broad/igv/util/StringUtils.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -package org.broad.igv.util; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by IntelliJ IDEA. - * User: jrobinso - * Date: Oct 30, 2009 - * Time: 1:51:36 AM - * To change this template use File | Settings | File Templates. - */ -public class StringUtils { - - - public static List breakQuotedString(String string, char splitToken) { - - ArrayList strings = new ArrayList(); - if (string.length() == 0) { - return strings; - } - - char[] characters = string.toCharArray(); - char c = characters[0]; - - boolean isQuoted = false; - StringBuffer buff = new StringBuffer(100); - for (int i = 0; i < characters.length; i++) { - c = characters[i]; - if (isQuoted) { - if (c == '"') { - isQuoted = false; - } - buff.append(c); - } else if (c == '"') { - isQuoted = true; - buff.append(c); - } else { - if (c == splitToken) { - strings.add(buff.toString().trim()); - buff.setLength(0); - } else { - buff.append(c); - } - } - } - if (buff.length() > 0) { - strings.add(buff.toString().trim()); - } - return strings; - - } - - - public static short genoToShort(String genotype) { - byte[] bytes = genotype.getBytes(); - return (short) ((bytes[0] & 0xff) << 8 | (bytes[1] & 0xff)); - } - - public static String readString(ByteBuffer byteBuffer) throws IOException { - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - byte b = -1; - while ((b = byteBuffer.get()) != 0) { - bytes.write(b); - } - return new String(bytes.toByteArray()); - } - - public static void main(String[] args) { - - String genotype = "AC"; - short genoShort = genoToShort(genotype); - - char allel1 = (char) ((genoShort >>> 8) & 0xFF); - char allel2 = (char) ((genoShort >>> 0) & 0xFF); - - System.out.println("Allele1: " + allel1); - System.out.println("Allele2: " + allel2); - - } -} diff --git a/src/org/broad/igv/util/collections/DoubleArrayList.java b/src/org/broad/igv/util/collections/DoubleArrayList.java deleted file mode 100644 index 0bd2e03..0000000 --- a/src/org/broad/igv/util/collections/DoubleArrayList.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ -package org.broad.igv.util.collections; - -/** - * Author: jrobinso - * Date: Jul 22, 2010 - *

- * ArrayList type collection for int types. Purpose is to avoid the need to create an object for each entry - * in the standard java collections. - */ -public class DoubleArrayList { - - - private transient double[] elements; - - private int size; - - - public DoubleArrayList() { - this(100); - } - - public DoubleArrayList(int initialCapacity) { - if (initialCapacity < 0) - throw new IllegalArgumentException("Illegal Capacity: " + initialCapacity); - this.elements = new double[initialCapacity]; - } - - public DoubleArrayList(double[] elements) { - this.elements = elements; - size = elements.length; - } - - public void add(double e) { - if (size + 1 >= elements.length) { - grow(); - } - elements[size++] = e; - } - - public void addAll(double[] args) { - double[] newElements = new double[size + args.length]; - System.arraycopy(elements, 0, newElements, 0, size); - System.arraycopy(args, 0, newElements, size, args.length); - elements = newElements; - size += args.length; - } - - public void addAll(DoubleArrayList aList) { - addAll(aList.toArray()); - } - - - public double get(int idx) { - return elements[idx]; - } - - public int size() { - return size; - } - - public boolean isEmpty() { - return size == 0; - } - - /** - * Empty all elements. This logically clears the collection but does not free up any space. - */ - public void clear() { - size = 0; - } - - private void grow() { - int oldCapacity = elements.length; - int newCapacity; - if (oldCapacity < 10000000) { - newCapacity = oldCapacity * 2; - } else { - newCapacity = (oldCapacity * 3) / 2 + 1; - } - double[] tmp = new double[newCapacity]; - System.arraycopy(elements, 0, tmp, 0, elements.length); - elements = tmp; - } - - - public double[] toArray() { - trimToSize(); - return elements; - } - - - private void trimToSize() { - int oldCapacity = elements.length; - if (size < oldCapacity) { - double[] tmp = new double[size]; - System.arraycopy(elements, 0, tmp, 0, size); - elements = tmp; - } - } -} diff --git a/src/org/broad/igv/util/collections/FloatArrayList.java b/src/org/broad/igv/util/collections/FloatArrayList.java deleted file mode 100644 index 8bfe773..0000000 --- a/src/org/broad/igv/util/collections/FloatArrayList.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ -package org.broad.igv.util.collections; - -/** - * Author: jrobinso - * Date: Jul 22, 2010 - *

- * ArrayList type collection for int types. Purpose is to avoid the need to create an object for each entry - * in the standard java collections. - */ -public class FloatArrayList { - - - private transient float[] elements; - - private int size; - - - public FloatArrayList() { - this(100); - } - - public FloatArrayList(int initialCapacity) { - if (initialCapacity < 0) - throw new IllegalArgumentException("Illegal Capacity: " + initialCapacity); - this.elements = new float[initialCapacity]; - } - - public FloatArrayList(float[] elements) { - this.elements = elements; - size = elements.length; - } - - public void add(float e) { - if (size + 1 >= elements.length) { - grow(); - } - elements[size++] = e; - } - - public void addAll(float[] args) { - float[] newElements = new float[size + args.length]; - System.arraycopy(elements, 0, newElements, 0, size); - System.arraycopy(args, 0, newElements, size, args.length); - elements = newElements; - size += args.length; - } - - public void addAll(FloatArrayList aList) { - addAll(aList.toArray()); - } - - - public float get(int idx) { - return elements[idx]; - } - - public int size() { - return size; - } - - public boolean isEmpty() { - return size == 0; - } - - /** - * Empty all elements. This logically clears the collection but does not free up any space. - */ - public void clear() { - size = 0; - } - - private void grow() { - int oldCapacity = elements.length; - int newCapacity; - if (oldCapacity < 10000000) { - newCapacity = oldCapacity * 2; - } else { - newCapacity = (oldCapacity * 3) / 2 + 1; - } - float[] tmp = new float[newCapacity]; - System.arraycopy(elements, 0, tmp, 0, elements.length); - elements = tmp; - } - - - public float[] toArray() { - trimToSize(); - return elements; - } - - - private void trimToSize() { - int oldCapacity = elements.length; - if (size < oldCapacity) { - float[] tmp = new float[size]; - System.arraycopy(elements, 0, tmp, 0, size); - elements = tmp; - } - } -} diff --git a/src/org/broad/igv/util/collections/IntArrayList.java b/src/org/broad/igv/util/collections/IntArrayList.java deleted file mode 100644 index 71cef13..0000000 --- a/src/org/broad/igv/util/collections/IntArrayList.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ -package org.broad.igv.util.collections; - -/** - * Author: jrobinso - * Date: Jul 22, 2010 - *

- * ArrayList type collection for int types. Purpose is to avoid the need to create an object for each entry - * in the standard java collections. - */ -public class IntArrayList { - - - private transient int[] elements; - - private int size; - - - public IntArrayList() { - this(100); - } - - public IntArrayList(int initialCapacity) { - if (initialCapacity < 0) - throw new IllegalArgumentException("Illegal Capacity: " + initialCapacity); - this.elements = new int[initialCapacity]; - } - - public IntArrayList(int[] elements) { - this.elements = elements; - size = elements.length; - } - - public void add(int e) { - if (size + 1 >= elements.length) { - grow(); - } - elements[size++] = e; - } - - public void addAll(int[] args) { - int[] newElements = new int[size + args.length]; - System.arraycopy(elements, 0, newElements, 0, size); - System.arraycopy(args, 0, newElements, size, args.length); - elements = newElements; - size += args.length; - } - - public void addAll(IntArrayList aList) { - addAll(aList.toArray()); - } - - - public int get(int idx) { - return elements[idx]; - } - - public int size() { - return size; - } - - public boolean isEmpty() { - return size == 0; - } - - /** - * Empty all elements. This logically clears the collection but does not free up any space. - */ - public void clear() { - size = 0; - } - - private void grow() { - int oldCapacity = elements.length; - int newCapacity; - if (oldCapacity < 10000000) { - newCapacity = oldCapacity * 2; - } else { - newCapacity = (oldCapacity * 3) / 2 + 1; - } - int[] tmp = new int[newCapacity]; - System.arraycopy(elements, 0, tmp, 0, elements.length); - elements = tmp; - } - - - public int[] toArray() { - trimToSize(); - return elements; - } - - - private void trimToSize() { - int oldCapacity = elements.length; - if (size < oldCapacity) { - int[] tmp = new int[size]; - System.arraycopy(elements, 0, tmp, 0, size); - elements = tmp; - } - } -} diff --git a/src/org/broad/tools/ConvertBAM2TDF.java b/src/org/broad/tools/ConvertBAM2TDF.java deleted file mode 100644 index 96680e0..0000000 --- a/src/org/broad/tools/ConvertBAM2TDF.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2011 by The Broad Institute of MIT and Harvard - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ -package org.broad.tools; - -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Collection; - -import net.sf.samtools.SAMFileReader; -import net.sf.samtools.SAMFileReader.ValidationStringency; - -import org.broad.igv.track.WindowFunction; - -/** - * Program to create tdf files from bam files. - * - * @author Thomas Abeel - * - */ -public class ConvertBAM2TDF { - - public static void main(String[] args) throws Exception { - if (args.length == 0) { - printUsage(); - } - for (String s : args) { - if (!new File(s + ".bai").exists()) { - System.err.println("WARNING: Could not find BAI file for " + s); - System.err - .println("\ttdformat needs a BAI file for each BAM file."); - } else { - try { - createFile(s); - } catch (Exception e) { - System.err.println("ERROR: Failed to create TDF file for " - + s); - } - } - } - } - - private static void printUsage() { - System.out - .println("Usage: java -jar tdformat-.jar [ ...]"); - System.out.println("\ttdformat needs a BAI file for each BAM file."); - - } - - private static void createFile(String ifile) throws IOException, - URISyntaxException { - Collection wfs = new ArrayList(); - for (WindowFunction wf : WindowFunction.values()) - wfs.add(wf); - SAMFileReader - .setDefaultValidationStringency(ValidationStringency.SILENT); - TDFTools igvTools = new TDFTools(); - igvTools.doCount(ifile, ifile + ".tdf", wfs); - - } - -} diff --git a/src/org/broad/tools/CoverageCounter.java b/src/org/broad/tools/CoverageCounter.java deleted file mode 100644 index e34aa6b..0000000 --- a/src/org/broad/tools/CoverageCounter.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General private License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.broad.tools; - -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - -import net.sf.samtools.AlignmentBlock; -import net.sf.samtools.SAMFileReader; -import net.sf.samtools.SAMRecord; -import net.sf.samtools.SAMRecordIterator; -import net.sf.samtools.SAMSequenceDictionary; -import net.sf.samtools.SAMSequenceRecord; - -/** - * TODO -- normalize option - * - -n Normalize the count by the total number of reads. This option - multiplies each count by (1,000,000 / total # of reads). It - is useful when comparing multiple chip-seq experiments when - the absolute coverage depth is not important. - */ - -/** - * @author jrobinso - * @author Thomas Abeel - */ -class CoverageCounter { - - private String alignmentFile; - private Preprocessor consumer; - private float[] buffer; - private int windowSize = 1; - // TODO -- make mapping qulaity a parameter - private int minMappingQuality = 0; - // FIXME What's this supposed to do? - // private int strandOption = -1; - private int extFactor; - private int totalCount = 0; - - private SAMSequenceDictionary genome; - - CoverageCounter(String alignmentFile, Preprocessor consumer, int windowSize, int extFactor, File wigFile, - SAMSequenceDictionary genome2) { - /* This should be a BAM file */ - this.alignmentFile = alignmentFile; - this.consumer = consumer; - this.windowSize = windowSize; - this.extFactor = extFactor; - // this.wigFile = wigFile; - this.genome = genome2; - // this.strandOption = strandOption; - buffer = new float[2];// strandOption < 0 ? new float[1] : new float[2]; - } - - private boolean passFilter(SAMRecord alignment) { - - return !alignment.getReadUnmappedFlag() && !alignment.getDuplicateReadFlag() - && alignment.getMappingQuality() >= minMappingQuality; - } - - void parse() throws IOException, URISyntaxException { - - int tolerance = (int) (windowSize * (Math.floor(extFactor / windowSize) + 2)); - - SAMFileReader sfr = new SAMFileReader(new File(alignmentFile)); - - // DataSourceFactory.createFile(new File(alignmentFile + - // ".bai")).read(genome); - - String lastChr = ""; - ReadCounter counter = null; - - for (SAMSequenceRecord e : genome.getSequences()) { - SAMRecordIterator it = sfr.queryOverlapping(e.getSequenceName(), 1, e.getSequenceLength()); - // for (DataKey dk : e) { - // Data data = e.get(dk); - // if (data instanceof ReadGroup) { - // for (SAMRecord alignment : ) { - while (it.hasNext()) { - SAMRecord alignment = it.next(); - if (passFilter(alignment)) { - - totalCount++; - - String alignmentChr = e.getSequenceName(); - - if (alignmentChr.equals(lastChr)) { - if (counter != null) { - counter.closeBucketsBefore(alignment.getAlignmentStart() - tolerance); - } - } else { - if (counter != null) { - counter.closeBucketsBefore(Integer.MAX_VALUE); - } - counter = new ReadCounter(alignmentChr); - lastChr = alignmentChr; - } - - AlignmentBlock[] blocks = alignment.getAlignmentBlocks().toArray(new AlignmentBlock[0]); - if (blocks != null) { - for (AlignmentBlock block : blocks) { - - int adjustedStart = block.getReferenceStart();// block.getStart(); - // FIXME Is this the correct coordinate? - int adjustedEnd = block.getReferenceStart() + block.getLength();// block.getEnd(); - if (alignment.getReadNegativeStrandFlag()) { - adjustedStart = Math.max(0, adjustedStart - extFactor); - } else { - adjustedEnd += extFactor; - } - - for (int pos = adjustedStart; pos < adjustedEnd; pos++) { - - if (!alignment.getReadNegativeStrandFlag()) - counter.incrementCount(pos); - else - counter.incrementNegCount(pos); - } - } - } else { - int adjustedStart = alignment.getAlignmentStart(); - // FIXME is this correct? - int adjustedEnd = alignment.getAlignmentEnd(); - if (alignment.getReadNegativeStrandFlag()) { - adjustedStart = Math.max(0, adjustedStart - extFactor); - } else { - adjustedEnd += extFactor; - } - - for (int pos = adjustedStart; pos < adjustedEnd; pos++) { - if (!alignment.getReadNegativeStrandFlag()) - counter.incrementCount(pos); - else - counter.incrementNegCount(pos); - } - } - } - - // } - // } - - } - it.close(); - } - - if (counter != null) { - counter.closeBucketsBefore(Integer.MAX_VALUE); - } - - consumer.setAttribute("totalCount", String.valueOf(totalCount)); - // FIXME??consumer.parsingComplete(); - // FIXME?? consumer.finish();// - - } - - class ReadCounter { - - String chr; - TreeMap counts = new TreeMap(); - - ReadCounter(String chr) { - this.chr = chr; - } - - void incrementCount(int position) { - Integer bucket = position / windowSize; - if (!counts.containsKey(bucket)) { - counts.put(bucket, new Counter()); - } - counts.get(bucket).increment(); - } - - void incrementNegCount(int position) { - Integer bucket = position / windowSize; - if (!counts.containsKey(bucket)) { - counts.put(bucket, new Counter()); - } - counts.get(bucket).incrementNeg(); - } - - void closeBucketsBefore(int position) { - List bucketsToClose = new ArrayList(); - - Integer bucket = position / windowSize; - for (Map.Entry entry : counts.entrySet()) { - if (entry.getKey() < bucket) { - - // Divide total count by window size. This is the average - // count per - // base over the window, so 30x coverage remains 30x - // irrespective of window size. - int bucketStartPosition = entry.getKey() * windowSize; - int bucketEndPosition = bucketStartPosition + windowSize; - if (genome != null) { - SAMSequenceRecord chromosome = genome.getSequence(chr); - if (chromosome != null) { - bucketEndPosition = Math.min(bucketEndPosition, chromosome.getSequenceLength()); - } - } - int bucketSize = bucketEndPosition - bucketStartPosition; - - buffer[0] = ((float) entry.getValue().getCount()) / bucketSize; - buffer[1] = ((float) entry.getValue().getNegCount()) / bucketSize; - - consumer.addData(chr, bucketStartPosition, bucketEndPosition, buffer, null); - - bucketsToClose.add(entry.getKey()); - } - } - - for (Integer key : bucketsToClose) { - counts.remove(key); - } - - } - } - - private class Counter { - - int count = 0; - int negCount = 0; - - void increment() { - count++; - } - - void incrementNeg() { - negCount++; - } - - int getCount() { - return count; - } - - int getNegCount() { - return negCount; - } - } - -} diff --git a/src/org/broad/tools/Preprocessor.java b/src/org/broad/tools/Preprocessor.java deleted file mode 100644 index c7a43db..0000000 --- a/src/org/broad/tools/Preprocessor.java +++ /dev/null @@ -1,784 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General private License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -package org.broad.tools; - -import java.io.File; -import java.io.IOException; -import java.io.PrintStream; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.samtools.SAMSequenceDictionary; -import net.sf.samtools.SAMSequenceRecord; - -import org.broad.igv.tdf.TDFBedTile; -import org.broad.igv.tdf.TDFDataset; -import org.broad.igv.tdf.TDFFixedTile; -import org.broad.igv.tdf.TDFGroup; -import org.broad.igv.tdf.TDFTile; -import org.broad.igv.tdf.TDFVaryTile; -import org.broad.igv.tdf.TDFWriter; -import org.broad.igv.tools.Accumulator; -import org.broad.igv.track.WindowFunction; -import org.broad.igv.util.collections.FloatArrayList; -import org.broad.igv.util.collections.IntArrayList; - -/** - * - * @author jrobinso - * @author Thomas Abeel - */ -class Preprocessor { - - private static Logger log = Logger.getLogger(Preprocessor.class.toString()); - private boolean compressed = true; - private boolean skipZeroes = false; - private int nZoom = 7; - private int maxExtFactor = 0; - private Zoom[] zoomLevels; - private int nTracks; - private SAMSequenceDictionary genome; - private Collection windowFunctions; - private String currentChr = ""; - private int currentChrLength; -// private int sizeEstimate; - private int nPtsProcessed = 0; - // StatusMonitor statusMonitor; -// private double percentComplete = 0.0; - private int lastStartPosition = 0; - private HashSet skippedChromosomes = new HashSet(); - private TDFWriter writer; - private Raw rawData; -// private Zoom genomeZoom; - private File outputFile; - private Accumulator allDataStats; - private List chromosomes = new ArrayList(); - private Set visitedChromosomes = new HashSet(); - private Map attributes = new HashMap(); - private PrintStream out = System.out; - - private List allDataFunctions = Arrays.asList(WindowFunction.mean, WindowFunction.median, - WindowFunction.min, WindowFunction.max, WindowFunction.percentile2, WindowFunction.percentile10, - WindowFunction.percentile90, WindowFunction.percentile98); - private String genomeID; - - Preprocessor(String genomeID, File outputFile, SAMSequenceDictionary genome, - Collection windowFunctions, int sizeEstimate) { - this.genomeID = genomeID; - // this.statusMonitor = monitor; - this.outputFile = outputFile; - this.genome = genome; - this.windowFunctions = windowFunctions; - //this.sizeEstimate = sizeEstimate; - // this.genome = genome; - allDataStats = new Accumulator(allDataFunctions); - - // if (statusMonitor == null) { - // statusMonitor = new CommandLineStatusMonitor(); - // } - } - - final public static String CHR_ALL = "All"; - - /** - * Called to set inital parameters. It is required that this be called prior - * to writing the file - */ - private void setTrackParameters(String trackType, String trackLine, String[] trackNames) { - - if (outputFile != null && writer == null) { - writer = new TDFWriter(outputFile, genomeID, trackType, trackLine, trackNames, windowFunctions, compressed); - nTracks = trackNames.length; - - // Convert genome coordinates from bp to kbp -// int genomeLength = (int) (getLength(genome.getSequences()) / 1000); -// genomeZoom = new Zoom(CHR_ALL, 0, genomeLength); - - TDFGroup rootGroup = writer.getRootGroup(); - rootGroup.setAttribute("genome", genomeID); - rootGroup.setAttribute("maxZoom", String.valueOf(nZoom)); - - } - } - -// private long getLength(List genome2) { -// long size = 0; -// for (SAMSequenceRecord e : genome2) { -// size += e.getSequenceLength(); -// } -// return size; -// } - - /** - * Add an array of data for the given interval. The array contains a value - * for each sample/track in this dataset. The name is an optional probe or - * feature name. - */ - void addData(String chr, int start, int end, float[] data, String name) { - - if (writer == null) { - return; - } - - if (skipZeroes) { - boolean allZeroes = true; - for (int i = 0; i < data.length; i++) { - if (data[i] != 0) { - allZeroes = false; - break; - } - } - if (allZeroes) { - return; - } - } - - // // Check for stop signal - // if (statusMonitor != null && statusMonitor.isInterrupted()) { - // throw new PreprocessingException("Preprocessing Halted."); - // } - - if (skippedChromosomes.contains(chr)) { - return; - } - - if (currentChr != null && chr.equals(currentChr)) { - if (start < (lastStartPosition - maxExtFactor)) { - String msg = "Error: Data is not sorted @ " + chr + " " + start + " (last position = " - + lastStartPosition + " max ext factor = " + maxExtFactor + ")"; - out.println(msg); - throw new RuntimeException(msg); - } - } else { - newChromosome(chr); - } - - // Check a second time, in case it just got added - if (skippedChromosomes.contains(chr)) { - return; - } - - // Is this data in range for the chromosome? - int chrLength = genome.getSequence(chr).getSequenceLength(); // genome.getChromosome(chr).getLength(); - - if (start > chrLength) { - log.info("Ignoring data from non-existent locus. Probe = " + name + " Locus = " + chr + ":" + start + "-" - + end + ". " + chr + " length = " + chrLength); - return; - } - - // Add to raw data - rawData.addData(start, end, data, name); - - // Zoom levels - for (Zoom zl : zoomLevels) { - zl.addData(start, end, data); - } - -// // Whole genome -// long offset = getCumulativeOffset(genome,chr); -// int gStart = (int) ((offset + start) / 1000); -// int gEnd = Math.max(gStart + 1, (int) ((offset + end) / 1000)); -// -// // Don't include "chrM" in the whole genome view or stats -// if (!(chr.equals("chrM") || chr.equals("M") || chr.equals("MT"))) { -// genomeZoom.addData(gStart, gEnd, data); -// for (int i = 0; i < data.length; i++) { -// allDataStats.add(data[i]); -// } -// } - - lastStartPosition = start; - - } - -// private long getCumulativeOffset(SAMSequenceDictionary genome, String chr) { -// //TODO check this implementation, I don't use this ~~Thomas -// long pos=0; -// for(SAMSequenceRecord sr:genome.getSequences()){ -// if(sr.getSequenceName().equals(chr)) -// return pos; -// pos+=sr.getSequenceLength(); -// } -// // Did not find the specified ID. -// return -1; -// } - - /** - * Start a new chromosome. Note that data is sorted by chromosome, then - * start position. - */ - private void newChromosome(String chr) { - - if (visitedChromosomes.contains(chr)) { - String msg = "Error: Data is not ordered by start position. Chromosome " + chr - + " appears in multiple blocks"; - out.println(msg); - throw new RuntimeException(msg); - - } - visitedChromosomes.add(chr); - - SAMSequenceRecord c = genome.getSequence(chr); - if (c == null) { - out.println("Chromosome: " + chr + " not found in .genome file. Skipping."); - skippedChromosomes.add(chr); - } else { - - chromosomes.add(chr); - - out.println(); - out.println("Processing chromosome " + chr); - if (zoomLevels != null) { - for (Zoom zl : zoomLevels) { - zl.close(); - } - } - if (rawData != null) { - rawData.close(); - } - - currentChr = chr; - currentChrLength = c.getSequenceLength(); - zoomLevels = new Zoom[getNZoom() + 1]; - for (int z = 0; z <= getNZoom(); z++) { - zoomLevels[z] = new Zoom(chr, z, currentChrLength); - } - - rawData = new Raw(chr, currentChrLength, 100000); - } - lastStartPosition = 0; - - } - - // /** - // * Called at end-of-file - // */ - // private void parsingComplete() { - // - // } - - void finish() { - if (writer == null) { - return; - } - - StringBuffer chrString = new StringBuffer(); - Iterator iter = chromosomes.iterator(); - while (iter.hasNext()) { - chrString.append(iter.next()); - if (iter.hasNext()) { - chrString.append(","); - } - } - writer.getRootGroup().setAttribute("chromosomes", chrString.toString()); - - for (Map.Entry entry : attributes.entrySet()) { - writer.getRootGroup().setAttribute(entry.getKey(), entry.getValue()); - } - - if (zoomLevels != null) { - for (Zoom zl : zoomLevels) { - zl.close(); - } - } -// genomeZoom.close(); - - if (rawData == null) { - // TODO -- delete .tdf file? - out.println("No features were found that matched chromosomes in genome: " + genome); - - } else { - rawData.close(); - - // Record max/min - allDataStats.finish(); - TDFGroup group = writer.getGroup("/"); - group.setAttribute(TDFGroup.USE_PERCENTILE_AUTOSCALING, "true"); - for (WindowFunction wf : allDataFunctions) { - group.setAttribute(wf.getDisplayName(), String.valueOf(allDataStats.getValue(wf))); - } - writer.closeFile(); - } - - // if (statusMonitor != null) { - // statusMonitor.setPercentComplete(100); - // } else { - // out.println("Done"); - // } - } - -// private void setType(String type) { -// // this.type = type; -// } -// -// private void setSortTolerance(int tolerance) { -// maxExtFactor = tolerance; -// } -// -// private void setAttribute(String key, String value) { -// attributes.put(key, value); -// } - -// /** -// * @param sizeEstimate -// * the sizeEstimate to set -// */ -// private void setSizeEstimate(int sizeEstimate) { -// this.sizeEstimate = sizeEstimate; -// } - - private void setSkipZeroes(boolean skipZeroes) { - this.skipZeroes = skipZeroes; - } - - private int getNZoom() { - return nZoom; - } - - private void setNZoom(int nZoom) { - this.nZoom = nZoom; - } -// -// private int getSizeEstimate() { -// return sizeEstimate; -// } - - /** - * Class representing a tile of raw (as opposed to summarized) data. - */ - private class RawTile { - String dsName; - int tileNumber; - int tileStart; - int tileEnd; - IntArrayList startArray; - IntArrayList endArray; - ArrayList nameList; - FloatArrayList[] dataArray; - - RawTile(String dsName, int tileNumber, int start, int end) { - this.dsName = dsName; - this.tileNumber = tileNumber; - this.tileStart = start; - this.tileEnd = end; - startArray = new IntArrayList(); - endArray = new IntArrayList(); - dataArray = new FloatArrayList[nTracks]; - for (int i = 0; i < nTracks; i++) { - dataArray[i] = new FloatArrayList(); - } - } - - void addData(int start, int end, float[] data, String name) { - - if (start > tileEnd) { - log.info("Warning: start position > tile end"); - - } - - if (end < tileStart) { - log.info("Warning: end position > tile end"); - } - - if (name != null && nameList == null) { - nameList = new ArrayList(); - } - - int dataStart = Math.max(tileStart, start); - int dataEnd = Math.min(tileEnd, end); - startArray.add(dataStart); - endArray.add(dataEnd); - for (int i = 0; i < data.length; i++) { - dataArray[i].add(data[i]); - } - if (name != null) { - nameList.add(name); - } - } - - void close() { - try { - if (startArray.size() > 0) { - int[] s = startArray.toArray(); - int[] e = endArray.toArray(); - float[][] d = new float[dataArray.length][dataArray[0].size()]; - for (int i = 0; i < dataArray.length; i++) { - d[i] = dataArray[i].toArray(); - } - - String[] n = nameList == null ? null : nameList.toArray(new String[] {}); - TDFBedTile tile = new TDFBedTile(tileStart, s, e, d, n); - writer.writeTile(dsName, tileNumber, tile); - startArray.clear(); - endArray.clear(); - for (int i = 0; i < dataArray.length; i++) { - dataArray[i].clear(); - } - } - } catch (IOException ex) { - ex.printStackTrace(); - } - } - } - - /** - * Class representing the raw dataset - */ - private class Raw { - - //private String chr; - private String dsName; - //private TDFDataset dataset; - private int tileWidth; - private Map activeTiles = new HashMap(); - - Raw(String chr, int chrLength, int tileWidth) { - - this.tileWidth = tileWidth; - int nTiles = (int) (chrLength / tileWidth) + 1; - dsName = "/" + chr + "/raw"; - writer.createDataset(dsName, TDFDataset.DataType.FLOAT, tileWidth, nTiles); - - } - - /** - * @param start - * @param end - * @param data - */ - private void addData(int start, int end, float[] data, String name) { - - int startTileNumber = (int) (start / tileWidth); - int endTileNumber = (int) (end / tileWidth); - - // Check for closed tiles -- tiles we are guaranteed to not revisit - int tmp = (start - maxExtFactor) / tileWidth; - while (!activeTiles.isEmpty()) { - Integer tileNumber = activeTiles.keySet().iterator().next(); - if (tileNumber < tmp) { - RawTile t = activeTiles.get(tileNumber); - t.close(); - activeTiles.remove(tileNumber); - // out.println("(-) " + level + "_" + tileNumber); - } else { - break; - } - } - - // Add data to all tiles it spans. The data will be effectively - // "cut" if it spans multiple tiles. - for (int t = startTileNumber; t <= endTileNumber; t++) { - RawTile tile = activeTiles.get(t); - if (tile == null) { - tile = new RawTile(dsName, t, t * tileWidth, (t + 1) * tileWidth); - activeTiles.put(t, tile); - } - tile.addData(start, end, data, name); - } - - // Update progress -- assume uniform distribution - // if (statusMonitor != null) { - // int p = (int) ((100.0 * nPtsProcessed) / (1.5 * - // getSizeEstimate())); - // if (p > percentComplete) { - // percentComplete = p; - // statusMonitor.setPercentComplete(percentComplete); - // } - // } - nPtsProcessed++; - } - - void close() { - for (RawTile t : activeTiles.values()) { - t.close(); - } - activeTiles = null; - } - - } - - /** - * Class representing all the data for a particular zoom level. - */ - private class Zoom { - - int level; - int tileWidth; - LinkedHashMap activeTiles = new LinkedHashMap(); - Map datasets = new HashMap(); - - Zoom(String chr, int level, int chrLength) { - int nTiles = (int) Math.pow(2, level); - tileWidth = chrLength / nTiles + 1; - this.level = level; - - // Create datasets -- one for each window function - for (WindowFunction wf : windowFunctions) { - String dsName = "/" + chr + "/z" + level + "/" + wf.toString(); - datasets.put(wf, writer.createDataset(dsName, TDFDataset.DataType.FLOAT, tileWidth, nTiles)); - } - } - - private void addData(int start, int end, float[] data) { - - int startTile = start / tileWidth; - int endTile = end / tileWidth; - - // Check for closed tiles - int tmp = (start - maxExtFactor) / tileWidth; - while (!activeTiles.isEmpty()) { - Integer tileNumber = activeTiles.keySet().iterator().next(); - if (tileNumber < tmp) { - Tile t = activeTiles.get(tileNumber); - t.close(); - activeTiles.remove(tileNumber); - } else { - break; - } - } - - for (int i = startTile; i <= endTile; i++) { - Tile t = activeTiles.get(i); - if (t == null) { - t = new Tile(datasets, level, i, 700, tileWidth); - activeTiles.put(i, t); - } - t.addData(start, end, data); - } - } - - // Close all active tiles - - private void close() { - for (Tile t : activeTiles.values()) { - t.close(); - } - } - } - - /** - * A tile of summarized data - */ - private class Tile { - int totalCount; - // int zoomLevel; - int tileNumber; - int tileStart; - int lastFinishedBin = 0; - float binWidth; - int nBins; - int nonEmptyBins; - Accumulator[][] accumulators; - Map datasets; - - Tile(Map datasets, int zoomLevel, int tileNumber, int nBins, int tileWidth) { - this.totalCount = 0; - this.datasets = datasets; - // this.zoomLevel = zoomLevel; - this.tileNumber = tileNumber; - this.tileStart = tileNumber * tileWidth; - this.nBins = nBins; - this.binWidth = ((float) tileWidth) / nBins; - this.accumulators = new Accumulator[nTracks][nBins]; - } - - /** - * Add a data point. Positions are zero based exclusive (UCSC - * convention) - * - * @param start - * @param end - * @param data - * array of values at this position, 1 value per track - */ - void addData(int start, int end, float[] data) { - totalCount++; - - int startBin = Math.max(0, (int) ((start - tileStart) / binWidth)); - int endBin = Math.min(nBins - 1, (int) ((end - tileStart) / binWidth)); - - int tmp = (int) ((start - tileStart - maxExtFactor) / binWidth); - - for (int t = 0; t < nTracks; t++) { - for (int b = lastFinishedBin; b < tmp; b++) { - if (accumulators[t][b] != null) { - accumulators[t][b].finish(); - } - } - lastFinishedBin = Math.max(0, tmp - 1); - - for (int b = startBin; b <= endBin; b++) { - if (accumulators[t][b] == null) { - accumulators[t][b] = new Accumulator(datasets.keySet()); - } - accumulators[t][b].add(data[t]); - } - } - } - - /** - * - */ - void close() { - - // Count non-empty bins. All tracks should be the same - nonEmptyBins = 0; - - for (int t = 0; t < nTracks; t++) { - for (int i = 0; i < nBins; i++) { - if (accumulators[t][i] != null) { - accumulators[t][i].finish(); - if (t == 0) { - nonEmptyBins++; - } - } - } - } - - TDFTile tile = null; - - for (WindowFunction wf : datasets.keySet()) { - - // If < 50% of bins are empty use vary step tile, otherwise use - // fixed step - if (nonEmptyBins < 0.5 * nBins) { - int[] starts = new int[nonEmptyBins]; - float[][] data = new float[nTracks][nonEmptyBins]; - int n = 0; - for (int i = 0; i < nBins; i++) { - for (int t = 0; t < nTracks; t++) { - Accumulator acc = accumulators[t][i]; - if (acc != null) { - data[t][n] = acc.getValue(wf); - if (t == nTracks - 1) { - starts[n] = (int) (tileStart + (i * binWidth)); - n++; - } - } - } - } - tile = new TDFVaryTile((int) tileStart, binWidth, starts, data); - - } else { - float[][] data = new float[nTracks][nBins]; - for (int t = 0; t < nTracks; t++) { - for (int i = 0; i < nBins; i++) { - data[t][i] = accumulators[t][i] == null ? Float.NaN : accumulators[t][i].getValue(wf); - } - } - tile = new TDFFixedTile(tileStart, tileStart, binWidth, data); - } - - String dsName = datasets.get(wf).getName(); - try { - writer.writeTile(dsName, tileNumber, tile); - } catch (IOException iOException) { - log.log(Level.SEVERE, "Error writing tile: " + dsName + " [" + tileNumber + "]", iOException); - // TODO -- replace with PreprocessorException - throw new RuntimeException(iOException); - } - } - } - } - - // private static boolean isAlignmentFile(String ext) { - // return ext.equalsIgnoreCase(".bam") || ext.equalsIgnoreCase(".sam") || - // ext.equalsIgnoreCase(".aligned") - // || ext.equalsIgnoreCase(".sorted.txt") || ext.equalsIgnoreCase(".bedz") - // || ext.equalsIgnoreCase(".bed"); - // } - - void count(String iFile, int maxZoomValue) - throws IOException, URISyntaxException { - setNZoom(maxZoomValue); - setTrackParameters("COVERAGE", null, new String[] { "forward","reverse" }); - this.setSkipZeroes(true); - CoverageCounter aParser = new CoverageCounter(iFile, this, 1, 0, null, genome ); -// setSizeEstimate((int) (getLength(genome.getSequences()))); - aParser.parse(); - } - -// private HashMapattributes=new HashMap(); - - public void setAttribute(String key, String value) { - attributes.put(key,value); - - } - -// private void preprocess(File iFile, String probeFile, int maxZoomValue) throws IOException { -// -// setNZoom(maxZoomValue); -// -// String tmp = iFile.getAbsolutePath().toLowerCase(); -// if (tmp.endsWith(".txt")) -// tmp = tmp.substring(0, tmp.length() - 4); -// if (tmp.endsWith(".gz")) -// tmp = tmp.substring(0, tmp.length() - 3); -// if (tmp.endsWith("wig") || tmp.endsWith("bedgraph")) { -// WiggleParser wg = new WiggleParser(iFile.getAbsolutePath(), this, genome); -// wg.parse(); -// } else if (tmp.endsWith(".cn") || tmp.endsWith(".igv") || tmp.endsWith(".snp")) { -// CNParser cnParser = new CNParser(iFile.getAbsolutePath(), this, genome); -// cnParser.parse(); -// } else { -// String extension = getExtension(iFile.getAbsolutePath()); -// out.println("Error: cannot 'tile' files of type " + extension); -// out.println("Valid file extensions are: .cn, .xcn, .cn, .snp, .wig, and .gct"); -// } -// } - -// /** -// * Strip of "gz" and "txt" extensions to get to true format extension. -// * -// * @param filename -// * @return -// */ -// private static String getExtension(String filename) { -// -// if (filename.endsWith(".gz")) { -// filename = filename.substring(0, filename.length() - 3); -// } -// -// // Special case for "sorted.txt" -// if (filename.toLowerCase().endsWith(".sorted.txt")) { -// return ".sorted.txt"; -// } else if (filename.toLowerCase().endsWith(".txt")) { -// filename = filename.substring(0, filename.length() - 4); -// } -// -// int idx = filename.lastIndexOf('.'); -// if (idx < 0) { -// return ""; -// } else { -// return filename.substring(idx).toLowerCase(); -// } -// } -} diff --git a/src/org/broad/tools/TDFTools.java b/src/org/broad/tools/TDFTools.java deleted file mode 100644 index d5bcbaa..0000000 --- a/src/org/broad/tools/TDFTools.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General private License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ - -package org.broad.tools; - -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.Collection; - -import net.sf.samtools.SAMFileReader; -import net.sf.samtools.SAMSequenceDictionary; -import net.sf.samtools.SAMSequenceRecord; - -import org.broad.igv.track.WindowFunction; - -/** - * Class to create TDF files from BAM files. - * - * @author jrobinso - * @author Thomas Abeel - */ -public class TDFTools { - - - - - /** - * Compute coverage or density of an alignment or feature file. - * - * @param ifile - * BAM Alignment - * @param ofile - * Output file - * @param windowFunctions - * @param windowSizeValue - * @param extFactorValue - * @param strandOption - * @throws IOException - * @throws URISyntaxException - * @throws ReadFailedException - */ - public void doCount(String ifile, String ofile, - Collection windowFunctions) - throws IOException, URISyntaxException { - System.out.println("Computing coverage. File = " + ifile); - SAMFileReader sfr=new SAMFileReader(new File(ifile)); - SAMSequenceDictionary dict=sfr.getFileHeader().getSequenceDictionary(); - long max=0; - for(SAMSequenceRecord ssr:dict.getSequences()){ - if(ssr.getSequenceLength()>max) - max=ssr.getSequenceLength(); - } - - - - int zoom=0; - while(max/2>50000){ - max/=2; - zoom++; - } - System.out.println("Zoom levels needed: "+zoom); - - - int maxZoomValue=zoom; - - Preprocessor p = new Preprocessor(new File(ifile).getName(), new File(ofile), dict,windowFunctions, 1); - p.count(ifile, maxZoomValue); - p.finish(); - - System.out.flush(); - } - - - - - -} diff --git a/src/org/broad/tribble/Feature.java b/src/org/broad/tribble/Feature.java deleted file mode 100644 index 2d7c311..0000000 --- a/src/org/broad/tribble/Feature.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2007-2010 by The Broad Institute, Inc. and the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * This software is licensed under the terms of the GNU Lesser General Public License (LGPL), Version 2.1 which - * is available at http://www.opensource.org/licenses/lgpl-2.1.php. - * - * THE SOFTWARE IS PROVIDED "AS IS." THE BROAD AND MIT MAKE NO REPRESENTATIONS OR WARRANTIES OF - * ANY KIND CONCERNING THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT - * OR OTHER DEFECTS, WHETHER OR NOT DISCOVERABLE. IN NO EVENT SHALL THE BROAD OR MIT, OR THEIR - * RESPECTIVE TRUSTEES, DIRECTORS, OFFICERS, EMPLOYEES, AND AFFILIATES BE LIABLE FOR ANY DAMAGES OF - * ANY KIND, INCLUDING, WITHOUT LIMITATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, ECONOMIC - * DAMAGES OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF WHETHER THE BROAD OR MIT SHALL - * BE ADVISED, SHALL HAVE OTHER REASON TO KNOW, OR IN FACT SHALL KNOW OF THE POSSIBILITY OF THE - * FOREGOING. - */ -package org.broad.tribble; - - -/** - * Represents a locus on a reference sequence. The coordiante conventions are 1-based fully closed. For example, - * a features spanning the second and third base of a sequence would have coordinates start = 2, end = 3, and - * a length of 2. - */ -public interface Feature { - - /** - * Return the features reference sequence name, e.g chromosome or contig - */ - public String getChr(); - - /** - * Return the start position in 1-based coordinates (first base is 1) - */ - public int getStart(); - - /** - * Return the end position following 1-based fully closed conventions. The length of a feature is - * end - start + 1; - */ - public int getEnd(); -} diff --git a/src/org/broad/tribble/LittleEndianInputStream.java b/src/org/broad/tribble/LittleEndianInputStream.java deleted file mode 100644 index e35b54b..0000000 --- a/src/org/broad/tribble/LittleEndianInputStream.java +++ /dev/null @@ -1,150 +0,0 @@ -/* -* Adapted from example code in -* Title: Hardcore Java -* Title: Java I/O -* Second Edition: May 2006 -* ISBN 10: 0-596-52750-0 -* ISBN 13: 9780596527501 -* -* http://www.javafaq.nu/java-example-code-1078.html -* -*/ -package org.broad.tribble; - -import java.io.ByteArrayOutputStream; -import java.io.EOFException; -import java.io.FilterInputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * File retrieved from BigWig project at Google code on July 26, 2011, revision - * 36 - * - * http://code.google.com/p/bigwig/ - * - * This project provides java readers for the UCSC's BigWig and BigBed formats. - * It was originally developed by Martin Decautis and Jim Robinson for the - * Integrative Genomics Viewer (http://www.broadinstitute.org/igv). Thanks to - * Jim Kent and Ann Zweig and from UCSC for their assistance. - * - * - * Modification to work with GenomeView by Thomas Abeel. - * - * @author Martin Decautis - * @author Jim Robinson - * @author Thomas Abeel - * - */ -public class LittleEndianInputStream extends FilterInputStream { - - public LittleEndianInputStream(InputStream in) { - super(in); - } - - public boolean readBoolean() throws IOException { - int bool = in.read(); - if (bool == -1) throw new EOFException(); - return (bool != 0); - } - - public byte readByte() throws IOException { - int temp = in.read(); - if (temp == -1) throw new EOFException(); - return (byte) temp; - } - - public int readUnsignedByte() throws IOException { - int temp = in.read(); - if (temp == -1) throw new EOFException(); - return temp; - } - - public short readShort() throws IOException { - int byte1 = in.read(); - int byte2 = in.read(); - // only need to test last byte read - // if byte1 is -1 so is byte2 - if (byte2 == -1) throw new EOFException(); - return (short) (((byte2 << 24) >>> 16) + ((byte1 << 24) >>> 24)); - } - - public int readUnsignedShort() throws IOException { - int byte1 = in.read(); - int byte2 = in.read(); - if (byte2 == -1) throw new EOFException(); - return ((byte2 << 24) >> 16) + ((byte1 << 24) >> 24); - } - - public char readChar() throws IOException { - int byte1 = in.read(); - int byte2 = in.read(); - if (byte2 == -1) throw new EOFException(); - return (char) (((byte2 << 24) >>> 16) + ((byte1 << 24) >>> 24)); - } - - public int readInt() throws IOException { - - int byte1 = in.read(); - int byte2 = in.read(); - int byte3 = in.read(); - int byte4 = in.read(); - if (byte4 == -1) { - throw new EOFException(); - } - return (byte4 << 24) - + ((byte3 << 24) >>> 8) - + ((byte2 << 24) >>> 16) - + ((byte1 << 24) >>> 24); - - } - - public long readLong() throws IOException { - - long byte1 = in.read(); - long byte2 = in.read(); - long byte3 = in.read(); - long byte4 = in.read(); - long byte5 = in.read(); - long byte6 = in.read(); - long byte7 = in.read(); - long byte8 = in.read(); - if (byte8 == -1) { - throw new EOFException(); - } - return (byte8 << 56) - + ((byte7 << 56) >>> 8) - + ((byte6 << 56) >>> 16) - + ((byte5 << 56) >>> 24) - + ((byte4 << 56) >>> 32) - + ((byte3 << 56) >>> 40) - + ((byte2 << 56) >>> 48) - + ((byte1 << 56) >>> 56); - - } - - public final double readDouble() throws IOException { - return Double.longBitsToDouble(this.readLong()); - } - - public final float readFloat() throws IOException { - return Float.intBitsToFloat(this.readInt()); - } - - /** - * Read a null terminated byte array and return result as a string - * - * @return - * @throws IOException - */ - - public String readString() throws IOException { - ByteArrayOutputStream bis = new ByteArrayOutputStream(100); - byte b ; - while ((b = (byte) in.read()) != 0) { - bis.write(b); - } - return new String(bis.toByteArray()); - } - -} diff --git a/src/org/broad/tribble/SeekableStreamUtils.java b/src/org/broad/tribble/SeekableStreamUtils.java deleted file mode 100644 index 8ea9c5b..0000000 --- a/src/org/broad/tribble/SeekableStreamUtils.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.broad.tribble; - -import java.io.EOFException; -import java.io.IOException; - -import net.sf.samtools.seekablestream.SeekableStream; -/** - * - * @author Thomas Abeel - * - */ -public class SeekableStreamUtils { - - public static void readFully(byte[] buffer, SeekableStream fis) throws IOException { - - int len = buffer.length; - if (len < 0) - throw new IndexOutOfBoundsException(); - int n = 0; - while (n < len) { - int count = fis.read(buffer, n, len - n); - if (count < 0) - throw new EOFException(); - n += count; - } - } -}