SimpleFastaCmd implements FastaCmd { @Override public BioSequence getByAccession( String accession, String database ) { return this.getByAccession( accession, database, SimpleFastaCmd.blastDbHome ); } SimpleFastaCmd(); @Override BioSequence getByAccession( String accession, String database ); @Override BioSequence getByIdentifier( int identifier, String database ); @Override Collection<BioSequence> getBatchAccessions( Collection<String> accessions, String database ); @Override Collection<BioSequence> getBatchIdentifiers( Collection<Integer> identifiers, String database ); @Override BioSequence getByAccession( String accession, String database, String blastHome ); @Override BioSequence getByIdentifier( int identifier, String database, String blastHome ); @Override Collection<BioSequence> getBatchAccessions( Collection<String> accessions, String database,
            String blastHome ); @Override Collection<BioSequence> getBatchIdentifiers( Collection<Integer> identifiers, String database,
            String blastHome ); static final String FASTA_CMD_ENV_VAR; }
@Test public void testGetSingleAcc() { if ( this.fastaCmdExecutableNotExists() ) { return; } SimpleFastaCmd fastaCmd = new SimpleFastaCmd(); String accession = "AA000002"; BioSequence bs = fastaCmd.getByAccession( accession, SimpleFastaCmdTest.TESTBLASTDB, testBlastDbPath ); assertNotNull( "fastacmd failed to find " + accession, bs ); String expected = "CCACCTTTCCCTCCACTCCTCACGTTCTCACCTGTAAAGCGTCCCTCCCTCATCCCCATGCCCCCTTACCCTGCAGGGTA" + "GAGTAGGCTAGAAACCAGAGAGCTCCAAGCTCCATCTGTGGAGAGGTGCCATCCTTGGGCTGCAGAGAGAGGAGAATTTG" + "CCCCAAAGCTGCCTGCAGAGCTTCACCACCCTTAGTCTCACAAAGCCTTGAGTTCATAGCATTTCTTGAGTTTTCACCCT" + "GCCCAGCAGGACACTGCAGCACCCAAAGGGCTTCCCAGGAGTAGGGTTGCCCTCAAGAGGCTCTTGGGTCTGATGGCCAC" + "ATCCTGGAATTGTTTTCAAGTTGATGGTCACAGCCCTGAGGCATGTAGGGGCGTGGGGATGCGCTCTGCTCTGCTCTCCT" + "CTCCTGAACCCCTGAACCCTCTGGCTACCCCAGAGCACTTAGAGCCAG"; assertEquals( expected, bs.getSequence() ); }
@Test public void testGetSingleAccNotFound() { if ( this.fastaCmdExecutableNotExists() ) { return; } SimpleFastaCmd fastaCmd = new SimpleFastaCmd(); BioSequence bs = fastaCmd.getByAccession( "FAKE.1", SimpleFastaCmdTest.TESTBLASTDB, testBlastDbPath ); assertNull( bs ); }